@figtreejs/core 0.0.1-beta.0 → 0.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,31 +1,31 @@
1
1
  import { jsx as $, jsxs as Ie } from "react/jsx-runtime";
2
2
  import * as ti from "react";
3
- import { useState as Oa, useRef as Xe, useEffect as an, useLayoutEffect as as, forwardRef as os, useCallback as ss, useContext as H, useMemo as fn, createContext as jn } from "react";
3
+ import { useState as Ua, useRef as Xe, useEffect as an, useLayoutEffect as as, forwardRef as os, useCallback as ss, useContext as H, useMemo as fn, createContext as jn } from "react";
4
4
  import { unstable_batchedUpdates as us } from "react-dom";
5
- var ni = sn(), A = (e) => on(e, ni), ri = sn();
6
- A.write = (e) => on(e, ri);
5
+ var ni = sn(), E = (e) => on(e, ni), ri = sn();
6
+ E.write = (e) => on(e, ri);
7
7
  var qn = sn();
8
- A.onStart = (e) => on(e, qn);
8
+ E.onStart = (e) => on(e, qn);
9
9
  var ii = sn();
10
- A.onFrame = (e) => on(e, ii);
10
+ E.onFrame = (e) => on(e, ii);
11
11
  var ai = sn();
12
- A.onFinish = (e) => on(e, ai);
12
+ E.onFinish = (e) => on(e, ai);
13
13
  var ut = [];
