chartformers 1.0.53 → 1.0.54

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.
@@ -1,4 +1,4 @@
1
- import aa, { useRef as Pt, useEffect as vt, useState as ft } from "react";
1
+ import aa, { useRef as Pt, useEffect as _t, useState as ut } from "react";
2
2
  import { createPortal as kn } from "react-dom";
3
3
  var Xe = { exports: {} }, Se = {};
4
4
  /**
@@ -48,41 +48,41 @@ function oa() {
48
48
  function t(m) {
49
49
  if (m == null) return null;
50
50
  if (typeof m == "function")
51
- return m.$$typeof === C ? null : m.displayName || m.name || null;
51
+ return m.$$typeof === $ ? null : m.displayName || m.name || null;
52
52
  if (typeof m == "string") return m;
53
53
  switch (m) {
54
- case K:
54
+ case J:
55
55
  return "Fragment";
56
- case q:
56
+ case z:
57
57
  return "Profiler";
58
- case T:
58
+ case j:
59
59
  return "StrictMode";
60
- case F:
60
+ case W:
61
61
  return "Suspense";
62
- case J:
62
+ case Y:
63
63
  return "SuspenseList";
64
- case B:
64
+ case et:
65
65
  return "Activity";
66
66
  }
67
67
  if (typeof m == "object")
68
68
  switch (typeof m.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
70
  ), m.$$typeof) {
71
- case j:
71
+ case D:
72
72
  return "Portal";
73
- case A:
73
+ case k:
74
74
  return m.displayName || "Context";
75
- case $:
75
+ case M:
76
76
  return (m._context.displayName || "Context") + ".Consumer";
77
- case O:
78
- var D = m.render;
79
- return m = m.displayName, m || (m = D.displayName || D.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
80
- case G:
81
- return D = m.displayName || null, D !== null ? D : t(m.type) || "Memo";
82
- case Y:
83
- D = m._payload, m = m._init;
77
+ case R:
78
+ var E = m.render;
79
+ return m = m.displayName, m || (m = E.displayName || E.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
80
+ case K:
81
+ return E = m.displayName || null, E !== null ? E : t(m.type) || "Memo";
82
+ case q:
83
+ E = m._payload, m = m._init;
84
84
  try {
85
- return t(m(D));
85
+ return t(m(E));
86
86
  } catch {
87
87
  }
88
88
  }
@@ -94,72 +94,72 @@ function oa() {
94
94
  function n(m) {
95
95
  try {
96
96
  e(m);
97
- var D = !1;
97
+ var E = !1;
98
98
  } catch {
99
- D = !0;
99
+ E = !0;
100
100
  }
101
- if (D) {
102
- D = console;
103
- var P = D.error, W = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
104
- return P.call(
105
- D,
101
+ if (E) {
102
+ E = console;
103
+ var L = E.error, B = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
104
+ return L.call(
105
+ E,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- W
107
+ B
108
108
  ), e(m);
109
109
  }
110
110
  }
111
111
  function r(m) {
112
- if (m === K) return "<>";
113
- if (typeof m == "object" && m !== null && m.$$typeof === Y)
112
+ if (m === J) return "<>";
113
+ if (typeof m == "object" && m !== null && m.$$typeof === q)
114
114
  return "<...>";
115
115
  try {
116
- var D = t(m);
117
- return D ? "<" + D + ">" : "<...>";
116
+ var E = t(m);
117
+ return E ? "<" + E + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
122
  function i() {
123
- var m = L.A;
123
+ var m = C.A;
124
124
  return m === null ? null : m.getOwner();
125
125
  }
126
126
  function a() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
129
  function s(m) {
130
- if (w.call(m, "key")) {
131
- var D = Object.getOwnPropertyDescriptor(m, "key").get;
132
- if (D && D.isReactWarning) return !1;
130
+ if (b.call(m, "key")) {
131
+ var E = Object.getOwnPropertyDescriptor(m, "key").get;
132
+ if (E && E.isReactWarning) return !1;
133
133
  }
134
134
  return m.key !== void 0;
135
135
  }
136
- function o(m, D) {
137
- function P() {
138
- R || (R = !0, console.error(
136
+ function o(m, E) {
137
+ function L() {
138
+ A || (A = !0, console.error(
139
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
- D
140
+ E
141
141
  ));
142
142
  }
143
- P.isReactWarning = !0, Object.defineProperty(m, "key", {
144
- get: P,
143
+ L.isReactWarning = !0, Object.defineProperty(m, "key", {
144
+ get: L,
145
145
  configurable: !0
146
146
  });
147
147
  }
148
148
  function c() {
149
149
  var m = t(this.type);
150
- return M[m] || (M[m] = !0, console.error(
150
+ return S[m] || (S[m] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
152
  )), m = this.props.ref, m !== void 0 ? m : null;
153
153
  }
154
- function l(m, D, P, W, Z, Q) {
155
- var z = P.ref;
154
+ function l(m, E, L, B, tt, G) {
155
+ var O = L.ref;
156
156
  return m = {
157
- $$typeof: v,
157
+ $$typeof: _,
158
158
  type: m,
159
- key: D,
160
- props: P,
161
- _owner: W
162
- }, (z !== void 0 ? z : null) !== null ? Object.defineProperty(m, "ref", {
159
+ key: E,
160
+ props: L,
161
+ _owner: B
162
+ }, (O !== void 0 ? O : null) !== null ? Object.defineProperty(m, "ref", {
163
163
  enumerable: !1,
164
164
  get: c
165
165
  }) : Object.defineProperty(m, "ref", { enumerable: !1, value: null }), m._store = {}, Object.defineProperty(m._store, "validated", {
@@ -176,99 +176,99 @@ function oa() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: Z
179
+ value: tt
180
180
  }), Object.defineProperty(m, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: Q
184
+ value: G
185
185
  }), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
186
186
  }
187
- function u(m, D, P, W, Z, Q) {
188
- var z = D.children;
189
- if (z !== void 0)
190
- if (W)
191
- if (E(z)) {
192
- for (W = 0; W < z.length; W++)
193
- h(z[W]);
194
- Object.freeze && Object.freeze(z);
187
+ function u(m, E, L, B, tt, G) {
188
+ var O = E.children;
189
+ if (O !== void 0)
190
+ if (B)
191
+ if (P(O)) {
192
+ for (B = 0; B < O.length; B++)
193
+ h(O[B]);
194
+ Object.freeze && Object.freeze(O);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else h(z);
200
- if (w.call(D, "key")) {
201
- z = t(m);
202
- var y = Object.keys(D).filter(function(_) {
203
- return _ !== "key";
199
+ else h(O);
200
+ if (b.call(E, "key")) {
201
+ O = t(m);
202
+ var X = Object.keys(E).filter(function(p) {
203
+ return p !== "key";
204
204
  });
205
- W = 0 < y.length ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}", S[z + W] || (y = 0 < y.length ? "{" + y.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ B = 0 < X.length ? "{key: someKey, " + X.join(": ..., ") + ": ...}" : "{key: someKey}", T[O + B] || (X = 0 < X.length ? "{" + X.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
209
209
  React keys must be passed directly to JSX without using spread:
210
210
  let props = %s;
211
211
  <%s key={someKey} {...props} />`,
212
- W,
213
- z,
214
- y,
215
- z
216
- ), S[z + W] = !0);
212
+ B,
213
+ O,
214
+ X,
215
+ O
216
+ ), T[O + B] = !0);
217
217
  }
218
- if (z = null, P !== void 0 && (n(P), z = "" + P), s(D) && (n(D.key), z = "" + D.key), "key" in D) {
219
- P = {};
220
- for (var g in D)
221
- g !== "key" && (P[g] = D[g]);
222
- } else P = D;
223
- return z && o(
224
- P,
218
+ if (O = null, L !== void 0 && (n(L), O = "" + L), s(E) && (n(E.key), O = "" + E.key), "key" in E) {
219
+ L = {};
220
+ for (var d in E)
221
+ d !== "key" && (L[d] = E[d]);
222
+ } else L = E;
223
+ return O && o(
224
+ L,
225
225
  typeof m == "function" ? m.displayName || m.name || "Unknown" : m
226
226
  ), l(
227
227
  m,
228
- z,
229
- P,
228
+ O,
229
+ L,
230
230
  i(),
231
- Z,
232
- Q
231
+ tt,
232
+ G
233
233
  );
234
234
  }
235
235
  function h(m) {
236
- f(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === Y && (m._payload.status === "fulfilled" ? f(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
236
+ f(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === q && (m._payload.status === "fulfilled" ? f(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
237
237
  }
238
238
  function f(m) {
239
- return typeof m == "object" && m !== null && m.$$typeof === v;
239
+ return typeof m == "object" && m !== null && m.$$typeof === _;
240
240
  }
241
- var p = aa, v = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), K = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), A = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), L = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, w = Object.prototype.hasOwnProperty, E = Array.isArray, d = console.createTask ? console.createTask : function() {
241
+ var y = aa, _ = Symbol.for("react.transitional.element"), D = Symbol.for("react.portal"), J = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), M = Symbol.for("react.consumer"), k = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), et = Symbol.for("react.activity"), $ = Symbol.for("react.client.reference"), C = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, b = Object.prototype.hasOwnProperty, P = Array.isArray, g = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- p = {
244
+ y = {
245
245
  react_stack_bottom_frame: function(m) {
246
246
  return m();
247
247
  }
248
248
  };
249
- var R, M = {}, N = p.react_stack_bottom_frame.bind(
250
- p,
249
+ var A, S = {}, N = y.react_stack_bottom_frame.bind(
250
+ y,
251
251
  a
252
- )(), x = d(r(a)), S = {};
253
- Me.Fragment = K, Me.jsx = function(m, D, P) {
254
- var W = 1e4 > L.recentlyCreatedOwnerStacks++;
252
+ )(), x = g(r(a)), T = {};
253
+ Me.Fragment = J, Me.jsx = function(m, E, L) {
254
+ var B = 1e4 > C.recentlyCreatedOwnerStacks++;
255
255
  return u(
256
256
  m,
257
- D,
258
- P,
257
+ E,
258
+ L,
259
259
  !1,
260
- W ? Error("react-stack-top-frame") : N,
261
- W ? d(r(m)) : x
260
+ B ? Error("react-stack-top-frame") : N,
261
+ B ? g(r(m)) : x
262
262
  );
263
- }, Me.jsxs = function(m, D, P) {
264
- var W = 1e4 > L.recentlyCreatedOwnerStacks++;
263
+ }, Me.jsxs = function(m, E, L) {
264
+ var B = 1e4 > C.recentlyCreatedOwnerStacks++;
265
265
  return u(
266
266
  m,
267
- D,
268
- P,
267
+ E,
268
+ L,
269
269
  !0,
270
- W ? Error("react-stack-top-frame") : N,
271
- W ? d(r(m)) : x
270
+ B ? Error("react-stack-top-frame") : N,
271
+ B ? g(r(m)) : x
272
272
  );
273
273
  };
274
274
  })()), Me;
@@ -430,39 +430,39 @@ function Ra() {
430
430
  }
431
431
  function fi(t, e) {
432
432
  var n = [], r = null, i = null, a = 6, s = 6, o = 3, c = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, l = t === En || t === Re ? -1 : 1, u = t === Re || t === Cn ? "x" : "y", h = t === En || t === Yn ? Na : Sa;
433
- function f(p) {
434
- var v = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), j = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : Aa), K = Math.max(a, 0) + o, T = e.range(), q = +T[0] + c, $ = +T[T.length - 1] + c, A = (e.bandwidth ? Ta : Ma)(e.copy(), c), O = p.selection ? p.selection() : p, F = O.selectAll(".domain").data([null]), J = O.selectAll(".tick").data(v, e).order(), G = J.exit(), Y = J.enter().append("g").attr("class", "tick"), B = J.select("line"), C = J.select("text");
435
- F = F.merge(F.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), J = J.merge(Y), B = B.merge(Y.append("line").attr("stroke", "currentColor").attr(u + "2", l * a)), C = C.merge(Y.append("text").attr("fill", "currentColor").attr(u, l * K).attr("dy", t === En ? "0em" : t === Yn ? "0.71em" : "0.32em")), p !== O && (F = F.transition(p), J = J.transition(p), B = B.transition(p), C = C.transition(p), G = G.transition(p).attr("opacity", br).attr("transform", function(L) {
436
- return isFinite(L = A(L)) ? h(L + c) : this.getAttribute("transform");
437
- }), Y.attr("opacity", br).attr("transform", function(L) {
438
- var w = this.parentNode.__axis;
439
- return h((w && isFinite(w = w(L)) ? w : A(L)) + c);
440
- })), G.remove(), F.attr("d", t === Re || t === Cn ? s ? "M" + l * s + "," + q + "H" + c + "V" + $ + "H" + l * s : "M" + c + "," + q + "V" + $ : s ? "M" + q + "," + l * s + "V" + c + "H" + $ + "V" + l * s : "M" + q + "," + c + "H" + $), J.attr("opacity", 1).attr("transform", function(L) {
441
- return h(A(L) + c);
442
- }), B.attr(u + "2", l * a), C.attr(u, l * K).text(j), O.filter(Ra).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === Cn ? "start" : t === Re ? "end" : "middle"), O.each(function() {
443
- this.__axis = A;
433
+ function f(y) {
434
+ var _ = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), D = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : Aa), J = Math.max(a, 0) + o, j = e.range(), z = +j[0] + c, M = +j[j.length - 1] + c, k = (e.bandwidth ? Ta : Ma)(e.copy(), c), R = y.selection ? y.selection() : y, W = R.selectAll(".domain").data([null]), Y = R.selectAll(".tick").data(_, e).order(), K = Y.exit(), q = Y.enter().append("g").attr("class", "tick"), et = Y.select("line"), $ = Y.select("text");
435
+ W = W.merge(W.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), Y = Y.merge(q), et = et.merge(q.append("line").attr("stroke", "currentColor").attr(u + "2", l * a)), $ = $.merge(q.append("text").attr("fill", "currentColor").attr(u, l * J).attr("dy", t === En ? "0em" : t === Yn ? "0.71em" : "0.32em")), y !== R && (W = W.transition(y), Y = Y.transition(y), et = et.transition(y), $ = $.transition(y), K = K.transition(y).attr("opacity", br).attr("transform", function(C) {
436
+ return isFinite(C = k(C)) ? h(C + c) : this.getAttribute("transform");
437
+ }), q.attr("opacity", br).attr("transform", function(C) {
438
+ var b = this.parentNode.__axis;
439
+ return h((b && isFinite(b = b(C)) ? b : k(C)) + c);
440
+ })), K.remove(), W.attr("d", t === Re || t === Cn ? s ? "M" + l * s + "," + z + "H" + c + "V" + M + "H" + l * s : "M" + c + "," + z + "V" + M : s ? "M" + z + "," + l * s + "V" + c + "H" + M + "V" + l * s : "M" + z + "," + c + "H" + M), Y.attr("opacity", 1).attr("transform", function(C) {
441
+ return h(k(C) + c);
442
+ }), et.attr(u + "2", l * a), $.attr(u, l * J).text(D), R.filter(Ra).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === Cn ? "start" : t === Re ? "end" : "middle"), R.each(function() {
443
+ this.__axis = k;
444
444
  });
445
445
  }
446
- return f.scale = function(p) {
447
- return arguments.length ? (e = p, f) : e;
446
+ return f.scale = function(y) {
447
+ return arguments.length ? (e = y, f) : e;
448
448
  }, f.ticks = function() {
449
449
  return n = Array.from(arguments), f;
450
- }, f.tickArguments = function(p) {
451
- return arguments.length ? (n = p == null ? [] : Array.from(p), f) : n.slice();
452
- }, f.tickValues = function(p) {
453
- return arguments.length ? (r = p == null ? null : Array.from(p), f) : r && r.slice();
454
- }, f.tickFormat = function(p) {
455
- return arguments.length ? (i = p, f) : i;
456
- }, f.tickSize = function(p) {
457
- return arguments.length ? (a = s = +p, f) : a;
458
- }, f.tickSizeInner = function(p) {
459
- return arguments.length ? (a = +p, f) : a;
460
- }, f.tickSizeOuter = function(p) {
461
- return arguments.length ? (s = +p, f) : s;
462
- }, f.tickPadding = function(p) {
463
- return arguments.length ? (o = +p, f) : o;
464
- }, f.offset = function(p) {
465
- return arguments.length ? (c = +p, f) : c;
450
+ }, f.tickArguments = function(y) {
451
+ return arguments.length ? (n = y == null ? [] : Array.from(y), f) : n.slice();
452
+ }, f.tickValues = function(y) {
453
+ return arguments.length ? (r = y == null ? null : Array.from(y), f) : r && r.slice();
454
+ }, f.tickFormat = function(y) {
455
+ return arguments.length ? (i = y, f) : i;
456
+ }, f.tickSize = function(y) {
457
+ return arguments.length ? (a = s = +y, f) : a;
458
+ }, f.tickSizeInner = function(y) {
459
+ return arguments.length ? (a = +y, f) : a;
460
+ }, f.tickSizeOuter = function(y) {
461
+ return arguments.length ? (s = +y, f) : s;
462
+ }, f.tickPadding = function(y) {
463
+ return arguments.length ? (o = +y, f) : o;
464
+ }, f.offset = function(y) {
465
+ return arguments.length ? (c = +y, f) : c;
466
466
  }, f;
467
467
  }
468
468
  function Zt(t) {
@@ -673,11 +673,11 @@ function Qa(t, e, n, r, i, a) {
673
673
  (o = e[s]) && (i[s] = o);
674
674
  }
675
675
  function ts(t, e, n, r, i, a, s) {
676
- var o, c, l = /* @__PURE__ */ new Map(), u = e.length, h = a.length, f = new Array(u), p;
676
+ var o, c, l = /* @__PURE__ */ new Map(), u = e.length, h = a.length, f = new Array(u), y;
677
677
  for (o = 0; o < u; ++o)
678
- (c = e[o]) && (f[o] = p = s.call(c, c.__data__, o, e) + "", l.has(p) ? i[o] = c : l.set(p, c));
678
+ (c = e[o]) && (f[o] = y = s.call(c, c.__data__, o, e) + "", l.has(y) ? i[o] = c : l.set(y, c));
679
679
  for (o = 0; o < h; ++o)
680
- p = s.call(t, a[o], o, a) + "", (c = l.get(p)) ? (r[o] = c, c.__data__ = a[o], l.delete(p)) : n[o] = new cn(t, a[o]);
680
+ y = s.call(t, a[o], o, a) + "", (c = l.get(y)) ? (r[o] = c, c.__data__ = a[o], l.delete(y)) : n[o] = new cn(t, a[o]);
681
681
  for (o = 0; o < u; ++o)
682
682
  (c = e[o]) && l.get(f[o]) === c && (i[o] = c);
683
683
  }
