@astrato-io/visualizations 0.6.5 → 0.8.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.
Files changed (140) hide show
  1. package/README.md +8 -2
  2. package/THIRD_PARTY_NOTICES.md +2 -229
  3. package/VISUALIZATION_DEFINITIONS.md +68 -114
  4. package/chunks/Button-BrGKp9Nm.js +110 -0
  5. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  6. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  7. package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
  8. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  9. package/chunks/Title-CO5dP1ma.js +1691 -0
  10. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  11. package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
  12. package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
  13. package/chunks/builder-DEDvNq1k.js +201 -0
  14. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  15. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  16. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  17. package/chunks/coloring-CncX_JRX.js +278 -0
  18. package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
  19. package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
  20. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  21. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  22. package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
  23. package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
  24. package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
  25. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  26. package/chunks/isEqual-B8loyPsC.js +12 -0
  27. package/chunks/label-format-type-weq1XfcX.js +8 -0
  28. package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
  29. package/chunks/logger-DpQtYQnX.js +1163 -0
  30. package/chunks/lookup-BWllin0q.js +36 -0
  31. package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
  32. package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
  33. package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
  34. package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
  35. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  36. package/chunks/{registry-CsQQzukD.js → requirements-Dvd8jqYF.js} +218 -222
  37. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  38. package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
  39. package/chunks/src-77e3mC7i.js +391 -0
  40. package/chunks/standalone-B55oyW6c.js +689 -0
  41. package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
  42. package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
  43. package/chunks/standalone-BMTCb10X.js +179 -0
  44. package/chunks/standalone-BXKRE_Se.js +468 -0
  45. package/chunks/standalone-Bes8srx1.js +354 -0
  46. package/chunks/standalone-BjZp0QMe.js +2 -0
  47. package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
  48. package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
  49. package/chunks/standalone-C8qAelL4.js +2 -0
  50. package/chunks/standalone-CJvIXsQE.js +743 -0
  51. package/chunks/standalone-CLmGb7nn2.js +355 -0
  52. package/chunks/standalone-CM5XcAN5.js +52327 -0
  53. package/chunks/standalone-CXNP6-xD.js +420 -0
  54. package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
  55. package/chunks/standalone-DLlyRIE6.js +287 -0
  56. package/chunks/standalone-DMcI1afI.js +396 -0
  57. package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
  58. package/chunks/standalone-DT0wKji7.js +6 -0
  59. package/chunks/standalone-DW6NT205.js +518 -0
  60. package/chunks/standalone-DYQIQH4c.js +2095 -0
  61. package/chunks/standalone-D__XCp-h.js +1003 -0
  62. package/chunks/standalone-XTgSsTAa.js +354 -0
  63. package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
  64. package/chunks/{standalone-0M4HlmDW2.js → standalone-vBnBS2YC.js} +1047 -964
  65. package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
  66. package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
  67. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  68. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  69. package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
  70. package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
  71. package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
  72. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  73. package/definitions.js +2 -2
  74. package/docs/operations/astrato-app-filter-bar.md +1 -1
  75. package/docs/operations/bar.md +31 -14
  76. package/docs/operations/combo.md +1 -1
  77. package/docs/operations/date-picker.md +3 -3
  78. package/docs/operations/distribution-gauge.md +13 -13
  79. package/docs/operations/dot.md +13 -13
  80. package/docs/operations/filter.md +1 -1
  81. package/docs/operations/gauge.md +13 -13
  82. package/docs/operations/heatMap.md +13 -13
  83. package/docs/operations/histogram.md +1 -1
  84. package/docs/operations/iframe.md +1 -1
  85. package/docs/operations/image.md +1 -1
  86. package/docs/operations/index.md +3 -3
  87. package/docs/operations/line.md +7 -7
  88. package/docs/operations/number.md +1 -1
  89. package/docs/operations/pie.md +13 -13
  90. package/docs/operations/radar.md +7 -7
  91. package/docs/operations/sankey.md +13 -13
  92. package/docs/operations/scatter.md +13 -13
  93. package/docs/operations/shape.md +1 -1
  94. package/docs/operations/simpleTextObject.md +1 -1
  95. package/docs/operations/slider.md +1 -1
  96. package/docs/operations/table.md +18 -1
  97. package/docs/operations/tree.md +51 -37
  98. package/docs/operations/treemap.md +63 -49
  99. package/docs/operations/waterfall.md +1 -1
  100. package/docs/operations/word-cloud.md +13 -13
  101. package/getters.js +7 -7
  102. package/index.js +419 -417
  103. package/metadata.js +17 -18
  104. package/operations.js +13 -13
  105. package/package.json +70 -55
  106. package/src/definitions/index.d.ts +1 -1
  107. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
  108. package/src/definitions/model/definitions/index.d.ts +1 -1
  109. package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
  110. package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
  111. package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
  112. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  113. package/src/getters/index.d.ts +1 -1
  114. package/src/operations/index.d.ts +1 -1
  115. package/src/types.d.ts +1 -0
  116. package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
  117. package/chunks/builder-B6dWSIdD.js +0 -12289
  118. package/chunks/coloring-B1XAfg6b.js +0 -664
  119. package/chunks/events-WZut5Ow6.js +0 -4
  120. package/chunks/grouping-type-On4s9Thj.js +0 -3
  121. package/chunks/requirements-DYjZCFyf.js +0 -6
  122. package/chunks/standalone-0ashe9w1.js +0 -411
  123. package/chunks/standalone-B7jax8wa.js +0 -339
  124. package/chunks/standalone-BK0VYU-l.js +0 -463
  125. package/chunks/standalone-BZV5vOwA.js +0 -6
  126. package/chunks/standalone-BhDrWj4p.js +0 -1980
  127. package/chunks/standalone-BvaKdky9.js +0 -344
  128. package/chunks/standalone-BwtM31-f.js +0 -2
  129. package/chunks/standalone-CC1VUjO32.js +0 -299
  130. package/chunks/standalone-CoLrAxRV.js +0 -13198
  131. package/chunks/standalone-DCtRoTWg.js +0 -675
  132. package/chunks/standalone-DUDFTBqL.js +0 -833
  133. package/chunks/standalone-DhZkX9Td.js +0 -2
  134. package/chunks/standalone-DtLElfuM.js +0 -512
  135. package/chunks/standalone-G9Q4Uczu.js +0 -726
  136. package/chunks/standalone-_DeX21JJ.js +0 -383
  137. package/chunks/standalone-gFhKZh8m.js +0 -179
  138. package/chunks/standalone-tDNy-SFH.js +0 -281
  139. package/chunks/ui-DQWtv2iM.js +0 -63551
  140. package/chunks/useFieldName-BvdcoJRl.js +0 -7