14
- A.setTimeout = (e, t) => {
15
- const n = A.now() + t, r = () => {
14
+ E.setTimeout = (e, t) => {
15
+ const n = E.now() + t, r = () => {
16
16
  const a = ut.findIndex((o) => o.cancel == r);
17
17
  ~a && ut.splice(a, 1), Oe -= ~a ? 1 : 0;
18
18
  }, i = { time: n, handler: e, cancel: r };
19
- return ut.splice(za(n), 0, i), Oe += 1, Ba(), i;
19
+ return ut.splice(Oa(n), 0, i), Oe += 1, za(), i;
20
20
  };
21
- var za = (e) => ~(~ut.findIndex((t) => t.time > e) || ~ut.length);
22
- A.cancel = (e) => {
21
+ var Oa = (e) => ~(~ut.findIndex((t) => t.time > e) || ~ut.length);
22
+ E.cancel = (e) => {
23
23
  qn.delete(e), ii.delete(e), ai.delete(e), ni.delete(e), ri.delete(e);
24
24
  };
25
- A.sync = (e) => {
26
- kr = !0, A.batchedUpdates(e), kr = !1;
25
+ E.sync = (e) => {
26
+ kr = !0, E.batchedUpdates(e), kr = !1;
27
27
  };
28
- A.throttle = (e) => {
28
+ E.throttle = (e) => {
29
29
  let t;
30
30
  function n() {
31
31
  try {
@@ -35,7 +35,7 @@ A.throttle = (e) => {
35
35
  }
36
36
  }
37
37
  function r(...i) {
38
- t = i, A.onStart(n);
38
+ t = i, E.onStart(n);
39
39
  }
40
40
  return r.handler = e, r.cancel = () => {
41
41
  qn.delete(n), t = null;
@@ -46,34 +46,34 @@ var oi = typeof window < "u" ? window.requestAnimationFrame : (
46
46
  (() => {
47
47
  })
48
48
  );
49
- A.use = (e) => oi = e;
50
- A.now = typeof performance < "u" ? () => performance.now() : Date.now;
51
- A.batchedUpdates = (e) => e();
52
- A.catch = console.error;
53
- A.frameLoop = "always";
54
- A.advance = () => {
55
- A.frameLoop !== "demand" ? console.warn(
49
+ E.use = (e) => oi = e;
50
+ E.now = typeof performance < "u" ? () => performance.now() : Date.now;
51
+ E.batchedUpdates = (e) => e();
52
+ E.catch = console.error;
53
+ E.frameLoop = "always";
54
+ E.advance = () => {
55
+ E.frameLoop !== "demand" ? console.warn(
56
56
  "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"
57
- ) : ja();
57
+ ) : Va();
58
58
  };
59
59
  var Ue = -1, Oe = 0, kr = !1;
60
60
  function on(e, t) {
61
- kr ? (t.delete(e), e(0)) : (t.add(e), Ba());
61
+ kr ? (t.delete(e), e(0)) : (t.add(e), za());
62
62
  }
63
- function Ba() {
64
- Ue < 0 && (Ue = 0, A.frameLoop !== "demand" && oi(Va));
63
+ function za() {
64
+ Ue < 0 && (Ue = 0, E.frameLoop !== "demand" && oi(Ba));
65
65
  }
66
66
  function cs() {
67
67
  Ue = -1;
68
68
  }
69
- function Va() {
70
- ~Ue && (oi(Va), A.batchedUpdates(ja));
69
+ function Ba() {
70
+ ~Ue && (oi(Ba), E.batchedUpdates(Va));
71
71
  }
72
- function ja() {
72
+ function Va() {
73
73
  const e = Ue;
74
- Ue = A.now();
75
- const t = za(Ue);
76
- if (t && (qa(ut.splice(0, t), (n) => n.handler()), Oe -= t), !Oe) {
74
+ Ue = E.now();
75
+ const t = Oa(Ue);
76
+ if (t && (ja(ut.splice(0, t), (n) => n.handler()), Oe -= t), !Oe) {
77
77
  cs();
78
78
  return;
79
79
  }
@@ -89,16 +89,16 @@ function sn() {
89
89
  return Oe -= t == e && e.has(n) ? 1 : 0, e.delete(n);
90
90
  },
91
91
  flush(n) {
92
- t.size && (e = /* @__PURE__ */ new Set(), Oe -= t.size, qa(t, (r) => r(n) && e.add(r)), Oe += e.size, t = e);
92
+ t.size && (e = /* @__PURE__ */ new Set(), Oe -= t.size, ja(t, (r) => r(n) && e.add(r)), Oe += e.size, t = e);
93
93
  }
94
94
  };
95
95
  }
96
- function qa(e, t) {
96
+ function ja(e, t) {
97
97
  e.forEach((n) => {
98
98
  try {
99
99
  t(n);
100
100
  } catch (r) {
101
- A.catch(r);
101
+ E.catch(r);
102
102
  }
103
103
  });
104
104
  }
@@ -110,8 +110,8 @@ hs(Ne, {
110
110
  assign: () => ds,
111
111
  colors: () => ze,
112
112
  createStringInterpolator: () => ui,
113
- skipAnimation: () => Ya,
114
- to: () => Ha,
113
+ skipAnimation: () => Ha,
114
+ to: () => qa,
115
115
  willAdvance: () => ci
116
116
  });
117
117
  function Tr() {
@@ -152,25 +152,25 @@ function Lt(e, t) {
152
152
  e.clear(), U(n, t);
153
153
  }
154
154
  }
155
- var It = (e, ...t) => Lt(e, (n) => n(...t)), si = () => typeof window > "u" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent), ui, Ha, ze = null, Ya = !1, ci = Tr, ds = (e) => {
156
- e.to && (Ha = e.to), e.now && (A.now = e.now), e.colors !== void 0 && (ze = e.colors), e.skipAnimation != null && (Ya = e.skipAnimation), e.createStringInterpolator && (ui = e.createStringInterpolator), e.requestAnimationFrame && A.use(e.requestAnimationFrame), e.batchedUpdates && (A.batchedUpdates = e.batchedUpdates), e.willAdvance && (ci = e.willAdvance), e.frameLoop && (A.frameLoop = e.frameLoop);
155
+ var It = (e, ...t) => Lt(e, (n) => n(...t)), si = () => typeof window > "u" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent), ui, qa, ze = null, Ha = !1, ci = Tr, ds = (e) => {
156
+ e.to && (qa = e.to), e.now && (E.now = e.now), e.colors !== void 0 && (ze = e.colors), e.skipAnimation != null && (Ha = e.skipAnimation), e.createStringInterpolator && (ui = e.createStringInterpolator), e.requestAnimationFrame && E.use(e.requestAnimationFrame), e.batchedUpdates && (E.batchedUpdates = e.batchedUpdates), e.willAdvance && (ci = e.willAdvance), e.frameLoop && (E.frameLoop = e.frameLoop);
157
157
  }, Ft = /* @__PURE__ */ new Set(), ge = [], ar = [], Sn = 0, Hn = {
158
158
  get idle() {
159
159
  return !Ft.size && !ge.length;
160
160
  },
161
161
  /** Advance the given animation on every frame until idle. */
162
162
  start(e) {
163
- Sn > e.priority ? (Ft.add(e), A.onStart(ms)) : (Wa(e), A(Pr));
163
+ Sn > e.priority ? (Ft.add(e), E.onStart(ms)) : (Ya(e), E(Pr));
164
164
  },
165
165
  /** Advance all animations by the given time. */
166
166
  advance: Pr,
167
167
  /** Call this when an animation's priority changes. */
168
168
  sort(e) {
169
169
  if (Sn)
170
- A.onFrame(() => Hn.sort(e));
170
+ E.onFrame(() => Hn.sort(e));
171
171
  else {
172
172
  const t = ge.indexOf(e);
173
- ~t && (ge.splice(t, 1), Ga(e));
173
+ ~t && (ge.splice(t, 1), Wa(e));
174
174
  }
175
175
  },
176
176
  /**
@@ -183,12 +183,12 @@ var It = (e, ...t) => Lt(e, (n) => n(...t)), si = () => typeof window > "u" || !
183
183
  }
184
184
  };
185
185
  function ms() {
186
- Ft.forEach(Wa), Ft.clear(), A(Pr);
186
+ Ft.forEach(Ya), Ft.clear(), E(Pr);
187
187
  }
188
- function Wa(e) {
189
- ge.includes(e) || Ga(e);
188
+ function Ya(e) {
189
+ ge.includes(e) || Wa(e);
190
190
  }
191
- function Ga(e) {
191
+ function Wa(e) {
192
192
  ge.splice(
193
193
  gs(ge, (t) => t.priority > e.priority),
194
194
  0,
@@ -495,17 +495,17 @@ function Vt(e, t) {
495
495
  Ts(r, t);
496
496
  });
497
497
  }
498
- var Qa = class {
498
+ var Ga = class {
499
499
  constructor(e) {
500
500
  if (!e && !(e = this.get))
501
501
  throw Error("Unknown getter");
502
502
  Ps(this, e);
503
503
  }
504
- }, Ps = (e, t) => Xa(e, Bt, t);
504
+ }, Ps = (e, t) => Qa(e, Bt, t);
505
505
  function vt(e, t) {
506
506
  if (e[Bt]) {
507
507
  let n = e[ht];
508
- n || Xa(e, ht, n = /* @__PURE__ */ new Set()), n.has(t) || (n.add(t), e.observerAdded && e.observerAdded(n.size, t));
508
+ n || Qa(e, ht, n = /* @__PURE__ */ new Set()), n.has(t) || (n.add(t), e.observerAdded && e.observerAdded(n.size, t));
509
509
  }
510
510
  return t;
511
511
  }
@@ -516,11 +516,11 @@ function jt(e, t) {
516
516
  r ? n.delete(t) : e[ht] = null, e.observerRemoved && e.observerRemoved(r, t);
517
517
  }
518
518
  }
519
- var Xa = (e, t, n) => Object.defineProperty(e, t, {
519
+ var Qa = (e, t, n) => Object.defineProperty(e, t, {
520
520
  value: n,
521
521
  writable: !0,
522
522
  configurable: !0
523
- }), _n = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, As = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi, Fi = new RegExp(`(${_n.source})(%|[a-z]+)`, "i"), Es = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, Wn = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/, Za = (e) => {
523
+ }), _n = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, As = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi, Fi = new RegExp(`(${_n.source})(%|[a-z]+)`, "i"), Es = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, Wn = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/, Xa = (e) => {
524
524
  const [t, n] = Rs(e);
525
525
  if (!t || si())
526
526
  return e;
@@ -532,7 +532,7 @@ var Xa = (e, t, n) => Object.defineProperty(e, t, {
532
532
  return i || e;
533
533
  } else {
534
534
  if (n && Wn.test(n))
535
- return Za(n);
535
+ return Xa(n);
536
536
  if (n)
537
537
  return n;
538
538
  }
@@ -543,7 +543,7 @@ var Xa = (e, t, n) => Object.defineProperty(e, t, {
543
543
  return [,];
544
544
  const [, n, r] = t;
545
545
  return [n, r];
546
- }, sr, Is = (e, t, n, r, i) => `rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`, Ka = (e) => {
546
+ }, sr, Is = (e, t, n, r, i) => `rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`, Za = (e) => {
547
547
  sr || (sr = ze ? (
548
548
  // match color names, ignore partial matches
549
549
  new RegExp(`(${Object.keys(ze).join("|")})(?!\\w)`, "g")
@@ -551,7 +551,7 @@ var Xa = (e, t, n) => Object.defineProperty(e, t, {
551
551
  // never match
552
552
  /^\b$/
553
553
  ));
554
- const t = e.output.map((a) => ae(a).replace(Wn, Za).replace(As, Ii).replace(sr, Ii)), n = t.map((a) => a.match(_n).map(Number)), i = n[0].map(
554
+ const t = e.output.map((a) => ae(a).replace(Wn, Xa).replace(As, Ii).replace(sr, Ii)), n = t.map((a) => a.match(_n).map(Number)), i = n[0].map(
555
555
  (a, o) => n.map((s) => {
556
556
  if (!(o in s))
557
557
  throw Error('The arity of each "output" value must be equal');
@@ -568,7 +568,7 @@ var Xa = (e, t, n) => Object.defineProperty(e, t, {
568
568
  () => `${i[s++](a)}${o || ""}`
569
569
  ).replace(Es, Is);
570
570
  };
571
- }, li = "react-spring: ", Ja = (e) => {
571
+ }, li = "react-spring: ", Ka = (e) => {
572
572
  const t = e;
573
573
  let n = !1;
574
574
  if (typeof t != "function")
@@ -576,13 +576,13 @@ var Xa = (e, t, n) => Object.defineProperty(e, t, {
576
576
  return (...r) => {
577
577
  n || (t(...r), n = !0);
578
578
  };
579
- }, Ls = Ja(console.warn);
579
+ }, Ls = Ka(console.warn);
580
580
  function Fs() {
581
581
  Ls(
582
582
  `${li}The "interpolate" function is deprecated in v9 (use "to" instead)`
583
583
  );
584
584
  }
585
- var Ds = Ja(console.warn);
585
+ var Ds = Ka(console.warn);
586
586
  function Us() {
587
587
  Ds(
588
588
  `${li}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`
@@ -598,14 +598,14 @@ var hi = si() ? an : as, Os = () => {
598
598
  e.current = !1;
599
599
  }), []), e;
600
600
  };
601
- function eo() {
602
- const e = Oa()[1], t = Os();
601
+ function Ja() {
602
+ const e = Ua()[1], t = Os();
603
603
  return () => {
604
604
  t.current && e(Math.random());
605
605
  };
606
606
  }
607
607
  function zs(e, t) {
608
- const [n] = Oa(
608
+ const [n] = Ua(
609
609
  () => ({
610
610
  inputs: t,
611
611
  result: e()
@@ -627,14 +627,14 @@ function Bs(e, t) {
627
627
  return !1;
628
628
  return !0;
629
629
  }
630
- var to = (e) => an(e, Vs), Vs = [];
630
+ var eo = (e) => an(e, Vs), Vs = [];
631
631
  function Di(e) {
632
632
  const t = Xe();
633
633
  return an(() => {
634
634
  t.current = e;
635
635
  }), t.current;
636
636
  }
637
- var qt = Symbol.for("Animated:node"), js = (e) => !!e && e[qt] === e, Se = (e) => e && e[qt], fi = (e, t) => fs(e, qt, t), Qn = (e) => e && e[qt] && e[qt].getPayload(), no = class {
637
+ var qt = Symbol.for("Animated:node"), js = (e) => !!e && e[qt] === e, Se = (e) => e && e[qt], fi = (e, t) => fs(e, qt, t), Qn = (e) => e && e[qt] && e[qt].getPayload(), to = class {
638
638
  constructor() {
639
639
  fi(this, this);
640
640
  }
@@ -642,7 +642,7 @@ var qt = Symbol.for("Animated:node"), js = (e) => !!e && e[qt] === e, Se = (e) =
642
642
  getPayload() {
643
643
  return this.payload || [];
644
644
  }
645
- }, un = class extends no {
645
+ }, un = class extends to {
646
646
  constructor(e) {
647
647
  super(), this._value = e, this.done = !0, this.durationProgress = 0, N.num(this._value) && (this.lastPosition = this._value);
648
648
  }
@@ -693,7 +693,7 @@ var qt = Symbol.for("Animated:node"), js = (e) => !!e && e[qt] === e, Se = (e) =
693
693
  output: [this.getValue(), e]
694
694
  })), this._value = 0, super.reset();
695
695
  }
696
- }, kn = { dependencies: null }, Xn = class extends no {
696
+ }, kn = { dependencies: null }, Xn = class extends to {
697
697
  constructor(e) {
698
698
  super(), this.source = e, this.setValue(e);
699
699
  }
@@ -723,13 +723,13 @@ var qt = Symbol.for("Animated:node"), js = (e) => !!e && e[qt] === e, Se = (e) =
723
723
  const t = Qn(e);
724
724
  t && U(t, (n) => this.add(n));
725
725
  }
726
- }, ro = class extends Xn {
726
+ }, no = class extends Xn {
727
727
  constructor(e) {
728
728
  super(e);
729
729
  }
730
730
  /** @internal */
731
731
  static create(e) {
732
- return new ro(e);
732
+ return new no(e);
733
733
  }
734
734
  getValue() {
735
735
  return this.source.map((e) => e.getValue());
@@ -744,7 +744,7 @@ function qs(e) {
744
744
  }
745
745
  function Ar(e) {
746
746
  const t = Se(e);
747
- return t ? t.constructor : N.arr(e) ? ro : Gn(e) ? Ht : un;
747
+ return t ? t.constructor : N.arr(e) ? no : Gn(e) ? Ht : un;
748
748
  }
749
749
  var Ui = (e, t) => {
750
750
  const n = (
@@ -759,7 +759,7 @@ var Ui = (e, t) => {
759
759
  a.current = Ws(i, m);
760
760
  },
761
761
  [i]
762
- ), [s, c] = Ys(r, t), u = eo(), l = () => {
762
+ ), [s, c] = Ys(r, t), u = Ja(), l = () => {
763
763
  const m = a.current;
764
764
  if (n && !m)
765
765
  return;
@@ -769,8 +769,8 @@ var Ui = (e, t) => {
769
769
  f.current && (U(
770
770
  f.current.deps,
771
771
  (m) => jt(m, f.current)
772
- ), A.cancel(f.current.update));
773
- })), an(l, []), to(() => () => {
772
+ ), E.cancel(f.current.update));
773
+ })), an(l, []), eo(() => () => {
774
774
  const m = f.current;
775
775
  U(m.deps, (g) => jt(g, m));
776
776
  });
@@ -782,7 +782,7 @@ var Ui = (e, t) => {
782
782
  this.update = e, this.deps = t;
783
783
  }
784
784
  eventObserved(e) {
785
- e.type == "change" && A.write(this.update);
785
+ e.type == "change" && E.write(this.update);
786
786
  }
787
787
  };
788
788
  function Ys(e, t) {
@@ -817,7 +817,7 @@ var Oi = Symbol.for("AnimatedComponent"), Gs = (e, {
817
817
  function Ye(e, ...t) {
818
818
  return N.fun(e) ? e(...t) : e;
819
819
  }
820
- var Dt = (e, t) => e === !0 || !!(t && e && (N.fun(e) ? e(t) : he(e).includes(t))), io = (e, t) => N.obj(e) ? t && e[t] : e, ao = (e, t) => e.default === !0 ? e[t] : e.default ? e.default[t] : void 0, Qs = (e) => e, di = (e, t = Qs) => {
820
+ var Dt = (e, t) => e === !0 || !!(t && e && (N.fun(e) ? e(t) : he(e).includes(t))), ro = (e, t) => N.obj(e) ? t && e[t] : e, io = (e, t) => e.default === !0 ? e[t] : e.default ? e.default[t] : void 0, Qs = (e) => e, di = (e, t = Qs) => {
821
821
  let n = Xs;
822
822
  e.default && e.default !== !0 && (e = e.default, n = Object.keys(e));
823
823
  const r = {};
@@ -878,7 +878,7 @@ function Ks(e) {
878
878
  }), n)
879
879
  return t;
880
880
  }
881
- function oo(e) {
881
+ function ao(e) {
882
882
  const t = Ks(e);
883
883
  if (t) {
884
884
  const n = { to: t };
@@ -940,7 +940,7 @@ var Vi = [], au = class {
940
940
  this.changed = !1, this.values = Vi, this.toValues = null, this.fromValues = Vi, this.config = new ru(), this.immediate = !1;
941
941
  }
942
942
  };
943
- function so(e, { key: t, props: n, defaultProps: r, state: i, actions: a }) {
943
+ function oo(e, { key: t, props: n, defaultProps: r, state: i, actions: a }) {
944
944
  return new Promise((o, s) => {
945
945
  let c, u, l = Dt(n.cancel ?? r?.cancel, t);
946
946
  if (l)
@@ -951,10 +951,10 @@ function so(e, { key: t, props: n, defaultProps: r, state: i, actions: a }) {
951
951
  m !== !0 && (m = i.paused || Dt(m, t)), c = Ye(n.delay || 0, t), m ? (i.resumeQueue.add(f), a.pause()) : (a.resume(), f());
952
952
  }
953
953
  function h() {
954
- i.resumeQueue.add(f), i.timeouts.delete(u), u.cancel(), c = u.time - A.now();
954
+ i.resumeQueue.add(f), i.timeouts.delete(u), u.cancel(), c = u.time - E.now();
955
955
  }
956
956
  function f() {
957
- c > 0 && !Ne.skipAnimation ? (i.delayed = !0, u = A.setTimeout(d, c), i.pauseQueue.add(h), i.timeouts.add(u)) : d();
957
+ c > 0 && !Ne.skipAnimation ? (i.delayed = !0, u = E.setTimeout(d, c), i.pauseQueue.add(h), i.timeouts.add(u)) : d();
958
958
  }
959
959
  function d() {
960
960
  i.delayed && (i.delayed = !1), i.pauseQueue.delete(h), i.timeouts.delete(u), e <= (i.cancelId || 0) && (l = !0);
@@ -966,10 +966,10 @@ function so(e, { key: t, props: n, defaultProps: r, state: i, actions: a }) {
966
966
  }
967
967
  });
968
968
  }
969
- var mi = (e, t) => t.length == 1 ? t[0] : t.some((n) => n.cancelled) ? ct(e.get()) : t.every((n) => n.noop) ? uo(e.get()) : ve(
969
+ var mi = (e, t) => t.length == 1 ? t[0] : t.some((n) => n.cancelled) ? ct(e.get()) : t.every((n) => n.noop) ? so(e.get()) : ve(
970
970
  e.get(),
971
971
  t.every((n) => n.finished)
972
- ), uo = (e) => ({
972
+ ), so = (e) => ({
973
973
  value: e,
974
974
  noop: !0,
975
975
  finished: !0,
@@ -983,7 +983,7 @@ var mi = (e, t) => t.length == 1 ? t[0] : t.some((n) => n.cancelled) ? ct(e.get(
983
983
  cancelled: !0,
984
984
  finished: !1
985
985
  });
986
- function co(e, t, n, r) {
986
+ function uo(e, t, n, r) {
987
987
  const { callId: i, parentId: a, onRest: o } = t, { asyncTo: s, promise: c } = n;
988
988
  return !a && e === s && !t.reset ? c : n.promise = (async () => {
989
989
  n.asyncId = i, n.asyncTo = e;
@@ -1011,11 +1011,11 @@ function co(e, t, n, r) {
1011
1011
  if (Ne.skipAnimation)
1012
1012
  throw Wt(n), p.result = ve(r, !1), h(p), p;
1013
1013
  d(b);
1014
- const _ = N.obj(x) ? { ...x } : { ...y, to: x };
1015
- _.parentId = i, Te(u, (k, T) => {
1016
- N.und(_[T]) && (_[T] = k);
1014
+ const w = N.obj(x) ? { ...x } : { ...y, to: x };
1015
+ w.parentId = i, Te(u, (k, T) => {
1016
+ N.und(w[T]) && (w[T] = k);
1017
1017
  });
1018
- const M = await r.start(_);
1018
+ const M = await r.start(w);
1019
1019
  return d(b), n.paused && await new Promise((k) => {
1020
1020
  n.resumeQueue.add(k);
1021
1021
  }), M;
@@ -1040,7 +1040,7 @@ function co(e, t, n, r) {
1040
1040
  } finally {
1041
1041
  i == n.asyncId && (n.asyncId = a, n.asyncTo = a ? s : void 0, n.promise = a ? c : void 0);
1042
1042
  }
1043
- return N.fun(o) && A.batchedUpdates(() => {
1043
+ return N.fun(o) && E.batchedUpdates(() => {
1044
1044
  o(g, r, r.item);
1045
1045
  }), g;
1046
1046
  })();
@@ -1058,7 +1058,7 @@ var ji = class extends Error {
1058
1058
  constructor() {
1059
1059
  super("SkipAnimationSignal");
1060
1060
  }
1061
- }, Ir = (e) => e instanceof gi, ou = 1, gi = class extends Qa {
1061
+ }, Ir = (e) => e instanceof gi, ou = 1, gi = class extends Ga {
1062
1062
  constructor() {
1063
1063
  super(...arguments), this.id = ou++, this._priority = 0;
1064
1064
  }
@@ -1113,7 +1113,7 @@ var ji = class extends Error {
1113
1113
  priority: e
1114
1114
  });
1115
1115
  }
1116
- }, Ze = Symbol.for("SpringPhase"), lo = 1, Lr = 2, Fr = 4, ur = (e) => (e[Ze] & lo) > 0, Fe = (e) => (e[Ze] & Lr) > 0, $t = (e) => (e[Ze] & Fr) > 0, Hi = (e, t) => t ? e[Ze] |= Lr | lo : e[Ze] &= ~Lr, Yi = (e, t) => t ? e[Ze] |= Fr : e[Ze] &= ~Fr, ho = class extends gi {
1116
+ }, Ze = Symbol.for("SpringPhase"), co = 1, Lr = 2, Fr = 4, ur = (e) => (e[Ze] & co) > 0, Fe = (e) => (e[Ze] & Lr) > 0, $t = (e) => (e[Ze] & Fr) > 0, Hi = (e, t) => t ? e[Ze] |= Lr | co : e[Ze] &= ~Lr, Yi = (e, t) => t ? e[Ze] |= Fr : e[Ze] &= ~Fr, lo = class extends gi {
1117
1117
  constructor(e, t) {
1118
1118
  if (super(), this.animation = new au(), this.defaultProps = {}, this._state = {
1119
1119
  paused: !1,
@@ -1188,17 +1188,17 @@ var ji = class extends Error {
1188
1188
  const b = a.precision || (g == h ? 5e-3 : Math.min(1, Math.abs(h - g) * 1e-3));
1189
1189
  if (N.und(a.duration))
1190
1190
  if (a.decay) {
1191
- const p = a.decay === !0 ? 0.998 : a.decay, _ = Math.exp(-(1 - p) * m);
1192
- d = g + x / (1 - p) * (1 - _), f = Math.abs(u.lastPosition - d) <= b, y = x * _;
1191
+ const p = a.decay === !0 ? 0.998 : a.decay, w = Math.exp(-(1 - p) * m);
1192
+ d = g + x / (1 - p) * (1 - w), f = Math.abs(u.lastPosition - d) <= b, y = x * w;
1193
1193
  } else {
1194
1194
  y = u.lastVelocity == null ? x : u.lastVelocity;
1195
- const p = a.restVelocity || b / 10, _ = a.clamp ? 0 : a.bounce, M = !N.und(_), k = g == h ? u.v0 > 0 : g < h;
1196
- let T, R = !1;
1197
- const I = 1, F = Math.ceil(e / I);
1198
- for (let v = 0; v < F && (T = Math.abs(y) > p, !(!T && (f = Math.abs(h - d) <= b, f))); ++v) {
1199
- M && (R = d == h || d > h == k, R && (y = -y * _, d = h));
1200
- const E = -a.tension * 1e-6 * (d - h), C = -a.friction * 1e-3 * y, P = (E + C) / a.mass;
1201
- y = y + P * I, d = d + y * I;
1195
+ const p = a.restVelocity || b / 10, w = a.clamp ? 0 : a.bounce, M = !N.und(w), k = g == h ? u.v0 > 0 : g < h;
1196
+ let T, I = !1;
1197
+ const R = 1, F = Math.ceil(e / R);
1198
+ for (let _ = 0; _ < F && (T = Math.abs(y) > p, !(!T && (f = Math.abs(h - d) <= b, f))); ++_) {
1199
+ M && (I = d == h || d > h == k, I && (y = -y * w, d = h));
1200
+ const P = -a.tension * 1e-6 * (d - h), C = -a.friction * 1e-3 * y, A = (P + C) / a.mass;
1201
+ y = y + A * R, d = d + y * R;
1202
1202
  }
1203
1203
  }
1204
1204
  else {
@@ -1217,7 +1217,7 @@ var ji = class extends Error {
1217
1217
  }
1218
1218
  /** Set the current value, while stopping the current animation */
1219
1219
  set(e) {
1220
- return A.batchedUpdates(() => {
1220
+ return E.batchedUpdates(() => {
1221
1221
  this._stop(), this._focus(e), this._set(e);
1222
1222
  }), this;
1223
1223
  }
@@ -1236,7 +1236,7 @@ var ji = class extends Error {
1236
1236
  finish() {
1237
1237
  if (Fe(this)) {
1238
1238
  const { to: e, config: t } = this.animation;
1239
- A.batchedUpdates(() => {
1239
+ E.batchedUpdates(() => {
1240
1240
  this._onStart(), t.decay || this._set(e, !1), this._stop();
1241
1241
  });
1242
1242
  }
@@ -1259,7 +1259,7 @@ var ji = class extends Error {
1259
1259
  */
1260
1260
  stop(e) {
1261
1261
  const { to: t } = this.animation;
1262
- return this._focus(this.get()), Wt(this._state, e && this._lastCallId), A.batchedUpdates(() => this._stop(t, e)), this;
1262
+ return this._focus(this.get()), Wt(this._state, e && this._lastCallId), E.batchedUpdates(() => this._stop(t, e)), this;
1263
1263
  }
1264
1264
  /** Restart the animation. */
1265
1265
  reset() {
@@ -1289,7 +1289,7 @@ var ji = class extends Error {
1289
1289
  r,
1290
1290
  di(
1291
1291
  e,
1292
- (o, s) => /^on/.test(s) ? io(o, n) : o
1292
+ (o, s) => /^on/.test(s) ? ro(o, n) : o
1293
1293
  )
1294
1294
  ), Gi(this, e, "onProps"), Tt(this, "onProps", e, this);
1295
1295
  const i = this._prepareNode(e);
@@ -1298,7 +1298,7 @@ var ji = class extends Error {
1298
1298
  "Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"
1299
1299
  );
1300
1300
  const a = this._state;
1301
- return so(++this._lastCallId, {
1301
+ return oo(++this._lastCallId, {
1302
1302
  key: n,
1303
1303
  props: e,
1304
1304
  defaultProps: r,
@@ -1324,7 +1324,7 @@ var ji = class extends Error {
1324
1324
  }
1325
1325
  }).then((o) => {
1326
1326
  if (e.loop && o.finished && !(t && o.noop)) {
1327
- const s = fo(e);
1327
+ const s = ho(e);
1328
1328
  if (s)
1329
1329
  return this._update(s, !0);
1330
1330
  }
@@ -1363,32 +1363,32 @@ var ji = class extends Error {
1363
1363
  // except for declarative updates. When `reset` is defined, there
1364
1364
  // must exist a value to animate from.
1365
1365
  N.und(t.reset) ? i && !t.default : !N.und(h) && Dt(t.reset, a)
1366
- ), _ = p ? h : this.get(), M = Yt(l), k = N.num(M) || N.arr(M) || Gn(M), T = !m && (!k || Dt(o.immediate || t.immediate, a));
1366
+ ), w = p ? h : this.get(), M = Yt(l), k = N.num(M) || N.arr(M) || Gn(M), T = !m && (!k || Dt(o.immediate || t.immediate, a));
1367
1367
  if (d) {
1368
- const v = Ar(l);
1369
- if (v !== b.constructor)
1368
+ const _ = Ar(l);
1369
+ if (_ !== b.constructor)
1370
1370
  if (T)
1371
1371
  b = this._set(M);
1372
1372
  else
1373
1373
  throw Error(
1374
- `Cannot animate between ${b.constructor.name} and ${v.name}, as the "to" prop suggests`
1374
+ `Cannot animate between ${b.constructor.name} and ${_.name}, as the "to" prop suggests`
1375
1375
  );
1376
1376
  }
1377
- const R = b.constructor;
1378
- let I = de(l), F = !1;
1379
- if (!I) {
1380
- const v = p || !ur(this) && f;
1381
- (d || v) && (F = Re(Yt(_), M), I = !F), (!Re(s.immediate, T) && !T || !Re(g.decay, x) || !Re(g.velocity, y)) && (I = !0);
1377
+ const I = b.constructor;
1378
+ let R = de(l), F = !1;
1379
+ if (!R) {
1380
+ const _ = p || !ur(this) && f;
1381
+ (d || _) && (F = Re(Yt(w), M), R = !F), (!Re(s.immediate, T) && !T || !Re(g.decay, x) || !Re(g.velocity, y)) && (R = !0);
1382
1382
  }
1383
- if (F && Fe(this) && (s.changed && !p ? I = !0 : I || this._stop(c)), !m && ((I || de(c)) && (s.values = b.getPayload(), s.toValues = de(l) ? null : R == Ht ? [1] : he(M)), s.immediate != T && (s.immediate = T, !T && !p && this._set(c)), I)) {
1384
- const { onRest: v } = s;
1383
+ if (F && Fe(this) && (s.changed && !p ? R = !0 : R || this._stop(c)), !m && ((R || de(c)) && (s.values = b.getPayload(), s.toValues = de(l) ? null : I == Ht ? [1] : he(M)), s.immediate != T && (s.immediate = T, !T && !p && this._set(c)), R)) {
1384
+ const { onRest: _ } = s;
1385
1385
  U(uu, (C) => Gi(this, t, C));
1386
- const E = ve(this, kt(this, c));
1387
- It(this._pendingCalls, E), this._pendingCalls.add(n), s.changed && A.batchedUpdates(() => {
1388
- s.changed = !p, v?.(E, this), p ? Ye(o.onRest, E) : s.onStart?.(E, this);
1386
+ const P = ve(this, kt(this, c));
1387
+ It(this._pendingCalls, P), this._pendingCalls.add(n), s.changed && E.batchedUpdates(() => {
1388
+ s.changed = !p, _?.(P, this), p ? Ye(o.onRest, P) : s.onStart?.(P, this);
1389
1389
  });
1390
1390
  }
1391
- p && this._set(_), m ? n(co(t.to, t, this._state, this)) : I ? this._start() : Fe(this) && !d ? this._pendingCalls.add(n) : n(uo(_));
1391
+ p && this._set(w), m ? n(uo(t.to, t, this._state, this)) : R ? this._start() : Fe(this) && !d ? this._pendingCalls.add(n) : n(so(w));
1392
1392
  }
1393
1393
  /** Update the `animation.to` value, which might be a `FluidValue` */
1394
1394
  _focus(e) {
@@ -1414,7 +1414,7 @@ var ji = class extends Error {
1414
1414
  const r = Se(this);
1415
1415
  if (!r || !Re(n, r.getValue())) {
1416
1416
  const i = Ar(n);
1417
- !r || r.constructor != i ? fi(this, i.create(n)) : r.setValue(n), r && A.batchedUpdates(() => {
1417
+ !r || r.constructor != i ? fi(this, i.create(n)) : r.setValue(n), r && E.batchedUpdates(() => {
1418
1418
  this._onChange(n, t);
1419
1419
  });
1420
1420
  }
@@ -1467,10 +1467,10 @@ function kt(e, t) {
1467
1467
  const n = Yt(t), r = Yt(e.get());
1468
1468
  return Re(r, n);
1469
1469
  }
1470
- function fo(e, t = e.loop, n = e.to) {
1470
+ function ho(e, t = e.loop, n = e.to) {
1471
1471
  const r = Ye(t);
1472
1472
  if (r) {
1473
- const i = r !== !0 && oo(r), a = (i || e).reverse, o = !i || i.reset;
1473
+ const i = r !== !0 && ao(r), a = (i || e).reverse, o = !i || i.reset;
1474
1474
  return Gt({
1475
1475
  ...e,
1476
1476
  loop: t,
@@ -1492,7 +1492,7 @@ function fo(e, t = e.loop, n = e.to) {
1492
1492
  }
1493
1493
  }
1494
1494
  function Gt(e) {
1495
- const { to: t, from: n } = e = oo(e), r = /* @__PURE__ */ new Set();
1495
+ const { to: t, from: n } = e = ao(e), r = /* @__PURE__ */ new Set();
1496
1496
  return N.obj(t) && Wi(t, r), N.obj(n) && Wi(n, r), e.keys = r.size ? Array.from(r) : null, e;
1497
1497
  }
1498
1498
  function su(e) {
@@ -1510,7 +1510,7 @@ var uu = [
1510
1510
  "onResume"
1511
1511
  ];
1512
1512
  function Gi(e, t, n) {
1513
- e.animation[n] = t[n] !== ao(t, n) ? io(t[n], e.key) : void 0;
1513
+ e.animation[n] = t[n] !== io(t, n) ? ro(t[n], e.key) : void 0;
1514
1514
  }
1515
1515
  function Tt(e, t, ...n) {
1516
1516
  e.animation[t]?.(...n), e.defaultProps[t]?.(...n);
@@ -1566,7 +1566,7 @@ var cu = ["onStart", "onChange", "onRest"], lu = 1, hu = class {
1566
1566
  */
1567
1567
  start(e) {
1568
1568
  let { queue: t } = this;
1569
- return e ? t = he(e).map(Gt) : this.queue = [], this._flush ? this._flush(this, t) : (xo(this, t), Dr(this, t));
1569
+ return e ? t = he(e).map(Gt) : this.queue = [], this._flush ? this._flush(this, t) : (po(this, t), Dr(this, t));
1570
1570
  }
1571
1571
  /** @internal */
1572
1572
  stop(e, t) {
@@ -1622,15 +1622,15 @@ var cu = ["onStart", "onChange", "onRest"], lu = 1, hu = class {
1622
1622
  this._active.delete(e.parent);
1623
1623
  else
1624
1624
  return;
1625
- A.onFrame(this._onFrame);
1625
+ E.onFrame(this._onFrame);
1626
1626
  }
1627
1627
  };
1628
1628
  function Dr(e, t) {
1629
- return Promise.all(t.map((n) => mo(e, n))).then(
1629
+ return Promise.all(t.map((n) => fo(e, n))).then(
1630
1630
  (n) => mi(e, n)
1631
1631
  );
1632
1632
  }
1633
- async function mo(e, t, n) {
1633
+ async function fo(e, t, n) {
1634
1634
  const { keys: r, to: i, from: a, loop: o, onRest: s, onResolve: c } = t, u = N.obj(t.default) && t.default;
1635
1635
  o && (t.loop = !1), i === !1 && (t.to = null), a === !1 && (t.from = null);
1636
1636
  const l = N.arr(i) || N.fun(i) ? i : void 0;
@@ -1639,8 +1639,8 @@ async function mo(e, t, n) {
1639
1639
  if (N.fun(x)) {
1640
1640
  const y = e._events[g];
1641
1641
  t[g] = ({ finished: b, cancelled: p }) => {
1642
- const _ = y.get(x);
1643
- _ ? (b || (_.finished = !1), p && (_.cancelled = !0)) : y.set(x, {
1642
+ const w = y.get(x);
1643
+ w ? (b || (w.finished = !1), p && (w.cancelled = !0)) : y.set(x, {
1644
1644
  value: null,
1645
1645
  finished: b || !1,
1646
1646
  cancelled: p || !1
@@ -1652,9 +1652,9 @@ async function mo(e, t, n) {
1652
1652
  t.pause === !h.paused ? (h.paused = t.pause, It(t.pause ? h.pauseQueue : h.resumeQueue)) : h.paused && (t.pause = !0);
1653
1653
  const f = (r || Object.keys(e.springs)).map(
1654
1654
  (g) => e.springs[g].start(t)
1655
- ), d = t.cancel === !0 || ao(t, "cancel") === !0;
1655
+ ), d = t.cancel === !0 || io(t, "cancel") === !0;
1656
1656
  (l || d && h.asyncId) && f.push(
1657
- so(++e._lastAsyncId, {
1657
+ oo(++e._lastAsyncId, {
1658
1658
  props: t,
1659
1659
  state: h,
1660
1660
  actions: {
@@ -1662,7 +1662,7 @@ async function mo(e, t, n) {
1662
1662
  resume: Tr,
1663
1663
  start(g, x) {
1664
1664
  d ? (Wt(h, e._lastAsyncId), x(ct(e))) : (g.onRest = s, x(
1665
- co(
1665
+ uo(
1666
1666
  l,
1667
1667
  g,
1668
1668
  h,
@@ -1677,35 +1677,35 @@ async function mo(e, t, n) {
1677
1677
  });
1678
1678
  const m = mi(e, await Promise.all(f));
1679
1679
  if (o && m.finished && !(n && m.noop)) {
1680
- const g = fo(t, o, i);
1680
+ const g = ho(t, o, i);
1681
1681
  if (g)
1682
- return xo(e, [g]), mo(e, g, !0);
1682
+ return po(e, [g]), fo(e, g, !0);
1683
1683
  }
1684
- return c && A.batchedUpdates(() => c(m, e, e.item)), m;
1684
+ return c && E.batchedUpdates(() => c(m, e, e.item)), m;
1685
1685
  }
1686
1686
  function Qi(e, t) {
1687
1687
  const n = { ...e.springs };
1688
1688
  return t && U(he(t), (r) => {
1689
- N.und(r.keys) && (r = Gt(r)), N.obj(r.to) || (r = { ...r, to: void 0 }), po(n, r, (i) => yo(i));
1690
- }), go(e, n), n;
1689
+ N.und(r.keys) && (r = Gt(r)), N.obj(r.to) || (r = { ...r, to: void 0 }), yo(n, r, (i) => go(i));
1690
+ }), mo(e, n), n;
1691
1691
  }
1692
- function go(e, t) {
1692
+ function mo(e, t) {
1693
1693
  Te(t, (n, r) => {
1694
1694
  e.springs[r] || (e.springs[r] = n, vt(n, e));
1695
1695
  });
1696
1696
  }
1697
- function yo(e, t) {
1698
- const n = new ho();
1697
+ function go(e, t) {
1698
+ const n = new lo();
1699
1699
  return n.key = e, t && vt(n, t), n;
1700
1700
  }
1701
- function po(e, t, n) {
1701
+ function yo(e, t, n) {
1702
1702
  t.keys && U(t.keys, (r) => {
1703
1703
  (e[r] || (e[r] = n(r)))._prepareNode(t);
1704
1704
  });
1705
1705
  }
1706
- function xo(e, t) {
1706
+ function po(e, t) {
1707
1707
  U(t, (n) => {
1708
- po(e.springs, n, (r) => yo(r, e));
1708
+ yo(e.springs, n, (r) => go(r, e));
1709
1709
  });
1710
1710
  }
1711
1711
  var Zn = ({
@@ -1775,14 +1775,14 @@ function mu(e, t, n) {
1775
1775
  const i = fn(
1776
1776
  () => r || arguments.length == 3 ? du() : void 0,
1777
1777
  []
1778
- ), a = Xe(0), o = eo(), s = fn(
1778
+ ), a = Xe(0), o = Ja(), s = fn(
1779
1779
  () => ({
1780
1780
  ctrls: [],
1781
1781
  queue: [],
1782
1782
  flush(y, b) {
1783
1783
  const p = Qi(y, b);
1784
1784
  return a.current > 0 && !s.queue.length && !Object.keys(p).some((M) => !y.springs[M]) ? Dr(y, b) : new Promise((M) => {
1785
- go(y, p), s.queue.push(() => {
1785
+ mo(y, p), s.queue.push(() => {
1786
1786
  M(Dr(y, b));
1787
1787
  }), o();
1788
1788
  });
@@ -1799,7 +1799,7 @@ function mu(e, t, n) {
1799
1799
  }, n);
1800
1800
  function h(y, b) {
1801
1801
  for (let p = y; p < b; p++) {
1802
- const _ = c.current[p] || (c.current[p] = new hu(null, s.flush)), M = r ? r(p, _) : t[p];
1802
+ const w = c.current[p] || (c.current[p] = new hu(null, s.flush)), M = r ? r(p, w) : t[p];
1803
1803
  M && (u[p] = su(M));
1804
1804
  }
1805
1805
  }
@@ -1809,10 +1809,10 @@ function mu(e, t, n) {
1809
1809
  const { queue: y } = s;
1810
1810
  y.length && (s.queue = [], U(y, (b) => b())), U(c.current, (b, p) => {
1811
1811
  i?.add(b), g && b.start({ default: d });
1812
- const _ = u[p];
1813
- _ && (tu(b, _.ref), b.ref ? b.queue.push(_) : b.start(_));
1812
+ const w = u[p];
1813
+ w && (tu(b, w.ref), b.ref ? b.queue.push(w) : b.start(w));
1814
1814
  });
1815
- }), to(() => () => {
1815
+ }), eo(() => () => {
1816
1816
  U(s.ctrls, (y) => y.stop(!0));
1817
1817
  });
1818
1818
  const x = f.map((y) => ({ ...y }));
@@ -1826,7 +1826,7 @@ function Kn(e, t) {
1826
1826
  );
1827
1827
  return n || arguments.length == 2 ? [r, i] : r;
1828
1828
  }
1829
- var bo = class extends gi {
1829
+ var xo = class extends gi {
1830
1830
  constructor(e, t) {
1831
1831
  super(), this.source = e, this.idle = !0, this._active = /* @__PURE__ */ new Set(), this.calc = zt(...t);
1832
1832
  const n = this._get(), r = Ar(n);
@@ -1843,7 +1843,7 @@ var bo = class extends gi {
1843
1843
  _start() {
1844
1844
  this.idle && !Xi(this._active) && (this.idle = !1, U(Qn(this), (e) => {
1845
1845
  e.done = !1;
1846
- }), Ne.skipAnimation ? (A.batchedUpdates(() => this.advance()), cr(this)) : Hn.start(this));
1846
+ }), Ne.skipAnimation ? (E.batchedUpdates(() => this.advance()), cr(this)) : Hn.start(this));
1847
1847
  }
1848
1848
  // Observe our sources only when we're observed.
1849
1849
  _attach() {
@@ -1880,14 +1880,14 @@ function cr(e) {
1880
1880
  parent: e
1881
1881
  }));
1882
1882
  }
1883
- var yu = (e, ...t) => new bo(e, t);
1883
+ var yu = (e, ...t) => new xo(e, t);
1884
1884
  Ne.assign({
1885
- createStringInterpolator: Ka,
1886
- to: (e, t) => new bo(e, t)
1885
+ createStringInterpolator: Za,
1886
+ to: (e, t) => new xo(e, t)
1887
1887
  });
1888
- var vo = /^--/;
1888
+ var bo = /^--/;
1889
1889
  function pu(e, t) {
1890
- return t == null || typeof t == "boolean" || t === "" ? "" : typeof t == "number" && t !== 0 && !vo.test(e) && !(Ut.hasOwnProperty(e) && Ut[e]) ? t + "px" : ("" + t).trim();
1890
+ return t == null || typeof t == "boolean" || t === "" ? "" : typeof t == "number" && t !== 0 && !bo.test(e) && !(Ut.hasOwnProperty(e) && Ut[e]) ? t + "px" : ("" + t).trim();
1891
1891
  }
1892
1892
  var Zi = {};
1893
1893
  function xu(e, t) {
@@ -1912,7 +1912,7 @@ function xu(e, t) {
1912
1912
  for (const f in i)
1913
1913
  if (i.hasOwnProperty(f)) {
1914
1914
  const d = pu(f, i[f]);
1915
- vo.test(f) ? e.style.setProperty(f, d) : e.style[f] = d;
1915
+ bo.test(f) ? e.style.setProperty(f, d) : e.style[f] = d;
1916
1916
  }
1917
1917
  h.forEach((f, d) => {
1918
1918
  e.setAttribute(f, l[d]);
@@ -1989,7 +1989,7 @@ var wu = /^(matrix|translate|scale|rotate|skew)/, _u = /^(translate)/, Nu = /^(r
1989
1989
  }
1990
1990
  }), i.length && (r.transform = new Cu(i, a)), super(r);
1991
1991
  }
1992
- }, Cu = class extends Qa {
1992
+ }, Cu = class extends Ga {
1993
1993
  constructor(e, t) {
1994
1994
  super(), this.inputs = e, this.transforms = t, this._value = null;
1995
1995
  }
@@ -2166,7 +2166,7 @@ var wu = /^(matrix|translate|scale|rotate|skew)/, _u = /^(translate)/, Nu = /^(r
2166
2166
  ];
2167
2167
  Ne.assign({
2168
2168
  batchedUpdates: us,
2169
- createStringInterpolator: Ka,
2169
+ createStringInterpolator: Za,
2170
2170
  colors: ys
2171
2171
  });
2172
2172
  var $u = Gs(Su, {
@@ -2263,14 +2263,14 @@ const Lu = function(e) {
2263
2263
  ...i
2264
2264
  }
2265
2265
  ) : /* @__PURE__ */ $($e.rect, { className: "node-shape", ...n });
2266
- }, hr = (e) => e instanceof ho;
2266
+ }, hr = (e) => e instanceof lo;
2267
2267
  function Ji(e, t, n) {
2268
2268
  return hr(e) || hr(t) || hr(n) ? yu(
2269
2269
  [e, t, n],
2270
2270
  (r, i, a) => `translate(${r},${i}) rotate(${a})`
2271
2271
  ) : `translate(${e},${t}) rotate(${n})`;
2272
2272
  }
2273
- function wo(e) {
2273
+ function vo(e) {
2274
2274
  const {
2275
2275
  alignmentBaseline: t,
2276
2276
  textAnchor: n,
@@ -2366,7 +2366,7 @@ function Mn(e, t) {
2366
2366
  function Uu(e, t) {
2367
2367
  return e == null || t == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
2368
2368
  }
2369
- function _o(e) {
2369
+ function wo(e) {
2370
2370
  let t, n, r;
2371
2371
  e.length !== 2 ? (t = Mn, n = (s, c) => Mn(e(s), c), r = (s, c) => e(s) - c) : (t = e === Mn || e === Uu ? e : Ou, n = e, r = e);
2372
2372
  function i(s, c, u = 0, l = s.length) {
@@ -2401,8 +2401,8 @@ function Ou() {
2401
2401
  function zu(e) {
2402
2402
  return e === null ? NaN : +e;
2403
2403
  }
2404
- const Bu = _o(Mn), Vu = Bu.right;
2405
- _o(zu).center;
2404
+ const Bu = wo(Mn), Vu = Bu.right;
2405
+ wo(zu).center;
2406
2406
  function ft(e, t) {
2407
2407
  let n, r;
2408
2408
  if (t === void 0)
@@ -2635,7 +2635,7 @@ function Ae(e, t, n, r) {
2635
2635
  ;
2636
2636
  }), n && (i.count = (a, o) => (fr.setTime(+a), dr.setTime(+o), e(fr), e(dr), Math.floor(n(fr, dr))), i.every = (a) => (a = Math.floor(a), !isFinite(a) || !(a > 0) ? null : a > 1 ? i.filter(r ? (o) => r(o) % a === 0 : (o) => i.count(0, o) % a === 0) : i)), i;
2637
2637
  }
2638
- const Ju = 1e3, xi = Ju * 60, ec = xi * 60, Qt = ec * 24, No = Qt * 7, bi = Ae(
2638
+ const Ju = 1e3, xi = Ju * 60, ec = xi * 60, Qt = ec * 24, _o = Qt * 7, bi = Ae(
2639
2639
  (e) => e.setHours(0, 0, 0, 0),
2640
2640
  (e, t) => e.setDate(e.getDate() + t),
2641
2641
  (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * xi) / Qt,
@@ -2659,10 +2659,10 @@ function nt(e) {
2659
2659
  t.setDate(t.getDate() - (t.getDay() + 7 - e) % 7), t.setHours(0, 0, 0, 0);
2660
2660
  }, (t, n) => {
2661
2661
  t.setDate(t.getDate() + n * 7);
2662
- }, (t, n) => (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * xi) / No);
2662
+ }, (t, n) => (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * xi) / _o);
2663
2663
  }
2664
- const Mo = nt(0), An = nt(1), nc = nt(2), rc = nt(3), dt = nt(4), ic = nt(5), ac = nt(6);
2665
- Mo.range;
2664
+ const No = nt(0), An = nt(1), nc = nt(2), rc = nt(3), dt = nt(4), ic = nt(5), ac = nt(6);
2665
+ No.range;
2666
2666
  An.range;
2667
2667
  nc.range;
2668
2668
  rc.range;
@@ -2674,10 +2674,10 @@ function rt(e) {
2674
2674
  t.setUTCDate(t.getUTCDate() - (t.getUTCDay() + 7 - e) % 7), t.setUTCHours(0, 0, 0, 0);
2675
2675
  }, (t, n) => {
2676
2676
  t.setUTCDate(t.getUTCDate() + n * 7);
2677
- }, (t, n) => (n - t) / No);
2677
+ }, (t, n) => (n - t) / _o);
2678
2678
  }
2679
- const Co = rt(0), En = rt(1), oc = rt(2), sc = rt(3), mt = rt(4), uc = rt(5), cc = rt(6);
2680
- Co.range;
2679
+ const Mo = rt(0), En = rt(1), oc = rt(2), sc = rt(3), mt = rt(4), uc = rt(5), cc = rt(6);
2680
+ Mo.range;
2681
2681
  En.range;
2682
2682
  oc.range;
2683
2683
  sc.range;
@@ -2738,7 +2738,7 @@ function lc(e) {
2738
2738
  H: Pc,
2739
2739
  I: Ac,
2740
2740
  j: Ec,
2741
- L: So,
2741
+ L: Co,
2742
2742
  m: Ic,
2743
2743
  M: Lc,
2744
2744
  p: Me,
@@ -2757,7 +2757,7 @@ function lc(e) {
2757
2757
  Y: qc,
2758
2758
  Z: Yc,
2759
2759
  "%": ua
2760
- }, _ = {
2760
+ }, w = {
2761
2761
  a: Be,
2762
2762
  A: Nt,
2763
2763
  b: be,
@@ -2771,7 +2771,7 @@ function lc(e) {
2771
2771
  H: Wc,
2772
2772
  I: Gc,
2773
2773
  j: Qc,
2774
- L: ko,
2774
+ L: $o,
2775
2775
  m: Zc,
2776
2776
  M: Kc,
2777
2777
  p: Ct,
@@ -2792,10 +2792,10 @@ function lc(e) {
2792
2792
  "%": ua
2793
2793
  }, M = {
2794
2794
  a: F,
2795
- A: v,
2796
- b: E,
2795
+ A: _,
2796
+ b: P,
2797
2797
  B: C,
2798
- c: P,
2798
+ c: A,
2799
2799
  d: ia,
2800
2800
  e: ia,
2801
2801
  f: Sc,
@@ -2807,7 +2807,7 @@ function lc(e) {
2807
2807
  L: Cc,
2808
2808
  m: wc,
2809
2809
  M: Nc,
2810
- p: I,
2810
+ p: R,
2811
2811
  q: vc,
2812
2812
  Q: kc,
2813
2813
  s: Tc,
@@ -2824,66 +2824,66 @@ function lc(e) {
2824
2824
  Z: bc,
2825
2825
  "%": $c
2826
2826
  };
2827
- p.x = k(n, p), p.X = k(r, p), p.c = k(t, p), _.x = k(n, _), _.X = k(r, _), _.c = k(t, _);
2827
+ p.x = k(n, p), p.X = k(r, p), p.c = k(t, p), w.x = k(n, w), w.X = k(r, w), w.c = k(t, w);
2828
2828
  function k(S, L) {
2829
2829
  return function(D) {
2830
- var w = [], ne = -1, j = 0, ue = S.length, ce, Ve, Pi;
2830
+ var v = [], ne = -1, j = 0, ue = S.length, ce, Ve, Pi;
2831
2831
  for (D instanceof Date || (D = /* @__PURE__ */ new Date(+D)); ++ne < ue; )
2832
- S.charCodeAt(ne) === 37 && (w.push(S.slice(j, ne)), (Ve = ta[ce = S.charAt(++ne)]) != null ? ce = S.charAt(++ne) : Ve = ce === "e" ? " " : "0", (Pi = L[ce]) && (ce = Pi(D, Ve)), w.push(ce), j = ne + 1);
2833
- return w.push(S.slice(j, ne)), w.join("");
2832
+ S.charCodeAt(ne) === 37 && (v.push(S.slice(j, ne)), (Ve = ta[ce = S.charAt(++ne)]) != null ? ce = S.charAt(++ne) : Ve = ce === "e" ? " " : "0", (Pi = L[ce]) && (ce = Pi(D, Ve)), v.push(ce), j = ne + 1);
2833
+ return v.push(S.slice(j, ne)), v.join("");
2834
2834
  };
2835
2835
  }
2836
2836
  function T(S, L) {
2837
2837
  return function(D) {
2838
- var w = Pt(1900, void 0, 1), ne = R(w, S, D += "", 0), j, ue;
2838
+ var v = Pt(1900, void 0, 1), ne = I(v, S, D += "", 0), j, ue;
2839
2839
  if (ne != D.length) return null;
2840
- if ("Q" in w) return new Date(w.Q);
2841
- if ("s" in w) return new Date(w.s * 1e3 + ("L" in w ? w.L : 0));
2842
- if (L && !("Z" in w) && (w.Z = 0), "p" in w && (w.H = w.H % 12 + w.p * 12), w.m === void 0 && (w.m = "q" in w ? w.q : 0), "V" in w) {
2843
- if (w.V < 1 || w.V > 53) return null;
2844
- "w" in w || (w.w = 1), "Z" in w ? (j = gr(Pt(w.y, 0, 1)), ue = j.getUTCDay(), j = ue > 4 || ue === 0 ? En.ceil(j) : En(j), j = vi.offset(j, (w.V - 1) * 7), w.y = j.getUTCFullYear(), w.m = j.getUTCMonth(), w.d = j.getUTCDate() + (w.w + 6) % 7) : (j = mr(Pt(w.y, 0, 1)), ue = j.getDay(), j = ue > 4 || ue === 0 ? An.ceil(j) : An(j), j = bi.offset(j, (w.V - 1) * 7), w.y = j.getFullYear(), w.m = j.getMonth(), w.d = j.getDate() + (w.w + 6) % 7);
2845
- } else ("W" in w || "U" in w) && ("w" in w || (w.w = "u" in w ? w.u % 7 : "W" in w ? 1 : 0), ue = "Z" in w ? gr(Pt(w.y, 0, 1)).getUTCDay() : mr(Pt(w.y, 0, 1)).getDay(), w.m = 0, w.d = "W" in w ? (w.w + 6) % 7 + w.W * 7 - (ue + 5) % 7 : w.w + w.U * 7 - (ue + 6) % 7);
2846
- return "Z" in w ? (w.H += w.Z / 100 | 0, w.M += w.Z % 100, gr(w)) : mr(w);
2840
+ if ("Q" in v) return new Date(v.Q);
2841
+ if ("s" in v) return new Date(v.s * 1e3 + ("L" in v ? v.L : 0));
2842
+ if (L && !("Z" in v) && (v.Z = 0), "p" in v && (v.H = v.H % 12 + v.p * 12), v.m === void 0 && (v.m = "q" in v ? v.q : 0), "V" in v) {
2843
+ if (v.V < 1 || v.V > 53) return null;
2844
+ "w" in v || (v.w = 1), "Z" in v ? (j = gr(Pt(v.y, 0, 1)), ue = j.getUTCDay(), j = ue > 4 || ue === 0 ? En.ceil(j) : En(j), j = vi.offset(j, (v.V - 1) * 7), v.y = j.getUTCFullYear(), v.m = j.getUTCMonth(), v.d = j.getUTCDate() + (v.w + 6) % 7) : (j = mr(Pt(v.y, 0, 1)), ue = j.getDay(), j = ue > 4 || ue === 0 ? An.ceil(j) : An(j), j = bi.offset(j, (v.V - 1) * 7), v.y = j.getFullYear(), v.m = j.getMonth(), v.d = j.getDate() + (v.w + 6) % 7);
2845
+ } else ("W" in v || "U" in v) && ("w" in v || (v.w = "u" in v ? v.u % 7 : "W" in v ? 1 : 0), ue = "Z" in v ? gr(Pt(v.y, 0, 1)).getUTCDay() : mr(Pt(v.y, 0, 1)).getDay(), v.m = 0, v.d = "W" in v ? (v.w + 6) % 7 + v.W * 7 - (ue + 5) % 7 : v.w + v.U * 7 - (ue + 6) % 7);
2846
+ return "Z" in v ? (v.H += v.Z / 100 | 0, v.M += v.Z % 100, gr(v)) : mr(v);
2847
2847
  };
2848
2848
  }
2849
- function R(S, L, D, w) {
2849
+ function I(S, L, D, v) {
2850
2850
  for (var ne = 0, j = L.length, ue = D.length, ce, Ve; ne < j; ) {
2851
- if (w >= ue) return -1;
2851
+ if (v >= ue) return -1;
2852
2852
  if (ce = L.charCodeAt(ne++), ce === 37) {
2853
- if (ce = L.charAt(ne++), Ve = M[ce in ta ? L.charAt(ne++) : ce], !Ve || (w = Ve(S, D, w)) < 0) return -1;
2854
- } else if (ce != D.charCodeAt(w++))
2853
+ if (ce = L.charAt(ne++), Ve = M[ce in ta ? L.charAt(ne++) : ce], !Ve || (v = Ve(S, D, v)) < 0) return -1;
2854
+ } else if (ce != D.charCodeAt(v++))
2855
2855
  return -1;
2856
2856
  }
2857
- return w;
2857
+ return v;
2858
2858
  }
2859
- function I(S, L, D) {
2860
- var w = u.exec(L.slice(D));
2861
- return w ? (S.p = l.get(w[0].toLowerCase()), D + w[0].length) : -1;
2859
+ function R(S, L, D) {
2860
+ var v = u.exec(L.slice(D));
2861
+ return v ? (S.p = l.get(v[0].toLowerCase()), D + v[0].length) : -1;
2862
2862
  }
2863
2863
  function F(S, L, D) {
2864
- var w = d.exec(L.slice(D));
2865
- return w ? (S.w = m.get(w[0].toLowerCase()), D + w[0].length) : -1;
2864
+ var v = d.exec(L.slice(D));
2865
+ return v ? (S.w = m.get(v[0].toLowerCase()), D + v[0].length) : -1;
2866
2866
  }
2867
- function v(S, L, D) {
2868
- var w = h.exec(L.slice(D));
2869
- return w ? (S.w = f.get(w[0].toLowerCase()), D + w[0].length) : -1;
2867
+ function _(S, L, D) {
2868
+ var v = h.exec(L.slice(D));
2869
+ return v ? (S.w = f.get(v[0].toLowerCase()), D + v[0].length) : -1;
2870
2870
  }
2871
- function E(S, L, D) {
2872
- var w = y.exec(L.slice(D));
2873
- return w ? (S.m = b.get(w[0].toLowerCase()), D + w[0].length) : -1;
2871
+ function P(S, L, D) {
2872
+ var v = y.exec(L.slice(D));
2873
+ return v ? (S.m = b.get(v[0].toLowerCase()), D + v[0].length) : -1;
2874
2874
  }
2875
2875
  function C(S, L, D) {
2876
- var w = g.exec(L.slice(D));
2877
- return w ? (S.m = x.get(w[0].toLowerCase()), D + w[0].length) : -1;
2876
+ var v = g.exec(L.slice(D));
2877
+ return v ? (S.m = x.get(v[0].toLowerCase()), D + v[0].length) : -1;
2878
2878
  }
2879
- function P(S, L, D) {
2880
- return R(S, t, L, D);
2879
+ function A(S, L, D) {
2880
+ return I(S, t, L, D);
2881
2881
  }
2882
2882
  function K(S, L, D) {
2883
- return R(S, n, L, D);
2883
+ return I(S, n, L, D);
2884
2884
  }
2885
2885
  function Y(S, L, D) {
2886
- return R(S, r, L, D);
2886
+ return I(S, r, L, D);
2887
2887
  }
2888
2888
  function z(S) {
2889
2889
  return o[S.getDay()];
@@ -2935,7 +2935,7 @@ function lc(e) {
2935
2935
  }, L;
2936
2936
  },
2937
2937
  utcFormat: function(S) {
2938
- var L = k(S += "", _);
2938
+ var L = k(S += "", w);
2939
2939
  return L.toString = function() {
2940
2940
  return S;
2941
2941
  }, L;
@@ -3054,11 +3054,11 @@ function Ac(e, t) {
3054
3054
  function Ec(e, t) {
3055
3055
  return O(1 + bi.count(Ke(e), e), t, 3);
3056
3056
  }
3057
- function So(e, t) {
3057
+ function Co(e, t) {
3058
3058
  return O(e.getMilliseconds(), t, 3);
3059
3059
  }
3060
3060
  function Rc(e, t) {
3061
- return So(e, t) + "000";
3061
+ return Co(e, t) + "000";
3062
3062
  }
3063
3063
  function Ic(e, t) {
3064
3064
  return O(e.getMonth() + 1, t, 2);
@@ -3074,14 +3074,14 @@ function Dc(e) {
3074
3074
  return t === 0 ? 7 : t;
3075
3075
  }
3076
3076
  function Uc(e, t) {
3077
- return O(Mo.count(Ke(e) - 1, e), t, 2);
3077
+ return O(No.count(Ke(e) - 1, e), t, 2);
3078
3078
  }
3079
- function $o(e) {
3079
+ function So(e) {
3080
3080
  var t = e.getDay();
3081
3081
  return t >= 4 || t === 0 ? dt(e) : dt.ceil(e);
3082
3082
  }
3083
3083
  function Oc(e, t) {
3084
- return e = $o(e), O(dt.count(Ke(e), e) + (Ke(e).getDay() === 4), t, 2);
3084
+ return e = So(e), O(dt.count(Ke(e), e) + (Ke(e).getDay() === 4), t, 2);
3085
3085
  }
3086
3086
  function zc(e) {
3087
3087
  return e.getDay();
@@ -3093,7 +3093,7 @@ function Vc(e, t) {
3093
3093
  return O(e.getFullYear() % 100, t, 2);
3094
3094
  }
3095
3095
  function jc(e, t) {
3096
- return e = $o(e), O(e.getFullYear() % 100, t, 2);
3096
+ return e = So(e), O(e.getFullYear() % 100, t, 2);
3097
3097
  }
3098
3098
  function qc(e, t) {
3099
3099
  return O(e.getFullYear() % 1e4, t, 4);
@@ -3118,11 +3118,11 @@ function Gc(e, t) {
3118
3118
  function Qc(e, t) {
3119
3119
  return O(1 + vi.count(Je(e), e), t, 3);
3120
3120
  }
3121
- function ko(e, t) {
3121
+ function $o(e, t) {
3122
3122
  return O(e.getUTCMilliseconds(), t, 3);
3123
3123
  }
3124
3124
  function Xc(e, t) {
3125
- return ko(e, t) + "000";
3125
+ return $o(e, t) + "000";
3126
3126
  }
3127
3127
  function Zc(e, t) {
3128
3128
  return O(e.getUTCMonth() + 1, t, 2);
@@ -3138,14 +3138,14 @@ function el(e) {
3138
3138
  return t === 0 ? 7 : t;
3139
3139
  }
3140
3140
  function tl(e, t) {
3141
- return O(Co.count(Je(e) - 1, e), t, 2);
3141
+ return O(Mo.count(Je(e) - 1, e), t, 2);
3142
3142
  }
3143
- function To(e) {
3143
+ function ko(e) {
3144
3144
  var t = e.getUTCDay();
3145
3145
  return t >= 4 || t === 0 ? mt(e) : mt.ceil(e);
3146
3146
  }
3147
3147
  function nl(e, t) {
3148
- return e = To(e), O(mt.count(Je(e), e) + (Je(e).getUTCDay() === 4), t, 2);
3148
+ return e = ko(e), O(mt.count(Je(e), e) + (Je(e).getUTCDay() === 4), t, 2);
3149
3149
  }
3150
3150
  function rl(e) {
3151
3151
  return e.getUTCDay();
@@ -3157,7 +3157,7 @@ function al(e, t) {
3157
3157
  return O(e.getUTCFullYear() % 100, t, 2);
3158
3158
  }
3159
3159
  function ol(e, t) {
3160
- return e = To(e), O(e.getUTCFullYear() % 100, t, 2);
3160
+ return e = ko(e), O(e.getUTCFullYear() % 100, t, 2);
3161
3161
  }
3162
3162
  function sl(e, t) {
3163
3163
  return O(e.getUTCFullYear() % 1e4, t, 4);
@@ -3178,7 +3178,7 @@ function ca(e) {
3178
3178
  function la(e) {
3179
3179
  return Math.floor(+e / 1e3);
3180
3180
  }
3181
- var at, Or, Po;
3181
+ var at, Or, To;
3182
3182
  ll({
3183
3183
  dateTime: "%x, %X",
3184
3184
  date: "%-m/%-d/%Y",
@@ -3190,23 +3190,23 @@ ll({
3190
3190
  shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
3191
3191
  });
3192
3192
  function ll(e) {
3193
- return at = lc(e), Or = at.format, Po = at.parse, at.utcFormat, at.utcParse, at;
3193
+ return at = lc(e), Or = at.format, To = at.parse, at.utcFormat, at.utcParse, at;
3194
3194
  }
3195
- function Ao(e) {
3195
+ function Po(e) {
3196
3196
  return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0;
3197
3197
  }
3198
- function Of(e) {
3199
- const t = Math.trunc(e), n = Ao(t) ? 366 : 365, r = Math.round((e - t) * n), i = Po("%Y-%j")(`${t}-${r}`);
3198
+ function Bf(e) {
3199
+ const t = Math.trunc(e), n = Po(t) ? 366 : 365, r = Math.round((e - t) * n), i = To("%Y-%j")(`${t}-${r}`);
3200
3200
  return pe(
3201
3201
  i,
3202
3202
  `Could not convert ${e} to date tried (year:${t} - day: ${r})`
3203
3203
  );
3204
3204
  }
3205
- function zf(e) {
3206
- const t = parseInt(Or("%Y")(e)), n = parseInt(Or("%j")(e)), r = Ao(t) ? 366 : 365;
3205
+ function Vf(e) {
3206
+ const t = parseInt(Or("%Y")(e)), n = parseInt(Or("%j")(e)), r = Po(t) ? 366 : 365;
3207
3207
  return t + n / r;
3208
3208
  }
3209
- function Eo(e, t) {
3209
+ function Ao(e, t) {
3210
3210
  let n;
3211
3211
  if (t instanceof Object) {
3212
3212
  if (t.type === B.Nothing)
@@ -3274,7 +3274,7 @@ class tr {
3274
3274
  getTaxon(t) {
3275
3275
  const n = Xt(
3276
3276
  this._data,
3277
- Eo(this._data, t)
3277
+ Ao(this._data, t)
3278
3278
  );
3279
3279
  switch (n.type) {
3280
3280
  case B.Some:
@@ -3302,7 +3302,7 @@ class tr {
3302
3302
  return this._data.finalized;
3303
3303
  }
3304
3304
  }
3305
- class Ro {
3305
+ class Eo {
3306
3306
  done;
3307
3307
  started;
3308
3308
  level;
@@ -3314,7 +3314,7 @@ class Ro {
3314
3314
  tree;
3315
3315
  options;
3316
3316
  constructor(t = new tr(), n = {}) {
3317
- this.done = !1, this.started = !1, this.level = 0, this.currentNode = void 0, this.nodeStack = [], this.labelNext = !1, this.lengthNext = !1, this.taxonSet = t, this.options = n, this.tree = new qo({ taxonSet: this.taxonSet });
3317
+ this.done = !1, this.started = !1, this.level = 0, this.currentNode = void 0, this.nodeStack = [], this.labelNext = !1, this.lengthNext = !1, this.taxonSet = t, this.options = n, this.tree = new jo({ taxonSet: this.taxonSet });
3318
3318
  }
3319
3319
  isDone() {
3320
3320
  return this.done;
@@ -3329,6 +3329,10 @@ class Ro {
3329
3329
  throw new Error("No tree to give - parsing has not started.");
3330
3330
  return this.tree;
3331
3331
  }
3332
+ /**
3333
+ * Parse the next token
3334
+ * @param t token
3335
+ */
3332
3336
  parseCharacter(t) {
3333
3337
  if (this.done)
3334
3338
  throw new Error("Parsing is done. We have seen a ';'");
@@ -3438,53 +3442,53 @@ class Ro {
3438
3442
  }
3439
3443
  }
3440
3444
  function zr(e, t = {}) {
3441
- const n = t.taxonSet ? t.taxonSet : new tr(), r = e.split(/\s*('[^']+'|"[^"]+"|\[&[^[]+]|,|:|\)|\(|;)\s*/).filter((o) => o.length > 0), i = new Ro(n, t);
3445
+ const n = t.taxonSet ? t.taxonSet : new tr(), r = e.split(/\s*('[^']+'|"[^"]+"|\[&[^[]+]|,|:|\)|\(|;)\s*/).filter((o) => o.length > 0), i = new Eo(n, t);
3442
3446
  for (const o of r)
3443
3447
  i.parseCharacter(o);
3444
3448
  return i.getTree();
3445
3449
  }
3446
- function fl(e, t, n = {}) {
3447
- const r = t.split(
3450
+ function fl(e, t = {}) {
3451
+ const n = e.split(
3448
3452
  /\s*(?:\bBegin\s+|\bbegin\s+|\bBEGIN\s+|\bend\s*;|\bEnd\s*;|\bEND\s*;)\s*/
3449
- ).filter((a) => a !== "");
3450
- if (r.length === 0 || r === void 0)
3453
+ ).filter((i) => i !== "");
3454
+ if (n.length === 0 || n === void 0)
3451
3455
  throw new Error(
3452
3456
  "No nexus tokens found in string. This may not be a nexus formated tree"
3453
3457
  );
3454
- if (r.shift().trim().toLowerCase() !== "#nexus")
3458
+ if (n.shift().trim().toLowerCase() !== "#nexus")
3455
3459
  throw Error("File does not begin with #NEXUS is it a nexus file?");
3456
- for (const a of r) {
3457
- const o = a.replace(/^\s+|\s+$/g, "").split(/\n/);
3458
- if (o.shift().toLowerCase().trim() === "trees;") {
3459
- let c = !1;
3460
- const u = /* @__PURE__ */ new Map();
3461
- for (const l of o)
3462
- if (l.trim().toLowerCase() === "translate")
3463
- c = !0;
3464
- else if (c)
3465
- if (l.trim() === ";")
3466
- c = !1;
3460
+ for (const i of n) {
3461
+ const a = i.replace(/^\s+|\s+$/g, "").split(/\n/);
3462
+ if (a.shift().toLowerCase().trim() === "trees;") {
3463
+ let s = !1;
3464
+ const c = /* @__PURE__ */ new Map();
3465
+ for (const u of a)
3466
+ if (u.trim().toLowerCase() === "translate")
3467
+ s = !0;
3468
+ else if (s)
3469
+ if (u.trim() === ";")
3470
+ s = !1;
3467
3471
  else {
3468
- const h = l.trim().replace(",", "").split(/\s*\s\s*/);
3469
- u.set(h[0], h[1]);
3472
+ const l = u.trim().replace(",", "").split(/\s*\s\s*/);
3473
+ c.set(l[0], l[1]);
3470
3474
  }
3471
3475
  else {
3472
- const h = l.substring(l.indexOf("("));
3473
- return u.size > 0 ? zr(h, {
3476
+ const l = u.substring(u.indexOf("("));
3477
+ return c.size > 0 ? zr(l, {
3474
3478
  parseAnnotations: !0,
3475
- ...n,
3476
- tipNameMap: u
3477
- }) : zr(h, {
3479
+ ...t,
3480
+ tipNameMap: c
3481
+ }) : zr(l, {
3478
3482
  parseAnnotations: !0,
3479
- ...n,
3480
- tipNameMap: u
3483
+ ...t,
3484
+ tipNameMap: c
3481
3485
  });
3482
3486
  }
3483
3487
  }
3484
3488
  }
3485
3489
  throw new Error("No tree section found in nexus file");
3486
3490
  }
3487
- var Io = Symbol.for("immer-nothing"), Br = Symbol.for("immer-draftable"), fe = Symbol.for("immer-state"), dl = process.env.NODE_ENV !== "production" ? [
3491
+ var Ro = Symbol.for("immer-nothing"), Br = Symbol.for("immer-draftable"), fe = Symbol.for("immer-state"), dl = process.env.NODE_ENV !== "production" ? [
3488
3492
  // All error codes, starting by 0:
3489
3493
  function(e) {
3490
3494
  return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
@@ -3529,10 +3533,10 @@ function yt(e) {
3529
3533
  return !!e && !!e[fe];
3530
3534
  }
3531
3535
  function et(e) {
3532
- return e ? Lo(e) || Array.isArray(e) || !!e[Br] || !!e.constructor?.[Br] || cn(e) || rr(e) : !1;
3536
+ return e ? Io(e) || Array.isArray(e) || !!e[Br] || !!e.constructor?.[Br] || cn(e) || rr(e) : !1;
3533
3537
  }
3534
3538
  var ml = Object.prototype.constructor.toString();
3535
- function Lo(e) {
3539
+ function Io(e) {
3536
3540
  if (!e || typeof e != "object")
3537
3541
  return !1;
3538
3542
  const t = gt(e);
@@ -3553,7 +3557,7 @@ function nr(e) {
3553
3557
  function Vr(e, t) {
3554
3558
  return nr(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
3555
3559
  }
3556
- function Fo(e, t, n) {
3560
+ function Lo(e, t, n) {
3557
3561
  const r = nr(e);
3558
3562
  r === 2 ? e.set(t, n) : r === 3 ? e.add(n) : e[t] = n;
3559
3563
  }
@@ -3576,7 +3580,7 @@ function jr(e, t) {
3576
3580
  return new Set(e);
3577
3581
  if (Array.isArray(e))
3578
3582
  return Array.prototype.slice.call(e);
3579
- const n = Lo(e);
3583
+ const n = Io(e);
3580
3584
  if (t === !0 || t === "class_only" && !n) {
3581
3585
  const r = Object.getOwnPropertyDescriptors(e);
3582
3586
  delete r[fe];
@@ -3620,7 +3624,7 @@ function tt(e) {
3620
3624
  return t || oe(0, e), t;
3621
3625
  }
3622
3626
  var Zt;
3623
- function Do() {
3627
+ function Fo() {
3624
3628
  return Zt;
3625
3629
  }
3626
3630
  function pl(e, t) {
@@ -3658,7 +3662,7 @@ function da(e, t) {
3658
3662
  e,
3659
3663
  t.patches_,
3660
3664
  t.inversePatches_
3661
- )) : e = In(t, n, []), qr(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== Io ? e : void 0;
3665
+ )) : e = In(t, n, []), qr(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== Ro ? e : void 0;
3662
3666
  }
3663
3667
  function In(e, t, n) {
3664
3668
  if (ir(t))
@@ -3693,7 +3697,7 @@ function ma(e, t, n, r, i, a, o) {
3693
3697
  if (process.env.NODE_ENV !== "production" && i === n && oe(5), yt(i)) {
3694
3698
  const s = a && t && t.type_ !== 3 && // Set objects are atomic since they have no keys.
3695
3699
  !Vr(t.assigned_, r) ? a.concat(r) : void 0, c = In(e, i, s);
3696
- if (Fo(n, r, c), yt(c))
3700
+ if (Lo(n, r, c), yt(c))
3697
3701
  e.canAutoFreeze_ = !1;
3698
3702
  else
3699
3703
  return;
@@ -3711,7 +3715,7 @@ function bl(e, t) {
3711
3715
  const n = Array.isArray(e), r = {
3712
3716
  type_: n ? 1 : 0,
3713
3717
  // Track which produce call this is associated with.
3714
- scope_: t ? t.scope_ : Do(),
3718
+ scope_: t ? t.scope_ : Fo(),
3715
3719
  // True for both shallow and deep changes.
3716
3720
  modified_: !1,
3717
3721
  // Used during finalization.
@@ -3753,7 +3757,7 @@ var _i = {
3753
3757
  return Reflect.ownKeys(qe(e));
3754
3758
  },
3755
3759
  set(e, t, n) {
3756
- const r = Uo(qe(e), t);
3760
+ const r = Do(qe(e), t);
3757
3761
  if (r?.set)
3758
3762
  return r.set.call(e.draft_, n), !0;
3759
3763
  if (!e.modified_) {
@@ -3808,14 +3812,14 @@ function yr(e, t) {
3808
3812
  return (n ? qe(n) : e)[t];
3809
3813
  }
3810
3814
  function vl(e, t, n) {
3811
- const r = Uo(t, n);
3815
+ const r = Do(t, n);
3812
3816
  return r ? "value" in r ? r.value : (
3813
3817
  // This is a very special case, if the prop is a getter defined by the
3814
3818
  // prototype, we should invoke it with the draft as context!
3815
3819
  r.get?.call(e.draft_)
3816
3820
  ) : void 0;
3817
3821
  }
3818
- function Uo(e, t) {
3822
+ function Do(e, t) {
3819
3823
  if (!(t in e))
3820
3824
  return;
3821
3825
  let n = gt(e);
@@ -3858,7 +3862,7 @@ var wl = class {
3858
3862
  }
3859
3863
  return ha(a, r), da(i, a);
3860
3864
  } else if (!t || typeof t != "object") {
3861
- if (i = n(t), i === void 0 && (i = t), i === Io && (i = void 0), this.autoFreeze_ && wi(i, !0), r) {
3865
+ if (i = n(t), i === void 0 && (i = t), i === Ro && (i = void 0), this.autoFreeze_ && wi(i, !0), r) {
3862
3866
  const a = [], o = [];
3863
3867
  tt("Patches").generateReplacementPatches_(t, i, a, o), r(a, o);
3864
3868
  }
@@ -3920,12 +3924,12 @@ var wl = class {
3920
3924
  };
3921
3925
  function Wr(e, t) {
3922
3926
  const n = cn(e) ? tt("MapSet").proxyMap_(e, t) : rr(e) ? tt("MapSet").proxySet_(e, t) : bl(e, t);
3923
- return (t ? t.scope_ : Do()).drafts_.push(n), n;
3927
+ return (t ? t.scope_ : Fo()).drafts_.push(n), n;
3924
3928
  }
3925
3929
  function _l(e) {
3926
- return yt(e) || oe(10, e), Oo(e);
3930
+ return yt(e) || oe(10, e), Uo(e);
3927
3931
  }
3928
- function Oo(e) {
3932
+ function Uo(e) {
3929
3933
  if (!et(e) || ir(e))
3930
3934
  return e;
3931
3935
  const t = e[fe];
@@ -3937,7 +3941,7 @@ function Oo(e) {
3937
3941
  } else
3938
3942
  n = jr(e, !0);
3939
3943
  return Rn(n, (r, i) => {
3940
- Fo(n, r, Oo(i));
3944
+ Lo(n, r, Uo(i));
3941
3945
  }), t && (t.finalized_ = !1), n;
3942
3946
  }
3943
3947
  var Nl = new wl(), J = Nl.produce;
@@ -4009,11 +4013,11 @@ function kl(e) {
4009
4013
  }
4010
4014
  return r > 0 ? e.slice(0, r) + e.slice(i + 1) : e;
4011
4015
  }
4012
- var zo;
4016
+ var Oo;
4013
4017
  function Tl(e, t) {
4014
4018
  var n = Fn(e, t);
4015
4019
  if (!n) return e + "";
4016
- var r = n[0], i = n[1], a = i - (zo = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
4020
+ var r = n[0], i = n[1], a = i - (Oo = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
4017
4021
  return a === o ? r : a > o ? r + new Array(a - o + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + new Array(1 - a).join("0") + Fn(e, Math.max(0, t + a - 1))[0];
4018
4022
  }
4019
4023
  function ga(e, t) {
@@ -4045,42 +4049,42 @@ function Pl(e) {
4045
4049
  var t = e.grouping === void 0 || e.thousands === void 0 ? pa : Cl(xa.call(e.grouping, Number), e.thousands + ""), n = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", a = e.numerals === void 0 ? pa : Sl(xa.call(e.numerals, String)), o = e.percent === void 0 ? "%" : e.percent + "", s = e.minus === void 0 ? "−" : e.minus + "", c = e.nan === void 0 ? "NaN" : e.nan + "";
4046
4050
  function u(h) {
4047
4051
  h = Dn(h);
4048
- var f = h.fill, d = h.align, m = h.sign, g = h.symbol, x = h.zero, y = h.width, b = h.comma, p = h.precision, _ = h.trim, M = h.type;
4049
- M === "n" ? (b = !0, M = "g") : ya[M] || (p === void 0 && (p = 12), _ = !0, M = "g"), (x || f === "0" && d === "=") && (x = !0, f = "0", d = "=");
4050
- var k = g === "$" ? n : g === "#" && /[boxX]/.test(M) ? "0" + M.toLowerCase() : "", T = g === "$" ? r : /[%p]/.test(M) ? o : "", R = ya[M], I = /[defgprs%]/.test(M);
4052
+ var f = h.fill, d = h.align, m = h.sign, g = h.symbol, x = h.zero, y = h.width, b = h.comma, p = h.precision, w = h.trim, M = h.type;
4053
+ M === "n" ? (b = !0, M = "g") : ya[M] || (p === void 0 && (p = 12), w = !0, M = "g"), (x || f === "0" && d === "=") && (x = !0, f = "0", d = "=");
4054
+ var k = g === "$" ? n : g === "#" && /[boxX]/.test(M) ? "0" + M.toLowerCase() : "", T = g === "$" ? r : /[%p]/.test(M) ? o : "", I = ya[M], R = /[defgprs%]/.test(M);
4051
4055
  p = p === void 0 ? 6 : /[gprs]/.test(M) ? Math.max(1, Math.min(21, p)) : Math.max(0, Math.min(20, p));
4052
- function F(v) {
4053
- var E = k, C = T, P, K, Y;
4056
+ function F(_) {
4057
+ var P = k, C = T, A, K, Y;
4054
4058
  if (M === "c")
4055
- C = R(v) + C, v = "";
4059
+ C = I(_) + C, _ = "";
4056
4060
  else {
4057
- v = +v;
4058
- var z = v < 0 || 1 / v < 0;
4059
- if (v = isNaN(v) ? c : R(Math.abs(v), p), _ && (v = kl(v)), z && +v == 0 && m !== "+" && (z = !1), E = (z ? m === "(" ? m : s : m === "-" || m === "(" ? "" : m) + E, C = (M === "s" ? ba[8 + zo / 3] : "") + C + (z && m === "(" ? ")" : ""), I) {
4060
- for (P = -1, K = v.length; ++P < K; )
4061
- if (Y = v.charCodeAt(P), 48 > Y || Y > 57) {
4062
- C = (Y === 46 ? i + v.slice(P + 1) : v.slice(P)) + C, v = v.slice(0, P);
4061
+ _ = +_;
4062
+ var z = _ < 0 || 1 / _ < 0;
4063
+ if (_ = isNaN(_) ? c : I(Math.abs(_), p), w && (_ = kl(_)), z && +_ == 0 && m !== "+" && (z = !1), P = (z ? m === "(" ? m : s : m === "-" || m === "(" ? "" : m) + P, C = (M === "s" ? ba[8 + Oo / 3] : "") + C + (z && m === "(" ? ")" : ""), R) {
4064
+ for (A = -1, K = _.length; ++A < K; )
4065
+ if (Y = _.charCodeAt(A), 48 > Y || Y > 57) {
4066
+ C = (Y === 46 ? i + _.slice(A + 1) : _.slice(A)) + C, _ = _.slice(0, A);
4063
4067
  break;
4064
4068
  }
4065
4069
  }
4066
4070
  }
4067
- b && !x && (v = t(v, 1 / 0));
4068
- var W = E.length + v.length + C.length, G = W < y ? new Array(y - W + 1).join(f) : "";
4069
- switch (b && x && (v = t(G + v, G.length ? y - C.length : 1 / 0), G = ""), d) {
4071
+ b && !x && (_ = t(_, 1 / 0));
4072
+ var W = P.length + _.length + C.length, G = W < y ? new Array(y - W + 1).join(f) : "";
4073
+ switch (b && x && (_ = t(G + _, G.length ? y - C.length : 1 / 0), G = ""), d) {
4070
4074
  case "<":
4071
- v = E + v + C + G;
4075
+ _ = P + _ + C + G;
4072
4076
  break;
4073
4077
  case "=":
4074
- v = E + G + v + C;
4078
+ _ = P + G + _ + C;
4075
4079
  break;
4076
4080
  case "^":
4077
- v = G.slice(0, W = G.length >> 1) + E + v + C + G.slice(W);
4081
+ _ = G.slice(0, W = G.length >> 1) + P + _ + C + G.slice(W);
4078
4082
  break;
4079
4083
  default:
4080
- v = G + E + v + C;
4084
+ _ = G + P + _ + C;
4081
4085
  break;
4082
4086
  }
4083
- return a(v);
4087
+ return a(_);
4084
4088
  }
4085
4089
  return F.toString = function() {
4086
4090
  return h + "";
@@ -4097,14 +4101,14 @@ function Pl(e) {
4097
4101
  formatPrefix: l
4098
4102
  };
4099
4103
  }
4100
- var gn, Jt, Bo;
4104
+ var gn, Jt, zo;
4101
4105
  Al({
4102
4106
  thousands: ",",
4103
4107
  grouping: [3],
4104
4108
  currency: ["$", ""]
4105
4109
  });
4106
4110
  function Al(e) {
4107
- return gn = Pl(e), Jt = gn.format, Bo = gn.formatPrefix, gn;
4111
+ return gn = Pl(e), Jt = gn.format, zo = gn.formatPrefix, gn;
4108
4112
  }
4109
4113
  function El(e) {
4110
4114
  return Math.max(0, -pt(Math.abs(e)));
@@ -4115,13 +4119,13 @@ function Rl(e, t) {
4115
4119
  function Il(e, t) {
4116
4120
  return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, pt(t) - pt(e)) + 1;
4117
4121
  }
4118
- function Vo(e, t) {
4122
+ function Bo(e, t) {
4119
4123
  const n = e._data.nodes.allNodes[t];
4120
4124
  return n === void 0 ? Pe() : er(n);
4121
4125
  }
4122
4126
  function Mi(e, t) {
4123
4127
  if (typeof t == "number")
4124
- return Vo(e, t);
4128
+ return Bo(e, t);
4125
4129
  if (t instanceof Object)
4126
4130
  return Gr(e, t);
4127
4131
  if (typeof t == "string") {
@@ -4136,7 +4140,7 @@ function Gr(e, t) {
4136
4140
  }
4137
4141
  function Ll(e, t) {
4138
4142
  const n = e._data.nodes.byLabel[t];
4139
- return n === void 0 ? Pe() : Vo(e, n);
4143
+ return n === void 0 ? Pe() : Bo(e, n);
4140
4144
  }
4141
4145
  function xr(e, t, n) {
4142
4146
  const r = e.getNode(t.number).annotations[n];
@@ -4144,12 +4148,12 @@ function xr(e, t, n) {
4144
4148
  }
4145
4149
  function Qr(e, t) {
4146
4150
  const n = e._data.nodeToTaxon[t.number];
4147
- return n === void 0 ? Pe() : jo(e, n);
4151
+ return n === void 0 ? Pe() : Vo(e, n);
4148
4152
  }
4149
- function jo(e, t) {
4153
+ function Vo(e, t) {
4150
4154
  return typeof t == "number" ? Xt(
4151
4155
  e.taxonSet._data,
4152
- Eo(e.taxonSet._data, t)
4156
+ Ao(e.taxonSet._data, t)
4153
4157
  ) : typeof t == "string" ? Xt(e.taxonSet._data, t) : Qr(e, t);
4154
4158
  }
4155
4159
  function br(e, t) {
@@ -4185,7 +4189,7 @@ function zl(e, t, n) {
4185
4189
  function yn(e, t, n) {
4186
4190
  return va.randomUUID && !e ? va.randomUUID() : zl(e);
4187
4191
  }
4188
- class qo {
4192
+ class jo {
4189
4193
  //TODO remove the TaxonSetInterface implementation.
4190
4194
  [Br] = !0;
4191
4195
  _data;
@@ -4235,8 +4239,7 @@ class qo {
4235
4239
  return zr(t, n);
4236
4240
  }
4237
4241
  static fromNexus(t, n) {
4238
- const r = new this();
4239
- return fl(r, t, n);
4242
+ return fl(t, n);
4240
4243
  }
4241
4244
  static fromString(t, n) {
4242
4245
  return t.toLowerCase().includes("#nexus") ? this.fromNexus(t, n) : this.fromNewick(t, n);
@@ -4367,7 +4370,7 @@ class qo {
4367
4370
  }
4368
4371
  //TODO overload as above.
4369
4372
  getTaxon(t) {
4370
- const n = jo(this, t);
4373
+ const n = Vo(this, t);
4371
4374
  switch (n.type) {
4372
4375
  case B.Some:
4373
4376
  return n.value;
@@ -4742,7 +4745,7 @@ class qo {
4742
4745
  return J(this, (r) => {
4743
4746
  n === void 0 && (n = r._data.nodes.allNodes[r._data.rootNode]);
4744
4747
  const i = t ? 1 : -1;
4745
- Ho(r._data, n, (a, o, s, c) => (o - c) * i);
4748
+ qo(r._data, n, (a, o, s, c) => (o - c) * i);
4746
4749
  });
4747
4750
  }
4748
4751
  rotate(t, n = !1) {
@@ -4849,14 +4852,14 @@ class qo {
4849
4852
  });
4850
4853
  }
4851
4854
  }
4852
- function Ho(e, t, n) {
4855
+ function qo(e, t, n) {
4853
4856
  let r = 0;
4854
4857
  if (e.nodes.allNodes[t.number].children.length > 0) {
4855
4858
  const i = /* @__PURE__ */ new Map();
4856
4859
  for (const s of e.nodes.allNodes[t.number].children.map(
4857
4860
  (c) => e.nodes.allNodes[c]
4858
4861
  )) {
4859
- const c = Ho(e, s, n);
4862
+ const c = qo(e, s, n);
4860
4863
  i.set(s.number, c), r += c;
4861
4864
  }
4862
4865
  const a = e.nodes.allNodes[t.number].children.slice().sort((s, c) => n(
@@ -4891,7 +4894,7 @@ function* Bl(e, t = void 0) {
4891
4894
  };
4892
4895
  t === void 0 && (t = e.getRoot()), yield* n(t);
4893
4896
  }
4894
- function* Bf(e, t = void 0, n = (r, i) => r.number - i.number) {
4897
+ function* jf(e, t = void 0, n = (r, i) => r.number - i.number) {
4895
4898
  const r = function* (i, a = void 0) {
4896
4899
  yield e.getNode(i.number);
4897
4900
  const o = [...e.getChildren(i), e.getParent(i)].filter(
@@ -4903,7 +4906,7 @@ function* Bf(e, t = void 0, n = (r, i) => r.number - i.number) {
4903
4906
  };
4904
4907
  t === void 0 && (t = e.getRoot()), yield* r(t);
4905
4908
  }
4906
- function* Vf(e, t = void 0, n = (r, i) => r.number - i.number) {
4909
+ function* qf(e, t = void 0, n = (r, i) => r.number - i.number) {
4907
4910
  const r = function* (i, a = void 0) {
4908
4911
  const o = [...e.getChildren(i), e.getParent(i)].filter(
4909
4912
  (s) => s.number !== a
@@ -4941,7 +4944,7 @@ function* Ci(e, t) {
4941
4944
  };
4942
4945
  yield* n(t);
4943
4946
  }
4944
- function* jf(e, t) {
4947
+ function* Hf(e, t) {
4945
4948
  let n = t;
4946
4949
  for (; !e.isRoot(n); )
4947
4950
  yield n, n = e.getParent(n);
@@ -5013,7 +5016,7 @@ function Hl(e) {
5013
5016
  return e === "'" ? ["in single quote", "'"] : e === '"' ? ["in double quote", '"'] : e === "[" ? ["in comment", "]"] : ["parsing", ""];
5014
5017
  }
5015
5018
  const wa = /\s*('[^']+'|"[^"]+"|\[&[^[]+]|,|:|\)|\(|;)\s*/;
5016
- class qf {
5019
+ class Yf {
5017
5020
  reader;
5018
5021
  taxonSet;
5019
5022
  currentBlock;
@@ -5024,6 +5027,10 @@ class qf {
5024
5027
  const r = new TransformStream(ql());
5025
5028
  this.reader = t.pipeThrough(new TextDecoderStream()).pipeThrough(r).getReader(), this.taxonSet = new tr(), this.currentBlock = void 0, this.options = n;
5026
5029
  }
5030
+ /**
5031
+ * The main public api.
5032
+ * an asynchronous iterator over the trees provided by the stream
5033
+ */
5027
5034
  async *getTrees() {
5028
5035
  for (; this.currentBlock !== "trees"; )
5029
5036
  await this.parseNextBlock(), this.hasTree = !0;
@@ -5172,7 +5179,7 @@ class qf {
5172
5179
  }
5173
5180
  case /tree/i.test(r): {
5174
5181
  await this.nextToken();
5175
- const i = new Ro(this.taxonSet, {
5182
+ const i = new Eo(this.taxonSet, {
5176
5183
  translateTaxonNames: this.translateTaxonMap
5177
5184
  });
5178
5185
  t = await this.skipUntil(/\(/);
@@ -5198,7 +5205,7 @@ class qf {
5198
5205
  }
5199
5206
  }
5200
5207
  }
5201
- class Hf {
5208
+ class Wf {
5202
5209
  _forwardCache;
5203
5210
  _reverseCache;
5204
5211
  constructor() {
@@ -5254,7 +5261,7 @@ class Hf {
5254
5261
  }
5255
5262
  }
5256
5263
  var q = /* @__PURE__ */ ((e) => (e.Rectangular = "Rectangular", e.Polar = "Polar", e.Radial = "Radial", e))(q || {});
5257
- function Yo(e) {
5264
+ function Ho(e) {
5258
5265
  function t(n) {
5259
5266
  const r = /* @__PURE__ */ new Map();
5260
5267
  let i = 0;
@@ -5297,8 +5304,8 @@ function Yo(e) {
5297
5304
  }
5298
5305
  return t;
5299
5306
  }
5300
- const Yl = Yo(q.Rectangular), Yf = Yo(q.Polar);
5301
- function Wf(e, t = {}) {
5307
+ const Yl = Ho(q.Rectangular), Gf = Ho(q.Polar);
5308
+ function Qf(e, t = {}) {
5302
5309
  const { spread: n = 1 } = t;
5303
5310
  console.log("radial layout with spread", n);
5304
5311
  const r = /* @__PURE__ */ new Map(), i = [
@@ -5315,45 +5322,45 @@ function Wf(e, t = {}) {
5315
5322
  const o = i.pop();
5316
5323
  Z(o, "Internal Error, hit the end of the data stack unexpectedly");
5317
5324
  const { angleStart: s, angleEnd: c, xpos: u, ypos: l, level: h } = o, f = (s + c) / 2, d = e.isRoot(a) ? 0 : e.getLength(a), m = Math.cos(f), g = Math.sin(f), x = u + d * m, y = l + d * g, b = e.getChildCount(a) > 0;
5318
- let p, _;
5319
- p = Math.cos(f), _ = Math.sin(f);
5320
- const M = {
5325
+ let p, w;
5326
+ p = Math.cos(f), w = Math.sin(f);
5327
+ const M = Yo(f), k = {
5321
5328
  x,
5322
5329
  y,
5323
5330
  layoutClass: q.Radial,
5324
- theta: f,
5331
+ theta: M,
5325
5332
  nodeLabel: {
5326
5333
  dxFactor: p,
5327
- dyFactor: _,
5334
+ dyFactor: w,
5328
5335
  alignmentBaseline: "middle",
5329
- textAnchor: _a(f) > Math.PI / 2 && _a(f) < 3 * Math.PI / 2 ? "end" : "start",
5330
- rotation: 0
5331
- // textSafeDegrees(normalizeAngle(branchAngle))
5336
+ textAnchor: M > Math.PI / 2 && M < 3 * Math.PI / 2 ? "end" : " start",
5337
+ rotation: Wl(M) * 2
5338
+ // why is this magic 2 needed?
5332
5339
  }
5333
5340
  };
5334
5341
  if (e.getChildCount(a) > 0) {
5335
- const k = [];
5336
- let T = 0;
5337
- for (let v = 0; v < e.getChildCount(a); v++) {
5338
- const E = [...Ci(e, e.getChild(a, v))].length;
5339
- k[v] = E, T += E;
5342
+ const T = [];
5343
+ let I = 0;
5344
+ for (let P = 0; P < e.getChildCount(a); P++) {
5345
+ const C = [...Ci(e, e.getChild(a, P))].length;
5346
+ T[P] = C, I += C;
5340
5347
  }
5341
- let R = c - s, I = s;
5342
- e.getRoot() !== a && (R *= 1 + n * Math.PI / 180 / 10, I = f - R / 2);
5343
- let F = I;
5344
- for (let v = e.getChildCount(a) - 1; v > -1; v--) {
5345
- const E = F;
5346
- F = E + R * k[v] / T, i.push({
5347
- angleStart: E,
5348
- angleEnd: F,
5348
+ let R = c - s, F = s;
5349
+ e.getRoot() !== a && (R *= 1 + n * Math.PI / 180 / 10, F = f - R / 2);
5350
+ let _ = F;
5351
+ for (let P = e.getChildCount(a) - 1; P > -1; P--) {
5352
+ const C = _;
5353
+ _ = C + R * T[P] / I, i.push({
5354
+ angleStart: C,
5355
+ angleEnd: _,
5349
5356
  xpos: x,
5350
5357
  ypos: y,
5351
5358
  level: h + 1,
5352
- number: e.getChild(a, v).number
5359
+ number: e.getChild(a, P).number
5353
5360
  });
5354
5361
  }
5355
5362
  }
5356
- r.set(a, M);
5363
+ r.set(a, k);
5357
5364
  }
5358
5365
  return function(a) {
5359
5366
  if (r.has(a))
@@ -5361,12 +5368,19 @@ function Wf(e, t = {}) {
5361
5368
  throw new Error("Node not found in layout - has the tree changed");
5362
5369
  };
5363
5370
  }
5364
- function _a(e) {
5371
+ function Wl(e) {
5372
+ const t = Gl(e);
5373
+ return t > 90 && t < 270 ? (t - 180) / 2 : t > 0 && t < 90 ? t / 2 : t < 360 && t > 270 ? (360 + t) / 2 : t;
5374
+ }
5375
+ function Yo(e) {
5365
5376
  for (; e > 2 * Math.PI; )
5366
5377
  e -= 2 * Math.PI;
5367
5378
  return e;
5368
5379
  }
5369
- const Wl = () => ({
5380
+ function Gl(e) {
5381
+ return Yo(e) * 180 / Math.PI;
5382
+ }
5383
+ const Ql = () => ({
5370
5384
  x: 0,
5371
5385
  y: 0,
5372
5386
  layoutClass: q.Rectangular,
@@ -5378,7 +5392,7 @@ const Wl = () => ({
5378
5392
  dyFactor: 0,
5379
5393
  rotation: 0
5380
5394
  }
5381
- }), wt = jn(Wl), _t = jn(!1), Gl = {
5395
+ }), wt = jn(Ql), _t = jn(!1), Xl = {
5382
5396
  canvasWidth: 0,
5383
5397
  canvasHeight: 0,
5384
5398
  domainX: [0, 1],
@@ -5394,8 +5408,8 @@ const Wl = () => ({
5394
5408
  },
5395
5409
  rootAngle: 0,
5396
5410
  angleRange: 0
5397
- }, ln = jn(Gl);
5398
- function Ql(e, t) {
5411
+ }, ln = jn(Xl);
5412
+ function Zl(e, t) {
5399
5413
  switch (arguments.length) {
5400
5414
  case 0:
5401
5415
  break;
@@ -5418,7 +5432,7 @@ function Wo(e, t) {
5418
5432
  }
5419
5433
  function hn() {
5420
5434
  }
5421
- var en = 0.7, Un = 1 / en, lt = "\\s*([+-]?\\d+)\\s*", tn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ke = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Xl = /^#([0-9a-f]{3,8})$/, Zl = new RegExp(`^rgb\\(${lt},${lt},${lt}\\)$`), Kl = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), Jl = new RegExp(`^rgba\\(${lt},${lt},${lt},${tn}\\)$`), eh = new RegExp(`^rgba\\(${ke},${ke},${ke},${tn}\\)$`), th = new RegExp(`^hsl\\(${tn},${ke},${ke}\\)$`), nh = new RegExp(`^hsla\\(${tn},${ke},${ke},${tn}\\)$`), Na = {
5435
+ var en = 0.7, Un = 1 / en, lt = "\\s*([+-]?\\d+)\\s*", tn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ke = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Kl = /^#([0-9a-f]{3,8})$/, Jl = new RegExp(`^rgb\\(${lt},${lt},${lt}\\)$`), eh = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), th = new RegExp(`^rgba\\(${lt},${lt},${lt},${tn}\\)$`), nh = new RegExp(`^rgba\\(${ke},${ke},${ke},${tn}\\)$`), rh = new RegExp(`^hsl\\(${tn},${ke},${ke}\\)$`), ih = new RegExp(`^hsla\\(${tn},${ke},${ke},${tn}\\)$`), _a = {
5422
5436
  aliceblue: 15792383,
5423
5437
  antiquewhite: 16444375,
5424
5438
  aqua: 65535,
@@ -5575,41 +5589,41 @@ Si(hn, nn, {
5575
5589
  displayable() {
5576
5590
  return this.rgb().displayable();
5577
5591
  },
5578
- hex: Ma,
5592
+ hex: Na,
5579
5593
  // Deprecated! Use color.formatHex.
5580
- formatHex: Ma,
5581
- formatHex8: rh,
5582
- formatHsl: ih,
5583
- formatRgb: Ca,
5584
- toString: Ca
5594
+ formatHex: Na,
5595
+ formatHex8: ah,
5596
+ formatHsl: oh,
5597
+ formatRgb: Ma,
5598
+ toString: Ma
5585
5599
  });
5586
- function Ma() {
5600
+ function Na() {
5587
5601
  return this.rgb().formatHex();
5588
5602
  }
5589
- function rh() {
5603
+ function ah() {
5590
5604
  return this.rgb().formatHex8();
5591
5605
  }
5592
- function ih() {
5606
+ function oh() {
5593
5607
  return Go(this).formatHsl();
5594
5608
  }
5595
- function Ca() {
5609
+ function Ma() {
5596
5610
  return this.rgb().formatRgb();
5597
5611
  }
5598
5612
  function nn(e) {
5599
5613
  var t, n;
5600
- return e = (e + "").trim().toLowerCase(), (t = Xl.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Sa(t) : n === 3 ? new se(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? pn(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? pn(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Zl.exec(e)) ? new se(t[1], t[2], t[3], 1) : (t = Kl.exec(e)) ? new se(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Jl.exec(e)) ? pn(t[1], t[2], t[3], t[4]) : (t = eh.exec(e)) ? pn(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = th.exec(e)) ? Ta(t[1], t[2] / 100, t[3] / 100, 1) : (t = nh.exec(e)) ? Ta(t[1], t[2] / 100, t[3] / 100, t[4]) : Na.hasOwnProperty(e) ? Sa(Na[e]) : e === "transparent" ? new se(NaN, NaN, NaN, 0) : null;
5614
+ return e = (e + "").trim().toLowerCase(), (t = Kl.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ca(t) : n === 3 ? new se(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? pn(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? pn(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Jl.exec(e)) ? new se(t[1], t[2], t[3], 1) : (t = eh.exec(e)) ? new se(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = th.exec(e)) ? pn(t[1], t[2], t[3], t[4]) : (t = nh.exec(e)) ? pn(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rh.exec(e)) ? ka(t[1], t[2] / 100, t[3] / 100, 1) : (t = ih.exec(e)) ? ka(t[1], t[2] / 100, t[3] / 100, t[4]) : _a.hasOwnProperty(e) ? Ca(_a[e]) : e === "transparent" ? new se(NaN, NaN, NaN, 0) : null;
5601
5615
  }
5602
- function Sa(e) {
5616
+ function Ca(e) {
5603
5617
  return new se(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
5604
5618
  }
5605
5619
  function pn(e, t, n, r) {
5606
5620
  return r <= 0 && (e = t = n = NaN), new se(e, t, n, r);
5607
5621
  }
5608
- function ah(e) {
5622
+ function sh(e) {
5609
5623
  return e instanceof hn || (e = nn(e)), e ? (e = e.rgb(), new se(e.r, e.g, e.b, e.opacity)) : new se();
5610
5624
  }
5611
5625
  function Xr(e, t, n, r) {
5612
- return arguments.length === 1 ? ah(e) : new se(e, t, n, r ?? 1);
5626
+ return arguments.length === 1 ? sh(e) : new se(e, t, n, r ?? 1);
5613
5627
  }
5614
5628
  function se(e, t, n, r) {
5615
5629
  this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
@@ -5630,20 +5644,20 @@ Si(se, Xr, Wo(hn, {
5630
5644
  displayable() {
5631
5645
  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;
5632
5646
  },
5633
- hex: $a,
5647
+ hex: Sa,
5634
5648
  // Deprecated! Use color.formatHex.
5635
- formatHex: $a,
5636
- formatHex8: oh,
5637
- formatRgb: ka,
5638
- toString: ka
5649
+ formatHex: Sa,
5650
+ formatHex8: uh,
5651
+ formatRgb: $a,
5652
+ toString: $a
5639
5653
  }));
5640
- function $a() {
5654
+ function Sa() {
5641
5655
  return `#${We(this.r)}${We(this.g)}${We(this.b)}`;
5642
5656
  }
5643
- function oh() {
5657
+ function uh() {
5644
5658
  return `#${We(this.r)}${We(this.g)}${We(this.b)}${We((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
5645
5659
  }
5646
- function ka() {
5660
+ function $a() {
5647
5661
  const e = On(this.opacity);
5648
5662
  return `${e === 1 ? "rgb(" : "rgba("}${Qe(this.r)}, ${Qe(this.g)}, ${Qe(this.b)}${e === 1 ? ")" : `, ${e})`}`;
5649
5663
  }
@@ -5656,7 +5670,7 @@ function Qe(e) {
5656
5670
  function We(e) {
5657
5671
  return e = Qe(e), (e < 16 ? "0" : "") + e.toString(16);
5658
5672
  }
5659
- function Ta(e, t, n, r) {
5673
+ function ka(e, t, n, r) {
5660
5674
  return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new we(e, t, n, r);
5661
5675
  }
5662
5676
  function Go(e) {
@@ -5667,13 +5681,13 @@ function Go(e) {
5667
5681
  var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = NaN, s = a - i, c = (a + i) / 2;
5668
5682
  return s ? (t === a ? o = (n - r) / s + (n < r) * 6 : n === a ? o = (r - t) / s + 2 : o = (t - n) / s + 4, s /= c < 0.5 ? a + i : 2 - a - i, o *= 60) : s = c > 0 && c < 1 ? 0 : o, new we(o, s, c, e.opacity);
5669
5683
  }
5670
- function sh(e, t, n, r) {
5684
+ function ch(e, t, n, r) {
5671
5685
  return arguments.length === 1 ? Go(e) : new we(e, t, n, r ?? 1);
5672
5686
  }
5673
5687
  function we(e, t, n, r) {
5674
5688
  this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
5675
5689
  }
5676
- Si(we, sh, Wo(hn, {
5690
+ Si(we, ch, Wo(hn, {
5677
5691
  brighter(e) {
5678
5692
  return e = e == null ? Un : Math.pow(Un, e), new we(this.h, this.s, this.l * e, this.opacity);
5679
5693
  },
@@ -5690,17 +5704,17 @@ Si(we, sh, Wo(hn, {
5690
5704
  );
5691
5705
  },
5692
5706
  clamp() {
5693
- return new we(Pa(this.h), xn(this.s), xn(this.l), On(this.opacity));
5707
+ return new we(Ta(this.h), xn(this.s), xn(this.l), On(this.opacity));
5694
5708
  },
5695
5709
  displayable() {
5696
5710
  return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
5697
5711
  },
5698
5712
  formatHsl() {
5699
5713
  const e = On(this.opacity);
5700
- return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${xn(this.s) * 100}%, ${xn(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
5714
+ return `${e === 1 ? "hsl(" : "hsla("}${Ta(this.h)}, ${xn(this.s) * 100}%, ${xn(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
5701
5715
  }
5702
5716
  }));
5703
- function Pa(e) {
5717
+ function Ta(e) {
5704
5718
  return e = (e || 0) % 360, e < 0 ? e + 360 : e;
5705
5719
  }
5706
5720
  function xn(e) {
@@ -5710,27 +5724,27 @@ function wr(e, t, n) {
5710
5724
  return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
5711
5725
  }
5712
5726
  const $i = (e) => () => e;
5713
- function uh(e, t) {
5727
+ function lh(e, t) {
5714
5728
  return function(n) {
5715
5729
  return e + n * t;
5716
5730
  };
5717
5731
  }
5718
- function ch(e, t, n) {
5732
+ function hh(e, t, n) {
5719
5733
  return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) {
5720
5734
  return Math.pow(e + r * t, n);
5721
5735
  };
5722
5736
  }
5723
- function lh(e) {
5737
+ function fh(e) {
5724
5738
  return (e = +e) == 1 ? Qo : function(t, n) {
5725
- return n - t ? ch(t, n, e) : $i(isNaN(t) ? n : t);
5739
+ return n - t ? hh(t, n, e) : $i(isNaN(t) ? n : t);
5726
5740
  };
5727
5741
  }
5728
5742
  function Qo(e, t) {
5729
5743
  var n = t - e;
5730
- return n ? uh(e, n) : $i(isNaN(e) ? t : e);
5744
+ return n ? lh(e, n) : $i(isNaN(e) ? t : e);
5731
5745
  }
5732
- const Aa = (function e(t) {
5733
- var n = lh(t);
5746
+ const Pa = (function e(t) {
5747
+ var n = fh(t);
5734
5748
  function r(i, a) {
5735
5749
  var o = n((i = Xr(i)).r, (a = Xr(a)).r), s = n(i.g, a.g), c = n(i.b, a.b), u = Qo(i.opacity, a.opacity);
5736
5750
  return function(l) {
@@ -5739,7 +5753,7 @@ const Aa = (function e(t) {
5739
5753
  }
5740
5754
  return r.gamma = e, r;
5741
5755
  })(1);
5742
- function hh(e, t) {
5756
+ function dh(e, t) {
5743
5757
  t || (t = []);
5744
5758
  var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i;
5745
5759
  return function(a) {
@@ -5747,10 +5761,10 @@ function hh(e, t) {
5747
5761
  return r;
5748
5762
  };
5749
5763
  }
5750
- function fh(e) {
5764
+ function mh(e) {
5751
5765
  return ArrayBuffer.isView(e) && !(e instanceof DataView);
5752
5766
  }
5753
- function dh(e, t) {
5767
+ function gh(e, t) {
5754
5768
  var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), a = new Array(n), o;
5755
5769
  for (o = 0; o < r; ++o) i[o] = ki(e[o], t[o]);
5756
5770
  for (; o < n; ++o) a[o] = t[o];
@@ -5759,7 +5773,7 @@ function dh(e, t) {
5759
5773
  return a;
5760
5774
  };
5761
5775
  }
5762
- function mh(e, t) {
5776
+ function yh(e, t) {
5763
5777
  var n = /* @__PURE__ */ new Date();
5764
5778
  return e = +e, t = +t, function(r) {
5765
5779
  return n.setTime(e * (1 - r) + t * r), n;
@@ -5770,7 +5784,7 @@ function zn(e, t) {
5770
5784
  return e * (1 - n) + t * n;
5771
5785
  };
5772
5786
  }
5773
- function gh(e, t) {
5787
+ function ph(e, t) {
5774
5788
  var n = {}, r = {}, i;
5775
5789
  (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {});
5776
5790
  for (i in t)
@@ -5781,64 +5795,64 @@ function gh(e, t) {
5781
5795
  };
5782
5796
  }
5783
5797
  var Zr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, _r = new RegExp(Zr.source, "g");
5784
- function yh(e) {
5798
+ function xh(e) {
5785
5799
  return function() {
5786
5800
  return e;
5787
5801
  };
5788
5802
  }
5789
- function ph(e) {
5803
+ function bh(e) {
5790
5804
  return function(t) {
5791
5805
  return e(t) + "";
5792
5806
  };
5793
5807
  }
5794
- function xh(e, t) {
5808
+ function vh(e, t) {
5795
5809
  var n = Zr.lastIndex = _r.lastIndex = 0, r, i, a, o = -1, s = [], c = [];
5796
5810
  for (e = e + "", t = t + ""; (r = Zr.exec(e)) && (i = _r.exec(t)); )
5797
5811
  (a = i.index) > n && (a = t.slice(n, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, c.push({ i: o, x: zn(r, i) })), n = _r.lastIndex;
5798
- return n < t.length && (a = t.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? c[0] ? ph(c[0].x) : yh(t) : (t = c.length, function(u) {
5812
+ return n < t.length && (a = t.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? c[0] ? bh(c[0].x) : xh(t) : (t = c.length, function(u) {
5799
5813
  for (var l = 0, h; l < t; ++l) s[(h = c[l]).i] = h.x(u);
5800
5814
  return s.join("");
5801
5815
  });
5802
5816
  }
5803
5817
  function ki(e, t) {
5804
5818
  var n = typeof t, r;
5805
- return t == null || n === "boolean" ? $i(t) : (n === "number" ? zn : n === "string" ? (r = nn(t)) ? (t = r, Aa) : xh : t instanceof nn ? Aa : t instanceof Date ? mh : fh(t) ? hh : Array.isArray(t) ? dh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? gh : zn)(e, t);
5819
+ return t == null || n === "boolean" ? $i(t) : (n === "number" ? zn : n === "string" ? (r = nn(t)) ? (t = r, Pa) : vh : t instanceof nn ? Pa : t instanceof Date ? yh : mh(t) ? dh : Array.isArray(t) ? gh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? ph : zn)(e, t);
5806
5820
  }
5807
- function bh(e, t) {
5821
+ function wh(e, t) {
5808
5822
  return e = +e, t = +t, function(n) {
5809
5823
  return Math.round(e * (1 - n) + t * n);
5810
5824
  };
5811
5825
  }
5812
- function vh(e) {
5826
+ function _h(e) {
5813
5827
  return function() {
5814
5828
  return e;
5815
5829
  };
5816
5830
  }
5817
- function wh(e) {
5831
+ function Nh(e) {
5818
5832
  return +e;
5819
5833
  }
5820
- var Ea = [0, 1];
5834
+ var Aa = [0, 1];
5821
5835
  function ot(e) {
5822
5836
  return e;
5823
5837
  }
5824
5838
  function Kr(e, t) {
5825
5839
  return (t -= e = +e) ? function(n) {
5826
5840
  return (n - e) / t;
5827
- } : vh(isNaN(t) ? NaN : 0.5);
5841
+ } : _h(isNaN(t) ? NaN : 0.5);
5828
5842
  }
5829
- function _h(e, t) {
5843
+ function Mh(e, t) {
5830
5844
  var n;
5831
5845
  return e > t && (n = e, e = t, t = n), function(r) {
5832
5846
  return Math.max(e, Math.min(t, r));
5833
5847
  };
5834
5848
  }
5835
- function Nh(e, t, n) {
5849
+ function Ch(e, t, n) {
5836
5850
  var r = e[0], i = e[1], a = t[0], o = t[1];
5837
5851
  return i < r ? (r = Kr(i, r), a = n(o, a)) : (r = Kr(r, i), a = n(a, o)), function(s) {
5838
5852
  return a(r(s));
5839
5853
  };
5840
5854
  }
5841
- function Mh(e, t, n) {
5855
+ function Sh(e, t, n) {
5842
5856
  var r = Math.min(e.length, t.length) - 1, i = new Array(r), a = new Array(r), o = -1;
5843
5857
  for (e[r] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++o < r; )
5844
5858
  i[o] = Kr(e[o], e[o + 1]), a[o] = n(t[o], t[o + 1]);
@@ -5847,14 +5861,14 @@ function Mh(e, t, n) {
5847
5861
  return a[c](i[c](s));
5848
5862
  };
5849
5863
  }
5850
- function Ch(e, t) {
5864
+ function $h(e, t) {
5851
5865
  return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
5852
5866
  }
5853
- function Sh() {
5854
- var e = Ea, t = Ea, n = ki, r, i, a, o = ot, s, c, u;
5867
+ function kh() {
5868
+ var e = Aa, t = Aa, n = ki, r, i, a, o = ot, s, c, u;
5855
5869
  function l() {
5856
5870
  var f = Math.min(e.length, t.length);
5857
- return o !== ot && (o = _h(e[0], e[f - 1])), s = f > 2 ? Mh : Nh, c = u = null, h;
5871
+ return o !== ot && (o = Mh(e[0], e[f - 1])), s = f > 2 ? Sh : Ch, c = u = null, h;
5858
5872
  }
5859
5873
  function h(f) {
5860
5874
  return f == null || isNaN(f = +f) ? a : (c || (c = s(e.map(r), t, n)))(r(o(f)));
@@ -5862,11 +5876,11 @@ function Sh() {
5862
5876
  return h.invert = function(f) {
5863
5877
  return o(i((u || (u = s(t, e.map(r), zn)))(f)));
5864
5878
  }, h.domain = function(f) {
5865
- return arguments.length ? (e = Array.from(f, wh), l()) : e.slice();
5879
+ return arguments.length ? (e = Array.from(f, Nh), l()) : e.slice();
5866
5880
  }, h.range = function(f) {
5867
5881
  return arguments.length ? (t = Array.from(f), l()) : t.slice();
5868
5882
  }, h.rangeRound = function(f) {
5869
- return t = Array.from(f), n = bh, l();
5883
+ return t = Array.from(f), n = wh, l();
5870
5884
  }, h.clamp = function(f) {
5871
5885
  return arguments.length ? (o = f ? !0 : ot, l()) : o !== ot;
5872
5886
  }, h.interpolate = function(f) {
@@ -5877,15 +5891,15 @@ function Sh() {
5877
5891
  return r = f, i = d, l();
5878
5892
  };
5879
5893
  }
5880
- function $h() {
5881
- return Sh()(ot, ot);
5894
+ function Th() {
5895
+ return kh()(ot, ot);
5882
5896
  }
5883
- function kh(e, t, n, r) {
5897
+ function Ph(e, t, n, r) {
5884
5898
  var i = Wu(e, t, n), a;
5885
5899
  switch (r = Dn(r ?? ",f"), r.type) {
5886
5900
  case "s": {
5887
5901
  var o = Math.max(Math.abs(e), Math.abs(t));
5888
- return r.precision == null && !isNaN(a = Rl(i, o)) && (r.precision = a), Bo(r, o);
5902
+ return r.precision == null && !isNaN(a = Rl(i, o)) && (r.precision = a), zo(r, o);
5889
5903
  }
5890
5904
  case "":
5891
5905
  case "e":
@@ -5903,14 +5917,14 @@ function kh(e, t, n, r) {
5903
5917
  }
5904
5918
  return Jt(r);
5905
5919
  }
5906
- function Th(e) {
5920
+ function Ah(e) {
5907
5921
  var t = e.domain;
5908
5922
  return e.ticks = function(n) {
5909
5923
  var r = t();
5910
5924
  return Yu(r[0], r[r.length - 1], n ?? 10);
5911
5925
  }, e.tickFormat = function(n, r) {
5912
5926
  var i = t();
5913
- return kh(i[0], i[i.length - 1], n ?? 10, r);
5927
+ return Ph(i[0], i[i.length - 1], n ?? 10, r);
5914
5928
  }, e.nice = function(n) {
5915
5929
  n == null && (n = 10);
5916
5930
  var r = t(), i = 0, a = r.length - 1, o = r[i], s = r[a], c, u, l = 10;
@@ -5929,12 +5943,12 @@ function Th(e) {
5929
5943
  }, e;
5930
5944
  }
5931
5945
  function me() {
5932
- var e = $h();
5946
+ var e = Th();
5933
5947
  return e.copy = function() {
5934
- return Ch(e, me());
5935
- }, Ql.apply(e, arguments), Th(e);
5948
+ return $h(e, me());
5949
+ }, Zl.apply(e, arguments), Ah(e);
5936
5950
  }
5937
- function Ph(e, t, n, r, i = !1, a = 0, o = 1.7 * Math.PI, s = 0, c = 0) {
5951
+ function Eh(e, t, n, r, i = !1, a = 0, o = 1.7 * Math.PI, s = 0, c = 0) {
5938
5952
  const u = Math.min(n, r) / 2, l = Ge(o), h = e * c, f = i ? [a * u, u].reverse() : [a * u, u], d = me().domain([h, e]).range(f), m = s + (2 * 3.14 - l) / 2, g = m + l, x = me().domain([0, t]).range([m, g]), y = [
5939
5953
  [0, 0],
5940
5954
  Rt(u, m),
@@ -5954,7 +5968,7 @@ function Ph(e, t, n, r, i = !1, a = 0, o = 1.7 * Math.PI, s = 0, c = 0) {
5954
5968
  const [z, W] = Rt(u, Y);
5955
5969
  y.push([z, W]);
5956
5970
  }
5957
- const _ = ft(y, (Y) => Y[0]), M = ft(y, (Y) => Y[1]), k = (_[1] - _[0]) / (M[1] - M[0]), T = Math.min(n, r * k), R = T, I = T / k, F = (n - R) / 2, v = (r - I) / 2, E = [v, r - v], C = [F, n - F], P = me().domain(_).range(C), K = me().domain(M).range(E);
5971
+ const w = ft(y, (Y) => Y[0]), M = ft(y, (Y) => Y[1]), k = (w[1] - w[0]) / (M[1] - M[0]), T = Math.min(n, r * k), I = T, R = T / k, F = (n - I) / 2, _ = (r - R) / 2, P = [_, r - _], C = [F, n - F], A = me().domain(w).range(C), K = me().domain(M).range(P);
5958
5972
  return function(z) {
5959
5973
  const [W, G] = [d(z.x), x(z.y)], [xe, Me] = Rt(W, G), te = Ge(G), Be = {
5960
5974
  alignmentBaseline: "middle",
@@ -5965,7 +5979,7 @@ function Ph(e, t, n, r, i = !1, a = 0, o = 1.7 * Math.PI, s = 0, c = 0) {
5965
5979
  };
5966
5980
  return {
5967
5981
  ...z,
5968
- x: P(xe),
5982
+ x: A(xe),
5969
5983
  y: K(Me),
5970
5984
  r: W,
5971
5985
  theta: G,
@@ -5981,21 +5995,21 @@ function Ge(e) {
5981
5995
  e -= 2 * Math.PI;
5982
5996
  return e;
5983
5997
  }
5984
- function Ah(e) {
5998
+ function Rh(e) {
5985
5999
  return Ge(e) * 180 / Math.PI;
5986
6000
  }
5987
6001
  function Xo(e) {
5988
- const t = Ah(Ge(e));
6002
+ const t = Rh(Ge(e));
5989
6003
  return t > 90 && t < 270 ? t - 180 : t;
5990
6004
  }
5991
- const Eh = {
6005
+ const Ih = {
5992
6006
  alignmentBaseline: "middle",
5993
6007
  textAnchor: "middle",
5994
6008
  dxFactor: 1,
5995
6009
  dyFactor: 1,
5996
6010
  rotation: 0
5997
6011
  };
5998
- function Rh({
6012
+ function Lh({
5999
6013
  domainX: e,
6000
6014
  domainY: t,
6001
6015
  canvasWidth: n,
@@ -6015,7 +6029,7 @@ function Rh({
6015
6029
  h = me().domain([d, e[1]]).range([0, n]), f = me().domain(t).range([0, r]);
6016
6030
  let m = (g) => f(g);
6017
6031
  if (l.scale > 0) {
6018
- const g = f.invert(l.y), x = Ih(l.scale, g), y = f.copy().domain(f.domain().map(x));
6032
+ const g = f.invert(l.y), x = Fh(l.scale, g), y = f.copy().domain(f.domain().map(x));
6019
6033
  m = (b) => y(x(b));
6020
6034
  }
6021
6035
  return a && h.range([n, 0]), function(x) {
@@ -6023,7 +6037,7 @@ function Rh({
6023
6037
  };
6024
6038
  }
6025
6039
  case q.Polar:
6026
- return Ph(
6040
+ return Eh(
6027
6041
  e[1],
6028
6042
  t[1],
6029
6043
  n,
@@ -6048,7 +6062,7 @@ function Rh({
6048
6062
  throw new Error("Not implemented in calcX");
6049
6063
  }
6050
6064
  }
6051
- const Ih = (e, t) => (n) => {
6065
+ const Fh = (e, t) => (n) => {
6052
6066
  if (e === 0)
6053
6067
  return n;
6054
6068
  const r = 1 / e, i = t - n, a = 1 - t / (r + t), o = 1 - (t - 1) / (r - (t - 1));
@@ -6065,16 +6079,16 @@ function Ko(e) {
6065
6079
  const t = (n) => {
6066
6080
  const r = H(Le), i = H(wt), a = H(_t), { domainX: o, layoutClass: s } = H(ln), { node: c, parent: u, aligned: l, gap: h = 6, ...f } = n, d = i(c), m = r(d);
6067
6081
  if (u === void 0) {
6068
- const g = m.nodeLabel ?? Eh, x = g.dxFactor * h, y = g.dyFactor * h, b = r({ x: o[1], y: d.y }), p = (l ? b.x : m.x) + x, _ = (l && s === q.Polar ? b.y : m.y) + y, { alignmentBaseline: M, rotation: k, textAnchor: T } = g, R = l ? `M${m.x} ${m.y}L${p} ${_}` : `M${m.x} ${m.y}L${m.x} ${m.y}`;
6082
+ const g = m.nodeLabel ?? Ih, x = g.dxFactor * h, y = g.dyFactor * h, b = r({ x: o[1], y: d.y }), p = (l ? b.x : m.x) + x, w = (l && s === q.Polar ? b.y : m.y) + y, { alignmentBaseline: M, rotation: k, textAnchor: T } = g, I = l ? `M${m.x} ${m.y}L${p} ${w}` : `M${m.x} ${m.y}L${m.x} ${m.y}`;
6069
6083
  return /* @__PURE__ */ $(
6070
6084
  e,
6071
6085
  {
6072
6086
  alignmentBaseline: M,
6073
6087
  rotation: k,
6074
6088
  textAnchor: T,
6075
- d: R,
6089
+ d: I,
6076
6090
  x: p,
6077
- y: _,
6091
+ y: w,
6078
6092
  ...f,
6079
6093
  animated: a
6080
6094
  }
@@ -6083,7 +6097,7 @@ function Ko(e) {
6083
6097
  const g = i(u), x = r(g), y = s === q.Polar ? pe(
6084
6098
  m.theta,
6085
6099
  "The layout is polar but theta was not calculated for this node"
6086
- ) : 0, b = s === q.Polar ? Xo(y) : 0, p = r({ x: g.x, y: d.y }), { dx: _, dy: M } = s === q.Polar ? Lh(y, h) : { dx: 0, dy: -1 * h }, k = (s === q.Polar ? (m.x + p.x) / 2 : (m.x + x.x) / 2) + _, T = (s === q.Polar ? (m.y + p.y) / 2 : s === q.Radial ? (m.y + x.y) / 2 : m.y) + M;
6100
+ ) : 0, b = s === q.Polar ? Xo(y) : 0, p = r({ x: g.x, y: d.y }), { dx: w, dy: M } = s === q.Polar ? Dh(y, h) : { dx: 0, dy: -1 * h }, k = (s === q.Polar ? (m.x + p.x) / 2 : (m.x + x.x) / 2) + w, T = (s === q.Polar ? (m.y + p.y) / 2 : s === q.Radial ? (m.y + x.y) / 2 : m.y) + M;
6087
6101
  return /* @__PURE__ */ $(
6088
6102
  e,
6089
6103
  {
@@ -6100,7 +6114,7 @@ function Ko(e) {
6100
6114
  };
6101
6115
  return t.displayName = `withNodeLabel(${e.displayName || e.name || "Component"})`, t;
6102
6116
  }
6103
- function Lh(e, t) {
6117
+ function Dh(e, t) {
6104
6118
  let n, r;
6105
6119
  return e > 0 && e < Math.PI / 2 ? (n = Math.sin(Math.PI / 2 - e) * t, r = -Math.cos(Math.PI / 2 - e) * t) : e > Math.PI / 2 && e < Math.PI ? (n = -Math.cos(Math.PI / 2 - (Math.PI - e)) * t, r = -Math.sin(Math.PI / 2 - (Math.PI - e)) * t) : e > Math.PI && e < 3 * Math.PI / 2 ? (n = Math.cos(Math.PI / 2 - (e - Math.PI)) * t, r = -Math.sin(Math.PI / 2 - (e - Math.PI)) * t) : (n = -Math.cos(Math.PI / 2 - (2 * Math.PI - e)) * t, r = -Math.sin(Math.PI / 2 - (2 * Math.PI - e)) * t), { dx: n, dy: r };
6106
6120
  }
@@ -6125,10 +6139,10 @@ function Ti(e) {
6125
6139
  function Jo(e) {
6126
6140
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6127
6141
  }
6128
- var Nr, Ra;
6129
- function Fh() {
6130
- if (Ra) return Nr;
6131
- Ra = 1, Nr = e;
6142
+ var Nr, Ea;
6143
+ function Uh() {
6144
+ if (Ea) return Nr;
6145
+ Ea = 1, Nr = e;
6132
6146
  function e(t) {
6133
6147
  var n = 0, r = 0, i = 0, a = 0;
6134
6148
  return t.map(function(o) {
@@ -6170,9 +6184,9 @@ function Fh() {
6170
6184
  }
6171
6185
  return Nr;
6172
6186
  }
6173
- var Dh = Fh();
6174
- const Uh = /* @__PURE__ */ Jo(Dh);
6175
- var Oh = /* @__PURE__ */ (function() {
6187
+ var Oh = Uh();
6188
+ const zh = /* @__PURE__ */ Jo(Oh);
6189
+ var Bh = /* @__PURE__ */ (function() {
6176
6190
  function e(t, n) {
6177
6191
  var r = [], i = !0, a = !1, o = void 0;
6178
6192
  try {
@@ -6204,7 +6218,7 @@ var Oh = /* @__PURE__ */ (function() {
6204
6218
  x: l + o,
6205
6219
  y: h + s
6206
6220
  };
6207
- }, zh = function(t, n) {
6221
+ }, Vh = function(t, n) {
6208
6222
  var r = n === 1.5707963267948966 ? 0.551915024494 : n === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(n / 4), i = Math.cos(t), a = Math.sin(t), o = Math.cos(t + n), s = Math.sin(t + n);
6209
6223
  return [{
6210
6224
  x: i - a * r,
@@ -6216,15 +6230,15 @@ var Oh = /* @__PURE__ */ (function() {
6216
6230
  x: o,
6217
6231
  y: s
6218
6232
  }];
6219
- }, Ia = function(t, n, r, i) {
6233
+ }, Ra = function(t, n, r, i) {
6220
6234
  var a = t * i - n * r < 0 ? -1 : 1, o = t * r + n * i;
6221
6235
  return o > 1 && (o = 1), o < -1 && (o = -1), a * Math.acos(o);
6222
- }, Bh = function(t, n, r, i, a, o, s, c, u, l, h, f) {
6236
+ }, jh = function(t, n, r, i, a, o, s, c, u, l, h, f) {
6223
6237
  var d = Math.pow(a, 2), m = Math.pow(o, 2), g = Math.pow(h, 2), x = Math.pow(f, 2), y = d * m - d * x - m * g;
6224
6238
  y < 0 && (y = 0), y /= d * x + m * g, y = Math.sqrt(y) * (s === c ? -1 : 1);
6225
- var b = y * a / o * f, p = y * -o / a * h, _ = l * b - u * p + (t + r) / 2, M = u * b + l * p + (n + i) / 2, k = (h - b) / a, T = (f - p) / o, R = (-h - b) / a, I = (-f - p) / o, F = Ia(1, 0, k, T), v = Ia(k, T, R, I);
6226
- return c === 0 && v > 0 && (v -= Ot), c === 1 && v < 0 && (v += Ot), [_, M, F, v];
6227
- }, Vh = function(t) {
6239
+ var b = y * a / o * f, p = y * -o / a * h, w = l * b - u * p + (t + r) / 2, M = u * b + l * p + (n + i) / 2, k = (h - b) / a, T = (f - p) / o, I = (-h - b) / a, R = (-f - p) / o, F = Ra(1, 0, k, T), _ = Ra(k, T, I, R);
6240
+ return c === 0 && _ > 0 && (_ -= Ot), c === 1 && _ < 0 && (_ += Ot), [w, M, F, _];
6241
+ }, qh = function(t) {
6228
6242
  var n = t.px, r = t.py, i = t.cx, a = t.cy, o = t.rx, s = t.ry, c = t.xAxisRotation, u = c === void 0 ? 0 : c, l = t.largeArcFlag, h = l === void 0 ? 0 : l, f = t.sweepFlag, d = f === void 0 ? 0 : f, m = [];
6229
6243
  if (o === 0 || s === 0)
6230
6244
  return [];
@@ -6234,18 +6248,18 @@ var Oh = /* @__PURE__ */ (function() {
6234
6248
  o = Math.abs(o), s = Math.abs(s);
6235
6249
  var p = Math.pow(y, 2) / Math.pow(o, 2) + Math.pow(b, 2) / Math.pow(s, 2);
6236
6250
  p > 1 && (o *= Math.sqrt(p), s *= Math.sqrt(p));
6237
- var _ = Bh(n, r, i, a, o, s, h, d, g, x, y, b), M = Oh(_, 4), k = M[0], T = M[1], R = M[2], I = M[3], F = Math.abs(I) / (Ot / 4);
6251
+ var w = jh(n, r, i, a, o, s, h, d, g, x, y, b), M = Bh(w, 4), k = M[0], T = M[1], I = M[2], R = M[3], F = Math.abs(R) / (Ot / 4);
6238
6252
  Math.abs(1 - F) < 1e-7 && (F = 1);
6239
- var v = Math.max(Math.ceil(F), 1);
6240
- I /= v;
6241
- for (var E = 0; E < v; E++)
6242
- m.push(zh(R, I)), R += I;
6253
+ var _ = Math.max(Math.ceil(F), 1);
6254
+ R /= _;
6255
+ for (var P = 0; P < _; P++)
6256
+ m.push(Vh(I, R)), I += R;
6243
6257
  return m.map(function(C) {
6244
- var P = Mr(C[0], o, s, x, g, k, T), K = P.x, Y = P.y, z = Mr(C[1], o, s, x, g, k, T), W = z.x, G = z.y, xe = Mr(C[2], o, s, x, g, k, T), Me = xe.x, te = xe.y;
6258
+ var A = Mr(C[0], o, s, x, g, k, T), K = A.x, Y = A.y, z = Mr(C[1], o, s, x, g, k, T), W = z.x, G = z.y, xe = Mr(C[2], o, s, x, g, k, T), Me = xe.x, te = xe.y;
6245
6259
  return { x1: K, y1: Y, x2: W, y2: G, x: Me, y: te };
6246
6260
  });
6247
6261
  };
6248
- function jh(e) {
6262
+ function Hh(e) {
6249
6263
  for (var t, n = [], r = 0, i = 0, a = 0, o = 0, s = null, c = null, u = 0, l = 0, h = 0, f = e.length; h < f; h++) {
6250
6264
  var d = e[h], m = d[0];
6251
6265
  switch (m) {
@@ -6253,7 +6267,7 @@ function jh(e) {
6253
6267
  a = d[1], o = d[2];
6254
6268
  break;
6255
6269
  case "A":
6256
- var g = Vh({
6270
+ var g = qh({
6257
6271
  px: u,
6258
6272
  py: l,
6259
6273
  cx: d[6],
@@ -6273,10 +6287,10 @@ function jh(e) {
6273
6287
  (t == "C" || t == "S") && (b += b - r, p += p - i), d = ["C", b, p, d[1], d[2], d[3], d[4]];
6274
6288
  break;
6275
6289
  case "T":
6276
- t == "Q" || t == "T" ? (s = u * 2 - s, c = l * 2 - c) : (s = u, c = l), d = La(u, l, s, c, d[1], d[2]);
6290
+ t == "Q" || t == "T" ? (s = u * 2 - s, c = l * 2 - c) : (s = u, c = l), d = Ia(u, l, s, c, d[1], d[2]);
6277
6291
  break;
6278
6292
  case "Q":
6279
- s = d[1], c = d[2], d = La(u, l, d[1], d[2], d[3], d[4]);
6293
+ s = d[1], c = d[2], d = Ia(u, l, d[1], d[2], d[3], d[4]);
6280
6294
  break;
6281
6295
  case "L":
6282
6296
  d = bn(u, l, d[1], d[2]);
@@ -6298,7 +6312,7 @@ function jh(e) {
6298
6312
  function bn(e, t, n, r) {
6299
6313
  return ["C", e, t, n, r, n, r];
6300
6314
  }
6301
- function La(e, t, n, r, i, a) {
6315
+ function Ia(e, t, n, r, i, a) {
6302
6316
  return [
6303
6317
  "C",
6304
6318
  e / 3 + 2 / 3 * n,
@@ -6309,10 +6323,10 @@ function La(e, t, n, r, i, a) {
6309
6323
  a
6310
6324
  ];
6311
6325
  }
6312
- var Cr, Fa;
6313
- function qh() {
6314
- if (Fa) return Cr;
6315
- Fa = 1, Cr = n;
6326
+ var Cr, La;
6327
+ function Yh() {
6328
+ if (La) return Cr;
6329
+ La = 1, Cr = n;
6316
6330
  var e = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, t = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
6317
6331
  function n(a) {
6318
6332
  var o = [];
@@ -6333,8 +6347,8 @@ function qh() {
6333
6347
  }
6334
6348
  return Cr;
6335
6349
  }
6336
- var Hh = qh();
6337
- const Yh = /* @__PURE__ */ Jo(Hh);
6350
+ var Wh = Yh();
6351
+ const Gh = /* @__PURE__ */ Jo(Wh);
6338
6352
  class Cn {
6339
6353
  x;
6340
6354
  y;
@@ -6344,7 +6358,7 @@ class Cn {
6344
6358
  }
6345
6359
  const Sr = 6;
6346
6360
  function es(e) {
6347
- const t = Yh(e), n = Uh(t), r = jh(n);
6361
+ const t = Gh(e), n = zh(t), r = Hh(n);
6348
6362
  let i = `${r[0][0]} ${r[0][1]} ${r[0][2]} `;
6349
6363
  const a = r.filter((o) => o[0] === "C").map((o) => [
6350
6364
  new Cn(o[1], o[2]),
@@ -6360,7 +6374,7 @@ function es(e) {
6360
6374
  "Path must have at least 1 node (excluding start point) update layout or path.helpers"
6361
6375
  );
6362
6376
  for (; a.length < Sr; ) {
6363
- const o = pe(a.pop(), "Internal error in normalization"), { left: s, right: c } = Wh(o, 0.5);
6377
+ const o = pe(a.pop(), "Internal error in normalization"), { left: s, right: c } = Qh(o, 0.5);
6364
6378
  a.push(s), a.push(c.reverse());
6365
6379
  }
6366
6380
  for (let o = 0; o < a.length; o++) {
@@ -6369,7 +6383,7 @@ function es(e) {
6369
6383
  }
6370
6384
  return i;
6371
6385
  }
6372
- function Wh(e, t) {
6386
+ function Qh(e, t) {
6373
6387
  const n = [], r = [];
6374
6388
  function i(a, o) {
6375
6389
  if (a.length == 1)
@@ -6386,28 +6400,28 @@ function Wh(e, t) {
6386
6400
  }
6387
6401
  return i(e, t), { left: n, right: r };
6388
6402
  }
6389
- function Gh(e) {
6403
+ function Xh(e) {
6390
6404
  const t = (n) => {
6391
- const r = H(Le), i = H(wt), a = H(_t), { node: o, parent: s, curvature: c = 0, ...u } = n, l = i(o), { layoutClass: h } = l, f = s ? i(s) : { x: l.x, y: l.y }, d = { x: f.x, y: l.y }, m = [f, l, d].map((x) => r(x)), g = es(Qh(m, c, h));
6405
+ const r = H(Le), i = H(wt), a = H(_t), { node: o, parent: s, curvature: c = 0, ...u } = n, l = i(o), { layoutClass: h } = l, f = s ? i(s) : { x: l.x, y: l.y }, d = { x: f.x, y: l.y }, m = [f, l, d].map((x) => r(x)), g = es(Zh(m, c, h));
6392
6406
  return /* @__PURE__ */ $(e, { d: g, animated: a, ...u });
6393
6407
  };
6394
6408
  return t.displayName = `withBranchArray(${e.displayName || e.name || "Component"})`, t;
6395
6409
  }
6396
- function Qh(e, t, n) {
6410
+ function Zh(e, t, n) {
6397
6411
  switch (n) {
6398
6412
  case q.Rectangular:
6399
- return Xh(e, t);
6413
+ return Kh(e, t);
6400
6414
  case q.Polar:
6401
- return Zh(e);
6415
+ return Jh(e);
6402
6416
  case q.Radial:
6403
- return Kh(e);
6417
+ return ef(e);
6404
6418
  default:
6405
6419
  throw new Error(
6406
6420
  `path generator not implemented for the ${n} of points`
6407
6421
  );
6408
6422
  }
6409
6423
  }
6410
- function Xh(e, t) {
6424
+ function Kh(e, t) {
6411
6425
  const n = e.length;
6412
6426
  switch (n) {
6413
6427
  case 0:
@@ -6422,7 +6436,7 @@ function Xh(e, t) {
6422
6436
  );
6423
6437
  }
6424
6438
  }
6425
- function Zh(e) {
6439
+ function Jh(e) {
6426
6440
  const t = e.length;
6427
6441
  switch (t) {
6428
6442
  case 3: {
@@ -6437,7 +6451,7 @@ function Zh(e) {
6437
6451
  );
6438
6452
  }
6439
6453
  }
6440
- function Kh(e) {
6454
+ function ef(e) {
6441
6455
  const t = e.length;
6442
6456
  switch (t) {
6443
6457
  case 0:
@@ -6493,69 +6507,69 @@ function ns(e) {
6493
6507
  };
6494
6508
  return t.displayName = `withCladessArray(${e.displayName || e.name || "Component"})`, t;
6495
6509
  }
6496
- const Jh = Ti(Zo(Pu)), ef = Ti(Zo(Lu));
6497
- function tf(e) {
6510
+ const tf = Ti(Zo(Pu)), nf = Ti(Zo(Lu));
6511
+ function rf(e) {
6498
6512
  switch (e.shape) {
6499
6513
  case xt.Circle:
6500
- return /* @__PURE__ */ $(Jh, { ...e });
6514
+ return /* @__PURE__ */ $(tf, { ...e });
6501
6515
  case xt.Rectangle:
6502
- return /* @__PURE__ */ $(ef, { ...e });
6516
+ return /* @__PURE__ */ $(nf, { ...e });
6503
6517
  }
6504
6518
  }
6505
- const nf = ts(
6506
- Ko(wo)
6507
- ), rf = Ti(
6508
- Ko(wo)
6509
- ), af = ts(Gh(Jn));
6510
- function of(e) {
6519
+ const af = ts(
6520
+ Ko(vo)
6521
+ ), of = Ti(
6522
+ Ko(vo)
6523
+ ), sf = ts(Xh(Jn));
6524
+ function uf(e) {
6511
6525
  switch (e.target) {
6512
6526
  case 0:
6513
- return /* @__PURE__ */ $(tf, { ...e });
6527
+ return /* @__PURE__ */ $(rf, { ...e });
6514
6528
  case 1:
6515
- return /* @__PURE__ */ $(af, { ...e });
6529
+ return /* @__PURE__ */ $(sf, { ...e });
6516
6530
  case 2:
6517
- return /* @__PURE__ */ $(rf, { ...e });
6531
+ return /* @__PURE__ */ $(of, { ...e });
6518
6532
  case 3:
6519
- return /* @__PURE__ */ $(nf, { ...e });
6533
+ return /* @__PURE__ */ $(af, { ...e });
6520
6534
  case 4:
6521
- return /* @__PURE__ */ $(Sf, { ...e });
6535
+ return /* @__PURE__ */ $(kf, { ...e });
6522
6536
  }
6523
6537
  }
6524
6538
  var ye = /* @__PURE__ */ ((e) => (e[e.Node = 0] = "Node", e[e.Branch = 1] = "Branch", e[e.NodeLabel = 2] = "NodeLabel", e[e.BranchLabel = 3] = "BranchLabel", e[e.Clade = 4] = "Clade", e[e.Axis = 5] = "Axis", e))(ye || {}), xt = /* @__PURE__ */ ((e) => (e[e.Circle = 0] = "Circle", e[e.Rectangle = 1] = "Rectangle", e))(xt || {}), bt = /* @__PURE__ */ ((e) => (e[e.Cartoon = 0] = "Cartoon", e[e.Highlight = 1] = "Highlight", e))(bt || {});
6525
- function sf(e) {
6539
+ function cf(e) {
6526
6540
  const { clade: t, ...n } = e, r = H(Le), i = H(wt), a = H(_t), { root: o, leftMost: s, rightMost: c, mostDiverged: u } = t, l = r(i(o)), { x: h, y: f } = l, d = r(i(s)), m = r(i(c)), g = r(i(u)), { layoutClass: x } = i(o);
6527
6541
  let y;
6528
6542
  if (x === q.Rectangular) {
6529
- const p = g.x, _ = m.y, M = d.y;
6530
- y = `M${h},${f}L${p},${_}L${p},${M}Z`;
6543
+ const p = g.x, w = m.y, M = d.y;
6544
+ y = `M${h},${f}L${p},${w}L${p},${M}Z`;
6531
6545
  } else if (x === q.Polar) {
6532
- const p = d, _ = m, M = p.theta === _.theta || p.r === 0 ? "" : `A${p.r},${p.r} 0 0 ${p.theta < _.theta ? 1 : 0} ${_.x},${_.y}`;
6546
+ const p = d, w = m, M = p.theta === w.theta || p.r === 0 ? "" : `A${p.r},${p.r} 0 0 ${p.theta < w.theta ? 1 : 0} ${w.x},${w.y}`;
6533
6547
  y = `M${h},${f}L${p.x},${p.y} ${M} Z`;
6534
6548
  } else
6535
6549
  return null;
6536
6550
  const b = es(y);
6537
6551
  return /* @__PURE__ */ $(Jn, { d: b, ...n, animated: a });
6538
6552
  }
6539
- const uf = ns(sf);
6553
+ const lf = ns(cf);
6540
6554
  function De(e) {
6541
6555
  return function() {
6542
6556
  return e;
6543
6557
  };
6544
6558
  }
6545
- const Da = Math.abs, ee = Math.atan2, je = Math.cos, cf = Math.max, $r = Math.min, Ce = Math.sin, st = Math.sqrt, ie = 1e-12, rn = Math.PI, Bn = rn / 2, lf = 2 * rn;
6546
- function hf(e) {
6559
+ const Fa = Math.abs, ee = Math.atan2, je = Math.cos, hf = Math.max, $r = Math.min, Ce = Math.sin, st = Math.sqrt, ie = 1e-12, rn = Math.PI, Bn = rn / 2, ff = 2 * rn;
6560
+ function df(e) {
6547
6561
  return e > 1 ? 0 : e < -1 ? rn : Math.acos(e);
6548
6562
  }
6549
- function Ua(e) {
6563
+ function Da(e) {
6550
6564
  return e >= 1 ? Bn : e <= -1 ? -Bn : Math.asin(e);
6551
6565
  }
6552
- const Jr = Math.PI, ei = 2 * Jr, He = 1e-6, ff = ei - He;
6566
+ const Jr = Math.PI, ei = 2 * Jr, He = 1e-6, mf = ei - He;
6553
6567
  function rs(e) {
6554
6568
  this._ += e[0];
6555
6569
  for (let t = 1, n = e.length; t < n; ++t)
6556
6570
  this._ += arguments[t] + e[t];
6557
6571
  }
6558
- function df(e) {
6572
+ function gf(e) {
6559
6573
  let t = Math.floor(e);
6560
6574
  if (!(t >= 0)) throw new Error(`invalid digits: ${e}`);
6561
6575
  if (t > 15) return rs;
@@ -6566,10 +6580,10 @@ function df(e) {
6566
6580
  this._ += Math.round(arguments[i] * n) / n + r[i];
6567
6581
  };
6568
6582
  }
6569
- class mf {
6583
+ class yf {
6570
6584
  constructor(t) {
6571
6585
  this._x0 = this._y0 = // start of current subpath
6572
- this._x1 = this._y1 = null, this._ = "", this._append = t == null ? rs : df(t);
6586
+ this._x1 = this._y1 = null, this._ = "", this._append = t == null ? rs : gf(t);
6573
6587
  }
6574
6588
  moveTo(t, n) {
6575
6589
  this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`;
@@ -6594,14 +6608,14 @@ class mf {
6594
6608
  else if (f > He) if (!(Math.abs(h * c - u * l) > He) || !a)
6595
6609
  this._append`L${this._x1 = t},${this._y1 = n}`;
6596
6610
  else {
6597
- let d = r - o, m = i - s, g = c * c + u * u, x = d * d + m * m, y = Math.sqrt(g), b = Math.sqrt(f), p = a * Math.tan((Jr - Math.acos((g + f - x) / (2 * y * b))) / 2), _ = p / b, M = p / y;
6598
- Math.abs(_ - 1) > He && this._append`L${t + _ * l},${n + _ * h}`, this._append`A${a},${a},0,0,${+(h * d > l * m)},${this._x1 = t + M * c},${this._y1 = n + M * u}`;
6611
+ let d = r - o, m = i - s, g = c * c + u * u, x = d * d + m * m, y = Math.sqrt(g), b = Math.sqrt(f), p = a * Math.tan((Jr - Math.acos((g + f - x) / (2 * y * b))) / 2), w = p / b, M = p / y;
6612
+ Math.abs(w - 1) > He && this._append`L${t + w * l},${n + w * h}`, this._append`A${a},${a},0,0,${+(h * d > l * m)},${this._x1 = t + M * c},${this._y1 = n + M * u}`;
6599
6613
  }
6600
6614
  }
6601
6615
  arc(t, n, r, i, a, o) {
6602
6616
  if (t = +t, n = +n, r = +r, o = !!o, r < 0) throw new Error(`negative radius: ${r}`);
6603
6617
  let s = r * Math.cos(i), c = r * Math.sin(i), u = t + s, l = n + c, h = 1 ^ o, f = o ? i - a : a - i;
6604
- this._x1 === null ? this._append`M${u},${l}` : (Math.abs(this._x1 - u) > He || Math.abs(this._y1 - l) > He) && this._append`L${u},${l}`, r && (f < 0 && (f = f % ei + ei), f > ff ? this._append`A${r},${r},0,1,${h},${t - s},${n - c}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = l}` : f > He && this._append`A${r},${r},0,${+(f >= Jr)},${h},${this._x1 = t + r * Math.cos(a)},${this._y1 = n + r * Math.sin(a)}`);
6618
+ this._x1 === null ? this._append`M${u},${l}` : (Math.abs(this._x1 - u) > He || Math.abs(this._y1 - l) > He) && this._append`L${u},${l}`, r && (f < 0 && (f = f % ei + ei), f > mf ? this._append`A${r},${r},0,1,${h},${t - s},${n - c}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = l}` : f > He && this._append`A${r},${r},0,${+(f >= Jr)},${h},${this._x1 = t + r * Math.cos(a)},${this._y1 = n + r * Math.sin(a)}`);
6605
6619
  }
6606
6620
  rect(t, n, r, i) {
6607
6621
  this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`;
@@ -6610,7 +6624,7 @@ class mf {
6610
6624
  return this._;
6611
6625
  }
6612
6626
  }
6613
- function gf(e) {
6627
+ function pf(e) {
6614
6628
  let t = 3;
6615
6629
  return e.digits = function(n) {
6616
6630
  if (!arguments.length) return t;
@@ -6622,63 +6636,63 @@ function gf(e) {
6622
6636
  t = r;
6623
6637
  }
6624
6638
  return e;
6625
- }, () => new mf(t);
6639
+ }, () => new yf(t);
6626
6640
  }
6627
- function yf(e) {
6641
+ function xf(e) {
6628
6642
  return e.innerRadius;
6629
6643
  }
6630
- function pf(e) {
6644
+ function bf(e) {
6631
6645
  return e.outerRadius;
6632
6646
  }
6633
- function xf(e) {
6647
+ function vf(e) {
6634
6648
  return e.startAngle;
6635
6649
  }
6636
- function bf(e) {
6650
+ function wf(e) {
6637
6651
  return e.endAngle;
6638
6652
  }
6639
- function vf(e) {
6653
+ function _f(e) {
6640
6654
  return e && e.padAngle;
6641
6655
  }
6642
- function wf(e, t, n, r, i, a, o, s) {
6656
+ function Nf(e, t, n, r, i, a, o, s) {
6643
6657
  var c = n - e, u = r - t, l = o - i, h = s - a, f = h * c - l * u;
6644
6658
  if (!(f * f < ie))
6645
6659
  return f = (l * (t - a) - h * (e - i)) / f, [e + f * c, t + f * u];
6646
6660
  }
6647
6661
  function vn(e, t, n, r, i, a, o) {
6648
- var s = e - n, c = t - r, u = (o ? a : -a) / st(s * s + c * c), l = u * c, h = -u * s, f = e + l, d = t + h, m = n + l, g = r + h, x = (f + m) / 2, y = (d + g) / 2, b = m - f, p = g - d, _ = b * b + p * p, M = i - a, k = f * g - m * d, T = (p < 0 ? -1 : 1) * st(cf(0, M * M * _ - k * k)), R = (k * p - b * T) / _, I = (-k * b - p * T) / _, F = (k * p + b * T) / _, v = (-k * b + p * T) / _, E = R - x, C = I - y, P = F - x, K = v - y;
6649
- return E * E + C * C > P * P + K * K && (R = F, I = v), {
6650
- cx: R,
6651
- cy: I,
6662
+ var s = e - n, c = t - r, u = (o ? a : -a) / st(s * s + c * c), l = u * c, h = -u * s, f = e + l, d = t + h, m = n + l, g = r + h, x = (f + m) / 2, y = (d + g) / 2, b = m - f, p = g - d, w = b * b + p * p, M = i - a, k = f * g - m * d, T = (p < 0 ? -1 : 1) * st(hf(0, M * M * w - k * k)), I = (k * p - b * T) / w, R = (-k * b - p * T) / w, F = (k * p + b * T) / w, _ = (-k * b + p * T) / w, P = I - x, C = R - y, A = F - x, K = _ - y;
6663
+ return P * P + C * C > A * A + K * K && (I = F, R = _), {
6664
+ cx: I,
6665
+ cy: R,
6652
6666
  x01: -l,
6653
6667
  y01: -h,
6654
- x11: R * (i / M - 1),
6655
- y11: I * (i / M - 1)
6668
+ x11: I * (i / M - 1),
6669
+ y11: R * (i / M - 1)
6656
6670
  };
6657
6671
  }
6658
- function _f() {
6659
- var e = yf, t = pf, n = De(0), r = null, i = xf, a = bf, o = vf, s = null, c = gf(u);
6672
+ function Mf() {
6673
+ var e = xf, t = bf, n = De(0), r = null, i = vf, a = wf, o = _f, s = null, c = pf(u);
6660
6674
  function u() {
6661
- var l, h, f = +e.apply(this, arguments), d = +t.apply(this, arguments), m = i.apply(this, arguments) - Bn, g = a.apply(this, arguments) - Bn, x = Da(g - m), y = g > m;
6675
+ var l, h, f = +e.apply(this, arguments), d = +t.apply(this, arguments), m = i.apply(this, arguments) - Bn, g = a.apply(this, arguments) - Bn, x = Fa(g - m), y = g > m;
6662
6676
  if (s || (s = l = c()), d < f && (h = d, d = f, f = h), !(d > ie)) s.moveTo(0, 0);
6663
- else if (x > lf - ie)
6677
+ else if (x > ff - ie)
6664
6678
  s.moveTo(d * je(m), d * Ce(m)), s.arc(0, 0, d, m, g, !y), f > ie && (s.moveTo(f * je(g), f * Ce(g)), s.arc(0, 0, f, g, m, y));
6665
6679
  else {
6666
- var b = m, p = g, _ = m, M = g, k = x, T = x, R = o.apply(this, arguments) / 2, I = R > ie && (r ? +r.apply(this, arguments) : st(f * f + d * d)), F = $r(Da(d - f) / 2, +n.apply(this, arguments)), v = F, E = F, C, P;
6667
- if (I > ie) {
6668
- var K = Ua(I / f * Ce(R)), Y = Ua(I / d * Ce(R));
6669
- (k -= K * 2) > ie ? (K *= y ? 1 : -1, _ += K, M -= K) : (k = 0, _ = M = (m + g) / 2), (T -= Y * 2) > ie ? (Y *= y ? 1 : -1, b += Y, p -= Y) : (T = 0, b = p = (m + g) / 2);
6680
+ var b = m, p = g, w = m, M = g, k = x, T = x, I = o.apply(this, arguments) / 2, R = I > ie && (r ? +r.apply(this, arguments) : st(f * f + d * d)), F = $r(Fa(d - f) / 2, +n.apply(this, arguments)), _ = F, P = F, C, A;
6681
+ if (R > ie) {
6682
+ var K = Da(R / f * Ce(I)), Y = Da(R / d * Ce(I));
6683
+ (k -= K * 2) > ie ? (K *= y ? 1 : -1, w += K, M -= K) : (k = 0, w = M = (m + g) / 2), (T -= Y * 2) > ie ? (Y *= y ? 1 : -1, b += Y, p -= Y) : (T = 0, b = p = (m + g) / 2);
6670
6684
  }
6671
6685
  var z = d * je(b), W = d * Ce(b), G = f * je(M), xe = f * Ce(M);
6672
6686
  if (F > ie) {
6673
- var Me = d * je(p), te = d * Ce(p), Be = f * je(_), Nt = f * Ce(_), be;
6687
+ var Me = d * je(p), te = d * Ce(p), Be = f * je(w), Nt = f * Ce(w), be;
6674
6688
  if (x < rn)
6675
- if (be = wf(z, W, Be, Nt, Me, te, G, xe)) {
6676
- var Mt = z - be[0], Ct = W - be[1], St = Me - be[0], S = te - be[1], L = 1 / Ce(hf((Mt * St + Ct * S) / (st(Mt * Mt + Ct * Ct) * st(St * St + S * S))) / 2), D = st(be[0] * be[0] + be[1] * be[1]);
6677
- v = $r(F, (f - D) / (L - 1)), E = $r(F, (d - D) / (L + 1));
6689
+ if (be = Nf(z, W, Be, Nt, Me, te, G, xe)) {
6690
+ var Mt = z - be[0], Ct = W - be[1], St = Me - be[0], S = te - be[1], L = 1 / Ce(df((Mt * St + Ct * S) / (st(Mt * Mt + Ct * Ct) * st(St * St + S * S))) / 2), D = st(be[0] * be[0] + be[1] * be[1]);
6691
+ _ = $r(F, (f - D) / (L - 1)), P = $r(F, (d - D) / (L + 1));
6678
6692
  } else
6679
- v = E = 0;
6693
+ _ = P = 0;
6680
6694
  }
6681
- T > ie ? E > ie ? (C = vn(Be, Nt, z, W, d, E, y), P = vn(Me, te, G, xe, d, E, y), s.moveTo(C.cx + C.x01, C.cy + C.y01), E < F ? s.arc(C.cx, C.cy, E, ee(C.y01, C.x01), ee(P.y01, P.x01), !y) : (s.arc(C.cx, C.cy, E, ee(C.y01, C.x01), ee(C.y11, C.x11), !y), s.arc(0, 0, d, ee(C.cy + C.y11, C.cx + C.x11), ee(P.cy + P.y11, P.cx + P.x11), !y), s.arc(P.cx, P.cy, E, ee(P.y11, P.x11), ee(P.y01, P.x01), !y))) : (s.moveTo(z, W), s.arc(0, 0, d, b, p, !y)) : s.moveTo(z, W), !(f > ie) || !(k > ie) ? s.lineTo(G, xe) : v > ie ? (C = vn(G, xe, Me, te, f, -v, y), P = vn(z, W, Be, Nt, f, -v, y), s.lineTo(C.cx + C.x01, C.cy + C.y01), v < F ? s.arc(C.cx, C.cy, v, ee(C.y01, C.x01), ee(P.y01, P.x01), !y) : (s.arc(C.cx, C.cy, v, ee(C.y01, C.x01), ee(C.y11, C.x11), !y), s.arc(0, 0, f, ee(C.cy + C.y11, C.cx + C.x11), ee(P.cy + P.y11, P.cx + P.x11), y), s.arc(P.cx, P.cy, v, ee(P.y11, P.x11), ee(P.y01, P.x01), !y))) : s.arc(0, 0, f, M, _, y);
6695
+ T > ie ? P > ie ? (C = vn(Be, Nt, z, W, d, P, y), A = vn(Me, te, G, xe, d, P, y), s.moveTo(C.cx + C.x01, C.cy + C.y01), P < F ? s.arc(C.cx, C.cy, P, ee(C.y01, C.x01), ee(A.y01, A.x01), !y) : (s.arc(C.cx, C.cy, P, ee(C.y01, C.x01), ee(C.y11, C.x11), !y), s.arc(0, 0, d, ee(C.cy + C.y11, C.cx + C.x11), ee(A.cy + A.y11, A.cx + A.x11), !y), s.arc(A.cx, A.cy, P, ee(A.y11, A.x11), ee(A.y01, A.x01), !y))) : (s.moveTo(z, W), s.arc(0, 0, d, b, p, !y)) : s.moveTo(z, W), !(f > ie) || !(k > ie) ? s.lineTo(G, xe) : _ > ie ? (C = vn(G, xe, Me, te, f, -_, y), A = vn(z, W, Be, Nt, f, -_, y), s.lineTo(C.cx + C.x01, C.cy + C.y01), _ < F ? s.arc(C.cx, C.cy, _, ee(C.y01, C.x01), ee(A.y01, A.x01), !y) : (s.arc(C.cx, C.cy, _, ee(C.y01, C.x01), ee(C.y11, C.x11), !y), s.arc(0, 0, f, ee(C.cy + C.y11, C.cx + C.x11), ee(A.cy + A.y11, A.cx + A.x11), y), s.arc(A.cx, A.cy, _, ee(A.y11, A.x11), ee(A.y01, A.x01), !y))) : s.arc(0, 0, f, M, w, y);
6682
6696
  }
6683
6697
  if (s.closePath(), l) return s = null, l + "" || null;
6684
6698
  }
@@ -6703,8 +6717,8 @@ function _f() {
6703
6717
  return arguments.length ? (s = l ?? null, u) : s;
6704
6718
  }, u;
6705
6719
  }
6706
- const Nf = _f();
6707
- function Mf(e) {
6720
+ const Cf = Mf();
6721
+ function Sf(e) {
6708
6722
  const { clade: t, ...n } = e, r = H(Le), i = H(wt), a = H(_t), { root: o, leftMost: s, rightMost: c, mostDiverged: u } = t, l = r(i(o)), h = r(i(s)), f = r(i(c)), d = r(i(u)), { layoutClass: m } = i(o);
6709
6723
  if (m === q.Rectangular) {
6710
6724
  const g = d.x - l.x, x = Math.abs(h.y - f.y);
@@ -6720,26 +6734,26 @@ function Mf(e) {
6720
6734
  }
6721
6735
  );
6722
6736
  } else if (m === q.Polar) {
6723
- const g = r({ x: 0, y: 0 }), x = `translate(${g.x},${g.y})`, y = l.r, b = d.r, p = h.theta, _ = f.theta, M = Nf({
6737
+ const g = r({ x: 0, y: 0 }), x = `translate(${g.x},${g.y})`, y = l.r, b = d.r, p = h.theta, w = f.theta, M = Cf({
6724
6738
  innerRadius: y,
6725
6739
  outerRadius: b + 5,
6726
- startAngle: _ + Math.PI / 2,
6740
+ startAngle: w + Math.PI / 2,
6727
6741
  endAngle: p + Math.PI / 2
6728
6742
  });
6729
6743
  return Z(M, "Error making arc shape for Clade Highlight"), /* @__PURE__ */ $(Jn, { d: M, transform: x, ...n, animated: a });
6730
6744
  } else
6731
6745
  return null;
6732
6746
  }
6733
- const Cf = ns(Mf);
6734
- function Sf(e) {
6747
+ const $f = ns(Sf);
6748
+ function kf(e) {
6735
6749
  switch (e.shape) {
6736
6750
  case bt.Cartoon:
6737
- return /* @__PURE__ */ $(uf, { ...e });
6751
+ return /* @__PURE__ */ $(lf, { ...e });
6738
6752
  case bt.Highlight:
6739
- return /* @__PURE__ */ $(Cf, { ...e });
6753
+ return /* @__PURE__ */ $($f, { ...e });
6740
6754
  }
6741
6755
  }
6742
- function $f(e) {
6756
+ function Tf(e) {
6743
6757
  return typeof e == "function";
6744
6758
  }
6745
6759
  function Ee(e) {
@@ -6747,7 +6761,7 @@ function Ee(e) {
6747
6761
  const n = {};
6748
6762
  for (const r in e) {
6749
6763
  const i = e[r];
6750
- $f(i) ? n[r] = i(t) : n[r] = i;
6764
+ Tf(i) ? n[r] = i(t) : n[r] = i;
6751
6765
  }
6752
6766
  return n;
6753
6767
  };
@@ -6764,7 +6778,7 @@ function wn(e) {
6764
6778
  return n;
6765
6779
  };
6766
6780
  }
6767
- function kf(e, t) {
6781
+ function Pf(e, t) {
6768
6782
  const n = "filter" in e ? e.filter : () => !0;
6769
6783
  Z(n, "Issue with filter option when making baubles");
6770
6784
  const r = "nodes" in e ? e.nodes : t.getNodes().filter(n), i = wn(e.interactions ?? {});
@@ -6875,16 +6889,16 @@ function kf(e, t) {
6875
6889
  }
6876
6890
  }
6877
6891
  }
6878
- function Gf(e) {
6892
+ function Xf(e) {
6879
6893
  return { ...e, shape: xt.Circle, target: ye.Node };
6880
6894
  }
6881
- function Qf(e) {
6895
+ function Zf(e) {
6882
6896
  return { ...e, shape: xt.Rectangle, target: ye.Node };
6883
6897
  }
6884
- function Tf(e) {
6898
+ function Af(e) {
6885
6899
  return { ...e, target: ye.Branch };
6886
6900
  }
6887
- function Xf(e) {
6901
+ function Kf(e) {
6888
6902
  return {
6889
6903
  attrs: {},
6890
6904
  aligned: !1,
@@ -6892,17 +6906,17 @@ function Xf(e) {
6892
6906
  target: ye.NodeLabel
6893
6907
  };
6894
6908
  }
6895
- function Zf(e) {
6909
+ function Jf(e) {
6896
6910
  return { attrs: {}, ...e, target: ye.BranchLabel };
6897
6911
  }
6898
- function Kf(e) {
6912
+ function ed(e) {
6899
6913
  return {
6900
6914
  ...e,
6901
6915
  shape: bt.Highlight,
6902
6916
  target: ye.Clade
6903
6917
  };
6904
6918
  }
6905
- function Jf(e) {
6919
+ function td(e) {
6906
6920
  return { ...e, shape: bt.Cartoon, target: ye.Clade };
6907
6921
  }
6908
6922
  const le = {
@@ -6923,7 +6937,7 @@ const le = {
6923
6937
  evenFill: "#EDEDED",
6924
6938
  oddFill: "none"
6925
6939
  };
6926
- function Pf(e) {
6940
+ function Ef(e) {
6927
6941
  const {
6928
6942
  attrs: t,
6929
6943
  evenFill: n = Vn.evenFill,
@@ -6953,7 +6967,7 @@ function Pf(e) {
6953
6967
  );
6954
6968
  }) });
6955
6969
  }
6956
- function Af(e) {
6970
+ function Rf(e) {
6957
6971
  const t = H(ln), n = H(Le), { bars: r, attrs: i } = e, a = e.ticks ? { ...le.ticks, ...e.ticks } : le.ticks, o = e.title ? { ...le.title, ...e.title } : le.title, s = is(e, t);
6958
6972
  let c;
6959
6973
  a.values != null ? c = a.values : c = s.ticks(a.number);
@@ -6965,10 +6979,10 @@ function Af(e) {
6965
6979
  ), l = t.domainY[1] + t.domainY[1] * 5e-3, h = n({ x: t.domainX[0], y: l }), f = n({ x: t.domainX[1], y: l }), d = `M${h.x},${h.y} L${f.x},${f.y}`, m = a.length * Math.cos(u), g = a.length * Math.sin(u), x = a.padding * Math.cos(u), y = a.padding * Math.sin(u), b = pe(
6966
6980
  pi(s.range()),
6967
6981
  "Error calculating x position for title"
6968
- ), p = n({ x: b, y: l }), _ = o.padding * Math.cos(u), M = o.padding * Math.sin(u);
6982
+ ), p = n({ x: b, y: l }), w = o.padding * Math.cos(u), M = o.padding * Math.sin(u);
6969
6983
  return /* @__PURE__ */ Ie("g", { className: "axis", children: [
6970
6984
  /* @__PURE__ */ $(
6971
- Pf,
6985
+ Ef,
6972
6986
  {
6973
6987
  ...r,
6974
6988
  tickValues: c,
@@ -6980,11 +6994,11 @@ function Af(e) {
6980
6994
  /* @__PURE__ */ $("path", { d, stroke: "black", ...i }),
6981
6995
  /* @__PURE__ */ Ie("g", { children: [
6982
6996
  c.map((k, T) => {
6983
- const R = n({ x: s(k), y: l });
6997
+ const I = n({ x: s(k), y: l });
6984
6998
  return /* @__PURE__ */ Ie(
6985
6999
  "g",
6986
7000
  {
6987
- transform: `translate(${R.x},${R.y}) rotate(90)`,
7001
+ transform: `translate(${I.x},${I.y}) rotate(90)`,
6988
7002
  children: [
6989
7003
  /* @__PURE__ */ $("line", { x1: m, y1: g, x2: 0, y2: 0, stroke: "black", ...i }),
6990
7004
  /* @__PURE__ */ $(
@@ -7006,7 +7020,7 @@ function Af(e) {
7006
7020
  "text",
7007
7021
  {
7008
7022
  textAnchor: "middle",
7009
- transform: `translate(${_},${M}) rotate(-90)`,
7023
+ transform: `translate(${w},${M}) rotate(-90)`,
7010
7024
  children: o.text
7011
7025
  }
7012
7026
  ) })
@@ -7026,7 +7040,7 @@ function is(e, t) {
7026
7040
  }
7027
7041
  return s.nice();
7028
7042
  }
7029
- function Ef(e) {
7043
+ function If(e) {
7030
7044
  const {
7031
7045
  attrs: t,
7032
7046
  evenFill: n = Vn.evenFill,
@@ -7057,7 +7071,7 @@ function Ef(e) {
7057
7071
  );
7058
7072
  }, []) }, "axisBars");
7059
7073
  }
7060
- function Rf(e) {
7074
+ function Lf(e) {
7061
7075
  const t = H(ln), n = H(Le), {
7062
7076
  // direction = defaultAxisProps.direction,
7063
7077
  gap: r = le.gap,
@@ -7071,7 +7085,7 @@ function Rf(e) {
7071
7085
  ), g = n({ x: m, y: l });
7072
7086
  return /* @__PURE__ */ Ie("g", { className: "axis", children: [
7073
7087
  i ? /* @__PURE__ */ $(
7074
- Ef,
7088
+ If,
7075
7089
  {
7076
7090
  ...i,
7077
7091
  tickValues: u,
@@ -7126,25 +7140,25 @@ function Rf(e) {
7126
7140
  ] })
7127
7141
  ] });
7128
7142
  }
7129
- function If(e) {
7143
+ function Ff(e) {
7130
7144
  const t = H(ln), { layoutClass: n } = t;
7131
- return n === q.Polar ? /* @__PURE__ */ $(Af, { ...e }) : n === q.Rectangular ? /* @__PURE__ */ $(Rf, { ...e }) : (console.warn(`Axis not supported for ${n}`), null);
7145
+ return n === q.Polar ? /* @__PURE__ */ $(Rf, { ...e }) : n === q.Rectangular ? /* @__PURE__ */ $(Lf, { ...e }) : (console.warn(`Axis not supported for ${n}`), null);
7132
7146
  }
7133
- const Lf = qo.fromNewick("((A:1,B:1):1,C:2);"), re = {
7147
+ const Df = jo.fromNewick("((A:1,B:1):1,C:2);"), re = {
7134
7148
  opts: Du,
7135
7149
  width: 100,
7136
7150
  layout: Yl,
7137
7151
  margins: { top: 10, right: 10, bottom: 10, left: 10 },
7138
- tree: Lf,
7152
+ tree: Df,
7139
7153
  baubles: [
7140
- Tf({
7154
+ Af({
7141
7155
  filter: () => !0,
7142
7156
  attrs: { stroke: "black", strokeWidth: 1 }
7143
7157
  })
7144
7158
  ],
7145
7159
  animated: !1
7146
7160
  };
7147
- function ed(e) {
7161
+ function nd(e) {
7148
7162
  const {
7149
7163
  width: t = re.width,
7150
7164
  height: n = re.width,
@@ -7165,11 +7179,11 @@ function ed(e) {
7165
7179
  } = u;
7166
7180
  let x, y, { x: b, y: p } = e;
7167
7181
  b !== void 0 && p !== void 0 ? (x = t, y = n) : (x = t - r.left - r.right, y = n - r.top - r.bottom, b = r.left, p = r.top);
7168
- const _ = a(i, u), { layoutClass: M } = _(i.getRoot()), k = ft(i.getNodes().map((v) => _(v).x)).map(
7169
- (v) => pe(v, "Error finding x extent from layout")
7170
- ), T = ft(i.getNodes().map((v) => _(v).y)).map(
7171
- (v) => pe(v, "Error finding y extent from layout")
7172
- ), R = {
7182
+ const w = a(i, u), { layoutClass: M } = w(i.getRoot()), k = ft(i.getNodes().map((_) => w(_).x)).map(
7183
+ (_) => pe(_, "Error finding x extent from layout")
7184
+ ), T = ft(i.getNodes().map((_) => w(_).y)).map(
7185
+ (_) => pe(_, "Error finding y extent from layout")
7186
+ ), I = {
7173
7187
  canvasWidth: x,
7174
7188
  canvasHeight: y,
7175
7189
  domainX: k,
@@ -7181,38 +7195,38 @@ function ed(e) {
7181
7195
  fishEye: f,
7182
7196
  rootAngle: l,
7183
7197
  angleRange: h
7184
- }, I = Rh(R), F = s.map((v) => kf(v, i));
7185
- return /* @__PURE__ */ $("g", { children: /* @__PURE__ */ $("g", { transform: `translate(${b},${p})`, children: /* @__PURE__ */ $(Le.Provider, { value: I, children: /* @__PURE__ */ $(ln.Provider, { value: R, children: /* @__PURE__ */ $(wt.Provider, { value: _, children: /* @__PURE__ */ Ie(_t.Provider, { value: o, children: [
7186
- c ? /* @__PURE__ */ $(If, { ...c }) : null,
7187
- F.map((v, E) => /* @__PURE__ */ $(of, { ...v }, v.id ?? E))
7198
+ }, R = Lh(I), F = s.map((_) => Pf(_, i));
7199
+ return /* @__PURE__ */ $("g", { children: /* @__PURE__ */ $("g", { transform: `translate(${b},${p})`, children: /* @__PURE__ */ $(Le.Provider, { value: R, children: /* @__PURE__ */ $(ln.Provider, { value: I, children: /* @__PURE__ */ $(wt.Provider, { value: w, children: /* @__PURE__ */ Ie(_t.Provider, { value: o, children: [
7200
+ c ? /* @__PURE__ */ $(Ff, { ...c }) : null,
7201
+ F.map((_, P) => /* @__PURE__ */ $(uf, { ..._ }, _.id ?? P))
7188
7202
  ] }) }) }) }) }) });
7189
7203
  }
7190
7204
  export {
7191
7205
  V as BaseAnnotationType,
7192
- Zf as BranchLabels,
7193
- Tf as Branches,
7194
- Jf as CartoonClades,
7195
- Gf as CircleNodes,
7196
- ed as FigTree,
7197
- Kf as HighlightClades,
7198
- qo as ImmutableTree,
7199
- qf as NexusImporter,
7200
- Xf as NodeLabels,
7201
- Hf as PreOrderTraversalCache,
7202
- Qf as RectangleNodes,
7206
+ Jf as BranchLabels,
7207
+ Af as Branches,
7208
+ td as CartoonClades,
7209
+ Xf as CircleNodes,
7210
+ nd as FigTree,
7211
+ ed as HighlightClades,
7212
+ jo as ImmutableTree,
7213
+ Yf as NexusImporter,
7214
+ Kf as NodeLabels,
7215
+ Wf as PreOrderTraversalCache,
7216
+ Zf as RectangleNodes,
7203
7217
  tr as TaxonSet,
7204
- zf as dateToDecimal,
7205
- Of as decimalToDate,
7218
+ Vf as dateToDecimal,
7219
+ Bf as decimalToDate,
7206
7220
  Du as defaultInternalLayoutOptions,
7207
7221
  q as layoutClass,
7208
- Ao as leapYear,
7209
- jf as pathToRootIterator,
7210
- Yf as polarLayout,
7222
+ Po as leapYear,
7223
+ Hf as pathToRootIterator,
7224
+ Gf as polarLayout,
7211
7225
  Vl as postOrderIterator,
7212
7226
  Bl as preOrderIterator,
7213
- Vf as psuedoRootPostOrderIterator,
7214
- Bf as psuedoRootPreOrderIterator,
7215
- Wf as radialLayout,
7227
+ qf as psuedoRootPostOrderIterator,
7228
+ jf as psuedoRootPreOrderIterator,
7229
+ Qf as radialLayout,
7216
7230
  Yl as rectangularLayout,
7217
7231
  Ci as tipIterator
7218
7232
  };