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