@@ -689,12 +689,12 @@ function ns(t, e) {
689
689
  var n = e ? ts : Qa, r = this._parents, i = this._groups;
690
690
  typeof t != "function" && (t = Za(t));
691
691
  for (var a = i.length, s = new Array(a), o = new Array(a), c = new Array(a), l = 0; l < a; ++l) {
692
- var u = r[l], h = i[l], f = h.length, p = rs(t.call(u, u && u.__data__, l, r)), v = p.length, j = o[l] = new Array(v), K = s[l] = new Array(v), T = c[l] = new Array(f);
693
- n(u, h, j, K, T, p, e);
694
- for (var q = 0, $ = 0, A, O; q < v; ++q)
695
- if (A = j[q]) {
696
- for (q >= $ && ($ = q + 1); !(O = K[$]) && ++$ < v; ) ;
697
- A._next = O || null;
692
+ var u = r[l], h = i[l], f = h.length, y = rs(t.call(u, u && u.__data__, l, r)), _ = y.length, D = o[l] = new Array(_), J = s[l] = new Array(_), j = c[l] = new Array(f);
693
+ n(u, h, D, J, j, y, e);
694
+ for (var z = 0, M = 0, k, R; z < _; ++z)
695
+ if (k = D[z]) {
696
+ for (z >= M && (M = z + 1); !(R = J[M]) && ++M < _; ) ;
697
+ k._next = R || null;
698
698
  }
699
699
  }
700
700
  return s = new At(s, r), s._enter = o, s._exit = c, s;
@@ -711,8 +711,8 @@ function as(t, e, n) {
711
711
  }
712
712
  function ss(t) {
713
713
  for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, s = Math.min(i, a), o = new Array(i), c = 0; c < s; ++c)
714
- for (var l = n[c], u = r[c], h = l.length, f = o[c] = new Array(h), p, v = 0; v < h; ++v)
715
- (p = l[v] || u[v]) && (f[v] = p);
714
+ for (var l = n[c], u = r[c], h = l.length, f = o[c] = new Array(h), y, _ = 0; _ < h; ++_)
715
+ (y = l[_] || u[_]) && (f[_] = y);
716
716
  for (; c < i; ++c)
717
717
  o[c] = n[c];
718
718
  return new At(o, this._parents);
@@ -1295,35 +1295,35 @@ function Nr() {
1295
1295
  }
1296
1296
  function oe(t) {
1297
1297
  var e, n;
1298
- return t = (t + "").trim().toLowerCase(), (e = ho.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Sr(e) : n === 3 ? new mt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Ke(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Ke(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = po.exec(t)) ? new mt(e[1], e[2], e[3], 1) : (e = go.exec(t)) ? new mt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = yo.exec(t)) ? Ke(e[1], e[2], e[3], e[4]) : (e = mo.exec(t)) ? Ke(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = xo.exec(t)) ? Rr(e[1], e[2] / 100, e[3] / 100, 1) : (e = vo.exec(t)) ? Rr(e[1], e[2] / 100, e[3] / 100, e[4]) : $r.hasOwnProperty(t) ? Sr($r[t]) : t === "transparent" ? new mt(NaN, NaN, NaN, 0) : null;
1298
+ return t = (t + "").trim().toLowerCase(), (e = ho.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Sr(e) : n === 3 ? new xt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Ke(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Ke(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = po.exec(t)) ? new xt(e[1], e[2], e[3], 1) : (e = go.exec(t)) ? new xt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = yo.exec(t)) ? Ke(e[1], e[2], e[3], e[4]) : (e = mo.exec(t)) ? Ke(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = xo.exec(t)) ? Rr(e[1], e[2] / 100, e[3] / 100, 1) : (e = vo.exec(t)) ? Rr(e[1], e[2] / 100, e[3] / 100, e[4]) : $r.hasOwnProperty(t) ? Sr($r[t]) : t === "transparent" ? new xt(NaN, NaN, NaN, 0) : null;
1299
1299
  }
1300
1300
  function Sr(t) {
1301
- return new mt(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
1301
+ return new xt(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
1302
1302
  }
1303
1303
  function Ke(t, e, n, r) {
1304
- return r <= 0 && (t = e = n = NaN), new mt(t, e, n, r);
1304
+ return r <= 0 && (t = e = n = NaN), new xt(t, e, n, r);
1305
1305
  }
1306
1306
  function Ai(t) {
1307
- return t instanceof fe || (t = oe(t)), t ? (t = t.rgb(), new mt(t.r, t.g, t.b, t.opacity)) : new mt();
1307
+ return t instanceof fe || (t = oe(t)), t ? (t = t.rgb(), new xt(t.r, t.g, t.b, t.opacity)) : new xt();
1308
1308
  }
1309
1309
  function Xn(t, e, n, r) {
1310
- return arguments.length === 1 ? Ai(t) : new mt(t, e, n, r ?? 1);
1310
+ return arguments.length === 1 ? Ai(t) : new xt(t, e, n, r ?? 1);
1311
1311
  }
1312
- function mt(t, e, n, r) {
1312
+ function xt(t, e, n, r) {
1313
1313
  this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
1314
1314
  }
1315
- Fe(mt, Xn, An(fe, {
1315
+ Fe(xt, Xn, An(fe, {
1316
1316
  brighter(t) {
1317
- return t = t == null ? un : Math.pow(un, t), new mt(this.r * t, this.g * t, this.b * t, this.opacity);
1317
+ return t = t == null ? un : Math.pow(un, t), new xt(this.r * t, this.g * t, this.b * t, this.opacity);
1318
1318
  },
1319
1319
  darker(t) {
1320
- return t = t == null ? Ie : Math.pow(Ie, t), new mt(this.r * t, this.g * t, this.b * t, this.opacity);
1320
+ return t = t == null ? Ie : Math.pow(Ie, t), new xt(this.r * t, this.g * t, this.b * t, this.opacity);
1321
1321
  },
1322
1322
  rgb() {
1323
1323
  return this;
1324
1324
  },
1325
1325
  clamp() {
1326
- return new mt(se(this.r), se(this.g), se(this.b), fn(this.opacity));
1326
+ return new xt(se(this.r), se(this.g), se(this.b), fn(this.opacity));
1327
1327
  },
1328
1328
  displayable() {
1329
1329
  return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
@@ -1380,7 +1380,7 @@ Fe(Rt, ko, An(fe, {
1380
1380
  },
1381
1381
  rgb() {
1382
1382
  var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
1383
- return new mt(
1383
+ return new xt(
1384
1384
  Ln(t >= 240 ? t - 240 : t + 120, i, r),
1385
1385
  Ln(t, i, r),
1386
1386
  Ln(t < 120 ? t + 240 : t - 120, i, r),
@@ -1411,7 +1411,7 @@ const $o = Math.PI / 180, Ao = 180 / Math.PI, hn = 18, Si = 0.96422, Mi = 1, Ti
1411
1411
  function Ci(t) {
1412
1412
  if (t instanceof zt) return new zt(t.l, t.a, t.b, t.opacity);
1413
1413
  if (t instanceof Wt) return Li(t);
1414
- t instanceof mt || (t = Ai(t));
1414
+ t instanceof xt || (t = Ai(t));
1415
1415
  var e = In(t.r), n = In(t.g), r = In(t.b), i = Dn((0.2225045 * e + 0.7168786 * n + 0.0606169 * r) / Mi), a, s;
1416
1416
  return e === n && n === r ? a = s = i : (a = Dn((0.4360747 * e + 0.3850649 * n + 0.1430804 * r) / Si), s = Dn((0.0139322 * e + 0.0971045 * n + 0.7141733 * r) / Ti)), new zt(116 * i - 16, 500 * (a - i), 200 * (i - s), t.opacity);
1417
1417
  }
@@ -1430,7 +1430,7 @@ Fe(zt, So, An(fe, {
1430
1430
  },
1431
1431
  rgb() {
1432
1432
  var t = (this.l + 16) / 116, e = isNaN(this.a) ? t : t + this.a / 500, n = isNaN(this.b) ? t : t - this.b / 200;
1433
- return e = Si * jn(e), t = Mi * jn(t), n = Ti * jn(n), new mt(
1433
+ return e = Si * jn(e), t = Mi * jn(t), n = Ti * jn(n), new xt(
1434
1434
  Pn(3.1338561 * e - 1.6168667 * t - 0.4906146 * n),
1435
1435
  Pn(-0.9787684 * e + 1.9161415 * t + 0.033454 * n),
1436
1436
  Pn(0.0719453 * e - 0.2289914 * t + 1.4052427 * n),
@@ -1613,11 +1613,11 @@ function Ii(t, e, n, r) {
1613
1613
  function i(l) {
1614
1614
  return l.length ? l.pop() + " " : "";
1615
1615
  }
1616
- function a(l, u, h, f, p, v) {
1616
+ function a(l, u, h, f, y, _) {
1617
1617
  if (l !== h || u !== f) {
1618
- var j = p.push("translate(", null, e, null, n);
1619
- v.push({ i: j - 4, x: Nt(l, h) }, { i: j - 2, x: Nt(u, f) });
1620
- } else (h || f) && p.push("translate(" + h + e + f + n);
1618
+ var D = y.push("translate(", null, e, null, n);
1619
+ _.push({ i: D - 4, x: Nt(l, h) }, { i: D - 2, x: Nt(u, f) });
1620
+ } else (h || f) && y.push("translate(" + h + e + f + n);
1621
1621
  }
1622
1622
  function s(l, u, h, f) {
1623
1623
  l !== u ? (l - u > 180 ? u += 360 : u - l > 180 && (l += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Nt(l, u) })) : u && h.push(i(h) + "rotate(" + u + r);
@@ -1625,16 +1625,16 @@ function Ii(t, e, n, r) {
1625
1625
  function o(l, u, h, f) {
1626
1626
  l !== u ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Nt(l, u) }) : u && h.push(i(h) + "skewX(" + u + r);
1627
1627
  }
1628
- function c(l, u, h, f, p, v) {
1628
+ function c(l, u, h, f, y, _) {
1629
1629
  if (l !== h || u !== f) {
1630
- var j = p.push(i(p) + "scale(", null, ",", null, ")");
1631
- v.push({ i: j - 4, x: Nt(l, h) }, { i: j - 2, x: Nt(u, f) });
1632
- } else (h !== 1 || f !== 1) && p.push(i(p) + "scale(" + h + "," + f + ")");
1630
+ var D = y.push(i(y) + "scale(", null, ",", null, ")");
1631
+ _.push({ i: D - 4, x: Nt(l, h) }, { i: D - 2, x: Nt(u, f) });
1632
+ } else (h !== 1 || f !== 1) && y.push(i(y) + "scale(" + h + "," + f + ")");
1633
1633
  }
1634
1634
  return function(l, u) {
1635
1635
  var h = [], f = [];
1636
- return l = t(l), u = t(u), a(l.translateX, l.translateY, u.translateX, u.translateY, h, f), s(l.rotate, u.rotate, h, f), o(l.skewX, u.skewX, h, f), c(l.scaleX, l.scaleY, u.scaleX, u.scaleY, h, f), l = u = null, function(p) {
1637
- for (var v = -1, j = f.length, K; ++v < j; ) h[(K = f[v]).i] = K.x(p);
1636
+ return l = t(l), u = t(u), a(l.translateX, l.translateY, u.translateX, u.translateY, h, f), s(l.rotate, u.rotate, h, f), o(l.skewX, u.skewX, h, f), c(l.scaleX, l.scaleY, u.scaleX, u.scaleY, h, f), l = u = null, function(y) {
1637
+ for (var _ = -1, D = f.length, J; ++_ < D; ) h[(J = f[_]).i] = J.x(y);
1638
1638
  return h.join("");
1639
1639
  };
1640
1640
  };
@@ -1754,18 +1754,18 @@ function Zo(t, e, n) {
1754
1754
  n.state = jr, n.timer.restart(s, n.delay, n.time), n.delay <= l && s(l - n.delay);
1755
1755
  }
1756
1756
  function s(l) {
1757
- var u, h, f, p;
1757
+ var u, h, f, y;
1758
1758
  if (n.state !== jr) return c();
1759
1759
  for (u in r)
1760
- if (p = r[u], p.name === n.name) {
1761
- if (p.state === an) return Dr(s);
1762
- p.state === Pr ? (p.state = sn, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[u]) : +u < e && (p.state = sn, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[u]);
1760
+ if (y = r[u], y.name === n.name) {
1761
+ if (y.state === an) return Dr(s);
1762
+ y.state === Pr ? (y.state = sn, y.timer.stop(), y.on.call("interrupt", t, t.__data__, y.index, y.group), delete r[u]) : +u < e && (y.state = sn, y.timer.stop(), y.on.call("cancel", t, t.__data__, y.index, y.group), delete r[u]);
1763
1763
  }
1764
1764
  if (Dr(function() {
1765
1765
  n.state === an && (n.state = Pr, n.timer.restart(o, n.delay, n.time), o(l));
1766
1766
  }), n.state = Zn, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Zn) {
1767
1767
  for (n.state = an, i = new Array(f = n.tween.length), u = 0, h = -1; u < f; ++u)
1768
- (p = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p);
1768
+ (y = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = y);
1769
1769
  i.length = h + 1;
1770
1770
  }
1771
1771
  }
@@ -1989,8 +1989,8 @@ function Nl(t) {
1989
1989
  function Sl(t) {
1990
1990
  if (t._id !== this._id) throw new Error();
1991
1991
  for (var e = this._groups, n = t._groups, r = e.length, i = n.length, a = Math.min(r, i), s = new Array(r), o = 0; o < a; ++o)
1992
- for (var c = e[o], l = n[o], u = c.length, h = s[o] = new Array(u), f, p = 0; p < u; ++p)
1993
- (f = c[p] || l[p]) && (h[p] = f);
1992
+ for (var c = e[o], l = n[o], u = c.length, h = s[o] = new Array(u), f, y = 0; y < u; ++y)
1993
+ (f = c[y] || l[y]) && (h[y] = f);
1994
1994
  for (; o < r; ++o)
1995
1995
  s[o] = e[o];
1996
1996
  return new Bt(s, this._parents, this._name, this._id);
@@ -2036,8 +2036,8 @@ function Dl(t) {
2036
2036
  for (var r = this._groups, i = r.length, a = [], s = [], o = 0; o < i; ++o)
2037
2037
  for (var c = r[o], l = c.length, u, h = 0; h < l; ++h)
2038
2038
  if (u = c[h]) {
2039
- for (var f = t.call(u, u.__data__, h, c), p, v = Ct(u, n), j = 0, K = f.length; j < K; ++j)
2040
- (p = f[j]) && Mn(p, e, n, j, f, v);
2039
+ for (var f = t.call(u, u.__data__, h, c), y, _ = Ct(u, n), D = 0, J = f.length; D < J; ++D)
2040
+ (y = f[D]) && Mn(y, e, n, D, f, _);
2041
2041
  a.push(f), s.push(u);
2042
2042
  }
2043
2043
  return new Bt(a, s, e, n);
@@ -2277,8 +2277,8 @@ let oc = class {
2277
2277
  else if (f > re) if (!(Math.abs(h * c - l * u) > re) || !a)
2278
2278
  this._append`L${this._x1 = e},${this._y1 = n}`;
2279
2279
  else {
2280
- let p = r - s, v = i - o, j = c * c + l * l, K = p * p + v * v, T = Math.sqrt(j), q = Math.sqrt(f), $ = a * Math.tan((tr - Math.acos((j + f - K) / (2 * T * q))) / 2), A = $ / q, O = $ / T;
2281
- Math.abs(A - 1) > re && this._append`L${e + A * u},${n + A * h}`, this._append`A${a},${a},0,0,${+(h * p > u * v)},${this._x1 = e + O * c},${this._y1 = n + O * l}`;
2280
+ let y = r - s, _ = i - o, D = c * c + l * l, J = y * y + _ * _, j = Math.sqrt(D), z = Math.sqrt(f), M = a * Math.tan((tr - Math.acos((D + f - J) / (2 * j * z))) / 2), k = M / z, R = M / j;
2281
+ Math.abs(k - 1) > re && this._append`L${e + k * u},${n + k * h}`, this._append`A${a},${a},0,0,${+(h * y > u * _)},${this._x1 = e + R * c},${this._y1 = n + R * l}`;
2282
2282
  }
2283
2283
  }
2284
2284
  arc(e, n, r, i, a, s) {
@@ -2397,51 +2397,51 @@ function pc(t) {
2397
2397
  var e = t.grouping === void 0 || t.thousands === void 0 ? Hr : cc(Or.call(t.grouping, Number), t.thousands + ""), n = t.currency === void 0 ? "" : t.currency[0] + "", r = t.currency === void 0 ? "" : t.currency[1] + "", i = t.decimal === void 0 ? "." : t.decimal + "", a = t.numerals === void 0 ? Hr : uc(Or.call(t.numerals, String)), s = t.percent === void 0 ? "%" : t.percent + "", o = t.minus === void 0 ? "−" : t.minus + "", c = t.nan === void 0 ? "NaN" : t.nan + "";
2398
2398
  function l(h) {
2399
2399
  h = xn(h);
2400
- var f = h.fill, p = h.align, v = h.sign, j = h.symbol, K = h.zero, T = h.width, q = h.comma, $ = h.precision, A = h.trim, O = h.type;
2401
- O === "n" ? (q = !0, O = "g") : zr[O] || ($ === void 0 && ($ = 12), A = !0, O = "g"), (K || f === "0" && p === "=") && (K = !0, f = "0", p = "=");
2402
- var F = j === "$" ? n : j === "#" && /[boxX]/.test(O) ? "0" + O.toLowerCase() : "", J = j === "$" ? r : /[%p]/.test(O) ? s : "", G = zr[O], Y = /[defgprs%]/.test(O);
2403
- $ = $ === void 0 ? 6 : /[gprs]/.test(O) ? Math.max(1, Math.min(21, $)) : Math.max(0, Math.min(20, $));
2404
- function B(C) {
2405
- var L = F, w = J, E, d, R;
2406
- if (O === "c")
2407
- w = G(C) + w, C = "";
2400
+ var f = h.fill, y = h.align, _ = h.sign, D = h.symbol, J = h.zero, j = h.width, z = h.comma, M = h.precision, k = h.trim, R = h.type;
2401
+ R === "n" ? (z = !0, R = "g") : zr[R] || (M === void 0 && (M = 12), k = !0, R = "g"), (J || f === "0" && y === "=") && (J = !0, f = "0", y = "=");
2402
+ var W = D === "$" ? n : D === "#" && /[boxX]/.test(R) ? "0" + R.toLowerCase() : "", Y = D === "$" ? r : /[%p]/.test(R) ? s : "", K = zr[R], q = /[defgprs%]/.test(R);
2403
+ M = M === void 0 ? 6 : /[gprs]/.test(R) ? Math.max(1, Math.min(21, M)) : Math.max(0, Math.min(20, M));
2404
+ function et($) {
2405
+ var C = W, b = Y, P, g, A;
2406
+ if (R === "c")
2407
+ b = K($) + b, $ = "";
2408
2408
  else {
2409
- C = +C;
2410
- var M = C < 0 || 1 / C < 0;
2411
- if (C = isNaN(C) ? c : G(Math.abs(C), $), A && (C = hc(C)), M && +C == 0 && v !== "+" && (M = !1), L = (M ? v === "(" ? v : o : v === "-" || v === "(" ? "" : v) + L, w = (O === "s" ? qr[8 + Bi / 3] : "") + w + (M && v === "(" ? ")" : ""), Y) {
2412
- for (E = -1, d = C.length; ++E < d; )
2413
- if (R = C.charCodeAt(E), 48 > R || R > 57) {
2414
- w = (R === 46 ? i + C.slice(E + 1) : C.slice(E)) + w, C = C.slice(0, E);
2409
+ $ = +$;
2410
+ var S = $ < 0 || 1 / $ < 0;
2411
+ if ($ = isNaN($) ? c : K(Math.abs($), M), k && ($ = hc($)), S && +$ == 0 && _ !== "+" && (S = !1), C = (S ? _ === "(" ? _ : o : _ === "-" || _ === "(" ? "" : _) + C, b = (R === "s" ? qr[8 + Bi / 3] : "") + b + (S && _ === "(" ? ")" : ""), q) {
2412
+ for (P = -1, g = $.length; ++P < g; )
2413
+ if (A = $.charCodeAt(P), 48 > A || A > 57) {
2414
+ b = (A === 46 ? i + $.slice(P + 1) : $.slice(P)) + b, $ = $.slice(0, P);
2415
2415
  break;
2416
2416
  }
2417
2417
  }
2418
2418
  }
2419
- q && !K && (C = e(C, 1 / 0));
2420
- var N = L.length + C.length + w.length, x = N < T ? new Array(T - N + 1).join(f) : "";
2421
- switch (q && K && (C = e(x + C, x.length ? T - w.length : 1 / 0), x = ""), p) {
2419
+ z && !J && ($ = e($, 1 / 0));
2420
+ var N = C.length + $.length + b.length, x = N < j ? new Array(j - N + 1).join(f) : "";
2421
+ switch (z && J && ($ = e(x + $, x.length ? j - b.length : 1 / 0), x = ""), y) {
2422
2422
  case "<":
2423
- C = L + C + w + x;
2423
+ $ = C + $ + b + x;
2424
2424
  break;
2425
2425
  case "=":
2426
- C = L + x + C + w;
2426
+ $ = C + x + $ + b;
2427
2427
  break;
2428
2428
  case "^":
2429
- C = x.slice(0, N = x.length >> 1) + L + C + w + x.slice(N);
2429
+ $ = x.slice(0, N = x.length >> 1) + C + $ + b + x.slice(N);
2430
2430
  break;
2431
2431
  default:
2432
- C = x + L + C + w;
2432
+ $ = x + C + $ + b;
2433
2433
  break;
2434
2434
  }
2435
- return a(C);
2435
+ return a($);
2436
2436
  }
2437
- return B.toString = function() {
2437
+ return et.toString = function() {
2438
2438
  return h + "";
2439
- }, B;
2439
+ }, et;
2440
2440
  }
2441
2441
  function u(h, f) {
2442
- var p = l((h = xn(h), h.type = "f", h)), v = Math.max(-8, Math.min(8, Math.floor($e(f) / 3))) * 3, j = Math.pow(10, -v), K = qr[8 + v / 3];
2443
- return function(T) {
2444
- return p(j * T) + K;
2442
+ var y = l((h = xn(h), h.type = "f", h)), _ = Math.max(-8, Math.min(8, Math.floor($e(f) / 3))) * 3, D = Math.pow(10, -_), J = qr[8 + _ / 3];
2443
+ return function(j) {
2444
+ return y(D * j) + J;
2445
2445
  };
2446
2446
  }
2447
2447
  return {
@@ -2690,11 +2690,11 @@ function Le(t, e) {
2690
2690
  };
2691
2691
  }
2692
2692
  function Ui(t, e, n) {
2693
- var r = t.x, i = t.y, a = t.r, s = e.x, o = e.y, c = e.r, l = n.x, u = n.y, h = n.r, f = r - s, p = r - l, v = i - o, j = i - u, K = c - a, T = h - a, q = r * r + i * i - a * a, $ = q - s * s - o * o + c * c, A = q - l * l - u * u + h * h, O = p * v - f * j, F = (v * A - j * $) / (O * 2) - r, J = (j * K - v * T) / O, G = (p * $ - f * A) / (O * 2) - i, Y = (f * T - p * K) / O, B = J * J + Y * Y - 1, C = 2 * (a + F * J + G * Y), L = F * F + G * G - a * a, w = -(Math.abs(B) > 1e-6 ? (C + Math.sqrt(C * C - 4 * B * L)) / (2 * B) : L / C);
2693
+ var r = t.x, i = t.y, a = t.r, s = e.x, o = e.y, c = e.r, l = n.x, u = n.y, h = n.r, f = r - s, y = r - l, _ = i - o, D = i - u, J = c - a, j = h - a, z = r * r + i * i - a * a, M = z - s * s - o * o + c * c, k = z - l * l - u * u + h * h, R = y * _ - f * D, W = (_ * k - D * M) / (R * 2) - r, Y = (D * J - _ * j) / R, K = (y * M - f * k) / (R * 2) - i, q = (f * j - y * J) / R, et = Y * Y + q * q - 1, $ = 2 * (a + W * Y + K * q), C = W * W + K * K - a * a, b = -(Math.abs(et) > 1e-6 ? ($ + Math.sqrt($ * $ - 4 * et * C)) / (2 * et) : C / $);
2694
2694
  return {
2695
- x: r + F + J * w,
2696
- y: i + G + Y * w,
2697
- r: w
2695
+ x: r + W + Y * b,
2696
+ y: i + K + q * b,
2697
+ r: b
2698
2698
  };
2699
2699
  }
2700
2700
  function Wr(t, e, n) {
@@ -2823,12 +2823,12 @@ function Ae() {
2823
2823
  var t = Ji().unknown(void 0), e = t.domain, n = t.range, r = 0, i = 1, a, s, o = !1, c = 0, l = 0, u = 0.5;
2824
2824
  delete t.unknown;
2825
2825
  function h() {
2826
- var f = e().length, p = i < r, v = p ? i : r, j = p ? r : i;
2827
- a = (j - v) / Math.max(1, f - c + l * 2), o && (a = Math.floor(a)), v += (j - v - a * (f - c)) * u, s = a * (1 - c), o && (v = Math.round(v), s = Math.round(s));
2828
- var K = wa(f).map(function(T) {
2829
- return v + a * T;
2826
+ var f = e().length, y = i < r, _ = y ? i : r, D = y ? r : i;
2827
+ a = (D - _) / Math.max(1, f - c + l * 2), o && (a = Math.floor(a)), _ += (D - _ - a * (f - c)) * u, s = a * (1 - c), o && (_ = Math.round(_), s = Math.round(s));
2828
+ var J = wa(f).map(function(j) {
2829
+ return _ + a * j;
2830
2830
  });
2831
- return n(p ? K.reverse() : K);
2831
+ return n(y ? J.reverse() : J);
2832
2832
  }
2833
2833
  return t.domain = function(f) {
2834
2834
  return arguments.length ? (e(f), h()) : e();
@@ -2918,8 +2918,8 @@ function su() {
2918
2918
  return arguments.length ? (n = f, u()) : n;
2919
2919
  }, h.unknown = function(f) {
2920
2920
  return arguments.length ? (a = f, h) : a;
2921
- }, function(f, p) {
2922
- return r = f, i = p, u();
2921
+ }, function(f, y) {
2922
+ return r = f, i = y, u();
2923
2923
  };
2924
2924
  }
2925
2925
  function ou() {
@@ -2989,7 +2989,7 @@ function pt(t) {
2989
2989
  return t;
2990
2990
  };
2991
2991
  }
2992
- const Gr = Math.abs, yt = Math.atan2, ee = Math.cos, uu = Math.max, qn = Math.min, Dt = Math.sin, me = Math.sqrt, wt = 1e-12, Oe = Math.PI, _n = Oe / 2, on = 2 * Oe;
2992
+ const Gr = Math.abs, mt = Math.atan2, ee = Math.cos, uu = Math.max, qn = Math.min, Dt = Math.sin, me = Math.sqrt, wt = 1e-12, Oe = Math.PI, _n = Oe / 2, on = 2 * Oe;
2993
2993
  function fu(t) {
2994
2994
  return t > 1 ? 0 : t < -1 ? Oe : Math.acos(t);
2995
2995
  }
@@ -3031,40 +3031,40 @@ function xu(t, e, n, r, i, a, s, o) {
3031
3031
  return f = (u * (e - a) - h * (t - i)) / f, [t + f * c, e + f * l];
3032
3032
  }
3033
3033
  function tn(t, e, n, r, i, a, s) {
3034
- var o = t - n, c = e - r, l = (s ? a : -a) / me(o * o + c * c), u = l * c, h = -l * o, f = t + u, p = e + h, v = n + u, j = r + h, K = (f + v) / 2, T = (p + j) / 2, q = v - f, $ = j - p, A = q * q + $ * $, O = i - a, F = f * j - v * p, J = ($ < 0 ? -1 : 1) * me(uu(0, O * O * A - F * F)), G = (F * $ - q * J) / A, Y = (-F * q - $ * J) / A, B = (F * $ + q * J) / A, C = (-F * q + $ * J) / A, L = G - K, w = Y - T, E = B - K, d = C - T;
3035
- return L * L + w * w > E * E + d * d && (G = B, Y = C), {
3036
- cx: G,
3037
- cy: Y,
3034
+ var o = t - n, c = e - r, l = (s ? a : -a) / me(o * o + c * c), u = l * c, h = -l * o, f = t + u, y = e + h, _ = n + u, D = r + h, J = (f + _) / 2, j = (y + D) / 2, z = _ - f, M = D - y, k = z * z + M * M, R = i - a, W = f * D - _ * y, Y = (M < 0 ? -1 : 1) * me(uu(0, R * R * k - W * W)), K = (W * M - z * Y) / k, q = (-W * z - M * Y) / k, et = (W * M + z * Y) / k, $ = (-W * z + M * Y) / k, C = K - J, b = q - j, P = et - J, g = $ - j;
3035
+ return C * C + b * b > P * P + g * g && (K = et, q = $), {
3036
+ cx: K,
3037
+ cy: q,
3038
3038
  x01: -u,
3039
3039
  y01: -h,
3040
- x11: G * (i / O - 1),
3041
- y11: Y * (i / O - 1)
3040
+ x11: K * (i / R - 1),
3041
+ y11: q * (i / R - 1)
3042
3042
  };
3043
3043
  }
3044
3044
  function Qr() {
3045
3045
  var t = du, e = pu, n = pt(0), r = null, i = gu, a = yu, s = mu, o = null, c = hu(l);
3046
3046
  function l() {
3047
- var u, h, f = +t.apply(this, arguments), p = +e.apply(this, arguments), v = i.apply(this, arguments) - _n, j = a.apply(this, arguments) - _n, K = Gr(j - v), T = j > v;
3048
- if (o || (o = u = c()), p < f && (h = p, p = f, f = h), !(p > wt)) o.moveTo(0, 0);
3049
- else if (K > on - wt)
3050
- o.moveTo(p * ee(v), p * Dt(v)), o.arc(0, 0, p, v, j, !T), f > wt && (o.moveTo(f * ee(j), f * Dt(j)), o.arc(0, 0, f, j, v, T));
3047
+ var u, h, f = +t.apply(this, arguments), y = +e.apply(this, arguments), _ = i.apply(this, arguments) - _n, D = a.apply(this, arguments) - _n, J = Gr(D - _), j = D > _;
3048
+ if (o || (o = u = c()), y < f && (h = y, y = f, f = h), !(y > wt)) o.moveTo(0, 0);
3049
+ else if (J > on - wt)
3050
+ o.moveTo(y * ee(_), y * Dt(_)), o.arc(0, 0, y, _, D, !j), f > wt && (o.moveTo(f * ee(D), f * Dt(D)), o.arc(0, 0, f, D, _, j));
3051
3051
  else {
3052
- var q = v, $ = j, A = v, O = j, F = K, J = K, G = s.apply(this, arguments) / 2, Y = G > wt && (r ? +r.apply(this, arguments) : me(f * f + p * p)), B = qn(Gr(p - f) / 2, +n.apply(this, arguments)), C = B, L = B, w, E;
3053
- if (Y > wt) {
3054
- var d = Zr(Y / f * Dt(G)), R = Zr(Y / p * Dt(G));
3055
- (F -= d * 2) > wt ? (d *= T ? 1 : -1, A += d, O -= d) : (F = 0, A = O = (v + j) / 2), (J -= R * 2) > wt ? (R *= T ? 1 : -1, q += R, $ -= R) : (J = 0, q = $ = (v + j) / 2);
3052
+ var z = _, M = D, k = _, R = D, W = J, Y = J, K = s.apply(this, arguments) / 2, q = K > wt && (r ? +r.apply(this, arguments) : me(f * f + y * y)), et = qn(Gr(y - f) / 2, +n.apply(this, arguments)), $ = et, C = et, b, P;
3053
+ if (q > wt) {
3054
+ var g = Zr(q / f * Dt(K)), A = Zr(q / y * Dt(K));
3055
+ (W -= g * 2) > wt ? (g *= j ? 1 : -1, k += g, R -= g) : (W = 0, k = R = (_ + D) / 2), (Y -= A * 2) > wt ? (A *= j ? 1 : -1, z += A, M -= A) : (Y = 0, z = M = (_ + D) / 2);
3056
3056
  }
3057
- var M = p * ee(q), N = p * Dt(q), x = f * ee(O), S = f * Dt(O);
3058
- if (B > wt) {
3059
- var m = p * ee($), D = p * Dt($), P = f * ee(A), W = f * Dt(A), Z;
3060
- if (K < Oe)
3061
- if (Z = xu(M, N, P, W, m, D, x, S)) {
3062
- var Q = M - Z[0], z = N - Z[1], y = m - Z[0], g = D - Z[1], _ = 1 / Dt(fu((Q * y + z * g) / (me(Q * Q + z * z) * me(y * y + g * g))) / 2), b = me(Z[0] * Z[0] + Z[1] * Z[1]);
3063
- C = qn(B, (f - b) / (_ - 1)), L = qn(B, (p - b) / (_ + 1));
3057
+ var S = y * ee(z), N = y * Dt(z), x = f * ee(R), T = f * Dt(R);
3058
+ if (et > wt) {
3059
+ var m = y * ee(M), E = y * Dt(M), L = f * ee(k), B = f * Dt(k), tt;
3060
+ if (J < Oe)
3061
+ if (tt = xu(S, N, L, B, m, E, x, T)) {
3062
+ var G = S - tt[0], O = N - tt[1], X = m - tt[0], d = E - tt[1], p = 1 / Dt(fu((G * X + O * d) / (me(G * G + O * O) * me(X * X + d * d))) / 2), v = me(tt[0] * tt[0] + tt[1] * tt[1]);
3063
+ $ = qn(et, (f - v) / (p - 1)), C = qn(et, (y - v) / (p + 1));
3064
3064
  } else
3065
- C = L = 0;
3065
+ $ = C = 0;
3066
3066
  }
3067
- J > wt ? L > wt ? (w = tn(P, W, M, N, p, L, T), E = tn(m, D, x, S, p, L, T), o.moveTo(w.cx + w.x01, w.cy + w.y01), L < B ? o.arc(w.cx, w.cy, L, yt(w.y01, w.x01), yt(E.y01, E.x01), !T) : (o.arc(w.cx, w.cy, L, yt(w.y01, w.x01), yt(w.y11, w.x11), !T), o.arc(0, 0, p, yt(w.cy + w.y11, w.cx + w.x11), yt(E.cy + E.y11, E.cx + E.x11), !T), o.arc(E.cx, E.cy, L, yt(E.y11, E.x11), yt(E.y01, E.x01), !T))) : (o.moveTo(M, N), o.arc(0, 0, p, q, $, !T)) : o.moveTo(M, N), !(f > wt) || !(F > wt) ? o.lineTo(x, S) : C > wt ? (w = tn(x, S, m, D, f, -C, T), E = tn(M, N, P, W, f, -C, T), o.lineTo(w.cx + w.x01, w.cy + w.y01), C < B ? o.arc(w.cx, w.cy, C, yt(w.y01, w.x01), yt(E.y01, E.x01), !T) : (o.arc(w.cx, w.cy, C, yt(w.y01, w.x01), yt(w.y11, w.x11), !T), o.arc(0, 0, f, yt(w.cy + w.y11, w.cx + w.x11), yt(E.cy + E.y11, E.cx + E.x11), T), o.arc(E.cx, E.cy, C, yt(E.y11, E.x11), yt(E.y01, E.x01), !T))) : o.arc(0, 0, f, O, A, T);
3067
+ Y > wt ? C > wt ? (b = tn(L, B, S, N, y, C, j), P = tn(m, E, x, T, y, C, j), o.moveTo(b.cx + b.x01, b.cy + b.y01), C < et ? o.arc(b.cx, b.cy, C, mt(b.y01, b.x01), mt(P.y01, P.x01), !j) : (o.arc(b.cx, b.cy, C, mt(b.y01, b.x01), mt(b.y11, b.x11), !j), o.arc(0, 0, y, mt(b.cy + b.y11, b.cx + b.x11), mt(P.cy + P.y11, P.cx + P.x11), !j), o.arc(P.cx, P.cy, C, mt(P.y11, P.x11), mt(P.y01, P.x01), !j))) : (o.moveTo(S, N), o.arc(0, 0, y, z, M, !j)) : o.moveTo(S, N), !(f > wt) || !(W > wt) ? o.lineTo(x, T) : $ > wt ? (b = tn(x, T, m, E, f, -$, j), P = tn(S, N, L, B, f, -$, j), o.lineTo(b.cx + b.x01, b.cy + b.y01), $ < et ? o.arc(b.cx, b.cy, $, mt(b.y01, b.x01), mt(P.y01, P.x01), !j) : (o.arc(b.cx, b.cy, $, mt(b.y01, b.x01), mt(b.y11, b.x11), !j), o.arc(0, 0, f, mt(b.cy + b.y11, b.cx + b.x11), mt(P.cy + P.y11, P.cx + P.x11), j), o.arc(P.cx, P.cy, $, mt(P.y11, P.x11), mt(P.y01, P.x01), !j))) : o.arc(0, 0, f, R, k, j);
3068
3068
  }
3069
3069
  if (o.closePath(), u) return o = null, u + "" || null;
3070
3070
  }
@@ -3101,23 +3101,23 @@ function _u(t) {
3101
3101
  function bu() {
3102
3102
  var t = _u, e = vu, n = null, r = pt(0), i = pt(on), a = pt(0);
3103
3103
  function s(o) {
3104
- var c, l = (o = na(o)).length, u, h, f = 0, p = new Array(l), v = new Array(l), j = +r.apply(this, arguments), K = Math.min(on, Math.max(-on, i.apply(this, arguments) - j)), T, q = Math.min(Math.abs(K) / l, a.apply(this, arguments)), $ = q * (K < 0 ? -1 : 1), A;
3104
+ var c, l = (o = na(o)).length, u, h, f = 0, y = new Array(l), _ = new Array(l), D = +r.apply(this, arguments), J = Math.min(on, Math.max(-on, i.apply(this, arguments) - D)), j, z = Math.min(Math.abs(J) / l, a.apply(this, arguments)), M = z * (J < 0 ? -1 : 1), k;
3105
3105
  for (c = 0; c < l; ++c)
3106
- (A = v[p[c] = c] = +t(o[c], c, o)) > 0 && (f += A);
3107
- for (e != null ? p.sort(function(O, F) {
3108
- return e(v[O], v[F]);
3109
- }) : n != null && p.sort(function(O, F) {
3110
- return n(o[O], o[F]);
3111
- }), c = 0, h = f ? (K - l * $) / f : 0; c < l; ++c, j = T)
3112
- u = p[c], A = v[u], T = j + (A > 0 ? A * h : 0) + $, v[u] = {
3106
+ (k = _[y[c] = c] = +t(o[c], c, o)) > 0 && (f += k);
3107
+ for (e != null ? y.sort(function(R, W) {
3108
+ return e(_[R], _[W]);
3109
+ }) : n != null && y.sort(function(R, W) {
3110
+ return n(o[R], o[W]);
3111
+ }), c = 0, h = f ? (J - l * M) / f : 0; c < l; ++c, D = j)
3112
+ u = y[c], k = _[u], j = D + (k > 0 ? k * h : 0) + M, _[u] = {
3113
3113
  data: o[u],
3114
3114
  index: c,
3115
- value: A,
3116
- startAngle: j,
3117
- endAngle: T,
3118
- padAngle: q
3115
+ value: k,
3116
+ startAngle: D,
3117
+ endAngle: j,
3118
+ padAngle: z
3119
3119
  };
3120
- return v;
3120
+ return _;
3121
3121
  }
3122
3122
  return s.value = function(o) {
3123
3123
  return arguments.length ? (t = typeof o == "function" ? o : pt(+o), s) : t;
@@ -3222,13 +3222,13 @@ De.prototype = {
3222
3222
  De.prototype;
3223
3223
  const Et = (t, e) => {
3224
3224
  const n = Pt(null);
3225
- return vt(() => {
3225
+ return _t(() => {
3226
3226
  e !== void 0 && n.current && t(dt(n.current));
3227
3227
  }, e === null ? void 0 : e), n;
3228
3228
  };
3229
3229
  function de() {
3230
- const t = Pt(null), [e, n] = ft({ width: 0, height: 0 });
3231
- return vt(() => {
3230
+ const t = Pt(null), [e, n] = ut({ width: 0, height: 0 });
3231
+ return _t(() => {
3232
3232
  const r = t.current;
3233
3233
  if (!r || !r.parentElement) return;
3234
3234
  const i = r.parentElement, a = () => {
@@ -3241,8 +3241,8 @@ function de() {
3241
3241
  }, []), [t, e];
3242
3242
  }
3243
3243
  function Tn() {
3244
- const [t, e] = ft(null);
3245
- return vt(() => {
3244
+ const [t, e] = ut(null);
3245
+ return _t(() => {
3246
3246
  const n = typeof document < "u" ? document.getElementById("UI-controls") : null;
3247
3247
  e(n);
3248
3248
  }, []), t;
@@ -3318,7 +3318,7 @@ const ti = [
3318
3318
  ...ta,
3319
3319
  ...ea,
3320
3320
  ...Gi
3321
- ], xt = (t, e = !0) => {
3321
+ ], vt = (t, e = !0) => {
3322
3322
  const n = e ? [...xe, ...ti] : [...ti, ...xe];
3323
3323
  return t < n.length ? n[t] : n[t % n.length];
3324
3324
  }, ve = (t) => t < xe.length ? xe[t] : xe[t % xe.length], St = (t, {
@@ -3359,8 +3359,8 @@ function Rn(t, e) {
3359
3359
  if (u < 0)
3360
3360
  h = 0;
3361
3361
  else if (u + o > l) {
3362
- const p = u + o - l;
3363
- h = u - p;
3362
+ const y = u + o - l;
3363
+ h = u - y;
3364
3364
  } else
3365
3365
  h = u;
3366
3366
  const f = s === "top" ? kt["tooltip--arrow-down"] : kt["tooltip--arrow-up"];
@@ -3395,7 +3395,7 @@ const Vt = "#d1d5db", Mu = "_disabled_6kkmf_99", nt = {
3395
3395
  "value-axis": "_value-axis_1tba7_21"
3396
3396
  }, Ne = (t) => {
3397
3397
  const e = Pt([]);
3398
- return vt(() => {
3398
+ return _t(() => {
3399
3399
  const n = e.current;
3400
3400
  if (t.length === 0) {
3401
3401
  e.current = [];
@@ -3427,11 +3427,11 @@ function $f({
3427
3427
  formatType: s = "long"
3428
3428
  } = { prefix: "", suffix: "", formatType: "long" }
3429
3429
  }) {
3430
- const [o, c] = de(), { width: l, height: u } = c, [h, f] = ft(!1), p = Ne(t.map((A) => A.label)), v = Tn(), j = l > 576, K = /* @__PURE__ */ H.jsx(
3430
+ const [o, c] = de(), { width: l, height: u } = c, [h, f] = ut(!1), y = Ne(t.map((k) => k.label)), _ = Tn(), D = l > 576, J = /* @__PURE__ */ H.jsx(
3431
3431
  "div",
3432
3432
  {
3433
3433
  id: "controls",
3434
- className: `${nt[j ? "controls-container" : "controls-container-sm"]} ${v ? nt["fill-container"] : ""}`,
3434
+ className: `${nt[D ? "controls-container" : "controls-container-sm"]} ${_ ? nt["fill-container"] : ""}`,
3435
3435
  children: /* @__PURE__ */ H.jsxs("label", { className: nt["controls-label"], children: [
3436
3436
  /* @__PURE__ */ H.jsx(
3437
3437
  "input",
@@ -3439,81 +3439,81 @@ function $f({
3439
3439
  type: "checkbox",
3440
3440
  className: nt["controls-checkbox"],
3441
3441
  checked: h,
3442
- onChange: (A) => f(A.target.checked)
3442
+ onChange: (k) => f(k.target.checked)
3443
3443
  }
3444
3444
  ),
3445
3445
  "Sort"
3446
3446
  ] })
3447
3447
  }
3448
- ), T = { idx: e, type: n }, q = 750, $ = Et((A) => {
3448
+ ), j = { idx: e, type: n }, z = 750, M = Et((k) => {
3449
3449
  if (l === 0 || u === 0) return;
3450
- const O = {
3450
+ const R = {
3451
3451
  top: 20,
3452
3452
  right: 30,
3453
3453
  bottom: r === "vertical" ? 50 : 30,
3454
3454
  left: r === "vertical" ? 25 : 50
3455
- }, F = h ? Mt(t).sort((x, S) => S.value - x.value) : Mt(t), J = A.select("svg"), G = J.node(), Y = J.select(".plot-area").attr("transform", "translate(" + O.left + "," + O.top + ")"), B = Ye(A).style("opacity", 0), C = j ? en.axisText : en.rotatedAxisText, L = l - O.left - O.right, w = u - O.top - O.bottom, E = Ae().domain(F.map((x) => x.label)).rangeRound(r === "vertical" ? [0, L] : [w, 0]).paddingInner(j ? 0.4 : 0.25).paddingOuter(0.1), d = ce().domain([0, Yt(F, (x) => x.value) ?? 0]).rangeRound(r === "vertical" ? [w, 0] : [0, L]), R = r === "vertical" ? Zt(E).tickValues(E.domain()).scale(E).tickSizeOuter(0) : Zt(d).ticks(5, "s").tickSizeOuter(0).tickSize(-w);
3456
- Y.select(".x-axis").attr("transform", `translate(0, ${w})`).transition().duration(q).call(R).selectAll("text").attr("class", C);
3457
- const M = r === "vertical" ? Qt(d).ticks(5, "s").tickSize(-L) : Qt(E).tickSizeOuter(0);
3458
- Y.select(".y-axis").attr("transform", "translate(0, 0)").transition().duration(q).call(M);
3455
+ }, W = h ? Mt(t).sort((x, T) => T.value - x.value) : Mt(t), Y = k.select("svg"), K = Y.node(), q = Y.select(".plot-area").attr("transform", "translate(" + R.left + "," + R.top + ")"), et = Ye(k).style("opacity", 0), $ = D ? en.axisText : en.rotatedAxisText, C = l - R.left - R.right, b = u - R.top - R.bottom, P = Ae().domain(W.map((x) => x.label)).rangeRound(r === "vertical" ? [0, C] : [b, 0]).paddingInner(D ? 0.4 : 0.25).paddingOuter(0.1), g = ce().domain([0, Yt(W, (x) => x.value) ?? 0]).rangeRound(r === "vertical" ? [b, 0] : [0, C]), A = r === "vertical" ? Zt(P).tickValues(P.domain()).scale(P).tickSizeOuter(0) : Zt(g).ticks(5, "s").tickSizeOuter(0).tickSize(-b);
3456
+ q.select(".x-axis").attr("transform", `translate(0, ${b})`).transition().duration(z).call(A).selectAll("text").attr("class", $);
3457
+ const S = r === "vertical" ? Qt(g).ticks(5, "s").tickSize(-C) : Qt(P).tickSizeOuter(0);
3458
+ q.select(".y-axis").attr("transform", "translate(0, 0)").transition().duration(z).call(S);
3459
3459
  const N = (x) => {
3460
- const { idx: S, type: m } = T, D = p.current.findIndex((P) => P === x.label);
3461
- return ve(m === "fixed" ? S : S + D);
3460
+ const { idx: T, type: m } = j, E = y.current.findIndex((L) => L === x.label);
3461
+ return ve(m === "fixed" ? T : T + E);
3462
3462
  };
3463
- Y.selectAll(".bar").data(F, (x) => x.label).join(
3464
- (x) => x.append("rect").attr("class", "bar").attr("x", function(S) {
3465
- return r === "vertical" ? E(S.label) ?? 0 : d(0);
3466
- }).attr("width", function(S) {
3467
- return r === "vertical" ? E.bandwidth() : 0;
3468
- }).attr("y", function(S) {
3469
- return r === "vertical" ? d(0) : E(S.label) ?? 0;
3463
+ q.selectAll(".bar").data(W, (x) => x.label).join(
3464
+ (x) => x.append("rect").attr("class", "bar").attr("x", function(T) {
3465
+ return r === "vertical" ? P(T.label) ?? 0 : g(0);
3466
+ }).attr("width", function(T) {
3467
+ return r === "vertical" ? P.bandwidth() : 0;
3468
+ }).attr("y", function(T) {
3469
+ return r === "vertical" ? g(0) : P(T.label) ?? 0;
3470
3470
  }).attr("height", function() {
3471
- return r === "vertical" ? 0 : E.bandwidth();
3472
- }).attr("fill", N).transition().duration(q).attr("y", function(S) {
3473
- return r === "vertical" ? d(S.value) : E(S.label) ?? 0;
3474
- }).attr("width", function(S) {
3475
- return r === "vertical" ? E.bandwidth() : d(S.value);
3476
- }).attr("height", function(S) {
3477
- return r === "vertical" ? d(0) - d(S.value) : E.bandwidth();
3471
+ return r === "vertical" ? 0 : P.bandwidth();
3472
+ }).attr("fill", N).transition().duration(z).attr("y", function(T) {
3473
+ return r === "vertical" ? g(T.value) : P(T.label) ?? 0;
3474
+ }).attr("width", function(T) {
3475
+ return r === "vertical" ? P.bandwidth() : g(T.value);
3476
+ }).attr("height", function(T) {
3477
+ return r === "vertical" ? g(0) - g(T.value) : P.bandwidth();
3478
3478
  }),
3479
3479
  void 0,
3480
- (x) => x.transition().duration(q).attr("fill", Vt).attr("height", 0).attr("y", u).style("opacity", 0).remove()
3480
+ (x) => x.transition().duration(z).attr("fill", Vt).attr("height", 0).attr("y", u).style("opacity", 0).remove()
3481
3481
  ).on(
3482
3482
  "mouseover",
3483
- (x, S) => {
3484
- Y.selectAll("rect.bar").filter((m) => m.label === S.label).style("stroke", "#71717a").style("stroke-width", 1), B.style("opacity", 1).select("p").text(S.label + ` :
3483
+ (x, T) => {
3484
+ q.selectAll("rect.bar").filter((m) => m.label === T.label).style("stroke", "#71717a").style("stroke-width", 1), et.style("opacity", 1).select("p").text(T.label + ` :
3485
3485
  ${i}
3486
- ${he(s === "long" ? "," : "~s")(S.value)}
3487
- ${a}`), dt(".x-axis").selectAll("text").filter((m) => m === S.label).style("font-weight", "bold");
3486
+ ${he(s === "long" ? "," : "~s")(T.value)}
3487
+ ${a}`), dt(".x-axis").selectAll("text").filter((m) => m === T.label).style("font-weight", "bold");
3488
3488
  }
3489
- ).on("mousemove", (x, S) => {
3490
- Rn(B, { e: x, svg: G, yScale: d });
3489
+ ).on("mousemove", (x, T) => {
3490
+ Rn(et, { e: x, svg: K, yScale: g });
3491
3491
  }).on(
3492
3492
  "mouseout",
3493
- (x, S) => {
3494
- Y.selectAll("rect.bar").filter((m) => m.label === S.label).style("stroke", "none").style("stroke-width", 0), B.style("opacity", 0), dt(".x-axis").selectAll("text").filter((m) => m === S.label).style("font-weight", "normal");
3493
+ (x, T) => {
3494
+ q.selectAll("rect.bar").filter((m) => m.label === T.label).style("stroke", "none").style("stroke-width", 0), et.style("opacity", 0), dt(".x-axis").selectAll("text").filter((m) => m === T.label).style("font-weight", "normal");
3495
3495
  }
3496
- ).transition().duration(q).attr("fill", N).attr("x", function(x) {
3497
- return r === "vertical" ? E(x.label) ?? 0 : d(0);
3496
+ ).transition().duration(z).attr("fill", N).attr("x", function(x) {
3497
+ return r === "vertical" ? P(x.label) ?? 0 : g(0);
3498
3498
  }).attr("width", function(x) {
3499
- return r === "vertical" ? E.bandwidth() : d(x.value);
3499
+ return r === "vertical" ? P.bandwidth() : g(x.value);
3500
3500
  }).attr("y", function(x) {
3501
- return r === "vertical" ? d(x.value) : E(x.label) ?? 0;
3501
+ return r === "vertical" ? g(x.value) : P(x.label) ?? 0;
3502
3502
  }).attr("height", function(x) {
3503
- return r === "vertical" ? d(0) - d(x.value) : E.bandwidth();
3503
+ return r === "vertical" ? g(0) - g(x.value) : P.bandwidth();
3504
3504
  });
3505
- }, [t, T, l, u, h, r, { prefix: i, suffix: a, formatType: s }]);
3505
+ }, [t, j, l, u, h, r, { prefix: i, suffix: a, formatType: s }]);
3506
3506
  return /* @__PURE__ */ H.jsxs(
3507
3507
  "div",
3508
3508
  {
3509
3509
  ref: o,
3510
3510
  style: { width: l, height: u, display: "flex", flexDirection: "column" },
3511
3511
  children: [
3512
- v && kn(K, v),
3512
+ _ && kn(J, _),
3513
3513
  /* @__PURE__ */ H.jsxs(
3514
3514
  "div",
3515
3515
  {
3516
- ref: $,
3516
+ ref: M,
3517
3517
  className: `${nt["fill-container"]}`,
3518
3518
  style: { display: "flex", flexDirection: "column", position: "relative" },
3519
3519
  children: [
@@ -3529,7 +3529,7 @@ function $f({
3529
3529
  ] })
3530
3530
  }
3531
3531
  ),
3532
- !v && /* @__PURE__ */ H.jsxs(
3532
+ !_ && /* @__PURE__ */ H.jsxs(
3533
3533
  "label",
3534
3534
  {
3535
3535
  className: nt["controls-label"],
@@ -3541,7 +3541,7 @@ function $f({
3541
3541
  type: "checkbox",
3542
3542
  className: nt["controls-checkbox"],
3543
3543
  checked: h,
3544
- onChange: (A) => f(A.target.checked)
3544
+ onChange: (k) => f(k.target.checked)
3545
3545
  }
3546
3546
  ),
3547
3547
  "Sort"
@@ -3557,8 +3557,8 @@ function $f({
3557
3557
  );
3558
3558
  }
3559
3559
  function ue() {
3560
- const t = Pt(null), [e, n] = ft({ width: 0, height: 0 });
3561
- return vt(() => {
3560
+ const t = Pt(null), [e, n] = ut({ width: 0, height: 0 });
3561
+ return _t(() => {
3562
3562
  const r = t.current;
3563
3563
  if (!r) return;
3564
3564
  const i = new ResizeObserver(([a]) => {
@@ -3592,108 +3592,108 @@ const Eu = "_legend_7ftsg_1", Cu = "_pieSlice_7ftsg_77", Lu = "_pieSliceNotHover
3592
3592
  pieLabelExit: qu
3593
3593
  };
3594
3594
  function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r = 0 }) {
3595
- const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { width: u, height: h } = l, f = Ne(t.map((J) => J.label)), [p, v] = ft([]), [j, K] = ft(!1), [T, q] = ft(""), $ = 750, A = Et((J) => {
3596
- const Y = (n && j ? Mt(t).sort((C, L) => C.value - L.value) : t).map((C) => C.label);
3597
- J.selectAll(".legend-item").data([...Y], (C) => C).join(
3598
- (C) => {
3599
- const L = C.append("div").attr("class", function(w) {
3600
- return `${jt[w === T ? "legend-active" : "legend"]} legend-item`;
3601
- }).style("left", "-10px").style("top", function(w, E) {
3602
- return `${E * 20 + 10}px`;
3595
+ const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { width: u, height: h } = l, f = Ne(t.map((Y) => Y.label)), [y, _] = ut([]), [D, J] = ut(!1), [j, z] = ut(""), M = 750, k = Et((Y) => {
3596
+ const q = (n && D ? Mt(t).sort(($, C) => $.value - C.value) : t).map(($) => $.label);
3597
+ Y.selectAll(".legend-item").data([...q], ($) => $).join(
3598
+ ($) => {
3599
+ const C = $.append("div").attr("class", function(b) {
3600
+ return `${jt[b === j ? "legend-active" : "legend"]} legend-item`;
3601
+ }).style("left", "-10px").style("top", function(b, P) {
3602
+ return `${P * 20 + 10}px`;
3603
3603
  }).style("opacity", 0);
3604
- return L.append("div").attr("class", `rect ${jt["legend-rect"]}`).style("background-color", (w) => ve(f.current.findIndex((E) => E === w) + r)), L.append("span").attr("class", jt["legend-label"]).style("color", (w) => "#333").text((w) => w), L.transition().duration($).style("left", "6px").style("opacity", 1), L;
3604
+ return C.append("div").attr("class", `rect ${jt["legend-rect"]}`).style("background-color", (b) => ve(f.current.findIndex((P) => P === b) + r)), C.append("span").attr("class", jt["legend-label"]).style("color", (b) => "#333").text((b) => b), C.transition().duration(M).style("left", "6px").style("opacity", 1), C;
3605
3605
  },
3606
- (C) => (C.attr("class", (L) => `
3607
- ${jt[L === T ? "legend-active" : "legend"]} legend-item`).transition().duration($).style("top", function(L, w) {
3608
- return `${w * 20 + 10}px`;
3609
- }).style("left", "6px").style("opacity", 1).select("div.rect").attr("class", `rect ${jt["legend-rect"]}`).style("background-color", (L) => ve(f.current.findIndex((w) => w === L) + r)), C.select("span").style("color", (L) => "#333").text((L) => L), C),
3610
- (C) => C.transition().duration($).style("opacity", 0).style("left", "30px").remove()
3611
- ).on("mouseover", (C, L) => {
3612
- q(L);
3606
+ ($) => ($.attr("class", (C) => `
3607
+ ${jt[C === j ? "legend-active" : "legend"]} legend-item`).transition().duration(M).style("top", function(C, b) {
3608
+ return `${b * 20 + 10}px`;
3609
+ }).style("left", "6px").style("opacity", 1).select("div.rect").attr("class", `rect ${jt["legend-rect"]}`).style("background-color", (C) => ve(f.current.findIndex((b) => b === C) + r)), $.select("span").style("color", (C) => "#333").text((C) => C), $),
3610
+ ($) => $.transition().duration(M).style("opacity", 0).style("left", "30px").remove()
3611
+ ).on("mouseover", ($, C) => {
3612
+ z(C);
3613
3613
  }).on("mouseout", () => {
3614
- q("");
3614
+ z("");
3615
3615
  });
3616
- }, [t, r, u, h, T, j, n]), O = Et((J) => {
3616
+ }, [t, r, u, h, j, D, n]), R = Et((Y) => {
3617
3617
  if (u === 0 || h === 0) return;
3618
- const G = { x: u / 2, y: h / 2 }, Y = { top: 10, right: 20, bottom: 10, left: 20 }, B = t, C = u - (Y.left + Y.right), L = h - (Y.top + Y.bottom), w = Math.min(C, L) / 2, E = B.reduce((b, U) => b + U.value, 0), d = J.select(".plot-area").attr("transform", "translate(" + G.x + "," + G.y + ")"), R = bu().value(function(b) {
3619
- return b.value;
3620
- }).sort(function(b, U) {
3621
- return j ? je(b.value, U.value) : 0;
3622
- }), M = Mt(B), N = R(M), x = Mt(M);
3623
- v(R(x));
3624
- let S = x.length > M.length;
3625
- const m = p.map((b) => b.data.label), D = N.map((b) => b.data.label);
3626
- m.every((b) => S ? !1 : D.includes(b) ? !0 : (S = !0, !1));
3627
- const P = p.length === 0, Z = Qr().innerRadius(e * w).outerRadius(w - 12), Q = Qr().innerRadius(e * w).outerRadius(w), z = (b, U) => {
3628
- const tt = Gt(
3629
- U === "exit" ? b.endAngle : b.startAngle,
3630
- U === "exit" ? b.startAngle : b.endAngle
3631
- ), ot = b.data.label === T;
3618
+ const K = { x: u / 2, y: h / 2 }, q = { top: 10, right: 20, bottom: 10, left: 20 }, et = t, $ = u - (q.left + q.right), C = h - (q.top + q.bottom), b = Math.min($, C) / 2, P = et.reduce((v, F) => v + F.value, 0), g = Y.select(".plot-area").attr("transform", "translate(" + K.x + "," + K.y + ")"), A = bu().value(function(v) {
3619
+ return v.value;
3620
+ }).sort(function(v, F) {
3621
+ return D ? je(v.value, F.value) : 0;
3622
+ }), S = Mt(et), N = A(S), x = Mt(S);
3623
+ _(A(x));
3624
+ let T = x.length > S.length;
3625
+ const m = y.map((v) => v.data.label), E = N.map((v) => v.data.label);
3626
+ m.every((v) => T ? !1 : E.includes(v) ? !0 : (T = !0, !1));
3627
+ const L = y.length === 0, tt = Qr().innerRadius(e * b).outerRadius(b - 12), G = Qr().innerRadius(e * b).outerRadius(b), O = (v, F) => {
3628
+ const Z = Gt(
3629
+ F === "exit" ? v.endAngle : v.startAngle,
3630
+ F === "exit" ? v.startAngle : v.endAngle
3631
+ ), st = v.data.label === j;
3632
3632
  return function(ct) {
3633
- return b.endAngle = tt(ct), ot ? Q(b) || "" : Z(b) || "";
3633
+ return v.endAngle = Z(ct), st ? G(v) || "" : tt(v) || "";
3634
3634
  };
3635
3635
  };
3636
- d.selectAll("path").data(N, function(b) {
3637
- return b.data.label;
3636
+ g.selectAll("path").data(N, function(v) {
3637
+ return v.data.label;
3638
3638
  }).join(
3639
- (b) => {
3640
- const U = b.append("path").attr("class", jt.pieSlice).attr("fill", function(tt) {
3641
- const ot = f.current.findIndex((ct) => ct === tt.data.label) + r;
3642
- return ve(ot);
3639
+ (v) => {
3640
+ const F = v.append("path").attr("class", jt.pieSlice).attr("fill", function(Z) {
3641
+ const st = f.current.findIndex((ct) => ct === Z.data.label) + r;
3642
+ return ve(st);
3643
3643
  });
3644
- return U.transition().duration($).delay(P ? 0 : $).attr("d", Z).attrTween("d", function(tt) {
3645
- if (!P)
3646
- return z(tt, "not exit");
3647
- const ot = Gt(0, tt.startAngle), ct = Gt(0, tt.endAngle), ht = tt.data.label === T;
3648
- return function(lt) {
3649
- return tt.startAngle = ot(lt), tt.endAngle = ct(lt), ht ? Q(tt) : Z(tt);
3644
+ return F.transition().duration(M).delay(L ? 0 : M).attr("d", tt).attrTween("d", function(Z) {
3645
+ if (!L)
3646
+ return O(Z, "not exit");
3647
+ const st = Gt(0, Z.startAngle), ct = Gt(0, Z.endAngle), ht = Z.data.label === j;
3648
+ return function(ft) {
3649
+ return Z.startAngle = st(ft), Z.endAngle = ct(ft), ht ? G(Z) : tt(Z);
3650
3650
  };
3651
- }), U;
3651
+ }), F;
3652
3652
  },
3653
- (b) => {
3654
- const U = b;
3655
- return b.transition().duration($).attr("fill", function(tt, ot) {
3656
- const ct = f.current.findIndex((ht) => ht === tt.data.label) + r;
3653
+ (v) => {
3654
+ const F = v;
3655
+ return v.transition().duration(M).attr("fill", function(Z, st) {
3656
+ const ct = f.current.findIndex((ht) => ht === Z.data.label) + r;
3657
3657
  return ve(ct);
3658
- }).attrTween("d", function(tt) {
3659
- const ot = p.find((Ot) => Ot.data.label === tt.data.label), ct = ot && ot.startAngle ? ot.startAngle : 0, ht = Gt(ct, tt.startAngle), lt = ot && ot.endAngle ? ot.endAngle : 0, ut = Gt(lt, tt.endAngle), _t = tt.data.label === T;
3658
+ }).attrTween("d", function(Z) {
3659
+ const st = y.find((Ot) => Ot.data.label === Z.data.label), ct = st && st.startAngle ? st.startAngle : 0, ht = Gt(ct, Z.startAngle), ft = st && st.endAngle ? st.endAngle : 0, lt = Gt(ft, Z.endAngle), gt = Z.data.label === j;
3660
3660
  return function(Ot) {
3661
- return tt.startAngle = ht(Ot), tt.endAngle = ut(Ot), _t ? Q(tt) || "" : Z(tt) || "";
3661
+ return Z.startAngle = ht(Ot), Z.endAngle = lt(Ot), gt ? G(Z) || "" : tt(Z) || "";
3662
3662
  };
3663
- }), U;
3663
+ }), F;
3664
3664
  },
3665
- (b) => b.attr("class", jt.pieSliceExit).transition().duration($).attr("fill", Vt).attrTween("d", function(U) {
3666
- return z(U, "exit");
3665
+ (v) => v.attr("class", jt.pieSliceExit).transition().duration(M).attr("fill", Vt).attrTween("d", function(F) {
3666
+ return O(F, "exit");
3667
3667
  }).remove()
3668
- ).on("mouseover", function(b, U) {
3669
- q(U.data.label);
3668
+ ).on("mouseover", function(v, F) {
3669
+ z(F.data.label);
3670
3670
  }).on("mouseout", () => {
3671
- q("");
3671
+ z("");
3672
3672
  });
3673
- const g = (b) => B.length === 1 ? "translate(0, 0)" : `translate(${Z.centroid(b)})`, _ = (b) => {
3674
- const U = b.value / E;
3675
- return he(".1%")(U);
3673
+ const d = (v) => et.length === 1 ? "translate(0, 0)" : `translate(${tt.centroid(v)})`, p = (v) => {
3674
+ const F = v.value / P;
3675
+ return he(".1%")(F);
3676
3676
  };
3677
- d.selectAll("text").data(N, function(b) {
3678
- return b.data.label;
3677
+ g.selectAll("text").data(N, function(v) {
3678
+ return v.data.label;
3679
3679
  }).join(
3680
- (b) => {
3681
- const U = b.append("text").text(_).attr("class", jt.pieLabelEnter);
3682
- return U.merge(U).transition().duration($).delay(
3683
- $
3680
+ (v) => {
3681
+ const F = v.append("text").text(p).attr("class", jt.pieLabelEnter);
3682
+ return F.merge(F).transition().duration(M).delay(
3683
+ M
3684
3684
  /* + exitDelay*/
3685
- ).attr("transform", g), U;
3685
+ ).attr("transform", d), F;
3686
3686
  },
3687
- (b) => {
3688
- const U = b.text(_);
3689
- return b.merge(U).attr("class", jt.pieLabelUpdate).transition().duration(T !== "" ? 250 : $).style("opacity", function(tt) {
3690
- const ot = T === tt.data.label;
3691
- return T === "" || ot ? 1 : 0;
3692
- }).attr("transform", g), U;
3687
+ (v) => {
3688
+ const F = v.text(p);
3689
+ return v.merge(F).attr("class", jt.pieLabelUpdate).transition().duration(j !== "" ? 250 : M).style("opacity", function(Z) {
3690
+ const st = j === Z.data.label;
3691
+ return j === "" || st ? 1 : 0;
3692
+ }).attr("transform", d), F;
3693
3693
  },
3694
- (b) => b.transition().duration($ / 2).attr("class", jt.pieLabelExit).remove()
3694
+ (v) => v.transition().duration(M / 2).attr("class", jt.pieLabelExit).remove()
3695
3695
  );
3696
- }, [t, r, e, u, h, j, T]), F = s > o;
3696
+ }, [t, r, e, u, h, D, j]), W = s > o;
3697
3697
  return /* @__PURE__ */ H.jsxs(
3698
3698
  "div",
3699
3699
  {
@@ -3703,7 +3703,7 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
3703
3703
  height: o,
3704
3704
  position: "relative",
3705
3705
  display: "flex",
3706
- flexDirection: F ? "row" : "column",
3706
+ flexDirection: W ? "row" : "column",
3707
3707
  overflow: "hidden"
3708
3708
  },
3709
3709
  children: [
@@ -3719,7 +3719,7 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
3719
3719
  children: /* @__PURE__ */ H.jsx(
3720
3720
  "svg",
3721
3721
  {
3722
- ref: O,
3722
+ ref: R,
3723
3723
  className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
3724
3724
  viewBox: `0 0 ${u} ${h}`,
3725
3725
  children: /* @__PURE__ */ H.jsx("g", { className: "plot-area" })
@@ -3731,19 +3731,19 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
3731
3731
  "div",
3732
3732
  {
3733
3733
  style: {
3734
- width: F ? s > 480 ? "180px" : "100px" : "100%",
3735
- height: F ? "100%" : o > 400 ? "180px" : "100px",
3734
+ width: W ? s > 480 ? "180px" : "100px" : "100%",
3735
+ height: W ? "100%" : o > 400 ? "180px" : "100px",
3736
3736
  flexShrink: 0,
3737
3737
  overflowY: "auto",
3738
3738
  background: "rgba(255, 255, 255)",
3739
- borderLeft: F ? "1px solid #ddd" : "none",
3740
- borderTop: F ? "none" : "1px solid #ddd",
3739
+ borderLeft: W ? "1px solid #ddd" : "none",
3740
+ borderTop: W ? "none" : "1px solid #ddd",
3741
3741
  padding: "0px"
3742
3742
  },
3743
3743
  children: /* @__PURE__ */ H.jsx(
3744
3744
  "div",
3745
3745
  {
3746
- ref: A,
3746
+ ref: k,
3747
3747
  className: "legends-content",
3748
3748
  style: {
3749
3749
  display: "flex",
@@ -3768,8 +3768,8 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
3768
3768
  {
3769
3769
  type: "checkbox",
3770
3770
  className: nt["controls-checkbox"],
3771
- checked: j,
3772
- onChange: (J) => K(J.target.checked)
3771
+ checked: D,
3772
+ onChange: (Y) => J(Y.target.checked)
3773
3773
  }
3774
3774
  ),
3775
3775
  "Sort"
@@ -3804,63 +3804,63 @@ const Fu = "_rect_aemvq_277", Vu = "_rectCard_aemvq_277", Wu = "_rectLegendNotHo
3804
3804
  "value-axis": "_value-axis_aemvq_421"
3805
3805
  };
3806
3806
  function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "vertical", tooltipFormat: i }) {
3807
- const [a, s] = de(), { width: o, height: c } = s, [l, u] = ue(), { height: h } = u, [f, p] = ue(), { width: v, height: j } = p, [K, T] = ft(null), [q, $] = ft(!1), [A, O] = ft(["all"]), [F, J] = ft(!1), [G, Y] = ft(""), [B, C] = ft(!1), L = Tn(), w = t;
3808
- vt(() => {
3809
- O(["all"]), $(!0);
3810
- }, [w]), vt(() => {
3811
- O(["all"]);
3807
+ const [a, s] = de(), { width: o, height: c } = s, [l, u] = ue(), { height: h } = u, [f, y] = ue(), { width: _, height: D } = y, [J, j] = ut(null), [z, M] = ut(!1), [k, R] = ut(["all"]), [W, Y] = ut(!1), [K, q] = ut(""), [et, $] = ut(!1), C = Tn(), b = t;
3808
+ _t(() => {
3809
+ R(["all"]), M(!0);
3810
+ }, [b]), _t(() => {
3811
+ R(["all"]);
3812
3812
  }, [e]);
3813
- const E = 750;
3814
- vt(() => {
3815
- let P;
3816
- return q && (P = setTimeout(() => {
3817
- $(!1);
3818
- }, E + 500)), () => {
3819
- clearTimeout(P);
3813
+ const P = 750;
3814
+ _t(() => {
3815
+ let L;
3816
+ return z && (L = setTimeout(() => {
3817
+ M(!1);
3818
+ }, P + 500)), () => {
3819
+ clearTimeout(L);
3820
3820
  };
3821
- }, [q]);
3822
- const d = [v, j, A, n, e], R = Mt(w), M = R.length === 0 ? [] : Object.keys(R[0]).filter((P) => P !== "label" && P !== "total"), N = Ne(M), x = v > 576, S = Et((P) => {
3823
- if (q)
3821
+ }, [z]);
3822
+ const g = [_, D, k, n, e], A = Mt(b), S = A.length === 0 ? [] : Object.keys(A[0]).filter((L) => L !== "label" && L !== "total"), N = Ne(S), x = _ > 576, T = Et((L) => {
3823
+ if (z)
3824
3824
  return;
3825
- const W = x ? 80 : 50, Z = function(z) {
3826
- const y = rt[x ? "legend-container" : "legend-container-sm"], g = rt[x ? "legend-container-active" : "legend-container-active-sm"], _ = rt[x ? "legend-container-inactive" : "legend-container-inactive-sm"];
3825
+ const B = x ? 80 : 50, tt = function(O) {
3826
+ const X = rt[x ? "legend-container" : "legend-container-sm"], d = rt[x ? "legend-container-active" : "legend-container-active-sm"], p = rt[x ? "legend-container-inactive" : "legend-container-inactive-sm"];
3827
3827
  return `
3828
- ${A.includes(z) ? e ? g : _ : y}
3828
+ ${k.includes(O) ? e ? d : p : X}
3829
3829
  legend-item
3830
3830
  `;
3831
3831
  };
3832
- P.selectAll(".legend-item").data([...M], (z) => z).join(
3833
- (z) => {
3834
- const y = z.append("div").attr("class", Z).style("left", (g, _) => `${_ * W}px`).style("top", "-53px").style("opacity", 0);
3835
- return y.append("div").attr("class", rt["legend-rect"]).style("background", (g) => {
3836
- if (!e && A.includes(g))
3832
+ L.selectAll(".legend-item").data([...S], (O) => O).join(
3833
+ (O) => {
3834
+ const X = O.append("div").attr("class", tt).style("left", (d, p) => `${p * B}px`).style("top", "-53px").style("opacity", 0);
3835
+ return X.append("div").attr("class", rt["legend-rect"]).style("background", (d) => {
3836
+ if (!e && k.includes(d))
3837
3837
  return Vt;
3838
- const _ = N.current.findIndex((b) => b === g) + n;
3839
- return xt(_);
3840
- }), y.append("span").attr("class", rt["legend-label"]).style("color", (g) => !e && A.includes(g) ? "#d1d5db" : "#333").text((g) => g), y.transition().duration(E).style("top", "0px").style("opacity", 1), y;
3838
+ const p = N.current.findIndex((v) => v === d) + n;
3839
+ return vt(p);
3840
+ }), X.append("span").attr("class", rt["legend-label"]).style("color", (d) => !e && k.includes(d) ? "#d1d5db" : "#333").text((d) => d), X.transition().duration(P).style("top", "0px").style("opacity", 1), X;
3841
3841
  },
3842
- (z) => (z.attr("class", Z).transition().duration(E).style("top", "0px").style("left", (y, g) => `${g * W}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (y) => {
3843
- if (!e && A.includes(y))
3842
+ (O) => (O.attr("class", tt).transition().duration(P).style("top", "0px").style("left", (X, d) => `${d * B}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (X) => {
3843
+ if (!e && k.includes(X))
3844
3844
  return Vt;
3845
- const g = N.current.findIndex((_) => _ === y) + n;
3846
- return xt(g);
3847
- }), z.select(`.${rt["legend-label"]}`).style("color", (y) => !e && A.includes(y) ? Vt : "#333").text((y) => y), z),
3848
- (z) => z.style("color", Vt).transition().duration(E).style("opacity", 0).style("top", "53px").remove()
3849
- ).on("mouseover", function(z, y) {
3850
- q || Y(y);
3851
- }).on("mouseout", function(z, y) {
3852
- q || (Y(""), F && J(!1));
3853
- }).on("click", (z, y) => {
3854
- O((g) => {
3855
- let _ = [];
3856
- return e ? g[0] === y ? _ = ["all"] : _ = [y] : g.includes(y) ? _ = g.filter((b) => b !== y) : _ = [...g, y], _;
3857
- }), J(!0);
3845
+ const d = N.current.findIndex((p) => p === X) + n;
3846
+ return vt(d);
3847
+ }), O.select(`.${rt["legend-label"]}`).style("color", (X) => !e && k.includes(X) ? Vt : "#333").text((X) => X), O),
3848
+ (O) => O.style("color", Vt).transition().duration(P).style("opacity", 0).style("top", "53px").remove()
3849
+ ).on("mouseover", function(O, X) {
3850
+ z || q(X);
3851
+ }).on("mouseout", function(O, X) {
3852
+ z || (q(""), W && Y(!1));
3853
+ }).on("click", (O, X) => {
3854
+ R((d) => {
3855
+ let p = [];
3856
+ return e ? d[0] === X ? p = ["all"] : p = [X] : d.includes(X) ? p = d.filter((v) => v !== X) : p = [...d, X], p;
3857
+ }), Y(!0);
3858
3858
  });
3859
- }, [...d, M, q]), m = /* @__PURE__ */ H.jsxs(
3859
+ }, [...g, S, z]), m = /* @__PURE__ */ H.jsxs(
3860
3860
  "div",
3861
3861
  {
3862
3862
  ref: l,
3863
- className: `${nt[x ? "controls-container" : "controls-container-sm"]} ${L ? nt["fill-container"] : ""}`,
3863
+ className: `${nt[x ? "controls-container" : "controls-container-sm"]} ${C ? nt["fill-container"] : ""}`,
3864
3864
  children: [
3865
3865
  /* @__PURE__ */ H.jsxs("label", { className: nt["controls-label"], style: { paddingRight: "12px" }, children: [
3866
3866
  /* @__PURE__ */ H.jsx(
@@ -3868,8 +3868,8 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
3868
3868
  {
3869
3869
  type: "checkbox",
3870
3870
  className: nt["controls-checkbox"],
3871
- checked: B,
3872
- onChange: (P) => C(P.target.checked)
3871
+ checked: et,
3872
+ onChange: (L) => $(L.target.checked)
3873
3873
  }
3874
3874
  ),
3875
3875
  "Sort"
@@ -3877,134 +3877,134 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
3877
3877
  /* @__PURE__ */ H.jsx(
3878
3878
  "div",
3879
3879
  {
3880
- ref: S,
3880
+ ref: T,
3881
3881
  id: "stacked-barchart-legends",
3882
3882
  className: `${rt["legends-container"]}`
3883
3883
  }
3884
3884
  )
3885
3885
  ]
3886
3886
  }
3887
- ), D = Et((P) => {
3888
- if (v === 0 || j === 0 || G !== "" && q) return;
3889
- const W = { top: 20, right: 20, bottom: 30, left: 40 }, Z = e ? M : M.filter((k) => !A.includes(k));
3890
- R.forEach((k, et) => {
3891
- const X = Z.reduce((gt, bt) => {
3892
- bt in k || (k[bt] = 0);
3893
- const Jt = k[bt];
3894
- return gt + (typeof Jt == "number" ? Jt : 0);
3887
+ ), E = Et((L) => {
3888
+ if (_ === 0 || D === 0 || K !== "" && z) return;
3889
+ const B = { top: 20, right: 20, bottom: 30, left: 40 }, tt = e ? S : S.filter((w) => !k.includes(w));
3890
+ A.forEach((w, Q) => {
3891
+ const U = tt.reduce((yt, bt) => {
3892
+ bt in w || (w[bt] = 0);
3893
+ const Jt = w[bt];
3894
+ return yt + (typeof Jt == "number" ? Jt : 0);
3895
3895
  }, 0);
3896
- k.total = X;
3896
+ w.total = U;
3897
3897
  });
3898
- const Q = R, z = B ? Mt(Q).sort(function(k, et) {
3899
- return e ? A[0] === "all" ? k.total - et.total : Number(k[A[0]]) - Number(et[A[0]]) : k.total - et.total;
3900
- }) : Q, y = v - W.left - W.right, g = j - W.top - W.bottom, _ = P.select("svg"), b = _.node(), U = _.select(".plot-area").attr("transform", "translate(" + W.left + "," + W.top + ")"), tt = Ye(P).style("opacity", 0);
3901
- let ot = !1;
3902
- K === null && (ot = !0, T(Mt(R)));
3903
- const ct = z.map(function(k) {
3904
- return k.label;
3905
- }), ht = Ae().domain(ct).rangeRound(r === "vertical" ? [0, y] : [g, 0]).paddingInner(x ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), lt = e ? A[0] === "all" ? Yt(R, (k) => k.total) : Yt(R, (k) => k[A[0]]) : Yt(R, (k) => k.total), ut = ce().domain([0, lt ?? 0]).range(r === "vertical" ? [g, 0] : [0, y]), _t = !x && r === "vertical" ? rt.rotatedAxisText : rt.axisText, Ot = [], Be = r === "vertical" ? Zt(ht).tickValues(ht.domain()).tickSizeOuter(0) : Zt(ut).ticks(4, "s").tickSizeOuter(0).tickSize(-g);
3906
- U.select(".x-axis").attr("transform", `translate(0,${g})`).transition().duration(E).call(Be).selectAll("text").style("cursor", "pointer").attr("dy", x ? "1em" : ".20em").attr("dx", x ? "0em" : "-.8em").attr("class", _t).selectAll(".tick").filter((k) => k === 0).select("line").remove();
3907
- const pe = r === "vertical" ? Qt(ut).ticks(4, "s").tickSize(-y) : Qt(ht).tickSizeOuter(0);
3908
- U.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(ot ? 0 : E).call(pe).selectAll(".tick").filter((k) => k === 0).select("line").remove();
3909
- const te = bn().keys(Z)(z).map((k) => {
3910
- const et = k.key, X = k.map((gt) => {
3911
- const bt = gt.data.label;
3898
+ const G = A, O = et ? Mt(G).sort(function(w, Q) {
3899
+ return e ? k[0] === "all" ? w.total - Q.total : Number(w[k[0]]) - Number(Q[k[0]]) : w.total - Q.total;
3900
+ }) : G, X = _ - B.left - B.right, d = D - B.top - B.bottom, p = L.select("svg"), v = p.node(), F = p.select(".plot-area").attr("transform", "translate(" + B.left + "," + B.top + ")"), Z = Ye(L).style("opacity", 0);
3901
+ let st = !1;
3902
+ J === null && (st = !0, j(Mt(A)));
3903
+ const ct = O.map(function(w) {
3904
+ return w.label;
3905
+ }), ht = Ae().domain(ct).rangeRound(r === "vertical" ? [0, X] : [d, 0]).paddingInner(x ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), ft = e ? k[0] === "all" ? Yt(A, (w) => w.total) : Yt(A, (w) => w[k[0]]) : Yt(A, (w) => w.total), lt = ce().domain([0, ft ?? 0]).range(r === "vertical" ? [d, 0] : [0, X]), gt = !x && r === "vertical" ? rt.rotatedAxisText : rt.axisText, Ot = [], Be = r === "vertical" ? Zt(ht).tickValues(ht.domain()).tickSizeOuter(0) : Zt(lt).ticks(4, "s").tickSizeOuter(0).tickSize(-d);
3906
+ F.select(".x-axis").attr("transform", `translate(0,${d})`).transition().duration(P).call(Be).selectAll("text").style("cursor", "pointer").attr("dy", x ? "1em" : ".20em").attr("dx", x ? "0em" : "-.8em").attr("class", gt).selectAll(".tick").filter((w) => w === 0).select("line").remove();
3907
+ const pe = r === "vertical" ? Qt(lt).ticks(4, "s").tickSize(-X) : Qt(ht).tickSizeOuter(0);
3908
+ F.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(st ? 0 : P).call(pe).selectAll(".tick").filter((w) => w === 0).select("line").remove();
3909
+ const te = bn().keys(tt)(O).map((w) => {
3910
+ const Q = w.key, U = w.map((yt) => {
3911
+ const bt = yt.data.label;
3912
3912
  return {
3913
- ...gt,
3914
- key: `${et} - ${bt}`,
3915
- barKey: et
3913
+ ...yt,
3914
+ key: `${Q} - ${bt}`,
3915
+ barKey: Q
3916
3916
  };
3917
3917
  });
3918
- return X.key = et, X;
3919
- }), Xt = U.selectAll(".serie").data(te, (k) => k.key).join(
3920
- (k) => k.append("g").attr("class", "serie").attr("fill", (X) => {
3921
- const gt = N.current.findIndex((Jt) => Jt === X.key) + n;
3922
- return xt(gt);
3923
- }).style("opacity", (X) => {
3924
- if (G !== "")
3918
+ return U.key = Q, U;
3919
+ }), Xt = F.selectAll(".serie").data(te, (w) => w.key).join(
3920
+ (w) => w.append("g").attr("class", "serie").attr("fill", (U) => {
3921
+ const yt = N.current.findIndex((Jt) => Jt === U.key) + n;
3922
+ return vt(yt);
3923
+ }).style("opacity", (U) => {
3924
+ if (K !== "")
3925
3925
  if (e) {
3926
- if (A[0] === "all")
3927
- return X.key === G || F ? 1 : 0.25;
3926
+ if (k[0] === "all")
3927
+ return U.key === K || W ? 1 : 0.25;
3928
3928
  } else
3929
- return F ? 1 : X.key === G ? 0.25 : 1;
3930
- return e ? A[0] === "all" || X.key === A[0] ? 1 : 0 : 1;
3931
- }).style("pointer-events", (X) => e ? A[0] === "all" || X.key === A[0] ? "auto" : "none" : "auto"),
3932
- (k) => k.transition().duration(E).attr("fill", (X) => {
3933
- const gt = N.current.findIndex((Jt) => Jt === X.key) + n;
3934
- return xt(gt);
3935
- }).style("opacity", (X) => {
3936
- if (G !== "")
3929
+ return W ? 1 : U.key === K ? 0.25 : 1;
3930
+ return e ? k[0] === "all" || U.key === k[0] ? 1 : 0 : 1;
3931
+ }).style("pointer-events", (U) => e ? k[0] === "all" || U.key === k[0] ? "auto" : "none" : "auto"),
3932
+ (w) => w.transition().duration(P).attr("fill", (U) => {
3933
+ const yt = N.current.findIndex((Jt) => Jt === U.key) + n;
3934
+ return vt(yt);
3935
+ }).style("opacity", (U) => {
3936
+ if (K !== "")
3937
3937
  if (e) {
3938
- if (A[0] === "all")
3939
- return X.key === G || F ? 1 : 0.25;
3938
+ if (k[0] === "all")
3939
+ return U.key === K || W ? 1 : 0.25;
3940
3940
  } else
3941
- return F ? 1 : X.key === G ? 0.25 : 1;
3942
- return e ? A[0] === "all" || X.key === A[0] ? 1 : 0 : 1;
3943
- }).style("pointer-events", (X) => e ? A[0] === "all" || X.key === A[0] ? "auto" : "none" : "auto"),
3944
- (k) => k.transition().duration(E).attr("fill", Vt).style("opacity", 0).selectAll("rect").attr("y", g).attr("height", 0).remove()
3945
- ), Kt = (k) => ht(k.data.label + "") ?? 0, Ut = ht.bandwidth(), qt = (k) => {
3946
- const et = r === "vertical" ? g : y;
3947
- return ot ? 0 : A[0] === "all" ? ut(r === "vertical" ? k[1] : k[0]) : (
3941
+ return W ? 1 : U.key === K ? 0.25 : 1;
3942
+ return e ? k[0] === "all" || U.key === k[0] ? 1 : 0 : 1;
3943
+ }).style("pointer-events", (U) => e ? k[0] === "all" || U.key === k[0] ? "auto" : "none" : "auto"),
3944
+ (w) => w.transition().duration(P).attr("fill", Vt).style("opacity", 0).selectAll("rect").attr("y", d).attr("height", 0).remove()
3945
+ ), Kt = (w) => ht(w.data.label + "") ?? 0, Ut = ht.bandwidth(), qt = (w) => {
3946
+ const Q = r === "vertical" ? d : X;
3947
+ return st ? 0 : k[0] === "all" ? lt(r === "vertical" ? w[1] : w[0]) : (
3948
3948
  /*d.key.startsWith(plotted)
3949
3949
  ?*/
3950
- e && r !== "vertical" ? ut(0) : et - (ut(k[0]) - ut(k[1]))
3950
+ e && r !== "vertical" ? lt(0) : Q - (lt(w[0]) - lt(w[1]))
3951
3951
  );
3952
- }, Lt = (k) => {
3953
- const et = r === "vertical" ? ut(k[0]) - ut(k[1]) : ut(k[1]) - ut(k[0]);
3954
- return isNaN(et) || et < 0 ? 0 : et;
3955
- }, Tt = (k) => r === "vertical" ? Kt(k) : qt(k), $t = (k) => r === "vertical" ? Ut : Lt(k), V = (k) => r === "vertical" ? qt(k) : Kt(k), it = (k) => r === "vertical" ? Lt(k) : Ut, st = (k) => {
3956
- if (k.barKey === G)
3952
+ }, Lt = (w) => {
3953
+ const Q = r === "vertical" ? lt(w[0]) - lt(w[1]) : lt(w[1]) - lt(w[0]);
3954
+ return isNaN(Q) || Q < 0 ? 0 : Q;
3955
+ }, Tt = (w) => r === "vertical" ? Kt(w) : qt(w), $t = (w) => r === "vertical" ? Ut : Lt(w), V = (w) => r === "vertical" ? qt(w) : Kt(w), it = (w) => r === "vertical" ? Lt(w) : Ut, ot = (w) => {
3956
+ if (w.barKey === K)
3957
3957
  return "none";
3958
- const et = $t(k), X = it(k);
3959
- return Z.indexOf(k.barKey) === Z.length - 1 || k.barKey === A[0] ? r === "vertical" ? `${et + X} ${et} ${X}` : `${et + X + et}` : r === "vertical" ? `${X} ${et}` : `${et} ${X}`;
3960
- }, I = (k) => {
3961
- const et = $t(k), X = Z.indexOf(k.barKey) === Z.length - 1 || k.barKey === A[0];
3962
- return r === "vertical" ? X ? 0 : et * -1 : 0;
3963
- }, at = (k) => G !== "" && G === k.barKey && e ? `rect ${rt.rectLegendHovered}` : `rect ${rt.rect}`;
3958
+ const Q = $t(w), U = it(w);
3959
+ return tt.indexOf(w.barKey) === tt.length - 1 || w.barKey === k[0] ? r === "vertical" ? `${Q + U} ${Q} ${U}` : `${Q + U + Q}` : r === "vertical" ? `${U} ${Q}` : `${Q} ${U}`;
3960
+ }, I = (w) => {
3961
+ const Q = $t(w), U = tt.indexOf(w.barKey) === tt.length - 1 || w.barKey === k[0];
3962
+ return r === "vertical" ? U ? 0 : Q * -1 : 0;
3963
+ }, at = (w) => K !== "" && K === w.barKey && e ? `rect ${rt.rectLegendHovered}` : `rect ${rt.rect}`;
3964
3964
  Xt.selectAll("rect").data(
3965
- (k) => k,
3965
+ (w) => w,
3966
3966
  // each group binds its stacked points
3967
- (k) => k.data.label
3967
+ (w) => w.data.label
3968
3968
  // unique key per bar
3969
3969
  ).join(
3970
- (k) => k.append("rect").attr("class", `rect ${nt.rect}`).attr("x", function(X) {
3971
- return r === "vertical" ? Tt(X) : ut(0);
3972
- }).attr("width", function(X) {
3973
- return r === "vertical" ? $t(X) : 0;
3974
- }).attr("y", (X) => {
3970
+ (w) => w.append("rect").attr("class", `rect ${nt.rect}`).attr("x", function(U) {
3971
+ return r === "vertical" ? Tt(U) : lt(0);
3972
+ }).attr("width", function(U) {
3973
+ return r === "vertical" ? $t(U) : 0;
3974
+ }).attr("y", (U) => {
3975
3975
  if (r === "vertical") {
3976
- if (!Ot.includes(X.data.label)) return g;
3977
- const gt = A[0] === "all" ? ut(X[1]) : X.key.startsWith(A[0]) ? g - (ut(X[0]) - ut(X[1])) : ut(X[1]), bt = ut(X[0]) - ut(X[1]), Jt = isNaN(bt) || bt < 0 ? 0 : bt, ia = gt + Jt;
3978
- return ot ? g - (W.bottom + W.top) : ia;
3976
+ if (!Ot.includes(U.data.label)) return d;
3977
+ const yt = k[0] === "all" ? lt(U[1]) : U.key.startsWith(k[0]) ? d - (lt(U[0]) - lt(U[1])) : lt(U[1]), bt = lt(U[0]) - lt(U[1]), Jt = isNaN(bt) || bt < 0 ? 0 : bt, ia = yt + Jt;
3978
+ return st ? d - (B.bottom + B.top) : ia;
3979
3979
  } else
3980
- return V(X);
3981
- }).attr("height", function(X) {
3982
- return r === "vertical" ? 0 : it(X);
3983
- }).attr("stroke-dasharray", st).attr("stroke-dashoffset", I).transition().duration(E).attr("x", Tt).attr("width", $t).attr("height", it).attr("y", V),
3980
+ return V(U);
3981
+ }).attr("height", function(U) {
3982
+ return r === "vertical" ? 0 : it(U);
3983
+ }).attr("stroke-dasharray", ot).attr("stroke-dashoffset", I).transition().duration(P).attr("x", Tt).attr("width", $t).attr("height", it).attr("y", V),
3984
3984
  void 0,
3985
3985
  // no custom update handler
3986
- (k) => k.transition().duration(E).attr("opacity", 0).attr("y", g).attr("height", 0).remove()
3987
- ).attr("class", at).attr("stroke-dasharray", st).attr("stroke-dashoffset", I).transition().duration(E).attr("x", Tt).attr("width", $t).attr("height", it).attr("y", V).on("start", function() {
3986
+ (w) => w.transition().duration(P).attr("opacity", 0).attr("y", d).attr("height", 0).remove()
3987
+ ).attr("class", at).attr("stroke-dasharray", ot).attr("stroke-dashoffset", I).transition().duration(P).attr("x", Tt).attr("width", $t).attr("height", it).attr("y", V).on("start", function() {
3988
3988
  }).on("end", function() {
3989
- }), Xt.selectAll("rect").on("mouseover", function(k, et) {
3990
- dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((bt) => bt === et.data.label).attr("class", (r === "vertical" ? _t : "") + " " + rt.hoveredAxisText), tt.style("opacity", 1).select("p.title").text(et.data.label);
3991
- const X = et.data[et.barKey], { total: gt } = et.data;
3992
- tt.select("p.top-label").text(et.barKey + " : " + St(X, i)), tt.select("p.bottom-label").text(A[0] === "all" ? `Total : ${St(gt, i)}` : "~");
3993
- }).on("touch", function(k, et) {
3994
- dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((X) => X === et.data.label);
3995
- }).on("mousemove", (k, et) => {
3996
- Rn(tt, { e: k, svg: b, yScale: ut });
3997
- }).on("mouseout", function(k, et) {
3998
- dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((X) => X === et.data.label).attr("class", r === "vertical" ? _t : ""), tt.style("opacity", 0);
3989
+ }), Xt.selectAll("rect").on("mouseover", function(w, Q) {
3990
+ dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((bt) => bt === Q.data.label).attr("class", (r === "vertical" ? gt : "") + " " + rt.hoveredAxisText), Z.style("opacity", 1).select("p.title").text(Q.data.label);
3991
+ const U = Q.data[Q.barKey], { total: yt } = Q.data;
3992
+ Z.select("p.top-label").text(Q.barKey + " : " + St(U, i)), Z.select("p.bottom-label").text(k[0] === "all" ? `Total : ${St(yt, i)}` : "~");
3993
+ }).on("touch", function(w, Q) {
3994
+ dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((U) => U === Q.data.label);
3995
+ }).on("mousemove", (w, Q) => {
3996
+ Rn(Z, { e: w, svg: v, yScale: lt });
3997
+ }).on("mouseout", function(w, Q) {
3998
+ dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((U) => U === Q.data.label).attr("class", r === "vertical" ? gt : ""), Z.style("opacity", 0);
3999
3999
  });
4000
- }, [...d, B, R, M, G, F, q, r, i]);
4000
+ }, [...g, et, A, S, K, W, z, r, i]);
4001
4001
  return /* @__PURE__ */ H.jsxs(
4002
4002
  "div",
4003
4003
  {
4004
4004
  ref: a,
4005
4005
  style: { width: `${o}px`, height: `${c}px`, display: "flex", flexDirection: "column" },
4006
4006
  children: [
4007
- L ? kn(m, L) : m,
4007
+ C ? kn(m, C) : m,
4008
4008
  /* @__PURE__ */ H.jsx(
4009
4009
  "div",
4010
4010
  {
@@ -4014,7 +4014,7 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
4014
4014
  children: /* @__PURE__ */ H.jsxs(
4015
4015
  "div",
4016
4016
  {
4017
- ref: D,
4017
+ ref: E,
4018
4018
  className: `${nt["fill-container"]}`,
4019
4019
  style: { display: "flex", flexDirection: "column" },
4020
4020
  children: [
@@ -4022,8 +4022,8 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
4022
4022
  "svg",
4023
4023
  {
4024
4024
  className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
4025
- viewBox: `0 0 ${v} ${j}`,
4026
- children: v > 0 && /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
4025
+ viewBox: `0 0 ${_} ${D}`,
4026
+ children: _ > 0 && /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
4027
4027
  /* @__PURE__ */ H.jsx("g", { className: "plot-rects" }),
4028
4028
  /* @__PURE__ */ H.jsx("g", { className: `${r === "vertical" ? rt["value-axis"] : ""} y-axis` }),
4029
4029
  /* @__PURE__ */ H.jsx("g", { className: `${r === "horizontal" ? rt["value-axis"] : ""} x-axis` })
@@ -4041,63 +4041,63 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
4041
4041
  );
4042
4042
  }
4043
4043
  function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipFormat: r }) {
4044
- const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width: p, height: v } = f, [j, K] = ft(null), [T, q] = ft(!1), [$, A] = ft("all"), [O, F] = ft(!1), [J, G] = ft(""), [Y, B] = ft(!1), C = Tn(), L = t;
4045
- vt(() => {
4046
- A("all"), q(!0), B(!1);
4047
- }, [L]);
4048
- const w = 750;
4049
- vt(() => {
4050
- let D;
4051
- return T && (D = setTimeout(() => {
4052
- q(!1);
4053
- }, w + 500)), () => {
4054
- clearTimeout(D);
4044
+ const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width: y, height: _ } = f, [D, J] = ut(null), [j, z] = ut(!1), [M, k] = ut("all"), [R, W] = ut(!1), [Y, K] = ut(""), [q, et] = ut(!1), $ = Tn(), C = t;
4045
+ _t(() => {
4046
+ k("all"), z(!0), et(!1);
4047
+ }, [C]);
4048
+ const b = 750;
4049
+ _t(() => {
4050
+ let E;
4051
+ return j && (E = setTimeout(() => {
4052
+ z(!1);
4053
+ }, b + 500)), () => {
4054
+ clearTimeout(E);
4055
4055
  };
4056
- }, [T]);
4057
- const E = [p, v, $, e], d = Mt(L), R = d.length === 0 ? [] : Object.keys(d[0]).filter((D) => D !== "label" && D !== "total"), M = Ne(R), N = p > 576, x = Et((D) => {
4058
- if (T) return;
4059
- const P = N ? 80 : 50, W = function(Q) {
4060
- const z = rt[N ? "legend-container" : "legend-container-sm"], y = rt[N ? "legend-container-active" : "legend-container-active-sm"], g = rt[N ? "legend-container-inactive" : "legend-container-inactive-sm"];
4056
+ }, [j]);
4057
+ const P = [y, _, M, e], g = Mt(C), A = g.length === 0 ? [] : Object.keys(g[0]).filter((E) => E !== "label" && E !== "total"), S = Ne(A), N = y > 576, x = Et((E) => {
4058
+ if (j) return;
4059
+ const L = N ? 80 : 50, B = function(G) {
4060
+ const O = rt[N ? "legend-container" : "legend-container-sm"], X = rt[N ? "legend-container-active" : "legend-container-active-sm"], d = rt[N ? "legend-container-inactive" : "legend-container-inactive-sm"];
4061
4061
  return `
4062
- ${$.includes(Q) ? $ === Q ? y : g : z}
4062
+ ${M.includes(G) ? M === G ? X : d : O}
4063
4063
  legend-item
4064
4064
  `;
4065
4065
  };
4066
- D.selectAll(".legend-item").data([...R], (Q) => Q).join(
4067
- (Q) => {
4068
- const z = Q.append("div").attr("class", W).style("left", (y, g) => `${g * P}px`).style("top", "-53px").style("opacity", 0);
4069
- return z.append("div").attr("class", rt["legend-rect"]).style("background", (y) => {
4070
- const g = M.current.findIndex((_) => _ === y) + e;
4071
- return xt(g);
4072
- }), z.append("span").attr("class", rt["legend-label"]).text((y) => y), z.transition().duration(w).style("top", "0px").style("opacity", 1), z;
4066
+ E.selectAll(".legend-item").data([...A], (G) => G).join(
4067
+ (G) => {
4068
+ const O = G.append("div").attr("class", B).style("left", (X, d) => `${d * L}px`).style("top", "-53px").style("opacity", 0);
4069
+ return O.append("div").attr("class", rt["legend-rect"]).style("background", (X) => {
4070
+ const d = S.current.findIndex((p) => p === X) + e;
4071
+ return vt(d);
4072
+ }), O.append("span").attr("class", rt["legend-label"]).text((X) => X), O.transition().duration(b).style("top", "0px").style("opacity", 1), O;
4073
4073
  },
4074
- (Q) => (Q.attr("class", W).transition().duration(w).style("top", "0px").style("left", (z, y) => `${y * P}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (z) => {
4075
- const y = M.current.findIndex((g) => g === z) + e;
4076
- return xt(y);
4077
- }), Q.select(`.${rt["legend-label"]}`).text((z) => z), Q),
4078
- (Q) => Q.transition().duration(w).style("opacity", 0).style("top", "53px").remove().remove()
4079
- ).on("click", (Q, z) => {
4080
- A((y) => y === z ? (B(!1), "all") : z);
4081
- }).on("mouseover", (Q, z) => {
4082
- G(z);
4083
- }).on("mouseout", (Q, z) => {
4084
- G("");
4074
+ (G) => (G.attr("class", B).transition().duration(b).style("top", "0px").style("left", (O, X) => `${X * L}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (O) => {
4075
+ const X = S.current.findIndex((d) => d === O) + e;
4076
+ return vt(X);
4077
+ }), G.select(`.${rt["legend-label"]}`).text((O) => O), G),
4078
+ (G) => G.transition().duration(b).style("opacity", 0).style("top", "53px").remove().remove()
4079
+ ).on("click", (G, O) => {
4080
+ k((X) => X === O ? (et(!1), "all") : O);
4081
+ }).on("mouseover", (G, O) => {
4082
+ K(O);
4083
+ }).on("mouseout", (G, O) => {
4084
+ K("");
4085
4085
  });
4086
- }, [...E, R, T]), S = /* @__PURE__ */ H.jsxs(
4086
+ }, [...P, A, j]), T = /* @__PURE__ */ H.jsxs(
4087
4087
  "div",
4088
4088
  {
4089
4089
  ref: c,
4090
- className: `${nt[N ? "controls-container" : "controls-container-sm"]} ${C ? nt["fill-container"] : ""}`,
4090
+ className: `${nt[N ? "controls-container" : "controls-container-sm"]} ${$ ? nt["fill-container"] : ""}`,
4091
4091
  children: [
4092
- /* @__PURE__ */ H.jsxs("label", { className: `${nt["controls-label"]} ${$ === "all" ? nt.disabled : ""}`, style: { paddingRight: "12px" }, children: [
4092
+ /* @__PURE__ */ H.jsxs("label", { className: `${nt["controls-label"]} ${M === "all" ? nt.disabled : ""}`, style: { paddingRight: "12px" }, children: [
4093
4093
  /* @__PURE__ */ H.jsx(
4094
4094
  "input",
4095
4095
  {
4096
4096
  type: "checkbox",
4097
4097
  className: `${nt["controls-checkbox"]}`,
4098
- checked: Y,
4099
- onChange: (D) => B(D.target.checked),
4100
- disabled: $ === "all"
4098
+ checked: q,
4099
+ onChange: (E) => et(E.target.checked),
4100
+ disabled: M === "all"
4101
4101
  }
4102
4102
  ),
4103
4103
  "Sort"
@@ -4112,65 +4112,65 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4112
4112
  )
4113
4113
  ]
4114
4114
  }
4115
- ), m = Et((D) => {
4116
- if (p === 0 || v === 0 || J !== "" && T) return;
4117
- const P = { top: 20, right: 30, bottom: 30, left: 40 };
4118
- d.forEach(function(V) {
4119
- V.total = R.reduce((it, st) => {
4120
- st in V || (V[st] = 0);
4121
- const I = V[st];
4115
+ ), m = Et((E) => {
4116
+ if (y === 0 || _ === 0 || Y !== "" && j) return;
4117
+ const L = { top: 20, right: 30, bottom: 30, left: 40 };
4118
+ g.forEach(function(V) {
4119
+ V.total = A.reduce((it, ot) => {
4120
+ ot in V || (V[ot] = 0);
4121
+ const I = V[ot];
4122
4122
  return it + (typeof I == "number" ? I : Number(I));
4123
4123
  }, 0);
4124
4124
  });
4125
- const W = d, Z = Y ? Mt(W).sort(function(V, it) {
4126
- return Number(V[$]) - Number(it[$]);
4127
- }) : W, Q = p - P.left - P.right, z = v - P.top - P.bottom, y = D.select("svg"), g = y.node(), _ = y.select(".plot-area").attr("transform", "translate(" + P.left + "," + P.top + ")"), b = Ye(D).style("opacity", 0);
4128
- j === null && K(Mt(d));
4129
- const U = $ === "all", tt = !N && n === "vertical" ? rt.rotatedAxisText : rt.axisText, ot = Z.map(function(V) {
4125
+ const B = g, tt = q ? Mt(B).sort(function(V, it) {
4126
+ return Number(V[M]) - Number(it[M]);
4127
+ }) : B, G = y - L.left - L.right, O = _ - L.top - L.bottom, X = E.select("svg"), d = X.node(), p = X.select(".plot-area").attr("transform", "translate(" + L.left + "," + L.top + ")"), v = Ye(E).style("opacity", 0);
4128
+ D === null && J(Mt(g));
4129
+ const F = M === "all", Z = !N && n === "vertical" ? rt.rotatedAxisText : rt.axisText, st = tt.map(function(V) {
4130
4130
  return V.label;
4131
- }), ct = Ae().domain(ot).rangeRound(n === "vertical" ? [0, Q] : [z, 0]).paddingInner(U ? 0.15 : N ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), ht = $ === "all" ? Yt(
4132
- d,
4131
+ }), ct = Ae().domain(st).rangeRound(n === "vertical" ? [0, G] : [O, 0]).paddingInner(F ? 0.15 : N ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), ht = M === "all" ? Yt(
4132
+ g,
4133
4133
  (V) => Yt(
4134
4134
  Object.entries(V).filter(([it]) => it !== "total" && it !== "label").map(([, it]) => it)
4135
4135
  // value is number | string | undefined
4136
4136
  )
4137
- ) : Yt(d, (V) => V[$]), lt = ce().domain([0, ht ?? 0]).range(n === "vertical" ? [z, 0] : [0, Q]), ut = n === "vertical" ? Zt(ct).tickValues(ct.domain()).tickSizeOuter(0) : Zt(lt).ticks(4, "s").tickSizeOuter(0).tickSize(-z);
4138
- _.select(".x-axis").attr("transform", `translate(0,${z})`).transition().duration(w).call(ut).selectAll("text").style("cursor", "pointer").attr("dy", N ? "1em" : ".20em").attr("dx", N ? "0em" : "-.8em").attr("class", tt).selectAll(".tick").filter((V) => V === 0).select("line").remove();
4139
- const _t = n === "vertical" ? Qt(lt).ticks(4, "s").tickSize(-Q) : Qt(ct).tickSizeOuter(0);
4140
- _.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(w).call(_t).selectAll(".tick").filter((V) => V === 0).select("line").remove();
4141
- const Be = bn().keys(R)(Z).map(
4137
+ ) : Yt(g, (V) => V[M]), ft = ce().domain([0, ht ?? 0]).range(n === "vertical" ? [O, 0] : [0, G]), lt = n === "vertical" ? Zt(ct).tickValues(ct.domain()).tickSizeOuter(0) : Zt(ft).ticks(4, "s").tickSizeOuter(0).tickSize(-O);
4138
+ p.select(".x-axis").attr("transform", `translate(0,${O})`).transition().duration(b).call(lt).selectAll("text").style("cursor", "pointer").attr("dy", N ? "1em" : ".20em").attr("dx", N ? "0em" : "-.8em").attr("class", Z).selectAll(".tick").filter((V) => V === 0).select("line").remove();
4139
+ const gt = n === "vertical" ? Qt(ft).ticks(4, "s").tickSize(-G) : Qt(ct).tickSizeOuter(0);
4140
+ p.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(b).call(gt).selectAll(".tick").filter((V) => V === 0).select("line").remove();
4141
+ const Be = bn().keys(A)(tt).map(
4142
4142
  (V) => {
4143
- const it = V.key, st = V.map((I) => ({
4143
+ const it = V.key, ot = V.map((I) => ({
4144
4144
  ...I,
4145
4145
  key: `${it} - ${I.data.label}`,
4146
4146
  barKey: it
4147
4147
  }));
4148
- return st.key = it, st;
4148
+ return ot.key = it, ot;
4149
4149
  }
4150
- ), pe = (V) => J !== "" ? `rect
4151
- ${J === V.barKey ? rt.rectLegendHovered : rt.rectLegendNotHovered}` : `rect ${rt.rect}`;
4152
- let ge = _.selectAll(".serie").data(Be, function(V) {
4150
+ ), pe = (V) => Y !== "" ? `rect
4151
+ ${Y === V.barKey ? rt.rectLegendHovered : rt.rectLegendNotHovered}` : `rect ${rt.rect}`;
4152
+ let ge = p.selectAll(".serie").data(Be, function(V) {
4153
4153
  return V.key;
4154
4154
  }).join(
4155
- (V) => V.append("g").attr("class", "serie").attr("fill", function(st) {
4156
- const I = M.current.findIndex((at) => at === st.key) + e;
4157
- return xt(I);
4158
- }).style("opacity", (st) => $ === "all" || st.key === $ ? 1 : 0).style("pointer-events", (st) => $ === "all" || st.key === $ ? "auto" : "none"),
4159
- (V) => V.transition().duration(w).attr("fill", function(st) {
4160
- const I = M.current.findIndex((at) => at === st.key) + e;
4161
- return xt(I);
4162
- }).style("opacity", (st) => $ === "all" || st.key === $ ? 1 : 0).style("pointer-events", (st) => $ === "all" || st.key === $ ? "auto" : "none"),
4163
- (V) => V.transition().duration(w).style("opacity", 0).attr("fill", "grey").selectAll("rect").attr("y", z).attr("height", 0).remove()
4155
+ (V) => V.append("g").attr("class", "serie").attr("fill", function(ot) {
4156
+ const I = S.current.findIndex((at) => at === ot.key) + e;
4157
+ return vt(I);
4158
+ }).style("opacity", (ot) => M === "all" || ot.key === M ? 1 : 0).style("pointer-events", (ot) => M === "all" || ot.key === M ? "auto" : "none"),
4159
+ (V) => V.transition().duration(b).attr("fill", function(ot) {
4160
+ const I = S.current.findIndex((at) => at === ot.key) + e;
4161
+ return vt(I);
4162
+ }).style("opacity", (ot) => M === "all" || ot.key === M ? 1 : 0).style("pointer-events", (ot) => M === "all" || ot.key === M ? "auto" : "none"),
4163
+ (V) => V.transition().duration(b).style("opacity", 0).attr("fill", "grey").selectAll("rect").attr("y", O).attr("height", 0).remove()
4164
4164
  );
4165
4165
  const te = (V) => {
4166
4166
  const it = ct(V.data.label + "") ?? 0;
4167
- if ($ === "all") {
4168
- const st = R.indexOf(V.barKey) || 0;
4169
- return it + st * (ct.bandwidth() / R.length);
4167
+ if (M === "all") {
4168
+ const ot = A.indexOf(V.barKey) || 0;
4169
+ return it + ot * (ct.bandwidth() / A.length);
4170
4170
  }
4171
4171
  return it;
4172
- }, Xt = () => $ === "all" ? ct.bandwidth() / R.length : ct.bandwidth(), Kt = (V) => n === "vertical" ? z - (lt(V[0]) - lt(V[1])) : lt(0), Ut = (V) => {
4173
- const it = n === "vertical" ? lt(V[0]) - lt(V[1]) : lt(V[1]) - lt(V[0]);
4172
+ }, Xt = () => M === "all" ? ct.bandwidth() / A.length : ct.bandwidth(), Kt = (V) => n === "vertical" ? O - (ft(V[0]) - ft(V[1])) : ft(0), Ut = (V) => {
4173
+ const it = n === "vertical" ? ft(V[0]) - ft(V[1]) : ft(V[1]) - ft(V[0]);
4174
4174
  return isNaN(it) || it < 0 ? 0 : it;
4175
4175
  }, qt = (V) => n === "vertical" ? te(V) : Kt(V), Lt = (V) => n === "vertical" ? Xt() : Ut(V), Tt = (V) => n === "vertical" ? Kt(V) : te(V), $t = (V) => n === "vertical" ? Ut(V) : Xt();
4176
4176
  ge.selectAll("rect").data(
@@ -4179,39 +4179,39 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4179
4179
  ).join(
4180
4180
  (V) => {
4181
4181
  let it;
4182
- return it = V.append("rect").attr("class", pe).attr("x", function(st) {
4183
- return n === "vertical" ? qt(st) : 0;
4184
- }).attr("width", function(st) {
4185
- return n === "vertical" ? $ === "all" ? ct.bandwidth() / R.length : ct.bandwidth() : 0;
4186
- }).attr("y", function(st) {
4187
- return n === "vertical" ? z : Tt(st);
4188
- }).attr("height", function(st) {
4189
- return n === "vertical" ? 0 : $ === "all" ? ct.bandwidth() / R.length : ct.bandwidth();
4190
- }).transition().duration(w).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), it;
4182
+ return it = V.append("rect").attr("class", pe).attr("x", function(ot) {
4183
+ return n === "vertical" ? qt(ot) : 0;
4184
+ }).attr("width", function(ot) {
4185
+ return n === "vertical" ? M === "all" ? ct.bandwidth() / A.length : ct.bandwidth() : 0;
4186
+ }).attr("y", function(ot) {
4187
+ return n === "vertical" ? O : Tt(ot);
4188
+ }).attr("height", function(ot) {
4189
+ return n === "vertical" ? 0 : M === "all" ? ct.bandwidth() / A.length : ct.bandwidth();
4190
+ }).transition().duration(b).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), it;
4191
4191
  },
4192
4192
  void 0,
4193
- (V) => V.attr("fill", Vt).transition().duration(w).attr("opacity", 0).attr("height", 0).attr("y", z + P.bottom).remove()
4194
- ).attr("class", pe).transition().duration(w).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), ge.selectAll("rect").on("mouseover", function(V, it) {
4195
- dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((k) => k === it.data.label).attr("class", (n === "vertical" ? tt : "") + " " + rt.hoveredAxisText), b.style("opacity", 1).select("p.title").text(it.data.label);
4196
- const st = it.data[it.barKey], { total: I } = it.data, at = st / I * 100;
4197
- he(".1f")(at) + "", b.select("p.top-label").text(it.barKey + " : " + St(st, r)), b.select("p.bottom-label").text(
4198
- $ === "all" ? `Total : ${St(I, r)}` : "~"
4193
+ (V) => V.attr("fill", Vt).transition().duration(b).attr("opacity", 0).attr("height", 0).attr("y", O + L.bottom).remove()
4194
+ ).attr("class", pe).transition().duration(b).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), ge.selectAll("rect").on("mouseover", function(V, it) {
4195
+ dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((w) => w === it.data.label).attr("class", (n === "vertical" ? Z : "") + " " + rt.hoveredAxisText), v.style("opacity", 1).select("p.title").text(it.data.label);
4196
+ const ot = it.data[it.barKey], { total: I } = it.data, at = ot / I * 100;
4197
+ he(".1f")(at) + "", v.select("p.top-label").text(it.barKey + " : " + St(ot, r)), v.select("p.bottom-label").text(
4198
+ M === "all" ? `Total : ${St(I, r)}` : "~"
4199
4199
  );
4200
4200
  }).on("touch", function(V, it) {
4201
- dt(".x-axis").selectAll("text").filter((st) => st === it.data.label).attr("class", tt);
4201
+ dt(".x-axis").selectAll("text").filter((ot) => ot === it.data.label).attr("class", Z);
4202
4202
  }).on("mousemove", (V, it) => {
4203
- Rn(b, { e: V, svg: g, yScale: lt });
4203
+ Rn(v, { e: V, svg: d, yScale: ft });
4204
4204
  }).on("mouseout", function(V, it) {
4205
- dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((st) => st === it.data.label).attr("class", n === "vertical" ? tt : ""), b.style("opacity", 0);
4205
+ dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((ot) => ot === it.data.label).attr("class", n === "vertical" ? Z : ""), v.style("opacity", 0);
4206
4206
  });
4207
- }, [...E, Y, d, R, J, O, n, T, r]);
4207
+ }, [...P, q, g, A, Y, R, n, j, r]);
4208
4208
  return /* @__PURE__ */ H.jsxs(
4209
4209
  "div",
4210
4210
  {
4211
4211
  ref: i,
4212
4212
  style: { width: s, height: o, display: "flex", flexDirection: "column" },
4213
4213
  children: [
4214
- C ? kn(S, C) : S,
4214
+ $ ? kn(T, $) : T,
4215
4215
  /* @__PURE__ */ H.jsx(
4216
4216
  "div",
4217
4217
  {
@@ -4229,8 +4229,8 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4229
4229
  "svg",
4230
4230
  {
4231
4231
  className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
4232
- viewBox: `0 0 ${p} ${v}`,
4233
- children: p > 0 && /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
4232
+ viewBox: `0 0 ${y} ${_}`,
4233
+ children: y > 0 && /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
4234
4234
  /* @__PURE__ */ H.jsx("g", { className: "plot-rects" }),
4235
4235
  /* @__PURE__ */ H.jsx("g", { className: `${n === "vertical" ? rt["value-axis"] : ""} y-axis` }),
4236
4236
  /* @__PURE__ */ H.jsx("g", { className: `${n === "horizontal" ? rt["value-axis"] : ""} x-axis` })
@@ -4248,51 +4248,51 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4248
4248
  );
4249
4249
  }
4250
4250
  function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipFormat: r }) {
4251
- const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width: p, height: v } = f, [j, K] = ft(""), [T, q] = ft(!0), [$, A] = ft(!1), [O, F] = ft("all"), J = Tn(), G = t;
4252
- vt(() => {
4253
- F("all"), q(!0), A(!0);
4254
- }, [G]);
4255
- const Y = 750;
4256
- vt(() => {
4251
+ const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width: y, height: _ } = f, [D, J] = ut(""), [j, z] = ut(!0), [M, k] = ut(!1), [R, W] = ut("all"), Y = Tn(), K = t;
4252
+ _t(() => {
4253
+ W("all"), z(!0), k(!0);
4254
+ }, [K]);
4255
+ const q = 750;
4256
+ _t(() => {
4257
4257
  let N;
4258
- return $ && (N = setTimeout(() => {
4259
- A(!1);
4260
- }, Y + 500)), () => {
4258
+ return M && (N = setTimeout(() => {
4259
+ k(!1);
4260
+ }, q + 500)), () => {
4261
4261
  clearTimeout(N);
4262
4262
  };
4263
- }, [$]);
4264
- const B = [p, v, O, e], C = Mt(G), L = C.length === 0 ? [] : Object.keys(C[0]).filter((N) => N !== "label" && N !== "total"), w = Ne(L), E = p > 576, d = Et((N) => {
4265
- if ($) return;
4266
- const x = E ? 80 : 50, S = function(D) {
4267
- const P = rt[E ? "legend-container" : "legend-container-sm"], W = rt[E ? "legend-container-active" : "legend-container-active-sm"], Z = rt[E ? "legend-container-inactive" : "legend-container-inactive-sm"];
4263
+ }, [M]);
4264
+ const et = [y, _, R, e], $ = Mt(K), C = $.length === 0 ? [] : Object.keys($[0]).filter((N) => N !== "label" && N !== "total"), b = Ne(C), P = y > 576, g = Et((N) => {
4265
+ if (M) return;
4266
+ const x = P ? 80 : 50, T = function(E) {
4267
+ const L = rt[P ? "legend-container" : "legend-container-sm"], B = rt[P ? "legend-container-active" : "legend-container-active-sm"], tt = rt[P ? "legend-container-inactive" : "legend-container-inactive-sm"];
4268
4268
  return `
4269
- ${O.includes(D) ? O === D ? W : Z : P}
4269
+ ${R.includes(E) ? R === E ? B : tt : L}
4270
4270
  legend-item
4271
4271
  `;
4272
4272
  };
4273
- N.selectAll(".legend-item").data([...L], (D) => D).join(
4274
- (D) => {
4275
- const P = D.append("div").attr("class", S).style("left", (W, Z) => `${Z * x}px`).style("top", "-53px").style("opacity", 0);
4276
- return P.append("div").attr("class", rt["legend-rect"]).style("background", (W) => {
4277
- const Z = w.current.findIndex((Q) => Q === W) + e;
4278
- return xt(Z);
4279
- }), P.append("span").attr("class", rt["legend-label"]).text((W) => W), P.transition().duration(Y).style("top", "0px").style("opacity", 1), P;
4273
+ N.selectAll(".legend-item").data([...C], (E) => E).join(
4274
+ (E) => {
4275
+ const L = E.append("div").attr("class", T).style("left", (B, tt) => `${tt * x}px`).style("top", "-53px").style("opacity", 0);
4276
+ return L.append("div").attr("class", rt["legend-rect"]).style("background", (B) => {
4277
+ const tt = b.current.findIndex((G) => G === B) + e;
4278
+ return vt(tt);
4279
+ }), L.append("span").attr("class", rt["legend-label"]).text((B) => B), L.transition().duration(q).style("top", "0px").style("opacity", 1), L;
4280
4280
  },
4281
- (D) => (D.attr("class", S).transition().duration(Y).style("top", "0px").style("left", (P, W) => `${W * x}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (P) => {
4282
- const W = w.current.findIndex((Z) => Z === P) + e;
4283
- return xt(W);
4284
- }), D.select(`.${rt["legend-label"]}`).text((P) => P), D),
4285
- (D) => D.transition().duration(Y).style("opacity", 0).style("top", "53px").remove().remove().remove()
4286
- ).on("mouseover", (D, P) => {
4287
- K(P);
4288
- }).on("mouseout", function(D) {
4289
- K("");
4281
+ (E) => (E.attr("class", T).transition().duration(q).style("top", "0px").style("left", (L, B) => `${B * x}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (L) => {
4282
+ const B = b.current.findIndex((tt) => tt === L) + e;
4283
+ return vt(B);
4284
+ }), E.select(`.${rt["legend-label"]}`).text((L) => L), E),
4285
+ (E) => E.transition().duration(q).style("opacity", 0).style("top", "53px").remove().remove().remove()
4286
+ ).on("mouseover", (E, L) => {
4287
+ J(L);
4288
+ }).on("mouseout", function(E) {
4289
+ J("");
4290
4290
  });
4291
- }, [...B, L, $]), R = /* @__PURE__ */ H.jsxs(
4291
+ }, [...et, C, M]), A = /* @__PURE__ */ H.jsxs(
4292
4292
  "div",
4293
4293
  {
4294
4294
  ref: c,
4295
- className: `${nt["controls-container"]} ${J ? nt["fill-container"] : ""}`,
4295
+ className: `${nt["controls-container"]} ${Y ? nt["fill-container"] : ""}`,
4296
4296
  children: [
4297
4297
  /* @__PURE__ */ H.jsxs("label", { className: nt["controls-label"], style: { paddingRight: "12px" }, children: [
4298
4298
  /* @__PURE__ */ H.jsx(
@@ -4300,8 +4300,8 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4300
4300
  {
4301
4301
  type: "checkbox",
4302
4302
  className: nt["controls-checkbox"],
4303
- checked: T,
4304
- onChange: (N) => q(N.target.checked)
4303
+ checked: j,
4304
+ onChange: (N) => z(N.target.checked)
4305
4305
  }
4306
4306
  ),
4307
4307
  "Percentage"
@@ -4309,117 +4309,117 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4309
4309
  /* @__PURE__ */ H.jsx(
4310
4310
  "div",
4311
4311
  {
4312
- ref: d,
4312
+ ref: g,
4313
4313
  id: "stacked-barchart-legends",
4314
4314
  className: `${rt["legends-container"]}`
4315
4315
  }
4316
4316
  )
4317
4317
  ]
4318
4318
  }
4319
- ), M = Et((N) => {
4320
- if (p === 0 || v === 0 || j !== "" && $) return;
4319
+ ), S = Et((N) => {
4320
+ if (y === 0 || _ === 0 || D !== "" && M) return;
4321
4321
  const x = { top: 20, right: 30, bottom: 30, left: 40 };
4322
- C.forEach(function(I) {
4323
- I.total = L.reduce((at, k) => {
4324
- k in I || (I[k] = 0);
4325
- const et = I[k];
4326
- return at + (typeof et == "number" ? et : Number(et));
4322
+ $.forEach(function(I) {
4323
+ I.total = C.reduce((at, w) => {
4324
+ w in I || (I[w] = 0);
4325
+ const Q = I[w];
4326
+ return at + (typeof Q == "number" ? Q : Number(Q));
4327
4327
  }, 0);
4328
4328
  });
4329
- const m = C.filter((I) => I?.total && I.total > 0), D = p - x.left - x.right, P = v - x.top - x.bottom, W = N.select("svg"), Z = W.node(), Q = W.select(".plot-area").attr("transform", "translate(" + x.left + "," + x.top + ")"), z = Ye(N).style("opacity", 0), y = !E && n === "vertical" ? rt.rotatedAxisText : rt.axisText, g = m.map(function(I) {
4329
+ const m = $.filter((I) => I?.total && I.total > 0), E = y - x.left - x.right, L = _ - x.top - x.bottom, B = N.select("svg"), tt = B.node(), G = B.select(".plot-area").attr("transform", "translate(" + x.left + "," + x.top + ")"), O = Ye(N).style("opacity", 0), X = !P && n === "vertical" ? rt.rotatedAxisText : rt.axisText, d = m.map(function(I) {
4330
4330
  return I.label;
4331
- }), _ = Ae().domain(g).rangeRound(n === "vertical" ? [0, D] : [P, 0]).paddingInner(E ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), b = Yt(C, (I) => I.total), U = ce().domain([0, T ? 1 : b || 0]).nice().range(n === "vertical" ? [P, 0] : [0, D]), tt = Ae().rangeRound([0, D]).paddingInner(0.1).align(0.2), ot = m.map(function(I) {
4331
+ }), p = Ae().domain(d).rangeRound(n === "vertical" ? [0, E] : [L, 0]).paddingInner(P ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), v = Yt($, (I) => I.total), F = ce().domain([0, j ? 1 : v || 0]).nice().range(n === "vertical" ? [L, 0] : [0, E]), Z = Ae().rangeRound([0, E]).paddingInner(0.1).align(0.2), st = m.map(function(I) {
4332
4332
  return I.label;
4333
4333
  });
4334
- tt.domain(ot);
4335
- const ct = [], ht = n === "vertical" ? Zt(_).tickValues(_.domain()).tickSizeOuter(0) : Zt(U).ticks(4, T ? ".0%" : "s").tickSizeOuter(0).tickSize(-P);
4336
- Q.select(".x-axis").attr("transform", `translate(0,${P})`).transition().duration(Y).call(ht).selectAll("text").style("cursor", "pointer").attr("dy", E ? "1em" : ".20em").attr("dx", E ? "0em" : "-.8em").attr("class", y).selectAll(".tick").filter((I) => I === 0).select("line").remove();
4337
- const lt = Yt(C, (I) => I.total), ut = ce().domain([0, T ? 1 : lt || 0]).nice().range([P, 0]), _t = n === "vertical" ? Qt(U).ticks(4, T ? ".0%" : "s").tickSize(-D) : Qt(_).tickSizeOuter(0);
4338
- Q.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(Y).call(_t).selectAll(".tick").filter((I) => I === 0).select("line").remove();
4339
- const Ot = bn().order(ir).offset($u), pe = (T ? Ot.keys(L)(m) : bn().keys(L)(m)).map((I) => {
4340
- const at = I.key, k = I.map((et) => {
4341
- const X = et.data.label;
4334
+ Z.domain(st);
4335
+ const ct = [], ht = n === "vertical" ? Zt(p).tickValues(p.domain()).tickSizeOuter(0) : Zt(F).ticks(4, j ? ".0%" : "s").tickSizeOuter(0).tickSize(-L);
4336
+ G.select(".x-axis").attr("transform", `translate(0,${L})`).transition().duration(q).call(ht).selectAll("text").style("cursor", "pointer").attr("dy", P ? "1em" : ".20em").attr("dx", P ? "0em" : "-.8em").attr("class", X).selectAll(".tick").filter((I) => I === 0).select("line").remove();
4337
+ const ft = Yt($, (I) => I.total), lt = ce().domain([0, j ? 1 : ft || 0]).nice().range([L, 0]), gt = n === "vertical" ? Qt(F).ticks(4, j ? ".0%" : "s").tickSize(-E) : Qt(p).tickSizeOuter(0);
4338
+ G.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(q).call(gt).selectAll(".tick").filter((I) => I === 0).select("line").remove();
4339
+ const Ot = bn().order(ir).offset($u), pe = (j ? Ot.keys(C)(m) : bn().keys(C)(m)).map((I) => {
4340
+ const at = I.key, w = I.map((Q) => {
4341
+ const U = Q.data.label;
4342
4342
  return {
4343
- ...et,
4344
- key: `${at} - ${X}`,
4343
+ ...Q,
4344
+ key: `${at} - ${U}`,
4345
4345
  barKey: at
4346
4346
  };
4347
4347
  });
4348
- return k.key = at, k;
4348
+ return w.key = at, w;
4349
4349
  });
4350
- let ge = Q.selectAll(".serie").data(pe, function(I) {
4350
+ let ge = G.selectAll(".serie").data(pe, function(I) {
4351
4351
  return I.key;
4352
4352
  }).join(
4353
- (I) => I.append("g").attr("class", "serie").attr("fill", function(k) {
4354
- const et = w.current.findIndex((X) => X === k.key) + e;
4355
- return xt(et);
4353
+ (I) => I.append("g").attr("class", "serie").attr("fill", function(w) {
4354
+ const Q = b.current.findIndex((U) => U === w.key) + e;
4355
+ return vt(Q);
4356
4356
  }).style("opacity", 1).style("pointer-events", "auto"),
4357
- (I) => I.transition().duration(Y).attr("fill", function(k) {
4358
- const et = w.current.findIndex((X) => X === k.key) + e;
4359
- return xt(et);
4357
+ (I) => I.transition().duration(q).attr("fill", function(w) {
4358
+ const Q = b.current.findIndex((U) => U === w.key) + e;
4359
+ return vt(Q);
4360
4360
  }).style("opacity", 1).style("pointer-events", "auto"),
4361
- (I) => I.transition().duration(Y).style("opacity", 0).attr("fill", Vt).selectAll("rect").attr("y", P).attr("height", 0).remove()
4361
+ (I) => I.transition().duration(q).style("opacity", 0).attr("fill", Vt).selectAll("rect").attr("y", L).attr("height", 0).remove()
4362
4362
  );
4363
- const te = (I) => _(I.data.label + "") ?? 0, Xt = _.bandwidth(), Kt = (I) => U(n === "vertical" ? I[1] : I[0]), Ut = (I) => {
4364
- const at = n === "vertical" ? U(I[0]) - U(I[1]) : U(I[1]) - U(I[0]);
4363
+ const te = (I) => p(I.data.label + "") ?? 0, Xt = p.bandwidth(), Kt = (I) => F(n === "vertical" ? I[1] : I[0]), Ut = (I) => {
4364
+ const at = n === "vertical" ? F(I[0]) - F(I[1]) : F(I[1]) - F(I[0]);
4365
4365
  return isNaN(at) || at < 0 ? 0 : at;
4366
4366
  }, qt = (I) => n === "vertical" ? te(I) : Kt(I), Lt = (I) => n === "vertical" ? Xt : Ut(I), Tt = (I) => n === "vertical" ? Kt(I) : te(I), $t = (I) => n === "vertical" ? Ut(I) : Xt;
4367
4367
  function V(I) {
4368
- if (I.barKey === j)
4368
+ if (I.barKey === D)
4369
4369
  return "none";
4370
- const at = Lt(I), k = $t(I);
4371
- return L.indexOf(I.barKey) === L.length - 1 || I.barKey === O[0] ? n === "vertical" ? `${at + k} ${at} ${k}` : `${at + k + at}` : n === "vertical" ? `${k} ${at}` : `${at} ${k}`;
4370
+ const at = Lt(I), w = $t(I);
4371
+ return C.indexOf(I.barKey) === C.length - 1 || I.barKey === R[0] ? n === "vertical" ? `${at + w} ${at} ${w}` : `${at + w + at}` : n === "vertical" ? `${w} ${at}` : `${at} ${w}`;
4372
4372
  }
4373
4373
  function it(I) {
4374
- const at = Lt(I), k = L.indexOf(I.barKey) === L.length - 1;
4375
- return n === "vertical" ? k ? 0 : at * -1 : 0;
4374
+ const at = Lt(I), w = C.indexOf(I.barKey) === C.length - 1;
4375
+ return n === "vertical" ? w ? 0 : at * -1 : 0;
4376
4376
  }
4377
- const st = (I) => j !== "" && j === I.barKey ? `rect ${rt.rectLegendHovered}` : `rect ${rt.rect}`;
4377
+ const ot = (I) => D !== "" && D === I.barKey ? `rect ${rt.rectLegendHovered}` : `rect ${rt.rect}`;
4378
4378
  ge.selectAll("rect").data(
4379
4379
  (I) => I,
4380
4380
  (I) => I.data.label
4381
4381
  ).join(
4382
4382
  (I) => {
4383
4383
  let at;
4384
- return at = I.append("rect").attr("class", st).attr("x", function(k) {
4385
- return n === "vertical" ? tt(k.data.label + "") ?? 0 : U(0);
4386
- }).attr("width", function(k) {
4387
- return n === "vertical" ? _.bandwidth() : 0;
4388
- }).attr("y", function(k) {
4384
+ return at = I.append("rect").attr("class", ot).attr("x", function(w) {
4385
+ return n === "vertical" ? Z(w.data.label + "") ?? 0 : F(0);
4386
+ }).attr("width", function(w) {
4387
+ return n === "vertical" ? p.bandwidth() : 0;
4388
+ }).attr("y", function(w) {
4389
4389
  if (n === "vertical") {
4390
- if (!ct.includes(k.data.label + ""))
4391
- return P;
4392
- const et = U(k[1]), X = U(k[0]) - U(k[1]), gt = isNaN(X) || X < 0 ? 0 : X;
4393
- return et + gt;
4390
+ if (!ct.includes(w.data.label + ""))
4391
+ return L;
4392
+ const Q = F(w[1]), U = F(w[0]) - F(w[1]), yt = isNaN(U) || U < 0 ? 0 : U;
4393
+ return Q + yt;
4394
4394
  } else
4395
- return Tt(k);
4396
- }).attr("height", function(k) {
4397
- return n === "vertical" ? 0 : $t(k);
4398
- }).attr("stroke-dasharray", V).attr("stroke-dashoffset", it).transition().duration(Y).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), at;
4395
+ return Tt(w);
4396
+ }).attr("height", function(w) {
4397
+ return n === "vertical" ? 0 : $t(w);
4398
+ }).attr("stroke-dasharray", V).attr("stroke-dashoffset", it).transition().duration(q).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), at;
4399
4399
  },
4400
4400
  void 0,
4401
- (I) => I.transition().duration(Y).attr("opacity", 0).attr("height", 0).attr("y", P).remove()
4402
- ).attr("class", st).attr("stroke-dasharray", V).attr("stroke-dashoffset", it).transition().duration(Y).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), ge.selectAll("rect").on("mouseover", function(I, at) {
4403
- dt(".x-axis").selectAll("text").filter((bt) => bt === at.data.name).attr("class", y + " " + nt.hoveredAxisText), z.style("opacity", 1).select("p.title").text(at.data.label);
4404
- const k = at.data[at.barKey] || 0, et = at.data.total || 0, X = k / et * 100, gt = he(".1f")(X) + "%";
4405
- z.select("p.top-label").text(at.barKey + " : " + (T ? gt : St(k, r))), z.select("p.bottom-label").text(
4406
- T ? `(${St(k, r)} of ${St(et, r)})` : `Total : ${St(et, r)}`
4401
+ (I) => I.transition().duration(q).attr("opacity", 0).attr("height", 0).attr("y", L).remove()
4402
+ ).attr("class", ot).attr("stroke-dasharray", V).attr("stroke-dashoffset", it).transition().duration(q).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), ge.selectAll("rect").on("mouseover", function(I, at) {
4403
+ dt(".x-axis").selectAll("text").filter((bt) => bt === at.data.name).attr("class", X + " " + nt.hoveredAxisText), O.style("opacity", 1).select("p.title").text(at.data.label);
4404
+ const w = at.data[at.barKey] || 0, Q = at.data.total || 0, U = w / Q * 100, yt = he(".1f")(U) + "%";
4405
+ O.select("p.top-label").text(at.barKey + " : " + (j ? yt : St(w, r))), O.select("p.bottom-label").text(
4406
+ j ? `(${St(w, r)} of ${St(Q, r)})` : `Total : ${St(Q, r)}`
4407
4407
  );
4408
4408
  }).on("touch", function(I, at) {
4409
- dt(".x-axis").selectAll("text").filter((k) => k === at.data.label).attr("class", y);
4409
+ dt(".x-axis").selectAll("text").filter((w) => w === at.data.label).attr("class", X);
4410
4410
  }).on("mousemove", (I, at) => {
4411
- Rn(z, { e: I, svg: Z, yScale: ut });
4411
+ Rn(O, { e: I, svg: tt, yScale: lt });
4412
4412
  }).on("mouseout", function(I, at) {
4413
- dt(".x-axis").selectAll("text").filter((k) => k === at.data.name).attr("class", y), z.style("opacity", 0);
4413
+ dt(".x-axis").selectAll("text").filter((w) => w === at.data.name).attr("class", X), O.style("opacity", 0);
4414
4414
  });
4415
- }, [...B, C, L, T, j, n, $, r]);
4415
+ }, [...et, $, C, j, D, n, M, r]);
4416
4416
  return /* @__PURE__ */ H.jsxs(
4417
4417
  "div",
4418
4418
  {
4419
4419
  ref: i,
4420
4420
  style: { width: s, height: o, display: "flex", flexDirection: "column" },
4421
4421
  children: [
4422
- J ? kn(R, J) : R,
4422
+ Y ? kn(A, Y) : A,
4423
4423
  /* @__PURE__ */ H.jsx(
4424
4424
  "div",
4425
4425
  {
@@ -4429,7 +4429,7 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4429
4429
  children: /* @__PURE__ */ H.jsxs(
4430
4430
  "div",
4431
4431
  {
4432
- ref: M,
4432
+ ref: S,
4433
4433
  className: `${nt["fill-container"]}`,
4434
4434
  style: { display: "flex", flexDirection: "column" },
4435
4435
  children: [
@@ -4437,7 +4437,7 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
4437
4437
  "svg",
4438
4438
  {
4439
4439
  className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
4440
- viewBox: `0 0 ${p} ${v}`,
4440
+ viewBox: `0 0 ${y} ${_}`,
4441
4441
  children: /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
4442
4442
  /* @__PURE__ */ H.jsx("g", { className: "plot-rects" }),
4443
4443
  /* @__PURE__ */ H.jsx("g", { className: `${n === "vertical" ? rt["value-axis"] : ""} y-axis` }),
@@ -4535,200 +4535,200 @@ function si({ nodes: t }) {
4535
4535
  }
4536
4536
  }
4537
4537
  function af() {
4538
- let t = 0, e = 0, n = 1, r = 1, i = 24, a = 8, s, o = ef, c = tf, l, u, h = nf, f = rf, p = 6;
4539
- function v() {
4540
- const d = { nodes: h.apply(null, arguments), links: f.apply(null, arguments) };
4541
- return j(d), K(d), T(d), q(d), O(d), si(d), d;
4538
+ let t = 0, e = 0, n = 1, r = 1, i = 24, a = 8, s, o = ef, c = tf, l, u, h = nf, f = rf, y = 6;
4539
+ function _() {
4540
+ const g = { nodes: h.apply(null, arguments), links: f.apply(null, arguments) };
4541
+ return D(g), J(g), j(g), z(g), R(g), si(g), g;
4542
4542
  }
4543
- v.update = function(d) {
4544
- return si(d), d;
4545
- }, v.nodeId = function(d) {
4546
- return arguments.length ? (o = typeof d == "function" ? d : nn(d), v) : o;
4547
- }, v.nodeAlign = function(d) {
4548
- return arguments.length ? (c = typeof d == "function" ? d : nn(d), v) : c;
4549
- }, v.nodeSort = function(d) {
4550
- return arguments.length ? (l = d, v) : l;
4551
- }, v.nodeWidth = function(d) {
4552
- return arguments.length ? (i = +d, v) : i;
4553
- }, v.nodePadding = function(d) {
4554
- return arguments.length ? (a = s = +d, v) : a;
4555
- }, v.nodes = function(d) {
4556
- return arguments.length ? (h = typeof d == "function" ? d : nn(d), v) : h;
4557
- }, v.links = function(d) {
4558
- return arguments.length ? (f = typeof d == "function" ? d : nn(d), v) : f;
4559
- }, v.linkSort = function(d) {
4560
- return arguments.length ? (u = d, v) : u;
4561
- }, v.size = function(d) {
4562
- return arguments.length ? (t = e = 0, n = +d[0], r = +d[1], v) : [n - t, r - e];
4563
- }, v.extent = function(d) {
4564
- return arguments.length ? (t = +d[0][0], n = +d[1][0], e = +d[0][1], r = +d[1][1], v) : [[t, e], [n, r]];
4565
- }, v.iterations = function(d) {
4566
- return arguments.length ? (p = +d, v) : p;
4543
+ _.update = function(g) {
4544
+ return si(g), g;
4545
+ }, _.nodeId = function(g) {
4546
+ return arguments.length ? (o = typeof g == "function" ? g : nn(g), _) : o;
4547
+ }, _.nodeAlign = function(g) {
4548
+ return arguments.length ? (c = typeof g == "function" ? g : nn(g), _) : c;
4549
+ }, _.nodeSort = function(g) {
4550
+ return arguments.length ? (l = g, _) : l;
4551
+ }, _.nodeWidth = function(g) {
4552
+ return arguments.length ? (i = +g, _) : i;
4553
+ }, _.nodePadding = function(g) {
4554
+ return arguments.length ? (a = s = +g, _) : a;
4555
+ }, _.nodes = function(g) {
4556
+ return arguments.length ? (h = typeof g == "function" ? g : nn(g), _) : h;
4557
+ }, _.links = function(g) {
4558
+ return arguments.length ? (f = typeof g == "function" ? g : nn(g), _) : f;
4559
+ }, _.linkSort = function(g) {
4560
+ return arguments.length ? (u = g, _) : u;
4561
+ }, _.size = function(g) {
4562
+ return arguments.length ? (t = e = 0, n = +g[0], r = +g[1], _) : [n - t, r - e];
4563
+ }, _.extent = function(g) {
4564
+ return arguments.length ? (t = +g[0][0], n = +g[1][0], e = +g[0][1], r = +g[1][1], _) : [[t, e], [n, r]];
4565
+ }, _.iterations = function(g) {
4566
+ return arguments.length ? (y = +g, _) : y;
4567
4567
  };
4568
- function j({ nodes: d, links: R }) {
4569
- for (const [N, x] of d.entries())
4568
+ function D({ nodes: g, links: A }) {
4569
+ for (const [N, x] of g.entries())
4570
4570
  x.index = N, x.sourceLinks = [], x.targetLinks = [];
4571
- const M = new Map(d.map((N, x) => [o(N, x, d), N]));
4572
- for (const [N, x] of R.entries()) {
4571
+ const S = new Map(g.map((N, x) => [o(N, x, g), N]));
4572
+ for (const [N, x] of A.entries()) {
4573
4573
  x.index = N;
4574
- let { source: S, target: m } = x;
4575
- typeof S != "object" && (S = x.source = ai(M, S)), typeof m != "object" && (m = x.target = ai(M, m)), S.sourceLinks.push(x), m.targetLinks.push(x);
4574
+ let { source: T, target: m } = x;
4575
+ typeof T != "object" && (T = x.source = ai(S, T)), typeof m != "object" && (m = x.target = ai(S, m)), T.sourceLinks.push(x), m.targetLinks.push(x);
4576
4576
  }
4577
4577
  if (u != null)
4578
- for (const { sourceLinks: N, targetLinks: x } of d)
4578
+ for (const { sourceLinks: N, targetLinks: x } of g)
4579
4579
  N.sort(u), x.sort(u);
4580
4580
  }
4581
- function K({ nodes: d }) {
4582
- for (const R of d)
4583
- R.value = R.fixedValue === void 0 ? Math.max(Fn(R.sourceLinks, Vn), Fn(R.targetLinks, Vn)) : R.fixedValue;
4581
+ function J({ nodes: g }) {
4582
+ for (const A of g)
4583
+ A.value = A.fixedValue === void 0 ? Math.max(Fn(A.sourceLinks, Vn), Fn(A.targetLinks, Vn)) : A.fixedValue;
4584
4584
  }
4585
- function T({ nodes: d }) {
4586
- const R = d.length;
4587
- let M = new Set(d), N = /* @__PURE__ */ new Set(), x = 0;
4588
- for (; M.size; ) {
4589
- for (const S of M) {
4590
- S.depth = x;
4591
- for (const { target: m } of S.sourceLinks)
4585
+ function j({ nodes: g }) {
4586
+ const A = g.length;
4587
+ let S = new Set(g), N = /* @__PURE__ */ new Set(), x = 0;
4588
+ for (; S.size; ) {
4589
+ for (const T of S) {
4590
+ T.depth = x;
4591
+ for (const { target: m } of T.sourceLinks)
4592
4592
  N.add(m);
4593
4593
  }
4594
- if (++x > R) throw new Error("circular link");
4595
- M = N, N = /* @__PURE__ */ new Set();
4594
+ if (++x > A) throw new Error("circular link");
4595
+ S = N, N = /* @__PURE__ */ new Set();
4596
4596
  }
4597
4597
  }
4598
- function q({ nodes: d }) {
4599
- const R = d.length;
4600
- let M = new Set(d), N = /* @__PURE__ */ new Set(), x = 0;
4601
- for (; M.size; ) {
4602
- for (const S of M) {
4603
- S.height = x;
4604
- for (const { source: m } of S.targetLinks)
4598
+ function z({ nodes: g }) {
4599
+ const A = g.length;
4600
+ let S = new Set(g), N = /* @__PURE__ */ new Set(), x = 0;
4601
+ for (; S.size; ) {
4602
+ for (const T of S) {
4603
+ T.height = x;
4604
+ for (const { source: m } of T.targetLinks)
4605
4605
  N.add(m);
4606
4606
  }
4607
- if (++x > R) throw new Error("circular link");
4608
- M = N, N = /* @__PURE__ */ new Set();
4607
+ if (++x > A) throw new Error("circular link");
4608
+ S = N, N = /* @__PURE__ */ new Set();
4609
4609
  }
4610
4610
  }
4611
- function $({ nodes: d }) {
4612
- const R = ni(d, (x) => x.depth) + 1, M = (n - t - i) / (R - 1), N = new Array(R);
4613
- for (const x of d) {
4614
- const S = Math.max(0, Math.min(R - 1, Math.floor(c.call(null, x, R))));
4615
- x.layer = S, x.x0 = t + S * M, x.x1 = x.x0 + i, N[S] ? N[S].push(x) : N[S] = [x];
4611
+ function M({ nodes: g }) {
4612
+ const A = ni(g, (x) => x.depth) + 1, S = (n - t - i) / (A - 1), N = new Array(A);
4613
+ for (const x of g) {
4614
+ const T = Math.max(0, Math.min(A - 1, Math.floor(c.call(null, x, A))));
4615
+ x.layer = T, x.x0 = t + T * S, x.x1 = x.x0 + i, N[T] ? N[T].push(x) : N[T] = [x];
4616
4616
  }
4617
4617
  if (l) for (const x of N)
4618
4618
  x.sort(l);
4619
4619
  return N;
4620
4620
  }
4621
- function A(d) {
4622
- const R = Qu(d, (M) => (r - e - (M.length - 1) * s) / Fn(M, Vn));
4623
- for (const M of d) {
4621
+ function k(g) {
4622
+ const A = Qu(g, (S) => (r - e - (S.length - 1) * s) / Fn(S, Vn));
4623
+ for (const S of g) {
4624
4624
  let N = e;
4625
- for (const x of M) {
4626
- x.y0 = N, x.y1 = N + x.value * R, N = x.y1 + s;
4627
- for (const S of x.sourceLinks)
4628
- S.width = S.value * R;
4625
+ for (const x of S) {
4626
+ x.y0 = N, x.y1 = N + x.value * A, N = x.y1 + s;
4627
+ for (const T of x.sourceLinks)
4628
+ T.width = T.value * A;
4629
4629
  }
4630
- N = (r - N + s) / (M.length + 1);
4631
- for (let x = 0; x < M.length; ++x) {
4632
- const S = M[x];
4633
- S.y0 += N * (x + 1), S.y1 += N * (x + 1);
4630
+ N = (r - N + s) / (S.length + 1);
4631
+ for (let x = 0; x < S.length; ++x) {
4632
+ const T = S[x];
4633
+ T.y0 += N * (x + 1), T.y1 += N * (x + 1);
4634
4634
  }
4635
- L(M);
4635
+ C(S);
4636
4636
  }
4637
4637
  }
4638
- function O(d) {
4639
- const R = $(d);
4640
- s = Math.min(a, (r - e) / (ni(R, (M) => M.length) - 1)), A(R);
4641
- for (let M = 0; M < p; ++M) {
4642
- const N = Math.pow(0.99, M), x = Math.max(1 - N, (M + 1) / p);
4643
- J(R, N, x), F(R, N, x);
4638
+ function R(g) {
4639
+ const A = M(g);
4640
+ s = Math.min(a, (r - e) / (ni(A, (S) => S.length) - 1)), k(A);
4641
+ for (let S = 0; S < y; ++S) {
4642
+ const N = Math.pow(0.99, S), x = Math.max(1 - N, (S + 1) / y);
4643
+ Y(A, N, x), W(A, N, x);
4644
4644
  }
4645
4645
  }
4646
- function F(d, R, M) {
4647
- for (let N = 1, x = d.length; N < x; ++N) {
4648
- const S = d[N];
4649
- for (const m of S) {
4650
- let D = 0, P = 0;
4651
- for (const { source: Z, value: Q } of m.targetLinks) {
4652
- let z = Q * (m.layer - Z.layer);
4653
- D += w(Z, m) * z, P += z;
4646
+ function W(g, A, S) {
4647
+ for (let N = 1, x = g.length; N < x; ++N) {
4648
+ const T = g[N];
4649
+ for (const m of T) {
4650
+ let E = 0, L = 0;
4651
+ for (const { source: tt, value: G } of m.targetLinks) {
4652
+ let O = G * (m.layer - tt.layer);
4653
+ E += b(tt, m) * O, L += O;
4654
4654
  }
4655
- if (!(P > 0)) continue;
4656
- let W = (D / P - m.y0) * R;
4657
- m.y0 += W, m.y1 += W, C(m);
4655
+ if (!(L > 0)) continue;
4656
+ let B = (E / L - m.y0) * A;
4657
+ m.y0 += B, m.y1 += B, $(m);
4658
4658
  }
4659
- l === void 0 && S.sort(wn), G(S, M);
4659
+ l === void 0 && T.sort(wn), K(T, S);
4660
4660
  }
4661
4661
  }
4662
- function J(d, R, M) {
4663
- for (let N = d.length, x = N - 2; x >= 0; --x) {
4664
- const S = d[x];
4665
- for (const m of S) {
4666
- let D = 0, P = 0;
4667
- for (const { target: Z, value: Q } of m.sourceLinks) {
4668
- let z = Q * (Z.layer - m.layer);
4669
- D += E(m, Z) * z, P += z;
4662
+ function Y(g, A, S) {
4663
+ for (let N = g.length, x = N - 2; x >= 0; --x) {
4664
+ const T = g[x];
4665
+ for (const m of T) {
4666
+ let E = 0, L = 0;
4667
+ for (const { target: tt, value: G } of m.sourceLinks) {
4668
+ let O = G * (tt.layer - m.layer);
4669
+ E += P(m, tt) * O, L += O;
4670
4670
  }
4671
- if (!(P > 0)) continue;
4672
- let W = (D / P - m.y0) * R;
4673
- m.y0 += W, m.y1 += W, C(m);
4671
+ if (!(L > 0)) continue;
4672
+ let B = (E / L - m.y0) * A;
4673
+ m.y0 += B, m.y1 += B, $(m);
4674
4674
  }
4675
- l === void 0 && S.sort(wn), G(S, M);
4675
+ l === void 0 && T.sort(wn), K(T, S);
4676
4676
  }
4677
4677
  }
4678
- function G(d, R) {
4679
- const M = d.length >> 1, N = d[M];
4680
- B(d, N.y0 - s, M - 1, R), Y(d, N.y1 + s, M + 1, R), B(d, r, d.length - 1, R), Y(d, e, 0, R);
4678
+ function K(g, A) {
4679
+ const S = g.length >> 1, N = g[S];
4680
+ et(g, N.y0 - s, S - 1, A), q(g, N.y1 + s, S + 1, A), et(g, r, g.length - 1, A), q(g, e, 0, A);
4681
4681
  }
4682
- function Y(d, R, M, N) {
4683
- for (; M < d.length; ++M) {
4684
- const x = d[M], S = (R - x.y0) * N;
4685
- S > 1e-6 && (x.y0 += S, x.y1 += S), R = x.y1 + s;
4682
+ function q(g, A, S, N) {
4683
+ for (; S < g.length; ++S) {
4684
+ const x = g[S], T = (A - x.y0) * N;
4685
+ T > 1e-6 && (x.y0 += T, x.y1 += T), A = x.y1 + s;
4686
4686
  }
4687
4687
  }
4688
- function B(d, R, M, N) {
4689
- for (; M >= 0; --M) {
4690
- const x = d[M], S = (x.y1 - R) * N;
4691
- S > 1e-6 && (x.y0 -= S, x.y1 -= S), R = x.y0 - s;
4688
+ function et(g, A, S, N) {
4689
+ for (; S >= 0; --S) {
4690
+ const x = g[S], T = (x.y1 - A) * N;
4691
+ T > 1e-6 && (x.y0 -= T, x.y1 -= T), A = x.y0 - s;
4692
4692
  }
4693
4693
  }
4694
- function C({ sourceLinks: d, targetLinks: R }) {
4694
+ function $({ sourceLinks: g, targetLinks: A }) {
4695
4695
  if (u === void 0) {
4696
- for (const { source: { sourceLinks: M } } of R)
4697
- M.sort(ii);
4698
- for (const { target: { targetLinks: M } } of d)
4699
- M.sort(ri);
4696
+ for (const { source: { sourceLinks: S } } of A)
4697
+ S.sort(ii);
4698
+ for (const { target: { targetLinks: S } } of g)
4699
+ S.sort(ri);
4700
4700
  }
4701
4701
  }
4702
- function L(d) {
4702
+ function C(g) {
4703
4703
  if (u === void 0)
4704
- for (const { sourceLinks: R, targetLinks: M } of d)
4705
- R.sort(ii), M.sort(ri);
4704
+ for (const { sourceLinks: A, targetLinks: S } of g)
4705
+ A.sort(ii), S.sort(ri);
4706
4706
  }
4707
- function w(d, R) {
4708
- let M = d.y0 - (d.sourceLinks.length - 1) * s / 2;
4709
- for (const { target: N, width: x } of d.sourceLinks) {
4710
- if (N === R) break;
4711
- M += x + s;
4707
+ function b(g, A) {
4708
+ let S = g.y0 - (g.sourceLinks.length - 1) * s / 2;
4709
+ for (const { target: N, width: x } of g.sourceLinks) {
4710
+ if (N === A) break;
4711
+ S += x + s;
4712
4712
  }
4713
- for (const { source: N, width: x } of R.targetLinks) {
4714
- if (N === d) break;
4715
- M -= x;
4713
+ for (const { source: N, width: x } of A.targetLinks) {
4714
+ if (N === g) break;
4715
+ S -= x;
4716
4716
  }
4717
- return M;
4717
+ return S;
4718
4718
  }
4719
- function E(d, R) {
4720
- let M = R.y0 - (R.targetLinks.length - 1) * s / 2;
4721
- for (const { source: N, width: x } of R.targetLinks) {
4722
- if (N === d) break;
4723
- M += x + s;
4719
+ function P(g, A) {
4720
+ let S = A.y0 - (A.targetLinks.length - 1) * s / 2;
4721
+ for (const { source: N, width: x } of A.targetLinks) {
4722
+ if (N === g) break;
4723
+ S += x + s;
4724
4724
  }
4725
- for (const { target: N, width: x } of d.sourceLinks) {
4726
- if (N === R) break;
4727
- M -= x;
4725
+ for (const { target: N, width: x } of g.sourceLinks) {
4726
+ if (N === A) break;
4727
+ S -= x;
4728
4728
  }
4729
- return M;
4729
+ return S;
4730
4730
  }
4731
- return v;
4731
+ return _;
4732
4732
  }
4733
4733
  var ar = Math.PI, sr = 2 * ar, ie = 1e-6, sf = sr - ie;
4734
4734
  function or() {
@@ -4764,8 +4764,8 @@ or.prototype = ra.prototype = {
4764
4764
  else if (h > ie) if (!(Math.abs(u * o - c * l) > ie) || !i)
4765
4765
  this._ += "L" + (this._x1 = t) + "," + (this._y1 = e);
4766
4766
  else {
4767
- var f = n - a, p = r - s, v = o * o + c * c, j = f * f + p * p, K = Math.sqrt(v), T = Math.sqrt(h), q = i * Math.tan((ar - Math.acos((v + h - j) / (2 * K * T))) / 2), $ = q / T, A = q / K;
4768
- Math.abs($ - 1) > ie && (this._ += "L" + (t + $ * l) + "," + (e + $ * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * p) + "," + (this._x1 = t + A * o) + "," + (this._y1 = e + A * c);
4767
+ var f = n - a, y = r - s, _ = o * o + c * c, D = f * f + y * y, J = Math.sqrt(_), j = Math.sqrt(h), z = i * Math.tan((ar - Math.acos((_ + h - D) / (2 * J * j))) / 2), M = z / j, k = z / J;
4768
+ Math.abs(M - 1) > ie && (this._ += "L" + (t + M * l) + "," + (e + M * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * y) + "," + (this._x1 = t + k * o) + "," + (this._y1 = e + k * c);
4769
4769
  }
4770
4770
  },
4771
4771
  arc: function(t, e, n, r, i, a) {
@@ -4837,138 +4837,148 @@ const mf = "_sankeyEnergyLink_10fud_285", xf = "_sankeyLabel_10fud_323", ci = {
4837
4837
  sankeyLabel: xf
4838
4838
  };
4839
4839
  function Tf({ data: t, tooltipFormat: e }) {
4840
- const [n, r] = ft(null), [i, a] = ft(!1), [s, o] = ft(!1), c = Pt(!0), l = Pt(!0), u = Pt("data"), [h, f] = de(), { width: p, height: v } = f, j = Ne(n ? n.nodes.map(($) => $.name) : []);
4841
- vt(() => {
4842
- r(($) => {
4843
- const A = $ === null ? [] : $.nodes.map((F) => F.name), O = t.nodes.map((F) => F.name);
4844
- return c.current = O.every((F) => !A.includes(F)), $ !== null && (l.current = !1), u.current = "data", t;
4840
+ const [n, r] = ut(null), [i, a] = ut(!1), [s, o] = ut(!1), c = Pt(!0), l = Pt(!0), u = Pt("data"), [h, f] = de(), { width: y, height: _ } = f, D = Ne(n ? n.nodes.map((k) => k.name) : []);
4841
+ function J(k) {
4842
+ const R = /* @__PURE__ */ new Map(), W = [], Y = [], K = (q) => (R.has(q) || (R.set(q, W.length), W.push({ name: q })), R.get(q));
4843
+ for (const { source: q, target: et, value: $ } of k)
4844
+ Y.push({
4845
+ source: K(q),
4846
+ target: K(et),
4847
+ value: $
4848
+ });
4849
+ return { nodes: W, links: Y };
4850
+ }
4851
+ _t(() => {
4852
+ r((k) => {
4853
+ const R = J(t), W = k === null ? [] : k.nodes.map((K) => K.name), Y = R.nodes.map((K) => K.name);
4854
+ return c.current = Y.every((K) => !W.includes(K)), k !== null && (l.current = !1), u.current = "data", R;
4845
4855
  }), s && o(!1), i && a(!1);
4846
- }, [t]), vt(() => {
4847
- p !== 0 && v !== 0 && (u.current = "dimension");
4848
- }, [p, v]);
4849
- const K = p <= 768, T = 1e3, q = Et(
4850
- ($) => {
4856
+ }, [t]), _t(() => {
4857
+ y !== 0 && _ !== 0 && (u.current = "dimension");
4858
+ }, [y, _]);
4859
+ const j = y <= 768, z = 1e3, M = Et(
4860
+ (k) => {
4851
4861
  if (!n)
4852
4862
  return;
4853
- const A = p, O = v;
4854
- if (A === 0 || O === 0)
4863
+ const R = y, W = _;
4864
+ if (R === 0 || W === 0)
4855
4865
  return;
4856
- const F = { top: 30, right: 20, bottom: 20, left: 20 }, J = O - (F.top + F.bottom), G = A - (F.left + F.right), Y = J, B = G, C = n.links.map((y) => ({ ...y })), L = n.nodes.map((y) => ({ ...y }));
4857
- C.forEach(function(y) {
4858
- const g = n.nodes[y.source].name, _ = n.nodes[y.target].name, b = g + " → " + _;
4859
- y.sourceName = g, y.targetName = _, y.id = b;
4866
+ const Y = { top: 30, right: 20, bottom: 20, left: 20 }, K = W - (Y.top + Y.bottom), q = R - (Y.left + Y.right), et = K, $ = q, C = n.links.map((d) => ({ ...d })), b = n.nodes.map((d) => ({ ...d }));
4867
+ C.forEach(function(d) {
4868
+ const p = n.nodes[d.source].name, v = n.nodes[d.target].name, F = p + " → " + v;
4869
+ d.sourceName = p, d.targetName = v, d.id = F;
4860
4870
  });
4861
- const w = $.select("svg");
4862
- w.node();
4863
- const E = w.select(".plot-area").attr("transform", "translate(" + F.left + "," + F.top + ")"), d = Ye($).style("opacity", 0), R = (y) => {
4864
- const g = y.targetLinks?.reduce((b, U) => b + U.value, 0) ?? 0, _ = y.sourceLinks?.reduce((b, U) => b + U.value, 0) ?? 0;
4865
- return { enteringValue: g, exitingValue: _ };
4866
- }, N = af().nodeSort(
4867
- s ? (y, g) => {
4868
- const { enteringValue: _, exitingValue: b } = R(y), { enteringValue: U, exitingValue: tt } = R(g);
4869
- return Math.max(_, b) - Math.max(U, tt);
4871
+ const P = k.select("svg");
4872
+ P.node();
4873
+ const g = P.select(".plot-area").attr("transform", "translate(" + Y.left + "," + Y.top + ")"), A = Ye(k).style("opacity", 0), S = (d) => {
4874
+ const p = d.targetLinks?.reduce((F, Z) => F + Z.value, 0) ?? 0, v = d.sourceLinks?.reduce((F, Z) => F + Z.value, 0) ?? 0;
4875
+ return { enteringValue: p, exitingValue: v };
4876
+ }, x = af().nodeSort(
4877
+ s ? (d, p) => {
4878
+ const { enteringValue: v, exitingValue: F } = S(d), { enteringValue: Z, exitingValue: st } = S(p);
4879
+ return Math.max(v, F) - Math.max(Z, st);
4870
4880
  } : null
4871
4881
  ).linkSort(
4872
- i ? (y, g) => y.value - g.value : null
4873
- ).nodeWidth(B <= 540 ? 8 : B > 540 && B <= 768 ? 12 : 15).nodePadding(B <= 540 ? 5 : 8).extent([[0, 0], [B, Y]])({
4874
- nodes: L.map((y) => Object.assign({}, y)),
4875
- links: C.map((y) => Object.assign({}, y))
4876
- }), { nodes: x, links: S } = N;
4877
- E.selectAll("linearGradient").remove();
4878
- const m = E.selectAll("linearGradient").data(S).join("linearGradient").attr("id", (y, g) => g.toString()).attr("gradientUnits", "userSpaceOnUse").attr("x1", (y) => y.source.x0).attr("x2", (y) => y.target.x0);
4879
- m.append("stop").attr("offset", "0%").attr("stop-color", (y) => {
4880
- const g = j.current.findIndex((_) => _ === y.sourceName);
4881
- return xt(g, !1);
4882
- }), m.append("stop").attr("offset", "100%").attr("stop-color", (y) => {
4883
- const g = j.current.findIndex((_) => _ === y.targetName);
4884
- return xt(g, !1);
4882
+ i ? (d, p) => d.value - p.value : null
4883
+ ).nodeWidth($ <= 540 ? 8 : $ > 540 && $ <= 768 ? 12 : 15).nodePadding($ <= 540 ? 5 : 8).extent([[0, 0], [$, et]])({
4884
+ nodes: b.map((d) => Object.assign({}, d)),
4885
+ links: C.map((d) => Object.assign({}, d))
4886
+ }), { nodes: T, links: m } = x;
4887
+ g.selectAll("linearGradient").remove();
4888
+ const E = g.selectAll("linearGradient").data(m).join("linearGradient").attr("id", (d, p) => p.toString()).attr("gradientUnits", "userSpaceOnUse").attr("x1", (d) => d.source.x0).attr("x2", (d) => d.target.x0);
4889
+ E.append("stop").attr("offset", "0%").attr("stop-color", (d) => {
4890
+ const p = D.current.findIndex((v) => v === d.sourceName);
4891
+ return vt(p, !1);
4892
+ }), E.append("stop").attr("offset", "100%").attr("stop-color", (d) => {
4893
+ const p = D.current.findIndex((v) => v === d.targetName);
4894
+ return vt(p, !1);
4885
4895
  });
4886
- const D = (y) => {
4887
- const g = y.source, _ = y.target, b = Math.abs(_.depth - g.depth);
4888
- return B * 1.5 * b;
4889
- }, P = (y) => D(y) + " " + D(y), W = (y) => !c.current || u.current !== "data" && !l.current ? 0 : y.target.depth * T;
4890
- E.selectAll(".link").data(S, (y) => y.id).join(
4891
- (y) => y.append("path").attr("class", `link ${ci.sankeyEnergyLink}`).attr("d", li()).style("stroke", function(g) {
4892
- return `url(#${m.filter((U) => U.sourceName === g.sourceName && U.targetName === g.targetName).node()?.id})`;
4893
- }).attr("stroke-dasharray", P).attr("stroke-dashoffset", D).attr("stroke-width", (g) => Math.max(1, g.width)).transition().duration(T).delay(function(g) {
4894
- return c.current ? W(g) : T;
4896
+ const L = (d) => {
4897
+ const p = d.source, v = d.target, F = Math.abs(v.depth - p.depth);
4898
+ return $ * 1.5 * F;
4899
+ }, B = (d) => L(d) + " " + L(d), tt = (d) => !c.current || u.current === "sort node" || u.current === "sort link" || u.current !== "data" && !l.current ? 0 : d.target.depth * z;
4900
+ g.selectAll(".link").data(m, (d) => d.id).join(
4901
+ (d) => d.append("path").attr("class", `link ${ci.sankeyEnergyLink}`).attr("d", li()).style("stroke", function(p) {
4902
+ return `url(#${E.filter((Z) => Z.sourceName === p.sourceName && Z.targetName === p.targetName).node()?.id})`;
4903
+ }).attr("stroke-dasharray", B).attr("stroke-dashoffset", L).attr("stroke-width", (p) => Math.max(1, p.width)).transition().duration(z).delay(function(p) {
4904
+ return c.current ? tt(p) : z;
4895
4905
  }).attr("stroke-dashoffset", 0).on("end", function() {
4896
4906
  dt(this).attr("stroke-dasharray", "none");
4897
4907
  }),
4898
- (y) => (y.attr("stroke-width", (g) => Math.max(1, g.width || 0)).transition().duration(T).delay(W).attr("d", li()).attr("stroke-dashoffset", 0).on("end", function() {
4908
+ (d) => (d.attr("stroke-width", (p) => Math.max(1, p.width || 0)).transition().duration(z).delay(tt).attr("d", li()).attr("stroke-dashoffset", 0).on("end", function() {
4899
4909
  dt(this).attr("stroke-dasharray", "none");
4900
- }), y),
4901
- (y) => c.current ? y.remove() : y.transition().duration(T / 4).style("opacity", 0).remove()
4902
- ).on("mouseover", (y, g) => {
4903
- E.selectAll("path.link").filter((_) => _.id !== g.id).style("stroke", "#1f2937").style("stroke-opacity", 0.05), E.selectAll("text.label").filter((_) => {
4904
- const b = _;
4905
- return b.name !== g.sourceName && b.name !== g.targetName;
4906
- }).style("opacity", 0), d.style("opacity", 1), d.select("p.title").text(g.id + St(g.value, e)), d.select("p.top-label").style("display", "none"), d.select("p.bottom-label").style("display", "none");
4907
- }).on("mousemove", (y, g) => {
4908
- ei(y, d);
4909
- }).on("mouseout", (y, g) => {
4910
- d.style("opacity", 0), E.selectAll("path.link").style("stroke", function(_) {
4911
- const b = _;
4912
- return `url(#${m.filter((ot) => ot.sourceName === b.sourceName && ot.targetName === b.targetName).node()?.id})`;
4913
- }).style("stroke-opacity", 0.5).style("fill", "none").attr("class", `link ${nt.sankeyEnergyLink}`), E.selectAll("text.label").style("opacity", 1);
4910
+ }), d),
4911
+ (d) => c.current ? d.remove() : d.transition().duration(z / 4).style("opacity", 0).remove()
4912
+ ).on("mouseover", (d, p) => {
4913
+ g.selectAll("path.link").filter((v) => v.id !== p.id).style("stroke", "#1f2937").style("stroke-opacity", 0.05), g.selectAll("text.label").filter((v) => {
4914
+ const F = v;
4915
+ return F.name !== p.sourceName && F.name !== p.targetName;
4916
+ }).style("opacity", 0), A.style("opacity", 1), A.select("p.title").text(p.id + St(p.value, e)), A.select("p.top-label").style("display", "none"), A.select("p.bottom-label").style("display", "none");
4917
+ }).on("mousemove", (d, p) => {
4918
+ ei(d, A);
4919
+ }).on("mouseout", (d, p) => {
4920
+ A.style("opacity", 0), g.selectAll("path.link").style("stroke", function(v) {
4921
+ const F = v;
4922
+ return `url(#${E.filter((ct) => ct.sourceName === F.sourceName && ct.targetName === F.targetName).node()?.id})`;
4923
+ }).style("stroke-opacity", 0.5).style("fill", "none").attr("class", `link ${nt.sankeyEnergyLink}`), g.selectAll("text.label").style("opacity", 1);
4914
4924
  });
4915
- const Z = (y) => !c.current || y.depth === 0 || u.current !== "data" && !l.current ? 0 : y.depth * T + T / 4, Q = (y) => {
4916
- const { enteringValue: g, exitingValue: _ } = R(y);
4917
- return { nodeState: y.sourceLinks?.length === 0 && y.targetLinks?.length === 0 ? "stray node" : y.sourceLinks?.length === 0 ? "leaf node" : y.targetLinks?.length === 0 ? "source node" : g > _ ? "surplus" : g < _ ? "minus" : "balanced", enteringValue: g, exitingValue: _ };
4918
- }, z = (y) => {
4919
- const { nodeState: g, enteringValue: _, exitingValue: b } = Q(y);
4920
- return { enteringValue: _, exitingValue: b, nodeState: g, stateColor: g === "surplus" ? "#4ade80" : g === "minus" ? "#f87171" : "#e7e7e7" };
4925
+ const G = (d) => !c.current || d.depth === 0 || u.current === "sort node" || u.current === "sort link" || u.current !== "data" && !l.current ? 0 : d.depth * z + z / 4, O = (d) => {
4926
+ const { enteringValue: p, exitingValue: v } = S(d);
4927
+ return { nodeState: d.sourceLinks?.length === 0 && d.targetLinks?.length === 0 ? "stray node" : d.sourceLinks?.length === 0 ? "leaf node" : d.targetLinks?.length === 0 ? "source node" : p > v ? "surplus" : p < v ? "minus" : "balanced", enteringValue: p, exitingValue: v };
4928
+ }, X = (d) => {
4929
+ const { nodeState: p, enteringValue: v, exitingValue: F } = O(d);
4930
+ return { enteringValue: v, exitingValue: F, nodeState: p, stateColor: p === "surplus" ? "#4ade80" : p === "minus" ? "#f87171" : "#e7e7e7" };
4921
4931
  };
4922
- E.selectAll("rect.node").data(x, ((y) => y.name)).join(
4923
- (y) => y.append("rect").attr("class", `node ${nt.baseNode}`).attr("x", (g) => g.x0).attr("y", (g) => g.y0).attr("height", (g) => c.current ? Math.abs(g.y1 - g.y0) : 0).attr("width", (g) => c.current ? 0 : g.x1 - g.x0).attr("opacity", 0).attr("stroke-width", 2.5).transition().duration(T).delay(Z).attr("fill", (g) => {
4924
- const _ = j.current.findIndex((b) => b === g.name);
4925
- return xt(_, !1);
4926
- }).attr("opacity", 1).attr("width", function(g) {
4927
- return g.x1 - g.x0;
4932
+ g.selectAll("rect.node").data(T, ((d) => d.name)).join(
4933
+ (d) => d.append("rect").attr("class", `node ${nt.baseNode}`).attr("x", (p) => p.x0).attr("y", (p) => p.y0).attr("height", (p) => c.current ? Math.abs(p.y1 - p.y0) : 0).attr("width", (p) => c.current ? 0 : p.x1 - p.x0).attr("opacity", 0).attr("stroke-width", 2.5).transition().duration(z).delay(G).attr("fill", (p) => {
4934
+ const v = D.current.findIndex((F) => F === p.name);
4935
+ return vt(v, !1);
4936
+ }).attr("opacity", 1).attr("width", function(p) {
4937
+ return p.x1 - p.x0;
4928
4938
  }),
4929
4939
  void 0,
4930
- (y) => c.current ? y.remove() : y.transition().duration(T / 4).style("opacity", 0).remove()
4931
- ).on("mouseover", (y, g) => {
4932
- E.selectAll("path.link").filter((lt) => {
4933
- const ut = lt;
4934
- return !(ut.sourceName === g.name || ut.targetName === g.name);
4940
+ (d) => c.current ? d.remove() : d.transition().duration(z / 4).style("opacity", 0).remove()
4941
+ ).on("mouseover", (d, p) => {
4942
+ g.selectAll("path.link").filter((lt) => {
4943
+ const gt = lt;
4944
+ return !(gt.sourceName === p.name || gt.targetName === p.name);
4935
4945
  }).style("stroke", "#1f2937").style("stroke-opacity", 0.05);
4936
- const _ = g.sourceLinks?.map((lt) => lt.targetName) ?? [], U = [...g.targetLinks?.map((lt) => lt.sourceName) ?? [], ..._, g.name];
4937
- E.selectAll("text.label").filter((lt) => !U.includes(lt.name)).style("opacity", 0.0625);
4938
- const { enteringValue: tt, exitingValue: ot, nodeState: ct, stateColor: ht } = z(g);
4939
- d.style("opacity", 1), d.select("p.title").text(g.name + " :"), d.select("p.top-label").style("display", "block").text("in " + St(tt, e)), d.select("p.bottom-label").style("display", "block").text("out " + St(ot, e)), d.select("p.small-text").style("display", "block").text(`${ct}`).style("color", `${ht}`);
4940
- }).on("mousemove", (y, g) => {
4941
- ei(y, d);
4942
- }).on("mouseout", (y, g) => {
4943
- d.style("opacity", 0), d.select("p.small-text").style("display", "none"), E.selectAll("path.link").style("stroke", function(tt) {
4944
- const ot = tt;
4945
- return `url(#${m.filter((lt) => lt.sourceName === ot.sourceName && lt.targetName === ot.targetName).node()?.id})`;
4946
+ const v = p.sourceLinks?.map((lt) => lt.targetName) ?? [], Z = [...p.targetLinks?.map((lt) => lt.sourceName) ?? [], ...v, p.name];
4947
+ g.selectAll("text.label").filter((lt) => !Z.includes(lt.name)).style("opacity", 0.0625);
4948
+ const { enteringValue: st, exitingValue: ct, nodeState: ht, stateColor: ft } = X(p);
4949
+ A.style("opacity", 1), A.select("p.title").text(p.name + " :"), A.select("p.top-label").style("display", "block").text("in " + St(st, e)), A.select("p.bottom-label").style("display", "block").text("out " + St(ct, e)), A.select("p.small-text").style("display", "block").text(`${ht}`).style("color", `${ft}`);
4950
+ }).on("mousemove", (d, p) => {
4951
+ ei(d, A);
4952
+ }).on("mouseout", (d, p) => {
4953
+ A.style("opacity", 0), A.select("p.small-text").style("display", "none"), g.selectAll("path.link").style("stroke", function(st) {
4954
+ const ct = st;
4955
+ return `url(#${E.filter((lt) => lt.sourceName === ct.sourceName && lt.targetName === ct.targetName).node()?.id})`;
4946
4956
  }).style("stroke-opacity", 0.5).style("fill", "none").attr("class", `link ${nt.sankeyEnergyLink}`);
4947
- const _ = g.sourceLinks?.map((tt) => tt.targetName) ?? [], U = [...g.targetLinks?.map((tt) => tt.sourceName) ?? [], ..._, g.name];
4948
- E.selectAll("text.label").filter((tt) => !U.includes(tt.name)).style("opacity", 1);
4949
- }).transition().duration(T).delay(Z).attr("stroke-width", K ? 2 : 2.5).style("stroke", function(y) {
4950
- const { stateColor: g, nodeState: _ } = z(y);
4951
- return _ === "surplus" || _ === "minus" ? g : "#52525b";
4952
- }).attr("opacity", 1).attr("x", (y) => y.x0).attr("y", (y) => y.y0).attr("height", (y) => Math.abs(y.y1 - y.y0)).attr("width", (y) => y.x1 - y.x0).attr("fill", (y) => {
4953
- const g = j.current.findIndex((_) => _ === y.name);
4954
- return xt(g, !1);
4955
- }), E.selectAll("text.label").data(x, (y) => y.name).join(
4956
- (y) => y.append("text").attr("class", `label ${ci.sankeyLabel}`).attr("x", (g) => g.x0 < B / 2 ? g.x1 + 6 : g.x0 - 6).attr("y", (g) => (g.y1 + g.y0) / 2).attr("dy", "0.35em").attr("text-anchor", (g) => g.x0 < B / 2 ? "start" : "end").style("font-size", B < 648 ? "12px" : "16px").style("font-weight", B < 648 ? "normal" : "bold").style("stroke-width", B < 648 ? "0px" : "0.25px").style("stroke", "#eff1f4").text((g) => g.name).attr("opacity", 0),
4957
+ const v = p.sourceLinks?.map((st) => st.targetName) ?? [], Z = [...p.targetLinks?.map((st) => st.sourceName) ?? [], ...v, p.name];
4958
+ g.selectAll("text.label").filter((st) => !Z.includes(st.name)).style("opacity", 1);
4959
+ }).transition().duration(z).delay(G).attr("stroke-width", j ? 2 : 2.5).style("stroke", function(d) {
4960
+ const { stateColor: p, nodeState: v } = X(d);
4961
+ return v === "surplus" || v === "minus" ? p : "#52525b";
4962
+ }).attr("opacity", 1).attr("x", (d) => d.x0).attr("y", (d) => d.y0).attr("height", (d) => Math.abs(d.y1 - d.y0)).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => {
4963
+ const p = D.current.findIndex((v) => v === d.name);
4964
+ return vt(p, !1);
4965
+ }), g.selectAll("text.label").data(T, (d) => d.name).join(
4966
+ (d) => d.append("text").attr("class", `label ${ci.sankeyLabel}`).attr("x", (p) => p.x0 < $ / 2 ? p.x1 + 6 : p.x0 - 6).attr("y", (p) => (p.y1 + p.y0) / 2).attr("dy", "0.35em").attr("text-anchor", (p) => p.x0 < $ / 2 ? "start" : "end").style("font-size", $ < 648 ? "12px" : "16px").style("font-weight", $ < 648 ? "normal" : "bold").style("stroke-width", $ < 648 ? "0px" : "0.25px").style("stroke", "#eff1f4").text((p) => p.name).attr("opacity", 0),
4957
4967
  void 0,
4958
- (y) => y.remove()
4959
- ).style("font-size", B < 648 ? "12px" : "16px").style("font-weight", B < 648 ? "normal" : "bold").style("stroke-width", B < 648 ? "0px" : "0.25px").transition().duration(T).delay(Z).attr("x", (y) => y.x0 < B / 2 ? y.x1 + 6 : y.x0 - 6).attr("y", (y) => (y.y1 + y.y0) / 2).attr("dy", "0.35em").attr("text-anchor", (y) => y.x0 < B / 2 ? "start" : "end").attr("opacity", 1);
4968
+ (d) => d.remove()
4969
+ ).style("font-size", $ < 648 ? "12px" : "16px").style("font-weight", $ < 648 ? "normal" : "bold").style("stroke-width", $ < 648 ? "0px" : "0.25px").transition().duration(z).delay(G).attr("x", (d) => d.x0 < $ / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", "0.35em").attr("text-anchor", (d) => d.x0 < $ / 2 ? "start" : "end").attr("opacity", 1);
4960
4970
  },
4961
- [n, i, s, p, v, e]
4971
+ [n, i, s, y, _, e]
4962
4972
  );
4963
4973
  return /* @__PURE__ */ H.jsx(
4964
4974
  "div",
4965
4975
  {
4966
4976
  ref: h,
4967
- style: { width: p, height: v, display: "flex", flexDirection: "column" },
4977
+ style: { width: y, height: _, display: "flex", flexDirection: "column" },
4968
4978
  children: /* @__PURE__ */ H.jsxs(
4969
4979
  "div",
4970
4980
  {
4971
- ref: q,
4981
+ ref: M,
4972
4982
  className: `${nt["fill-container"]}`,
4973
4983
  style: { display: "flex", flexDirection: "column", position: "relative" },
4974
4984
  children: [
@@ -4976,7 +4986,7 @@ function Tf({ data: t, tooltipFormat: e }) {
4976
4986
  "svg",
4977
4987
  {
4978
4988
  className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
4979
- viewBox: `0 0 ${p} ${v}`,
4989
+ viewBox: `0 0 ${y} ${_}`,
4980
4990
  children: /* @__PURE__ */ H.jsx("g", { className: "plot-area" })
4981
4991
  }
4982
4992
  ),
@@ -5002,9 +5012,9 @@ function Tf({ data: t, tooltipFormat: e }) {
5002
5012
  type: "checkbox",
5003
5013
  className: nt["controls-checkbox"],
5004
5014
  checked: i,
5005
- onChange: ($) => {
5006
- const A = $.target.checked;
5007
- A && (u.current = "sort link"), a(A);
5015
+ onChange: (k) => {
5016
+ const R = k.target.checked;
5017
+ R && (u.current = "sort link"), a(R);
5008
5018
  }
5009
5019
  }
5010
5020
  ),
@@ -5023,9 +5033,9 @@ function Tf({ data: t, tooltipFormat: e }) {
5023
5033
  type: "checkbox",
5024
5034
  className: nt["controls-checkbox"],
5025
5035
  checked: s,
5026
- onChange: ($) => {
5027
- const A = $.target.checked;
5028
- A && (u.current = "sort node"), o(A);
5036
+ onChange: (k) => {
5037
+ const R = k.target.checked;
5038
+ R && (u.current = "sort node"), o(R);
5029
5039
  }
5030
5040
  }
5031
5041
  ),
@@ -5050,163 +5060,163 @@ const vf = "_node_dqcsq_1", _f = "_circle_pack_label_dqcsq_27", ne = {
5050
5060
  "node--root": "_node--root_dqcsq_73"
5051
5061
  };
5052
5062
  function Rf({ data: t, tooltipFormat: e }) {
5053
- const [n, r] = ft(null), [i, a] = ft({ name: "", value: 0 }), [s, o] = ft({ name: "", value: 0 }), c = Pt(!0), [l, u] = de(), { width: h, height: f } = u, p = Pt(null), v = Pt(null);
5054
- vt(() => {
5055
- if (!v.current || !p.current) return;
5056
- const T = p.current;
5057
- function q(A, O) {
5058
- const F = Math.max(A.length, O.length);
5059
- return function(J) {
5060
- let G = "";
5061
- for (let Y = 0; Y < F; Y++)
5062
- G += J < 0.5 ? A[Y] ?? "" : O[Y] ?? "";
5063
- return G;
5063
+ const [n, r] = ut(null), [i, a] = ut({ name: "", value: 0 }), [s, o] = ut({ name: "", value: 0 }), c = Pt(!0), [l, u] = de(), { width: h, height: f } = u, y = Pt(null), _ = Pt(null);
5064
+ _t(() => {
5065
+ if (!_.current || !y.current) return;
5066
+ const j = y.current;
5067
+ function z(k, R) {
5068
+ const W = Math.max(k.length, R.length);
5069
+ return function(Y) {
5070
+ let K = "";
5071
+ for (let q = 0; q < W; q++)
5072
+ K += Y < 0.5 ? k[q] ?? "" : R[q] ?? "";
5073
+ return K;
5064
5074
  };
5065
5075
  }
5066
- dt(T).transition().duration(250).tween("text", function() {
5067
- const A = q(s.name, i.name);
5068
- return function(O) {
5069
- T.textContent = A(O);
5076
+ dt(j).transition().duration(250).tween("text", function() {
5077
+ const k = z(s.name, i.name);
5078
+ return function(R) {
5079
+ j.textContent = k(R);
5070
5080
  };
5071
5081
  });
5072
- const $ = v.current;
5073
- dt($).transition().duration(250).ease(tc).tween("text", function() {
5074
- const A = Nt(s.value, i.value);
5075
- return function(O) {
5076
- $.textContent = St(Math.round(A(O)), e).toLocaleString();
5082
+ const M = _.current;
5083
+ dt(M).transition().duration(250).ease(tc).tween("text", function() {
5084
+ const k = Nt(s.value, i.value);
5085
+ return function(R) {
5086
+ M.textContent = St(Math.round(k(R)), e).toLocaleString();
5077
5087
  };
5078
5088
  });
5079
- }, [i, s]), vt(() => {
5080
- r((T) => (T !== null && (c.current = !1), t));
5089
+ }, [i, s]), _t(() => {
5090
+ r((j) => (j !== null && (c.current = !1), t));
5081
5091
  }, [t]);
5082
- const j = 1e3, K = Et(
5083
- (T) => {
5092
+ const D = 1e3, J = Et(
5093
+ (j) => {
5084
5094
  if (!n)
5085
5095
  return;
5086
- const q = h, $ = f, A = 12, O = 1.5;
5087
- if (q === 0 || $ === 0)
5096
+ const z = h, M = f, k = 12, R = 1.5;
5097
+ if (z === 0 || M === 0)
5088
5098
  return;
5089
- const F = 25, J = $ - F * 2, G = q - F * 2, Y = J, B = G, C = { name: "branches", children: n }, L = Math.min(B, Y), w = pr(C).sum(function(g) {
5090
- return g.value;
5091
- }).sort(function(g, _) {
5092
- return g.value - _.value;
5093
- }), E = Qc().size([L - 20, L - 20]).padding(2);
5094
- let d = w, R = 1, M = 1;
5095
- const N = E(w), x = N.descendants(), S = [N.x, N.y, N.r * 2 + F], m = dt("#tooltip").style("opacity", 0), D = T.select("svg");
5096
- D.node();
5097
- const P = D.select(".plot-area").attr("transform", "translate(" + q / 2 + "," + $ / 2 + ")"), W = ce().domain([-1, 2]).range(["hsl(152,80%,80%)", "hsl(228,30%,40%)"]).interpolate(Yo), Z = P.selectAll("circle").data(x, (g) => g.data.name).join(
5098
- (g) => g.append("circle").attr("class", function(_) {
5099
- return _.parent ? _.children ? ne.node : `${ne.node} ${ne["node--leaf"]}` : `${ne.node} ${ne["node--root"]}`;
5100
- }).style("fill", function(_) {
5101
- return _.children ? W(_.depth) : "#f0fdfa";
5102
- }).style("cursor", "pointer").transition().duration(j).attr("r", function(_) {
5103
- const b = L / S[2];
5104
- return _.r * b;
5105
- }).attr("cx", function(_) {
5106
- const b = L / S[2];
5107
- return (_.x - S[0]) * b;
5108
- }).attr("cy", function(_) {
5109
- const b = L / S[2];
5110
- return (_.y - S[1]) * b;
5111
- }).style("stroke", "#737373").style("stroke-width", O * M).style("fill", function(_) {
5112
- return _.children ? W(_.depth) : "#f0fdfa";
5099
+ const W = 25, Y = M - W * 2, K = z - W * 2, q = Y, et = K, $ = { name: "branches", children: n }, C = Math.min(et, q), b = pr($).sum(function(d) {
5100
+ return d.value;
5101
+ }).sort(function(d, p) {
5102
+ return d.value - p.value;
5103
+ }), P = Qc().size([C - 20, C - 20]).padding(2);
5104
+ let g = b, A = 1, S = 1;
5105
+ const N = P(b), x = N.descendants(), T = [N.x, N.y, N.r * 2 + W], m = dt("#tooltip").style("opacity", 0), E = j.select("svg");
5106
+ E.node();
5107
+ const L = E.select(".plot-area").attr("transform", "translate(" + z / 2 + "," + M / 2 + ")"), B = ce().domain([-1, 2]).range(["hsl(152,80%,80%)", "hsl(228,30%,40%)"]).interpolate(Yo), tt = L.selectAll("circle").data(x, (d) => d.data.name).join(
5108
+ (d) => d.append("circle").attr("class", function(p) {
5109
+ return p.parent ? p.children ? ne.node : `${ne.node} ${ne["node--leaf"]}` : `${ne.node} ${ne["node--root"]}`;
5110
+ }).style("fill", function(p) {
5111
+ return p.children ? B(p.depth) : "#f0fdfa";
5112
+ }).style("cursor", "pointer").transition().duration(D).attr("r", function(p) {
5113
+ const v = C / T[2];
5114
+ return p.r * v;
5115
+ }).attr("cx", function(p) {
5116
+ const v = C / T[2];
5117
+ return (p.x - T[0]) * v;
5118
+ }).attr("cy", function(p) {
5119
+ const v = C / T[2];
5120
+ return (p.y - T[1]) * v;
5121
+ }).style("stroke", "#737373").style("stroke-width", R * S).style("fill", function(p) {
5122
+ return p.children ? B(p.depth) : "#f0fdfa";
5113
5123
  }),
5114
- (g) => g.transition().duration(j).attr("cx", function(_) {
5115
- const b = L / S[2];
5116
- return (_.x - S[0]) * b;
5117
- }).attr("cy", function(_) {
5118
- const b = L / S[2];
5119
- return (_.y - S[1]) * b;
5120
- }).attr("r", function(_) {
5121
- const b = L / S[2];
5122
- return _.r * b;
5123
- }).style("stroke", function(_) {
5124
+ (d) => d.transition().duration(D).attr("cx", function(p) {
5125
+ const v = C / T[2];
5126
+ return (p.x - T[0]) * v;
5127
+ }).attr("cy", function(p) {
5128
+ const v = C / T[2];
5129
+ return (p.y - T[1]) * v;
5130
+ }).attr("r", function(p) {
5131
+ const v = C / T[2];
5132
+ return p.r * v;
5133
+ }).style("stroke", function(p) {
5124
5134
  return "#737373";
5125
- }).style("stroke-width", O * M).style("fill", function(_) {
5126
- return _.children ? W(_.depth) : "#f0fdfa";
5135
+ }).style("stroke-width", R * S).style("fill", function(p) {
5136
+ return p.children ? B(p.depth) : "#f0fdfa";
5127
5137
  }),
5128
- (g) => g.transition().duration(j).style("opacity", 0).remove()
5129
- ).on("mouseover", function(g, _) {
5130
- d.parent === _ ? Q.filter(function(b) {
5131
- return b.parent === d || this.style.display === "inline";
5132
- }).style("font-size", A * M).style("fill-opacity", function(b) {
5133
- return b.parent === d ? 1 : 0;
5134
- }).style("display", function(b) {
5135
- return b.parent === d ? "inline" : "none";
5136
- }) : _ === d ? Q.filter(function(b) {
5137
- return b.parent === d || this.style.display === "inline";
5138
- }).style("font-size", A * M).style("fill-opacity", function(b) {
5139
- return b.parent === d ? 1 : 0;
5140
- }).style("display", function(b) {
5141
- return b.parent === d ? "inline" : "none";
5142
- }) : (Q.filter(function(b) {
5143
- return b.data.name != _.data.name;
5144
- }).style("fill-opacity", 0).style("display", "none"), Q.filter(function(b) {
5145
- return b.data.name === _.data.name;
5146
- }).style("fill-opacity", 1).style("display", "inline")), dt(this).style("stroke"), _ != w && dt(this).style("stroke-width", O * M * 2.5).style("stroke", "#e4e4e7"), m.transition().duration(250).style("opacity", 1), a((b) => (o(b), { name: _.data.name === "branches" ? "Total" : _.data.name, value: _.value ? _.value : 0 }));
5147
- }).on("mouseout", function(g, _) {
5148
- Q.filter(function(b) {
5149
- return b.parent === d || this.style.display === "inline";
5150
- }).style("fill-opacity", function(b) {
5151
- return b.parent === d ? 1 : 0;
5152
- }).style("display", function(b) {
5153
- return b.parent === d ? "inline" : "none";
5154
- }), dt(this).style("stroke-width", O * M).style("stroke", function(b) {
5138
+ (d) => d.transition().duration(D).style("opacity", 0).remove()
5139
+ ).on("mouseover", function(d, p) {
5140
+ g.parent === p ? G.filter(function(v) {
5141
+ return v.parent === g || this.style.display === "inline";
5142
+ }).style("font-size", k * S).style("fill-opacity", function(v) {
5143
+ return v.parent === g ? 1 : 0;
5144
+ }).style("display", function(v) {
5145
+ return v.parent === g ? "inline" : "none";
5146
+ }) : p === g ? G.filter(function(v) {
5147
+ return v.parent === g || this.style.display === "inline";
5148
+ }).style("font-size", k * S).style("fill-opacity", function(v) {
5149
+ return v.parent === g ? 1 : 0;
5150
+ }).style("display", function(v) {
5151
+ return v.parent === g ? "inline" : "none";
5152
+ }) : (G.filter(function(v) {
5153
+ return v.data.name != p.data.name;
5154
+ }).style("fill-opacity", 0).style("display", "none"), G.filter(function(v) {
5155
+ return v.data.name === p.data.name;
5156
+ }).style("fill-opacity", 1).style("display", "inline")), dt(this).style("stroke"), p != b && dt(this).style("stroke-width", R * S * 2.5).style("stroke", "#e4e4e7"), m.transition().duration(250).style("opacity", 1), a((v) => (o(v), { name: p.data.name === "branches" ? "Total" : p.data.name, value: p.value ? p.value : 0 }));
5157
+ }).on("mouseout", function(d, p) {
5158
+ G.filter(function(v) {
5159
+ return v.parent === g || this.style.display === "inline";
5160
+ }).style("fill-opacity", function(v) {
5161
+ return v.parent === g ? 1 : 0;
5162
+ }).style("display", function(v) {
5163
+ return v.parent === g ? "inline" : "none";
5164
+ }), dt(this).style("stroke-width", R * S).style("stroke", function(v) {
5155
5165
  return "#737373";
5156
5166
  }), m.transition().duration(250).style("opacity", 0);
5157
- }).on("click", function(g, _) {
5158
- if (_ === w) {
5159
- y();
5167
+ }).on("click", function(d, p) {
5168
+ if (p === b) {
5169
+ X();
5160
5170
  return;
5161
5171
  }
5162
- d != _ ? z(_) : y(), Z.style("stroke-width", O * M), g.stopPropagation();
5163
- }), Q = P.selectAll("text").data(x, function(g) {
5164
- return g.data.name;
5172
+ g != p ? O(p) : X(), tt.style("stroke-width", R * S), d.stopPropagation();
5173
+ }), G = L.selectAll("text").data(x, function(d) {
5174
+ return d.data.name;
5165
5175
  }).join(
5166
- (g) => g.append("text").attr("class", ne.circle_pack_label).text(function(_) {
5167
- return _.data.name;
5168
- }).style("font-size", 12).style("text-anchor", "middle").style("fill-opacity", 0).style("stroke-opacity", 0).style("display", "none").style("pointer-events", "none").style("text-shadow", "0 1px 0 lightblue, 1px 0 0 lightblue, -1px 0 0 lightblue, 0 -1px 0 lightblue").transition().duration(j).attr("transform", function(_) {
5169
- const b = L / S[2];
5170
- return "translate(" + (_.x - S[0]) * b + "," + (_.y - S[1]) * b + ")";
5171
- }).style("fill-opacity", function(_) {
5172
- return _.parent === w ? 1 : 0;
5173
- }).style("display", function(_) {
5174
- return _.parent === w ? "inline" : "none";
5176
+ (d) => d.append("text").attr("class", ne.circle_pack_label).text(function(p) {
5177
+ return p.data.name;
5178
+ }).style("font-size", 12).style("text-anchor", "middle").style("fill-opacity", 0).style("stroke-opacity", 0).style("display", "none").style("pointer-events", "none").style("text-shadow", "0 1px 0 lightblue, 1px 0 0 lightblue, -1px 0 0 lightblue, 0 -1px 0 lightblue").transition().duration(D).attr("transform", function(p) {
5179
+ const v = C / T[2];
5180
+ return "translate(" + (p.x - T[0]) * v + "," + (p.y - T[1]) * v + ")";
5181
+ }).style("fill-opacity", function(p) {
5182
+ return p.parent === b ? 1 : 0;
5183
+ }).style("display", function(p) {
5184
+ return p.parent === b ? "inline" : "none";
5175
5185
  }),
5176
- (g) => g.attr("class", ne.circle_pack_label).transition().duration(j).attr("transform", function(_) {
5177
- const b = L / S[2];
5178
- return "translate(" + (_.x - S[0]) * b + "," + (_.y - S[1]) * b + ")";
5179
- }).style("fill-opacity", function(_) {
5180
- return _.parent === w ? 1 : 0;
5181
- }).style("display", function(_) {
5182
- return _.parent === w ? "inline" : "none";
5186
+ (d) => d.attr("class", ne.circle_pack_label).transition().duration(D).attr("transform", function(p) {
5187
+ const v = C / T[2];
5188
+ return "translate(" + (p.x - T[0]) * v + "," + (p.y - T[1]) * v + ")";
5189
+ }).style("fill-opacity", function(p) {
5190
+ return p.parent === b ? 1 : 0;
5191
+ }).style("display", function(p) {
5192
+ return p.parent === b ? "inline" : "none";
5183
5193
  }),
5184
- (g) => g.transition().duration(j).style("opacity", 0).remove()
5194
+ (d) => d.transition().duration(D).style("opacity", 0).remove()
5185
5195
  );
5186
- Q.raise();
5187
- function z(g) {
5188
- d = g;
5189
- const _ = L / 2 - F, b = q / 2, U = $ / 2, tt = L / S[2], ot = (
5196
+ G.raise();
5197
+ function O(d) {
5198
+ g = d;
5199
+ const p = C / 2 - W, v = z / 2, F = M / 2, Z = C / T[2], st = (
5190
5200
  /*currentData==="---"?Math.max((d.r * k),0.25):*/
5191
- g.r * tt
5201
+ d.r * Z
5192
5202
  );
5193
- M = ot / _, R = _ / ot;
5194
- const ct = (g.x - S[0]) * tt, ht = b - ct * R, lt = (g.y - S[0]) * tt, ut = U - lt * R;
5195
- P.transition().duration(1e3).attr("transform", "translate(" + ht + "," + ut + ")scale(" + R + ")"), Q.style("font-size", A * M + "px").filter(function(_t) {
5196
- return _t.parent === d || this.style.display === "inline";
5197
- }).style("fill-opacity", function(_t) {
5198
- return _t.parent === d ? 1 : 0;
5199
- }).style("display", function(_t) {
5200
- return _t.parent === d ? "inline" : "none";
5203
+ S = st / p, A = p / st;
5204
+ const ct = (d.x - T[0]) * Z, ht = v - ct * A, ft = (d.y - T[0]) * Z, lt = F - ft * A;
5205
+ L.transition().duration(1e3).attr("transform", "translate(" + ht + "," + lt + ")scale(" + A + ")"), G.style("font-size", k * S + "px").filter(function(gt) {
5206
+ return gt.parent === g || this.style.display === "inline";
5207
+ }).style("fill-opacity", function(gt) {
5208
+ return gt.parent === g ? 1 : 0;
5209
+ }).style("display", function(gt) {
5210
+ return gt.parent === g ? "inline" : "none";
5201
5211
  });
5202
5212
  }
5203
- function y() {
5204
- P.transition().duration(1e3).attr("transform", "translate(" + q / 2 + ", " + $ / 2 + ")scale(1)"), d = w, R = 1, M = 1, Q.style("font-size", A * M + "px").filter(function(g) {
5205
- return g.parent === d || this.style.display === "inline";
5206
- }).style("fill-opacity", function(g) {
5207
- return g.parent === d ? 1 : 0;
5208
- }).style("display", function(g) {
5209
- return g.parent === d ? "inline" : "none";
5213
+ function X() {
5214
+ L.transition().duration(1e3).attr("transform", "translate(" + z / 2 + ", " + M / 2 + ")scale(1)"), g = b, A = 1, S = 1, G.style("font-size", k * S + "px").filter(function(d) {
5215
+ return d.parent === g || this.style.display === "inline";
5216
+ }).style("fill-opacity", function(d) {
5217
+ return d.parent === g ? 1 : 0;
5218
+ }).style("display", function(d) {
5219
+ return d.parent === g ? "inline" : "none";
5210
5220
  });
5211
5221
  }
5212
5222
  },
@@ -5220,7 +5230,7 @@ function Rf({ data: t, tooltipFormat: e }) {
5220
5230
  children: /* @__PURE__ */ H.jsxs(
5221
5231
  "div",
5222
5232
  {
5223
- ref: K,
5233
+ ref: J,
5224
5234
  className: `${nt["fill-container"]}`,
5225
5235
  style: { display: "flex", flexDirection: "column", position: "relative" },
5226
5236
  children: [
@@ -5247,8 +5257,8 @@ function Rf({ data: t, tooltipFormat: e }) {
5247
5257
  gap: 2
5248
5258
  },
5249
5259
  children: [
5250
- /* @__PURE__ */ H.jsx("p", { ref: p, id: "name", children: "Test tooltip" }),
5251
- /* @__PURE__ */ H.jsx("p", { ref: v, id: "value", children: "Test tooltip" })
5260
+ /* @__PURE__ */ H.jsx("p", { ref: y, id: "name", children: "Test tooltip" }),
5261
+ /* @__PURE__ */ H.jsx("p", { ref: _, id: "value", children: "Test tooltip" })
5252
5262
  ]
5253
5263
  }
5254
5264
  )