@@ -1,25 +1,40 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Ai as t, Ea as n, Es as r, Hn as i, La as a, Mi as o, Si as s, Ta as c, fc as l, js as u, ki as d, n as f } from "./isEqual-BDxAhUo8.js";
3
- import { $t as p, B as m, Cn as h, Ei as g, Gn as _, Ir as v, M as y, N as b, Yi as x, Zi as S, _n as C, a as w, s as T, u as ee } from "./utils-Bg7K-t6K.js";
4
- import { Oi as te } from "./handlers-VTBfIZYZ.js";
5
- import { Ht as E, On as ne, S as re, mt as ie } from "./ui-DQWtv2iM.js";
6
- import { C as ae, E as oe, Gt as se, Ht as ce, Jt as D, O as le, T as ue, a as de, d as fe, f as pe, g as me, k as O, m as he, u as ge, v as _e, x as ve, y as ye } from "./escobar-eDjtGpkC.js";
7
- import { l as be, r as xe } from "./coloring-B1XAfg6b.js";
8
- import { f as Se, r as Ce, t as we, u as Te, y as Ee } from "./src-D9XogOrc.js";
9
- import { a as De, i as Oe, r as ke, t as Ae } from "./accessors-DemrDevR.js";
10
- import { r as je, t as Me } from "./src-BOS6SqkZ.js";
11
- var k = /* @__PURE__ */ e(x()), Ne = ({ vTheme: e, vSpec: n, id: r, layout: i }) => {
12
- let a = e?.fonts?.general.fontFamily ?? "Roboto", s = {
13
- ...d,
14
- ...n.treeChartSettings?.nodeLayout?.border
2
+ import { Hi as t, Kr as n, Ui as r, Us as i, Wi as a, Wo as o, Yo as s, Yr as c, fn as l, qr as u, ta as d, xs as f, zr as p } from "./visualization-filters-Cc4KU-l-.js";
3
+ import { Ei as m, M as h, Rn as g, Xt as _, a as v, bn as y, j as b, mn as x, ri as S, s as C, u as ee, xr as w, z as te } from "./utils-vdmi_2PK.js";
4
+ import { Oi as ne } from "./handlers-TOT-7INo.js";
5
+ import { n as T } from "./isEqual-B8loyPsC.js";
6
+ import { s as re } from "./logger-DpQtYQnX.js";
7
+ import { A as E, C as ie, D as ae, M as oe, N as se, S as ce, T as le, Xt as ue, a as de, b as fe, g as pe, h as me, in as D, k as he, m as ge, qt as _e, v as ve } from "./escobar-DRhRMYRE.js";
8
+ import { M as ye, _ as be } from "./MenuOption-ByRqhRdX.js";
9
+ import { t as xe } from "./ToggleButton-KOBAimC1.js";
10
+ import "./coloring-CncX_JRX.js";
11
+ import { s as Se, t as Ce } from "./src-77e3mC7i.js";
12
+ import { f as we, r as Te, t as Ee, u as De, y as Oe } from "./src-D9XogOrc.js";
13
+ import { t as ke } from "./builder-DEDvNq1k.js";
14
+ import { a as Ae, i as je, r as Me, t as Ne } from "./accessors-DemrDevR.js";
15
+ import { r as Pe, t as Fe } from "./src-BOS6SqkZ.js";
16
+ var O = S(), Ie = ({ fillColor: e = t.grey2 }) => /* @__PURE__ */ (0, O.jsx)("svg", {
17
+ width: "16",
18
+ height: "16",
19
+ viewBox: "0 0 24 24",
20
+ fill: "none",
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ children: /* @__PURE__ */ (0, O.jsx)("path", {
23
+ d: "M3 17.46V20.5C3 20.78 3.22 21 3.5 21H6.54C6.67 21 6.8 20.95 6.89 20.85L17.81 9.94L14.06 6.19L3.15 17.1C3.05 17.2 3 17.32 3 17.46ZM20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C17.98 2.9 17.35 2.9 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04Z",
24
+ fill: e
25
+ })
26
+ }), k = /* @__PURE__ */ e(m()), Le = ({ vTheme: e, vSpec: r, id: i, layout: a }) => {
27
+ let o = e?.fonts?.general.fontFamily ?? "Roboto", s = {
28
+ ...n,
29
+ ...r.treeChartSettings?.nodeLayout?.border
15
30
  };
16
31
  s.enabled === !1 && (s.borderWidth = 0);
17
32
  let l = {
18
- ...t,
19
- ...n.treeChartSettings?.nodeLayout.hoverStyle
20
- }, u = n.treeChartSettings?.nodeLayout?.backgroundColor ?? o.backgroundColor, f = new ie(u).isLight() ? c.grey1 : c.grey5;
33
+ ...u,
34
+ ...r.treeChartSettings?.nodeLayout.hoverStyle
35
+ }, d = r.treeChartSettings?.nodeLayout?.backgroundColor ?? c.backgroundColor, f = new be(d).isLight() ? t.grey1 : t.grey5;
21
36
  return `
22
- #${r} {
37
+ #${i} {
23
38
  &[data-mode="view"] .tree-toolbar {
24
39
  display: none;
25
40
  }
@@ -27,19 +42,19 @@ var k = /* @__PURE__ */ e(x()), Ne = ({ vTheme: e, vSpec: n, id: r, layout: i })
27
42
  display: flex;
28
43
  }
29
44
 
30
- --link-color: ${c.grey3};
45
+ --link-color: ${t.grey3};
31
46
 
32
47
  --border-color: ${s.borderColor};
33
48
  --border-width: ${s.borderWidth}px;
34
- --border-color-edit: ${c.secondaryPurple};
49
+ --border-color-edit: ${t.secondaryPurple};
35
50
  --border-radius: ${s.borderRadius}px;
36
- --border-color-selected: ${c.grey2};
51
+ --border-color-selected: ${t.grey2};
37
52
 
38
53
  --border-hover-width: ${l.borderWidth}px;
39
54
  --border-hover-color: ${l.borderColor || s.borderColor};
40
55
 
41
- --node-background: ${u};
42
- --node-background-highlight: ${c.grey2};
56
+ --node-background: ${d};
57
+ --node-background-highlight: ${t.grey2};
43
58
  --font-color: ${f};
44
59
 
45
60
  .links-wrapper path {
@@ -73,7 +88,7 @@ var k = /* @__PURE__ */ e(x()), Ne = ({ vTheme: e, vSpec: n, id: r, layout: i })
73
88
  background-color: var(--node-background);
74
89
  }
75
90
  &:hover .button-content {
76
- background-color: ${c.grey5};
91
+ background-color: ${t.grey5};
77
92
  }
78
93
  }
79
94
 
@@ -91,7 +106,7 @@ var k = /* @__PURE__ */ e(x()), Ne = ({ vTheme: e, vSpec: n, id: r, layout: i })
91
106
  .node-content {
92
107
  color: var(--font-color);
93
108
  font-size: 12px;
94
- font-family: ${a}, sans-serif;
109
+ font-family: ${o}, sans-serif;
95
110
  width: 100%;
96
111
  height: 100%;
97
112
  border: var(--border-width) solid var(--border-color);
@@ -129,7 +144,7 @@ var k = /* @__PURE__ */ e(x()), Ne = ({ vTheme: e, vSpec: n, id: r, layout: i })
129
144
  }
130
145
 
131
146
  .dragging-active .drop-target .node-content::after {
132
- background-color: ${c.feedbackBlue};
147
+ background-color: ${t.feedbackBlue};
133
148
  opacity: 1;
134
149
  }
135
150
 
@@ -148,7 +163,7 @@ var k = /* @__PURE__ */ e(x()), Ne = ({ vTheme: e, vSpec: n, id: r, layout: i })
148
163
  width: 100%;
149
164
  height: 100%;
150
165
  border-radius: var(--border-radius);
151
- background-color: ${c.grey2};
166
+ background-color: ${t.grey2};
152
167
  opacity: 0.2;
153
168
  }
154
169
  .node-excluded .node-foreign-object-div {
@@ -156,27 +171,27 @@ var k = /* @__PURE__ */ e(x()), Ne = ({ vTheme: e, vSpec: n, id: r, layout: i })
156
171
  }
157
172
  }
158
173
 
159
- ${i.getCSS(r, n)}`;
160
- }, Pe = { depth: -1 }, Fe = {}, Ie = {};
161
- function Le(e) {
174
+ ${a.getCSS(i, r)}`;
175
+ }, Re = { depth: -1 }, ze = {}, Be = {};
176
+ function Ve(e) {
162
177
  return e.id;
163
178
  }
164
- function Re(e) {
179
+ function He(e) {
165
180
  return e.parentId;
166
181
  }
167
- function ze() {
168
- var e = Le, t = Re, n;
182
+ function Ue() {
183
+ var e = Ve, t = He, n;
169
184
  function r(r) {
170
185
  var i = Array.from(r), a = e, o = t, s, c, l, u, d, f, p, m, h = /* @__PURE__ */ new Map();
171
186
  if (n != null) {
172
- let e = i.map((e, t) => Be(n(e, t, r))), t = e.map(Ve), s = new Set(e).add("");
173
- for (let n of t) s.has(n) || (s.add(n), e.push(n), t.push(Ve(n)), i.push(Ie));
187
+ let e = i.map((e, t) => We(n(e, t, r))), t = e.map(Ge), s = new Set(e).add("");
188
+ for (let n of t) s.has(n) || (s.add(n), e.push(n), t.push(Ge(n)), i.push(Be));
174
189
  a = (t, n) => e[n], o = (e, n) => t[n];
175
190
  }
176
- for (l = 0, s = i.length; l < s; ++l) c = i[l], f = i[l] = new ke(c), (p = a(c, l, r)) != null && (p += "") && (m = f.id = p, h.set(m, h.has(m) ? Fe : f)), (p = o(c, l, r)) != null && (p += "") && (f.parent = p);
191
+ for (l = 0, s = i.length; l < s; ++l) c = i[l], f = i[l] = new Me(c), (p = a(c, l, r)) != null && (p += "") && (m = f.id = p, h.set(m, h.has(m) ? ze : f)), (p = o(c, l, r)) != null && (p += "") && (f.parent = p);
177
192
  for (l = 0; l < s; ++l) if (f = i[l], p = f.parent) {
178
193
  if (d = h.get(p), !d) throw Error("missing: " + p);
179
- if (d === Fe) throw Error("ambiguous: " + p);
194
+ if (d === ze) throw Error("ambiguous: " + p);
180
195
  d.children ? d.children.push(f) : d.children = [f], f.parent = d;
181
196
  } else {
182
197
  if (u) throw Error("multiple roots");
@@ -184,34 +199,34 @@ function ze() {
184
199
  }
185
200
  if (!u) throw Error("no root");
186
201
  if (n != null) {
187
- for (; u.data === Ie && u.children.length === 1;) u = u.children[0], --s;
188
- for (let e = i.length - 1; e >= 0 && (f = i[e], f.data === Ie); --e) f.data = null;
202
+ for (; u.data === Be && u.children.length === 1;) u = u.children[0], --s;
203
+ for (let e = i.length - 1; e >= 0 && (f = i[e], f.data === Be); --e) f.data = null;
189
204
  }
190
- if (u.parent = Pe, u.eachBefore(function(e) {
205
+ if (u.parent = Re, u.eachBefore(function(e) {
191
206
  e.depth = e.parent.depth + 1, --s;
192
- }).eachBefore(Oe), u.parent = null, s > 0) throw Error("cycle");
207
+ }).eachBefore(je), u.parent = null, s > 0) throw Error("cycle");
193
208
  return u;
194
209
  }
195
210
  return r.id = function(t) {
196
- return arguments.length ? (e = Ae(t), r) : e;
211
+ return arguments.length ? (e = Ne(t), r) : e;
197
212
  }, r.parentId = function(e) {
198
- return arguments.length ? (t = Ae(e), r) : t;
213
+ return arguments.length ? (t = Ne(e), r) : t;
199
214
  }, r.path = function(e) {
200
- return arguments.length ? (n = Ae(e), r) : n;
215
+ return arguments.length ? (n = Ne(e), r) : n;
201
216
  }, r;
202
217
  }
203
- function Be(e) {
218
+ function We(e) {
204
219
  e = `${e}`;
205
220
  let t = e.length;
206
- return He(e, t - 1) && !He(e, t - 2) && (e = e.slice(0, -1)), e[0] === "/" ? e : `/${e}`;
221
+ return Ke(e, t - 1) && !Ke(e, t - 2) && (e = e.slice(0, -1)), e[0] === "/" ? e : `/${e}`;
207
222
  }
208
- function Ve(e) {
223
+ function Ge(e) {
209
224
  let t = e.length;
210
225
  if (t < 2) return "";
211
- for (; --t > 1 && !He(e, t););
226
+ for (; --t > 1 && !Ke(e, t););
212
227
  return e.slice(0, t);
213
228
  }
214
- function He(e, t) {
229
+ function Ke(e, t) {
215
230
  if (e[t] === "/") {
216
231
  let n = 0;
217
232
  for (; t > 0 && e[--t] === "\\";) ++n;
@@ -219,39 +234,39 @@ function He(e, t) {
219
234
  }
220
235
  return !1;
221
236
  }
222
- function Ue(e, t) {
237
+ function qe(e, t) {
223
238
  return e.parent === t.parent ? 1 : 2;
224
239
  }
225
- function We(e) {
240
+ function Je(e) {
226
241
  var t = e.children;
227
242
  return t ? t[0] : e.t;
228
243
  }
229
- function Ge(e) {
244
+ function Ye(e) {
230
245
  var t = e.children;
231
246
  return t ? t[t.length - 1] : e.t;
232
247
  }
233
- function Ke(e, t, n) {
248
+ function Xe(e, t, n) {
234
249
  var r = n / (t.i - e.i);
235
250
  t.c -= r, t.s += n, e.c += r, t.z += n, t.m += n;
236
251
  }
237
- function qe(e) {
252
+ function Ze(e) {
238
253
  for (var t = 0, n = 0, r = e.children, i = r.length, a; --i >= 0;) a = r[i], a.z += t, a.m += t, t += a.s + (n += a.c);
239
254
  }
240
- function Je(e, t, n) {
255
+ function Qe(e, t, n) {
241
256
  return e.a.parent === t.parent ? e.a : n;
242
257
  }
243
- function Ye(e, t) {
258
+ function $e(e, t) {
244
259
  this._ = e, this.parent = null, this.children = null, this.A = null, this.a = this, this.z = 0, this.m = 0, this.c = 0, this.s = 0, this.t = null, this.i = t;
245
260
  }
246
- Ye.prototype = Object.create(ke.prototype);
247
- function Xe(e) {
248
- for (var t = new Ye(e, 0), n, r = [t], i, a, o, s; n = r.pop();) if (a = n._.children) for (n.children = Array(s = a.length), o = s - 1; o >= 0; --o) r.push(i = n.children[o] = new Ye(a[o], o)), i.parent = n;
249
- return (t.parent = new Ye(null, 0)).children = [t], t;
261
+ $e.prototype = Object.create(Me.prototype);
262
+ function et(e) {
263
+ for (var t = new $e(e, 0), n, r = [t], i, a, o, s; n = r.pop();) if (a = n._.children) for (n.children = Array(s = a.length), o = s - 1; o >= 0; --o) r.push(i = n.children[o] = new $e(a[o], o)), i.parent = n;
264
+ return (t.parent = new $e(null, 0)).children = [t], t;
250
265
  }
251
- function Ze() {
252
- var e = Ue, t = 1, n = 1, r = null;
266
+ function tt() {
267
+ var e = qe, t = 1, n = 1, r = null;
253
268
  function i(i) {
254
- var s = Xe(i);
269
+ var s = et(i);
255
270
  if (s.eachAfter(a), s.parent.m = -s.z, s.eachBefore(o), r) i.eachBefore(c);
256
271
  else {
257
272
  var l = i, u = i, d = i;
@@ -268,7 +283,7 @@ function Ze() {
268
283
  function a(t) {
269
284
  var n = t.children, r = t.parent.children, i = t.i ? r[t.i - 1] : null;
270
285
  if (n) {
271
- qe(t);
286
+ Ze(t);
272
287
  var a = (n[0].z + n[n.length - 1].z) / 2;
273
288
  i ? (t.z = i.z + e(t._, i._), t.m = t.z - a) : t.z = a;
274
289
  } else i && (t.z = i.z + e(t._, i._));
@@ -279,8 +294,8 @@ function Ze() {
279
294
  }
280
295
  function s(t, n, r) {
281
296
  if (n) {
282
- for (var i = t, a = t, o = n, s = i.parent.children[0], c = i.m, l = a.m, u = o.m, d = s.m, f; o = Ge(o), i = We(i), o && i;) s = We(s), a = Ge(a), a.a = t, f = o.z + u - i.z - c + e(o._, i._), f > 0 && (Ke(Je(o, t, r), t, f), c += f, l += f), u += o.m, c += i.m, d += s.m, l += a.m;
283
- o && !Ge(a) && (a.t = o, a.m += u - l), i && !We(s) && (s.t = i, s.m += c - d, r = t);
297
+ for (var i = t, a = t, o = n, s = i.parent.children[0], c = i.m, l = a.m, u = o.m, d = s.m, f; o = Ye(o), i = Je(i), o && i;) s = Je(s), a = Ye(a), a.a = t, f = o.z + u - i.z - c + e(o._, i._), f > 0 && (Xe(Qe(o, t, r), t, f), c += f, l += f), u += o.m, c += i.m, d += s.m, l += a.m;
298
+ o && !Ye(a) && (a.t = o, a.m += u - l), i && !Je(s) && (s.t = i, s.m += c - d, r = t);
284
299
  }
285
300
  return r;
286
301
  }
@@ -295,14 +310,14 @@ function Ze() {
295
310
  return arguments.length ? (r = !0, t = +e[0], n = +e[1], i) : r ? [t, n] : null;
296
311
  }, i;
297
312
  }
298
- var A = "__root__", Qe = "__total__", $e = (e) => `__dimension__${JSON.stringify(e)}`, et = (e, t) => {
313
+ var A = "__root__", nt = "__total__", rt = (e) => `__dimension__${JSON.stringify(e)}`, it = (e, t) => {
299
314
  let n = e[t];
300
315
  return n == null ? ["nil"] : [
301
316
  "value",
302
317
  typeof n,
303
318
  n
304
319
  ];
305
- }, tt = (e, t) => {
320
+ }, at = (e, t) => {
306
321
  if (t?.indicator !== "custom") return;
307
322
  let n = t?.indicatorThreshold;
308
323
  if (!n || e == null) return {
@@ -328,34 +343,34 @@ var A = "__root__", Qe = "__total__", $e = (e) => `__dimension__${JSON.stringify
328
343
  color: null,
329
344
  icon: void 0
330
345
  };
331
- }, nt = (e, t, n, r) => {
332
- let i = {};
346
+ }, ot = (e, t, n, r) => {
347
+ let a = {};
333
348
  return e.slots?.forEach((n) => {
334
349
  if (n.key === "main") return;
335
- let a = {
350
+ let o = {
336
351
  enabled: n.enabled === !0,
337
352
  label: "-",
338
353
  value: null,
339
354
  indicator: n.indicator ?? null
340
355
  };
341
- if (a.enabled) {
342
- let i = e.formatter;
356
+ if (o.enabled) {
357
+ let a = e.formatter;
343
358
  if (n.source === "field") {
344
- let o = r?.find((t) => t.parentId === e.dataItem.uniqueSignature && t.role === `tree-${n.key}`);
345
- if (o) {
346
- let e = l(o.dataItem);
347
- o.formatter && (i = o.formatter), e && (a.value = t?.[e], a.label = a.value === null ? "-" : C(i?.format, a.value) ?? "-");
359
+ let s = r?.find((t) => t.parentId === e.dataItem.uniqueSignature && t.role === `tree-${n.key}`);
360
+ if (s) {
361
+ let e = i(s.dataItem);
362
+ s.formatter && (a = s.formatter), e && (o.value = t?.[e], o.label = o.value === null ? "-" : x(a?.format, o.value) ?? "-");
348
363
  }
349
- } else n.source === "variable" && (a.value = n.propertyValue, a.label = a.value === null ? "-" : C(i?.format, a.value) ?? "-");
350
- a.customIndicator = tt(a.value, n);
364
+ } else n.source === "variable" && (o.value = n.propertyValue, o.label = o.value === null ? "-" : x(a?.format, o.value) ?? "-");
365
+ o.customIndicator = at(o.value, n);
351
366
  }
352
- i[n.key] = { ...a };
353
- }), i;
354
- }, rt = (e, t, n, r = !1) => {
367
+ a[n.key] = { ...o };
368
+ }), a;
369
+ }, st = (e, t, n, r = !1) => {
355
370
  if (n === 0 || e.data.id === "__total__") return !0;
356
371
  let i = t ?? 2;
357
372
  return e.depth - +!!r < i;
358
- }, it = (e, t, n) => {
373
+ }, ct = (e, t, n) => {
359
374
  let r = [{
360
375
  id: A,
361
376
  parentId: null,
@@ -364,29 +379,29 @@ var A = "__root__", Qe = "__total__", $e = (e) => `__dimension__${JSON.stringify
364
379
  e.measures.forEach((e) => {
365
380
  a.add(e.dataItem.uniqueSignature);
366
381
  });
367
- let o = e.measures.filter((e) => s(e));
382
+ let o = e.measures.filter((e) => p(e));
368
383
  e.measures.forEach((e) => {
369
384
  let t = e.dataItem.uniqueSignature, n = e.parentId && a.has(e.parentId) ? e.parentId : A;
370
385
  r.push({
371
386
  id: t,
372
387
  parentId: n,
373
- disabled: !s(e)
388
+ disabled: !p(e)
374
389
  });
375
390
  });
376
- let c = ze().id((e) => e.id).parentId((e) => e.parentId)(r), u = [];
377
- c.descendants().forEach((e) => {
391
+ let s = Ue().id((e) => e.id).parentId((e) => e.parentId)(r), c = [];
392
+ s.descendants().forEach((e) => {
378
393
  if (e.data.disabled) return;
379
394
  let t = e.ancestors().slice(1).find((e) => !e.data.disabled);
380
- t ? u.push({
395
+ t ? c.push({
381
396
  id: e.data.id,
382
397
  parentId: t.data.id
383
- }) : u.push({
398
+ }) : c.push({
384
399
  id: e.data.id,
385
400
  parentId: null
386
401
  });
387
402
  });
388
- let d = u.map((n) => {
389
- if (n.id === "__root__") return {
403
+ let u = c.flatMap((n) => {
404
+ if (n.id === "__root__") return [{
390
405
  id: n.id,
391
406
  parentId: null,
392
407
  label: "Dummy Root",
@@ -394,126 +409,128 @@ var A = "__root__", Qe = "__total__", $e = (e) => `__dimension__${JSON.stringify
394
409
  label: "-",
395
410
  value: null
396
411
  }
397
- };
398
- let r = o.find((e) => e.dataItem.uniqueSignature === n.id), a = l(r.dataItem), s = t[0].items?.[0], c = r ? nt(r, s, o, e.supportingMeasures) : {}, u = s?.[a], d = r?.slots?.find((e) => e.key === "main");
399
- return {
412
+ }];
413
+ let r = o.find((e) => e.dataItem.uniqueSignature === n.id);
414
+ if (!r) return [];
415
+ let a = i(r.dataItem), s = t[0].items?.[0], c = r ? ot(r, s, o, e.supportingMeasures) : {}, u = s?.[a], d = r?.slots?.find((e) => e.key === "main");
416
+ return [{
400
417
  id: n.id,
401
418
  parentId: n.parentId,
402
- label: i(r),
419
+ label: l(r),
403
420
  value: {
404
- label: C(r.formatter?.format, t[0].items?.[0]?.[a]) ?? "-",
421
+ label: x(r.formatter?.format, t[0].items?.[0]?.[a]) ?? "-",
405
422
  value: u
406
423
  },
407
424
  indicator: d?.indicator ?? null,
408
- customIndicator: tt(u, d),
425
+ customIndicator: at(u, d),
409
426
  brush: {
410
- key: [se.sourceKey, se.field].join("/"),
411
- value: ce(r)
427
+ key: [ue.sourceKey, ue.field].join("/"),
428
+ value: _e(r)
412
429
  },
413
430
  ...c
414
- };
415
- }), f = ze().id((e) => e.id).parentId((e) => e.parentId)(d), p = o.map((e) => e.dataItem.uniqueSignature);
416
- return f.sort((e, t) => p.indexOf(e.data.id) - p.indexOf(t.data.id)), f.descendants().forEach((e) => {
431
+ }];
432
+ }), d = Ue().id((e) => e.id).parentId((e) => e.parentId)(u), f = o.map((e) => e.dataItem.uniqueSignature);
433
+ return d.sort((e, t) => f.indexOf(e.data.id) - f.indexOf(t.data.id)), d.descendants().forEach((e) => {
417
434
  let t = !1;
418
- t = e.data.id in n ? n[e.data.id] === !1 : e.data.expanded?.enabled ? e.data.expanded.value === !1 : !1, t && (e._children = e.children, e.children = null);
419
- }), f;
420
- }, at = (e, t, n) => {
435
+ t = e.data.id in n ? n[e.data.id] === !1 : e.data.expanded?.enabled ? e.data.expanded.value === !1 : !1, t && (e._children = e.children, e.children = void 0);
436
+ }), d;
437
+ }, lt = (e, t, n) => {
421
438
  if (t.itemsNotAffectedByFiltering?.pattern?.length && e.staticFilters.ignoreGlobalFilters && e.staticFilters.showGlobalFiltersEffect) {
422
439
  let e = [0, ...t.itemsNotAffectedByFiltering.pattern.map((e) => n[e]).filter((e) => e !== null)].join("-");
423
440
  return !t.itemsNotAffectedByFiltering.itemsMap?.[e];
424
441
  }
425
442
  return !1;
426
- }, ot = (e, t, n, r, i, a) => {
427
- let { id: o, parentId: s, prop: c, measureProp: l, dataItemIdx: u, engineKey: d } = a, f = n?.slots?.find((e) => e.key === "main"), p = i && n ? nt(n, r, [n], e.supportingMeasures) : {};
443
+ }, ut = (e, t, n, r, i, a) => {
444
+ let { id: o, parentId: s, prop: c, measureProp: l, dataItemIdx: u, engineKey: d } = a, f = n?.slots?.find((e) => e.key === "main"), p = i && n ? ot(n, r, [n], e.supportingMeasures) : {};
428
445
  return {
429
446
  id: o,
430
447
  parentId: s,
431
448
  label: String(r[c]),
432
449
  row: +u,
433
- value: i ? {
434
- label: C(n.formatter?.format, r[l]) ?? "-",
450
+ value: i && n && l ? {
451
+ label: x(n.formatter?.format, r[l]) ?? "-",
435
452
  value: r[l]
436
453
  } : null,
437
454
  indicator: f?.indicator ?? null,
438
- customIndicator: tt(r[l], f),
455
+ customIndicator: at(l ? r[l] : null, f),
439
456
  brush: {
440
457
  key: d,
441
458
  value: r[c]
442
459
  },
443
- _excluded: at(e, t, r),
460
+ _excluded: lt(e, t, r),
444
461
  ...p
445
462
  };
446
463
  };
447
- function st(e, t, n) {
448
- let i = t[0], a = e.dimensions.filter((e) => s(e)), o = {}, c = a.map((t) => [l(t.dataItem), r(e.referencedData, t.dataItem.internalKey)]), u = e.measures.filter((e) => s(e))[0], d = u ? l(u.dataItem) : null, f = e.totals?.enabled ?? !1, p = u?.slots?.find((e) => e.key === "main"), m, h, g = /* @__PURE__ */ new Set(), _ = i.groupings ? Object.keys(i.groupings) : void 0;
449
- _ && _.forEach((t) => {
450
- let n = i.groupings[t], r = i.items[+t], a = c.filter(([e]) => n[e] === 0);
464
+ function dt(e, t, n) {
465
+ let r = t[0], a = e.dimensions.filter((e) => p(e)), s = {}, c = a.map((t) => [i(t.dataItem), o(e.referencedData, t.dataItem.internalKey) ?? i(t.dataItem)]), l = e.measures.filter((e) => p(e))[0], u = l ? i(l.dataItem) : null, d = e.totals?.enabled ?? !1, f = l?.slots?.find((e) => e.key === "main"), m, h, g = /* @__PURE__ */ new Set(), _ = r.groupings, v = _ ? Object.keys(_) : void 0;
466
+ _ && v && v.forEach((t) => {
467
+ let n = _[t], i = r.items[+t], a = c.filter(([e]) => n[e] === 0);
451
468
  if (!a.length) {
452
- m = d ? r[d] : void 0, h = r;
469
+ m = u ? i[u] : void 0, h = i;
453
470
  return;
454
471
  }
455
- let [s, l] = a.length ? a[a.length - 1] : ["", ""], p = $e(a.map((e) => et(r, e[0]))), _ = a.slice(0, -1), v = _.length ? $e(_.map((e) => et(r, e[0]))) : f ? Qe : A;
456
- a.length < c.length && g.add(p), o[p] || (o[p] = ot(e, i, u, r, !!u, {
457
- engineKey: l,
472
+ let [o, f] = a.length ? a[a.length - 1] : ["", ""], p = rt(a.map((e) => it(i, e[0]))), v = a.slice(0, -1), y = v.length ? rt(v.map((e) => it(i, e[0]))) : d ? nt : A;
473
+ a.length < c.length && g.add(p), s[p] || (s[p] = ut(e, r, l, i, !!l, {
474
+ engineKey: f,
458
475
  id: p,
459
- parentId: v,
460
- measureProp: d,
461
- prop: s,
476
+ parentId: y,
477
+ measureProp: u,
478
+ prop: o,
462
479
  dataItemIdx: +t
463
480
  }));
464
- }), i.items.forEach((t, n) => {
465
- _?.includes(String(n)) || c.forEach(([r, a], s, c) => {
466
- if (t[r] === void 0) {
467
- console.warn(`Dimension property ${r} is missing in data item at index ${n}, skipping this dimension for this item`);
481
+ }), r.items.forEach((t, n) => {
482
+ v?.includes(String(n)) || c.forEach(([i, a], o, c) => {
483
+ if (t[i] === void 0) {
484
+ console.warn(`Dimension property ${i} is missing in data item at index ${n}, skipping this dimension for this item`);
468
485
  return;
469
486
  }
470
- let l = $e(c.slice(0, s + 1).map((e) => et(t, e[0]))), p = s === 0 ? f ? Qe : A : $e(c.slice(0, s).map((e) => et(t, e[0])));
471
- o[l] || (o[l] = ot(e, i, u, t, s === c.length - 1 && !!u, {
487
+ let f = rt(c.slice(0, o + 1).map((e) => it(t, e[0]))), p = o === 0 ? d ? nt : A : rt(c.slice(0, o).map((e) => it(t, e[0])));
488
+ s[f] || (s[f] = ut(e, r, l, t, o === c.length - 1 && !!l, {
472
489
  engineKey: a,
473
490
  dataItemIdx: n,
474
- id: l,
491
+ id: f,
475
492
  parentId: p,
476
- measureProp: d,
477
- prop: r
493
+ measureProp: u,
494
+ prop: i
478
495
  }));
479
496
  });
480
497
  });
481
- let v = m ?? Object.values(o).reduce((e, t) => e + (g.has(t.id) ? 0 : t.value?.value ?? 0), 0), y = h ?? i.totals, b = Object.values(o);
482
- f && b.unshift({
483
- id: Qe,
498
+ let y = m ?? Object.values(s).reduce((e, t) => e + (g.has(t.id) ? 0 : t.value?.value ?? 0), 0), b = h ?? r.totals, S = Object.values(s);
499
+ d && S.unshift({
500
+ id: nt,
484
501
  parentId: A,
485
502
  label: "Total",
486
503
  row: -1,
487
- value: u ? {
488
- label: C(u.formatter?.format, v) ?? "-",
489
- value: v
504
+ value: l ? {
505
+ label: x(l.formatter?.format, y) ?? "-",
506
+ value: y
490
507
  } : null,
491
- indicator: p?.indicator ?? null,
492
- customIndicator: tt(v, p),
493
- ...u ? nt(u, y, [u], e.supportingMeasures) : {}
494
- }), b.unshift({
508
+ indicator: f?.indicator ?? null,
509
+ customIndicator: at(y, f),
510
+ ...l ? ot(l, b, [l], e.supportingMeasures) : {}
511
+ }), S.unshift({
495
512
  id: A,
496
513
  parentId: null,
497
514
  label: "Dummy Root",
498
515
  row: -1,
499
516
  value: null
500
517
  });
501
- let x = ze().id((e) => e.id).parentId((e) => e.parentId)(b);
502
- return x.sort((e, t) => e.data.row - t.data.row), x.descendants().forEach((t) => {
518
+ let C = Ue().id((e) => e.id).parentId((e) => e.parentId)(S);
519
+ return C.sort((e, t) => (e.data.row ?? 0) - (t.data.row ?? 0)), C.descendants().forEach((t) => {
503
520
  if (t.data.id === "__total__") return;
504
521
  let r = !1;
505
- r = t.data.id in n ? n[t.data.id] === !1 : !rt(t, e.treeChartSettings?.initialExpandedLevels, a.length, f), r && (t._children = t.children, t.children = null);
506
- }), x;
522
+ r = t.data.id in n ? n[t.data.id] === !1 : !st(t, e.treeChartSettings?.initialExpandedLevels, a.length, d), r && (t._children = t.children, t.children = void 0);
523
+ }), C;
507
524
  }
508
- var ct = ({ vSpec: e, data: t, nodeExpandState: n }) => {
509
- let r = e.dimensions.filter(s).length, [i, a] = (0, k.useState)(null);
525
+ var ft = ({ vSpec: e, data: t, nodeExpandState: n }) => {
526
+ let r = e.dimensions.filter(p).length, [i, a] = (0, k.useState)(null);
510
527
  return (0, k.useEffect)(() => {
511
528
  if (r > 0) {
512
- let r = st(e, t, n.current);
529
+ let r = dt(e, t, n.current);
513
530
  a(r);
514
531
  return;
515
532
  }
516
- let i = it(e, t, n.current);
533
+ let i = ct(e, t, n.current);
517
534
  a(i);
518
535
  }, [
519
536
  t,
@@ -523,117 +540,117 @@ var ct = ({ vSpec: e, data: t, nodeExpandState: n }) => {
523
540
  e.treeChartSettings?.nodeExpandState,
524
541
  e.totals?.enabled
525
542
  ]), i;
526
- }, lt = {
543
+ }, pt = {
527
544
  svg: "http://www.w3.org/2000/svg",
528
545
  xhtml: "http://www.w3.org/1999/xhtml",
529
546
  xlink: "http://www.w3.org/1999/xlink",
530
547
  xml: "http://www.w3.org/XML/1998/namespace",
531
548
  xmlns: "http://www.w3.org/2000/xmlns/"
532
549
  };
533
- function ut(e) {
550
+ function mt(e) {
534
551
  var t = e += "", n = t.indexOf(":");
535
- return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), lt.hasOwnProperty(t) ? {
536
- space: lt[t],
552
+ return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), pt.hasOwnProperty(t) ? {
553
+ space: pt[t],
537
554
  local: e
538
555
  } : e;
539
556
  }
540
- function dt(e) {
557
+ function ht(e) {
541
558
  return function() {
542
559
  var t = this.ownerDocument, n = this.namespaceURI;
543
560
  return n === "http://www.w3.org/1999/xhtml" && t.documentElement.namespaceURI === "http://www.w3.org/1999/xhtml" ? t.createElement(e) : t.createElementNS(n, e);
544
561
  };
545
562
  }
546
- function ft(e) {
563
+ function gt(e) {
547
564
  return function() {
548
565
  return this.ownerDocument.createElementNS(e.space, e.local);
549
566
  };
550
567
  }
551
- function pt(e) {
552
- var t = ut(e);
553
- return (t.local ? ft : dt)(t);
568
+ function _t(e) {
569
+ var t = mt(e);
570
+ return (t.local ? gt : ht)(t);
554
571
  }
555
- function mt() {}
556
- function ht(e) {
557
- return e == null ? mt : function() {
572
+ function vt() {}
573
+ function yt(e) {
574
+ return e == null ? vt : function() {
558
575
  return this.querySelector(e);
559
576
  };
560
577
  }
561
- function gt(e) {
562
- typeof e != "function" && (e = ht(e));
578
+ function bt(e) {
579
+ typeof e != "function" && (e = yt(e));
563
580
  for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = Array(o), c, l, u = 0; u < o; ++u) (c = a[u]) && (l = e.call(c, c.__data__, u, a)) && ("__data__" in c && (l.__data__ = c.__data__), s[u] = l);
564
581
  return new M(r, this._parents);
565
582
  }
566
- function _t(e) {
583
+ function xt(e) {
567
584
  return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
568
585
  }
569
- function vt() {
586
+ function St() {
570
587
  return [];
571
588
  }
572
- function yt(e) {
573
- return e == null ? vt : function() {
589
+ function Ct(e) {
590
+ return e == null ? St : function() {
574
591
  return this.querySelectorAll(e);
575
592
  };
576
593
  }
577
- function bt(e) {
594
+ function wt(e) {
578
595
  return function() {
579
- return _t(e.apply(this, arguments));
596
+ return xt(e.apply(this, arguments));
580
597
  };
581
598
  }
582
- function xt(e) {
583
- e = typeof e == "function" ? bt(e) : yt(e);
599
+ function Tt(e) {
600
+ e = typeof e == "function" ? wt(e) : Ct(e);
584
601
  for (var t = this._groups, n = t.length, r = [], i = [], a = 0; a < n; ++a) for (var o = t[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && (r.push(e.call(c, c.__data__, l, o)), i.push(c));
585
602
  return new M(r, i);
586
603
  }
587
- function St(e) {
604
+ function Et(e) {
588
605
  return function() {
589
606
  return this.matches(e);
590
607
  };
591
608
  }
592
- function Ct(e) {
609
+ function Dt(e) {
593
610
  return function(t) {
594
611
  return t.matches(e);
595
612
  };
596
613
  }
597
- var wt = Array.prototype.find;
598
- function Tt(e) {
614
+ var Ot = Array.prototype.find;
615
+ function kt(e) {
599
616
  return function() {
600
- return wt.call(this.children, e);
617
+ return Ot.call(this.children, e);
601
618
  };
602
619
  }
603
- function Et() {
620
+ function At() {
604
621
  return this.firstElementChild;
605
622
  }
606
- function Dt(e) {
607
- return this.select(e == null ? Et : Tt(typeof e == "function" ? e : Ct(e)));
623
+ function jt(e) {
624
+ return this.select(e == null ? At : kt(typeof e == "function" ? e : Dt(e)));
608
625
  }
609
- var Ot = Array.prototype.filter;
610
- function kt() {
626
+ var Mt = Array.prototype.filter;
627
+ function Nt() {
611
628
  return Array.from(this.children);
612
629
  }
613
- function At(e) {
630
+ function Pt(e) {
614
631
  return function() {
615
- return Ot.call(this.children, e);
632
+ return Mt.call(this.children, e);
616
633
  };
617
634
  }
618
- function jt(e) {
619
- return this.selectAll(e == null ? kt : At(typeof e == "function" ? e : Ct(e)));
635
+ function Ft(e) {
636
+ return this.selectAll(e == null ? Nt : Pt(typeof e == "function" ? e : Dt(e)));
620
637
  }
621
- function Mt(e) {
622
- typeof e != "function" && (e = St(e));
638
+ function It(e) {
639
+ typeof e != "function" && (e = Et(e));
623
640
  for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = [], c, l = 0; l < o; ++l) (c = a[l]) && e.call(c, c.__data__, l, a) && s.push(c);
624
641
  return new M(r, this._parents);
625
642
  }
626
- function Nt(e) {
643
+ function Lt(e) {
627
644
  return Array(e.length);
628
645
  }
629
- function Pt() {
630
- return new M(this._enter || this._groups.map(Nt), this._parents);
646
+ function Rt() {
647
+ return new M(this._enter || this._groups.map(Lt), this._parents);
631
648
  }
632
- function Ft(e, t) {
649
+ function zt(e, t) {
633
650
  this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
634
651
  }
635
- Ft.prototype = {
636
- constructor: Ft,
652
+ zt.prototype = {
653
+ constructor: zt,
637
654
  appendChild: function(e) {
638
655
  return this._parent.insertBefore(e, this._next);
639
656
  },
@@ -647,30 +664,30 @@ Ft.prototype = {
647
664
  return this._parent.querySelectorAll(e);
648
665
  }
649
666
  };
650
- function It(e) {
667
+ function Bt(e) {
651
668
  return function() {
652
669
  return e;
653
670
  };
654
671
  }
655
- function Lt(e, t, n, r, i, a) {
656
- for (var o = 0, s, c = t.length, l = a.length; o < l; ++o) (s = t[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new Ft(e, a[o]);
672
+ function Vt(e, t, n, r, i, a) {
673
+ for (var o = 0, s, c = t.length, l = a.length; o < l; ++o) (s = t[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new zt(e, a[o]);
657
674
  for (; o < c; ++o) (s = t[o]) && (i[o] = s);
658
675
  }
659
- function Rt(e, t, n, r, i, a, o) {
676
+ function Ht(e, t, n, r, i, a, o) {
660
677
  var s, c, l = /* @__PURE__ */ new Map(), u = t.length, d = a.length, f = Array(u), p;
661
678
  for (s = 0; s < u; ++s) (c = t[s]) && (f[s] = p = o.call(c, c.__data__, s, t) + "", l.has(p) ? i[s] = c : l.set(p, c));
662
- for (s = 0; s < d; ++s) p = o.call(e, a[s], s, a) + "", (c = l.get(p)) ? (r[s] = c, c.__data__ = a[s], l.delete(p)) : n[s] = new Ft(e, a[s]);
679
+ for (s = 0; s < d; ++s) p = o.call(e, a[s], s, a) + "", (c = l.get(p)) ? (r[s] = c, c.__data__ = a[s], l.delete(p)) : n[s] = new zt(e, a[s]);
663
680
  for (s = 0; s < u; ++s) (c = t[s]) && l.get(f[s]) === c && (i[s] = c);
664
681
  }
665
- function zt(e) {
682
+ function Ut(e) {
666
683
  return e.__data__;
667
684
  }
668
- function Bt(e, t) {
669
- if (!arguments.length) return Array.from(this, zt);
670
- var n = t ? Rt : Lt, r = this._parents, i = this._groups;
671
- typeof e != "function" && (e = It(e));
685
+ function Wt(e, t) {
686
+ if (!arguments.length) return Array.from(this, Ut);
687
+ var n = t ? Ht : Vt, r = this._parents, i = this._groups;
688
+ typeof e != "function" && (e = Bt(e));
672
689
  for (var a = i.length, o = Array(a), s = Array(a), c = Array(a), l = 0; l < a; ++l) {
673
- var u = r[l], d = i[l], f = d.length, p = Vt(e.call(u, u && u.__data__, l, r)), m = p.length, h = s[l] = Array(m), g = o[l] = Array(m);
690
+ var u = r[l], d = i[l], f = d.length, p = Gt(e.call(u, u && u.__data__, l, r)), m = p.length, h = s[l] = Array(m), g = o[l] = Array(m);
674
691
  n(u, d, h, g, c[l] = Array(f), p, t);
675
692
  for (var _ = 0, v = 0, y, b; _ < m; ++_) if (y = h[_]) {
676
693
  for (_ >= v && (v = _ + 1); !(b = g[v]) && ++v < m;);
@@ -679,27 +696,27 @@ function Bt(e, t) {
679
696
  }
680
697
  return o = new M(o, r), o._enter = s, o._exit = c, o;
681
698
  }
682
- function Vt(e) {
699
+ function Gt(e) {
683
700
  return typeof e == "object" && "length" in e ? e : Array.from(e);
684
701
  }
685
- function Ht() {
686
- return new M(this._exit || this._groups.map(Nt), this._parents);
702
+ function Kt() {
703
+ return new M(this._exit || this._groups.map(Lt), this._parents);
687
704
  }
688
- function Ut(e, t, n) {
705
+ function qt(e, t, n) {
689
706
  var r = this.enter(), i = this, a = this.exit();
690
707
  return typeof e == "function" ? (r = e(r), r &&= r.selection()) : r = r.append(e + ""), t != null && (i = t(i), i &&= i.selection()), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i;
691
708
  }
692
- function Wt(e) {
709
+ function Jt(e) {
693
710
  for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, a = r.length, o = Math.min(i, a), s = Array(i), c = 0; c < o; ++c) for (var l = n[c], u = r[c], d = l.length, f = s[c] = Array(d), p, m = 0; m < d; ++m) (p = l[m] || u[m]) && (f[m] = p);
694
711
  for (; c < i; ++c) s[c] = n[c];
695
712
  return new M(s, this._parents);
696
713
  }
697
- function Gt() {
714
+ function Yt() {
698
715
  for (var e = this._groups, t = -1, n = e.length; ++t < n;) for (var r = e[t], i = r.length - 1, a = r[i], o; --i >= 0;) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o);
699
716
  return this;
700
717
  }
701
- function Kt(e) {
702
- e ||= qt;
718
+ function Xt(e) {
719
+ e ||= Zt;
703
720
  function t(t, n) {
704
721
  return t && n ? e(t.__data__, n.__data__) : !t - !n;
705
722
  }
@@ -709,129 +726,129 @@ function Kt(e) {
709
726
  }
710
727
  return new M(i, this._parents).order();
711
728
  }
712
- function qt(e, t) {
729
+ function Zt(e, t) {
713
730
  return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
714
731
  }
715
- function Jt() {
732
+ function Qt() {
716
733
  var e = arguments[0];
717
734
  return arguments[0] = this, e.apply(null, arguments), this;
718
735
  }
719
- function Yt() {
736
+ function $t() {
720
737
  return Array.from(this);
721
738
  }
722
- function Xt() {
739
+ function en() {
723
740
  for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length; i < a; ++i) {
724
741
  var o = r[i];
725
742
  if (o) return o;
726
743
  }
727
744
  return null;
728
745
  }
729
- function Zt() {
746
+ function tn() {
730
747
  let e = 0;
731
748
  for (let t of this) ++e;
732
749
  return e;
733
750
  }
734
- function Qt() {
751
+ function nn() {
735
752
  return !this.node();
736
753
  }
737
- function $t(e) {
754
+ function rn(e) {
738
755
  for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var i = t[n], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && e.call(s, s.__data__, a, i);
739
756
  return this;
740
757
  }
741
- function en(e) {
758
+ function an(e) {
742
759
  return function() {
743
760
  this.removeAttribute(e);
744
761
  };
745
762
  }
746
- function tn(e) {
763
+ function on(e) {
747
764
  return function() {
748
765
  this.removeAttributeNS(e.space, e.local);
749
766
  };
750
767
  }
751
- function nn(e, t) {
768
+ function sn(e, t) {
752
769
  return function() {
753
770
  this.setAttribute(e, t);
754
771
  };
755
772
  }
756
- function rn(e, t) {
773
+ function cn(e, t) {
757
774
  return function() {
758
775
  this.setAttributeNS(e.space, e.local, t);
759
776
  };
760
777
  }
761
- function an(e, t) {
778
+ function ln(e, t) {
762
779
  return function() {
763
780
  var n = t.apply(this, arguments);
764
781
  n == null ? this.removeAttribute(e) : this.setAttribute(e, n);
765
782
  };
766
783
  }
767
- function on(e, t) {
784
+ function un(e, t) {
768
785
  return function() {
769
786
  var n = t.apply(this, arguments);
770
787
  n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n);
771
788
  };
772
789
  }
773
- function sn(e, t) {
774
- var n = ut(e);
790
+ function dn(e, t) {
791
+ var n = mt(e);
775
792
  if (arguments.length < 2) {
776
793
  var r = this.node();
777
794
  return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
778
795
  }
779
- return this.each((t == null ? n.local ? tn : en : typeof t == "function" ? n.local ? on : an : n.local ? rn : nn)(n, t));
796
+ return this.each((t == null ? n.local ? on : an : typeof t == "function" ? n.local ? un : ln : n.local ? cn : sn)(n, t));
780
797
  }
781
- function cn(e) {
798
+ function fn(e) {
782
799
  return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
783
800
  }
784
- function ln(e) {
801
+ function pn(e) {
785
802
  return function() {
786
803
  this.style.removeProperty(e);
787
804
  };
788
805
  }
789
- function un(e, t, n) {
806
+ function mn(e, t, n) {
790
807
  return function() {
791
808
  this.style.setProperty(e, t, n);
792
809
  };
793
810
  }
794
- function dn(e, t, n) {
811
+ function hn(e, t, n) {
795
812
  return function() {
796
813
  var r = t.apply(this, arguments);
797
814
  r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n);
798
815
  };
799
816
  }
800
- function fn(e, t, n) {
801
- return arguments.length > 1 ? this.each((t == null ? ln : typeof t == "function" ? dn : un)(e, t, n ?? "")) : j(this.node(), e);
817
+ function gn(e, t, n) {
818
+ return arguments.length > 1 ? this.each((t == null ? pn : typeof t == "function" ? hn : mn)(e, t, n ?? "")) : j(this.node(), e);
802
819
  }
803
820
  function j(e, t) {
804
- return e.style.getPropertyValue(t) || cn(e).getComputedStyle(e, null).getPropertyValue(t);
821
+ return e.style.getPropertyValue(t) || fn(e).getComputedStyle(e, null).getPropertyValue(t);
805
822
  }
806
- function pn(e) {
823
+ function _n(e) {
807
824
  return function() {
808
825
  delete this[e];
809
826
  };
810
827
  }
811
- function mn(e, t) {
828
+ function vn(e, t) {
812
829
  return function() {
813
830
  this[e] = t;
814
831
  };
815
832
  }
816
- function hn(e, t) {
833
+ function yn(e, t) {
817
834
  return function() {
818
835
  var n = t.apply(this, arguments);
819
836
  n == null ? delete this[e] : this[e] = n;
820
837
  };
821
838
  }
822
- function gn(e, t) {
823
- return arguments.length > 1 ? this.each((t == null ? pn : typeof t == "function" ? hn : mn)(e, t)) : this.node()[e];
839
+ function bn(e, t) {
840
+ return arguments.length > 1 ? this.each((t == null ? _n : typeof t == "function" ? yn : vn)(e, t)) : this.node()[e];
824
841
  }
825
- function _n(e) {
842
+ function xn(e) {
826
843
  return e.trim().split(/^|\s+/);
827
844
  }
828
- function vn(e) {
829
- return e.classList || new yn(e);
845
+ function Sn(e) {
846
+ return e.classList || new Cn(e);
830
847
  }
831
- function yn(e) {
832
- this._node = e, this._names = _n(e.getAttribute("class") || "");
848
+ function Cn(e) {
849
+ this._node = e, this._names = xn(e.getAttribute("class") || "");
833
850
  }
834
- yn.prototype = {
851
+ Cn.prototype = {
835
852
  add: function(e) {
836
853
  this._names.indexOf(e) < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" ")));
837
854
  },
@@ -843,123 +860,123 @@ yn.prototype = {
843
860
  return this._names.indexOf(e) >= 0;
844
861
  }
845
862
  };
846
- function bn(e, t) {
847
- for (var n = vn(e), r = -1, i = t.length; ++r < i;) n.add(t[r]);
863
+ function wn(e, t) {
864
+ for (var n = Sn(e), r = -1, i = t.length; ++r < i;) n.add(t[r]);
848
865
  }
849
- function xn(e, t) {
850
- for (var n = vn(e), r = -1, i = t.length; ++r < i;) n.remove(t[r]);
866
+ function Tn(e, t) {
867
+ for (var n = Sn(e), r = -1, i = t.length; ++r < i;) n.remove(t[r]);
851
868
  }
852
- function Sn(e) {
869
+ function En(e) {
853
870
  return function() {
854
- bn(this, e);
871
+ wn(this, e);
855
872
  };
856
873
  }
857
- function Cn(e) {
874
+ function Dn(e) {
858
875
  return function() {
859
- xn(this, e);
876
+ Tn(this, e);
860
877
  };
861
878
  }
862
- function wn(e, t) {
879
+ function On(e, t) {
863
880
  return function() {
864
- (t.apply(this, arguments) ? bn : xn)(this, e);
881
+ (t.apply(this, arguments) ? wn : Tn)(this, e);
865
882
  };
866
883
  }
867
- function Tn(e, t) {
868
- var n = _n(e + "");
884
+ function kn(e, t) {
885
+ var n = xn(e + "");
869
886
  if (arguments.length < 2) {
870
- for (var r = vn(this.node()), i = -1, a = n.length; ++i < a;) if (!r.contains(n[i])) return !1;
887
+ for (var r = Sn(this.node()), i = -1, a = n.length; ++i < a;) if (!r.contains(n[i])) return !1;
871
888
  return !0;
872
889
  }
873
- return this.each((typeof t == "function" ? wn : t ? Sn : Cn)(n, t));
890
+ return this.each((typeof t == "function" ? On : t ? En : Dn)(n, t));
874
891
  }
875
- function En() {
892
+ function An() {
876
893
  this.textContent = "";
877
894
  }
878
- function Dn(e) {
895
+ function jn(e) {
879
896
  return function() {
880
897
  this.textContent = e;
881
898
  };
882
899
  }
883
- function On(e) {
900
+ function Mn(e) {
884
901
  return function() {
885
902
  var t = e.apply(this, arguments);
886
903
  this.textContent = t ?? "";
887
904
  };
888
905
  }
889
- function kn(e) {
890
- return arguments.length ? this.each(e == null ? En : (typeof e == "function" ? On : Dn)(e)) : this.node().textContent;
906
+ function Nn(e) {
907
+ return arguments.length ? this.each(e == null ? An : (typeof e == "function" ? Mn : jn)(e)) : this.node().textContent;
891
908
  }
892
- function An() {
909
+ function Pn() {
893
910
  this.innerHTML = "";
894
911
  }
895
- function jn(e) {
912
+ function Fn(e) {
896
913
  return function() {
897
914
  this.innerHTML = e;
898
915
  };
899
916
  }
900
- function Mn(e) {
917
+ function In(e) {
901
918
  return function() {
902
919
  var t = e.apply(this, arguments);
903
920
  this.innerHTML = t ?? "";
904
921
  };
905
922
  }
906
- function Nn(e) {
907
- return arguments.length ? this.each(e == null ? An : (typeof e == "function" ? Mn : jn)(e)) : this.node().innerHTML;
923
+ function Ln(e) {
924
+ return arguments.length ? this.each(e == null ? Pn : (typeof e == "function" ? In : Fn)(e)) : this.node().innerHTML;
908
925
  }
909
- function Pn() {
926
+ function Rn() {
910
927
  this.nextSibling && this.parentNode.appendChild(this);
911
928
  }
912
- function Fn() {
913
- return this.each(Pn);
929
+ function zn() {
930
+ return this.each(Rn);
914
931
  }
915
- function In() {
932
+ function Bn() {
916
933
  this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
917
934
  }
918
- function Ln() {
919
- return this.each(In);
935
+ function Vn() {
936
+ return this.each(Bn);
920
937
  }
921
- function Rn(e) {
922
- var t = typeof e == "function" ? e : pt(e);
938
+ function Hn(e) {
939
+ var t = typeof e == "function" ? e : _t(e);
923
940
  return this.select(function() {
924
941
  return this.appendChild(t.apply(this, arguments));
925
942
  });
926
943
  }
927
- function zn() {
944
+ function Un() {
928
945
  return null;
929
946
  }
930
- function Bn(e, t) {
931
- var n = typeof e == "function" ? e : pt(e), r = t == null ? zn : typeof t == "function" ? t : ht(t);
947
+ function Wn(e, t) {
948
+ var n = typeof e == "function" ? e : _t(e), r = t == null ? Un : typeof t == "function" ? t : yt(t);
932
949
  return this.select(function() {
933
950
  return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
934
951
  });
935
952
  }
936
- function Vn() {
953
+ function Gn() {
937
954
  var e = this.parentNode;
938
955
  e && e.removeChild(this);
939
956
  }
940
- function Hn() {
941
- return this.each(Vn);
957
+ function Kn() {
958
+ return this.each(Gn);
942
959
  }
943
- function Un() {
960
+ function qn() {
944
961
  var e = this.cloneNode(!1), t = this.parentNode;
945
962
  return t ? t.insertBefore(e, this.nextSibling) : e;
946
963
  }
947
- function Wn() {
964
+ function Jn() {
948
965
  var e = this.cloneNode(!0), t = this.parentNode;
949
966
  return t ? t.insertBefore(e, this.nextSibling) : e;
950
967
  }
951
- function Gn(e) {
952
- return this.select(e ? Wn : Un);
968
+ function Yn(e) {
969
+ return this.select(e ? Jn : qn);
953
970
  }
954
- function Kn(e) {
971
+ function Xn(e) {
955
972
  return arguments.length ? this.property("__data__", e) : this.node().__data__;
956
973
  }
957
- function qn(e) {
974
+ function Zn(e) {
958
975
  return function(t) {
959
976
  e.call(this, t, this.__data__);
960
977
  };
961
978
  }
962
- function Jn(e) {
979
+ function Qn(e) {
963
980
  return e.trim().split(/^|\s+/).map(function(e) {
964
981
  var t = "", n = e.indexOf(".");
965
982
  return n >= 0 && (t = e.slice(n + 1), e = e.slice(0, n)), {
@@ -968,7 +985,7 @@ function Jn(e) {
968
985
  };
969
986
  });
970
987
  }
971
- function Yn(e) {
988
+ function $n(e) {
972
989
  return function() {
973
990
  var t = this.__on;
974
991
  if (t) {
@@ -977,9 +994,9 @@ function Yn(e) {
977
994
  }
978
995
  };
979
996
  }
980
- function Xn(e, t, n) {
997
+ function er(e, t, n) {
981
998
  return function() {
982
- var r = this.__on, i, a = qn(t);
999
+ var r = this.__on, i, a = Zn(t);
983
1000
  if (r) {
984
1001
  for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === e.type && i.name === e.name) {
985
1002
  this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = t;
@@ -995,8 +1012,8 @@ function Xn(e, t, n) {
995
1012
  }, r ? r.push(i) : this.__on = [i];
996
1013
  };
997
1014
  }
998
- function Zn(e, t, n) {
999
- var r = Jn(e + ""), i, a = r.length, o;
1015
+ function tr(e, t, n) {
1016
+ var r = Qn(e + ""), i, a = r.length, o;
1000
1017
  if (arguments.length < 2) {
1001
1018
  var s = this.node().__on;
1002
1019
  if (s) {
@@ -1004,87 +1021,87 @@ function Zn(e, t, n) {
1004
1021
  }
1005
1022
  return;
1006
1023
  }
1007
- for (s = t ? Xn : Yn, i = 0; i < a; ++i) this.each(s(r[i], t, n));
1024
+ for (s = t ? er : $n, i = 0; i < a; ++i) this.each(s(r[i], t, n));
1008
1025
  return this;
1009
1026
  }
1010
- function Qn(e, t, n) {
1011
- var r = cn(e), i = r.CustomEvent;
1027
+ function nr(e, t, n) {
1028
+ var r = fn(e), i = r.CustomEvent;
1012
1029
  typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i);
1013
1030
  }
1014
- function $n(e, t) {
1031
+ function rr(e, t) {
1015
1032
  return function() {
1016
- return Qn(this, e, t);
1033
+ return nr(this, e, t);
1017
1034
  };
1018
1035
  }
1019
- function er(e, t) {
1036
+ function ir(e, t) {
1020
1037
  return function() {
1021
- return Qn(this, e, t.apply(this, arguments));
1038
+ return nr(this, e, t.apply(this, arguments));
1022
1039
  };
1023
1040
  }
1024
- function tr(e, t) {
1025
- return this.each((typeof t == "function" ? er : $n)(e, t));
1041
+ function ar(e, t) {
1042
+ return this.each((typeof t == "function" ? ir : rr)(e, t));
1026
1043
  }
1027
- function* nr() {
1044
+ function* or() {
1028
1045
  for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o);
1029
1046
  }
1030
- var rr = [null];
1047
+ var sr = [null];
1031
1048
  function M(e, t) {
1032
1049
  this._groups = e, this._parents = t;
1033
1050
  }
1034
1051
  function N() {
1035
- return new M([[document.documentElement]], rr);
1052
+ return new M([[document.documentElement]], sr);
1036
1053
  }
1037
- function ir() {
1054
+ function cr() {
1038
1055
  return this;
1039
1056
  }
1040
1057
  M.prototype = N.prototype = {
1041
1058
  constructor: M,
1042
- select: gt,
1043
- selectAll: xt,
1044
- selectChild: Dt,
1045
- selectChildren: jt,
1046
- filter: Mt,
1047
- data: Bt,
1048
- enter: Pt,
1049
- exit: Ht,
1050
- join: Ut,
1051
- merge: Wt,
1052
- selection: ir,
1053
- order: Gt,
1054
- sort: Kt,
1055
- call: Jt,
1056
- nodes: Yt,
1057
- node: Xt,
1058
- size: Zt,
1059
- empty: Qt,
1060
- each: $t,
1061
- attr: sn,
1062
- style: fn,
1063
- property: gn,
1064
- classed: Tn,
1065
- text: kn,
1066
- html: Nn,
1067
- raise: Fn,
1068
- lower: Ln,
1069
- append: Rn,
1070
- insert: Bn,
1071
- remove: Hn,
1072
- clone: Gn,
1073
- datum: Kn,
1074
- on: Zn,
1075
- dispatch: tr,
1076
- [Symbol.iterator]: nr
1059
+ select: bt,
1060
+ selectAll: Tt,
1061
+ selectChild: jt,
1062
+ selectChildren: Ft,
1063
+ filter: It,
1064
+ data: Wt,
1065
+ enter: Rt,
1066
+ exit: Kt,
1067
+ join: qt,
1068
+ merge: Jt,
1069
+ selection: cr,
1070
+ order: Yt,
1071
+ sort: Xt,
1072
+ call: Qt,
1073
+ nodes: $t,
1074
+ node: en,
1075
+ size: tn,
1076
+ empty: nn,
1077
+ each: rn,
1078
+ attr: dn,
1079
+ style: gn,
1080
+ property: bn,
1081
+ classed: kn,
1082
+ text: Nn,
1083
+ html: Ln,
1084
+ raise: zn,
1085
+ lower: Vn,
1086
+ append: Hn,
1087
+ insert: Wn,
1088
+ remove: Kn,
1089
+ clone: Yn,
1090
+ datum: Xn,
1091
+ on: tr,
1092
+ dispatch: ar,
1093
+ [Symbol.iterator]: or
1077
1094
  };
1078
1095
  function P(e) {
1079
- return typeof e == "string" ? new M([[document.querySelector(e)]], [document.documentElement]) : new M([[e]], rr);
1096
+ return typeof e == "string" ? new M([[document.querySelector(e)]], [document.documentElement]) : new M([[e]], sr);
1080
1097
  }
1081
- function ar(e) {
1098
+ function lr(e) {
1082
1099
  let t;
1083
1100
  for (; t = e.sourceEvent;) e = t;
1084
1101
  return e;
1085
1102
  }
1086
1103
  function F(e, t) {
1087
- if (e = ar(e), t === void 0 && (t = e.currentTarget), t) {
1104
+ if (e = lr(e), t === void 0 && (t = e.currentTarget), t) {
1088
1105
  var n = t.ownerSVGElement || t;
1089
1106
  if (n.createSVGPoint) {
1090
1107
  var r = n.createSVGPoint();
@@ -1097,62 +1114,62 @@ function F(e, t) {
1097
1114
  }
1098
1115
  return [e.pageX, e.pageY];
1099
1116
  }
1100
- function or(e) {
1101
- return typeof e == "string" ? new M([document.querySelectorAll(e)], [document.documentElement]) : new M([_t(e)], rr);
1117
+ function ur(e) {
1118
+ return typeof e == "string" ? new M([document.querySelectorAll(e)], [document.documentElement]) : new M([xt(e)], sr);
1102
1119
  }
1103
- var sr = /* @__PURE__ */ e(ne()), I = n[a.KPIChange], L = I.slots, cr = "#577f56", lr = "#9e4d53", R = (e) => typeof e == "number" && Number.isFinite(e), ur = (e, t) => {
1104
- let n = new sr.default(e);
1105
- return (new sr.default(t).isLight() ? n.lighten(.5).alpha(.5) : n.darken(.5).alpha(.5)).rgb().string();
1106
- }, dr = (e, t) => {
1120
+ var dr = /* @__PURE__ */ e(ye()), I = r[d.KPIChange], L = I.slots, fr = "#577f56", pr = "#9e4d53", R = (e) => typeof e == "number" && Number.isFinite(e), mr = (e, t) => {
1121
+ let n = new dr.default(e);
1122
+ return (new dr.default(t).isLight() ? n.lighten(.5).alpha(.5) : n.darken(.5).alpha(.5)).rgb().string();
1123
+ }, hr = (e, t) => {
1107
1124
  if (!e.enabled) return "";
1108
1125
  let n = R(e.value) ? e.value : null, r = n === null ? "" : n < 0 ? "negative" : "positive", i = "", a = "";
1109
1126
  if (e.indicator === "inverse") r = r === "negative" ? "positive" : "negative";
1110
1127
  else if (e.indicator === "none") r = "";
1111
1128
  else if (e.indicator === "custom") {
1112
1129
  r = "";
1113
- let n = e.customIndicator?.color ? ur(e.customIndicator.color, t) : "inherit";
1114
- i = `color: ${e.customIndicator?.color ?? "inherit"}; background-color: ${n};`, e.customIndicator?.icon && (a = `<span class="footer-icon">${_.sanitize(e.customIndicator.icon)}</span>`);
1130
+ let n = e.customIndicator?.color ? mr(e.customIndicator.color, t) : "inherit";
1131
+ i = `color: ${e.customIndicator?.color ?? "inherit"}; background-color: ${n};`, e.customIndicator?.icon && (a = `<span class="footer-icon">${g.sanitize(e.customIndicator.icon)}</span>`);
1115
1132
  }
1116
- return `<div class="footer ${r}" style="${i}"><span class="footer-label">${_.sanitize(e.label)}</span>${a}</div>`;
1117
- }, fr = (e, t) => {
1133
+ return `<div class="footer ${r}" style="${i}"><span class="footer-label">${g.sanitize(e.label ?? "-")}</span>${a}</div>`;
1134
+ }, gr = (e, t) => {
1118
1135
  if (!e.enabled) return "";
1119
1136
  let n = e.indicator, r = R(e.value) ? e.value : null, i = r === null ? "neutral" : r < 0 ? "negative" : "positive", a = "", o = r === null ? "" : r < 0 ? "arrow_downward" : "arrow_upward";
1120
1137
  if (n === "inverse") i = i === "negative" ? "positive" : "negative";
1121
1138
  else if (n === "none") i = "", o = void 0;
1122
1139
  else if (n === "custom") {
1123
1140
  i = "";
1124
- let n = e.customIndicator?.color ? ur(e.customIndicator.color, t) : "inherit";
1141
+ let n = e.customIndicator?.color ? mr(e.customIndicator.color, t) : "inherit";
1125
1142
  a = `color: ${e.customIndicator?.color ?? "inherit"}; background-color: ${n};`, o = e.customIndicator?.icon;
1126
1143
  }
1127
- let s = o ? `<span class="pill-icon">${_.sanitize(o)}</span>` : "";
1128
- return `<div class="pill ${i}" style="${a}"><span class="pill-label">${_.sanitize(e.label)}</span>${s}</div>`;
1129
- }, pr = (e, t) => {
1144
+ let s = o ? `<span class="pill-icon">${g.sanitize(o)}</span>` : "";
1145
+ return `<div class="pill ${i}" style="${a}"><span class="pill-label">${g.sanitize(e.label ?? "-")}</span>${s}</div>`;
1146
+ }, _r = (e, t) => {
1130
1147
  let n = e.value ?? {
1131
1148
  label: "-",
1132
1149
  value: null,
1133
1150
  enabled: !1
1134
1151
  }, r = "", i = "";
1135
- return e.indicator === "custom" && (e.customIndicator?.color && (r = `color: ${e.customIndicator.color};`), e.customIndicator?.icon && (i = `<span class="value-icon">${_.sanitize(e.customIndicator.icon)}</span>`)), `<div class="value ${t ? "value-space" : ""}" style="${r}"><span class="value-label">${_.sanitize(n.label)}</span>${i}</div>`;
1136
- }, mr = (e, t) => {
1137
- let n = e.data.diff ?? L.diff.defaults, r = e.data.change ?? L.change.defaults, i = t.config.nodeDefaultBackground ?? "#ffffff", a = pr(e.data, !r.enabled), o = dr(n, i), s = fr(r, i), c = [];
1138
- return e.data._upToTheRootHighlighted && c.push("node-highlight"), `
1139
- <div class="node-content layout-a ${c.join(" ")}">
1140
- <div class="label">${_.sanitize(e.data.label)}</div>
1152
+ return e.indicator === "custom" && (e.customIndicator?.color && (r = `color: ${e.customIndicator.color};`), e.customIndicator?.icon && (i = `<span class="value-icon">${g.sanitize(e.customIndicator.icon)}</span>`)), `<div class="value ${t ? "value-space" : ""}" style="${r}"><span class="value-label">${g.sanitize(n.label)}</span>${i}</div>`;
1153
+ }, vr = (e, t) => {
1154
+ let n = e.data.diff ?? a.diff.defaults, r = e.data.change ?? a.change.defaults, i = t.config.nodeDefaultBackground ?? "#ffffff", o = _r(e.data, !r.enabled), s = hr(n, i), c = gr(r, i), l = [];
1155
+ return e.data._upToTheRootHighlighted && l.push("node-highlight"), `
1156
+ <div class="node-content layout-a ${l.join(" ")}">
1157
+ <div class="label">${g.sanitize(e.data.label)}</div>
1141
1158
  <div class="flex-row">
1142
- ${a}
1143
- ${s}
1159
+ ${o}
1160
+ ${c}
1144
1161
  </div>
1145
- ${o}
1162
+ ${s}
1146
1163
 
1147
1164
  </div>
1148
1165
  `;
1149
- }, hr = ({ node: e, config: t }) => e.data?.id === "__root__" ? null : `<div class="button-content"> ${{
1166
+ }, yr = ({ node: e, config: t }) => e.data?.id === "__root__" ? null : `<div class="button-content"> ${{
1150
1167
  left: (e) => e ? "◀" : "▶",
1151
1168
  bottom: (e) => e ? "▼" : "▲",
1152
1169
  right: (e) => e ? "▶" : "◀",
1153
1170
  top: (e) => e ? "▲" : "▼"
1154
1171
  }[t.layout](e.children)} </div>`;
1155
- function gr(e) {
1172
+ function br(e) {
1156
1173
  if (e.data._upToTheRootHighlighted) {
1157
1174
  P(this).style("stroke-width", "var(--border-hover-width)").style("stroke", "var(--border-hover-color)");
1158
1175
  return;
@@ -1161,26 +1178,30 @@ function gr(e) {
1161
1178
  P(this).style("stroke-width", null).style("stroke", null);
1162
1179
  return;
1163
1180
  }
1164
- let t = (R(e.data.diff?.value) ? e.data.diff.value : null) ?? (R(L.diff.defaults.value) ? L.diff.defaults.value : 0), n = e.parent?.children?.flatMap((t) => t.id === e.id || !t.data.diff?.enabled || !R(t.data.diff?.value) ? [] : [Math.abs(t.data.diff.value)]) ?? [], r = n.length ? Math.max(...n) : 0, i = Math.abs(t) > r, a = t < 0, o = a ? lr : cr, s = e.data.diff?.indicator;
1165
- s === "inverse" ? o = a ? cr : lr : s === "none" ? o = "var(--link-color)" : s === "custom" && (o = e.data.diff?.customIndicator?.color ?? "var(--link-color)");
1166
- let c = i ? 2 : 1;
1167
- P(this).style("stroke", o).style("stroke-width", c);
1181
+ let t = (R(e.data.diff?.value) ? e.data.diff.value : null) ?? (R(a.diff.defaults.value) ? a.diff.defaults.value : 0), n = e.parent?.children?.flatMap((t) => t.id === e.id || !t.data.diff?.enabled || !R(t.data.diff?.value) ? [] : [Math.abs(t.data.diff.value)]) ?? [], r = n.length ? Math.max(...n) : 0, i = Math.abs(t) > r, o = t < 0, s = o ? pr : fr, c = e.data.diff?.indicator;
1182
+ c === "inverse" ? s = o ? fr : pr : c === "none" ? s = "var(--link-color)" : c === "custom" && (s = e.data.diff?.customIndicator?.color ?? "var(--link-color)");
1183
+ let l = i ? 2 : 1;
1184
+ P(this).style("stroke", s).style("stroke-width", l);
1168
1185
  }
1169
- var _r = (e, t) => {
1186
+ var xr = (e, t) => {
1170
1187
  let n = {
1171
1188
  ...I.labelStyle,
1172
- ...t.treeChartSettings.nodeLayout?.labelStyle
1189
+ ...t.treeChartSettings.nodeLayout?.labelStyle,
1190
+ fontSize: t.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? I.labelStyle?.fontSize
1173
1191
  }, r = {
1174
1192
  ...I.valueStyle,
1175
- ...t.treeChartSettings.nodeLayout?.valueStyle
1193
+ ...t.treeChartSettings.nodeLayout?.valueStyle,
1194
+ fontSize: t.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? I.valueStyle?.fontSize
1176
1195
  }, i = {
1177
- ...L.change.styling,
1178
- ...L.change.styling.fontStyle,
1179
- ...t.treeChartSettings.nodeLayout?.slots?.change
1196
+ ...L.change?.styling,
1197
+ ...L.change?.styling?.fontStyle,
1198
+ ...t.treeChartSettings.nodeLayout?.slots?.change,
1199
+ fontSize: t.treeChartSettings.nodeLayout?.slots?.change?.fontSize ?? L.change?.styling?.fontSize
1180
1200
  }, a = {
1181
- ...L.diff.styling,
1182
- ...L.diff.styling.fontStyle,
1183
- ...t.treeChartSettings.nodeLayout?.slots?.diff
1201
+ ...L.diff?.styling,
1202
+ ...L.diff?.styling?.fontStyle,
1203
+ ...t.treeChartSettings.nodeLayout?.slots?.diff,
1204
+ fontSize: t.treeChartSettings.nodeLayout?.slots?.diff?.fontSize ?? L.diff?.styling?.fontSize
1184
1205
  };
1185
1206
  return `
1186
1207
  #${e} {
@@ -1308,35 +1329,38 @@ var _r = (e, t) => {
1308
1329
  }
1309
1330
 
1310
1331
  .positive {
1311
- color: ${cr};
1332
+ color: ${fr};
1312
1333
  background-color: #e4fae8;
1313
1334
  }
1314
1335
 
1315
1336
  .negative {
1316
- color: ${lr};
1337
+ color: ${pr};
1317
1338
  background-color: #fcecec;
1318
1339
  }
1319
1340
  }
1320
1341
  }`;
1321
- }, vr = {
1342
+ }, Sr = {
1322
1343
  name: "KPI Change",
1323
1344
  ...I,
1324
- getNodeContent: mr,
1325
- getButtonContent: hr,
1326
- linkUpdate: gr,
1327
- getCSS: _r,
1345
+ getNodeContent: vr,
1346
+ getButtonContent: yr,
1347
+ linkUpdate: br,
1348
+ getCSS: xr,
1328
1349
  width: 180,
1329
1350
  sizes: (e) => {
1330
1351
  let t = {
1331
- ...L.diff.styling,
1332
- ...L.diff.styling.fontStyle,
1333
- ...e.treeChartSettings.nodeLayout?.slots?.diff
1352
+ ...L.diff?.styling,
1353
+ ...L.diff?.styling?.fontStyle,
1354
+ ...e.treeChartSettings.nodeLayout?.slots?.diff,
1355
+ fontSize: e.treeChartSettings.nodeLayout?.slots?.diff?.fontSize ?? L.diff?.styling?.fontSize
1334
1356
  }, n = {
1335
1357
  ...I.labelStyle,
1336
- ...e.treeChartSettings.nodeLayout?.labelStyle
1358
+ ...e.treeChartSettings.nodeLayout?.labelStyle,
1359
+ fontSize: e.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? I.labelStyle?.fontSize
1337
1360
  }, r = {
1338
1361
  ...I.valueStyle,
1339
- ...e.treeChartSettings.nodeLayout?.valueStyle
1362
+ ...e.treeChartSettings.nodeLayout?.valueStyle,
1363
+ fontSize: e.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? I.valueStyle?.fontSize
1340
1364
  };
1341
1365
  return {
1342
1366
  label: Math.ceil(D(n.fontSize)) + 8,
@@ -1346,25 +1370,27 @@ var _r = (e, t) => {
1346
1370
  },
1347
1371
  height: (e, t) => {
1348
1372
  let n = 20;
1349
- return n += t?.label ?? 0, n += t?.value ?? 0, (e.data.diff ?? L.diff.defaults)?.enabled && (n += t?.diff ?? 0), n;
1373
+ return n += t?.label ?? 0, n += t?.value ?? 0, (e.data.diff ?? a.diff.defaults)?.enabled && (n += t?.diff ?? 0), n;
1350
1374
  }
1351
- }, z = n[a.Basic], yr = (e) => {
1375
+ }, z = r[d.Basic], Cr = (e) => {
1352
1376
  if (e.id === "__root__") return null;
1353
1377
  let t = "", n = "";
1354
- e.data.indicator === "custom" && (e.data.customIndicator?.color && (t = `color: ${e.data.customIndicator.color};`), e.data.customIndicator?.icon && (n = `<span class="value-icon">${_.sanitize(e.data.customIndicator.icon)}</span>`));
1355
- let r = e.data.value ? `<div class="value" style="${t}"><span class="value-label">${_.sanitize(e.data.value.label)}</span>${n}</div>` : "", i = [];
1378
+ e.data.indicator === "custom" && (e.data.customIndicator?.color && (t = `color: ${e.data.customIndicator.color};`), e.data.customIndicator?.icon && (n = `<span class="value-icon">${g.sanitize(e.data.customIndicator.icon)}</span>`));
1379
+ let r = e.data.value ? `<div class="value" style="${t}"><span class="value-label">${g.sanitize(e.data.value.label)}</span>${n}</div>` : "", i = [];
1356
1380
  return e.data._upToTheRootHighlighted && i.push("node-highlight"), `
1357
1381
  <div class="node-content layout-b ${i.join(" ")}">
1358
- <div class="label">${_.sanitize(e.data.label)}</div>
1382
+ <div class="label">${g.sanitize(e.data.label)}</div>
1359
1383
  ${r}
1360
1384
  </div>`;
1361
- }, br = (e, t) => {
1385
+ }, wr = (e, t) => {
1362
1386
  let n = {
1363
1387
  ...z.labelStyle,
1364
- ...t.treeChartSettings.nodeLayout?.labelStyle
1388
+ ...t.treeChartSettings.nodeLayout?.labelStyle,
1389
+ fontSize: t.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? z.labelStyle?.fontSize
1365
1390
  }, r = {
1366
1391
  ...z.valueStyle,
1367
- ...t.treeChartSettings.nodeLayout?.valueStyle
1392
+ ...t.treeChartSettings.nodeLayout?.valueStyle,
1393
+ fontSize: t.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? z.valueStyle?.fontSize
1368
1394
  };
1369
1395
  return `
1370
1396
  #${e} {
@@ -1408,19 +1434,21 @@ var _r = (e, t) => {
1408
1434
  }
1409
1435
  }
1410
1436
  }`;
1411
- }, xr = {
1437
+ }, Tr = {
1412
1438
  name: "Basic",
1413
1439
  ...z,
1414
- getNodeContent: yr,
1415
- getCSS: br,
1440
+ getNodeContent: Cr,
1441
+ getCSS: wr,
1416
1442
  width: 140,
1417
1443
  sizes: (e) => {
1418
1444
  let t = {
1419
1445
  ...z.labelStyle,
1420
- ...e.treeChartSettings.nodeLayout?.labelStyle
1446
+ ...e.treeChartSettings.nodeLayout?.labelStyle,
1447
+ fontSize: e.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? z.labelStyle?.fontSize
1421
1448
  }, n = {
1422
1449
  ...z.valueStyle,
1423
- ...e.treeChartSettings.nodeLayout?.valueStyle
1450
+ ...e.treeChartSettings.nodeLayout?.valueStyle,
1451
+ fontSize: e.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? z.valueStyle?.fontSize
1424
1452
  };
1425
1453
  return {
1426
1454
  label: D(t.fontSize) + 8,
@@ -1428,34 +1456,34 @@ var _r = (e, t) => {
1428
1456
  };
1429
1457
  },
1430
1458
  height: (e, t) => {
1431
- let n = 8 + t.label;
1432
- return e.data.value && (n += 8 + t.value), n;
1459
+ let n = 8 + (t?.label ?? 0);
1460
+ return e.data.value && (n += 8 + (t?.value ?? 0)), n;
1433
1461
  }
1434
- }, Sr = {
1435
- [a.KPIChange]: vr,
1436
- [a.Basic]: xr
1437
- }, Cr = { passive: !1 }, B = {
1462
+ }, Er = {
1463
+ [d.KPIChange]: Sr,
1464
+ [d.Basic]: Tr
1465
+ }, Dr = { passive: !1 }, B = {
1438
1466
  capture: !0,
1439
1467
  passive: !1
1440
1468
  };
1441
- function wr(e) {
1469
+ function Or(e) {
1442
1470
  e.stopImmediatePropagation();
1443
1471
  }
1444
1472
  function V(e) {
1445
1473
  e.preventDefault(), e.stopImmediatePropagation();
1446
1474
  }
1447
- function Tr(e) {
1475
+ function kr(e) {
1448
1476
  var t = e.document.documentElement, n = P(e).on("dragstart.drag", V, B);
1449
1477
  "onselectstart" in t ? n.on("selectstart.drag", V, B) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
1450
1478
  }
1451
- function Er(e, t) {
1479
+ function Ar(e, t) {
1452
1480
  var n = e.document.documentElement, r = P(e).on("dragstart.drag", null);
1453
1481
  t && (r.on("click.drag", V, B), setTimeout(function() {
1454
1482
  r.on("click.drag", null);
1455
1483
  }, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
1456
1484
  }
1457
- var Dr = (e) => () => e;
1458
- function Or(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
1485
+ var jr = (e) => () => e;
1486
+ function Mr(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
1459
1487
  Object.defineProperties(this, {
1460
1488
  type: {
1461
1489
  value: e,
@@ -1510,34 +1538,34 @@ function Or(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a
1510
1538
  _: { value: u }
1511
1539
  });
1512
1540
  }
1513
- Or.prototype.on = function() {
1541
+ Mr.prototype.on = function() {
1514
1542
  var e = this._.on.apply(this._, arguments);
1515
1543
  return e === this._ ? this : e;
1516
- }, Me();
1517
- function kr(e) {
1544
+ }, Fe();
1545
+ function Nr(e) {
1518
1546
  return !e.ctrlKey && !e.button;
1519
1547
  }
1520
- function Ar() {
1548
+ function Pr() {
1521
1549
  return this.parentNode;
1522
1550
  }
1523
- function jr(e, t) {
1551
+ function Fr(e, t) {
1524
1552
  return t ?? {
1525
1553
  x: e.x,
1526
1554
  y: e.y
1527
1555
  };
1528
1556
  }
1529
- function Mr() {
1557
+ function Ir() {
1530
1558
  return navigator.maxTouchPoints || "ontouchstart" in this;
1531
1559
  }
1532
- function Nr() {
1533
- var e = kr, t = Ar, n = jr, r = Mr, i = {}, a = je("start", "drag", "end"), o = 0, s, c, l, u, d = 0;
1560
+ function Lr() {
1561
+ var e = Nr, t = Pr, n = Fr, r = Ir, i = {}, a = Pe("start", "drag", "end"), o = 0, s, c, l, u, d = 0;
1534
1562
  function f(e) {
1535
- e.on("mousedown.drag", p).filter(r).on("touchstart.drag", g).on("touchmove.drag", _, Cr).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1563
+ e.on("mousedown.drag", p).filter(r).on("touchstart.drag", g).on("touchmove.drag", _, Dr).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1536
1564
  }
1537
1565
  function p(n, r) {
1538
1566
  if (!(u || !e.call(this, n, r))) {
1539
1567
  var i = y(this, t.call(this, n, r), n, r, "mouse");
1540
- i && (P(n.view).on("mousemove.drag", m, B).on("mouseup.drag", h, B), Tr(n.view), wr(n), l = !1, s = n.clientX, c = n.clientY, i("start", n));
1568
+ i && (P(n.view).on("mousemove.drag", m, B).on("mouseup.drag", h, B), kr(n.view), Or(n), l = !1, s = n.clientX, c = n.clientY, i("start", n));
1541
1569
  }
1542
1570
  }
1543
1571
  function m(e) {
@@ -1548,12 +1576,12 @@ function Nr() {
1548
1576
  i.mouse("drag", e);
1549
1577
  }
1550
1578
  function h(e) {
1551
- P(e.view).on("mousemove.drag mouseup.drag", null), Er(e.view, l), V(e), i.mouse("end", e);
1579
+ P(e.view).on("mousemove.drag mouseup.drag", null), Ar(e.view, l), V(e), i.mouse("end", e);
1552
1580
  }
1553
1581
  function g(n, r) {
1554
1582
  if (e.call(this, n, r)) {
1555
1583
  var i = n.changedTouches, a = t.call(this, n, r), o = i.length, s, c;
1556
- for (s = 0; s < o; ++s) (c = y(this, a, n, r, i[s].identifier, i[s])) && (wr(n), c("start", n, i[s]));
1584
+ for (s = 0; s < o; ++s) (c = y(this, a, n, r, i[s].identifier, i[s])) && (Or(n), c("start", n, i[s]));
1557
1585
  }
1558
1586
  }
1559
1587
  function _(e) {
@@ -1564,11 +1592,11 @@ function Nr() {
1564
1592
  var t = e.changedTouches, n = t.length, r, a;
1565
1593
  for (u && clearTimeout(u), u = setTimeout(function() {
1566
1594
  u = null;
1567
- }, 500), r = 0; r < n; ++r) (a = i[t[r].identifier]) && (wr(e), a("end", e, t[r]));
1595
+ }, 500), r = 0; r < n; ++r) (a = i[t[r].identifier]) && (Or(e), a("end", e, t[r]));
1568
1596
  }
1569
1597
  function y(e, t, r, s, c, l) {
1570
1598
  var u = a.copy(), d = F(l || r, t), p, m, h;
1571
- if ((h = n.call(e, new Or("beforestart", {
1599
+ if ((h = n.call(e, new Mr("beforestart", {
1572
1600
  sourceEvent: r,
1573
1601
  target: f,
1574
1602
  identifier: c,
@@ -1589,7 +1617,7 @@ function Nr() {
1589
1617
  d = F(l || a, t), _ = o;
1590
1618
  break;
1591
1619
  }
1592
- u.call(r, e, new Or(r, {
1620
+ u.call(r, e, new Mr(r, {
1593
1621
  sourceEvent: a,
1594
1622
  subject: h,
1595
1623
  target: f,
@@ -1604,13 +1632,13 @@ function Nr() {
1604
1632
  };
1605
1633
  }
1606
1634
  return f.filter = function(t) {
1607
- return arguments.length ? (e = typeof t == "function" ? t : Dr(!!t), f) : e;
1635
+ return arguments.length ? (e = typeof t == "function" ? t : jr(!!t), f) : e;
1608
1636
  }, f.container = function(e) {
1609
- return arguments.length ? (t = typeof e == "function" ? e : Dr(e), f) : t;
1637
+ return arguments.length ? (t = typeof e == "function" ? e : jr(e), f) : t;
1610
1638
  }, f.subject = function(e) {
1611
- return arguments.length ? (n = typeof e == "function" ? e : Dr(e), f) : n;
1639
+ return arguments.length ? (n = typeof e == "function" ? e : jr(e), f) : n;
1612
1640
  }, f.touchable = function(e) {
1613
- return arguments.length ? (r = typeof e == "function" ? e : Dr(!!e), f) : r;
1641
+ return arguments.length ? (r = typeof e == "function" ? e : jr(!!e), f) : r;
1614
1642
  }, f.on = function() {
1615
1643
  var e = a.on.apply(a, arguments);
1616
1644
  return e === a ? f : e;
@@ -1618,74 +1646,74 @@ function Nr() {
1618
1646
  return arguments.length ? (d = (e = +e) * e, f) : Math.sqrt(d);
1619
1647
  }, f;
1620
1648
  }
1621
- var H = 0, Pr = 0, Fr = 0, Ir = 1e3, Lr, U, Rr = 0, W = 0, zr = 0, G = typeof performance == "object" && performance.now ? performance : Date, Br = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
1649
+ var H = 0, Rr = 0, zr = 0, Br = 1e3, Vr, U, Hr = 0, W = 0, Ur = 0, G = typeof performance == "object" && performance.now ? performance : Date, Wr = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
1622
1650
  setTimeout(e, 17);
1623
1651
  };
1624
- function Vr() {
1625
- return W ||= (Br(Hr), G.now() + zr);
1652
+ function Gr() {
1653
+ return W ||= (Wr(Kr), G.now() + Ur);
1626
1654
  }
1627
- function Hr() {
1655
+ function Kr() {
1628
1656
  W = 0;
1629
1657
  }
1630
- function Ur() {
1658
+ function qr() {
1631
1659
  this._call = this._time = this._next = null;
1632
1660
  }
1633
- Ur.prototype = Wr.prototype = {
1634
- constructor: Ur,
1661
+ qr.prototype = Jr.prototype = {
1662
+ constructor: qr,
1635
1663
  restart: function(e, t, n) {
1636
1664
  if (typeof e != "function") throw TypeError("callback is not a function");
1637
- n = (n == null ? Vr() : +n) + (t == null ? 0 : +t), !this._next && U !== this && (U ? U._next = this : Lr = this, U = this), this._call = e, this._time = n, Yr();
1665
+ n = (n == null ? Gr() : +n) + (t == null ? 0 : +t), !this._next && U !== this && (U ? U._next = this : Vr = this, U = this), this._call = e, this._time = n, $r();
1638
1666
  },
1639
1667
  stop: function() {
1640
- this._call && (this._call = null, this._time = Infinity, Yr());
1668
+ this._call && (this._call = null, this._time = Infinity, $r());
1641
1669
  }
1642
1670
  };
1643
- function Wr(e, t, n) {
1644
- var r = new Ur();
1671
+ function Jr(e, t, n) {
1672
+ var r = new qr();
1645
1673
  return r.restart(e, t, n), r;
1646
1674
  }
1647
- function Gr() {
1648
- Vr(), ++H;
1649
- for (var e = Lr, t; e;) (t = W - e._time) >= 0 && e._call.call(void 0, t), e = e._next;
1675
+ function Yr() {
1676
+ Gr(), ++H;
1677
+ for (var e = Vr, t; e;) (t = W - e._time) >= 0 && e._call.call(void 0, t), e = e._next;
1650
1678
  --H;
1651
1679
  }
1652
- function Kr() {
1653
- W = (Rr = G.now()) + zr, H = Pr = 0;
1680
+ function Xr() {
1681
+ W = (Hr = G.now()) + Ur, H = Rr = 0;
1654
1682
  try {
1655
- Gr();
1683
+ Yr();
1656
1684
  } finally {
1657
- H = 0, Jr(), W = 0;
1685
+ H = 0, Qr(), W = 0;
1658
1686
  }
1659
1687
  }
1660
- function qr() {
1661
- var e = G.now(), t = e - Rr;
1662
- t > Ir && (zr -= t, Rr = e);
1688
+ function Zr() {
1689
+ var e = G.now(), t = e - Hr;
1690
+ t > Br && (Ur -= t, Hr = e);
1663
1691
  }
1664
- function Jr() {
1665
- for (var e, t = Lr, n, r = Infinity; t;) t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Lr = n);
1666
- U = e, Yr(r);
1692
+ function Qr() {
1693
+ for (var e, t = Vr, n, r = Infinity; t;) t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Vr = n);
1694
+ U = e, $r(r);
1667
1695
  }
1668
- function Yr(e) {
1669
- H || (Pr &&= clearTimeout(Pr), e - W > 24 ? (e < Infinity && (Pr = setTimeout(Kr, e - G.now() - zr)), Fr &&= clearInterval(Fr)) : (Fr ||= (Rr = G.now(), setInterval(qr, Ir)), H = 1, Br(Kr)));
1696
+ function $r(e) {
1697
+ H || (Rr &&= clearTimeout(Rr), e - W > 24 ? (e < Infinity && (Rr = setTimeout(Xr, e - G.now() - Ur)), zr &&= clearInterval(zr)) : (zr ||= (Hr = G.now(), setInterval(Zr, Br)), H = 1, Wr(Xr)));
1670
1698
  }
1671
- function Xr(e, t, n) {
1672
- var r = new Ur();
1699
+ function ei(e, t, n) {
1700
+ var r = new qr();
1673
1701
  return t = t == null ? 0 : +t, r.restart((n) => {
1674
1702
  r.stop(), e(n + t);
1675
1703
  }, t, n), r;
1676
1704
  }
1677
- xe(), he(), Me();
1678
- var Zr = je("start", "end", "cancel", "interrupt"), Qr = [];
1679
- function $r(e, t, n, r, i, a) {
1705
+ Ce(), ve(), Fe();
1706
+ var ti = Pe("start", "end", "cancel", "interrupt"), ni = [];
1707
+ function ri(e, t, n, r, i, a) {
1680
1708
  var o = e.__transition;
1681
1709
  if (!o) e.__transition = {};
1682
1710
  else if (n in o) return;
1683
- ti(e, n, {
1711
+ ai(e, n, {
1684
1712
  name: t,
1685
1713
  index: r,
1686
1714
  group: i,
1687
- on: Zr,
1688
- tween: Qr,
1715
+ on: ti,
1716
+ tween: ni,
1689
1717
  time: a.time,
1690
1718
  delay: a.delay,
1691
1719
  duration: a.duration,
@@ -1694,7 +1722,7 @@ function $r(e, t, n, r, i, a) {
1694
1722
  state: 0
1695
1723
  });
1696
1724
  }
1697
- function ei(e, t) {
1725
+ function ii(e, t) {
1698
1726
  var n = q(e, t);
1699
1727
  if (n.state > 0) throw Error("too late; already scheduled");
1700
1728
  return n;
@@ -1709,9 +1737,9 @@ function q(e, t) {
1709
1737
  if (!n || !(n = n[t])) throw Error("transition not found");
1710
1738
  return n;
1711
1739
  }
1712
- function ti(e, t, n) {
1740
+ function ai(e, t, n) {
1713
1741
  var r = e.__transition, i;
1714
- r[t] = n, n.timer = Wr(a, 0, n.time);
1742
+ r[t] = n, n.timer = Jr(a, 0, n.time);
1715
1743
  function a(e) {
1716
1744
  n.state = 1, n.timer.restart(o, n.delay, n.time), n.delay <= e && o(e - n.delay);
1717
1745
  }
@@ -1719,10 +1747,10 @@ function ti(e, t, n) {
1719
1747
  var l, u, d, f;
1720
1748
  if (n.state !== 1) return c();
1721
1749
  for (l in r) if (f = r[l], f.name === n.name) {
1722
- if (f.state === 3) return Xr(o);
1750
+ if (f.state === 3) return ei(o);
1723
1751
  f.state === 4 ? (f.state = 6, f.timer.stop(), f.on.call("interrupt", e, e.__data__, f.index, f.group), delete r[l]) : +l < t && (f.state = 6, f.timer.stop(), f.on.call("cancel", e, e.__data__, f.index, f.group), delete r[l]);
1724
1752
  }
1725
- if (Xr(function() {
1753
+ if (ei(function() {
1726
1754
  n.state === 3 && (n.state = 4, n.timer.restart(s, n.delay, n.time), s(a));
1727
1755
  }), n.state = 2, n.on.call("start", e, e.__data__, n.index, n.group), n.state === 2) {
1728
1756
  for (n.state = 3, i = Array(d = n.tween.length), l = 0, u = -1; l < d; ++l) (f = n.tween[l].value.call(e, e.__data__, n.index, n.group)) && (i[++u] = f);
@@ -1738,7 +1766,7 @@ function ti(e, t, n) {
1738
1766
  delete e.__transition;
1739
1767
  }
1740
1768
  }
1741
- function ni(e, t) {
1769
+ function oi(e, t) {
1742
1770
  var n = e.__transition, r, i, a = !0, o;
1743
1771
  if (n) {
1744
1772
  for (o in t = t == null ? null : t + "", n) {
@@ -1751,12 +1779,12 @@ function ni(e, t) {
1751
1779
  a && delete e.__transition;
1752
1780
  }
1753
1781
  }
1754
- function ri(e) {
1782
+ function si(e) {
1755
1783
  return this.each(function() {
1756
- ni(this, e);
1784
+ oi(this, e);
1757
1785
  });
1758
1786
  }
1759
- function ii(e, t) {
1787
+ function ci(e, t) {
1760
1788
  var n, r;
1761
1789
  return function() {
1762
1790
  var i = K(this, e), a = i.tween;
@@ -1770,7 +1798,7 @@ function ii(e, t) {
1770
1798
  i.tween = r;
1771
1799
  };
1772
1800
  }
1773
- function ai(e, t, n) {
1801
+ function li(e, t, n) {
1774
1802
  var r, i;
1775
1803
  if (typeof n != "function") throw Error();
1776
1804
  return function() {
@@ -1789,15 +1817,15 @@ function ai(e, t, n) {
1789
1817
  a.tween = i;
1790
1818
  };
1791
1819
  }
1792
- function oi(e, t) {
1820
+ function ui(e, t) {
1793
1821
  var n = this._id;
1794
1822
  if (e += "", arguments.length < 2) {
1795
1823
  for (var r = q(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === e) return o.value;
1796
1824
  return null;
1797
1825
  }
1798
- return this.each((t == null ? ii : ai)(n, e, t));
1826
+ return this.each((t == null ? ci : li)(n, e, t));
1799
1827
  }
1800
- function si(e, t, n) {
1828
+ function di(e, t, n) {
1801
1829
  var r = e._id;
1802
1830
  return e.each(function() {
1803
1831
  var e = K(this, r);
@@ -1806,289 +1834,289 @@ function si(e, t, n) {
1806
1834
  return q(e, r).value[t];
1807
1835
  };
1808
1836
  }
1809
- function ci(e, t) {
1837
+ function fi(e, t) {
1810
1838
  var n;
1811
- return (typeof t == "number" ? ae : t instanceof be ? ue : (n = be(t)) ? (t = n, ue) : ve)(e, t);
1839
+ return (typeof t == "number" ? ae : t instanceof Se ? he : (n = Se(t)) ? (t = n, he) : le)(e, t);
1812
1840
  }
1813
- he();
1814
- function li(e) {
1841
+ ve();
1842
+ function pi(e) {
1815
1843
  return function() {
1816
1844
  this.removeAttribute(e);
1817
1845
  };
1818
1846
  }
1819
- function ui(e) {
1847
+ function mi(e) {
1820
1848
  return function() {
1821
1849
  this.removeAttributeNS(e.space, e.local);
1822
1850
  };
1823
1851
  }
1824
- function di(e, t, n) {
1852
+ function hi(e, t, n) {
1825
1853
  var r, i = n + "", a;
1826
1854
  return function() {
1827
1855
  var o = this.getAttribute(e);
1828
1856
  return o === i ? null : o === r ? a : a = t(r = o, n);
1829
1857
  };
1830
1858
  }
1831
- function fi(e, t, n) {
1859
+ function gi(e, t, n) {
1832
1860
  var r, i = n + "", a;
1833
1861
  return function() {
1834
1862
  var o = this.getAttributeNS(e.space, e.local);
1835
1863
  return o === i ? null : o === r ? a : a = t(r = o, n);
1836
1864
  };
1837
1865
  }
1838
- function pi(e, t, n) {
1866
+ function _i(e, t, n) {
1839
1867
  var r, i, a;
1840
1868
  return function() {
1841
1869
  var o, s = n(this), c;
1842
1870
  return s == null ? void this.removeAttribute(e) : (o = this.getAttribute(e), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s)));
1843
1871
  };
1844
1872
  }
1845
- function mi(e, t, n) {
1873
+ function vi(e, t, n) {
1846
1874
  var r, i, a;
1847
1875
  return function() {
1848
1876
  var o, s = n(this), c;
1849
1877
  return s == null ? void this.removeAttributeNS(e.space, e.local) : (o = this.getAttributeNS(e.space, e.local), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s)));
1850
1878
  };
1851
1879
  }
1852
- function hi(e, t) {
1853
- var n = ut(e), r = n === "transform" ? ye : ci;
1854
- return this.attrTween(e, typeof t == "function" ? (n.local ? mi : pi)(n, r, si(this, "attr." + e, t)) : t == null ? (n.local ? ui : li)(n) : (n.local ? fi : di)(n, r, t));
1880
+ function yi(e, t) {
1881
+ var n = mt(e), r = n === "transform" ? ie : fi;
1882
+ return this.attrTween(e, typeof t == "function" ? (n.local ? vi : _i)(n, r, di(this, "attr." + e, t)) : t == null ? (n.local ? mi : pi)(n) : (n.local ? gi : hi)(n, r, t));
1855
1883
  }
1856
- function gi(e, t) {
1884
+ function bi(e, t) {
1857
1885
  return function(n) {
1858
1886
  this.setAttribute(e, t.call(this, n));
1859
1887
  };
1860
1888
  }
1861
- function _i(e, t) {
1889
+ function xi(e, t) {
1862
1890
  return function(n) {
1863
1891
  this.setAttributeNS(e.space, e.local, t.call(this, n));
1864
1892
  };
1865
1893
  }
1866
- function vi(e, t) {
1894
+ function Si(e, t) {
1867
1895
  var n, r;
1868
1896
  function i() {
1869
1897
  var i = t.apply(this, arguments);
1870
- return i !== r && (n = (r = i) && _i(e, i)), n;
1898
+ return i !== r && (n = (r = i) && xi(e, i)), n;
1871
1899
  }
1872
1900
  return i._value = t, i;
1873
1901
  }
1874
- function yi(e, t) {
1902
+ function Ci(e, t) {
1875
1903
  var n, r;
1876
1904
  function i() {
1877
1905
  var i = t.apply(this, arguments);
1878
- return i !== r && (n = (r = i) && gi(e, i)), n;
1906
+ return i !== r && (n = (r = i) && bi(e, i)), n;
1879
1907
  }
1880
1908
  return i._value = t, i;
1881
1909
  }
1882
- function bi(e, t) {
1910
+ function wi(e, t) {
1883
1911
  var n = "attr." + e;
1884
1912
  if (arguments.length < 2) return (n = this.tween(n)) && n._value;
1885
1913
  if (t == null) return this.tween(n, null);
1886
1914
  if (typeof t != "function") throw Error();
1887
- var r = ut(e);
1888
- return this.tween(n, (r.local ? vi : yi)(r, t));
1915
+ var r = mt(e);
1916
+ return this.tween(n, (r.local ? Si : Ci)(r, t));
1889
1917
  }
1890
- function xi(e, t) {
1918
+ function Ti(e, t) {
1891
1919
  return function() {
1892
- ei(this, e).delay = +t.apply(this, arguments);
1920
+ ii(this, e).delay = +t.apply(this, arguments);
1893
1921
  };
1894
1922
  }
1895
- function Si(e, t) {
1923
+ function Ei(e, t) {
1896
1924
  return t = +t, function() {
1897
- ei(this, e).delay = t;
1925
+ ii(this, e).delay = t;
1898
1926
  };
1899
1927
  }
1900
- function Ci(e) {
1928
+ function Di(e) {
1901
1929
  var t = this._id;
1902
- return arguments.length ? this.each((typeof e == "function" ? xi : Si)(t, e)) : q(this.node(), t).delay;
1930
+ return arguments.length ? this.each((typeof e == "function" ? Ti : Ei)(t, e)) : q(this.node(), t).delay;
1903
1931
  }
1904
- function wi(e, t) {
1932
+ function Oi(e, t) {
1905
1933
  return function() {
1906
1934
  K(this, e).duration = +t.apply(this, arguments);
1907
1935
  };
1908
1936
  }
1909
- function Ti(e, t) {
1937
+ function ki(e, t) {
1910
1938
  return t = +t, function() {
1911
1939
  K(this, e).duration = t;
1912
1940
  };
1913
1941
  }
1914
- function Ei(e) {
1942
+ function Ai(e) {
1915
1943
  var t = this._id;
1916
- return arguments.length ? this.each((typeof e == "function" ? wi : Ti)(t, e)) : q(this.node(), t).duration;
1944
+ return arguments.length ? this.each((typeof e == "function" ? Oi : ki)(t, e)) : q(this.node(), t).duration;
1917
1945
  }
1918
- function Di(e, t) {
1946
+ function ji(e, t) {
1919
1947
  if (typeof t != "function") throw Error();
1920
1948
  return function() {
1921
1949
  K(this, e).ease = t;
1922
1950
  };
1923
1951
  }
1924
- function Oi(e) {
1952
+ function Mi(e) {
1925
1953
  var t = this._id;
1926
- return arguments.length ? this.each(Di(t, e)) : q(this.node(), t).ease;
1954
+ return arguments.length ? this.each(ji(t, e)) : q(this.node(), t).ease;
1927
1955
  }
1928
- function ki(e, t) {
1956
+ function Ni(e, t) {
1929
1957
  return function() {
1930
1958
  var n = t.apply(this, arguments);
1931
1959
  if (typeof n != "function") throw Error();
1932
1960
  K(this, e).ease = n;
1933
1961
  };
1934
1962
  }
1935
- function Ai(e) {
1963
+ function Pi(e) {
1936
1964
  if (typeof e != "function") throw Error();
1937
- return this.each(ki(this._id, e));
1965
+ return this.each(Ni(this._id, e));
1938
1966
  }
1939
- function ji(e) {
1940
- typeof e != "function" && (e = St(e));
1967
+ function Fi(e) {
1968
+ typeof e != "function" && (e = Et(e));
1941
1969
  for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = [], c, l = 0; l < o; ++l) (c = a[l]) && e.call(c, c.__data__, l, a) && s.push(c);
1942
1970
  return new J(r, this._parents, this._name, this._id);
1943
1971
  }
1944
- function Mi(e) {
1972
+ function Ii(e) {
1945
1973
  if (e._id !== this._id) throw Error();
1946
1974
  for (var t = this._groups, n = e._groups, r = t.length, i = n.length, a = Math.min(r, i), o = Array(r), s = 0; s < a; ++s) for (var c = t[s], l = n[s], u = c.length, d = o[s] = Array(u), f, p = 0; p < u; ++p) (f = c[p] || l[p]) && (d[p] = f);
1947
1975
  for (; s < r; ++s) o[s] = t[s];
1948
1976
  return new J(o, this._parents, this._name, this._id);
1949
1977
  }
1950
- function Ni(e) {
1978
+ function Li(e) {
1951
1979
  return (e + "").trim().split(/^|\s+/).every(function(e) {
1952
1980
  var t = e.indexOf(".");
1953
1981
  return t >= 0 && (e = e.slice(0, t)), !e || e === "start";
1954
1982
  });
1955
1983
  }
1956
- function Pi(e, t, n) {
1957
- var r, i, a = Ni(t) ? ei : K;
1984
+ function Ri(e, t, n) {
1985
+ var r, i, a = Li(t) ? ii : K;
1958
1986
  return function() {
1959
1987
  var o = a(this, e), s = o.on;
1960
1988
  s !== r && (i = (r = s).copy()).on(t, n), o.on = i;
1961
1989
  };
1962
1990
  }
1963
- function Fi(e, t) {
1991
+ function zi(e, t) {
1964
1992
  var n = this._id;
1965
- return arguments.length < 2 ? q(this.node(), n).on.on(e) : this.each(Pi(n, e, t));
1993
+ return arguments.length < 2 ? q(this.node(), n).on.on(e) : this.each(Ri(n, e, t));
1966
1994
  }
1967
- function Ii(e) {
1995
+ function Bi(e) {
1968
1996
  return function() {
1969
1997
  var t = this.parentNode;
1970
1998
  for (var n in this.__transition) if (+n !== e) return;
1971
1999
  t && t.removeChild(this);
1972
2000
  };
1973
2001
  }
1974
- function Li() {
1975
- return this.on("end.remove", Ii(this._id));
2002
+ function Vi() {
2003
+ return this.on("end.remove", Bi(this._id));
1976
2004
  }
1977
- function Ri(e) {
2005
+ function Hi(e) {
1978
2006
  var t = this._name, n = this._id;
1979
- typeof e != "function" && (e = ht(e));
1980
- for (var r = this._groups, i = r.length, a = Array(i), o = 0; o < i; ++o) for (var s = r[o], c = s.length, l = a[o] = Array(c), u, d, f = 0; f < c; ++f) (u = s[f]) && (d = e.call(u, u.__data__, f, s)) && ("__data__" in u && (d.__data__ = u.__data__), l[f] = d, $r(l[f], t, n, f, l, q(u, n)));
2007
+ typeof e != "function" && (e = yt(e));
2008
+ for (var r = this._groups, i = r.length, a = Array(i), o = 0; o < i; ++o) for (var s = r[o], c = s.length, l = a[o] = Array(c), u, d, f = 0; f < c; ++f) (u = s[f]) && (d = e.call(u, u.__data__, f, s)) && ("__data__" in u && (d.__data__ = u.__data__), l[f] = d, ri(l[f], t, n, f, l, q(u, n)));
1981
2009
  return new J(a, this._parents, t, n);
1982
2010
  }
1983
- function zi(e) {
2011
+ function Ui(e) {
1984
2012
  var t = this._name, n = this._id;
1985
- typeof e != "function" && (e = yt(e));
2013
+ typeof e != "function" && (e = Ct(e));
1986
2014
  for (var r = this._groups, i = r.length, a = [], o = [], s = 0; s < i; ++s) for (var c = r[s], l = c.length, u, d = 0; d < l; ++d) if (u = c[d]) {
1987
- for (var f = e.call(u, u.__data__, d, c), p, m = q(u, n), h = 0, g = f.length; h < g; ++h) (p = f[h]) && $r(p, t, n, h, f, m);
2015
+ for (var f = e.call(u, u.__data__, d, c), p, m = q(u, n), h = 0, g = f.length; h < g; ++h) (p = f[h]) && ri(p, t, n, h, f, m);
1988
2016
  a.push(f), o.push(u);
1989
2017
  }
1990
2018
  return new J(a, o, t, n);
1991
2019
  }
1992
- var Bi = N.prototype.constructor;
1993
- function Vi() {
1994
- return new Bi(this._groups, this._parents);
2020
+ var Wi = N.prototype.constructor;
2021
+ function Gi() {
2022
+ return new Wi(this._groups, this._parents);
1995
2023
  }
1996
- he();
1997
- function Hi(e, t) {
2024
+ ve();
2025
+ function Ki(e, t) {
1998
2026
  var n, r, i;
1999
2027
  return function() {
2000
2028
  var a = j(this, e), o = (this.style.removeProperty(e), j(this, e));
2001
2029
  return a === o ? null : a === n && o === r ? i : i = t(n = a, r = o);
2002
2030
  };
2003
2031
  }
2004
- function Ui(e) {
2032
+ function qi(e) {
2005
2033
  return function() {
2006
2034
  this.style.removeProperty(e);
2007
2035
  };
2008
2036
  }
2009
- function Wi(e, t, n) {
2037
+ function Ji(e, t, n) {
2010
2038
  var r, i = n + "", a;
2011
2039
  return function() {
2012
2040
  var o = j(this, e);
2013
2041
  return o === i ? null : o === r ? a : a = t(r = o, n);
2014
2042
  };
2015
2043
  }
2016
- function Gi(e, t, n) {
2044
+ function Yi(e, t, n) {
2017
2045
  var r, i, a;
2018
2046
  return function() {
2019
2047
  var o = j(this, e), s = n(this), c = s + "";
2020
2048
  return s ?? (c = s = (this.style.removeProperty(e), j(this, e))), o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s));
2021
2049
  };
2022
2050
  }
2023
- function Ki(e, t) {
2051
+ function Xi(e, t) {
2024
2052
  var n, r, i, a = "style." + t, o = "end." + a, s;
2025
2053
  return function() {
2026
- var c = K(this, e), l = c.on, u = c.value[a] == null ? s ||= Ui(t) : void 0;
2054
+ var c = K(this, e), l = c.on, u = c.value[a] == null ? s ||= qi(t) : void 0;
2027
2055
  (l !== n || i !== u) && (r = (n = l).copy()).on(o, i = u), c.on = r;
2028
2056
  };
2029
2057
  }
2030
- function qi(e, t, n) {
2031
- var r = (e += "") == "transform" ? _e : ci;
2032
- return t == null ? this.styleTween(e, Hi(e, r)).on("end.style." + e, Ui(e)) : typeof t == "function" ? this.styleTween(e, Gi(e, r, si(this, "style." + e, t))).each(Ki(this._id, e)) : this.styleTween(e, Wi(e, r, t), n).on("end.style." + e, null);
2058
+ function Zi(e, t, n) {
2059
+ var r = (e += "") == "transform" ? ce : fi;
2060
+ return t == null ? this.styleTween(e, Ki(e, r)).on("end.style." + e, qi(e)) : typeof t == "function" ? this.styleTween(e, Yi(e, r, di(this, "style." + e, t))).each(Xi(this._id, e)) : this.styleTween(e, Ji(e, r, t), n).on("end.style." + e, null);
2033
2061
  }
2034
- function Ji(e, t, n) {
2062
+ function Qi(e, t, n) {
2035
2063
  return function(r) {
2036
2064
  this.style.setProperty(e, t.call(this, r), n);
2037
2065
  };
2038
2066
  }
2039
- function Yi(e, t, n) {
2067
+ function $i(e, t, n) {
2040
2068
  var r, i;
2041
2069
  function a() {
2042
2070
  var a = t.apply(this, arguments);
2043
- return a !== i && (r = (i = a) && Ji(e, a, n)), r;
2071
+ return a !== i && (r = (i = a) && Qi(e, a, n)), r;
2044
2072
  }
2045
2073
  return a._value = t, a;
2046
2074
  }
2047
- function Xi(e, t, n) {
2075
+ function ea(e, t, n) {
2048
2076
  var r = "style." + (e += "");
2049
2077
  if (arguments.length < 2) return (r = this.tween(r)) && r._value;
2050
2078
  if (t == null) return this.tween(r, null);
2051
2079
  if (typeof t != "function") throw Error();
2052
- return this.tween(r, Yi(e, t, n ?? ""));
2080
+ return this.tween(r, $i(e, t, n ?? ""));
2053
2081
  }
2054
- function Zi(e) {
2082
+ function ta(e) {
2055
2083
  return function() {
2056
2084
  this.textContent = e;
2057
2085
  };
2058
2086
  }
2059
- function Qi(e) {
2087
+ function na(e) {
2060
2088
  return function() {
2061
2089
  var t = e(this);
2062
2090
  this.textContent = t ?? "";
2063
2091
  };
2064
2092
  }
2065
- function $i(e) {
2066
- return this.tween("text", typeof e == "function" ? Qi(si(this, "text", e)) : Zi(e == null ? "" : e + ""));
2093
+ function ra(e) {
2094
+ return this.tween("text", typeof e == "function" ? na(di(this, "text", e)) : ta(e == null ? "" : e + ""));
2067
2095
  }
2068
- function ea(e) {
2096
+ function ia(e) {
2069
2097
  return function(t) {
2070
2098
  this.textContent = e.call(this, t);
2071
2099
  };
2072
2100
  }
2073
- function ta(e) {
2101
+ function aa(e) {
2074
2102
  var t, n;
2075
2103
  function r() {
2076
2104
  var r = e.apply(this, arguments);
2077
- return r !== n && (t = (n = r) && ea(r)), t;
2105
+ return r !== n && (t = (n = r) && ia(r)), t;
2078
2106
  }
2079
2107
  return r._value = e, r;
2080
2108
  }
2081
- function na(e) {
2109
+ function oa(e) {
2082
2110
  var t = "text";
2083
2111
  if (arguments.length < 1) return (t = this.tween(t)) && t._value;
2084
2112
  if (e == null) return this.tween(t, null);
2085
2113
  if (typeof e != "function") throw Error();
2086
- return this.tween(t, ta(e));
2114
+ return this.tween(t, aa(e));
2087
2115
  }
2088
- function ra() {
2089
- for (var e = this._name, t = this._id, n = sa(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) if (c = o[l]) {
2116
+ function sa() {
2117
+ for (var e = this._name, t = this._id, n = da(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) if (c = o[l]) {
2090
2118
  var u = q(c, t);
2091
- $r(c, e, n, l, o, {
2119
+ ri(c, e, n, l, o, {
2092
2120
  time: u.time + u.delay + u.duration,
2093
2121
  delay: 0,
2094
2122
  duration: u.duration,
@@ -2097,7 +2125,7 @@ function ra() {
2097
2125
  }
2098
2126
  return new J(r, this._parents, e, n);
2099
2127
  }
2100
- function ia() {
2128
+ function ca() {
2101
2129
  var e, t, n = this, r = n._id, i = n.size();
2102
2130
  return new Promise(function(a, o) {
2103
2131
  var s = { value: o }, c = { value: function() {
@@ -2109,68 +2137,68 @@ function ia() {
2109
2137
  }), i === 0 && a();
2110
2138
  });
2111
2139
  }
2112
- var aa = 0;
2140
+ var la = 0;
2113
2141
  function J(e, t, n, r) {
2114
2142
  this._groups = e, this._parents = t, this._name = n, this._id = r;
2115
2143
  }
2116
- function oa(e) {
2144
+ function ua(e) {
2117
2145
  return N().transition(e);
2118
2146
  }
2119
- function sa() {
2120
- return ++aa;
2147
+ function da() {
2148
+ return ++la;
2121
2149
  }
2122
2150
  var Y = N.prototype;
2123
- J.prototype = oa.prototype = {
2151
+ J.prototype = ua.prototype = {
2124
2152
  constructor: J,
2125
- select: Ri,
2126
- selectAll: zi,
2153
+ select: Hi,
2154
+ selectAll: Ui,
2127
2155
  selectChild: Y.selectChild,
2128
2156
  selectChildren: Y.selectChildren,
2129
- filter: ji,
2130
- merge: Mi,
2131
- selection: Vi,
2132
- transition: ra,
2157
+ filter: Fi,
2158
+ merge: Ii,
2159
+ selection: Gi,
2160
+ transition: sa,
2133
2161
  call: Y.call,
2134
2162
  nodes: Y.nodes,
2135
2163
  node: Y.node,
2136
2164
  size: Y.size,
2137
2165
  empty: Y.empty,
2138
2166
  each: Y.each,
2139
- on: Fi,
2140
- attr: hi,
2141
- attrTween: bi,
2142
- style: qi,
2143
- styleTween: Xi,
2144
- text: $i,
2145
- textTween: na,
2146
- remove: Li,
2147
- tween: oi,
2148
- delay: Ci,
2149
- duration: Ei,
2150
- ease: Oi,
2151
- easeVarying: Ai,
2152
- end: ia,
2167
+ on: zi,
2168
+ attr: yi,
2169
+ attrTween: wi,
2170
+ style: Zi,
2171
+ styleTween: ea,
2172
+ text: ra,
2173
+ textTween: oa,
2174
+ remove: Vi,
2175
+ tween: ui,
2176
+ delay: Di,
2177
+ duration: Ai,
2178
+ ease: Mi,
2179
+ easeVarying: Pi,
2180
+ end: ca,
2153
2181
  [Symbol.iterator]: Y[Symbol.iterator]
2154
- }, fe();
2155
- var ca = {
2182
+ }, me();
2183
+ var fa = {
2156
2184
  time: null,
2157
2185
  delay: 0,
2158
2186
  duration: 250,
2159
2187
  ease: pe
2160
2188
  };
2161
- function la(e, t) {
2189
+ function pa(e, t) {
2162
2190
  for (var n; !(n = e.__transition) || !(n = n[t]);) if (!(e = e.parentNode)) throw Error(`transition ${t} not found`);
2163
2191
  return n;
2164
2192
  }
2165
- function ua(e) {
2193
+ function ma(e) {
2166
2194
  var t, n;
2167
- e instanceof J ? (t = e._id, e = e._name) : (t = sa(), (n = ca).time = Vr(), e = e == null ? null : e + "");
2168
- for (var r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && $r(c, e, t, l, o, n || la(c, t));
2195
+ e instanceof J ? (t = e._id, e = e._name) : (t = da(), (n = fa).time = Gr(), e = e == null ? null : e + "");
2196
+ for (var r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && ri(c, e, t, l, o, n || pa(c, t));
2169
2197
  return new J(r, this._parents, e, t);
2170
2198
  }
2171
- N.prototype.interrupt = ri, N.prototype.transition = ua;
2172
- var da = (e) => () => e;
2173
- function fa(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
2199
+ N.prototype.interrupt = si, N.prototype.transition = ma;
2200
+ var ha = (e) => () => e;
2201
+ function ga(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
2174
2202
  Object.defineProperties(this, {
2175
2203
  type: {
2176
2204
  value: e,
@@ -2234,47 +2262,47 @@ X.prototype = {
2234
2262
  return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
2235
2263
  }
2236
2264
  };
2237
- var pa = new X(1, 0, 0);
2238
- ma.prototype = X.prototype;
2239
- function ma(e) {
2240
- for (; !e.__zoom;) if (!(e = e.parentNode)) return pa;
2265
+ var _a = new X(1, 0, 0);
2266
+ va.prototype = X.prototype;
2267
+ function va(e) {
2268
+ for (; !e.__zoom;) if (!(e = e.parentNode)) return _a;
2241
2269
  return e.__zoom;
2242
2270
  }
2243
- function ha(e) {
2271
+ function ya(e) {
2244
2272
  e.stopImmediatePropagation();
2245
2273
  }
2246
- function ga(e) {
2274
+ function Z(e) {
2247
2275
  e.preventDefault(), e.stopImmediatePropagation();
2248
2276
  }
2249
- Me(), he();
2250
- function _a(e) {
2277
+ Fe(), ve();
2278
+ function ba(e) {
2251
2279
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
2252
2280
  }
2253
- function va() {
2281
+ function xa() {
2254
2282
  var e = this;
2255
2283
  return e instanceof SVGElement ? (e = e.ownerSVGElement || e, e.hasAttribute("viewBox") ? (e = e.viewBox.baseVal, [[e.x, e.y], [e.x + e.width, e.y + e.height]]) : [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]) : [[0, 0], [e.clientWidth, e.clientHeight]];
2256
2284
  }
2257
- function ya() {
2258
- return this.__zoom || pa;
2285
+ function Sa() {
2286
+ return this.__zoom || _a;
2259
2287
  }
2260
- function ba(e) {
2288
+ function Ca(e) {
2261
2289
  return -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * (e.ctrlKey ? 10 : 1);
2262
2290
  }
2263
- function xa() {
2291
+ function wa() {
2264
2292
  return navigator.maxTouchPoints || "ontouchstart" in this;
2265
2293
  }
2266
- function Sa(e, t, n) {
2294
+ function Ta(e, t, n) {
2267
2295
  var r = e.invertX(t[0][0]) - n[0][0], i = e.invertX(t[1][0]) - n[1][0], a = e.invertY(t[0][1]) - n[0][1], o = e.invertY(t[1][1]) - n[1][1];
2268
2296
  return e.translate(i > r ? (r + i) / 2 : Math.min(0, r) || Math.max(0, i), o > a ? (a + o) / 2 : Math.min(0, a) || Math.max(0, o));
2269
2297
  }
2270
- function Ca() {
2271
- var e = _a, t = va, n = Sa, r = ba, i = xa, a = [0, Infinity], o = [[-Infinity, -Infinity], [Infinity, Infinity]], s = 250, c = me, l = je("start", "zoom", "end"), u, d, f, p = 500, m = 150, h = 0, g = 10;
2298
+ function Ea() {
2299
+ var e = ba, t = xa, n = Ta, r = Ca, i = wa, a = [0, Infinity], o = [[-Infinity, -Infinity], [Infinity, Infinity]], s = 250, c = fe, l = Pe("start", "zoom", "end"), u, d, f, p = 500, m = 150, h = 0, g = 10;
2272
2300
  function _(e) {
2273
- e.property("__zoom", ya).on("wheel.zoom", w, { passive: !1 }).on("mousedown.zoom", T).on("dblclick.zoom", ee).filter(i).on("touchstart.zoom", te).on("touchmove.zoom", E).on("touchend.zoom touchcancel.zoom", ne).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2301
+ e.property("__zoom", Sa).on("wheel.zoom", ee, { passive: !1 }).on("mousedown.zoom", w).on("dblclick.zoom", te).filter(i).on("touchstart.zoom", ne).on("touchmove.zoom", T).on("touchend.zoom touchcancel.zoom", re).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2274
2302
  }
2275
2303
  _.transform = function(e, t, n, r) {
2276
2304
  var i = e.selection ? e.selection() : e;
2277
- i.property("__zoom", ya), e === i ? i.interrupt().each(function() {
2305
+ i.property("__zoom", Sa), e === i ? i.interrupt().each(function() {
2278
2306
  S(this, arguments).event(r).start().zoom(null, typeof t == "function" ? t.apply(this, arguments) : t).end();
2279
2307
  }) : x(e, t, n, r);
2280
2308
  }, _.scaleBy = function(e, t, n, r) {
@@ -2293,7 +2321,7 @@ function Ca() {
2293
2321
  }, _.translateTo = function(e, r, i, a, s) {
2294
2322
  _.transform(e, function() {
2295
2323
  var e = t.apply(this, arguments), s = this.__zoom, c = a == null ? b(e) : typeof a == "function" ? a.apply(this, arguments) : a;
2296
- return n(pa.translate(c[0], c[1]).scale(s.k).translate(typeof r == "function" ? -r.apply(this, arguments) : -r, typeof i == "function" ? -i.apply(this, arguments) : -i), e, o);
2324
+ return n(_a.translate(c[0], c[1]).scale(s.k).translate(typeof r == "function" ? -r.apply(this, arguments) : -r, typeof i == "function" ? -i.apply(this, arguments) : -i), e, o);
2297
2325
  }, a, s);
2298
2326
  };
2299
2327
  function v(e, t) {
@@ -2344,7 +2372,7 @@ function Ca() {
2344
2372
  },
2345
2373
  emit: function(e) {
2346
2374
  var t = P(this.that).datum();
2347
- l.call(e, this.that, new fa(e, {
2375
+ l.call(e, this.that, new ga(e, {
2348
2376
  sourceEvent: this.sourceEvent,
2349
2377
  target: _,
2350
2378
  type: e,
@@ -2353,55 +2381,55 @@ function Ca() {
2353
2381
  }), t);
2354
2382
  }
2355
2383
  };
2356
- function w(t, ...i) {
2384
+ function ee(t, ...i) {
2357
2385
  if (!e.apply(this, arguments)) return;
2358
2386
  var s = S(this, i).event(t), c = this.__zoom, l = Math.max(a[0], Math.min(a[1], c.k * 2 ** r.apply(this, arguments))), u = F(t);
2359
2387
  if (s.wheel) (s.mouse[0][0] !== u[0] || s.mouse[0][1] !== u[1]) && (s.mouse[1] = c.invert(s.mouse[0] = u)), clearTimeout(s.wheel);
2360
2388
  else if (c.k === l) return;
2361
- else s.mouse = [u, c.invert(u)], ni(this), s.start();
2362
- ga(t), s.wheel = setTimeout(d, m), s.zoom("mouse", n(y(v(c, l), s.mouse[0], s.mouse[1]), s.extent, o));
2389
+ else s.mouse = [u, c.invert(u)], oi(this), s.start();
2390
+ Z(t), s.wheel = setTimeout(d, m), s.zoom("mouse", n(y(v(c, l), s.mouse[0], s.mouse[1]), s.extent, o));
2363
2391
  function d() {
2364
2392
  s.wheel = null, s.end();
2365
2393
  }
2366
2394
  }
2367
- function T(t, ...r) {
2395
+ function w(t, ...r) {
2368
2396
  if (f || !e.apply(this, arguments)) return;
2369
2397
  var i = t.currentTarget, a = S(this, r, !0).event(t), s = P(t.view).on("mousemove.zoom", d, !0).on("mouseup.zoom", p, !0), c = F(t, i), l = t.clientX, u = t.clientY;
2370
- Tr(t.view), ha(t), a.mouse = [c, this.__zoom.invert(c)], ni(this), a.start();
2398
+ kr(t.view), ya(t), a.mouse = [c, this.__zoom.invert(c)], oi(this), a.start();
2371
2399
  function d(e) {
2372
- if (ga(e), !a.moved) {
2400
+ if (Z(e), !a.moved) {
2373
2401
  var t = e.clientX - l, r = e.clientY - u;
2374
2402
  a.moved = t * t + r * r > h;
2375
2403
  }
2376
2404
  a.event(e).zoom("mouse", n(y(a.that.__zoom, a.mouse[0] = F(e, i), a.mouse[1]), a.extent, o));
2377
2405
  }
2378
2406
  function p(e) {
2379
- s.on("mousemove.zoom mouseup.zoom", null), Er(e.view, a.moved), ga(e), a.event(e).end();
2407
+ s.on("mousemove.zoom mouseup.zoom", null), Ar(e.view, a.moved), Z(e), a.event(e).end();
2380
2408
  }
2381
2409
  }
2382
- function ee(r, ...i) {
2410
+ function te(r, ...i) {
2383
2411
  if (e.apply(this, arguments)) {
2384
2412
  var a = this.__zoom, c = F(r.changedTouches ? r.changedTouches[0] : r, this), l = a.invert(c), u = a.k * (r.shiftKey ? .5 : 2), d = n(y(v(a, u), c, l), t.apply(this, i), o);
2385
- ga(r), s > 0 ? P(this).transition().duration(s).call(x, d, c, r) : P(this).call(_.transform, d, c, r);
2413
+ Z(r), s > 0 ? P(this).transition().duration(s).call(x, d, c, r) : P(this).call(_.transform, d, c, r);
2386
2414
  }
2387
2415
  }
2388
- function te(t, ...n) {
2416
+ function ne(t, ...n) {
2389
2417
  if (e.apply(this, arguments)) {
2390
2418
  var r = t.touches, i = r.length, a = S(this, n, t.changedTouches.length === i).event(t), o, s, c, l;
2391
- for (ha(t), s = 0; s < i; ++s) c = r[s], l = F(c, this), l = [
2419
+ for (ya(t), s = 0; s < i; ++s) c = r[s], l = F(c, this), l = [
2392
2420
  l,
2393
2421
  this.__zoom.invert(l),
2394
2422
  c.identifier
2395
2423
  ], a.touch0 ? !a.touch1 && a.touch0[2] !== l[2] && (a.touch1 = l, a.taps = 0) : (a.touch0 = l, o = !0, a.taps = 1 + !!u);
2396
2424
  u &&= clearTimeout(u), o && (a.taps < 2 && (d = l[0], u = setTimeout(function() {
2397
2425
  u = null;
2398
- }, p)), ni(this), a.start());
2426
+ }, p)), oi(this), a.start());
2399
2427
  }
2400
2428
  }
2401
- function E(e, ...t) {
2429
+ function T(e, ...t) {
2402
2430
  if (this.__zooming) {
2403
2431
  var r = S(this, t).event(e), i = e.changedTouches, a = i.length, s, c, l, u;
2404
- for (ga(e), s = 0; s < a; ++s) c = i[s], l = F(c, this), r.touch0 && r.touch0[2] === c.identifier ? r.touch0[0] = l : r.touch1 && r.touch1[2] === c.identifier && (r.touch1[0] = l);
2432
+ for (Z(e), s = 0; s < a; ++s) c = i[s], l = F(c, this), r.touch0 && r.touch0[2] === c.identifier ? r.touch0[0] = l : r.touch1 && r.touch1[2] === c.identifier && (r.touch1[0] = l);
2405
2433
  if (c = r.that.__zoom, r.touch1) {
2406
2434
  var d = r.touch0[0], f = r.touch0[1], p = r.touch1[0], m = r.touch1[1], h = (h = p[0] - d[0]) * h + (h = p[1] - d[1]) * h, g = (g = m[0] - f[0]) * g + (g = m[1] - f[1]) * g;
2407
2435
  c = v(c, Math.sqrt(h / g)), l = [(d[0] + p[0]) / 2, (d[1] + p[1]) / 2], u = [(f[0] + m[0]) / 2, (f[1] + m[1]) / 2];
@@ -2410,10 +2438,10 @@ function Ca() {
2410
2438
  r.zoom("touch", n(y(c, l, u), r.extent, o));
2411
2439
  }
2412
2440
  }
2413
- function ne(e, ...t) {
2441
+ function re(e, ...t) {
2414
2442
  if (this.__zooming) {
2415
2443
  var n = S(this, t).event(e), r = e.changedTouches, i = r.length, a, o;
2416
- for (ha(e), f && clearTimeout(f), f = setTimeout(function() {
2444
+ for (ya(e), f && clearTimeout(f), f = setTimeout(function() {
2417
2445
  f = null;
2418
2446
  }, p), a = 0; a < i; ++a) o = r[a], n.touch0 && n.touch0[2] === o.identifier ? delete n.touch0 : n.touch1 && n.touch1[2] === o.identifier && delete n.touch1;
2419
2447
  if (n.touch1 && !n.touch0 && (n.touch0 = n.touch1, delete n.touch1), n.touch0) n.touch0[1] = this.__zoom.invert(n.touch0[0]);
@@ -2424,13 +2452,13 @@ function Ca() {
2424
2452
  }
2425
2453
  }
2426
2454
  return _.wheelDelta = function(e) {
2427
- return arguments.length ? (r = typeof e == "function" ? e : da(+e), _) : r;
2455
+ return arguments.length ? (r = typeof e == "function" ? e : ha(+e), _) : r;
2428
2456
  }, _.filter = function(t) {
2429
- return arguments.length ? (e = typeof t == "function" ? t : da(!!t), _) : e;
2457
+ return arguments.length ? (e = typeof t == "function" ? t : ha(!!t), _) : e;
2430
2458
  }, _.touchable = function(e) {
2431
- return arguments.length ? (i = typeof e == "function" ? e : da(!!e), _) : i;
2459
+ return arguments.length ? (i = typeof e == "function" ? e : ha(!!e), _) : i;
2432
2460
  }, _.extent = function(e) {
2433
- return arguments.length ? (t = typeof e == "function" ? e : da([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), _) : t;
2461
+ return arguments.length ? (t = typeof e == "function" ? e : ha([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), _) : t;
2434
2462
  }, _.scaleExtent = function(e) {
2435
2463
  return arguments.length ? (a[0] = +e[0], a[1] = +e[1], _) : [a[0], a[1]];
2436
2464
  }, _.translateExtent = function(e) {
@@ -2450,8 +2478,8 @@ function Ca() {
2450
2478
  return arguments.length ? (g = +e, _) : g;
2451
2479
  }, _;
2452
2480
  }
2453
- oe();
2454
- var wa = (e) => ({
2481
+ E();
2482
+ var Da = (e) => ({
2455
2483
  left: {
2456
2484
  nodeLeftX: () => 0,
2457
2485
  nodeRightX: (e) => e.width,
@@ -2465,10 +2493,10 @@ var wa = (e) => ({
2465
2493
  linkY: (e) => e.y,
2466
2494
  linkCompactXStart: (e) => e.x + e.width / 2,
2467
2495
  linkCompactYStart: (e) => e.y + (e.compactEven ? e.height / 2 : -e.height / 2),
2468
- compactLinkMidX: (e) => e.firstCompactNode.x,
2469
- compactLinkMidY: (e, t) => e.firstCompactNode.y + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2470
- linkParentX: (e) => e.parent.x + e.parent.width,
2471
- linkParentY: (e) => e.parent.y,
2496
+ compactLinkMidX: (e) => e.firstCompactNode?.x ?? e.x,
2497
+ compactLinkMidY: (e, t) => (e.firstCompactNode?.y ?? e.y) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2498
+ linkParentX: (e) => (e.parent?.x ?? e.x) + (e.parent?.width ?? 0),
2499
+ linkParentY: (e) => e.parent?.y ?? e.y,
2472
2500
  buttonX: (e) => e.width,
2473
2501
  buttonY: (e) => e.height / 2,
2474
2502
  centerTransform: ({ rootMargin: e, centerY: t, scale: n }) => `translate(${e},${t}) scale(${n})`,
@@ -2497,8 +2525,8 @@ var wa = (e) => ({
2497
2525
  linkJoinY: (e) => e.y + e.height,
2498
2526
  linkCompactXStart: (e) => e.x + (e.compactEven ? e.width / 2 : -e.width / 2),
2499
2527
  linkCompactYStart: (e) => e.y + e.height / 2,
2500
- compactLinkMidX: (e, t) => e.firstCompactNode.x + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2501
- compactLinkMidY: (e) => e.firstCompactNode.y,
2528
+ compactLinkMidX: (e, t) => (e.firstCompactNode?.x ?? e.x) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2529
+ compactLinkMidY: (e) => e.firstCompactNode?.y ?? e.y,
2502
2530
  compactDimension: {
2503
2531
  sizeColumn: (e) => e.width,
2504
2532
  sizeRow: (e) => e.height,
@@ -2506,8 +2534,8 @@ var wa = (e) => ({
2506
2534
  },
2507
2535
  linkX: (e) => e.x,
2508
2536
  linkY: (e) => e.y,
2509
- linkParentX: (e) => e.parent.x,
2510
- linkParentY: (e) => e.parent.y + e.parent.height,
2537
+ linkParentX: (e) => e.parent?.x ?? e.x,
2538
+ linkParentY: (e) => (e.parent?.y ?? e.y) + (e.parent?.height ?? 0),
2511
2539
  buttonX: (e) => e.width / 2,
2512
2540
  buttonY: (e) => e.height,
2513
2541
  centerTransform: ({ rootMargin: e, scale: t, centerX: n }) => `translate(${n},${e}) scale(${t})`,
@@ -2528,8 +2556,8 @@ var wa = (e) => ({
2528
2556
  linkJoinY: (e) => e.y - e.height,
2529
2557
  linkCompactXStart: (e) => e.x + (e.compactEven ? e.width / 2 : -e.width / 2),
2530
2558
  linkCompactYStart: (e) => e.y - e.height / 2,
2531
- compactLinkMidX: (e, t) => e.firstCompactNode.x + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2532
- compactLinkMidY: (e) => e.firstCompactNode.y,
2559
+ compactLinkMidX: (e, t) => (e.firstCompactNode?.x ?? e.x) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2560
+ compactLinkMidY: (e) => e.firstCompactNode?.y ?? e.y,
2533
2561
  linkX: (e) => e.x,
2534
2562
  linkY: (e) => e.y,
2535
2563
  compactDimension: {
@@ -2537,8 +2565,8 @@ var wa = (e) => ({
2537
2565
  sizeRow: (e) => e.height,
2538
2566
  reverse: (e) => e
2539
2567
  },
2540
- linkParentX: (e) => e.parent.x,
2541
- linkParentY: (e) => e.parent.y - e.parent.height,
2568
+ linkParentX: (e) => e.parent?.x ?? e.x,
2569
+ linkParentY: (e) => (e.parent?.y ?? e.y) - (e.parent?.height ?? 0),
2542
2570
  buttonX: (e) => e.width / 2,
2543
2571
  buttonY: () => 0,
2544
2572
  centerTransform: ({ rootMargin: e, scale: t, centerX: n, chartHeight: r }) => `translate(${n},${r - e}) scale(${t})`,
@@ -2561,14 +2589,14 @@ var wa = (e) => ({
2561
2589
  linkJoinY: (e) => e.y,
2562
2590
  linkX: (e) => e.x,
2563
2591
  linkY: (e) => e.y,
2564
- linkParentX: (e) => e.parent.x - e.parent.width,
2565
- linkParentY: (e) => e.parent.y,
2592
+ linkParentX: (e) => (e.parent?.x ?? e.x) - (e.parent?.width ?? 0),
2593
+ linkParentY: (e) => e.parent?.y ?? e.y,
2566
2594
  buttonX: () => 0,
2567
2595
  buttonY: (e) => e.height / 2,
2568
2596
  linkCompactXStart: (e) => e.x - e.width / 2,
2569
2597
  linkCompactYStart: (e) => e.y + (e.compactEven ? e.height / 2 : -e.height / 2),
2570
- compactLinkMidX: (e) => e.firstCompactNode.x,
2571
- compactLinkMidY: (e, t) => e.firstCompactNode.y + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2598
+ compactLinkMidX: (e) => e.firstCompactNode?.x ?? e.x,
2599
+ compactLinkMidY: (e, t) => (e.firstCompactNode?.y ?? e.y) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2572
2600
  centerTransform: ({ rootMargin: e, centerY: t, scale: n, chartWidth: r }) => `translate(${r - e},${t}) scale(${n})`,
2573
2601
  nodeFlexSize: ({ height: e, width: t, siblingsMargin: n, childrenMargin: r, config: i, node: a }) => i.compact && a.flexCompactDim ? [a.flexCompactDim[0], a.flexCompactDim[1]] : [e + n, t + r],
2574
2602
  compactDimension: {
@@ -2585,7 +2613,7 @@ var wa = (e) => ({
2585
2613
  nodeUpdateTransform: ({ x: e, y: t, width: n, height: r }) => `translate(${e - n},${t - r / 2})`
2586
2614
  }
2587
2615
  });
2588
- function Ta(e, t, n) {
2616
+ function Oa(e, t, n) {
2589
2617
  let r = e.x, i = e.y, a = t.x, o = t.y, s = n && n.x != null ? n.x : r, c = n && n.y != null ? n.y : i, l = a - r < 0 ? -1 : 1, u = o - i < 0 ? -1 : 1, d = Math.abs(a - r) / 2 < 35 ? Math.abs(a - r) / 2 : 35;
2590
2618
  d = Math.abs(o - i) / 2 < d ? Math.abs(o - i) / 2 : d;
2591
2619
  let f = Math.abs(a - r) / 2 - d;
@@ -2603,7 +2631,7 @@ function Ta(e, t, n) {
2603
2631
  ${a - f * l} ${o}
2604
2632
  L ${a} ${o}`;
2605
2633
  }
2606
- function Ea(e, t, n, r = { sy: 0 }) {
2634
+ function ka(e, t, n, r = { sy: 0 }) {
2607
2635
  let i = e.x, a = e.y, o = t.x, s = t.y, c = n && n.x != null ? n.x : i, l = n && n.y != null ? n.y : a, u = o - i < 0 ? -1 : 1, d = s - a < 0 ? -1 : 1;
2608
2636
  a += r.sy;
2609
2637
  let f = Math.abs(o - i) / 2 < 15 ? Math.abs(o - i) / 2 : 15;
@@ -2619,7 +2647,7 @@ function Ea(e, t, n, r = { sy: 0 }) {
2619
2647
  C ${o} ${a + p * d + f * d} ${o} ${a + p * d + f * d} ${o} ${s - p * d}
2620
2648
  L ${o} ${s}`;
2621
2649
  }
2622
- function Da({ node: e, config: t }) {
2650
+ function Aa({ node: e, config: t }) {
2623
2651
  return e.data?.id === "__root__" ? null : `<div class="button-content"> ${{
2624
2652
  left: (t) => t ? `<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2625
2653
  <path d="M14.283 3.50094L6.51 11.4749C6.37348 11.615 6.29707 11.8029 6.29707 11.9984C6.29707 12.194 6.37348 12.3819 6.51 12.5219L14.283 20.4989C14.3466 20.5643 14.4226 20.6162 14.5066 20.6516C14.5906 20.6871 14.6808 20.7053 14.772 20.7053C14.8632 20.7053 14.9534 20.6871 15.0374 20.6516C15.1214 20.6162 15.1974 20.5643 15.261 20.4989C15.3918 20.365 15.4651 20.1852 15.4651 19.9979C15.4651 19.8107 15.3918 19.6309 15.261 19.4969L7.9515 11.9984L15.261 4.50144C15.3914 4.36756 15.4643 4.18807 15.4643 4.00119C15.4643 3.81431 15.3914 3.63482 15.261 3.50094C15.1974 3.43563 15.1214 3.38371 15.0374 3.34827C14.9534 3.31282 14.8632 3.29456 14.772 3.29456C14.6808 3.29456 14.5906 3.31282 14.5066 3.34827C14.4226 3.38371 14.3466 3.43563 14.283 3.50094V3.50094Z" fill="#716E7B" stroke="#716E7B"/>
@@ -2647,8 +2675,9 @@ function Da({ node: e, config: t }) {
2647
2675
  `
2648
2676
  }[t.layout](e.children)} </div>`;
2649
2677
  }
2650
- function Oa(e, t, n, r) {
2651
- let i = r.pagingStep(e.parent), a = e.parent.data._pagingStep, o = e.parent.data._directSubordinatesPaging - a;
2678
+ function ja(e, t, n, r) {
2679
+ if (!e.parent) return "";
2680
+ let i = r.pagingStep(e.parent), a = e.parent.data._pagingStep ?? 0, o = (e.parent.data._directSubordinatesPaging ?? 0) - a;
2652
2681
  return `
2653
2682
  <div style="margin-top:90px;">
2654
2683
  <div style="display:flex;width:170px;border-radius:20px;padding:5px 15px; padding-bottom:4px;;background-color:#E5E9F2">
@@ -2659,7 +2688,7 @@ function Oa(e, t, n, r) {
2659
2688
  </div>
2660
2689
  `;
2661
2690
  }
2662
- var ka = () => {
2691
+ var Ma = () => {
2663
2692
  let e = {
2664
2693
  svgWidth: 800,
2665
2694
  svgHeight: window.innerHeight - 100,
@@ -2693,13 +2722,14 @@ var ka = () => {
2693
2722
  pagingStep: () => 5,
2694
2723
  minPagingVisibleNodes: () => 2e3,
2695
2724
  scaleExtent: [.05, 2.5],
2725
+ minFitScale: 0,
2696
2726
  duration: 400,
2697
2727
  setActiveNodeCentered: !0,
2698
2728
  layout: "top",
2699
2729
  compact: !0,
2700
2730
  gridEnabled: !1,
2701
2731
  gridRows: 0,
2702
- createZoom: () => Ca(),
2732
+ createZoom: () => Ea(),
2703
2733
  onZoomStart: () => {},
2704
2734
  onZoom: () => {},
2705
2735
  onZoomEnd: () => {},
@@ -2713,10 +2743,10 @@ var ka = () => {
2713
2743
  onNodeParentChange() {},
2714
2744
  onExpandOrCollapse: (e) => e,
2715
2745
  nodeContent: (e) => e.id === "__root__" ? null : "<div class=\"node-content\"></div>",
2716
- buttonContent: Da,
2717
- pagingButton: Oa,
2746
+ buttonContent: Aa,
2747
+ pagingButton: ja,
2718
2748
  nodeUpdate: function() {
2719
- P(this).select(".node-rect").attr("stroke", void 0).attr("stroke-width", void 0);
2749
+ P(this).select(".node-rect").attr("stroke", null).attr("stroke-width", null);
2720
2750
  },
2721
2751
  nodeEnter: (e) => e,
2722
2752
  nodeExit: (e) => e,
@@ -2725,137 +2755,154 @@ var ka = () => {
2725
2755
  P(this).style("stroke-width", "var(--border-hover-width)").style("stroke", "var(--border-hover-color)");
2726
2756
  return;
2727
2757
  }
2728
- P(this).style("stroke", void 0).style("stroke-width", void 0), e.data._upToTheRootHighlighted && P(this).raise();
2758
+ P(this).style("stroke", null).style("stroke-width", null), e.data._upToTheRootHighlighted && P(this).raise();
2729
2759
  },
2730
- hdiagonal: Ta,
2731
- diagonal: Ea,
2732
- linkGroupArc: le().x((e) => e.x).y((e) => e.y)
2760
+ hdiagonal: Oa,
2761
+ diagonal: ka,
2762
+ linkGroupArc: oe().x((e) => e.x).y((e) => e.y)
2763
+ };
2764
+ return e.layoutBindings = Da(e), e;
2765
+ }, Na = (e) => Math.min(1, 9 / e), Pa = (e, t, n, r) => {
2766
+ if (r === void 0 || t - e <= n) return (e + t) / 2;
2767
+ let i = n / 2;
2768
+ return Math.min(t - i, Math.max(e + i, r));
2769
+ }, Fa = ({ bounds: e, viewport: t, scaleExtent: n, minScale: r = 0, scale: i, focus: a }) => {
2770
+ let { x0: o, x1: s, y0: c, y1: l } = e, { width: u, height: d } = t, [f, p] = n, m = 1 / Math.max((s - o) / u, (l - c) / d), h = i ?? Math.min(p, Math.max(Math.max(f, Math.min(r, p)), m));
2771
+ return {
2772
+ k: h,
2773
+ x: u / 2 - h * Pa(o, s, u / h, a?.x),
2774
+ y: d / 2 - h * Pa(c, l, d / h, a?.y)
2733
2775
  };
2734
- return e.layoutBindings = wa(e), e;
2735
- }, Aa = (e, n, r) => {
2776
+ }, Ia = (e, t, r) => {
2736
2777
  let i = (0, k.useRef)(e.treeChartSettings?.transform), a = (0, k.useRef)(null);
2737
- return a.current = (n) => {
2738
- let i = ka(), a = n.treeOptions, s = {
2778
+ return a.current = (t) => {
2779
+ let i = Ma(), a = t.treeOptions, o = {
2739
2780
  linkUpdate: i.linkUpdate,
2740
2781
  getButtonContent: i.buttonContent,
2741
- ...Sr[a.layoutPreset]
2742
- }, c = s.sizes ? s.sizes(e) : {}, l = {
2743
- ...d,
2782
+ ...Er[a.layoutPreset]
2783
+ }, s = o.sizes ? o.sizes(e) : {}, l = {
2784
+ ...o.labelStyle,
2785
+ ...e.treeChartSettings?.nodeLayout?.labelStyle,
2786
+ fontSize: e.treeChartSettings?.nodeLayout?.labelStyle?.fontSize ?? o.labelStyle?.fontSize
2787
+ }, d = {
2788
+ ...n,
2744
2789
  ...e.treeChartSettings?.nodeLayout?.border
2745
2790
  };
2746
- l.enabled === !1 && (l.borderWidth = 0);
2747
- let u = {
2748
- ...t,
2791
+ d.enabled === !1 && (d.borderWidth = 0);
2792
+ let f = {
2793
+ ...u,
2749
2794
  ...e.treeChartSettings?.nodeLayout.hoverStyle
2750
- }, f = u.enabled ? u.borderWidth : 0;
2751
- r.nodeWidth((e) => (a.nodeWidth ? a.nodeWidth : typeof s.width == "function" ? s.width(e) : s.width) + (l.borderWidth ?? 0) * 2).nodeHeight((e) => (e.id === "__root__" ? 0 : typeof s.height == "function" ? s.height(e, c) : s.height) + (l.borderWidth ?? 0) * 2).nodeDefaultBackground(e.treeChartSettings?.nodeLayout?.backgroundColor ?? o.backgroundColor).compact(a.compact).layout(a.directionOrigin).padding({
2752
- top: f,
2753
- right: f,
2754
- bottom: f,
2755
- left: f
2756
- }).gridEnabled(a.gridLayoutEnabled).gridRows(a.gridLayoutRows).forceAutoFit(a.forceAutoFit).setActiveNodeCentered(!a.forceAutoFit).duration(a.animate === !1 ? 0 : 400).root(n.root).linkUpdate(s.linkUpdate).buttonContent(s.getButtonContent).container(n.container).nodeContent((e) => s.getNodeContent(e, { config: r.getConfig() })).render({
2757
- zoomToFit: n.zoomToFit ?? !1,
2758
- transform: n.transform
2795
+ }, p = f.enabled ? f.borderWidth : 0;
2796
+ r.nodeWidth((e) => (a.nodeWidth ? a.nodeWidth : typeof o.width == "function" ? o.width(e) : o.width) + (d.borderWidth ?? 0) * 2).nodeHeight((e) => (e.id === "__root__" ? 0 : typeof o.height == "function" ? o.height(e, s) : o.height) + (d.borderWidth ?? 0) * 2).nodeDefaultBackground(e.treeChartSettings?.nodeLayout?.backgroundColor ?? c.backgroundColor).compact(a.compact).layout(a.directionOrigin).padding({
2797
+ top: p,
2798
+ right: p,
2799
+ bottom: p,
2800
+ left: p
2801
+ }).gridEnabled(a.gridLayoutEnabled).gridRows(a.gridLayoutRows).forceAutoFit(a.forceAutoFit).minFitScale(a.keepFitReadable ? Na(D(l.fontSize)) : 0).setActiveNodeCentered(!a.forceAutoFit).duration(a.animate === !1 ? 0 : 400).root(t.root).linkUpdate(o.linkUpdate).buttonContent(o.getButtonContent).container(t.container).nodeContent((e) => o.getNodeContent(e, { config: r.getConfig() })).render({
2802
+ zoomToFit: t.zoomToFit ?? !1,
2803
+ transform: t.transform
2759
2804
  });
2760
- }, (0, k.useCallback)((e, t) => {
2761
- a.current({
2805
+ }, (0, k.useCallback)((e, n) => {
2806
+ !e || !t.current || a.current?.({
2762
2807
  root: e,
2763
- container: n.current,
2764
- treeOptions: t,
2808
+ container: t.current,
2809
+ treeOptions: n,
2765
2810
  zoomToFit: !0,
2766
2811
  transform: i.current ?? void 0
2767
2812
  });
2768
2813
  }, []);
2769
- }, ja = {
2814
+ }, La = {
2770
2815
  directionOrigin: "top",
2771
2816
  compact: !1,
2772
- layoutPreset: a.Basic,
2817
+ layoutPreset: d.Basic,
2773
2818
  forceAutoFit: !1,
2819
+ keepFitReadable: !0,
2774
2820
  animate: !0,
2775
2821
  interactive: !0,
2776
2822
  gridLayoutEnabled: !1,
2777
2823
  gridLayoutRows: 0
2778
- }, Ma = (e, t) => {
2779
- let n = {
2780
- directionOrigin: e.treeChartSettings?.directionOrigin ?? ja.directionOrigin,
2781
- compact: e.treeChartSettings?.compact ?? ja.compact,
2782
- layoutPreset: e.treeChartSettings?.nodeLayout?.preset ?? ja.layoutPreset,
2783
- forceAutoFit: e.treeChartSettings?.forceAutoFit ?? ja.forceAutoFit,
2824
+ }, Ra = (e, t) => {
2825
+ let n = t?.isPrintMode ?? !1, r = e.treeChartSettings?.forceAutoFit ?? La.forceAutoFit, i = {
2826
+ directionOrigin: e.treeChartSettings?.directionOrigin ?? La.directionOrigin,
2827
+ compact: e.treeChartSettings?.compact ?? La.compact,
2828
+ layoutPreset: e.treeChartSettings?.nodeLayout?.preset ?? La.layoutPreset,
2829
+ forceAutoFit: r,
2830
+ keepFitReadable: !r && !n,
2784
2831
  nodeWidth: e.treeChartSettings?.nodeLayout?.width,
2785
- animate: !(t?.isPrintMode ?? !1),
2832
+ animate: !n,
2786
2833
  interactive: t.disable?.interactions !== !0,
2787
2834
  gridLayoutEnabled: e.treeChartSettings.gridLayout?.enabled ?? !1,
2788
2835
  gridLayoutRows: e.treeChartSettings.gridLayout?.rows ?? 0
2789
2836
  };
2790
2837
  return {
2791
- treeSettings: n,
2792
- layout: Sr[n.layoutPreset || a.Basic]
2838
+ treeSettings: i,
2839
+ layout: Er[i.layoutPreset || d.Basic]
2793
2840
  };
2794
2841
  };
2795
- function Na(e) {
2842
+ function za(e) {
2796
2843
  var t = 0, n = e.children, r = n && n.length;
2797
2844
  if (!r) t = 1;
2798
2845
  else for (; --r >= 0;) t += n[r].value;
2799
2846
  e.value = t;
2800
2847
  }
2801
- function Pa() {
2802
- return this.eachAfter(Na);
2848
+ function Ba() {
2849
+ return this.eachAfter(za);
2803
2850
  }
2804
- function Fa(e) {
2851
+ function Va(e) {
2805
2852
  var t = this, n, r = [t], i, a, o;
2806
2853
  do
2807
2854
  for (n = r.reverse(), r = []; t = n.pop();) if (e(t), i = t.children, i) for (a = 0, o = i.length; a < o; ++a) r.push(i[a]);
2808
2855
  while (r.length);
2809
2856
  return this;
2810
2857
  }
2811
- function Ia(e) {
2858
+ function Ha(e) {
2812
2859
  for (var t = this, n = [t], r, i; t = n.pop();) if (e(t), r = t.children, r) for (i = r.length - 1; i >= 0; --i) n.push(r[i]);
2813
2860
  return this;
2814
2861
  }
2815
- function La(e) {
2862
+ function Ua(e) {
2816
2863
  for (var t = this, n = [t], r = [], i, a, o; t = n.pop();) if (r.push(t), i = t.children, i) for (a = 0, o = i.length; a < o; ++a) n.push(i[a]);
2817
2864
  for (; t = r.pop();) e(t);
2818
2865
  return this;
2819
2866
  }
2820
- function Ra(e) {
2867
+ function Wa(e) {
2821
2868
  return this.eachAfter(function(t) {
2822
2869
  for (var n = +e(t.data) || 0, r = t.children, i = r && r.length; --i >= 0;) n += r[i].value;
2823
2870
  t.value = n;
2824
2871
  });
2825
2872
  }
2826
- function za(e) {
2873
+ function Ga(e) {
2827
2874
  return this.eachBefore(function(t) {
2828
2875
  t.children && t.children.sort(e);
2829
2876
  });
2830
2877
  }
2831
- function Ba(e) {
2832
- for (var t = this, n = Va(t, e), r = [t]; t !== n;) t = t.parent, r.push(t);
2878
+ function Ka(e) {
2879
+ for (var t = this, n = qa(t, e), r = [t]; t !== n;) t = t.parent, r.push(t);
2833
2880
  for (var i = r.length; e !== n;) r.splice(i, 0, e), e = e.parent;
2834
2881
  return r;
2835
2882
  }
2836
- function Va(e, t) {
2883
+ function qa(e, t) {
2837
2884
  if (e === t) return e;
2838
2885
  var n = e.ancestors(), r = t.ancestors(), i = null;
2839
2886
  for (e = n.pop(), t = r.pop(); e === t;) i = e, e = n.pop(), t = r.pop();
2840
2887
  return i;
2841
2888
  }
2842
- function Ha() {
2889
+ function Ja() {
2843
2890
  for (var e = this, t = [e]; e = e.parent;) t.push(e);
2844
2891
  return t;
2845
2892
  }
2846
- function Ua() {
2893
+ function Ya() {
2847
2894
  var e = [];
2848
2895
  return this.each(function(t) {
2849
2896
  e.push(t);
2850
2897
  }), e;
2851
2898
  }
2852
- function Wa() {
2899
+ function Xa() {
2853
2900
  var e = [];
2854
2901
  return this.eachBefore(function(t) {
2855
2902
  t.children || e.push(t);
2856
2903
  }), e;
2857
2904
  }
2858
- function Ga() {
2905
+ function Za() {
2859
2906
  var e = this, t = [];
2860
2907
  return e.each(function(n) {
2861
2908
  n !== e && t.push({
@@ -2864,47 +2911,47 @@ function Ga() {
2864
2911
  });
2865
2912
  }), t;
2866
2913
  }
2867
- function Ka(e, t) {
2868
- var n = new Za(e), r = +e.value && (n.value = e.value), i, a = [n], o, s, c, l;
2869
- for (t ??= Ja; i = a.pop();) if (r && (i.value = +i.data.value), (s = t(i.data)) && (l = s.length)) for (i.children = Array(l), c = l - 1; c >= 0; --c) a.push(o = i.children[c] = new Za(s[c])), o.parent = i, o.depth = i.depth + 1;
2870
- return n.eachBefore(Xa);
2914
+ function Qa(e, t) {
2915
+ var n = new ro(e), r = +e.value && (n.value = e.value), i, a = [n], o, s, c, l;
2916
+ for (t ??= eo; i = a.pop();) if (r && (i.value = +i.data.value), (s = t(i.data)) && (l = s.length)) for (i.children = Array(l), c = l - 1; c >= 0; --c) a.push(o = i.children[c] = new ro(s[c])), o.parent = i, o.depth = i.depth + 1;
2917
+ return n.eachBefore(no);
2871
2918
  }
2872
- function qa() {
2873
- return Ka(this).eachBefore(Ya);
2919
+ function $a() {
2920
+ return Qa(this).eachBefore(to);
2874
2921
  }
2875
- function Ja(e) {
2922
+ function eo(e) {
2876
2923
  return e.children;
2877
2924
  }
2878
- function Ya(e) {
2925
+ function to(e) {
2879
2926
  e.data = e.data.data;
2880
2927
  }
2881
- function Xa(e) {
2928
+ function no(e) {
2882
2929
  var t = 0;
2883
2930
  do
2884
2931
  e.height = t;
2885
2932
  while ((e = e.parent) && e.height < ++t);
2886
2933
  }
2887
- function Za(e) {
2934
+ function ro(e) {
2888
2935
  this.data = e, this.depth = this.height = 0, this.parent = null;
2889
2936
  }
2890
- Za.prototype = Ka.prototype = {
2891
- constructor: Za,
2892
- count: Pa,
2893
- each: Fa,
2894
- eachAfter: La,
2895
- eachBefore: Ia,
2896
- sum: Ra,
2897
- sort: za,
2898
- path: Ba,
2899
- ancestors: Ha,
2900
- descendants: Ua,
2901
- leaves: Wa,
2902
- links: Ga,
2903
- copy: qa
2937
+ ro.prototype = Qa.prototype = {
2938
+ constructor: ro,
2939
+ count: Ba,
2940
+ each: Va,
2941
+ eachAfter: Ua,
2942
+ eachBefore: Ha,
2943
+ sum: Wa,
2944
+ sort: Ga,
2945
+ path: Ka,
2946
+ ancestors: Ja,
2947
+ descendants: Ya,
2948
+ leaves: Xa,
2949
+ links: Za,
2950
+ copy: $a
2904
2951
  };
2905
- var Qa = S();
2906
- we();
2907
- var { version: $a } = {
2952
+ var io = re();
2953
+ Ee();
2954
+ var { version: ao } = {
2908
2955
  name: "d3-flextree",
2909
2956
  version: "2.1.2",
2910
2957
  main: "build/d3-flextree.js",
@@ -2965,13 +3012,13 @@ var { version: $a } = {
2965
3012
  "rollup-plugin-uglify": "^3.0.0",
2966
3013
  "uglify-es": "^3.3.9"
2967
3014
  }
2968
- }, eo = Object.freeze({
3015
+ }, oo = Object.freeze({
2969
3016
  children: (e) => e.children,
2970
3017
  nodeSize: (e) => e.data.size,
2971
3018
  spacing: 0
2972
3019
  });
2973
- function to(e) {
2974
- let t = Object.assign({}, eo, e);
3020
+ function so(e) {
3021
+ let t = Object.assign({}, oo, e);
2975
3022
  function n(e) {
2976
3023
  let n = t[e];
2977
3024
  return typeof n == "function" ? n : () => n;
@@ -2982,7 +3029,7 @@ function to(e) {
2982
3029
  }
2983
3030
  function i() {
2984
3031
  let e = n("nodeSize"), t = n("spacing");
2985
- return class n extends Ka.prototype.constructor {
3032
+ return class n extends Qa.prototype.constructor {
2986
3033
  constructor(e) {
2987
3034
  super(e);
2988
3035
  }
@@ -3095,7 +3142,7 @@ function to(e) {
3095
3142
  this.data.y = e;
3096
3143
  }
3097
3144
  update() {
3098
- return no(this), ro(this), this;
3145
+ return co(this), lo(this), this;
3099
3146
  }
3100
3147
  };
3101
3148
  }
@@ -3139,52 +3186,52 @@ function to(e) {
3139
3186
  }
3140
3187
  }), r;
3141
3188
  }
3142
- to.version = $a;
3143
- var no = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3189
+ so.version = ao;
3190
+ var co = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3144
3191
  let [r, i] = t;
3145
- no(n, e.y + e.ySize);
3192
+ co(n, e.y + e.ySize);
3146
3193
  let a = (r === 0 ? n.lExt : n.rExt).bottom;
3147
- r !== 0 && ao(e, r, i);
3148
- let o = mo(a, r, i);
3194
+ r !== 0 && fo(e, r, i);
3195
+ let o = bo(a, r, i);
3149
3196
  return [r + 1, o];
3150
- }, [0, null]), io(e), po(e), e), ro = (e, t, n) => {
3197
+ }, [0, null]), uo(e), yo(e), e), lo = (e, t, n) => {
3151
3198
  t === void 0 && (t = -e.relX - e.prelim, n = 0);
3152
3199
  let r = t + e.relX;
3153
- return e.relX = r + e.prelim - n, e.prelim = 0, e.x = n + e.relX, (e.children || []).forEach((t) => ro(t, r, e.x)), e;
3154
- }, io = (e) => {
3200
+ return e.relX = r + e.prelim - n, e.prelim = 0, e.x = n + e.relX, (e.children || []).forEach((t) => lo(t, r, e.x)), e;
3201
+ }, uo = (e) => {
3155
3202
  (e.children || []).reduce((e, t) => {
3156
3203
  let [n, r] = e, i = n + t.shift, a = r + i + t.change;
3157
3204
  return t.relX += a, [i, a];
3158
3205
  }, [0, 0]);
3159
- }, ao = (e, t, n) => {
3206
+ }, fo = (e, t, n) => {
3160
3207
  let r = e.children[t - 1], i = e.children[t], a = r, o = r.relX, s = i, c = i.relX, l = !0;
3161
3208
  for (; a && s;) {
3162
3209
  a.bottom > n.lowY && (n = n.next);
3163
3210
  let r = o + a.prelim - (c + s.prelim) + a.xSize / 2 + s.xSize / 2 + a.spacing(s);
3164
- (r > 0 || r < 0 && l) && (c += r, oo(i, r), so(e, t, n.index, r)), l = !1;
3211
+ (r > 0 || r < 0 && l) && (c += r, po(i, r), mo(e, t, n.index, r)), l = !1;
3165
3212
  let u = a.bottom, d = s.bottom;
3166
- u <= d && (a = lo(a), a && (o += a.relX)), u >= d && (s = co(s), s && (c += s.relX));
3213
+ u <= d && (a = go(a), a && (o += a.relX)), u >= d && (s = ho(s), s && (c += s.relX));
3167
3214
  }
3168
- !a && s ? uo(e, t, s, c) : a && !s && fo(e, t, a, o);
3169
- }, oo = (e, t) => {
3215
+ !a && s ? _o(e, t, s, c) : a && !s && vo(e, t, a, o);
3216
+ }, po = (e, t) => {
3170
3217
  e.relX += t, e.lExtRelX += t, e.rExtRelX += t;
3171
- }, so = (e, t, n, r) => {
3218
+ }, mo = (e, t, n, r) => {
3172
3219
  let i = e.children[t], a = t - n;
3173
3220
  if (a > 1) {
3174
3221
  let t = r / a;
3175
3222
  e.children[n + 1].shift += t, i.shift -= t, i.change -= r - t;
3176
3223
  }
3177
- }, co = (e) => e.hasChildren ? e.firstChild : e.lThr, lo = (e) => e.hasChildren ? e.lastChild : e.rThr, uo = (e, t, n, r) => {
3224
+ }, ho = (e) => e.hasChildren ? e.firstChild : e.lThr, go = (e) => e.hasChildren ? e.lastChild : e.rThr, _o = (e, t, n, r) => {
3178
3225
  let i = e.firstChild, a = i.lExt, o = e.children[t];
3179
3226
  a.lThr = n;
3180
3227
  let s = r - n.relX - i.lExtRelX;
3181
3228
  a.relX += s, a.prelim -= s, i.lExt = o.lExt, i.lExtRelX = o.lExtRelX;
3182
- }, fo = (e, t, n, r) => {
3229
+ }, vo = (e, t, n, r) => {
3183
3230
  let i = e.children[t], a = i.rExt, o = e.children[t - 1];
3184
3231
  a.rThr = n;
3185
3232
  let s = r - n.relX - i.rExtRelX;
3186
3233
  a.relX += s, a.prelim -= s, i.rExt = o.rExt, i.rExtRelX = o.rExtRelX;
3187
- }, po = (e) => {
3234
+ }, yo = (e) => {
3188
3235
  if (e.hasChildren) {
3189
3236
  let t = e.firstChild, n = e.lastChild, r = (t.prelim + t.relX - t.xSize / 2 + n.relX + n.prelim + n.xSize / 2) / 2;
3190
3237
  Object.assign(e, {
@@ -3195,7 +3242,7 @@ var no = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3195
3242
  rExtRelX: n.rExtRelX
3196
3243
  });
3197
3244
  }
3198
- }, mo = (e, t, n) => {
3245
+ }, bo = (e, t, n) => {
3199
3246
  for (; n !== null && e >= n.lowY;) n = n.next;
3200
3247
  return {
3201
3248
  lowY: e,
@@ -3203,22 +3250,25 @@ var no = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3203
3250
  next: n
3204
3251
  };
3205
3252
  };
3206
- oe();
3207
- var Z = {
3253
+ E();
3254
+ var Q = {
3208
3255
  selection: N,
3209
3256
  select: P,
3210
- max: Se,
3211
- min: Te,
3212
- sum: Ce,
3213
- cumsum: Ee,
3214
- tree: Ze,
3215
- stratify: ze,
3216
- zoom: Ca,
3217
- zoomIdentity: pa,
3218
- linkHorizontal: le,
3219
- flextree: to
3220
- }, ho = class {
3257
+ max: we,
3258
+ min: De,
3259
+ sum: Te,
3260
+ cumsum: Oe,
3261
+ tree: tt,
3262
+ stratify: Ue,
3263
+ zoom: Ea,
3264
+ zoomIdentity: _a,
3265
+ linkHorizontal: oe,
3266
+ flextree: so
3267
+ }, xo = class {
3221
3268
  stateInternal = {
3269
+ allNodes: [],
3270
+ dragStartX: 0,
3271
+ dragStartY: 0,
3222
3272
  root: null,
3223
3273
  lastTransform: {
3224
3274
  x: 0,
@@ -3229,17 +3279,15 @@ var Z = {
3229
3279
  };
3230
3280
  getConfig;
3231
3281
  constructor() {
3232
- let e = ka();
3282
+ let e = Ma();
3233
3283
  this.getConfig = () => e, Object.keys(e).forEach((t) => {
3234
- this[t] = function(n) {
3235
- if (arguments.length) e[t] = n;
3236
- else return e[t];
3237
- return this;
3238
- };
3284
+ Object.assign(this, { [t]: function(...n) {
3285
+ return n.length ? (e[t] = n[0], this) : e[t];
3286
+ } });
3239
3287
  }), this.initializeEnterExitUpdatePattern(), this.extendHierarchyNodePrototype();
3240
3288
  }
3241
3289
  init() {
3242
- let e = this.getChartState(), t = this.getConfig(), n = Z.select(t.container), r = n.node().getBoundingClientRect();
3290
+ let e = this.getChartState(), t = this.getConfig(), n = Q.select(t.container), r = t.container.getBoundingClientRect();
3243
3291
  e.containerRect = r;
3244
3292
  let i = n.patternify({
3245
3293
  tag: "svg",
@@ -3265,10 +3313,10 @@ var Z = {
3265
3313
  o &&= (t.onNodeLeave(o), null);
3266
3314
  }).on("mousemove", (e) => {
3267
3315
  let n = e.target.closest("g.node"), r = null;
3268
- n && ([...e.target.classList].includes("node-button-foreign-object") || (r = Z.select(n).datum(), r.parent || (r = null))), o && o !== r && t.onNodeLeave(o), r && o !== r && t.onNodeHover(r), o = r;
3316
+ n && ([...e.target.classList].includes("node-button-foreign-object") || (r = Q.select(n).datum(), r.parent || (r = null))), o && o !== r && t.onNodeLeave(o), r && o !== r && t.onNodeHover(r), o = r;
3269
3317
  }), e.chart = a;
3270
- let s = { zoom: null }, c = !1;
3271
- s.zoom = t.createZoom().clickDistance(10).on("start", (e) => {
3318
+ let s = { zoom: t.createZoom() }, c = !1;
3319
+ s.zoom = s.zoom.clickDistance(10).on("start", (e) => {
3272
3320
  t.onZoomStart(e);
3273
3321
  }).on("end", (n) => {
3274
3322
  c && (e.userTransform = {
@@ -3284,7 +3332,8 @@ var Z = {
3284
3332
  let l = i.on("mousedown.zoom");
3285
3333
  i.on("mousedown.zoom", null), i.on("mousedown.zoom", (e) => {
3286
3334
  c = !0, setTimeout(() => {
3287
- l?.call(i.node(), e);
3335
+ let t = i.node();
3336
+ t && l?.call(t, e, void 0);
3288
3337
  }, 0);
3289
3338
  });
3290
3339
  }
@@ -3292,13 +3341,13 @@ var Z = {
3292
3341
  return this.stateInternal;
3293
3342
  }
3294
3343
  initializeEnterExitUpdatePattern() {
3295
- Z.selection.prototype.patternify = function(e) {
3296
- let t = e.selector, n = e.tag, r = e.data || [t], i = this.selectAll("." + t).data(r, (e, t) => typeof e == "object" && e.id ? e.id : t);
3344
+ Q.selection.prototype.patternify = function(e) {
3345
+ let t = e.selector, n = e.tag, r = e.data ?? [t], i = this.selectAll("." + t).data(r, (e, t) => e && typeof e == "object" && "id" in e && typeof e.id == "string" ? e.id : t);
3297
3346
  return i.exit().remove(), i = i.enter().append(n).merge(i), i.attr("class", t), i;
3298
3347
  };
3299
3348
  }
3300
3349
  extendHierarchyNodePrototype() {
3301
- De.prototype.allDescendants || (De.prototype.allDescendants = function() {
3350
+ Ae.prototype.allDescendants || (Ae.prototype.allDescendants = function() {
3302
3351
  let e = [];
3303
3352
  this.each((t) => {
3304
3353
  e.push(t);
@@ -3325,13 +3374,13 @@ var Z = {
3325
3374
  render(e = {}) {
3326
3375
  let t = this.getConfig(), n = this.getChartState();
3327
3376
  if (!t.root?.children || t.root.children.length == 0) return this;
3328
- let r = Z.select(t.container).node().getBoundingClientRect();
3377
+ let r = t.container.getBoundingClientRect();
3329
3378
  if (n.containerRect = r, !r.width || !r.height) return this;
3330
3379
  let i = {
3331
3380
  chartWidth: r.width,
3332
3381
  chartHeight: r.height
3333
3382
  };
3334
- return n.calc = i, n.calc.centerX = i.chartWidth / 2, n.calc.centerY = i.chartHeight / 2, n.flexTreeLayout = to({ nodeSize: (e) => {
3383
+ n.calc = i, n.calc.centerX = i.chartWidth / 2, n.calc.centerY = i.chartHeight / 2, n.flexTreeLayout = so({ nodeSize: (e) => {
3335
3384
  let n = t.nodeWidth(e), r = t.nodeHeight(e), i = t.siblingsMargin(e), a = t.childrenMargin(e);
3336
3385
  return t.layoutBindings[t.layout].nodeFlexSize({
3337
3386
  config: t,
@@ -3341,16 +3390,16 @@ var Z = {
3341
3390
  siblingsMargin: i,
3342
3391
  childrenMargin: a
3343
3392
  });
3344
- } }).spacing((e, n) => e.parent == n.parent ? 0 : t.neighbourMargin(e, n)), this.setLayouts(), n.svg.attr("width", r.width).attr("height", r.height), this.update(n.root, e), this;
3393
+ } }).spacing((e, n) => e.parent == n.parent ? 0 : t.neighbourMargin(e, n)), this.setLayouts();
3394
+ let a = n.svg;
3395
+ return !a || !n.root ? this : (a.attr("width", r.width).attr("height", r.height), this.update(n.root, e), this);
3345
3396
  }
3346
3397
  groupBy(e, t, n) {
3347
3398
  let r = {};
3348
3399
  return e.forEach((e) => {
3349
3400
  let n = t(e);
3350
3401
  r[n] || (r[n] = []), r[n].push(e);
3351
- }), Object.keys(r).forEach((e) => {
3352
- r[e] = n(r[e]);
3353
- }), Object.entries(r);
3402
+ }), Object.entries(r).map(([e, t]) => [e, n(t)]);
3354
3403
  }
3355
3404
  calculateCompactFlexDimensions(e) {
3356
3405
  let t = this.getConfig();
@@ -3363,7 +3412,7 @@ var Z = {
3363
3412
  n.forEach((e, t) => {
3364
3413
  t || (e.firstCompact = !0), t % 2 ? e.compactEven = !1 : e.compactEven = !0, e.row = Math.floor(t / 2);
3365
3414
  });
3366
- let r = Z.max(n.filter((e) => e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), i = Z.max(n.filter((e) => !e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), a = Math.max(r, i) * 2, o = this.groupBy(n, (e) => e.row, (e) => Z.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e) + t.compactMarginBetween())), s = Z.sum(o.map((e) => e[1]));
3415
+ let r = Q.max(n.filter((e) => e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), i = Q.max(n.filter((e) => !e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), a = Math.max(r ?? 0, i ?? 0) * 2, o = this.groupBy(n, (e) => e.row, (e) => Q.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e) + t.compactMarginBetween()) ?? 0), s = Q.sum(o.map((e) => e[1]));
3367
3416
  n.forEach((e) => {
3368
3417
  e.firstCompactNode = n[0], e.firstCompact ? e.flexCompactDim = [a + t.compactMarginPair(e), s - t.compactMarginBetween()] : e.flexCompactDim = [0, 0];
3369
3418
  }), e.flexCompactDim = null;
@@ -3375,17 +3424,18 @@ var Z = {
3375
3424
  e.eachBefore((e) => {
3376
3425
  if (e.children) {
3377
3426
  let n = e.children.filter((e) => e.flexCompactDim), r = n[0];
3378
- if (!r) return;
3427
+ if (!r?.flexCompactDim) return;
3428
+ let i = r.flexCompactDim[0];
3379
3429
  n.forEach((e, n) => {
3380
- n == 0 && (r.x -= r.flexCompactDim[0] / 2), n & n % 2 - 1 ? e.x = r.x + r.flexCompactDim[0] * .25 - t.compactMarginPair(e) / 4 : n && (e.x = r.x + r.flexCompactDim[0] * .75 + t.compactMarginPair(e) / 4);
3430
+ n == 0 && (r.x -= i / 2), n & n % 2 - 1 ? e.x = r.x + i * .25 - t.compactMarginPair(e) / 4 : n && (e.x = r.x + i * .75 + t.compactMarginPair(e) / 4);
3381
3431
  });
3382
- let i = r.x + r.flexCompactDim[0] * .5;
3383
- r.x = r.x + r.flexCompactDim[0] * .25 - t.compactMarginPair(r) / 4;
3384
- let a = e.x - i;
3385
- Math.abs(a) < 10 && n.forEach((e) => e.x += a);
3386
- let o = this.groupBy(n, (e) => e.row, (e) => Z.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e))), s = Z.cumsum(o.map((e) => e[1] + t.compactMarginBetween()));
3432
+ let a = r.x + i * .5;
3433
+ r.x = r.x + i * .25 - t.compactMarginPair(r) / 4;
3434
+ let o = e.x - a;
3435
+ Math.abs(o) < 10 && n.forEach((e) => e.x += o);
3436
+ let s = this.groupBy(n, (e) => e.row, (e) => Q.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e)) ?? 0), c = Q.cumsum(s.map((e) => e[1] + t.compactMarginBetween()));
3387
3437
  n.forEach((e) => {
3388
- e.row ? e.y = r.y + s[e.row - 1] : e.y = r.y;
3438
+ e.row ? e.y = r.y + c[e.row - 1] : e.y = r.y;
3389
3439
  });
3390
3440
  }
3391
3441
  });
@@ -3393,7 +3443,7 @@ var Z = {
3393
3443
  calculateGridLayout(e) {
3394
3444
  let t = this.getChartState(), n = this.getConfig(), r = e.descendants().slice(1);
3395
3445
  if (e.x = 0, e.y = 0, !r.length) return e;
3396
- let i = Z.max(r, (e) => e.width) ?? 0, a = Z.max(r, (e) => e.height) ?? 0, o = Z.max(r, (e) => n.siblingsMargin(e)) ?? 0, s = Math.max(1, i + o), c = Math.max(1, a + o), l = Math.max(1, Math.floor((t.calc?.chartWidth ?? s) / s)), u = n.layout === "top" || n.layout === "bottom", d = Math.max(0, Math.floor(n.gridRows)), f = d === 0 ? l : u ? Math.ceil(r.length / d) : d, p = Math.ceil(r.length / f);
3446
+ let i = Q.max(r, (e) => e.width) ?? 0, a = Q.max(r, (e) => e.height) ?? 0, o = Q.max(r, (e) => n.siblingsMargin(e)) ?? 0, s = Math.max(1, i + o), c = Math.max(1, a + o), l = Math.max(1, Math.floor((t.calc?.chartWidth ?? s) / s)), u = n.layout === "top" || n.layout === "bottom", d = Math.max(0, Math.floor(n.gridRows)), f = d === 0 ? l : u ? Math.ceil(r.length / d) : d, p = Math.ceil(r.length / f);
3397
3447
  return r.forEach((e, t) => {
3398
3448
  let i, a;
3399
3449
  if (u) {
@@ -3422,12 +3472,13 @@ var Z = {
3422
3472
  }
3423
3473
  update({ x0: e, y0: t }, n = {}) {
3424
3474
  let r = this.getChartState(), i = this.getConfig();
3475
+ if (!r.root || !r.flexTreeLayout || !r.svg || !r.zoomBehavior || !r.linksWrapper || !r.nodesWrapper) return;
3425
3476
  i.compact && !i.gridEnabled && this.calculateCompactFlexDimensions(r.root);
3426
3477
  let a = i.gridEnabled ? this.calculateGridLayout(r.root) : r.flexTreeLayout(r.root);
3427
3478
  i.compact && !i.gridEnabled && this.calculateCompactFlexPositions(r.root), i.forceAutoFit ? (r.svg.attr("cursor", "default"), r.zoomBehavior.filter(() => !1)) : (r.svg.attr("cursor", "grab"), r.zoomBehavior.filter(() => !0));
3428
3479
  let o = a.descendants().slice(1), s = r.root.children?.length || 0, c = i.gridEnabled ? [] : a.descendants().slice(s + 1);
3429
3480
  i.gridEnabled || o.forEach((e) => i.layoutBindings[i.layout].swap(e));
3430
- let l = r.linksWrapper.selectAll("path.link").data(c, (e) => i.nodeId(e.data)), u = l.enter().insert("path", "g").attr("class", "link").attr("d", (e) => {
3481
+ let l = r.linksWrapper.selectAll("path.link").data(c, (e) => i.nodeId(e.data) ?? ""), u = l.enter().insert("path", "g").attr("class", "link").attr("d", (e) => {
3431
3482
  let t = {
3432
3483
  x: i.layoutBindings[i.layout].linkJoinX(e.parent || e),
3433
3484
  y: i.layoutBindings[i.layout].linkJoinY(e.parent || e)
@@ -3456,13 +3507,10 @@ var Z = {
3456
3507
  };
3457
3508
  return i.layoutBindings[i.layout].diagonal(t, t, null, { sy: i.linkYOffset });
3458
3509
  }).remove();
3459
- let d = this, f = r.nodesWrapper.selectAll("g.node").data(o, ({ data: e }) => i.nodeId(e)), p = f.enter().append("g").attr("data-brush", (e) => {
3460
- let t = e.data;
3461
- if (t.brush) return t.brush.key;
3462
- }).attr("class", "node").attr("transform", (n) => n == r.root ? `translate(${e},${t})` : `translate(${i.layoutBindings[i.layout].nodeJoinX(n.parent || n)},${i.layoutBindings[i.layout].nodeJoinY(n.parent || n)})`).classed("draggable droppable", !0).on("click.node", (e, t) => {
3510
+ let d = this, f = r.nodesWrapper.selectAll("g.node").data(o, ({ data: e }) => i.nodeId(e) ?? ""), p = f.enter().append("g").attr("data-brush", (e) => e.data.brush?.key ?? null).attr("class", "node").attr("transform", (n) => n == r.root ? `translate(${e},${t})` : `translate(${i.layoutBindings[i.layout].nodeJoinX(n.parent || n)},${i.layoutBindings[i.layout].nodeJoinY(n.parent || n)})`).classed("draggable droppable", !0).on("click.node", (e, t) => {
3463
3511
  [...e.srcElement.classList].includes("node-button-foreign-object") || i.onNodeClick(t);
3464
- }).call(Nr().filter(function(e, t) {
3465
- return r.dragEnabled && t.depth > 0;
3512
+ }).call(Lr().filter(function(e, t) {
3513
+ return r.dragEnabled === !0 && t.depth > 0;
3466
3514
  }).on("start", function(e, t) {
3467
3515
  d.onDragStart(this, e, t);
3468
3516
  }).on("drag", function(e) {
@@ -3507,18 +3555,15 @@ var Z = {
3507
3555
  })},${i.layoutBindings[i.layout].buttonY({
3508
3556
  width: e,
3509
3557
  height: t
3510
- })})`).attr("display", ({ data: e }) => !i.gridEnabled && e._directSubordinates > 0 ? null : "none").attr("opacity", ({ children: e, _children: t }) => e || t ? 1 : 0), m.select(".node-button-foreign-object .node-button-div").html((e) => i.buttonContent({
3558
+ })})`).attr("display", ({ data: e }) => !i.gridEnabled && (e._directSubordinates ?? 0) > 0 ? null : "none").attr("opacity", ({ children: e, _children: t }) => e || t ? 1 : 0), m.select(".node-button-foreign-object .node-button-div").html((e) => i.buttonContent({
3511
3559
  node: e,
3512
3560
  config: i
3513
- })), m.attr("data-value", (e) => {
3514
- let t = e.data;
3515
- if (t.brush) return t.brush.value;
3516
- }), m.each(i.nodeUpdate);
3561
+ })), m.attr("data-value", (e) => e.data.brush?.value ?? null), m.each(i.nodeUpdate);
3517
3562
  let h = f.exit();
3518
3563
  h.each(i.nodeExit);
3519
3564
  let g = h.data().reduce((e, t) => e.depth < t.depth ? e : t, { depth: Infinity });
3520
3565
  h.attr("opacity", 1).transition().duration(i.duration).attr("transform", () => {
3521
- let { x: e, y: t, width: n, height: r } = g.parent || {};
3566
+ let { x: e, y: t, width: n, height: r } = g.parent ?? g;
3522
3567
  return `translate(${i.layoutBindings[i.layout].nodeJoinX({
3523
3568
  x: e,
3524
3569
  y: t,
@@ -3531,7 +3576,7 @@ var Z = {
3531
3576
  height: r
3532
3577
  })})`;
3533
3578
  }).on("end", function() {
3534
- Z.select(this).remove();
3579
+ Q.select(this).remove();
3535
3580
  }).attr("opacity", 0), o.forEach((e) => {
3536
3581
  e.x0 = e.x, e.y0 = e.y;
3537
3582
  });
@@ -3541,7 +3586,7 @@ var Z = {
3541
3586
  _.data._centeredWithDescendants && (e = i.compact ? _.descendants().filter((e, t) => t < 7) : _.descendants().filter((e, t, n) => {
3542
3587
  let r = Math.round(n.length / 2);
3543
3588
  return n.length % 2 ? t > r - 2 && t < r + 2 - 1 : t > r - 2 && t < r + 2;
3544
- })), _.data._centeredWithDescendants = null, _.data._centered = null, this.fit({
3589
+ })), _.data._centeredWithDescendants = !1, _.data._centered = !1, this.fit({
3545
3590
  animate: !0,
3546
3591
  scale: !1,
3547
3592
  nodes: e
@@ -3562,21 +3607,21 @@ var Z = {
3562
3607
  }
3563
3608
  restyleForeignObjectElements(e) {
3564
3609
  let t = this.getChartState(), n = this.getConfig();
3565
- t.svg.selectAll(".node-foreign-object").filter((t) => !e || e.has(t)).classed("node-excluded", (e) => e.data._excluded).attr("width", ({ width: e }) => e).attr("height", ({ height: e }) => e).attr("x", () => 0).attr("y", () => 0), t.svg.selectAll(".node-foreign-object-div").filter((t) => !e || e.has(t)).style("width", ({ width: e }) => `${e}px`).style("height", ({ height: e }) => `${e}px`).html(function(e, r, i) {
3566
- return n.nodeContent.bind(this)(e, r, i, t);
3610
+ t.svg?.selectAll(".node-foreign-object").filter((t) => !e || e.has(t)).classed("node-excluded", (e) => e.data._excluded === !0).attr("width", ({ width: e }) => e).attr("height", ({ height: e }) => e).attr("x", () => 0).attr("y", () => 0), t.svg?.selectAll(".node-foreign-object-div").filter((t) => !e || e.has(t)).style("width", ({ width: e }) => `${e}px`).style("height", ({ height: e }) => `${e}px`).html(function(e, t, r) {
3611
+ return n.nodeContent.call(this, e, t, r, n);
3567
3612
  });
3568
3613
  }
3569
3614
  onButtonClick(e, t) {
3570
3615
  let n = this.getConfig();
3571
- t.parent && (n.setActiveNodeCentered && (t.data._centered = !0, t.data._centeredWithDescendants = !0), t.children ? (t._children = t.children, t.children = null) : (t.children = t._children, t._children = null), this.updateNodesState(), e.stopPropagation(), n.onExpandOrCollapse(t));
3616
+ t.parent && (n.setActiveNodeCentered && (t.data._centered = !0, t.data._centeredWithDescendants = !0), t.children ? (t._children = t.children, t.children = void 0) : (t.children = t._children, t._children = void 0), this.updateNodesState(), e.stopPropagation(), n.onExpandOrCollapse(t));
3572
3617
  }
3573
3618
  updateNodesState() {
3574
3619
  let e = this.getChartState();
3575
- this.setLayouts(), this.update(e.root);
3620
+ this.setLayouts(), e.root && this.update(e.root);
3576
3621
  }
3577
3622
  setLayouts() {
3578
3623
  let e = this.getChartState(), t = this.getConfig();
3579
- e.root = t.root, e.root.each((e) => {
3624
+ e.root = t.root, e.root && (e.root.each((e) => {
3580
3625
  let n = e._hierarchyHeight || e.height, r = t.nodeWidth(e), i = t.nodeHeight(e);
3581
3626
  Object.assign(e, {
3582
3627
  width: r,
@@ -3589,13 +3634,13 @@ var Z = {
3589
3634
  _directSubordinatesPaging: (e.children || e._children || []).length,
3590
3635
  _totalSubordinates: e.allDescendants().length - 1
3591
3636
  });
3592
- });
3637
+ }));
3593
3638
  }
3594
3639
  collapse(e) {
3595
- e.children &&= (e._children = e.children, e._children.forEach((e) => this.collapse(e)), null);
3640
+ e.children &&= (e._children = e.children, e._children.forEach((e) => this.collapse(e)), void 0);
3596
3641
  }
3597
3642
  expand(e) {
3598
- e._children &&= (e.children = e._children, e.children.forEach((e) => this.expand(e)), null);
3643
+ e._children &&= (e.children = e._children, e.children.forEach((e) => this.expand(e)), void 0);
3599
3644
  }
3600
3645
  enableDrag() {
3601
3646
  let e = this.getChartState();
@@ -3609,7 +3654,7 @@ var Z = {
3609
3654
  let r = this.getChartState();
3610
3655
  r.dragNode = n;
3611
3656
  let i = t.subject.width / 2;
3612
- r.dragStartX = t.x - i, r.dragStartY = parseFloat(t.y), r.isDragStarting = !0, P(e).classed("dragging", !0);
3657
+ r.dragStartX = t.x - i, r.dragStartY = t.y, r.isDragStarting = !0, P(e).classed("dragging", !0);
3613
3658
  }
3614
3659
  onDrag(e, t) {
3615
3660
  let n = this.getChartState(), r = this.getConfig();
@@ -3618,7 +3663,7 @@ var Z = {
3618
3663
  if (n.isDragStarting) {
3619
3664
  n.isDragStarting = !1, r.container.classList.add("dragging-active"), i.raise();
3620
3665
  let e = t.subject.descendants(), a = [...e || [], t.subject], o = e.filter((e) => e.data.id !== t.subject.id);
3621
- n.linksWrapper.selectAll("path.link").data(a, (e) => r.nodeId(e.data)).remove(), o && n.nodesWrapper.selectAll("g.node").data(o, (e) => r.nodeId(e.data)).remove();
3666
+ n.linksWrapper?.selectAll("path.link").data(a, (e) => r.nodeId(e.data) ?? "").remove(), o && n.nodesWrapper?.selectAll("g.node").data(o, (e) => r.nodeId(e.data) ?? "").remove();
3622
3667
  }
3623
3668
  n.dropNode = null;
3624
3669
  let a = {
@@ -3630,7 +3675,7 @@ var Z = {
3630
3675
  bottom: t.y + t.subject.height,
3631
3676
  midX: t.x + t.subject.width / 2,
3632
3677
  midY: t.y + t.subject.height / 2
3633
- }, o = or("g.node:not(.dragging)");
3678
+ }, o = ur("g.node:not(.dragging)");
3634
3679
  o.classed("drop-target", !1), o.filter(function(e) {
3635
3680
  let t = {
3636
3681
  left: e.x,
@@ -3638,9 +3683,8 @@ var Z = {
3638
3683
  top: e.y,
3639
3684
  bottom: e.y + e.height
3640
3685
  };
3641
- if (n.dragNode.parent === e) return !1;
3642
- if (a.midX > t.left && a.midX < t.right && a.midY > t.top && a.midY < t.bottom && this.classList.contains("droppable")) return n.dropNode = e, !!e;
3643
- }).classed("drop-target", !0), n.dragStartX += parseFloat(t.dx), n.dragStartY += parseFloat(t.dy), i.attr("transform", "translate(" + n.dragStartX + "," + n.dragStartY + ")");
3686
+ return n.dragNode?.parent === e ? !1 : a.midX > t.left && a.midX < t.right && a.midY > t.top && a.midY < t.bottom && this.classList.contains("droppable") ? (n.dropNode = e, !0) : !1;
3687
+ }).classed("drop-target", !0), n.dragStartX += t.dx, n.dragStartY += t.dy, i.attr("transform", "translate(" + n.dragStartX + "," + n.dragStartY + ")");
3644
3688
  }
3645
3689
  onDragEnd(e, t) {
3646
3690
  this.getConfig().container.classList.remove("dragging-active");
@@ -3650,11 +3694,11 @@ var Z = {
3650
3694
  this.render();
3651
3695
  return;
3652
3696
  }
3653
- if (t.subject.parent.id === n.dropNode.id) {
3697
+ if (t.subject.parent?.id === n.dropNode.id) {
3654
3698
  this.render();
3655
3699
  return;
3656
3700
  }
3657
- P(e).remove(), n.dragNode.parent = n.dropNode, n.dragNode.parent && (n.dragNode.parent.children = n.dragNode.parent.children?.filter((e) => e.id !== n.dragNode?.id) || null), this.getConfig().onNodeParentChange?.(n.dragNode), n.dropNode = null, n.dragNode = null, this.render();
3701
+ P(e).remove(), n.dragNode.parent = n.dropNode, n.dragNode.parent && (n.dragNode.parent.children = n.dragNode.parent.children?.filter((e) => e.id !== n.dragNode?.id) || void 0), this.getConfig().onNodeParentChange?.(n.dragNode), n.dropNode = null, n.dragNode = null, this.render();
3658
3702
  }
3659
3703
  }
3660
3704
  zoomed(e) {
@@ -3663,32 +3707,57 @@ var Z = {
3663
3707
  let r = e.transform;
3664
3708
  t.lastTransform = r, n.attr("transform", r.toString());
3665
3709
  }
3666
- zoomTreeBounds({ x0: e, x1: t, y0: n, y1: r, params: i = {
3710
+ zoomTreeBounds({ x0: e, x1: t, y0: n, y1: r, focus: i, params: a = {
3667
3711
  animate: !0,
3668
3712
  scale: !0,
3669
3713
  onCompleted: void 0
3670
3714
  } }) {
3671
- let { width: a, height: o } = this.getChartState().containerRect, { svg: s, zoomBehavior: c, lastTransform: l } = this.getChartState(), { duration: u, scaleExtent: d } = this.getConfig(), f = Math.min(d[1], Math.max(d[0], 1 / Math.max((t - e) / a, (r - n) / o))), p = Z.zoomIdentity.translate(a / 2, o / 2);
3672
- p = p.scale(i.scale ? f : l.k), p = p.translate(-(e + t) / 2, -(n + r) / 2), s.transition().duration(i.animate ? u : 0).call(c.transform, p);
3715
+ let { svg: o, zoomBehavior: s, lastTransform: c, containerRect: l } = this.getChartState();
3716
+ if (!o || !s || !l) return;
3717
+ let { width: u, height: d } = l, { duration: f, scaleExtent: p, minFitScale: m } = this.getConfig(), { k: h, x: g, y: _ } = Fa({
3718
+ bounds: {
3719
+ x0: e,
3720
+ x1: t,
3721
+ y0: n,
3722
+ y1: r
3723
+ },
3724
+ viewport: {
3725
+ width: u,
3726
+ height: d
3727
+ },
3728
+ scaleExtent: p,
3729
+ minScale: m,
3730
+ scale: a.scale ? void 0 : c.k,
3731
+ focus: i
3732
+ }), v = Q.zoomIdentity.translate(g, _).scale(h);
3733
+ o.transition().duration(a.animate ? f : 0).call(s.transform, v);
3673
3734
  }
3674
3735
  applyTransform(e, t = !1) {
3675
3736
  let { zoomBehavior: n, lastTransform: r, svg: i } = this.getChartState(), { duration: a } = this.getConfig();
3676
3737
  if (e.k === r.k && e.x === r.x && e.y === r.y) return;
3677
- let o = Z.zoomIdentity.translate(e.x, e.y).scale(e.k);
3678
- i && i.transition().duration(t ? 0 : a).call(n.transform, o);
3738
+ let o = Q.zoomIdentity.translate(e.x, e.y).scale(e.k);
3739
+ i && n && i.transition().duration(t ? 0 : a).call(n.transform, o);
3679
3740
  }
3680
3741
  fit({ animate: e = !0, nodes: t, scale: n = !0, onCompleted: r } = {}) {
3681
- let i = this.getChartState(), a = this.getConfig(), { root: o } = i, s = t || (a.gridEnabled ? o.descendants().slice(1) : o.descendants()), c = Z.min(s, (e) => e.x + a.layoutBindings[a.layout].nodeLeftX(e)), l = Z.max(s, (e) => e.x + a.layoutBindings[a.layout].nodeRightX(e)), u = Z.min(s, (e) => e.y + a.layoutBindings[a.layout].nodeTopY(e)), d = Z.max(s, (e) => e.y + a.layoutBindings[a.layout].nodeBottomY(e));
3742
+ let i = this.getChartState(), a = this.getConfig(), { root: o } = i;
3743
+ if (!o) return this;
3744
+ let s = a.layoutBindings[a.layout], c = t || (a.gridEnabled ? o.descendants().slice(1) : o.descendants()), l = Q.min(c, (e) => e.x + s.nodeLeftX(e)), u = Q.max(c, (e) => e.x + s.nodeRightX(e)), d = Q.min(c, (e) => e.y + s.nodeTopY(e)), f = Q.max(c, (e) => e.y + s.nodeBottomY(e));
3745
+ if (l === void 0 || u === void 0 || d === void 0 || f === void 0) return this;
3746
+ let p = t ? void 0 : o.id === "__root__" ? o.children?.[0] : o;
3682
3747
  return this.zoomTreeBounds({
3683
3748
  params: {
3684
3749
  animate: e,
3685
3750
  scale: n,
3686
3751
  onCompleted: r
3687
3752
  },
3688
- x0: c - a.padding.left,
3689
- x1: l + a.padding.right,
3690
- y0: u - a.padding.top,
3691
- y1: d + a.padding.bottom
3753
+ x0: l - a.padding.left,
3754
+ x1: u + a.padding.right,
3755
+ y0: d - a.padding.top,
3756
+ y1: f + a.padding.bottom,
3757
+ focus: p ? {
3758
+ x: p.x + (s.nodeLeftX(p) + s.nodeRightX(p)) / 2,
3759
+ y: p.y + (s.nodeTopY(p) + s.nodeBottomY(p)) / 2
3760
+ } : void 0
3692
3761
  }), this;
3693
3762
  }
3694
3763
  unsetUserTransform() {
@@ -3697,24 +3766,24 @@ var Z = {
3697
3766
  }
3698
3767
  zoomIn() {
3699
3768
  let { svg: e, zoomBehavior: t } = this.getChartState();
3700
- e.transition().call(t.scaleBy, 1.3);
3769
+ e && t && e.transition().call(t.scaleBy, 1.3);
3701
3770
  }
3702
3771
  zoomOut() {
3703
3772
  let { svg: e, zoomBehavior: t } = this.getChartState();
3704
- e.transition().call(t.scaleBy, .78);
3773
+ e && t && e.transition().call(t.scaleBy, .78);
3705
3774
  }
3706
3775
  destroy() {
3707
3776
  let e = this.getChartState();
3708
3777
  e.svg && (e.svg.selectAll("*").remove(), e.svg = null, e.chart = null);
3709
3778
  }
3710
- }, Q = ge(), go = (e, t, n) => {
3779
+ }, $ = ge(), So = (e, t, n) => {
3711
3780
  let r = String(n);
3712
3781
  return Array.from(e.querySelectorAll(".node[data-brush][data-value]")).find((e) => e.getAttribute("data-brush") === t && e.getAttribute("data-value") === r);
3713
- }, _o = (e, t, n) => {
3714
- let r = h(), i = (0, k.useCallback)((t) => {
3715
- t.data.brush && r.daedalus.emitEvent(O.Brush, {
3782
+ }, Co = (e, t, n) => {
3783
+ let r = y(), i = (0, k.useCallback)((t) => {
3784
+ t.data.brush && r.daedalus.emitEvent(se.Brush, {
3716
3785
  data: {
3717
- action: Q.BrushEventAction.Hover,
3786
+ action: $.BrushEventAction.Hover,
3718
3787
  data: [{
3719
3788
  id: t.data.brush.key,
3720
3789
  values: [t.data.brush.value]
@@ -3723,9 +3792,9 @@ var Z = {
3723
3792
  emitter: e
3724
3793
  });
3725
3794
  }, [r, e]), a = (0, k.useCallback)((t) => {
3726
- t.data.brush && r.daedalus.emitEvent(O.Brush, {
3795
+ t.data.brush && r.daedalus.emitEvent(se.Brush, {
3727
3796
  data: {
3728
- action: Q.BrushEventAction.Blur,
3797
+ action: $.BrushEventAction.Blur,
3729
3798
  data: [{
3730
3799
  id: t.data.brush.key,
3731
3800
  values: [t.data.brush.value]
@@ -3733,50 +3802,50 @@ var Z = {
3733
3802
  },
3734
3803
  emitter: e
3735
3804
  });
3736
- }, [r, e]), o = (0, k.useRef)({});
3737
- return o.current[O.Brush] = (r) => {
3805
+ }, [r, e]), o = (0, k.useRef)();
3806
+ return o.current = (r) => {
3738
3807
  if (r.emitter !== e && !(!t || !n.interactive)) switch (r.data.action) {
3739
- case Q.BrushEventAction.Hover:
3808
+ case $.BrushEventAction.Hover:
3740
3809
  r.data.data.forEach(({ id: e, values: n }) => {
3741
3810
  n.forEach((n) => {
3742
- go(t, e, n)?.classList.add("hovered");
3811
+ So(t, e, n)?.classList.add("hovered");
3743
3812
  });
3744
3813
  });
3745
3814
  break;
3746
- case Q.BrushEventAction.Blur:
3815
+ case $.BrushEventAction.Blur:
3747
3816
  r.data.data.forEach(({ id: e, values: n }) => {
3748
3817
  n.forEach((n) => {
3749
- go(t, e, n)?.classList.remove("hovered");
3818
+ So(t, e, n)?.classList.remove("hovered");
3750
3819
  });
3751
3820
  });
3752
3821
  break;
3753
- case Q.BrushEventAction.End:
3822
+ case $.BrushEventAction.End:
3754
3823
  t.querySelectorAll(".node.hovered").forEach((e) => e.classList.remove("hovered"));
3755
3824
  break;
3756
3825
  }
3757
- }, y({
3758
- action: O.Brush,
3759
- handler: ({ payload: e }) => e && o.current[O.Brush](e)
3826
+ }, b({
3827
+ action: se.Brush,
3828
+ handler: ({ payload: e }) => e && o.current?.(e)
3760
3829
  }, []), {
3761
3830
  onTreeNodeHover: i,
3762
3831
  onTreeNodeLeave: a
3763
3832
  };
3764
- }, vo = (e) => {
3765
- let { variables: t, variablesFetched: n, updateVariable: r } = w();
3833
+ }, wo = (e) => {
3834
+ let { variables: t, variablesFetched: n, updateVariable: r } = v();
3766
3835
  return {
3767
3836
  variables: (0, k.useMemo)(() => {
3768
3837
  let n = {};
3769
3838
  return e.measures?.forEach((e) => {
3770
- !e.slots || !s(e) || Object.values(e.slots).filter((e) => e.enabled && e.source === "variable" && e.propertyValue?.type === "variable").forEach((r) => {
3771
- let i = r.propertyValue.variableName;
3772
- if (!i) return;
3773
- let a = t.find((e) => e.name === i);
3774
- n[i] || (n[i] = {
3775
- id: a?.id ?? null,
3839
+ !e.slots || !p(e) || Object.values(e.slots).filter((e) => e.enabled && e.source === "variable" && e.propertyValue?.type === "variable").forEach((r) => {
3840
+ let a = r.propertyValue.variableName;
3841
+ if (!a) return;
3842
+ let o = t.find((e) => e.name === a);
3843
+ n[a] || (n[a] = {
3844
+ id: o?.id ?? null,
3776
3845
  measureId: []
3777
3846
  });
3778
- let o = l(e.dataItem);
3779
- n[i].measureId.includes(o) || n[i].measureId.push(o);
3847
+ let s = i(e.dataItem);
3848
+ n[a].measureId.includes(s) || n[a].measureId.push(s);
3780
3849
  });
3781
3850
  }), n;
3782
3851
  }, [
@@ -3787,122 +3856,133 @@ var Z = {
3787
3856
  updateVariable: r,
3788
3857
  variablesFetched: n
3789
3858
  };
3790
- }, yo = (e, t) => {
3791
- let n = e.dimensions.filter(s), r = n.map((e) => l(e.dataItem)), i = n.length, a = (0, k.useMemo)(() => T(n.map((e) => ({
3859
+ }, To = (e, t) => {
3860
+ let n = e.dimensions.filter(p), r = n.map((e) => i(e.dataItem)), a = n.length, o = (0, k.useMemo)(() => C(n.map((e) => ({
3792
3861
  dataItem: e.dataItem,
3793
3862
  dateLevel: void 0,
3794
3863
  datePart: void 0,
3795
- operator: Qa.FilterOperator.InList
3796
- })), { ignoreApplied: !0 }), [r]), o = (0, k.useCallback)((e) => {
3797
- if (!i || !a?.length || !e.data.brush) return;
3798
- let { key: t, value: n } = e.data.brush, r = a.find((e) => e.fieldKey === t && de(e.operators));
3864
+ operator: io.FilterOperator.InList
3865
+ })), { ignoreApplied: !0 }), [r]), s = (0, k.useCallback)((e) => {
3866
+ if (!a || !o?.length || !e.data.brush) return;
3867
+ let { key: t, value: n } = e.data.brush, r = o.find((e) => e.fieldKey === t && de(e.operators));
3799
3868
  if (!r) return;
3800
- let o = (r.operators.pending ?? r.operators.applied ?? r.operators.initial) === Qa.FilterOperator.NotInList ? "off" : "on";
3801
- r.state.pending && r.state.pending.includes(n) && (o = o === "off" ? "on" : "off"), r.onClick(n, { [o]: !0 });
3802
- }, [a, r]);
3869
+ let i = (r.operators.pending ?? r.operators.applied ?? r.operators.initial) === io.FilterOperator.NotInList ? "off" : "on";
3870
+ r.state.pending && r.state.pending.includes(n) && (i = i === "off" ? "on" : "off"), r.onClick(n, { [i]: !0 });
3871
+ }, [o, r]);
3803
3872
  return (0, k.useEffect)(() => {
3804
- t && (t.querySelectorAll(".node.selected").forEach((e) => e.classList.remove("selected")), a.forEach(({ fieldKey: e, state: n }) => {
3873
+ t && (t.querySelectorAll(".node.selected").forEach((e) => e.classList.remove("selected")), o.forEach(({ fieldKey: e, state: n }) => {
3805
3874
  n.pending !== null && n.pending.forEach((n) => {
3806
- go(t, e, n)?.classList.add("selected");
3875
+ e && So(t, e, n)?.classList.add("selected");
3807
3876
  });
3808
3877
  }));
3809
- }, [t, JSON.stringify(a)]), { onTreeNodeClick: o };
3810
- }, bo = (e, t) => {
3878
+ }, [t, JSON.stringify(o)]), { onTreeNodeClick: s };
3879
+ }, Eo = (e, t) => {
3811
3880
  e.next({
3812
- action: f.SaveLocalVSpec,
3881
+ action: T.SaveLocalVSpec,
3813
3882
  payload: { vSpecChange: { treeChartSettings: { ...t } } },
3814
3883
  mergeWith(e, t, n) {
3815
3884
  if (n === "nodeExpandState") return t;
3816
3885
  }
3817
3886
  });
3818
- }, xo = 80, So = (e, t, n, r) => {
3819
- let i = (0, k.useRef)(e.treeChartSettings?.nodeExpandState ?? {}), a = r.forceAutoFit, o = ee(), c = vo(o), u = b(), d = m(), f = e.dimensions.filter(s), p = f.length, [h] = (0, k.useState)(e.treeChartSettings?.transform ?? null), [g, _] = (0, k.useState)(h ?? {
3887
+ }, Do = 80, Oo = (e, t, n, r) => {
3888
+ let a = (0, k.useRef)(e.treeChartSettings?.nodeExpandState ?? {}), o = r.forceAutoFit, s = ee(), c = wo(s), l = h(), u = te(), d = y(), f = e.dimensions.filter(p), m = f.length, [g] = (0, k.useState)(e.treeChartSettings?.transform ?? null), [_, v] = (0, k.useState)(g ?? {
3820
3889
  k: 1,
3821
3890
  x: 0,
3822
3891
  y: 0
3823
- }), v = (0, k.useRef)(e.treeChartSettings?.transform), { onTreeNodeHover: y, onTreeNodeLeave: x } = _o(n, t.current, r), { onTreeNodeClick: S } = yo(e, t.current), C = (0, k.useRef)(new ho()), w = (0, k.useRef)(null), T = !e.treeChartSettings.gridLayout?.enabled && e.treeChartSettings?.nodeLayout?.hoverStyle?.enabled, E = (0, k.useCallback)(() => {
3824
- w.current &&= (clearTimeout(w.current), null);
3892
+ }), b = (0, k.useRef)(e.treeChartSettings?.transform), { onTreeNodeHover: x, onTreeNodeLeave: S } = Co(n, t.current, r), { onTreeNodeClick: C } = To(e, t.current), w = (0, k.useRef)(new xo()), T = (0, k.useRef)(null), re = !e.treeChartSettings.gridLayout?.enabled && e.treeChartSettings?.nodeLayout?.hoverStyle?.enabled, E = (0, k.useCallback)(() => {
3893
+ T.current &&= (clearTimeout(T.current), null);
3825
3894
  }, []);
3826
- return C.current.onNodeHover((e) => {
3827
- r.interactive && y(e), T && (E(), C.current.highlight(e));
3895
+ return w.current.onNodeHover((e) => {
3896
+ r.interactive && x(e), re && (E(), w.current.highlight(e));
3828
3897
  }).onNodeLeave((e) => {
3829
- r.interactive && x(e), T && (E(), w.current = setTimeout(() => {
3830
- C.current.highlight(null), w.current = null;
3831
- }, xo));
3898
+ r.interactive && S(e), re && (E(), T.current = setTimeout(() => {
3899
+ w.current.highlight(null), T.current = null;
3900
+ }, Do));
3832
3901
  }).onNodeClick((e) => {
3833
- r.interactive && S(e);
3902
+ if (!r.interactive) return;
3903
+ let t = m > 0 ? e.data.id === "__total__" ? "total" : "dimension" : "measure", n = e.data.value?.value, i = t === "dimension" ? e.data.brush?.value : n;
3904
+ ke({
3905
+ id: "onNodeClick",
3906
+ nodeName: e.data.label,
3907
+ nodeType: t,
3908
+ ...i == null ? {} : { nodeValue: i },
3909
+ ...n == null ? {} : { measureValue: n }
3910
+ }, { vBackendAPI: d }), C(e);
3834
3911
  }).onNodeParentChange((t) => {
3835
- if (p > 0) return;
3912
+ if (m > 0) return;
3836
3913
  let n = e.measures.find((e) => e.dataItem.uniqueSignature === t.data.id);
3837
- n && te(d, e.measures, l(n.dataItem), !t.parent || t.parent.data.id === "__root__" ? null : t.parent.data.id);
3914
+ n && ne(u, e.measures, i(n.dataItem), !t.parent || t.parent.data.id === "__root__" ? void 0 : t.parent.data.id);
3838
3915
  }).onExpandOrCollapse((t) => {
3839
- let n = rt(t, e.treeChartSettings?.initialExpandedLevels, f.length, e.totals?.enabled ?? !1), r = !(t._children?.length > 0 && !t.children?.length);
3840
- r === n ? delete i.current[t.data.id] : i.current[t.data.id] = r, bo(u, { nodeExpandState: i.current }), !(p > 0) && Object.values(c.variables).filter((e) => e.measureId.includes(t.data.id)).forEach((e) => {
3841
- c.updateVariable(e.id, r, Qa.VariableType.boolean);
3916
+ let n = st(t, e.treeChartSettings?.initialExpandedLevels, f.length, e.totals?.enabled ?? !1), r = !((t._children?.length ?? 0) > 0 && !t.children?.length);
3917
+ r === n ? delete a.current[t.data.id] : a.current[t.data.id] = r, Eo(l, { nodeExpandState: a.current }), !(m > 0) && Object.values(c.variables).filter((e) => e.measureId.includes(t.data.id)).forEach((e) => {
3918
+ e.id && c.updateVariable(e.id, r, io.VariableType.boolean);
3842
3919
  });
3843
3920
  }).onUserZoom(() => {
3844
- v.current = null;
3921
+ b.current = null;
3845
3922
  }).onZoomEnd((e) => {
3846
- if (a) return;
3923
+ if (o) return;
3847
3924
  let t = {
3848
3925
  k: e.transform.k,
3849
3926
  x: e.transform.x,
3850
3927
  y: e.transform.y
3851
3928
  };
3852
- t.k === g.k && t.x === g.x && t.y === g.y || (_(t), bo(u, {
3853
- nodeExpandState: i.current,
3929
+ t.k === _.k && t.x === _.x && t.y === _.y || (v(t), Eo(l, {
3930
+ nodeExpandState: a.current,
3854
3931
  transform: t
3855
3932
  }));
3856
3933
  }), (0, k.useEffect)(() => () => E(), [E]), (0, k.useEffect)(() => {
3857
- e.treeChartSettings?.nodeExpandState && (i.current = e.treeChartSettings.nodeExpandState ?? {});
3934
+ e.treeChartSettings?.nodeExpandState && (a.current = e.treeChartSettings.nodeExpandState ?? {});
3858
3935
  }, [e.treeChartSettings?.nodeExpandState]), (0, k.useEffect)(() => {
3859
- o.treeChartSettings?.nodeExpandState || (i.current = {});
3860
- }, [o.treeChartSettings?.initialExpandedLevels]), (0, k.useEffect)(() => {
3861
- v.current = e.treeChartSettings?.transform, C.current && C.current.unsetUserTransform(), !(!e.treeChartSettings?.transform || !C.current) && C.current.applyTransform(e.treeChartSettings.transform);
3936
+ s.treeChartSettings?.nodeExpandState || (a.current = {});
3937
+ }, [s.treeChartSettings?.initialExpandedLevels]), (0, k.useEffect)(() => {
3938
+ b.current = e.treeChartSettings?.transform, w.current && w.current.unsetUserTransform(), !(!e.treeChartSettings?.transform || !w.current) && w.current.applyTransform(e.treeChartSettings.transform);
3862
3939
  }, [e.treeChartSettings?.transform]), {
3863
- chart: C.current,
3864
- expandedState: i
3865
- };
3866
- }, $ = g(), Co = ({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
3867
- let a = i?.isEditMode ?? !1, o = i?.isPrintMode ?? !1, c = e?.treeChartSettings?.gridLayout?.enabled, l = e.dimensions.filter(s).length, d = e.measures.filter(s), f = (0, k.useRef)("tree-" + u(10)), p = (0, k.useRef)(null), m = e.treeChartSettings?.forceAutoFit === !0, { layout: h, treeSettings: g } = Ma(e, i), { chart: _, expandedState: y } = So(e, p, f.current, g), b = Aa(e, p, _), x = ct({
3940
+ chart: w.current,
3941
+ expandedState: a
3942
+ };
3943
+ }, ko = ({ vSpec: e, vTheme: t, data: n, elementSize: r = {
3944
+ width: 0,
3945
+ height: 0
3946
+ }, vizProperties: i }) => {
3947
+ let a = i?.isEditMode ?? !1, o = i?.isPrintMode ?? !1, c = e?.treeChartSettings?.gridLayout?.enabled, l = e.dimensions.filter(p).length, u = e.measures.filter(p), d = (0, k.useRef)("tree-" + s(10)), f = (0, k.useRef)(null), m = e.treeChartSettings?.forceAutoFit === !0, { layout: h, treeSettings: g } = Ra(e, i), { chart: _, expandedState: v } = Oo(e, f, d.current, g), y = Ia(e, f, _), b = ft({
3868
3948
  vSpec: e,
3869
3949
  data: n,
3870
- nodeExpandState: y
3871
- }), [S, C] = (0, k.useState)(!1);
3872
- (0, k.useLayoutEffect)(() => (_ && _.init(), () => {
3873
- _?.destroy();
3874
- }), [p.current]), (0, k.useEffect)(() => {
3875
- S ? _.enableDrag() : _.disableDrag();
3876
- }, [S]), (0, k.useEffect)(() => {
3877
- !p.current || !_ || !r.width || !r.height || b(x, g);
3950
+ nodeExpandState: v
3951
+ }), [x, S] = (0, k.useState)(!1);
3952
+ (0, k.useLayoutEffect)(() => (f.current && _.container(f.current).init(), () => {
3953
+ _.destroy();
3954
+ }), [_]), (0, k.useEffect)(() => {
3955
+ x ? _.enableDrag() : _.disableDrag();
3956
+ }, [x]), (0, k.useEffect)(() => {
3957
+ !f.current || !_ || !r.width || !r.height || y(b, g);
3878
3958
  }, [
3879
3959
  r.width,
3880
3960
  r.height,
3881
- b
3961
+ y
3882
3962
  ]);
3883
- let w = a && l === 0 && !c;
3963
+ let C = a && l === 0 && !c;
3884
3964
  (0, k.useEffect)(() => {
3885
- p.current && b(x, g);
3965
+ f.current && y(b, g);
3886
3966
  }, [
3887
- x,
3967
+ b,
3888
3968
  JSON.stringify(g),
3889
- b
3969
+ y
3890
3970
  ]);
3891
- let T = Ne({
3971
+ let ee = Le({
3892
3972
  vTheme: t,
3893
3973
  vSpec: e,
3894
- id: f.current,
3974
+ id: d.current,
3895
3975
  layout: h
3896
3976
  });
3897
- return /* @__PURE__ */ (0, $.jsxs)("div", {
3977
+ return /* @__PURE__ */ (0, O.jsxs)("div", {
3898
3978
  style: {
3899
3979
  width: "100%",
3900
3980
  height: "100%"
3901
3981
  },
3902
- id: f.current,
3982
+ id: d.current,
3903
3983
  "data-mode": a ? "edit" : "view",
3904
3984
  children: [
3905
- !o && /* @__PURE__ */ (0, $.jsxs)("div", {
3985
+ !o && /* @__PURE__ */ (0, O.jsxs)("div", {
3906
3986
  className: "tree-toolbar",
3907
3987
  style: {
3908
3988
  position: "absolute",
@@ -3912,33 +3992,36 @@ var Z = {
3912
3992
  top: 0,
3913
3993
  gap: 10
3914
3994
  },
3915
- children: [w && /* @__PURE__ */ (0, $.jsx)(E, {
3995
+ children: [C && /* @__PURE__ */ (0, O.jsx)(xe, {
3916
3996
  size: "small",
3917
3997
  value: "organize",
3918
- selected: S,
3919
- onChange: () => C(!S),
3920
- disabled: d.length < 2,
3921
- children: /* @__PURE__ */ (0, $.jsx)(re, {})
3922
- }), !m && /* @__PURE__ */ (0, $.jsx)(E, {
3998
+ selected: x,
3999
+ onChange: () => S(!x),
4000
+ disabled: u.length < 2,
4001
+ children: /* @__PURE__ */ (0, O.jsx)(Ie, {})
4002
+ }), !m && /* @__PURE__ */ (0, O.jsx)(xe, {
3923
4003
  value: "",
3924
4004
  size: "small",
3925
4005
  onClick: () => _?.fit(),
3926
- children: /* @__PURE__ */ (0, $.jsx)(v, {})
4006
+ children: /* @__PURE__ */ (0, O.jsx)(w, {})
3927
4007
  })]
3928
4008
  }),
3929
- /* @__PURE__ */ (0, $.jsx)("style", { children: T }),
3930
- /* @__PURE__ */ (0, $.jsx)("div", {
4009
+ /* @__PURE__ */ (0, O.jsx)("style", { children: ee }),
4010
+ /* @__PURE__ */ (0, O.jsx)("div", {
3931
4011
  style: {
3932
4012
  width: "100%",
3933
4013
  height: "100%"
3934
4014
  },
3935
- ref: p
4015
+ ref: f
3936
4016
  })
3937
4017
  ]
3938
4018
  });
3939
- }, wo = p(class extends k.Component {
3940
- render() {
3941
- return /* @__PURE__ */ (0, $.jsx)(Co, { ...this.props });
3942
- }
4019
+ }, Ao = _((e) => {
4020
+ let { vSpec: t, data: n } = e;
4021
+ return !t || !n || !f(t) ? null : /* @__PURE__ */ (0, O.jsx)(ko, {
4022
+ ...e,
4023
+ vSpec: t,
4024
+ data: n
4025
+ });
3943
4026
  });
3944
- export { wo as Tree };
4027
+ export { Ao as Tree };