@algorisys/tinyfly 0.119.1 → 0.120.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,13 +20,13 @@ function kn(t) {
20
20
  function bu(t) {
21
21
  return t.property === "motionPath" && "motionPathConfig" in t;
22
22
  }
23
- function U3(t) {
23
+ function G3(t) {
24
24
  return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
25
25
  }
26
26
  function Dg(t) {
27
27
  return "keyframes" in t;
28
28
  }
29
- class G3 {
29
+ class U3 {
30
30
  _currentTime = 0;
31
31
  _isRunning = !1;
32
32
  onTick = null;
@@ -285,14 +285,14 @@ function tS(t, e) {
285
285
  const n = _r(t), s = oo(t);
286
286
  return e >= ro(t) ? 0 : (s - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
287
287
  }
288
- const pa = (t) => t, Xg = (t) => t * t, Ug = (t) => 1 - (1 - t) * (1 - t), Gg = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, Mu = (t) => t * t * t, xu = (t) => 1 - Math.pow(1 - t, 3), Cr = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Vg = Mu, Jg = xu, Zg = Cr, Qg = {
288
+ const pa = (t) => t, Xg = (t) => t * t, Gg = (t) => 1 - (1 - t) * (1 - t), Ug = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, Mu = (t) => t * t * t, xu = (t) => 1 - Math.pow(1 - t, 3), Cr = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Vg = Mu, Jg = xu, Zg = Cr, Qg = {
289
289
  linear: pa,
290
290
  "ease-in": Vg,
291
291
  "ease-out": Jg,
292
292
  "ease-in-out": Zg,
293
293
  "ease-in-quad": Xg,
294
- "ease-out-quad": Ug,
295
- "ease-in-out-quad": Gg,
294
+ "ease-out-quad": Gg,
295
+ "ease-in-out-quad": Ug,
296
296
  "ease-in-cubic": Mu,
297
297
  "ease-out-cubic": xu,
298
298
  "ease-in-out-cubic": Cr
@@ -448,12 +448,12 @@ function up(t, e, n, s, o, r, i, a, l) {
448
448
  }, tt = (R) => {
449
449
  const D = -c * Math.sin(R), Y = h * Math.cos(R);
450
450
  return [d * D - f * Y, f * D + d * Y];
451
- }, G = [];
451
+ }, U = [];
452
452
  for (let R = 0; R < C; R++) {
453
453
  const D = P + R * W, Y = D + W, [_, j] = V(D), [nt, $] = R === C - 1 ? [a, l] : V(Y), [I, B] = tt(D), [K, L] = tt(Y);
454
- G.push([_ + q * I, j + q * B, nt - q * K, $ - q * L, nt, $]);
454
+ U.push([_ + q * I, j + q * B, nt - q * K, $ - q * L, nt, $]);
455
455
  }
456
- return G;
456
+ return U;
457
457
  }
458
458
  function De(t, e, n, s, o) {
459
459
  const r = 1 - o;
@@ -770,14 +770,14 @@ const Dn = Math.PI / 180, Ap = 0.9995;
770
770
  function ul() {
771
771
  return [0, 0, 0, 1];
772
772
  }
773
- function Gt(t, e) {
773
+ function Ut(t, e) {
774
774
  const n = Math.hypot(t[0], t[1], t[2]);
775
775
  if (n === 0) return ul();
776
776
  const s = e * Dn / 2, o = Math.sin(s) / n;
777
777
  return [t[0] * o, t[1] * o, t[2] * o, Math.cos(s)];
778
778
  }
779
779
  function $p(t, e, n) {
780
- return ya(ya(Gt([0, 1, 0], e), Gt([1, 0, 0], t)), Gt([0, 0, 1], n));
780
+ return ya(ya(Ut([0, 1, 0], e), Ut([1, 0, 0], t)), Ut([0, 0, 1], n));
781
781
  }
782
782
  function Pp(t) {
783
783
  const [e, n, s, o] = Ye(t), r = 2 * (e * s + n * o), i = 2 * (e * n + s * o), a = 1 - 2 * (e * e + s * s), l = 2 * (n * s - e * o), c = 1 - 2 * (n * n + s * s), h = 2 * (e * s - n * o), u = 1 - 2 * (e * e + n * n), d = Math.asin(Math.max(-1, Math.min(1, -l)));
@@ -831,7 +831,7 @@ const rS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
831
831
  __proto__: null,
832
832
  conjugate: Op,
833
833
  dot: Tu,
834
- fromAxisAngle: Gt,
834
+ fromAxisAngle: Ut,
835
835
  fromEuler: $p,
836
836
  identity: ul,
837
837
  length: Eu,
@@ -1651,7 +1651,7 @@ function ve(t) {
1651
1651
  ...t.stagger !== void 0 && { stagger: { ...t.stagger } }
1652
1652
  };
1653
1653
  }
1654
- function Up(t) {
1654
+ function Gp(t) {
1655
1655
  if (wn(t)) {
1656
1656
  const e = t;
1657
1657
  return {
@@ -1705,7 +1705,7 @@ function Up(t) {
1705
1705
  ...ve(t)
1706
1706
  });
1707
1707
  }
1708
- function Gp(t) {
1708
+ function Up(t) {
1709
1709
  const e = t._config.markers;
1710
1710
  return {
1711
1711
  formatVersion: yu(t.tracks),
@@ -1734,12 +1734,12 @@ function zs(t) {
1734
1734
  id: t.id,
1735
1735
  name: t.name,
1736
1736
  config: t.config,
1737
- tracks: t.tracks.map(Up),
1737
+ tracks: t.tracks.map(Gp),
1738
1738
  captions: t.captions
1739
1739
  });
1740
1740
  }
1741
1741
  function cS(t) {
1742
- return JSON.stringify(Gp(t));
1742
+ return JSON.stringify(Up(t));
1743
1743
  }
1744
1744
  function hS(t) {
1745
1745
  const e = JSON.parse(t);
@@ -2398,7 +2398,7 @@ function Xu(t, e = {}) {
2398
2398
  ];
2399
2399
  return t.hide ? u.filter((d) => !t.hide.includes(d.side)) : u;
2400
2400
  }
2401
- function Uu(t, e = {}) {
2401
+ function Gu(t, e = {}) {
2402
2402
  return t.map((n) => ({ box: n, depth: Ku([(n.min[0] + n.max[0]) / 2, (n.min[1] + n.max[1]) / 2, (n.min[2] + n.max[2]) / 2]) })).sort((n, s) => n.depth - s.depth).flatMap(({ box: n }) => Xu(n, e));
2403
2403
  }
2404
2404
  function jS(t = {}) {
@@ -2407,7 +2407,7 @@ function jS(t = {}) {
2407
2407
  { tag: 1, min: [e - s, -s, -s], max: [e + s, e - s, s] },
2408
2408
  { tag: 2, min: [e - s, e - s, -s], max: [e + s, e + s, e] }
2409
2409
  ], r = t.centre ?? { x: 0, y: 0 }, i = gl([2 * e / 3, e / 3, e / 3], { scale: t.scale }), a = { centre: { x: r.x - i.x, y: r.y - i.y }, scale: t.scale };
2410
- return { boxes: o, faces: [...Uu(o, a), ...Xu({ ...o[0], hide: ["right"] }, a)] };
2410
+ return { boxes: o, faces: [...Gu(o, a), ...Xu({ ...o[0], hide: ["right"] }, a)] };
2411
2411
  }
2412
2412
  function YS(t = {}) {
2413
2413
  const e = Math.max(2, Math.round(t.steps ?? 8)), n = t.tread ?? 1.5, s = t.rise ?? 0.25, o = t.width ?? 3, r = t.base ?? 1.5, i = Math.max(1, Math.round(e * (n - 2 * s) / (n + 2 * s))), a = 2 * (e + i), l = n * (e - i) / a, c = [
@@ -2429,7 +2429,7 @@ function YS(t = {}) {
2429
2429
  u = [u[0] + y.dir[0] * y.count * n, u[1] + y.dir[1] * y.count * n, 0];
2430
2430
  }
2431
2431
  const f = a * l, p = t.centre ?? { x: 0, y: 0 }, g = gl([e * n / 2, e * n / 2, f / 2 + r], { scale: t.scale }), m = { centre: { x: p.x - g.x, y: p.y - g.y }, scale: t.scale };
2432
- return { boxes: h, faces: Uu(h, m), rise: l };
2432
+ return { boxes: h, faces: Gu(h, m), rise: l };
2433
2433
  }
2434
2434
  function km(t, e, n) {
2435
2435
  let s = 0;
@@ -2542,7 +2542,7 @@ function XS(t) {
2542
2542
  }
2543
2543
  return [...d, ...y, ...u.reverse()];
2544
2544
  }
2545
- function US(t) {
2545
+ function GS(t) {
2546
2546
  const e = Math.min(1, Math.max(0, t.grow ?? 1)), n = e >= 1 ? 1 : 1 - Math.pow(1 - e, 3) + 0.08 * Math.sin(e * Math.PI) * e, s = t.r * Math.max(0, n);
2547
2547
  if (s <= 0) return [];
2548
2548
  const o = Math.max(12, Math.round(t.segments ?? 48)), r = t.wobble ?? 0.05, i = t.time ?? 0, a = t.period ? i / t.period : i / 2500, l = (a - Math.floor(a)) * Math.PI * 2, c = t.seed ?? 0, h = [];
@@ -2552,7 +2552,7 @@ function US(t) {
2552
2552
  }
2553
2553
  return h;
2554
2554
  }
2555
- function GS(t) {
2555
+ function US(t) {
2556
2556
  const e = t.progress;
2557
2557
  if (e <= 0 || e >= 1) return [];
2558
2558
  const n = Math.max(3, Math.round(t.pieces ?? 8)), s = [], o = t.r * (1 + 1.2 * e), r = Math.PI * 2 / n * 0.6 * (1 - e);
@@ -2780,7 +2780,7 @@ function Am(t) {
2780
2780
  zt({ type: "bounce", mode: "in" });
2781
2781
  zt({ type: "bounce", mode: "in-out" });
2782
2782
  function or(t) {
2783
- const e = Gu.get(t.trim().toLowerCase());
2783
+ const e = Uu.get(t.trim().toLowerCase());
2784
2784
  if (e) return e;
2785
2785
  const n = Am(t), s = /^steps\(\s*(\d+)\s*\)$/.exec(n);
2786
2786
  if (s) {
@@ -2797,9 +2797,9 @@ function or(t) {
2797
2797
  }
2798
2798
  return n in $c ? { easing: $c[n] } : n in bo ? { easing: { type: "cubic-bezier", points: bo[n] } } : { easing: "ease-out" };
2799
2799
  }
2800
- const Gu = /* @__PURE__ */ new Map();
2800
+ const Uu = /* @__PURE__ */ new Map();
2801
2801
  function yl(t, e) {
2802
- return Gu.set(
2802
+ return Uu.set(
2803
2803
  t.trim().toLowerCase(),
2804
2804
  e.bezier ? { easing: { type: "cubic-bezier", points: e.bezier }, fn: e.fn } : { fn: e.fn, requiresBaking: "custom" }
2805
2805
  ), t;
@@ -3352,7 +3352,7 @@ class Xn {
3352
3352
  from: C,
3353
3353
  to: O,
3354
3354
  velocity: Xm(w, A) ?? this.options.startVelocity?.(d[0], A) ?? 0
3355
- }, tt = this.nextTrackId(`${d[0]}-${A}-spring`), G = {
3355
+ }, tt = this.nextTrackId(`${d[0]}-${A}-spring`), U = {
3356
3356
  id: tt,
3357
3357
  target: d[0],
3358
3358
  ...d.length > 1 && { targets: d },
@@ -3362,7 +3362,7 @@ class Xn {
3362
3362
  spring: V,
3363
3363
  delay: f + p
3364
3364
  };
3365
- this.timeline.addTrack(G), k.push(tt), b = Math.max(b, zg(V));
3365
+ this.timeline.addTrack(U), k.push(tt), b = Math.max(b, zg(V));
3366
3366
  for (const R of d) this.lastValues.set(`${R}|${A}`, O);
3367
3367
  continue;
3368
3368
  }
@@ -3512,13 +3512,13 @@ function ui(t) {
3512
3512
  }
3513
3513
  return String(t ?? "");
3514
3514
  }
3515
- function Um(t) {
3515
+ function Gm(t) {
3516
3516
  return new Xn(t);
3517
3517
  }
3518
3518
  function ws(t) {
3519
3519
  return zm(Wm(t));
3520
3520
  }
3521
- function Gm(t) {
3521
+ function Um(t) {
3522
3522
  return !Array.isArray(t) || t.length !== 4 ? null : `matrix3d(${me(Ye(t)).map((n) => Math.round(n * 1e6) / 1e6 + 0).join(", ")})`;
3523
3523
  }
3524
3524
  const Vm = /* @__PURE__ */ new Set([
@@ -3723,7 +3723,7 @@ class pn {
3723
3723
  * Build a transform function string for a property.
3724
3724
  */
3725
3725
  buildTransformPart(e, n) {
3726
- if (e === "quaternion") return Gm(n);
3726
+ if (e === "quaternion") return Um(n);
3727
3727
  if (typeof n != "number") return null;
3728
3728
  switch (e) {
3729
3729
  case "x":
@@ -5406,7 +5406,7 @@ function mi(t, e) {
5406
5406
  function Xy(t) {
5407
5407
  return Math.round(t * 100) / 100;
5408
5408
  }
5409
- function Uy(t, e) {
5409
+ function Gy(t, e) {
5410
5410
  switch (e) {
5411
5411
  // Play forward from wherever it is; reverse() flips a reversed timeline and plays.
5412
5412
  // Neither restarts an animation that is already at that end.
@@ -5445,7 +5445,7 @@ function kl(t, e, n, s, o = () => {
5445
5445
  const a = e.scrub === void 0 || e.scrub === !1 ? !1 : e.scrub, l = (e.toggleActions ?? "play none none none").trim().split(/\s+/);
5446
5446
  let c = 0, h;
5447
5447
  const u = (f, p) => () => {
5448
- p?.(), n && !a && Uy(n, l[f] ?? "none"), e.once && f === 0 && queueMicrotask(() => h.destroy());
5448
+ p?.(), n && !a && Gy(n, l[f] ?? "none"), e.once && f === 0 && queueMicrotask(() => h.destroy());
5449
5449
  }, d = e.containerAnimation ? Jy(t, e.containerAnimation, i, o) : void 0;
5450
5450
  return h = new Nr({
5451
5451
  trigger: i,
@@ -5457,7 +5457,7 @@ function kl(t, e, n, s, o = () => {
5457
5457
  horizontal: e.horizontal,
5458
5458
  pinSpacing: e.pinSpacing,
5459
5459
  onRefresh: e.invalidateOnRefresh && n?.invalidate ? () => n.invalidate() : void 0,
5460
- snap: e.snap === void 0 ? void 0 : Gy(e.snap, n),
5460
+ snap: e.snap === void 0 ? void 0 : Uy(e.snap, n),
5461
5461
  markers: e.markers,
5462
5462
  container: d,
5463
5463
  onUpdate: (f, p) => {
@@ -5473,7 +5473,7 @@ function kl(t, e, n, s, o = () => {
5473
5473
  onLeaveBack: u(3, e.onLeaveBack)
5474
5474
  }), n && a === !1 && n.progress(0), h.start(), t.own(h);
5475
5475
  }
5476
- function Gy(t, e) {
5476
+ function Uy(t, e) {
5477
5477
  const n = (o) => o === "labels" ? (r) => Vy(r, e?.labelProgresses?.() ?? []) : o;
5478
5478
  if (typeof t != "object" || Array.isArray(t)) return n(t);
5479
5479
  const s = t.ease ? or(t.ease) : void 0;
@@ -5881,7 +5881,7 @@ class _e {
5881
5881
  }
5882
5882
  },
5883
5883
  startVelocity: (o, r) => e.velocityOf(o, r),
5884
- layoutColumns: (o) => Gc(o.map((r) => e.elementFor(r))),
5884
+ layoutColumns: (o) => Uc(o.map((r) => e.elementFor(r))),
5885
5885
  random: () => e.utils.random(0, 1)
5886
5886
  }), this.compat.timeline.onComplete = () => {
5887
5887
  this.finishedThisFrame = !0;
@@ -6178,7 +6178,7 @@ class _e {
6178
6178
  staggerContext(e) {
6179
6179
  return {
6180
6180
  count: e.length,
6181
- columnsFromLayout: () => Gc(e.map((n) => this.stage.elementFor(n))),
6181
+ columnsFromLayout: () => Uc(e.map((n) => this.stage.elementFor(n))),
6182
6182
  random: () => this.stage.utils.random(0, 1)
6183
6183
  };
6184
6184
  }
@@ -6186,12 +6186,12 @@ class _e {
6186
6186
  const r = e.map((d) => this.targetFor(d));
6187
6187
  if (!(e.length > 1 && (n.some(g1) || e.some((d) => this.stage.objectFor(d) !== void 0)))) {
6188
6188
  const d = this.targetFor(e[0]);
6189
- o(n.map((f) => this.prepare(Uc(f, 0, d, this.stage.utils, r), e)), e, s);
6189
+ o(n.map((f) => this.prepare(Gc(f, 0, d, this.stage.utils, r), e)), e, s);
6190
6190
  return;
6191
6191
  }
6192
6192
  const a = n.length - 1, { stagger: l, ...c } = n[a], h = ka(l, this.staggerContext(e)), u = h ? fa(e.length, h).map((d) => d / 1e3) : e.map(() => 0);
6193
6193
  e.forEach((d, f) => {
6194
- const p = f === 0 ? rr(c.delay, 0) / 1e3 + u[0] : 0, g = f === 0 ? 0 : u[f] - u[f - 1], m = f === 0 ? s : `<${g < 0 ? "-" : "+"}${Math.abs(g).toFixed(6)}`, k = n.map((w, b) => b === a ? { ...c, delay: p } : w).map((w) => this.prepare(Uc(w, f, this.targetFor(d), this.stage.utils, r), [d]));
6194
+ const p = f === 0 ? rr(c.delay, 0) / 1e3 + u[0] : 0, g = f === 0 ? 0 : u[f] - u[f - 1], m = f === 0 ? s : `<${g < 0 ? "-" : "+"}${Math.abs(g).toFixed(6)}`, k = n.map((w, b) => b === a ? { ...c, delay: p } : w).map((w) => this.prepare(Gc(w, f, this.targetFor(d), this.stage.utils, r), [d]));
6195
6195
  o(k, [d], m);
6196
6196
  });
6197
6197
  }
@@ -6351,14 +6351,14 @@ function g1(t) {
6351
6351
  function hd(t) {
6352
6352
  return Object.entries(t).some(([e, n]) => (typeof n == "function" || Ju(n)) && !bl.has(e));
6353
6353
  }
6354
- function Uc(t, e, n, s, o) {
6354
+ function Gc(t, e, n, s, o) {
6355
6355
  if (!hd(t)) return t;
6356
6356
  const r = {};
6357
6357
  for (const [i, a] of Object.entries(t))
6358
6358
  bl.has(i) ? r[i] = a : typeof a == "function" ? r[i] = a(e, n, o) : Ju(a) ? r[i] = s.resolveRandomString(a) : r[i] = a;
6359
6359
  return r;
6360
6360
  }
6361
- function Gc(t) {
6361
+ function Uc(t) {
6362
6362
  const e = t.map((s) => s?.getBoundingClientRect().top);
6363
6363
  if (e[0] === void 0) return t.length;
6364
6364
  let n = 0;
@@ -6948,8 +6948,8 @@ function M1(t, e, n = {}) {
6948
6948
  const c = s.createElement("div");
6949
6949
  c.className = "tf-ctl-bar", c.setAttribute("role", "group");
6950
6950
  const h = (W, q, V, tt = "") => {
6951
- const G = s.createElement("button");
6952
- return G.type = "button", G.className = `tf-ctl-btn ${tt}`.trim(), G.setAttribute("aria-label", W), G.title = W, G.textContent = q, G.addEventListener("click", V), G;
6951
+ const U = s.createElement("button");
6952
+ return U.type = "button", U.className = `tf-ctl-btn ${tt}`.trim(), U.setAttribute("aria-label", W), U.title = W, U.textContent = q, U.addEventListener("click", V), U;
6953
6953
  }, u = h(o.restart, "⟲", () => {
6954
6954
  t.pause(), t.seek(0);
6955
6955
  }), d = h(o.prev, "|◀", () => t.prev()), f = h(o.play, "▶", () => t.isPlaying ? t.pause() : g(), "tf-ctl-primary"), p = h(o.next, "▶|", () => t.next()), g = () => {
@@ -6986,8 +6986,8 @@ function M1(t, e, n = {}) {
6986
6986
  s.activeElement !== m && (m.value = String(q > 0 ? Math.round(t.currentTime / q * 1e3) : 0));
6987
6987
  const V = t.markers;
6988
6988
  if (d.hidden = p.hidden = y.hidden = V.length === 0, V.length > 0) {
6989
- const tt = t.currentMarker, G = tt ? V.indexOf(tt) + 1 : 0;
6990
- y.textContent = o.stepFormat.replace("{index}", String(G)).replace("{total}", String(V.length)), y.setAttribute("aria-label", `${o.step} ${G} ${o.of} ${V.length}`), d.disabled = t.currentTime <= 0.5, p.disabled = t.currentTime >= q - 0.5;
6989
+ const tt = t.currentMarker, U = tt ? V.indexOf(tt) + 1 : 0;
6990
+ y.textContent = o.stepFormat.replace("{index}", String(U)).replace("{total}", String(V.length)), y.setAttribute("aria-label", `${o.step} ${U} ${o.of} ${V.length}`), d.disabled = t.currentTime <= 0.5, p.disabled = t.currentTime >= q - 0.5;
6991
6991
  const R = t.caption() ?? "";
6992
6992
  b.textContent !== R && (b.textContent = R), b.hidden = !a();
6993
6993
  const D = !W && tt?.question !== void 0 && Math.abs(t.currentTime - tt.time) < 1;
@@ -7876,7 +7876,7 @@ function vo(t, e) {
7876
7876
  for (const n of e.slice(1)) t.lineTo(n.x, n.y);
7877
7877
  t.closePath();
7878
7878
  }
7879
- function U1(t, e, n, s) {
7879
+ function G1(t, e, n, s) {
7880
7880
  const [o, r] = s.light, i = (u) => {
7881
7881
  const d = u.x * o + u.y * r;
7882
7882
  return 1 - s.weight * d * (d > 0 ? 0.55 : 1);
@@ -7949,7 +7949,7 @@ function Br(t, e) {
7949
7949
  if (e.look === "pencil") return J1(t, e);
7950
7950
  if (e.look === "illustrated") {
7951
7951
  if (!e.illustrated) throw new Error("createPen: the illustrated look needs its resolved style");
7952
- return U1(t, e.ink, e.lineWidth, e.illustrated);
7952
+ return G1(t, e.ink, e.lineWidth, e.illustrated);
7953
7953
  }
7954
7954
  return vd(t, e.ink, e.look);
7955
7955
  }
@@ -7987,7 +7987,7 @@ function vd(t, e, n, s = !0) {
7987
7987
  }
7988
7988
  };
7989
7989
  }
7990
- function G1(t, e) {
7990
+ function U1(t, e) {
7991
7991
  const n = [t[0]];
7992
7992
  let s = 0;
7993
7993
  for (let i = 1; i < t.length; i++) {
@@ -8023,14 +8023,14 @@ function J1(t, e) {
8023
8023
  const h = (p, g, m = !1) => Mn(ue(`${e.seed}:${m ? "paper" : l}:${p}:${g}`)), u = (p, g, m, y, k, w = 0) => {
8024
8024
  if (p.length < 2) return;
8025
8025
  const b = p.slice(1).reduce((A, P, O) => A + Math.hypot(P.x - p[O].x, P.y - p[O].y), 0);
8026
- let S = G1(p, Math.max(1.5, Math.min(e.lineWidth * 0.8, b / 24)));
8026
+ let S = U1(p, Math.max(1.5, Math.min(e.lineWidth * 0.8, b / 24)));
8027
8027
  if (w > 0 && S.length >= 2) {
8028
8028
  const [A, P] = [S[S.length - 2], S[S.length - 1]], O = Math.hypot(P.x - A.x, P.y - A.y) || 1;
8029
8029
  S = [...S, { x: P.x + (P.x - A.x) / O * w, y: P.y + (P.y - A.y) / O * w }];
8030
8030
  }
8031
8031
  const E = sh(m), v = sh(m), x = S.length, M = [], T = [];
8032
8032
  S.forEach((A, P) => {
8033
- const O = x === 1 ? 0 : P / (x - 1), C = S[Math.max(0, P - 1)], W = S[Math.min(x - 1, P + 1)], q = Math.hypot(W.x - C.x, W.y - C.y) || 1, V = -(W.y - C.y) / q, tt = (W.x - C.x) / q, G = E(O) * k, R = Math.min(1, O / 0.08, (1 - O) / 0.08), D = (0.55 + 0.45 * Math.sqrt(Math.max(0, R))) * (1 + i * v(O)), Y = Math.max(0.3, g(O) * D / 2), _ = A.x + V * G, j = A.y + tt * G;
8033
+ const O = x === 1 ? 0 : P / (x - 1), C = S[Math.max(0, P - 1)], W = S[Math.min(x - 1, P + 1)], q = Math.hypot(W.x - C.x, W.y - C.y) || 1, V = -(W.y - C.y) / q, tt = (W.x - C.x) / q, U = E(O) * k, R = Math.min(1, O / 0.08, (1 - O) / 0.08), D = (0.55 + 0.45 * Math.sqrt(Math.max(0, R))) * (1 + i * v(O)), Y = Math.max(0.3, g(O) * D / 2), _ = A.x + V * U, j = A.y + tt * U;
8034
8034
  M.push({ x: _ + V * Y, y: j + tt * Y }), T.push({ x: _ - V * Y, y: j - tt * Y });
8035
8035
  }), t.save(), t.globalAlpha *= y, t.fillStyle = s, cr(t, [...M, ...T.reverse()], !0), t.fill(), t.restore();
8036
8036
  }, d = (p, g) => {
@@ -8588,15 +8588,15 @@ function qb(t, e, n, s, o, r) {
8588
8588
  function Cd(t, e) {
8589
8589
  const n = e.height ?? 300, s = Math.min(3, Math.max(0.3, t.stretch ?? 1)), o = Math.sqrt(s), r = e.armLength ?? 1;
8590
8590
  if (!Number.isFinite(r) || r <= 0) throw new Error("stick figure: armLength must be a positive finite multiplier");
8591
- const i = (e.headSize ?? 2 * Td) / 2, a = e.headSize === void 0 ? Sb : 1 - 2 * i, l = i * n, c = an(t.sit), h = t.leftHip + (-Mo - t.leftHip) * c, u = t.leftKnee + (-Mo - t.leftKnee) * c, d = t.rightHip + (Mo - t.rightHip) * c, f = t.rightKnee + (Mo - t.rightKnee) * c, p = e.classic === !0, g = an(t.turn), m = (G, R, D, Y, _) => {
8592
- const j = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, Math.abs(le(R - D) / 2) + le(Y))), nt = Math.max(-1, Math.min(1, Cb + _)), $ = g + (1 - g) * G * nt;
8591
+ const i = (e.headSize ?? 2 * Td) / 2, a = e.headSize === void 0 ? Sb : 1 - 2 * i, l = i * n, c = an(t.sit), h = t.leftHip + (-Mo - t.leftHip) * c, u = t.leftKnee + (-Mo - t.leftKnee) * c, d = t.rightHip + (Mo - t.rightHip) * c, f = t.rightKnee + (Mo - t.rightKnee) * c, p = e.classic === !0, g = an(t.turn), m = (U, R, D, Y, _) => {
8592
+ const j = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, Math.abs(le(R - D) / 2) + le(Y))), nt = Math.max(-1, Math.min(1, Cb + _)), $ = g + (1 - g) * U * nt;
8593
8593
  return p ? { x: 0, y: 0 } : { x: Math.cos(j) * dh * $, y: Math.sin(j) * dh };
8594
8594
  }, y = { left: t.leftAnkle ?? 0, right: t.rightAnkle ?? 0 }, k = { left: t.leftFootOut ?? 0, right: t.rightFootOut ?? 0 };
8595
8595
  let w = 0;
8596
8596
  if (c > 0 || !p) {
8597
- const G = (_, j, nt, $, I) => Ia * Math.cos(le(j)) + hr * Math.cos(le(j - nt)) + Math.max(0, m(_, j, nt, $, I).y), R = Math.max(
8598
- G(-1, h, u, y.left, k.left),
8599
- G(1, d, f, y.right, k.right)
8597
+ const U = (_, j, nt, $, I) => Ia * Math.cos(le(j)) + hr * Math.cos(le(j - nt)) + Math.max(0, m(_, j, nt, $, I).y), R = Math.max(
8598
+ U(-1, h, u, y.left, k.left),
8599
+ U(1, d, f, y.right, k.right)
8600
8600
  ), D = 1 - an((t.rise ?? 0) / Bb), Y = (p ? Math.min(1, c / Db) : 1) * D;
8601
8601
  w = (lh - R) * Y * n * s;
8602
8602
  }
@@ -8604,25 +8604,25 @@ function Cd(t, e) {
8604
8604
  let M;
8605
8605
  if (v !== 0) {
8606
8606
  M = [];
8607
- for (let G = 0; G <= fh; G++) {
8608
- const R = G / fh, D = gh(b, S, v, R);
8607
+ for (let U = 0; U <= fh; U++) {
8608
+ const R = U / fh, D = gh(b, S, v, R);
8609
8609
  M.push({ x: D.x - E * Math.sin(Math.PI * R), y: D.y });
8610
8610
  }
8611
8611
  } else
8612
8612
  M = E === 0 ? [{ x: 0, y: b }, { x: 0, y: S }] : as({ x: 0, y: b }, { x: -E, y: (b + S) / 2 }, { x: 0, y: S }, 1, 8);
8613
- const T = S + Tb * n * s, A = (e.shoulderWidth ?? 0) * n * Math.cos(g * Math.PI / 2), P = (G, R, D, Y, _) => {
8613
+ const T = S + Tb * n * s, A = (e.shoulderWidth ?? 0) * n * Math.cos(g * Math.PI / 2), P = (U, R, D, Y, _) => {
8614
8614
  const j = zb(D, Y);
8615
- return { x: G + j.x * _ * n, y: R + j.y * _ * n };
8616
- }, O = (G, R, D) => {
8617
- const Y = P(0, b, R, G, Ia * s);
8618
- return { root: { x: 0, y: b }, joint: Y, end: P(Y.x, Y.y, R - D, G, hr * s) };
8619
- }, C = (G, R, D) => {
8620
- const Y = { x: G * A, y: T }, _ = P(Y.x, Y.y, R, G, Eb * o * r);
8621
- return { root: Y, joint: _, end: P(_.x, _.y, R + D, G, Ab * o * r) };
8622
- }, W = { left: O(-1, h, u), right: O(1, d, f) }, q = (G, R, D, Y, _, j) => {
8623
- const nt = m(G, D, Y, _, j);
8615
+ return { x: U + j.x * _ * n, y: R + j.y * _ * n };
8616
+ }, O = (U, R, D) => {
8617
+ const Y = P(0, b, R, U, Ia * s);
8618
+ return { root: { x: 0, y: b }, joint: Y, end: P(Y.x, Y.y, R - D, U, hr * s) };
8619
+ }, C = (U, R, D) => {
8620
+ const Y = { x: U * A, y: T }, _ = P(Y.x, Y.y, R, U, Eb * o * r);
8621
+ return { root: Y, joint: _, end: P(_.x, _.y, R + D, U, Ab * o * r) };
8622
+ }, W = { left: O(-1, h, u), right: O(1, d, f) }, q = (U, R, D, Y, _, j) => {
8623
+ const nt = m(U, D, Y, _, j);
8624
8624
  return { x: R.end.x + nt.x * n * s, y: R.end.y + nt.y * n * s };
8625
- }, V = (G, R, D, Y, _) => P(R.end.x, R.end.y, D + Y + _, G, $d * o), tt = {
8625
+ }, V = (U, R, D, Y, _) => P(R.end.x, R.end.y, D + Y + _, U, $d * o), tt = {
8626
8626
  left: C(-1, t.leftShoulder, t.leftElbow),
8627
8627
  right: C(1, t.rightShoulder, t.rightElbow)
8628
8628
  };
@@ -8664,11 +8664,11 @@ function gh(t, e, n, s) {
8664
8664
  }
8665
8665
  function jb(t, e) {
8666
8666
  if (t.chest.bend === 0) return e;
8667
- const n = Us(e, { x: 0, y: t.neckY }, t.chest.bend);
8667
+ const n = Gs(e, { x: 0, y: t.neckY }, t.chest.bend);
8668
8668
  return { x: n.x + t.chest.end.x, y: n.y + t.chest.end.y - t.neckY };
8669
8669
  }
8670
8670
  const _s = (t, e) => e === 0 ? [t.root, t.joint, t.end] : as(t.root, t.joint, t.end, e);
8671
- function Us(t, e, n) {
8671
+ function Gs(t, e, n) {
8672
8672
  const s = Math.cos(n), o = Math.sin(n), r = t.x - e.x, i = t.y - e.y;
8673
8673
  return { x: e.x + r * s - i * o, y: e.y + r * o + i * s };
8674
8674
  }
@@ -8681,7 +8681,7 @@ function Rd(t, e, n) {
8681
8681
  }
8682
8682
  function Yb(t, e, n, s) {
8683
8683
  const { pivot: o, angle: r, lift: i } = Rd(e, n, s), a = (d) => {
8684
- const f = Us(d, o, r);
8684
+ const f = Gs(d, o, r);
8685
8685
  return { x: f.x, y: f.y - i };
8686
8686
  }, l = (d) => ({ left: a(d.left), right: a(d.right) }), c = { left: Math.max(a(t.feet.left).y, a(t.toes.left).y), right: Math.max(a(t.feet.right).y, a(t.toes.right).y) }, h = Math.max(c.left, c.right), u = Pd * e.height;
8687
8687
  return {
@@ -8709,7 +8709,7 @@ function Yb(t, e, n, s) {
8709
8709
  };
8710
8710
  }
8711
8711
  function Kb(t, e) {
8712
- const n = le(t.lean), s = le(e.headTilt), o = { x: 0, y: t.hipY }, r = (b) => ({ x: t.facing * b.x, y: b.y }), i = (b) => r(Us(b, o, n)), a = (b) => i(jb(t, b)), l = (b) => a(Us({ x: b.x, y: b.y + t.neckY }, { x: 0, y: t.neckY }, s)), c = _s(t.arms.left, t.rubber).map(a), h = _s(t.arms.right, t.rubber).map(a), u = (b, S) => Math.atan2(S.y - b.y, S.x - b.x), d = { left: a(t.handTips.left), right: a(t.handTips.right) }, f = (b, S) => {
8712
+ const n = le(t.lean), s = le(e.headTilt), o = { x: 0, y: t.hipY }, r = (b) => ({ x: t.facing * b.x, y: b.y }), i = (b) => r(Gs(b, o, n)), a = (b) => i(jb(t, b)), l = (b) => a(Gs({ x: b.x, y: b.y + t.neckY }, { x: 0, y: t.neckY }, s)), c = _s(t.arms.left, t.rubber).map(a), h = _s(t.arms.right, t.rubber).map(a), u = (b, S) => Math.atan2(S.y - b.y, S.x - b.x), d = { left: a(t.handTips.left), right: a(t.handTips.right) }, f = (b, S) => {
8713
8713
  const [E, v] = b.slice(-2), x = t.arms[S], M = u(a(x.end), d[S]) - u(a(x.joint), a(x.end));
8714
8714
  return u(E, v) + M;
8715
8715
  };
@@ -8763,7 +8763,7 @@ function ke(t, e = {}) {
8763
8763
  return Hd(Cd(t, e), t);
8764
8764
  }
8765
8765
  function h4(t, e, n) {
8766
- return Us({ x: t.center.x + e * t.rx, y: t.center.y + n * t.ry }, t.center, t.angle);
8766
+ return Gs({ x: t.center.x + e * t.rx, y: t.center.y + n * t.ry }, t.center, t.angle);
8767
8767
  }
8768
8768
  function Xb(t, e, n) {
8769
8769
  const s = (r) => ({ x: r.x + e, y: r.y + n }), o = (r) => ({ left: s(r.left), right: s(r.right) });
@@ -8791,7 +8791,7 @@ function Xb(t, e, n) {
8791
8791
  head: { ...t.head, center: s(t.head.center) }
8792
8792
  };
8793
8793
  }
8794
- function Ub(t, e, n = {}, s = 0) {
8794
+ function Gb(t, e, n = {}, s = 0) {
8795
8795
  const o = Cd(e, n), r = n.color ?? "#1e293b", i = n.layers ?? {}, a = n.layers ? Hd(o, e, !1) : void 0, l = n.sketch ? Ta(t, n.sketch, s) : void 0, c = n.sketch && n.layers ? Ta(t, n.sketch, s) : void 0, h = (v) => {
8796
8796
  t.save(), v(), t.restore();
8797
8797
  }, u = (v) => {
@@ -8883,7 +8883,7 @@ function Fd(t, e, n, s) {
8883
8883
  }
8884
8884
  return t.talk > 0 && (i = { ...i, mouth: Math.max(i.mouth, t.talk * xb(e)) }), { pose: i, hands: a };
8885
8885
  }
8886
- function Gb(t, e, n, s) {
8886
+ function Ub(t, e, n, s) {
8887
8887
  return Fd(t, e, n, s).pose;
8888
8888
  }
8889
8889
  const Ld = (t, e) => (t.facing ?? e.facing ?? 1) < 0 ? -1 : 1, ur = (t, e) => `hand.${t}.${e}`;
@@ -8917,7 +8917,7 @@ function Wd(t) {
8917
8917
  figureGaits: t.cast?.gaits,
8918
8918
  draw(i, a, l) {
8919
8919
  const c = a.props, h = Fd(c, l, t.dance, t.cast?.gaits);
8920
- i.translate(s / 2, n), Ub(i, h.pose, Jb({ ...e, rubber: c.rubber, facing: Ld(c, e) }, h.hands), l);
8920
+ i.translate(s / 2, n), Gb(i, h.pose, Jb({ ...e, rubber: c.rubber, facing: Ld(c, e) }, h.hands), l);
8921
8921
  }
8922
8922
  };
8923
8923
  }
@@ -8944,7 +8944,7 @@ function Nd(t, e, n) {
8944
8944
  let r = 0, i = 0;
8945
8945
  for (const [c, h] of e.state?.values.get(n) ?? [])
8946
8946
  c === "gait" && typeof h == "string" && (o.gait = h), typeof h == "number" && (c === "x" || c === "motionPathX" ? r = h : c === "y" || c === "motionPathY" ? i = h : c in o && (o[c] = h));
8947
- const a = Gb(o, e.time, t.figureDance, t.figureGaits), l = ke(a, { ...s, rubber: o.rubber, facing: Ld(o, s) });
8947
+ const a = Ub(o, e.time, t.figureDance, t.figureGaits), l = ke(a, { ...s, rubber: o.rubber, facing: Ld(o, s) });
8948
8948
  return { pose: a, joints: Xb(l, t.x + r + t.width / 2, t.y + i + t.height) };
8949
8949
  }
8950
8950
  function Sl(t) {
@@ -10315,7 +10315,7 @@ function bh(t) {
10315
10315
  const [e, n, s] = La(t);
10316
10316
  return { swing: Math.asin(Math.max(-1, Math.min(1, s))), spread: Math.atan2(e, -n) };
10317
10317
  }
10318
- function Gs(t, e, n, s, o) {
10318
+ function Us(t, e, n, s, o) {
10319
10319
  const r = t.chains.find((P) => P.id === n);
10320
10320
  if (!r) throw new Error(`reach: no chain ${n} in ${t.id}`);
10321
10321
  if (r.bones.length < 2 || r.rest[1] > -0.99) throw new Error(`reach: ${n} is not a hanging limb of two bones or more`);
@@ -10335,13 +10335,13 @@ function Gs(t, e, n, s, o) {
10335
10335
  ];
10336
10336
  return t.withAngles(e, r, A);
10337
10337
  }
10338
- const Un = (t, e) => (t % e + e) % e, wh = (t) => t * t * (3 - 2 * t), Fw = (t) => Object.fromEntries(
10338
+ const Gn = (t, e) => (t % e + e) % e, wh = (t) => t * t * (3 - 2 * t), Fw = (t) => Object.fromEntries(
10339
10339
  ["left", "right"].flatMap((e) => Object.entries(Tt[t]).map(([n, s]) => [`hand.${e}.${n}`, s]))
10340
10340
  );
10341
10341
  function Ii(t, e = !1) {
10342
- const n = qd(), s = Gs(n, at, "arm.left", [0.015, 0.68, 0.2], { height: 1 }), o = Gs(n, s, "arm.right", [-0.015, 0.68, 0.2], { height: 1 });
10342
+ const n = qd(), s = Us(n, at, "arm.left", [0.015, 0.68, 0.2], { height: 1 }), o = Us(n, s, "arm.right", [-0.015, 0.68, 0.2], { height: 1 });
10343
10343
  return Array.from({ length: 32 }, (r, i) => {
10344
- const a = i / 4, l = Math.floor(a), c = a - l, h = l % 2 === 0, u = Math.sin(Math.PI * c), d = Math.max(0, ...t.map((p) => 1 - Math.min(Un(a - p, 8), Un(p - a, 8)) / 0.5)), f = {
10344
+ const a = i / 4, l = Math.floor(a), c = a - l, h = l % 2 === 0, u = Math.sin(Math.PI * c), d = Math.max(0, ...t.map((p) => 1 - Math.min(Gn(a - p, 8), Gn(p - a, 8)) / 0.5)), f = {
10345
10345
  side: (h ? 1 : -1) * 5 * Math.sin(Math.PI * c),
10346
10346
  bend: 2 + 3 * u,
10347
10347
  "head.tilt": (h ? -1 : 1) * 3 * u,
@@ -10381,7 +10381,7 @@ function Yd(t) {
10381
10381
  function pr(t, e, n = at) {
10382
10382
  const s = Yd(t);
10383
10383
  if (!Number.isFinite(e)) throw new Error("humanDanceFrame: beat must be finite");
10384
- const o = Un(e, s.beats);
10384
+ const o = Gn(e, s.beats);
10385
10385
  let r = s.keys.length - 1;
10386
10386
  for (let m = 0; m < s.keys.length; m++) s.keys[m].beat <= o && (r = m);
10387
10387
  const i = s.keys[r], a = s.keys[(r + 1) % s.keys.length], l = i.beat > o ? i.beat - s.beats : i.beat, c = a.beat <= i.beat ? a.beat + s.beats : a.beat, h = wh((o - l) / (c - i.beat)), u = { ...at, ...n };
@@ -10390,8 +10390,8 @@ function pr(t, e, n = at) {
10390
10390
  const y = m.match(/^hand\.(?:left|right)\.(.+)$/)?.[1], k = n[m] ?? at[m] ?? (y ? Rt[y] : void 0) ?? 0, w = i.pose[m] ?? k;
10391
10391
  u[m] = w + ((a.pose[m] ?? k) - w) * h;
10392
10392
  }
10393
- const d = Math.floor(e), f = e - d, p = f <= 0.6 ? 1 : 1 - wh((f - 0.6) / 0.4), g = Math.max(0, ...s.strikes.map((m) => 1 - Math.min(Un(o - m, s.beats), Un(m - o, s.beats)) / 0.25));
10394
- return { pose: u, contact: { side: Un(d, 2) === 0 ? "left" : "right", start: d, weight: p }, strike: g };
10393
+ const d = Math.floor(e), f = e - d, p = f <= 0.6 ? 1 : 1 - wh((f - 0.6) / 0.4), g = Math.max(0, ...s.strikes.map((m) => 1 - Math.min(Gn(o - m, s.beats), Gn(m - o, s.beats)) / 0.25));
10394
+ return { pose: u, contact: { side: Gn(d, 2) === 0 ? "left" : "right", start: d, weight: p }, strike: g };
10395
10395
  }
10396
10396
  function w4(t, e) {
10397
10397
  const n = Yd(e.style), s = e.bpm ?? n.bpm, o = e.beats ?? n.beats, r = e.samplesPerBeat ?? 16;
@@ -10434,7 +10434,7 @@ function Bw(t, e, n, s) {
10434
10434
  function Ko(t, e) {
10435
10435
  return t / (Math.PI * Math.sqrt(2 * (1 + e * e)));
10436
10436
  }
10437
- function Ud(t) {
10437
+ function Gd(t) {
10438
10438
  if (typeof t == "string") {
10439
10439
  if (!Object.prototype.hasOwnProperty.call(Wa, t)) throw new Error(`body shape: unknown shape '${t}'`);
10440
10440
  t = Wa[t];
@@ -10448,7 +10448,7 @@ function Ud(t) {
10448
10448
  return { height: e, bust: n, underbust: r, waist: s, hip: o };
10449
10449
  }
10450
10450
  function zw(t, e) {
10451
- const n = Ud(t), s = (d) => d / n.height, o = Ko(s(n.hip), Na), r = Ko(s(n.waist), vh), i = Ko(s(n.underbust), kh), a = o * Na, l = r * vh, c = i * kh, h = s(n.bust - n.underbust) * Lw, u = Math.min(0.25, Math.max(0, n.waist / n.hip - 0.8));
10451
+ const n = Gd(t), s = (d) => d / n.height, o = Ko(s(n.hip), Na), r = Ko(s(n.waist), vh), i = Ko(s(n.underbust), kh), a = o * Na, l = r * vh, c = i * kh, h = s(n.bust - n.underbust) * Lw, u = Math.min(0.25, Math.max(0, n.waist / n.hip - 0.8));
10452
10452
  return {
10453
10453
  torso: [
10454
10454
  { at: 0, width: o },
@@ -10477,21 +10477,21 @@ function zw(t, e) {
10477
10477
  hipHalfWidth: o
10478
10478
  };
10479
10479
  }
10480
- function Gd(t) {
10480
+ function Ud(t) {
10481
10481
  return t * 0.4;
10482
10482
  }
10483
10483
  function qw(t) {
10484
- const e = Ud(t), n = Ko(e.hip / e.height, Na);
10485
- return Math.max(0.02, n - Math.max(0.042, Gd(n)));
10484
+ const e = Gd(t), n = Ko(e.hip / e.height, Na);
10485
+ return Math.max(0.02, n - Math.max(0.042, Ud(n)));
10486
10486
  }
10487
- function Gn(t, e, n, s) {
10487
+ function Un(t, e, n, s) {
10488
10488
  if (!Number.isFinite(t) || t < n || t > s) throw new Error(`organic body: ${e} must be ${n}..${s}`);
10489
10489
  return t;
10490
10490
  }
10491
10491
  function Pn(t, e) {
10492
10492
  if (t.length < 2 || t[0].at !== 0 || t.at(-1).at !== 1) throw new Error(`organic body: ${e} must run from 0 to 1`);
10493
10493
  return t.map((n, s) => {
10494
- if (Gn(n.at, `${e}.at`, 0, 1), Gn(n.width, `${e}.width`, 1e-3, 0.3), s > 0 && n.at <= t[s - 1].at) throw new Error(`organic body: ${e} positions must increase`);
10494
+ if (Un(n.at, `${e}.at`, 0, 1), Un(n.width, `${e}.width`, 1e-3, 0.3), s > 0 && n.at <= t[s - 1].at) throw new Error(`organic body: ${e} positions must increase`);
10495
10495
  return { at: n.at, width: n.width };
10496
10496
  });
10497
10497
  }
@@ -10506,7 +10506,7 @@ function jw(t, e) {
10506
10506
  { at: 0.68, width: n * 0.9 },
10507
10507
  { at: 0.86, width: n },
10508
10508
  { at: 1, width: 0.024 }
10509
- ], "torso"), l = Gn(t.depth ?? 0.55, "depth", 0.2, 1), c = (u) => u.map((d) => ({ at: d.at, width: Math.max(1e-3, d.width * l) })), h = i ? Math.max(1, Gd(i.hipHalfWidth) / 0.042) : 1;
10509
+ ], "torso"), l = Un(t.depth ?? 0.55, "depth", 0.2, 1), c = (u) => u.map((d) => ({ at: d.at, width: Math.max(1e-3, d.width * l) })), h = i ? Math.max(1, Ud(i.hipHalfWidth) / 0.042) : 1;
10510
10510
  return {
10511
10511
  torso: a,
10512
10512
  torsoFront: Pn(t.torsoFront ?? i?.torsoFront ?? c(a), "torsoFront"),
@@ -10528,13 +10528,13 @@ function jw(t, e) {
10528
10528
  neck: Pn(t.neck ?? [{ at: 0, width: 0.024 }, { at: 1, width: 0.023 }], "neck"),
10529
10529
  depth: l,
10530
10530
  fill: t.fill ?? e.skin,
10531
- outline: { color: t.outline?.color ?? e.ink, width: Gn(t.outline?.width ?? e.lineWidth, "outline.width", 0, 100) },
10531
+ outline: { color: t.outline?.color ?? e.ink, width: Un(t.outline?.width ?? e.lineWidth, "outline.width", 0, 100) },
10532
10532
  shading: {
10533
10533
  mode: o.mode ?? "cel",
10534
10534
  light: [...r],
10535
10535
  shadow: o.shadow ?? "#633923",
10536
- opacity: Gn(o.opacity ?? 0.17, "shading.opacity", 0, 1),
10537
- highlight: Gn(o.highlight ?? 0.12, "shading.highlight", 0, 1)
10536
+ opacity: Un(o.opacity ?? 0.17, "shading.opacity", 0, 1),
10537
+ highlight: Un(o.highlight ?? 0.12, "shading.highlight", 0, 1)
10538
10538
  }
10539
10539
  };
10540
10540
  }
@@ -10644,7 +10644,7 @@ function Th(t, e) {
10644
10644
  for (const n of e.slice(1)) t.lineTo(n.x, n.y);
10645
10645
  t.closePath();
10646
10646
  }
10647
- function Uw(t, e, n) {
10647
+ function Gw(t, e, n) {
10648
10648
  const s = n.shading;
10649
10649
  if (s.mode === "none" || n.fill === "none") return;
10650
10650
  const o = Math.hypot(...s.light), r = { x: s.light[0] / o, y: s.light[1] / o }, i = t.globalAlpha;
@@ -10668,7 +10668,7 @@ function Uw(t, e, n) {
10668
10668
  }
10669
10669
  t.restore();
10670
10670
  }
10671
- function Gw(t, e, n, s) {
10671
+ function Uw(t, e, n, s) {
10672
10672
  const o = s.bodyContours, r = (i) => o[i] && Vd(t, o[i].outline);
10673
10673
  if (n.startsWith("arm.")) return e < 0.2 && r("spine");
10674
10674
  if (n.startsWith("leg.")) return e < 0.2 && r("spine") || e > 0.85 && r(n.replace("leg.", "foot."));
@@ -10696,12 +10696,12 @@ function Vw(t) {
10696
10696
  function Eh(t, e, n, s, o) {
10697
10697
  const r = s.bodyContours?.[o];
10698
10698
  if (!r) return !1;
10699
- if (n.fill === "none" && (e = lo(t, e)), e.shape(r.outline, n.fill === "none" ? null : n.fill, 0), e.look === "clean" && Uw(t, r, n), (e.look !== "silhouette" || n.fill === "none") && s.lineWidth > 0) {
10699
+ if (n.fill === "none" && (e = lo(t, e)), e.shape(r.outline, n.fill === "none" ? null : n.fill, 0), e.look === "clean" && Gw(t, r, n), (e.look !== "silhouette" || n.fill === "none") && s.lineWidth > 0) {
10700
10700
  const i = Vw(r.outline);
10701
10701
  let a = [];
10702
10702
  for (let l = 0; l <= r.outline.length; l++) {
10703
10703
  const c = l % r.outline.length, h = r.outline[c], u = r.outline[(c + 1) % r.outline.length], d = { x: (h.x + u.x) / 2, y: (h.y + u.y) / 2 };
10704
- o.startsWith("arm.") && r.positions[c] === 1 || Gw(d, r.positions[c], o, s) ? (a.length >= 2 && e.line(a, s.lineWidth, i), a = []) : (a.length === 0 && a.push(h), a.push(u));
10704
+ o.startsWith("arm.") && r.positions[c] === 1 || Uw(d, r.positions[c], o, s) ? (a.length >= 2 && e.line(a, s.lineWidth, i), a = []) : (a.length === 0 && a.push(h), a.push(u));
10705
10705
  }
10706
10706
  a.length >= 2 && e.line(a, s.lineWidth, i);
10707
10707
  }
@@ -10835,8 +10835,8 @@ function r2(t, e, n, s, o = {}, r) {
10835
10835
  t.shape(a([{ x: W - F, y: K + 0.02 }, { x: W + F, y: K + 0.02 }, { x: W + F, y: L }, { x: W - F, y: L }], q), o.skin ?? "#ffffff", 0, !0), t.line(a([{ x: W - F, y: L }, { x: W + F, y: L }], q), i);
10836
10836
  }
10837
10837
  }
10838
- const tt = Kt + (o.style === "anime" ? 0.38 : 0.3) + Yt(n, `brow.${C}`, 0) * 0.14 + Math.max(0, V - 1) * 0.12, G = { x: W + O * 0.13, y: tt }, R = { x: W - O * 0.13, y: tt + f * 0.1 }, D = y ? 0.035 : 0;
10839
- t.line(a([G, { x: (G.x + R.x) / 2, y: (G.y + R.y) / 2 + D }, R], { x: W, y: tt }), i * (y ? 2.2 : 1));
10838
+ const tt = Kt + (o.style === "anime" ? 0.38 : 0.3) + Yt(n, `brow.${C}`, 0) * 0.14 + Math.max(0, V - 1) * 0.12, U = { x: W + O * 0.13, y: tt }, R = { x: W - O * 0.13, y: tt + f * 0.1 }, D = y ? 0.035 : 0;
10839
+ t.line(a([U, { x: (U.x + R.x) / 2, y: (U.y + R.y) / 2 + D }, R], { x: W, y: tt }), i * (y ? 2.2 : 1));
10840
10840
  }
10841
10841
  h2(t, e, n, i, o.projection), c2(t, e, o.ageLines ?? 0, i, o.projection);
10842
10842
  const k = { x: 0, y: Bt };
@@ -10877,7 +10877,7 @@ function r2(t, e, n, s, o = {}, r) {
10877
10877
  }
10878
10878
  }
10879
10879
  function i2(t, e, n, s, o, r, i, a, l, c, h, u, d) {
10880
- const { x: f, y: p } = n, g = Math.min(1.2, Math.max(0.5, u.eyeScale ?? 1)), m = Math.min(1.2, Math.max(0.45, u.eyeAspect ?? 1)), y = 0.21 * g * (1 + i * 0.15), k = 0.25 * g * m * Math.min(o, 1.6) * (1 - r) * (1 + i * 0.3), w = { x: f - y, y: p }, b = { x: f + y, y: p }, S = { x: f, y: p + k * 1.9 }, E = { x: f, y: p - k * 1.35 }, v = xe(w, S, b), x = xe(b, E, w), M = (G) => Mt(e, G, n, u.projection).points, T = (G) => G.map((R) => {
10880
+ const { x: f, y: p } = n, g = Math.min(1.2, Math.max(0.5, u.eyeScale ?? 1)), m = Math.min(1.2, Math.max(0.45, u.eyeAspect ?? 1)), y = 0.21 * g * (1 + i * 0.15), k = 0.25 * g * m * Math.min(o, 1.6) * (1 - r) * (1 + i * 0.3), w = { x: f - y, y: p }, b = { x: f + y, y: p }, S = { x: f, y: p + k * 1.9 }, E = { x: f, y: p - k * 1.35 }, v = xe(w, S, b), x = xe(b, E, w), M = (U) => Mt(e, U, n, u.projection).points, T = (U) => U.map((R) => {
10881
10881
  const D = Math.min(b.x, Math.max(w.x, R.x));
10882
10882
  return { x: D, y: Math.min(Ws(w, S, b, D), Math.max(Ws(b, E, w, D), R.y)) };
10883
10883
  });
@@ -10888,20 +10888,20 @@ function i2(t, e, n, s, o, r, i, a, l, c, h, u, d) {
10888
10888
  q && t.shape(M(T(pe(A, P - C * 0.5, O * 0.7, C * 0.32))), q, 0, !0);
10889
10889
  const V = Math.min(0.085, 0.042 * a) * g, tt = T(pe(A, P, V, V * 1.35));
10890
10890
  if (t.shape(M(tt), t.ink, 0, !0), u.inPupil && d) {
10891
- const [G] = M([{ x: A, y: P }]), R = Math.min(...M(tt).map((D) => Math.hypot(D.x - G.x, D.y - G.y)));
10892
- R > 0.5 && (d.save(), d.beginPath(), d.arc(G.x, G.y, R, 0, Math.PI * 2), d.clip(), u.inPupil(d, { ...G, r: R, side: s === 1 ? "left" : "right" }), d.restore());
10891
+ const [U] = M([{ x: A, y: P }]), R = Math.min(...M(tt).map((D) => Math.hypot(D.x - U.x, D.y - U.y)));
10892
+ R > 0.5 && (d.save(), d.beginPath(), d.arc(U.x, U.y, R, 0, Math.PI * 2), d.clip(), u.inPupil(d, { ...U, r: R, side: s === 1 ? "left" : "right" }), d.restore());
10893
10893
  }
10894
10894
  if (t.shape(M(T(pe(A - 0.038 * g, P + 0.075 * g, 0.035 * g, 0.045 * g))), "#ffffff", 0, !0), t.shape(M(T(pe(A + 0.04 * g, P - 0.04 * g, 0.014 * g, 0.02 * g))), "#ffffff", 0, !0), W) {
10895
- const G = xe(w, { x: f, y: p + k * 1.2 }, b);
10896
- t.shape(M([...v, ...G.slice(1, -1).reverse()]), "rgba(70, 35, 30, 0.22)", 0, !0);
10895
+ const U = xe(w, { x: f, y: p + k * 1.2 }, b);
10896
+ t.shape(M([...v, ...U.slice(1, -1).reverse()]), "rgba(70, 35, 30, 0.22)", 0, !0);
10897
10897
  const R = xe({ x: f - y * 0.7, y: p + k * 0.55 + 0.03 }, { x: f, y: p + k * 1.4 + 0.09 }, { x: f + y * 0.85, y: p + k * 0.5 + 0.03 });
10898
10898
  t.line(M(R), h * 0.45);
10899
10899
  const D = x.filter((Y) => s * (Y.x - f) > y * 0.25);
10900
10900
  D.length >= 2 && t.line(M(D), h * 0.55);
10901
10901
  }
10902
10902
  if (t.line(M(v), h * (W ? 1.9 : 1.1)), u.lashes !== !1)
10903
- for (const G of [0, 0.035]) {
10904
- const R = f + s * (y - G), D = Ws(w, S, b, R);
10903
+ for (const U of [0, 0.035]) {
10904
+ const R = f + s * (y - U), D = Ws(w, S, b, R);
10905
10905
  t.line(M([{ x: R, y: D }, { x: R + s * 0.055, y: D + 0.07 }]), h * 0.75);
10906
10906
  }
10907
10907
  }
@@ -11019,7 +11019,7 @@ function qr(t, e, n = 64) {
11019
11019
  for (let O = 0; O < n; O++) {
11020
11020
  const C = P * g + O, W = (m[C] > 0 ? 8 : 0) | (m[C + 1] > 0 ? 4 : 0) | (m[C + g + 1] > 0 ? 2 : 0) | (m[C + g] > 0 ? 1 : 0);
11021
11021
  if (W === 0 || W === 15) continue;
11022
- const q = () => v(!1, O, P), V = () => v(!1, O, P + 1), tt = () => v(!0, O, P), G = () => v(!0, O + 1, P);
11022
+ const q = () => v(!1, O, P), V = () => v(!1, O, P + 1), tt = () => v(!0, O, P), U = () => v(!0, O + 1, P);
11023
11023
  switch (W) {
11024
11024
  case 1:
11025
11025
  case 14:
@@ -11027,15 +11027,15 @@ function qr(t, e, n = 64) {
11027
11027
  break;
11028
11028
  case 2:
11029
11029
  case 13:
11030
- M(V(), G());
11030
+ M(V(), U());
11031
11031
  break;
11032
11032
  case 3:
11033
11033
  case 12:
11034
- M(tt(), G());
11034
+ M(tt(), U());
11035
11035
  break;
11036
11036
  case 4:
11037
11037
  case 11:
11038
- M(q(), G());
11038
+ M(q(), U());
11039
11039
  break;
11040
11040
  case 6:
11041
11041
  case 9:
@@ -11048,7 +11048,7 @@ function qr(t, e, n = 64) {
11048
11048
  case 5:
11049
11049
  case 10: {
11050
11050
  const R = (y(O, P) + y(O + 1, P) + y(O + 1, P + 1) + y(O, P + 1)) / 4 > 0;
11051
- W === 5 === R ? (M(tt(), q()), M(V(), G())) : (M(tt(), V()), M(q(), G()));
11051
+ W === 5 === R ? (M(tt(), q()), M(V(), U())) : (M(tt(), V()), M(q(), U()));
11052
11052
  break;
11053
11053
  }
11054
11054
  }
@@ -11630,7 +11630,7 @@ function O2(t, e) {
11630
11630
  beard: n.beard ?? s?.beard ?? "none"
11631
11631
  };
11632
11632
  }
11633
- const Be = (t) => t * Math.PI / 180, Uo = (t, e, n) => {
11633
+ const Be = (t) => t * Math.PI / 180, Go = (t, e, n) => {
11634
11634
  const s = Math.min(1, Math.max(0, (n - t) / (e - t)));
11635
11635
  return s * s * (3 - 2 * s);
11636
11636
  }, mf = {
@@ -11645,7 +11645,7 @@ const Be = (t) => t * Math.PI / 180, Uo = (t, e, n) => {
11645
11645
  sideburns: { top: [0.08, 0.08], reach: 100, band: 0.42, length: 0, shape: "round", volume: 0.05, aroundMouth: !1 },
11646
11646
  muttonChops: { top: [0.08, 0.08], reach: 100, band: 0.75, length: 0, shape: "round", volume: 0.08, aroundMouth: !1 }
11647
11647
  }, I2 = (t, e) => {
11648
- const n = Uo(Be(48), Be(100), mr(e, 0));
11648
+ const n = Go(Be(48), Be(100), mr(e, 0));
11649
11649
  return t.top[0] + (t.top[1] - t.top[0]) * n;
11650
11650
  }, _2 = (t) => t === "sideburns" || t === "muttonChops";
11651
11651
  function ja(t, e) {
@@ -11653,7 +11653,7 @@ function ja(t, e) {
11653
11653
  if (!n) return null;
11654
11654
  const s = Be(n.reach), o = (r) => {
11655
11655
  const i = mr(r, 0);
11656
- return n.shape === "point" ? Math.exp(-((i / 0.42) ** 2)) : n.shape === "square" ? 1 - Uo(Be(45), Be(85), i) : Math.cos(Math.min(i, Math.PI / 2)) ** 0.7;
11656
+ return n.shape === "point" ? Math.exp(-((i / 0.42) ** 2)) : n.shape === "square" ? 1 - Go(Be(45), Be(85), i) : Math.cos(Math.min(i, Math.PI / 2)) ** 0.7;
11657
11657
  };
11658
11658
  return {
11659
11659
  top: Math.max(n.top[0], n.top[1]) + 0.05,
@@ -11662,13 +11662,13 @@ function ja(t, e) {
11662
11662
  const a = mr(r, 0), l = I2(n, r);
11663
11663
  let c = Math.min(l - i, s - a);
11664
11664
  if (n.band > 0 && (c = Math.min(c, i - (l - n.band))), _2(t)) {
11665
- const h = t === "muttonChops" ? Be(70) - Be(22) * Uo(0.08, -0.6, i) : Be(72);
11665
+ const h = t === "muttonChops" ? Be(70) - Be(22) * Go(0.08, -0.6, i) : Be(72);
11666
11666
  c = Math.min(c, a - h);
11667
11667
  }
11668
11668
  return c;
11669
11669
  },
11670
11670
  position(r, i) {
11671
- const [a, l, c] = Te(r, i), h = 1 + e + n.volume, u = n.length * o(r) * Uo(-0.45, -1, i);
11671
+ const [a, l, c] = Te(r, i), h = 1 + e + n.volume, u = n.length * o(r) * Go(-0.45, -1, i);
11672
11672
  return [a * h, l * h - u, c * h + u * 0.25];
11673
11673
  },
11674
11674
  normal: (r, i) => Te(r, i)
@@ -11890,7 +11890,7 @@ function X2(t, e, n, s, o, r, i) {
11890
11890
  function xf(t, e, n, s, o, r) {
11891
11891
  kf(s) && (n.hair && qa(e, s, n.hair, { ...r, motion: yr(o) }), n.hat && bf(e, s, n.hat, { lineWidth: r.lineWidth, hairVolume: n.hair?.volume ?? 0 }));
11892
11892
  }
11893
- const Nh = 40, U2 = 0.215 + 0.205, ne = (t, e) => {
11893
+ const Nh = 40, G2 = 0.215 + 0.205, ne = (t, e) => {
11894
11894
  const n = {};
11895
11895
  for (const s of ["left", "right"]) for (const [o, r] of Object.entries(e)) n[`${t}.${s}.${o}`] = r;
11896
11896
  return n;
@@ -11904,7 +11904,7 @@ function Fl(t, e, n = at, s = 1) {
11904
11904
  }
11905
11905
  function Ll(t, e, n = 1, s = 1) {
11906
11906
  const o = zr(t);
11907
- return 4 * U2 * s * e * Math.sin(o.swing * n * Math.PI / 180);
11907
+ return 4 * G2 * s * e * Math.sin(o.swing * n * Math.PI / 180);
11908
11908
  }
11909
11909
  const On = (t) => jd[t], Wl = {
11910
11910
  /** Squash down in a squint, shoot up stretched with arms flung up, hang, land squashed, end surprised. */
@@ -11982,7 +11982,7 @@ const On = (t) => jd[t], Wl = {
11982
11982
  { after: 900, pose: { ...On("sad"), bend: 18, stretch: 0.92, lean: ft(t, "lean") + 5, "head.nod": 14, ...ne("arm", { spread: 6, swing: 0, elbow: 4, bend: 0 }) }, easing: "ease-in-out" }
11983
11983
  ]
11984
11984
  };
11985
- function G2(t, e) {
11985
+ function U2(t, e) {
11986
11986
  const n = wt(e.from ?? {}), s = e.speed ?? 1;
11987
11987
  let o = n;
11988
11988
  return [
@@ -12108,7 +12108,7 @@ const ek = { apron: "#d8b48a", labCoat: "#f4f6f8", hoodie: "#6b7280", cardigan:
12108
12108
  function nk(t) {
12109
12109
  return t.parts["leg.left"].order > t.parts["leg.right"].order ? "left" : "right";
12110
12110
  }
12111
- const jh = (t) => Math.max(t.parts["leg.left"].order, t.parts["leg.right"].order) > t.parts.spine.order, Ut = (t) => t.bodyForward?.[2] ?? Math.cos(t.turn * Math.PI / 2), Ae = (t) => t.bodyForward?.[0] ?? Math.sin(t.turn * Math.PI / 2);
12111
+ const jh = (t) => Math.max(t.parts["leg.left"].order, t.parts["leg.right"].order) > t.parts.spine.order, Gt = (t) => t.bodyForward?.[2] ?? Math.cos(t.turn * Math.PI / 2), Ae = (t) => t.bodyForward?.[0] ?? Math.sin(t.turn * Math.PI / 2);
12112
12112
  function Yh(t, e, n) {
12113
12113
  t.save(), t.beginPath(), t.moveTo(e[0].x, e[0].y);
12114
12114
  for (const s of e.slice(1)) t.lineTo(s.x, s.y);
@@ -12125,7 +12125,7 @@ function sk(t = {}) {
12125
12125
  const L = I.parts[`leg.${K}`].points;
12126
12126
  if (a === "skirt" && !u) return;
12127
12127
  const F = a === "shorts" && !u, N = I.bodyContours?.[`leg.${K}`], X = N ? Ri(N, 0, F ? 0.5 : 1, I.height * 6e-3) : jt(F ? Ni(L, 0, 0.5) : L, I.height * (F ? 0.085 : 0.08), I.height * (F ? 0.07 : 0.05));
12128
- B.shape(X, r, m(I)), !(n === "plain" || Ut(I) < 0.15) && Yh($, X, () => {
12128
+ B.shape(X, r, m(I)), !(n === "plain" || Gt(I) < 0.15) && Yh($, X, () => {
12129
12129
  const z = (J, Q = 0) => Kh(L, J, Q * I.height);
12130
12130
  if (n === "jeans")
12131
12131
  B.line([z(0.07, -0.018), z(0.17, -0.02), z(0.23, 0), z(0.17, 0.02), z(0.07, 0.018)], m(I) * 0.65), B.line([z(0.27, 0.013), ...[0.4, 0.55, 0.7, 0.85, 0.96].filter((J) => !F || J < 0.5).map((J) => z(J, 0.013))], m(I) * 0.5);
@@ -12162,7 +12162,7 @@ function sk(t = {}) {
12162
12162
  const B = c ? f : o;
12163
12163
  I.shape(b($), B, m($));
12164
12164
  }, v = ($, I, B) => {
12165
- const K = Ut(I);
12165
+ const K = Gt(I);
12166
12166
  if (!e || K < 0.2 || c) return;
12167
12167
  const { top: L, hip: F } = w(I), N = Ae(I) * I.height * 0.025, X = [L, F], z = (J, Q = 0) => Kh(X, J, N + Q * I.height * K);
12168
12168
  Yh($, b(I), () => {
@@ -12179,7 +12179,7 @@ function sk(t = {}) {
12179
12179
  } else e === "dress" ? B.line([z(0.04, -0.035), z(0.17, -0.028), z(0.17, 0.028), z(0.04, 0.035)], m(I) * 0.75) : B.line([z(0.025, -0.035), z(0.1, -0.02), z(0.12), z(0.1, 0.02), z(0.025, 0.035)], m(I) * 0.65);
12180
12180
  });
12181
12181
  }, x = ($, I) => {
12182
- const B = Ut($), { top: K, hip: L } = w($), F = $.height * 0.07, N = { x: (K.x - L.x) * 0.16, y: (K.y - L.y) * 0.16 };
12182
+ const B = Gt($), { top: K, hip: L } = w($), F = $.height * 0.07, N = { x: (K.x - L.x) * 0.16, y: (K.y - L.y) * 0.16 };
12183
12183
  if (B >= 0) {
12184
12184
  I.shape(
12185
12185
  [
@@ -12207,14 +12207,14 @@ function sk(t = {}) {
12207
12207
  m($)
12208
12208
  );
12209
12209
  }, M = ($, I) => {
12210
- const B = Ut($);
12210
+ const B = Gt($);
12211
12211
  if (B < 0.2) return;
12212
12212
  const { top: K, hip: L } = w($), F = Ae($) * $.height * 0.03, N = $.height * 0.06 * B, X = mt(K, L, 0.62), z = mt(K, L, 0.9);
12213
12213
  I.line([{ x: X.x + F - N, y: X.y }, { x: z.x + F - N * 1.1, y: z.y }], m($) * 0.7), I.line([{ x: X.x + F + N, y: X.y }, { x: z.x + F + N * 1.1, y: z.y }], m($) * 0.7);
12214
12214
  const J = mt(K, L, 0.1);
12215
12215
  for (const Q of [-1, 1]) I.line([{ x: J.x + F + Q * N * 0.2, y: J.y }, { x: J.x + F + Q * N * 0.35, y: J.y + $.height * 0.07 }], m($) * 0.6);
12216
12216
  }, T = ($, I) => {
12217
- const { top: B, hip: K } = w($), L = Ut($);
12217
+ const { top: B, hip: K } = w($), L = Gt($);
12218
12218
  if (I.shape(jt([B, mt(B, K, 0.5), mt(B, K, 1.08)], $.height * 0.155, $.height * 0.15), f, m($)), L < 0.2) return;
12219
12219
  const F = Ae($) * $.height * 0.03, N = $.height * 0.02 * L, X = mt(B, K, 0.12), z = mt(B, K, 1.05);
12220
12220
  I.shape([{ x: X.x + F - N, y: X.y }, { x: X.x + F + N, y: X.y }, { x: z.x + F + N * 1.3, y: z.y }, { x: z.x + F - N * 1.3, y: z.y }], o, m($) * 0.7);
@@ -12223,11 +12223,11 @@ function sk(t = {}) {
12223
12223
  I.dot(Q.x + F + N * 1.6, Q.y, m($) * 1.2);
12224
12224
  }
12225
12225
  }, A = ($, I) => {
12226
- const B = Ut($), { top: K, hip: L } = w($), F = Ae($) * $.height * 0.04, N = mt(L, K, 0.12), X = mt(L, K, 0.74);
12226
+ const B = Gt($), { top: K, hip: L } = w($), F = Ae($) * $.height * 0.04, N = mt(L, K, 0.12), X = mt(L, K, 0.74);
12227
12227
  if (B < 0.15) {
12228
12228
  if (B < -0.3) {
12229
- const H = $.points["shoulder.left"], U = $.points["shoulder.right"];
12230
- I.line([H, { x: N.x + $.height * 0.03, y: N.y }], m($) * 0.8), I.line([U, { x: N.x - $.height * 0.03, y: N.y }], m($) * 0.8);
12229
+ const H = $.points["shoulder.left"], G = $.points["shoulder.right"];
12230
+ I.line([H, { x: N.x + $.height * 0.03, y: N.y }], m($) * 0.8), I.line([G, { x: N.x - $.height * 0.03, y: N.y }], m($) * 0.8);
12231
12231
  }
12232
12232
  return;
12233
12233
  }
@@ -12243,34 +12243,34 @@ function sk(t = {}) {
12243
12243
  m($)
12244
12244
  );
12245
12245
  for (const H of ["left", "right"]) {
12246
- const U = $.points[`shoulder.${H}`], et = { x: X.x + F + (U.x > X.x + F ? 1 : -1) * z * 0.55, y: X.y };
12247
- I.line([et, { x: U.x + (et.x - U.x) * 0.15, y: U.y + (et.y - U.y) * 0.15 }], m($) * 1.6);
12246
+ const G = $.points[`shoulder.${H}`], et = { x: X.x + F + (G.x > X.x + F ? 1 : -1) * z * 0.55, y: X.y };
12247
+ I.line([et, { x: G.x + (et.x - G.x) * 0.15, y: G.y + (et.y - G.y) * 0.15 }], m($) * 1.6);
12248
12248
  }
12249
12249
  const J = mt(X, N, 0.3), Q = z * 0.4;
12250
12250
  I.line([{ x: J.x + F - Q, y: J.y }, { x: J.x + F - Q, y: J.y + Q * 1.4 }, { x: J.x + F + Q, y: J.y + Q * 1.4 }, { x: J.x + F + Q, y: J.y }], m($) * 0.6);
12251
12251
  }, P = ($, I) => {
12252
- const { hip: B, top: K } = w($), L = mt(B, K, 0.2), F = [$.points["ankle.left"], $.points["ankle.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 0.98), X = $.height * 0.075, z = Math.max($.height * 0.12, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.07), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1, U = { x: -Q / H, y: J / H };
12252
+ const { hip: B, top: K } = w($), L = mt(B, K, 0.2), F = [$.points["ankle.left"], $.points["ankle.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 0.98), X = $.height * 0.075, z = Math.max($.height * 0.12, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.07), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1, G = { x: -Q / H, y: J / H };
12253
12253
  if (I.shape(
12254
12254
  [
12255
- { x: L.x + U.x * X, y: L.y + U.y * X },
12256
- { x: N.x + U.x * z, y: N.y + U.y * z },
12257
- { x: N.x - U.x * z, y: N.y - U.y * z },
12258
- { x: L.x - U.x * X, y: L.y - U.y * X }
12255
+ { x: L.x + G.x * X, y: L.y + G.y * X },
12256
+ { x: N.x + G.x * z, y: N.y + G.y * z },
12257
+ { x: N.x - G.x * z, y: N.y - G.y * z },
12258
+ { x: L.x - G.x * X, y: L.y - G.y * X }
12259
12259
  ],
12260
12260
  f,
12261
12261
  m($)
12262
- ), Ut($) > 0.2) {
12262
+ ), Gt($) > 0.2) {
12263
12263
  const it = Ae($) * $.height * 0.03;
12264
12264
  for (const ot of [-0.35, 0, 0.35]) {
12265
12265
  const lt = X * 0.5 * ot, st = z * 0.45 * ot;
12266
- I.line([{ x: L.x + it + U.x * lt, y: L.y + U.y * lt + $.height * 0.02 }, { x: N.x + it + U.x * st, y: N.y + U.y * st }], m($) * 0.5);
12266
+ I.line([{ x: L.x + it + G.x * lt, y: L.y + G.y * lt + $.height * 0.02 }, { x: N.x + it + G.x * st, y: N.y + G.y * st }], m($) * 0.5);
12267
12267
  }
12268
12268
  }
12269
12269
  }, O = ($, I) => {
12270
- const B = Ut($), { top: K, hip: L } = w($), F = Ae($), N = F >= 0 ? "left" : "right", X = N === "left" ? "right" : "left", z = $.points[`shoulder.${N}`], J = $.height * 0.035;
12270
+ const B = Gt($), { top: K, hip: L } = w($), F = Ae($), N = F >= 0 ? "left" : "right", X = N === "left" ? "right" : "left", z = $.points[`shoulder.${N}`], J = $.height * 0.035;
12271
12271
  if (B < 0.15) {
12272
- const U = mt(K, L, 0.9);
12273
- I.shape(jt([z, { x: U.x + (z.x - K.x) * 0.5, y: U.y }], J * 2.2, J * 2.6), f, m($));
12272
+ const G = mt(K, L, 0.9);
12273
+ I.shape(jt([z, { x: G.x + (z.x - K.x) * 0.5, y: G.y }], J * 2.2, J * 2.6), f, m($));
12274
12274
  return;
12275
12275
  }
12276
12276
  const Q = { x: L.x + ($.points[`hip.${X}`].x - L.x) * 1.2, y: mt(L, K, 0.08).y };
@@ -12282,19 +12282,19 @@ function sk(t = {}) {
12282
12282
  I.shape(Tf($, { top: !1, length: 0.45 }).skirt, r, m($));
12283
12283
  return;
12284
12284
  }
12285
- const { hip: B, top: K } = w($), L = mt(B, K, 0.18), F = [$.points["knee.left"], $.points["knee.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 1.05), X = $.height * 0.075, z = Math.max($.height * 0.13, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.08), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1, U = { x: -Q / H, y: J / H };
12285
+ const { hip: B, top: K } = w($), L = mt(B, K, 0.18), F = [$.points["knee.left"], $.points["knee.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 1.05), X = $.height * 0.075, z = Math.max($.height * 0.13, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.08), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1, G = { x: -Q / H, y: J / H };
12286
12286
  I.shape(
12287
12287
  [
12288
- { x: L.x + U.x * X, y: L.y + U.y * X },
12289
- { x: N.x + U.x * z, y: N.y + U.y * z },
12290
- { x: N.x - U.x * z, y: N.y - U.y * z },
12291
- { x: L.x - U.x * X, y: L.y - U.y * X }
12288
+ { x: L.x + G.x * X, y: L.y + G.y * X },
12289
+ { x: N.x + G.x * z, y: N.y + G.y * z },
12290
+ { x: N.x - G.x * z, y: N.y - G.y * z },
12291
+ { x: L.x - G.x * X, y: L.y - G.y * X }
12292
12292
  ],
12293
12293
  r,
12294
12294
  m($)
12295
12295
  );
12296
12296
  }, W = ($, I) => {
12297
- const B = Ut($);
12297
+ const B = Gt($);
12298
12298
  if (B < 0.2) return;
12299
12299
  const { top: K, hip: L } = w($), F = { x: (L.x - K.x) * 0.12, y: (L.y - K.y) * 0.12 }, N = $.height * 0.045 * B;
12300
12300
  for (const X of [-1, 1])
@@ -12308,12 +12308,12 @@ function sk(t = {}) {
12308
12308
  m($) * 0.8
12309
12309
  );
12310
12310
  }, q = ($, I, B) => {
12311
- const K = Ut($);
12311
+ const K = Gt($);
12312
12312
  if (K < 0.25) return;
12313
12313
  const { top: L, hip: F } = w($), N = Ae($) * $.height * 0.03, X = (H) => ({ x: mt(L, F, H).x + N, y: mt(L, F, H).y }), z = $.height * 0.022 * K, J = X(0.08), Q = X(0.62);
12314
12314
  I.shape([{ x: J.x - z, y: J.y - z }, { x: J.x + z, y: J.y - z }, { x: J.x + z * 0.6, y: J.y + z }, { x: J.x - z * 0.6, y: J.y + z }], B, m($) * 0.7), I.shape([{ x: J.x - z * 0.6, y: J.y + z }, { x: J.x + z * 0.6, y: J.y + z }, { x: Q.x + z * 1.4, y: Q.y - z * 2 }, Q, { x: Q.x - z * 1.4, y: Q.y - z * 2 }], B, m($) * 0.7);
12315
12315
  }, V = ($, I) => {
12316
- const B = Ut($), { top: K, hip: L } = w($), F = mt(L, K, 0.72), N = [$.points["knee.left"], $.points["knee.right"]], X = mt(L, { x: (N[0].x + N[1].x) / 2, y: (N[0].y + N[1].y) / 2 }, 0.9), z = Ae($) * $.height * 0.04;
12316
+ const B = Gt($), { top: K, hip: L } = w($), F = mt(L, K, 0.72), N = [$.points["knee.left"], $.points["knee.right"]], X = mt(L, { x: (N[0].x + N[1].x) / 2, y: (N[0].y + N[1].y) / 2 }, 0.9), z = Ae($) * $.height * 0.04;
12317
12317
  if (B < 0.15) {
12318
12318
  const H = mt(L, K, 0.2);
12319
12319
  B < -0.3 && I.line([{ x: H.x - $.height * 0.05, y: H.y }, { x: H.x + $.height * 0.05, y: H.y }], m($));
@@ -12335,15 +12335,15 @@ function sk(t = {}) {
12335
12335
  }, tt = ($, I, B) => {
12336
12336
  const { top: K, hip: L } = w($), F = [$.points["knee.left"], $.points["knee.right"]], N = mt(L, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 0.95);
12337
12337
  B ? I.shape(jt([mt(K, L, 0.8), L, N], $.height * 0.145, $.height * 0.17), f, m($)) : I.shape(jt([K, mt(K, L, 0.5), L], $.height * 0.14, $.height * 0.15), f, m($));
12338
- const X = Ut($);
12338
+ const X = Gt($);
12339
12339
  if (X > 0.2) {
12340
12340
  const z = Ae($) * $.height * 0.03, [J, Q] = B ? [L, N] : [K, L];
12341
12341
  if (I.line([{ x: J.x + z, y: J.y }, { x: Q.x + z, y: Q.y }], m($) * 0.8), !B) {
12342
- const H = mt(K, L, 0.35), U = $.height * 0.025 * X;
12343
- I.shape([{ x: H.x + z - U * 2.4, y: H.y }, { x: H.x + z - U * 0.6, y: H.y }, { x: H.x + z - U * 0.6, y: H.y + U * 1.6 }, { x: H.x + z - U * 2.4, y: H.y + U * 1.6 }], f, m($) * 0.6);
12342
+ const H = mt(K, L, 0.35), G = $.height * 0.025 * X;
12343
+ I.shape([{ x: H.x + z - G * 2.4, y: H.y }, { x: H.x + z - G * 0.6, y: H.y }, { x: H.x + z - G * 0.6, y: H.y + G * 1.6 }, { x: H.x + z - G * 2.4, y: H.y + G * 1.6 }], f, m($) * 0.6);
12344
12344
  }
12345
12345
  }
12346
- }, G = ($, I, B, K, L) => {
12346
+ }, U = ($, I, B, K, L) => {
12347
12347
  const F = $.bodyContours?.[`arm.${B}`];
12348
12348
  if (F) {
12349
12349
  const Z = Ri(F, 0, L, $.height * 6e-3);
@@ -12355,10 +12355,10 @@ function sk(t = {}) {
12355
12355
  }
12356
12356
  return;
12357
12357
  }
12358
- const N = $.parts[`arm.${B}`].points, X = N[0], z = $.chains.spine[$.chains.spine.length - 1], Q = [{ x: X.x + (z.x - X.x) * 0.45, y: X.y + (z.y - X.y) * 0.45 }, ...Ni(N, 0, L)], H = jt(Q, $.height * 0.085, $.height * (L > 0.6 ? 0.045 : 0.06)), U = Q.length, et = H.slice(0, U), it = H.slice(U).reverse();
12358
+ const N = $.parts[`arm.${B}`].points, X = N[0], z = $.chains.spine[$.chains.spine.length - 1], Q = [{ x: X.x + (z.x - X.x) * 0.45, y: X.y + (z.y - X.y) * 0.45 }, ...Ni(N, 0, L)], H = jt(Q, $.height * 0.085, $.height * (L > 0.6 ? 0.045 : 0.06)), G = Q.length, et = H.slice(0, G), it = H.slice(G).reverse();
12359
12359
  I.shape(H, K, 0);
12360
12360
  const ot = (Z) => Math.hypot(Z[1].x - z.x, Z[1].y - z.y), [lt, st] = ot(et) > ot(it) ? [et, it] : [it, et];
12361
- I.line(lt.slice(1), m($)), I.line(st.slice(Math.ceil(U * 0.45)), m($)), I.line([et[U - 1], it[U - 1]], m($));
12361
+ I.line(lt.slice(1), m($)), I.line(st.slice(Math.ceil(G * 0.45)), m($)), I.line([et[G - 1], it[G - 1]], m($));
12362
12362
  }, R = l || c || h, D = R ? f : o, Y = R || i === "long" ? 0.95 : 0.45, _ = R || i !== "none", j = ($, I) => {
12363
12363
  a === "skirt" && !u && !d && C($, I), d && P($, I), l && tt($, I, !0), t.over === "apron" && V($, I);
12364
12364
  }, nt = ($) => (I, B, K) => {
@@ -12370,11 +12370,11 @@ function sk(t = {}) {
12370
12370
  "leg.right": { clip: S, over: nt("right") },
12371
12371
  spine: {
12372
12372
  over: ($, I, B) => {
12373
- c && Ut(I) >= 0 && x(I, B), E(I, B), v($, I, B), s && !c && W(I, B), t.tie && !c && q(I, B, t.tie), l && tt(I, B, !1), h && T(I, B), c && (Ut(I) < 0 && x(I, B), M(I, B)), u && A(I, B), d && O(I, B), jh(I) || j(I, B);
12373
+ c && Gt(I) >= 0 && x(I, B), E(I, B), v($, I, B), s && !c && W(I, B), t.tie && !c && q(I, B, t.tie), l && tt(I, B, !1), h && T(I, B), c && (Gt(I) < 0 && x(I, B), M(I, B)), u && A(I, B), d && O(I, B), jh(I) || j(I, B);
12374
12374
  }
12375
12375
  },
12376
- "arm.left": { over: _ ? ($, I, B) => G(I, B, "left", D, Y) : void 0 },
12377
- "arm.right": { over: _ ? ($, I, B) => G(I, B, "right", D, Y) : void 0 }
12376
+ "arm.left": { over: _ ? ($, I, B) => U(I, B, "left", D, Y) : void 0 },
12377
+ "arm.right": { over: _ ? ($, I, B) => U(I, B, "right", D, Y) : void 0 }
12378
12378
  }
12379
12379
  };
12380
12380
  }
@@ -12486,20 +12486,20 @@ function Xh(t, e, n, s, o, r = 1, i) {
12486
12486
  }
12487
12487
  }
12488
12488
  }
12489
- const Uh = (t, e) => (t[`held.${e}`] ?? 1) >= 0.5, Gh = (t) => Math.sin(t * Math.PI / 2);
12489
+ const Gh = (t, e) => (t[`held.${e}`] ?? 1) >= 0.5, Uh = (t) => Math.sin(t * Math.PI / 2);
12490
12490
  function rk(t) {
12491
12491
  const e = (r) => Math.max(1, r.lineWidth * 0.45), n = (r) => (i, a, l, c, h) => {
12492
12492
  const u = t[r];
12493
- u && Uh(h ?? {}, r) && Xh(l, u, Di(a, r), a.height, e(a), Gh(a.turn), a.head.center.y - a.head.ry);
12493
+ u && Gh(h ?? {}, r) && Xh(l, u, Di(a, r), a.height, e(a), Uh(a.turn), a.head.center.y - a.head.ry);
12494
12494
  }, s = (r, i, a, l, c) => {
12495
12495
  const h = t.both;
12496
- if (!h || !Uh(c ?? {}, "both")) return;
12496
+ if (!h || !Gh(c ?? {}, "both")) return;
12497
12497
  const u = Di(i, "left"), d = Di(i, "right"), f = {
12498
12498
  point: { x: (u.point.x + d.point.x) / 2, y: (u.point.y + d.point.y) / 2 },
12499
12499
  along: { x: (u.along.x + d.along.x) / 2, y: (u.along.y + d.along.y) / 2 },
12500
12500
  depth: (u.depth + d.depth) / 2
12501
12501
  };
12502
- Xh(a, h, f, i.height, e(i), Gh(i.turn), i.head.center.y - i.head.ry);
12502
+ Xh(a, h, f, i.height, e(i), Uh(i.turn), i.head.center.y - i.head.ry);
12503
12503
  }, o = { parts: {} };
12504
12504
  if (t.left && (o.parts["arm.left"] = { over: n("left") }), t.right && (o.parts["arm.right"] = { over: n("right") }), t.both) {
12505
12505
  const r = (i) => (a, l, c, h, u) => {
@@ -12758,7 +12758,7 @@ function Pf(t, e, n) {
12758
12758
  }
12759
12759
  return s;
12760
12760
  }
12761
- function Ue(t, e, n, s) {
12761
+ function Ge(t, e, n, s) {
12762
12762
  const o = t.plan.id === "human" ? { ...at, ...e } : e;
12763
12763
  let r;
12764
12764
  if (Array.isArray(s))
@@ -12767,7 +12767,7 @@ function Ue(t, e, n, s) {
12767
12767
  const { skeleton: i } = Zs(t, o), a = Pl(t.plan, { ...o, roll: 0 }, { height: t.height, contact: "none" }), l = (o.roll ?? 0) * Math.PI / 180, c = s.x - i.hip.x, h = s.y - i.hip.y, u = a.hip.x + c * Math.cos(-l) - h * Math.sin(-l), d = a.hip.y + c * Math.sin(-l) + h * Math.cos(-l), f = Math.PI / 2 * (o.turn ?? 0), p = s.depth ?? i.chains[n].depths[i.chains[n].depths.length - 1], g = Math.cos(f), m = Math.sin(f);
12768
12768
  r = [u * g - p * m, -d, u * m + p * g];
12769
12769
  }
12770
- return Gs(t.plan, o, n, r, { height: t.height });
12770
+ return Us(t.plan, o, n, r, { height: t.height });
12771
12771
  }
12772
12772
  const Of = /* @__PURE__ */ new Set(["walk", "walking", "gait"]);
12773
12773
  function Dl(t, e = at, n) {
@@ -12843,17 +12843,17 @@ function A4(t, e, n = at) {
12843
12843
  }))
12844
12844
  }));
12845
12845
  }
12846
- const Xr = (t, e) => [t[0] + e[0], t[1] + e[1], t[2] + e[2]], Se = (t, e) => [t[0] - e[0], t[1] - e[1], t[2] - e[2]], wr = (t, e) => [t[0] * e, t[1] * e, t[2] * e], Bl = (t) => Math.hypot(...t), _f = (t) => wr(t, 1 / (Bl(t) || 1)), Ur = (t) => ({ ...at, ...t }), zl = (t) => Tn(t.character.plan, Ur(t.pose), { height: t.character.height, contact: t.character.contact });
12846
+ const Xr = (t, e) => [t[0] + e[0], t[1] + e[1], t[2] + e[2]], Se = (t, e) => [t[0] - e[0], t[1] - e[1], t[2] - e[2]], wr = (t, e) => [t[0] * e, t[1] * e, t[2] * e], Bl = (t) => Math.hypot(...t), _f = (t) => wr(t, 1 / (Bl(t) || 1)), Gr = (t) => ({ ...at, ...t }), zl = (t) => Tn(t.character.plan, Gr(t.pose), { height: t.character.height, contact: t.character.contact });
12847
12847
  function hs(t, e, n) {
12848
12848
  return Xr(t.position, zl(t).chains[e][n]);
12849
12849
  }
12850
12850
  function Cf(t, e, n) {
12851
- const s = Ur(t.pose), o = zl(t).hip, r = co(t.character.plan, s, t.character.height), i = Se(Se(n, t.position), o), a = gs(i, (s.roll ?? 0) * Math.PI / 180), l = Xr(r.root, Jt(a, -(s.turn ?? 0) * Math.PI / 2));
12852
- return Gs(t.character.plan, s, e, l, { height: t.character.height });
12851
+ const s = Gr(t.pose), o = zl(t).hip, r = co(t.character.plan, s, t.character.height), i = Se(Se(n, t.position), o), a = gs(i, (s.roll ?? 0) * Math.PI / 180), l = Xr(r.root, Jt(a, -(s.turn ?? 0) * Math.PI / 2));
12852
+ return Us(t.character.plan, s, e, l, { height: t.character.height });
12853
12853
  }
12854
12854
  function fk(t, e, n, s = "toe") {
12855
12855
  const o = `leg.${e}`, r = s === "toe" ? 3 : 2;
12856
- let i = { ...t, pose: Ur(t.pose), position: [...t.position] };
12856
+ let i = { ...t, pose: Gr(t.pose), position: [...t.position] };
12857
12857
  for (let l = 0; l < 6; l++) {
12858
12858
  const c = zl(i).chains[o], h = Se(c[r], c[2]);
12859
12859
  i = { ...i, pose: Cf(i, o, Se(n, h)) };
@@ -12872,7 +12872,7 @@ function $4(t, e, n = {}) {
12872
12872
  if (!(o > 0) || !Number.isFinite(o)) throw new Error("meetDandiya: stick length must be positive and finite");
12873
12873
  const r = n.point ?? [(t.position[0] + e.position[0]) / 2, Math.max(t.position[1], e.position[1]) + s * 0.62, (t.position[2] + e.position[2]) / 2], i = (c, h) => {
12874
12874
  const u = _f([r[0] - c.position[0], s * 0.2, r[2] - c.position[2]]), d = Se(r, wr(u, o));
12875
- let f = Ur(c.pose);
12875
+ let f = Gr(c.pose);
12876
12876
  for (let g = 0; g < 6; g++) {
12877
12877
  const m = { ...c, pose: f }, y = hs(m, `arm.${h}`, 2);
12878
12878
  f = Cf(m, `arm.${h}`, Se(d, Se(Jh(m, h), y)));
@@ -12947,7 +12947,7 @@ function bk(t, e) {
12947
12947
  return (e - t.takeoff) / (t.landing - t.takeoff);
12948
12948
  }
12949
12949
  function wk(t, e) {
12950
- const n = typeof t == "string" ? Gr[t] : t, s = pk(n), o = kr(e);
12950
+ const n = typeof t == "string" ? Ur[t] : t, s = pk(n), o = kr(e);
12951
12951
  let r = 0;
12952
12952
  for (let u = 0; u < s.length; u++) s[u].at <= o && (r = u);
12953
12953
  const i = s[r], a = s[Math.min(r + 1, s.length - 1)], l = a.at > i.at ? (o - i.at) / (a.at - i.at) : 0, c = Xs(i.pose, a.pose, zt(a.easing ?? "ease-in-out")(kr(l))), h = bk(n, o);
@@ -12958,11 +12958,11 @@ function wk(t, e) {
12958
12958
  };
12959
12959
  }
12960
12960
  function kk(t, e, n) {
12961
- const s = typeof t == "string" ? Gr[t] : t, o = kr(e), r = kr((o - s.takeoff) / (s.landing - s.takeoff));
12961
+ const s = typeof t == "string" ? Ur[t] : t, o = kr(e), r = kr((o - s.takeoff) / (s.landing - s.takeoff));
12962
12962
  return s.travel * n * r;
12963
12963
  }
12964
12964
  function O4(t, e, n = {}) {
12965
- const s = typeof e == "string" ? Gr[e] : e, o = n.start ?? 0, r = n.duration ?? s.duration, i = n.samples ?? 48, a = Array.from({ length: i + 1 }, (h, u) => {
12965
+ const s = typeof e == "string" ? Ur[e] : e, o = n.start ?? 0, r = n.duration ?? s.duration, i = n.samples ?? 48, a = Array.from({ length: i + 1 }, (h, u) => {
12966
12966
  const d = u / i;
12967
12967
  return { time: o + d * r, progress: d, pose: wk(s, d) };
12968
12968
  }), c = Object.keys(ht).filter((h) => a.some((u) => u.pose[h] !== ht[h])).map((h) => ({
@@ -13070,7 +13070,7 @@ function Cn(t, e, n, s, o, r = 1300) {
13070
13070
  ]
13071
13071
  };
13072
13072
  }
13073
- const Gr = {
13073
+ const Ur = {
13074
13074
  frontFlip: Cn("Front flip (tuck)", 360, 0.56, 0.35, [
13075
13075
  { at: 0.38, pose: Po, easing: "ease-out-cubic" },
13076
13076
  { at: 0.64, pose: Po }
@@ -13464,9 +13464,9 @@ function Wk(t, e, n) {
13464
13464
  function Nk(t) {
13465
13465
  const e = Ce([0, 1, 0], t);
13466
13466
  if (e > 0.999999) return Wr();
13467
- if (e < -0.999999) return me(Gt([1, 0, 0], 180));
13467
+ if (e < -0.999999) return me(Ut([1, 0, 0], 180));
13468
13468
  const n = qs([0, 1, 0], t);
13469
- return me(Gt(n, Math.acos(e) * 180 / Math.PI));
13469
+ return me(Ut(n, Math.acos(e) * 180 / Math.PI));
13470
13470
  }
13471
13471
  function Dk(t, e, n, s, o) {
13472
13472
  const r = t.solid ?? {}, i = r.outline === !1 ? void 0 : r.outline ?? { width: 2, color: "#0f172a" }, a = { color: r.color ?? "#475569", shading: r.shading ?? "toon", outline: i }, l = { color: r.skin ?? "#f2c49b", shading: r.shading ?? "toon", outline: i }, c = { color: "#0f172a", shading: "unlit" }, h = s.height * 0.034, u = [], d = (w, b, S) => u.push({ mesh: w, world: Ht(o, b), material: S }), f = (w, b, S) => d(e.sphere, pl(w, [0, 0, 0, 1], [b, b, b]), S);
@@ -13643,7 +13643,7 @@ function C4(t, e, n = {}) {
13643
13643
  }
13644
13644
  return Object.entries(s).map(([o, r]) => ({ id: `${t}-${o}`, target: t, property: o, keyframes: r }));
13645
13645
  }
13646
- function Ul(t, e, n, s = {}) {
13646
+ function Gl(t, e, n, s = {}) {
13647
13647
  if (n.length === 0) return e;
13648
13648
  const o = s.fields?.mouth ?? "mouth", r = s.fields?.mouthWidth ?? "mouthWidth", i = { [o]: en.rest.mouth, [r]: en.rest.mouthWidth, ...s.rest }, a = new Ft({ id: "before-speech", tracks: e }), l = (u, d) => a.getStateAtTime(d).values.get(t)?.get(u) ?? i[u], c = [o, r], h = e.filter((u) => u.target !== t || !c.includes(u.property));
13649
13649
  for (const u of c) {
@@ -13711,7 +13711,7 @@ function Xk(t, e, n = "x", s = 20, o = 0) {
13711
13711
  }
13712
13712
  return { vertices: r, faces: a, marks: l, creases: !0 };
13713
13713
  }
13714
- function Uk([t, e, n], s = 16) {
13714
+ function Gk([t, e, n], s = 16) {
13715
13715
  const o = Math.max(4, Math.round(s / 2)), r = [[0, e, 0]];
13716
13716
  for (let h = 1; h < o; h++) {
13717
13717
  const u = Math.PI * h / o;
@@ -13736,12 +13736,12 @@ function Uk([t, e, n], s = 16) {
13736
13736
  }
13737
13737
  return { vertices: r, faces: c, creases: !1 };
13738
13738
  }
13739
- const Gk = (t) => t.reduce((e, [n, s], o) => {
13739
+ const Uk = (t) => t.reduce((e, [n, s], o) => {
13740
13740
  const [r, i] = t[(o + 1) % t.length];
13741
13741
  return e + n * i - r * s;
13742
13742
  }, 0) / 2;
13743
13743
  function Vk(t, e) {
13744
- const n = Gk(t) < 0 ? [...t].reverse() : t, s = n.length, o = e / 2, r = [...n.map(([a, l]) => [o, l, a]), ...n.map(([a, l]) => [-o, l, a])], i = [
13744
+ const n = Uk(t) < 0 ? [...t].reverse() : t, s = n.length, o = e / 2, r = [...n.map(([a, l]) => [o, l, a]), ...n.map(([a, l]) => [-o, l, a])], i = [
13745
13745
  // Seen from +x, (forward, up) = (z, y) runs anticlockwise when z points left on screen: so reverse for the left cap.
13746
13746
  { corners: Array.from({ length: s }, (a, l) => s - 1 - l), normal: [1, 0, 0] },
13747
13747
  { corners: Array.from({ length: s }, (a, l) => s + l), normal: [-1, 0, 0] }
@@ -13788,7 +13788,7 @@ function Qk(t) {
13788
13788
  case "cylinder":
13789
13789
  return Xk(t.radius, t.length, t.axis, t.segments, t.spokes);
13790
13790
  case "ellipsoid":
13791
- return Uk(t.radii, t.segments);
13791
+ return Gk(t.radii, t.segments);
13792
13792
  case "extrude":
13793
13793
  return Vk(t.profile, t.width);
13794
13794
  case "panel":
@@ -13846,7 +13846,7 @@ function Xf(t, e) {
13846
13846
  return (n + s) / 2;
13847
13847
  }
13848
13848
  const Ss = 520, u0 = ["do", "at", "for", "to", "through", "toward", "speed", "pose", "gag", "say", "look", "turns", "dance", "bpm", "beats"], t5 = (t) => Math.max(700, Array.from(t).length * 65), d0 = 70, f0 = 35;
13849
- function Uf(t, e) {
13849
+ function Gf(t, e) {
13850
13850
  const n = e[0] - t.x, s = e[1] - t.eyeHeight, o = e[2] - t.z, r = t.heading * Math.PI / 180, i = n * Math.cos(r) - o * Math.sin(r), a = n * Math.sin(r) + o * Math.cos(r), l = Math.atan2(i, a) * 180 / Math.PI, c = Math.hypot(i, a), h = -Math.atan2(s, c) * 180 / Math.PI, u = Math.max(-d0, Math.min(d0, l * 0.75)), d = Math.max(-f0, Math.min(f0, h * 0.7));
13851
13851
  return {
13852
13852
  "head.turn": u,
@@ -13924,14 +13924,14 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
13924
13924
  const A = g(M, Qn(T[0].point, T[1].point)), P = T[T.length - 1].at, O = x.speed ?? e5[v] * Math.sqrt(o / 1.7), C = x.for ?? P / O * 1e3, W = Ll(v, o), q = zt("ease-in-out"), V = Math.min(r5, C / 4);
13925
13925
  d.push({ time: A, value: v }), p("walking", A, 0), f("walking", A + V, 1, "ease-out"), f("walking", A + C - V, 1), f("walking", A + C, 0, "ease-in");
13926
13926
  const tt = h;
13927
- let G = c;
13927
+ let U = c;
13928
13928
  for (let R = 0; ; R = Math.min(P, R + n5)) {
13929
13929
  const D = A + Xf(q, R / P) * C, { point: Y, direction: _ } = Kf(T, R);
13930
- G += Mr(G, Qn([0, 0], _));
13930
+ U += Mr(U, Qn([0, 0], _));
13931
13931
  const j = R === 0 ? p : f;
13932
- if (j("x", D, Y[0]), j("z", D, Y[1]), j("rotateY", D, G), j("walk", D, tt + R / W), R >= P) break;
13932
+ if (j("x", D, Y[0]), j("z", D, Y[1]), j("rotateY", D, U), j("walk", D, tt + R / W), R >= P) break;
13933
13933
  }
13934
- return h = tt + P / W, [a, l] = T[T.length - 1].point, c = G, A + C;
13934
+ return h = tt + P / W, [a, l] = T[T.length - 1].point, c = U, A + C;
13935
13935
  }, k = [], w = [];
13936
13936
  let b = 0;
13937
13937
  for (const v of e) {
@@ -13947,9 +13947,9 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
13947
13947
  const O = { ...r }, C = Math.max(1, Math.ceil(P * 16)), W = Array.from({ length: C + 1 }, (V, tt) => pr(v.dance, P * tt / C, O).pose), q = Math.min(150, (M - x) / 4);
13948
13948
  for (const V of Object.keys(W[0])) {
13949
13949
  const tt = i(V, O);
13950
- V === "turn" || V === "roll" || W.every((G) => G[V] === tt) || (p(V, x, tt), W.slice(1).forEach((G, R) => {
13950
+ V === "turn" || V === "roll" || W.every((U) => U[V] === tt) || (p(V, x, tt), W.slice(1).forEach((U, R) => {
13951
13951
  const D = x + (M - x) * (R + 1) / C, Y = Math.min(1, (D - x) / q), _ = Y * Y * (3 - 2 * Y);
13952
- f(V, D, tt + (G[V] - tt) * _);
13952
+ f(V, D, tt + (U[V] - tt) * _);
13953
13953
  }), r[V] = W[C][V]);
13954
13954
  }
13955
13955
  } else if (v.do === "hold") M = x + (v.for ?? 1e3);
@@ -13960,7 +13960,7 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
13960
13960
  const T = typeof v.pose == "string" ? Me[v.pose] : v.pose;
13961
13961
  m(x, M, T);
13962
13962
  } else if (v.do === "gag") {
13963
- const T = G2(v.gag, { at: x, from: { ...r } });
13963
+ const T = U2(v.gag, { at: x, from: { ...r } });
13964
13964
  let A = T[0];
13965
13965
  for (const P of T.slice(1))
13966
13966
  m(A.time, P.time, Object.fromEntries(Object.entries(P.pose).filter(([O, C]) => r[O] !== C)), P.easing ?? "ease-in-out"), A = P;
@@ -13976,13 +13976,13 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
13976
13976
  A > 0 && m(M - Ss / 2, M, { "head.tilt": T.tilt, "brow.left": T.left, "brow.right": T.right });
13977
13977
  } else if (v.do === "look") {
13978
13978
  const T = v.look ?? v.toward, A = o * 0.9, P = T === "camera" ? n.camera ?? [0, 1.6, 8] : T.length === 3 ? T : [T[0], A, T[1]];
13979
- M = x + (v.for ?? 500), m(x, M, Uf({ x: a, z: l, heading: c, eyeHeight: A }, P), "ease-out");
13979
+ M = x + (v.for ?? 500), m(x, M, Gf({ x: a, z: l, heading: c, eyeHeight: A }, P), "ease-out");
13980
13980
  }
13981
13981
  k.push({ do: v.do, start: x, end: M }), b = M;
13982
13982
  }
13983
13983
  const S = `${n.scene}/${t}`;
13984
13984
  let E = [...u].map(([v, x]) => ({ id: `${t}-${v}`, target: S, property: v, keyframes: jf(x) }));
13985
- return d.length > 0 && E.push({ id: `${t}-gait`, target: S, property: "gait", keyframes: d }), w.length > 0 && (E = Ul(S, E, w, { rest: { mouth: n.pose?.mouth ?? at.mouth ?? 0, mouthWidth: n.pose?.mouthWidth ?? at.mouthWidth ?? 1 } })), { tracks: E, duration: b, beats: k, end: { position: [a, l], heading: c, pose: { ...r } } };
13985
+ return d.length > 0 && E.push({ id: `${t}-gait`, target: S, property: "gait", keyframes: d }), w.length > 0 && (E = Gl(S, E, w, { rest: { mouth: n.pose?.mouth ?? at.mouth ?? 0, mouthWidth: n.pose?.mouthWidth ?? at.mouthWidth ?? 1 } })), { tracks: E, duration: b, beats: k, end: { position: [a, l], heading: c, pose: { ...r } } };
13986
13986
  }
13987
13987
  function g0(t, e, n = [0, 0, 0]) {
13988
13988
  const s = t.filter((r) => r.target === e), o = new Ft({ id: `${e}-position`, tracks: s });
@@ -14008,7 +14008,7 @@ function R4(t, e) {
14008
14008
  const d = i.getStateAtTime(u).values.get(n), f = (g, m) => {
14009
14009
  const y = d?.get(g);
14010
14010
  return typeof y == "number" ? y : m;
14011
- }, p = Uf({ x: f("x", r[0]), z: f("z", r[2]), heading: f("rotateY", 0), eyeHeight: f("y", r[1]) + s * 0.9 }, l(u));
14011
+ }, p = Gf({ x: f("x", r[0]), z: f("z", r[2]), heading: f("rotateY", 0), eyeHeight: f("y", r[1]) + s * 0.9 }, l(u));
14012
14012
  for (const g of c) h[g].push({ time: u, value: p[g] ?? 0 });
14013
14013
  if (u >= e.end) break;
14014
14014
  }
@@ -14087,7 +14087,7 @@ function l5(t, e, n = {}, s) {
14087
14087
  for (const c of l) Zf(t, c, s);
14088
14088
  t.restore();
14089
14089
  }
14090
- function Gf(t, e, n = {}, s) {
14090
+ function Uf(t, e, n = {}, s) {
14091
14091
  const o = n.length ?? 90, r = n.thickness ?? 34;
14092
14092
  t.save(), t.translate(e.x, e.y), t.rotate((n.angle ?? -35) * Math.PI / 180);
14093
14093
  const i = -r / 2;
@@ -14126,7 +14126,7 @@ function Jf(t, e, n = {}, s) {
14126
14126
  prop: {
14127
14127
  depth: k.depth,
14128
14128
  draw: () => {
14129
- t.save(), t.translate(d.x, d.y), t.scale(a, a), o === "eraser" ? Gf(t, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, outline: i }, s) : l5(t, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, length: 190, outline: i }, s), t.restore();
14129
+ t.save(), t.translate(d.x, d.y), t.scale(a, a), o === "eraser" ? Uf(t, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, outline: i }, s) : l5(t, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, length: 190, outline: i }, s), t.restore();
14130
14130
  }
14131
14131
  }
14132
14132
  });
@@ -14247,7 +14247,7 @@ function Y4(t, e) {
14247
14247
  const l = Number(i.props?.erase ?? 0);
14248
14248
  if (r.save(), Qf(r, e.path, n, l), t.draw(r, i, a), r.restore(), !o || l <= 0 || l >= 1) return;
14249
14249
  const c = Ml(e.path, l);
14250
- s ? Jf(r, c, { ...s, tool: "eraser" }) : Gf(r, c, o);
14250
+ s ? Jf(r, c, { ...s, tool: "eraser" }) : Uf(r, c, o);
14251
14251
  }
14252
14252
  };
14253
14253
  }
@@ -14263,7 +14263,7 @@ function uo() {
14263
14263
  const o = t.get(n);
14264
14264
  return o ? [...o].sort((r, i) => r.time - i.time)[o.length - 1].value : s;
14265
14265
  },
14266
- valueAt: (n, s) => Gl(t.get(n), s),
14266
+ valueAt: (n, s) => Ul(t.get(n), s),
14267
14267
  cutAfter(n, s) {
14268
14268
  for (const o of n) t.set(o, (t.get(o) ?? []).filter((r) => r.time <= s));
14269
14269
  },
@@ -14277,7 +14277,7 @@ function uo() {
14277
14277
  }
14278
14278
  };
14279
14279
  }
14280
- function Gl(t, e) {
14280
+ function Ul(t, e) {
14281
14281
  if (!t || t.length === 0) return 0;
14282
14282
  const n = [...t].sort((s, o) => s.time - o.time);
14283
14283
  if (e <= n[0].time) return n[0].value;
@@ -14388,7 +14388,7 @@ const p5 = {
14388
14388
  highlight: "rgba(249, 226, 175, 0.22)",
14389
14389
  strike: "#f38ba8",
14390
14390
  font: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
14391
- }, Ua = ["wipe", "fly", "blur"], Go = {
14391
+ }, Ga = ["wipe", "fly", "blur"], Uo = {
14392
14392
  kind: "code",
14393
14393
  create: "codePanel({ code, language?, x, y, fontSize?, lineHeight?, width?, hidden? })",
14394
14394
  anchors: {
@@ -14412,7 +14412,7 @@ const p5 = {
14412
14412
  function K4(t) {
14413
14413
  const e = { ...p5, ...t.theme }, n = t.code.replace(/\t/g, " ").replace(/\n$/, "").split(`
14414
14414
  `), s = t.fontSize ?? 16, o = (t.lineHeight ?? 1.6) * s, r = (t.charWidth ?? 0.6) * s, i = t.padding ?? 12, a = t.lineNumbers === !1 ? 0 : (String(n.length).length + 2) * r, l = Math.max(1, ...n.map((R) => R.length)), c = t.width ?? i * 2 + a + l * r, h = i * 2 + n.length * o, u = t.x + i + a, d = new Set(t.hidden ?? []), f = t.language ?? "plain";
14415
- if (!Ga.includes(f)) throw new Error(`codePanel: ${dt("language", f, Ga)}`);
14415
+ if (!Ua.includes(f)) throw new Error(`codePanel: ${dt("language", f, Ua)}`);
14416
14416
  const p = n.map((R) => v5(R, f).flatMap((D) => Array.from(D.text, () => e[D.kind]))), g = uo(), m = Jr(g), y = [], k = /* @__PURE__ */ new Map(), w = [], b = [], S = (R) => {
14417
14417
  if (!Number.isInteger(R) || R < 1 || R > n.length) throw new Error(`codePanel: no line ${R} (it has ${n.length})`);
14418
14418
  }, E = g.tween, v = g.last, x = (R, D, Y, _, j, nt = 300) => {
@@ -14462,9 +14462,9 @@ function K4(t) {
14462
14462
  ...w.filter((ot) => ot.line === K).map((ot) => ({ column: ot.column, length: ot.text.length, piece: ot, insert: void 0 })),
14463
14463
  ...b.filter((ot) => ot.line === K).map((ot) => ({ column: ot.column, length: 0, piece: void 0, insert: ot }))
14464
14464
  ].sort((ot, lt) => ot.column - lt.column || ot.length - lt.length);
14465
- let U = 0, et = j;
14465
+ let G = 0, et = j;
14466
14466
  for (const ot of H) {
14467
- $(K, U, Math.min(ot.column, z), et, N), et += (ot.column - U) * r;
14467
+ $(K, G, Math.min(ot.column, z), et, N), et += (ot.column - G) * r;
14468
14468
  let lt = ot.length, st = "";
14469
14469
  if (ot.piece) {
14470
14470
  const Z = ot.piece.written ?? "", rt = _(`piece.${ot.piece.id}.write`);
@@ -14472,9 +14472,9 @@ function K4(t) {
14472
14472
  } else ot.insert && (lt = ot.insert.chars * _(`insert.${ot.insert.id}.open`), ot.insert.text && (st = ot.insert.text.slice(0, Math.round(_(`insert.${ot.insert.id}.type`) * ot.insert.text.length))));
14473
14473
  R.fillStyle = e.text;
14474
14474
  for (let Z = 0; Z < st.length; Z++) st[Z] !== " " && R.fillText(st[Z], et + Z * r, N);
14475
- et += lt * r, U = ot.column + ot.length;
14475
+ et += lt * r, G = ot.column + ot.length;
14476
14476
  }
14477
- $(K, U, Math.max(U, z), et, N);
14477
+ $(K, G, Math.max(G, z), et, N);
14478
14478
  const it = _(`line.${K}.strike`);
14479
14479
  it > 0 && (R.strokeStyle = e.strike, R.lineWidth = Math.max(1.5, s / 10), R.beginPath(), R.moveTo(j, N), R.lineTo(j + X * Math.min(1, it), N), R.stroke()), R.restore();
14480
14480
  });
@@ -14487,7 +14487,7 @@ function K4(t) {
14487
14487
  R.restore();
14488
14488
  }
14489
14489
  }, q = (R) => {
14490
- const { kind: D, rest: Y } = ds(R), _ = (j) => hn("codePanel", R, Go, j);
14490
+ const { kind: D, rest: Y } = ds(R), _ = (j) => hn("codePanel", R, Uo, j);
14491
14491
  if (D === "box") {
14492
14492
  if (Y) throw _("box takes no arguments");
14493
14493
  return { kind: D };
@@ -14518,9 +14518,9 @@ function K4(t) {
14518
14518
  }, tt = (R, D) => {
14519
14519
  if (typeof D.text != "string") throw new Error(`codePanel.edit: ${R} needs \`text\` (the text to write)`);
14520
14520
  return D.text;
14521
- }, G = {
14521
+ }, U = {
14522
14522
  kind: "code",
14523
- about: Go,
14523
+ about: Uo,
14524
14524
  target: W,
14525
14525
  lines: n,
14526
14526
  box: T(t.x, t.y, c, h),
@@ -14537,15 +14537,15 @@ function K4(t) {
14537
14537
  const _ = v(`line.${Y}.highlight`, 0);
14538
14538
  x(Y, "highlight", _, D.on === !1 ? 0 : 1, D, 200);
14539
14539
  }
14540
- return G;
14540
+ return U;
14541
14541
  },
14542
14542
  strike(R, D) {
14543
14543
  for (const Y of P(R)) x(Y, "strike", v(`line.${Y}.strike`, 0), 1, D);
14544
- return G;
14544
+ return U;
14545
14545
  },
14546
14546
  remove(R, D) {
14547
14547
  const Y = P(R), _ = D.style ?? "wipe";
14548
- if (!Ua.includes(_)) throw new Error(`codePanel.remove: ${dt("style", _, Ua)}`);
14548
+ if (!Ga.includes(_)) throw new Error(`codePanel.remove: ${dt("style", _, Ga)}`);
14549
14549
  const j = _ === "wipe" ? 300 : 450, nt = D.at + (D.duration ?? j), $ = D.close ?? 250;
14550
14550
  for (const I of Y)
14551
14551
  x(I, "wipe", 0, 1, { ...D, easing: D.easing ?? (_ === "fly" ? "ease-in" : void 0) }, j), k.set(I, { style: _, from: D.from ?? "left" }), y.push({ line: I, closed: nt + $ });
@@ -14556,16 +14556,16 @@ function K4(t) {
14556
14556
  const K = v(`line.${I}.shift`, 0);
14557
14557
  x(I, "shift", K, K + B, { at: nt, duration: $, easing: "ease-in-out" });
14558
14558
  }
14559
- return G;
14559
+ return U;
14560
14560
  },
14561
14561
  type(R, D) {
14562
- return x(R, "reveal", 0, 1, { duration: n[R - 1].length * 45, ...D }), G;
14562
+ return x(R, "reveal", 0, 1, { duration: n[R - 1].length * 45, ...D }), U;
14563
14563
  },
14564
14564
  piece(R, D, Y = 1) {
14565
14565
  if (typeof R == "string") {
14566
14566
  const I = q(R);
14567
14567
  if (I.kind !== "token") throw new Error(`codePanel.piece: a piece is a word, token:N:TEXT, not "${R}"`);
14568
- return G.piece(I.n, I.text, I.occurrence);
14568
+ return U.piece(I.n, I.text, I.occurrence);
14569
14569
  }
14570
14570
  const _ = R;
14571
14571
  if (D === void 0) throw new Error('codePanel.piece: which word? piece(n, text) or piece("token:N:TEXT")');
@@ -14574,22 +14574,22 @@ function K4(t) {
14574
14574
  if (nt) return nt;
14575
14575
  if (w.some((I) => I.line === _ && j < I.column + I.text.length && I.column < j + D.length))
14576
14576
  throw new Error(`codePanel: "${D}" on line ${_} overlaps another piece`);
14577
- const $ = { id: w.length + 1, line: _, column: j, text: D, home: G.token(_, D, Y, 0) };
14577
+ const $ = { id: w.length + 1, line: _, column: j, text: D, home: U.token(_, D, Y, 0) };
14578
14578
  w.push($);
14579
14579
  for (const I of ["x", "y", "rotate", "write", "away"]) C[`piece.${$.id}.${I}`] = 0;
14580
14580
  return C[`piece.${$.id}.opacity`] = 1, $;
14581
14581
  },
14582
14582
  follow(R, D) {
14583
- return m.follow(R, D), G;
14583
+ return m.follow(R, D), U;
14584
14584
  },
14585
14585
  fling(R, D) {
14586
- return m.fling(R, D), G;
14586
+ return m.fling(R, D), U;
14587
14587
  },
14588
14588
  move(R, D) {
14589
- return m.move(R, D), G;
14589
+ return m.move(R, D), U;
14590
14590
  },
14591
14591
  write(R, D, Y) {
14592
- return R.written = D, E(`piece.${R.id}.write`, 0, 1, { duration: Math.max(1, D.length) * 70, ...Y }), G;
14592
+ return R.written = D, E(`piece.${R.id}.write`, 0, 1, { duration: Math.max(1, D.length) * 70, ...Y }), U;
14593
14593
  },
14594
14594
  spot(R, D, Y = 1, _ = 1 / 0) {
14595
14595
  S(R);
@@ -14601,59 +14601,59 @@ function K4(t) {
14601
14601
  const j = { id: b.length + 1, line: R, column: D, chars: Y.length, text: Y, at: _.at };
14602
14602
  b.push(j), C[`insert.${j.id}.open`] = 0, C[`insert.${j.id}.type`] = 0;
14603
14603
  const nt = _.duration ?? Y.length * 70;
14604
- return E(`insert.${j.id}.open`, 0, 1, { at: _.at, duration: nt * 0.6, easing: "ease-out" }), E(`insert.${j.id}.type`, 0, 1, { at: _.at, duration: nt }), G;
14604
+ return E(`insert.${j.id}.open`, 0, 1, { at: _.at, duration: nt * 0.6, easing: "ease-out" }), E(`insert.${j.id}.type`, 0, 1, { at: _.at, duration: nt }), U;
14605
14605
  },
14606
14606
  drop(R, D, Y, _) {
14607
14607
  S(D);
14608
- const j = _.duration ?? 250, nt = D === R.line, $ = _.easing ?? (nt ? "linear" : "ease-out"), I = G.landing(R, D, Y, _.at), B = { id: b.length + 1, line: D, column: Y, chars: R.text.length, at: _.at };
14609
- return b.push(B), C[`insert.${B.id}.open`] = 0, E(`insert.${B.id}.open`, 0, 1, { at: _.at, duration: j, easing: nt ? $ : "ease-out" }), E(`piece.${R.id}.away`, v(`piece.${R.id}.away`, 0), 1, { at: _.at, duration: j, easing: nt ? $ : "ease-in-out" }), m.cutAfter(R, _.at), G.move(R, { at: _.at, duration: j, easing: $, to: { x: I.x, y: I.y } }), E(`piece.${R.id}.rotate`, g.valueAt(`piece.${R.id}.rotate`, _.at), 0, { at: _.at, duration: j }), G;
14608
+ const j = _.duration ?? 250, nt = D === R.line, $ = _.easing ?? (nt ? "linear" : "ease-out"), I = U.landing(R, D, Y, _.at), B = { id: b.length + 1, line: D, column: Y, chars: R.text.length, at: _.at };
14609
+ return b.push(B), C[`insert.${B.id}.open`] = 0, E(`insert.${B.id}.open`, 0, 1, { at: _.at, duration: j, easing: nt ? $ : "ease-out" }), E(`piece.${R.id}.away`, v(`piece.${R.id}.away`, 0), 1, { at: _.at, duration: j, easing: nt ? $ : "ease-in-out" }), m.cutAfter(R, _.at), U.move(R, { at: _.at, duration: j, easing: $, to: { x: I.x, y: I.y } }), E(`piece.${R.id}.rotate`, g.valueAt(`piece.${R.id}.rotate`, _.at), 0, { at: _.at, duration: j }), U;
14610
14610
  },
14611
14611
  landing(R, D, Y, _ = 1 / 0) {
14612
- const j = G.spot(D, Y, R.text.length, _), nt = D === R.line && Y > R.column ? R.text.length * r : 0;
14612
+ const j = U.spot(D, Y, R.text.length, _), nt = D === R.line && Y > R.column ? R.text.length * r : 0;
14613
14613
  return T(j.left - nt, j.top, j.width, j.height);
14614
14614
  },
14615
14615
  ride(R, D, Y) {
14616
14616
  const _ = n.map((j, nt) => {
14617
14617
  const $ = g.keys(`line.${nt + 1}.shift`) ?? [];
14618
- return { top: A(nt + 1), offset: (I) => -Gl($, I) * o, windows: Qs($) };
14618
+ return { top: A(nt + 1), offset: (I) => -Ul($, I) * o, windows: Qs($) };
14619
14619
  });
14620
14620
  return Vl(R, D, { ground: Y.ground, every: Y.every ?? cn, floors: _ });
14621
14621
  },
14622
14622
  tracks: g.tracks,
14623
14623
  anchor(R, D = 1 / 0) {
14624
14624
  const Y = q(R);
14625
- return Y.kind === "box" ? G.box : Y.kind === "line" ? G.line(Y.n, D) : Y.kind === "token" ? G.token(Y.n, Y.text, Y.occurrence, D) : G.spot(Y.n, Y.column, Y.width, D);
14625
+ return Y.kind === "box" ? U.box : Y.kind === "line" ? U.line(Y.n, D) : Y.kind === "token" ? U.token(Y.n, Y.text, Y.occurrence, D) : U.spot(Y.n, Y.column, Y.width, D);
14626
14626
  },
14627
14627
  edit(R, D, Y) {
14628
14628
  const _ = () => V(R, D, "line").map((j) => j.n);
14629
- if (R === "highlight") return G.highlight(_(), Y);
14630
- if (R === "strike") return G.strike(_(), Y);
14631
- if (R === "remove") return G.remove(_(), Y);
14629
+ if (R === "highlight") return U.highlight(_(), Y);
14630
+ if (R === "strike") return U.strike(_(), Y);
14631
+ if (R === "remove") return U.remove(_(), Y);
14632
14632
  if (R === "type") {
14633
- for (const j of _()) G.type(j, Y);
14634
- return G;
14633
+ for (const j of _()) U.type(j, Y);
14634
+ return U;
14635
14635
  }
14636
14636
  if (R === "insert") {
14637
14637
  const [j] = V(R, D, "spot", !0);
14638
- return G.insert(j.n, j.column, tt(R, Y), Y);
14638
+ return U.insert(j.n, j.column, tt(R, Y), Y);
14639
14639
  }
14640
14640
  if (R === "write" || R === "drop" || R === "move" || R === "fling") {
14641
- const [j] = V(R, D, "token", !0), nt = G.piece(j.n, j.text, j.occurrence);
14642
- if (R === "write") return G.write(nt, tt(R, Y), Y);
14643
- if (R === "fling") return G.fling(nt, Y);
14641
+ const [j] = V(R, D, "token", !0), nt = U.piece(j.n, j.text, j.occurrence);
14642
+ if (R === "write") return U.write(nt, tt(R, Y), Y);
14643
+ if (R === "fling") return U.fling(nt, Y);
14644
14644
  if (R === "drop") {
14645
14645
  const I = typeof Y.into == "string" ? q(Y.into) : void 0;
14646
14646
  if (I?.kind !== "spot") throw new Error("codePanel.edit: drop needs `into`, a spot anchor (spot:N:C)");
14647
- return G.drop(nt, I.n, I.column, Y);
14647
+ return U.drop(nt, I.n, I.column, Y);
14648
14648
  }
14649
- const $ = typeof Y.to == "string" ? G.anchor(Y.to, Y.at) : Y.to;
14649
+ const $ = typeof Y.to == "string" ? U.anchor(Y.to, Y.at) : Y.to;
14650
14650
  if (!$ || typeof $.x != "number" || typeof $.y != "number") throw new Error("codePanel.edit: move needs `to`, an anchor name or { x, y }");
14651
- return G.move(nt, { ...Y, to: $ });
14651
+ return U.move(nt, { ...Y, to: $ });
14652
14652
  }
14653
- throw Zr("codePanel", R, Go);
14653
+ throw Zr("codePanel", R, Uo);
14654
14654
  }
14655
14655
  };
14656
- return G;
14656
+ return U;
14657
14657
  }
14658
14658
  function b5(t, e, n, s, o) {
14659
14659
  if (e.style === "wipe") {
@@ -14717,7 +14717,7 @@ const xr = {
14717
14717
  plain: []
14718
14718
  };
14719
14719
  xr.typescript = [...xr.javascript, "enum", "interface", "type", "implements", "private", "public", "readonly", "keyof", "as", "declare", "namespace"];
14720
- const Ga = Object.keys(xr), k5 = {
14720
+ const Ua = Object.keys(xr), k5 = {
14721
14721
  go: "//",
14722
14722
  rust: "//",
14723
14723
  csharp: "//",
@@ -15161,7 +15161,7 @@ const x0 = ["bar", "line", "pie", "donut"], S0 = 'system-ui, -apple-system, "Seg
15161
15161
  pull: "slice anchors; { at, duration?, on? }: pull the slice out from the centre (on: false puts it back)"
15162
15162
  }
15163
15163
  }, $5 = 600, P5 = 500, O5 = 200, I5 = 400, _5 = 0.14, C5 = Math.PI * 2;
15164
- function U4(t) {
15164
+ function G4(t) {
15165
15165
  if (!x0.includes(t.kind)) throw new Error(`chart: ${dt("kind", t.kind, x0)}`);
15166
15166
  const e = typeof t.theme == "string" ? t.theme : "light";
15167
15167
  if (!(e in Co)) throw new Error(`chart: ${dt("theme", e, Object.keys(Co))}`);
@@ -15175,46 +15175,46 @@ function U4(t) {
15175
15175
  if (a.has(H.id)) throw new Error(`chart: two series are called "${H.id}"`);
15176
15176
  a.add(H.id);
15177
15177
  }
15178
- const l = new Map(i.map((H, U) => [H.id, U])), c = (H) => i[l.get(H)].color ?? (l.get(H) === 0 ? n.color : n.palette[l.get(H) % n.palette.length]), h = /* @__PURE__ */ new Set(), u = (H, U) => {
15179
- const et = H.values?.[U.id] ?? (t.series ? void 0 : H.value) ?? H.value;
15178
+ const l = new Map(i.map((H, G) => [H.id, G])), c = (H) => i[l.get(H)].color ?? (l.get(H) === 0 ? n.color : n.palette[l.get(H) % n.palette.length]), h = /* @__PURE__ */ new Set(), u = (H, G) => {
15179
+ const et = H.values?.[G.id] ?? (t.series ? void 0 : H.value) ?? H.value;
15180
15180
  if (typeof et != "number" || !Number.isFinite(et))
15181
- throw new Error(r ? `chart: "${H.id}" needs a value for series "${U.id}" (\`values: { ${U.id}: … }\`)` : `chart: "${H.id}" needs a \`value\`, a number`);
15181
+ throw new Error(r ? `chart: "${H.id}" needs a value for series "${G.id}" (\`values: { ${G.id}: … }\`)` : `chart: "${H.id}" needs a \`value\`, a number`);
15182
15182
  return et;
15183
15183
  };
15184
15184
  for (const H of t.data) {
15185
15185
  if (typeof H?.id != "string" || !H.id || /[:.]/.test(H.id)) throw new Error(`chart: every datum needs an \`id\` without ":" or "." (got ${JSON.stringify(H?.id)})`);
15186
15186
  if (h.has(H.id)) throw new Error(`chart: two data are called "${H.id}"`);
15187
- for (const U of i) u(H, U);
15187
+ for (const G of i) u(H, G);
15188
15188
  h.add(H.id);
15189
15189
  }
15190
- const d = s === "bar" ? "bar" : s === "line" ? "point" : "slice", f = Math.max(...t.data.flatMap((H) => i.map((U) => u(H, U)))), p = o ? t.data.reduce((H, U) => H + u(U, i[0]), 0) : t.max ?? H5(f * 1.1);
15190
+ const d = s === "bar" ? "bar" : s === "line" ? "point" : "slice", f = Math.max(...t.data.flatMap((H) => i.map((G) => u(H, G)))), p = o ? t.data.reduce((H, G) => H + u(G, i[0]), 0) : t.max ?? H5(f * 1.1);
15191
15191
  if (!o && !(p > 0)) throw new Error(`chart: \`max\` must be above 0 (got ${p})`);
15192
15192
  const g = Math.max(10, Math.min(16, t.height / 20)), m = r && t.legend !== !1, y = o ? void 0 : t.axis?.x, k = o ? void 0 : t.axis?.y, w = t.title ? g * 2.3 : g * 0.5, b = {
15193
15193
  left: g * 3.6 + (k ? g * 1.5 : 0),
15194
15194
  right: t.width - g,
15195
15195
  top: (t.title ? g * 3 : g * 1.6) + (m ? g * 1.6 : 0),
15196
15196
  bottom: t.height - g * 2.4 - (y ? g * 1.4 : 0)
15197
- }, S = b.bottom - b.top, E = (b.right - b.left) / t.data.length, v = r ? E * 0.72 / i.length : E * 0.6, x = r ? v * 0.86 : v, M = Math.max(4, g * 0.35), T = S / p, A = new Map(t.data.map((H, U) => [H.id, U])), P = (H) => b.left + E * (A.get(H) + 0.5), O = (H, U) => r ? P(H) - E * 0.36 + v * l.get(U) + (v - x) / 2 : P(H) - x / 2, C = (H, U) => O(H, U) + x / 2, W = t.height - g * 1.2, q = {
15197
+ }, S = b.bottom - b.top, E = (b.right - b.left) / t.data.length, v = r ? E * 0.72 / i.length : E * 0.6, x = r ? v * 0.86 : v, M = Math.max(4, g * 0.35), T = S / p, A = new Map(t.data.map((H, G) => [H.id, G])), P = (H) => b.left + E * (A.get(H) + 0.5), O = (H, G) => r ? P(H) - E * 0.36 + v * l.get(G) + (v - x) / 2 : P(H) - x / 2, C = (H, G) => O(H, G) + x / 2, W = t.height - g * 1.2, q = {
15198
15198
  cx: t.width / 2,
15199
15199
  cy: (b.top + W) / 2,
15200
15200
  r: Math.max(10, Math.min(t.width / 2, (W - b.top) / 2) - g * 2.6)
15201
- }, V = s === "donut" ? q.r * 0.55 : 0, tt = s === "donut" ? (V + q.r) / 2 : q.r * 0.62, G = /* @__PURE__ */ new Map();
15201
+ }, V = s === "donut" ? q.r * 0.55 : 0, tt = s === "donut" ? (V + q.r) / 2 : q.r * 0.62, U = /* @__PURE__ */ new Map();
15202
15202
  if (m) {
15203
15203
  let H = b.right;
15204
- for (const U of [...i].reverse()) {
15205
- const et = U.label ?? U.id, it = g * 0.62 * et.length + g * 1.9;
15206
- G.set(U.id, kt(H - it, w, it, g * 1.4)), H -= it + g * 0.6;
15204
+ for (const G of [...i].reverse()) {
15205
+ const et = G.label ?? G.id, it = g * 0.62 * et.length + g * 1.9;
15206
+ U.set(G.id, kt(H - it, w, it, g * 1.4)), H -= it + g * 0.6;
15207
15207
  }
15208
15208
  }
15209
- const R = uo(), D = Jr(R), Y = {}, _ = (H, U, et) => r ? `${d}.${H}.${U}.${et}` : `${d}.${H}.${et}`;
15209
+ const R = uo(), D = Jr(R), Y = {}, _ = (H, G, et) => r ? `${d}.${H}.${G}.${et}` : `${d}.${H}.${et}`;
15210
15210
  for (const H of t.data)
15211
- for (const U of i)
15212
- Y[_(H.id, U.id, "value")] = u(H, U), Y[_(H.id, U.id, "show")] = H.hidden ? 0 : 1, Y[_(H.id, U.id, "highlight")] = 0, o && (Y[_(H.id, U.id, "pull")] = 0);
15213
- const j = (H, U) => R.keys(H)?.length ? Gl(R.keys(H), U) : Y[H], nt = (H, U, et) => j(_(H, U, "value"), et) * (s === "bar" ? j(_(H, U, "show"), et) : 1) * T, $ = (H) => {
15214
- const U = i[0].id, et = t.data.map((st) => Math.max(0, H(_(st.id, U, "value"))) * Math.max(0, Math.min(1, H(_(st.id, U, "show"))))), it = et.reduce((st, Z) => st + Z, 0), ot = /* @__PURE__ */ new Map();
15211
+ for (const G of i)
15212
+ Y[_(H.id, G.id, "value")] = u(H, G), Y[_(H.id, G.id, "show")] = H.hidden ? 0 : 1, Y[_(H.id, G.id, "highlight")] = 0, o && (Y[_(H.id, G.id, "pull")] = 0);
15213
+ const j = (H, G) => R.keys(H)?.length ? Ul(R.keys(H), G) : Y[H], nt = (H, G, et) => j(_(H, G, "value"), et) * (s === "bar" ? j(_(H, G, "show"), et) : 1) * T, $ = (H) => {
15214
+ const G = i[0].id, et = t.data.map((st) => Math.max(0, H(_(st.id, G, "value"))) * Math.max(0, Math.min(1, H(_(st.id, G, "show"))))), it = et.reduce((st, Z) => st + Z, 0), ot = /* @__PURE__ */ new Map();
15215
15215
  let lt = -Math.PI / 2;
15216
15216
  return t.data.forEach((st, Z) => {
15217
- const rt = it > 0 ? C5 * et[Z] / it : 0, ct = lt + rt / 2, ut = Math.max(0, Math.min(1, H(_(st.id, U, "pull")))) * q.r * _5;
15217
+ const rt = it > 0 ? C5 * et[Z] / it : 0, ct = lt + rt / 2, ut = Math.max(0, Math.min(1, H(_(st.id, G, "pull")))) * q.r * _5;
15218
15218
  ot.set(st.id, {
15219
15219
  start: lt,
15220
15220
  sweep: rt,
@@ -15223,43 +15223,43 @@ function U4(t) {
15223
15223
  centre: { x: q.cx + Math.cos(ct) * (tt + ut), y: q.cy + Math.sin(ct) * (tt + ut) }
15224
15224
  }), lt += rt;
15225
15225
  }), ot;
15226
- }, I = (H) => $((U) => j(U, H)), B = (H) => {
15227
- const { kind: U, rest: et } = ds(H), it = (ot) => hn("chart", H, jn, ot);
15228
- if (U === "box") {
15226
+ }, I = (H) => $((G) => j(G, H)), B = (H) => {
15227
+ const { kind: G, rest: et } = ds(H), it = (ot) => hn("chart", H, jn, ot);
15228
+ if (G === "box") {
15229
15229
  if (et) throw it("box takes no arguments");
15230
15230
  return { kind: "box" };
15231
15231
  }
15232
- if (U === "legend") {
15233
- if (!G.has(et)) throw it(m ? `there is no series "${et}" (series: ${i.map((ot) => ot.id).join(", ")})` : "only a chart with several series has a legend");
15232
+ if (G === "legend") {
15233
+ if (!U.has(et)) throw it(m ? `there is no series "${et}" (series: ${i.map((ot) => ot.id).join(", ")})` : "only a chart with several series has a legend");
15234
15234
  return { kind: "legend", series: et };
15235
15235
  }
15236
- if (U === "bar" || U === "point" || U === "slice" || U === "label" || U === "value") {
15237
- if (!et) throw it(`write it ${U}:ID`);
15236
+ if (G === "bar" || G === "point" || G === "slice" || G === "label" || G === "value") {
15237
+ if (!et) throw it(`write it ${G}:ID`);
15238
15238
  const ot = et.indexOf(":"), lt = ot < 0 ? et : et.slice(0, ot), st = ot < 0 ? i[0].id : et.slice(ot + 1);
15239
15239
  if (!A.has(lt)) throw it(`there is no "${lt}" (data: ${[...A.keys()].join(", ")})`);
15240
15240
  if (!a.has(st)) throw it(`there is no series "${st}" (series: ${i.map((Z) => Z.id).join(", ")})`);
15241
- if (U === "label" && ot >= 0) throw it("a label is one per datum: label:ID");
15242
- if ((U === "bar" || U === "point" || U === "slice") && U !== d) throw it(`a ${s} chart has ${d}s, not ${U}s: ${d}:${lt}`);
15243
- return { kind: U, id: lt, series: st };
15241
+ if (G === "label" && ot >= 0) throw it("a label is one per datum: label:ID");
15242
+ if ((G === "bar" || G === "point" || G === "slice") && G !== d) throw it(`a ${s} chart has ${d}s, not ${G}s: ${d}:${lt}`);
15243
+ return { kind: G, id: lt, series: st };
15244
15244
  }
15245
15245
  throw it();
15246
- }, K = (H, U) => {
15246
+ }, K = (H, G) => {
15247
15247
  if (H.kind === "box") return kt(0, 0, t.width, t.height);
15248
- if (H.kind === "legend") return G.get(H.series);
15248
+ if (H.kind === "legend") return U.get(H.series);
15249
15249
  if (o) {
15250
- const st = I(U).get(H.id), Z = Math.max(g * 1.5, q.r * 0.42);
15250
+ const st = I(G).get(H.id), Z = Math.max(g * 1.5, q.r * 0.42);
15251
15251
  if (H.kind === "slice") return kt(st.centre.x - Z / 2, st.centre.y - Z / 2, Z, Z);
15252
15252
  const rt = L(st);
15253
15253
  return H.kind === "label" ? rt : st.sweep >= 0.3 ? kt(st.centre.x - g * 1.6, st.centre.y - g * 0.65, g * 3.2, g * 1.3) : kt(rt.left, rt.bottom, rt.width, g * 1.3);
15254
15254
  }
15255
- const et = H.kind === "label" ? P(H.id) : C(H.id, H.series), it = b.bottom - nt(H.id, H.series, U);
15255
+ const et = H.kind === "label" ? P(H.id) : C(H.id, H.series), it = b.bottom - nt(H.id, H.series, G);
15256
15256
  if (H.kind === "bar") return kt(et - x / 2, it, x, b.bottom - it);
15257
15257
  if (H.kind === "point") return kt(P(H.id) - M, it - M, M * 2, M * 2);
15258
15258
  if (H.kind === "label") return kt(et - E / 2, b.bottom + g * 0.4, E, g * 1.4);
15259
15259
  const ot = it - (s === "line" ? M : 0) - g * 0.3, lt = r && s === "bar" ? v : E;
15260
15260
  return kt((s === "line" ? P(H.id) : et) - lt / 2, ot - g * 1.3, lt, g * 1.3);
15261
15261
  }, L = (H) => {
15262
- const U = q.r + H.out + g * 0.9, et = { x: q.cx + Math.cos(H.mid) * U, y: q.cy + Math.sin(H.mid) * U }, it = g * 4.2, ot = Math.cos(H.mid), lt = ot > 0.2 ? et.x : ot < -0.2 ? et.x - it : et.x - it / 2;
15262
+ const G = q.r + H.out + g * 0.9, et = { x: q.cx + Math.cos(H.mid) * G, y: q.cy + Math.sin(H.mid) * G }, it = g * 4.2, ot = Math.cos(H.mid), lt = ot > 0.2 ? et.x : ot < -0.2 ? et.x - it : et.x - it / 2;
15263
15263
  return kt(lt, et.y - g * 0.7, it, g * 1.4);
15264
15264
  }, F = (H) => kt(t.x + H.left, t.y + H.top, H.width, H.height), N = (H) => `${t.prefix ?? ""}${H.toFixed(t.decimals ?? 0)}${t.suffix ?? ""}`, X = /* @__PURE__ */ new Map(), z = {
15265
15265
  type: "custom",
@@ -15274,12 +15274,12 @@ function U4(t) {
15274
15274
  props: Object.fromEntries(Object.keys(Y).map((H) => [H, L5(H)])),
15275
15275
  actions: jn.edits
15276
15276
  },
15277
- draw(H, U) {
15278
- const et = U.props ?? {}, it = (st) => Number(et[st] ?? Y[st] ?? 0);
15277
+ draw(H, G) {
15278
+ const et = G.props ?? {}, it = (st) => Number(et[st] ?? Y[st] ?? 0);
15279
15279
  if (H.save(), H.fillStyle = n.background, T0(H, 0, 0, t.width, t.height, 8), H.fill(), H.font = `${g}px ${n.font}`, H.textBaseline = "middle", t.title && (H.fillStyle = n.text, H.textAlign = "left", H.font = `600 ${g * 1.2}px ${n.font}`, H.fillText(t.title, o ? g : b.left, g * 1.5), H.font = `${g}px ${n.font}`), m) {
15280
15280
  H.textAlign = "left";
15281
15281
  for (const st of i) {
15282
- const Z = G.get(st.id);
15282
+ const Z = U.get(st.id);
15283
15283
  H.fillStyle = c(st.id), T0(H, Z.left, Z.top + g * 0.25, g * 0.9, g * 0.9, 2), H.fill(), H.fillStyle = n.text, H.fillText(st.label ?? st.id, Z.left + g * 1.3, Z.top + Z.height / 2);
15284
15284
  }
15285
15285
  }
@@ -15324,20 +15324,20 @@ function U4(t) {
15324
15324
  H.strokeStyle = n.text, H.lineWidth = 1.5, H.beginPath(), H.moveTo(b.left, b.bottom), H.lineTo(b.right, b.bottom), H.stroke(), H.restore();
15325
15325
  }
15326
15326
  };
15327
- function J(H, U) {
15328
- const et = i[0].id, it = $(U);
15327
+ function J(H, G) {
15328
+ const et = i[0].id, it = $(G);
15329
15329
  t.data.forEach((ot, lt) => {
15330
15330
  const st = it.get(ot.id);
15331
15331
  if (st.sweep <= 1e-4) return;
15332
- const Z = X.get(ot.id), rt = Z ? { x: U(`piece.${Z.id}.x`), y: U(`piece.${Z.id}.y`) } : { x: 0, y: 0 }, ct = Z ? U(`piece.${Z.id}.rotate`) * Math.PI / 180 : 0, ut = Z ? U(`piece.${Z.id}.opacity`) : 1;
15332
+ const Z = X.get(ot.id), rt = Z ? { x: G(`piece.${Z.id}.x`), y: G(`piece.${Z.id}.y`) } : { x: 0, y: 0 }, ct = Z ? G(`piece.${Z.id}.rotate`) * Math.PI / 180 : 0, ut = Z ? G(`piece.${Z.id}.opacity`) : 1;
15333
15333
  if (ut <= 0) return;
15334
15334
  H.save(), H.globalAlpha = ut;
15335
15335
  const yt = { x: q.cx + Math.cos(st.mid) * st.out, y: q.cy + Math.sin(st.mid) * st.out };
15336
- H.translate(st.centre.x + rt.x, st.centre.y + rt.y), H.rotate(ct), H.translate(-st.centre.x, -st.centre.y), H.beginPath(), H.arc(yt.x, yt.y, q.r, st.start, st.start + st.sweep), V > 0 ? H.arc(yt.x, yt.y, V, st.start + st.sweep, st.start, !0) : H.lineTo(yt.x, yt.y), H.closePath(), H.fillStyle = Ki(n.palette[lt % n.palette.length], n.highlight, U(_(ot.id, et, "highlight"))), H.fill(), H.strokeStyle = n.background, H.lineWidth = Math.max(1.5, g * 0.15), H.stroke(), t.values !== !1 && st.sweep >= 0.3 && (H.fillStyle = n.background, H.font = `600 ${g}px ${n.font}`, H.textAlign = "center", H.fillText(N(U(_(ot.id, et, "value"))), st.centre.x, st.centre.y), H.font = `${g}px ${n.font}`), H.restore();
15336
+ H.translate(st.centre.x + rt.x, st.centre.y + rt.y), H.rotate(ct), H.translate(-st.centre.x, -st.centre.y), H.beginPath(), H.arc(yt.x, yt.y, q.r, st.start, st.start + st.sweep), V > 0 ? H.arc(yt.x, yt.y, V, st.start + st.sweep, st.start, !0) : H.lineTo(yt.x, yt.y), H.closePath(), H.fillStyle = Ki(n.palette[lt % n.palette.length], n.highlight, G(_(ot.id, et, "highlight"))), H.fill(), H.strokeStyle = n.background, H.lineWidth = Math.max(1.5, g * 0.15), H.stroke(), t.values !== !1 && st.sweep >= 0.3 && (H.fillStyle = n.background, H.font = `600 ${g}px ${n.font}`, H.textAlign = "center", H.fillText(N(G(_(ot.id, et, "value"))), st.centre.x, st.centre.y), H.font = `${g}px ${n.font}`), H.restore();
15337
15337
  const bt = L(st), re = Math.cos(st.mid);
15338
15338
  H.globalAlpha = ut, H.fillStyle = n.text, H.textAlign = re > 0.2 ? "left" : re < -0.2 ? "right" : "center";
15339
15339
  const ps = re > 0.2 ? bt.left : re < -0.2 ? bt.right : bt.left + bt.width / 2;
15340
- H.fillText(ot.label ?? ot.id, ps, bt.top + bt.height / 2), t.values !== !1 && st.sweep < 0.3 && (H.globalAlpha = ut * 0.8, H.fillText(N(U(_(ot.id, et, "value"))), ps, bt.bottom + g * 0.65)), H.globalAlpha = 1;
15340
+ H.fillText(ot.label ?? ot.id, ps, bt.top + bt.height / 2), t.values !== !1 && st.sweep < 0.3 && (H.globalAlpha = ut * 0.8, H.fillText(N(G(_(ot.id, et, "value"))), ps, bt.bottom + g * 0.65)), H.globalAlpha = 1;
15341
15341
  });
15342
15342
  }
15343
15343
  const Q = {
@@ -15347,22 +15347,22 @@ function U4(t) {
15347
15347
  target: z,
15348
15348
  max: p,
15349
15349
  box: kt(t.x, t.y, t.width, t.height),
15350
- anchor(H, U = 1 / 0) {
15351
- return F(K(B(H), U));
15350
+ anchor(H, G = 1 / 0) {
15351
+ return F(K(B(H), G));
15352
15352
  },
15353
15353
  piece(H) {
15354
- const U = B(H);
15355
- if (U.kind !== "slice")
15354
+ const G = B(H);
15355
+ if (G.kind !== "slice")
15356
15356
  throw new Error(o ? `chart: a piece is a slice, slice:ID, not "${H}"` : `chart: a ${d} is not a piece; slices of a pie or donut are (slice:ID). Change a ${d} with edit('set' | 'show' | 'highlight', …)`);
15357
- const et = X.get(U.id);
15357
+ const et = X.get(G.id);
15358
15358
  if (et) return et;
15359
- const it = { id: X.size + 1, datum: U.id, home: F(K(U, 0)) };
15360
- X.set(U.id, it);
15359
+ const it = { id: X.size + 1, datum: G.id, home: F(K(G, 0)) };
15360
+ X.set(G.id, it);
15361
15361
  for (const ot of ["x", "y", "rotate"]) Y[`piece.${it.id}.${ot}`] = 0;
15362
15362
  return Y[`piece.${it.id}.opacity`] = 1, it;
15363
15363
  },
15364
- edit(H, U, et) {
15365
- const it = Array.isArray(U) ? U : [U];
15364
+ edit(H, G, et) {
15365
+ const it = Array.isArray(G) ? G : [G];
15366
15366
  if (it.length === 0) throw new Error(`chart.edit: ${H} takes at least one anchor`);
15367
15367
  if (!(H in jn.edits)) throw Zr("chart", H, jn);
15368
15368
  if (H === "pull" && !o) throw new Error(`chart.edit: pull takes slice anchors of a pie or donut; a ${s} chart has ${d}s`);
@@ -15380,16 +15380,16 @@ function U4(t) {
15380
15380
  }
15381
15381
  return Q;
15382
15382
  },
15383
- follow(H, U) {
15384
- return D.follow(H, U), Q;
15383
+ follow(H, G) {
15384
+ return D.follow(H, G), Q;
15385
15385
  },
15386
- fling(H, U) {
15387
- return D.fling(H, U), Q;
15386
+ fling(H, G) {
15387
+ return D.fling(H, G), Q;
15388
15388
  },
15389
- move(H, U) {
15390
- return D.move(H, U), Q;
15389
+ move(H, G) {
15390
+ return D.move(H, G), Q;
15391
15391
  },
15392
- ride(H, U, et) {
15392
+ ride(H, G, et) {
15393
15393
  if (s !== "bar") return H;
15394
15394
  const it = t.data.flatMap(
15395
15395
  (ot) => i.map((lt) => {
@@ -15397,7 +15397,7 @@ function U4(t) {
15397
15397
  return { top: t.y + b.bottom - st, offset: (rt) => st - nt(ot.id, lt.id, rt), windows: Z };
15398
15398
  })
15399
15399
  );
15400
- return Vl(H, U, { ground: et.ground, every: et.every ?? cn, floors: it });
15400
+ return Vl(H, G, { ground: et.ground, every: et.every ?? cn, floors: it });
15401
15401
  },
15402
15402
  tracks: R.tracks
15403
15403
  };
@@ -15504,7 +15504,7 @@ const Sr = {
15504
15504
  outfit: { shirt: "#ae7396", trousers: "#648769", sleeves: "short", bottom: "skirt" }
15505
15505
  }
15506
15506
  };
15507
- function G4(t, e = {}) {
15507
+ function U4(t, e = {}) {
15508
15508
  if (!Object.prototype.hasOwnProperty.call(Sr, t)) throw new Error(`softCartoonCharacter: unknown actor '${t}'`);
15509
15509
  const n = Sr[t], s = { ...n.body };
15510
15510
  return e.body?.measurements !== void 0 && delete s.torso, ho({ ...n, ...e, body: { ...s, ...e.body }, face: { ...n.face, ...e.face } });
@@ -15873,7 +15873,7 @@ function Z4(t, e, n, s = {}) {
15873
15873
  const k = y ? a ? 1 : 0.62 : a ? 3 : 3.38;
15874
15874
  let w = { ...at, ...m.pose, turn: k, lean: (m.pose?.lean ?? 0) + o.lean };
15875
15875
  const b = y ? 1 : -1, S = (E, v, x) => {
15876
- w = Ue(m.character, w, E, { x: c.x + v - m.x, y: c.y, depth: x });
15876
+ w = Ge(m.character, w, E, { x: c.x + v - m.x, y: c.y, depth: x });
15877
15877
  };
15878
15878
  if (t === "handOver") {
15879
15879
  const E = A0 * l;
@@ -15899,7 +15899,7 @@ function tT(t, e, n = {}) {
15899
15899
  const y = m ? r ? 1 : 0.62 : r ? 3 : 3.38, k = m ? 1 : -1;
15900
15900
  let w = { ...at, ...p.pose, turn: y, lean: (p.pose?.lean ?? 0) + Va.lean, "head.tilt": (p.pose?.["head.tilt"] ?? 0) + k * Va.tilt };
15901
15901
  const { over: b, round: S } = a(p, g, k);
15902
- return w = Ue(p.character, w, "arm.right", b), w = Ue(p.character, w, "arm.left", S), w;
15902
+ return w = Ge(p.character, w, "arm.right", b), w = Ge(p.character, w, "arm.left", S), w;
15903
15903
  }, c = l(s, o, !0), h = l(o, s, !1), u = 0.05 * i, d = (p, g, m, y) => {
15904
15904
  const k = ye(p.character, y).points, { over: w, round: b } = a(p, g, m);
15905
15905
  return Math.hypot(k["hand.right"].x - w.x, k["hand.right"].y - w.y) < u && Math.hypot(k["hand.left"].x - b.x, k["hand.left"].y - b.y) < u;
@@ -15913,10 +15913,10 @@ function eT(t, e) {
15913
15913
  function nT(t, e, n, s = {}) {
15914
15914
  const o = Math.max(0, Math.min(1, n)), r = s.view === "side", i = t.x <= e.x, a = Math.min(t.character.height, e.character.height), l = { x: (t.x + e.x) / 2, y: -(Yn.low + (Yn.high - Yn.low) * o) * a }, c = (m) => m ? r ? 1 : 0.62 : r ? 3 : 3.38;
15915
15915
  let h = { ...at, ...t.pose, turn: c(i), lean: (t.pose?.lean ?? 0) + Yn.helperLean * (1 - o) + 4, bend: (t.pose?.bend ?? 0) + Yn.helperBend * (1 - o), "head.nod": 18 * (1 - o) };
15916
- h = Ue(t.character, h, "arm.right", { x: l.x - t.x, y: l.y });
15916
+ h = Ge(t.character, h, "arm.right", { x: l.x - t.x, y: l.y });
15917
15917
  const u = { ...Me.sitFloor, ...e.pose, turn: c(!i) }, d = { ...at, ...e.pose, turn: c(!i) };
15918
15918
  let f = Pf(u, d, o);
15919
- f = Ue(e.character, f, "arm.right", { x: l.x - e.x, y: l.y });
15919
+ f = Ge(e.character, f, "arm.right", { x: l.x - e.x, y: l.y });
15920
15920
  const p = 0.04 * a, g = (m, y) => {
15921
15921
  const k = ye(m.character, y).points["hand.right"];
15922
15922
  return Math.hypot(k.x + m.x - l.x, k.y - l.y) < p;
@@ -15933,7 +15933,7 @@ function D5(t, e = {}) {
15933
15933
  const n = { ...$0[t], ...e };
15934
15934
  return e.top && e.top !== "shirt" && (n.collar = e.collar ?? !1, n.tie = e.tie ?? null), n.top === "dress" && (n.bottom = "skirt"), n;
15935
15935
  }
15936
- const B5 = 0.7, z5 = 50, q5 = 1.2, j5 = 0.8, Y5 = 3, K5 = 30, X5 = 0.8, U5 = 0.6, Xi = (t, e) => Math.max(-e, Math.min(e, t)), G5 = ["hair.swing", "hair.trail", "hair.lift"];
15936
+ const B5 = 0.7, z5 = 50, q5 = 1.2, j5 = 0.8, Y5 = 3, K5 = 30, X5 = 0.8, G5 = 0.6, Xi = (t, e) => Math.max(-e, Math.min(e, t)), U5 = ["hair.swing", "hair.trail", "hair.lift"];
15937
15937
  function V5(t, e) {
15938
15938
  const n = e.start ?? 0, s = e.amount ?? 1, o = Math.max(1e-6, e.headRadius);
15939
15939
  let r = NaN, i = { x: 0, y: 0, turn: 0 };
@@ -15942,7 +15942,7 @@ function V5(t, e) {
15942
15942
  return p.turn * 90 + (p.headTurn ?? 0);
15943
15943
  }, c = { start: n, end: e.end, step: e.step, stiffness: e.stiffness ?? 70, damping: e.damping ?? 6 }, h = zo(l, c), u = zo((f) => a(f).x, c), d = zo((f) => a(f).y, c);
15944
15944
  return h.map((f, p) => {
15945
- const g = a(f.time), m = f.value - l(f.time), y = u[p].value - g.x - (e.wind ?? 0) * B5 * o, k = d[p].value - g.y, w = Math.sin(g.turn * Math.PI / 2), b = Math.cos(g.turn * Math.PI / 2), S = m * Y5 + y * b / o * K5, E = -y * w / o * X5, v = -k / o * U5;
15945
+ const g = a(f.time), m = f.value - l(f.time), y = u[p].value - g.x - (e.wind ?? 0) * B5 * o, k = d[p].value - g.y, w = Math.sin(g.turn * Math.PI / 2), b = Math.cos(g.turn * Math.PI / 2), S = m * Y5 + y * b / o * K5, E = -y * w / o * X5, v = -k / o * G5;
15946
15946
  return {
15947
15947
  time: f.time,
15948
15948
  swing: Xi(S * s, z5),
@@ -16008,7 +16008,7 @@ function oT(t, e, n, s = {}) {
16008
16008
  wind: s.wind
16009
16009
  }
16010
16010
  ), y = [];
16011
- for (const k of G5) {
16011
+ for (const k of U5) {
16012
16012
  const w = k.slice(5);
16013
16013
  let b = m.map((E) => ({ time: E.time, value: E[w] }));
16014
16014
  if (b.every((E) => Math.abs(E.value) < 1e-3)) continue;
@@ -16089,7 +16089,7 @@ function ng(t) {
16089
16089
  const { base: e, ...n } = t;
16090
16090
  return { ...ts[e ?? "full"], ...n };
16091
16091
  }
16092
- const Ja = 160, Z5 = 120, Q5 = 700, Ui = 60, tv = 90, Ho = 3200, es = 1, un = 1e-6;
16092
+ const Ja = 160, Z5 = 120, Q5 = 700, Gi = 60, tv = 90, Ho = 3200, es = 1, un = 1e-6;
16093
16093
  function Jl(t, e, n = {}) {
16094
16094
  const s = ng(n.style), o = n.seed ?? 1, r = {};
16095
16095
  if (t.length === 0) return r;
@@ -16161,7 +16161,7 @@ function ev(t, e, n, s, o) {
16161
16161
  return h;
16162
16162
  }
16163
16163
  function nv(t, e, n, s, o) {
16164
- const r = [], i = Ui + tv;
16164
+ const r = [], i = Gi + tv;
16165
16165
  for (let f = 1; f < t.length; f++) {
16166
16166
  const p = t[f - 1].pose, g = t[f].pose;
16167
16167
  Object.entries(e.headTurns).some(([y, k]) => Math.abs((g[y] ?? 0) - (p[y] ?? 0)) > k) && t[f].act !== !1 && r.push(Math.max(t[0].time, t[f - 1].time - n.eyeLead));
@@ -16177,7 +16177,7 @@ function nv(t, e, n, s, o) {
16177
16177
  const d = [{ time: a, value: o }];
16178
16178
  for (const f of r) {
16179
16179
  const p = d[d.length - 1].time;
16180
- f + Ui <= p + es || (f > p + es && d.push({ time: f, value: o }), d.push({ time: f + Ui, value: 1, easing: "ease-in" }), d.push({ time: f + i, value: o, easing: "ease-out" }));
16180
+ f + Gi <= p + es || (f > p + es && d.push({ time: f, value: o }), d.push({ time: f + Gi, value: 1, easing: "ease-in" }), d.push({ time: f + i, value: o, easing: "ease-out" }));
16181
16181
  }
16182
16182
  return d.length > 1 ? d : [];
16183
16183
  }
@@ -16598,7 +16598,7 @@ const H0 = {
16598
16598
  tired: 1500,
16599
16599
  shove: 1300,
16600
16600
  run: 560
16601
- }, yv = 450, bv = 2.4, wv = 160, R0 = 2.5, kv = 200, vv = 340, Mv = 1.1, F0 = [380, 900], xv = 0.35, Fo = 300, Gi = 150, Sv = 260, Tv = 1.2, Vi = 160, L0 = 400, Ts = 300, Ev = 450, W0 = 500, Ji = 350, N0 = 150, Av = 120, Zi = 180, D0 = 420, $v = 300, B0 = 300, Pv = 140, Qi = 150, z0 = 450, Ov = 450, ta = 150, q0 = 350, j0 = 400, Iv = 12, _v = 600, Y0 = 90, K0 = 400, Cv = 200, Hv = 0.09, X0 = 350, $e = 450, ea = 1200, Rv = 700, Fn = 320, Pe = 220, Fv = 65, Lv = 700, U0 = (t) => t in vn, Wv = (t) => t in he;
16601
+ }, yv = 450, bv = 2.4, wv = 160, R0 = 2.5, kv = 200, vv = 340, Mv = 1.1, F0 = [380, 900], xv = 0.35, Fo = 300, Ui = 150, Sv = 260, Tv = 1.2, Vi = 160, L0 = 400, Ts = 300, Ev = 450, W0 = 500, Ji = 350, N0 = 150, Av = 120, Zi = 180, D0 = 420, $v = 300, B0 = 300, Pv = 140, Qi = 150, z0 = 450, Ov = 450, ta = 150, q0 = 350, j0 = 400, Iv = 12, _v = 600, Y0 = 90, K0 = 400, Cv = 200, Hv = 0.09, X0 = 350, $e = 450, ea = 1200, Rv = 700, Fn = 320, Pe = 220, Fv = 65, Lv = 700, G0 = (t) => t in vn, Wv = (t) => t in he;
16602
16602
  function Nv(t) {
16603
16603
  return Math.max(Lv, Array.from(t).length * Fv);
16604
16604
  }
@@ -16623,13 +16623,13 @@ function Ql(t, e, n = {}) {
16623
16623
  }, tt = (_) => {
16624
16624
  const j = ke(_, { height: u, facing: p });
16625
16625
  return { x: d + (j.hands.right.x + j.fingertips.right.x) / 2, y: f + (j.hands.right.y + j.fingertips.right.y) / 2 };
16626
- }, G = (_, j, nt) => {
16626
+ }, U = (_, j, nt) => {
16627
16627
  const $ = { ..._, rightWrist: 0, rightElbow: 0, rightShoulder: q(_, j, nt) }, I = ke($, { height: u, facing: p }), B = { x: d + I.shoulders.right.x, y: f + I.shoulders.right.y }, K = { x: d + I.elbows.right.x, y: f + I.elbows.right.y }, L = tt($), F = Math.hypot(K.x - B.x, K.y - B.y), N = Math.hypot(L.x - K.x, L.y - K.y), X = Math.min(F + N - 0.01, Math.max(Math.abs(F - N) + 0.01, Math.hypot(j - B.x, nt - B.y))), z = (et) => et * 180 / Math.PI, J = z(Math.acos((F * F + X * X - N * N) / (2 * F * X))), Q = 180 - z(Math.acos((F * F + N * N - X * X) / (2 * F * N)));
16628
- let H = { rightShoulder: $.rightShoulder, rightElbow: 0 }, U = 1 / 0;
16628
+ let H = { rightShoulder: $.rightShoulder, rightElbow: 0 }, G = 1 / 0;
16629
16629
  for (const et of [1, -1])
16630
16630
  for (const it of [1, -1]) {
16631
16631
  const ot = { rightShoulder: $.rightShoulder + et * J, rightElbow: it * Q }, lt = { ..._, rightWrist: 0, ...ot }, st = tt(lt), rt = Math.hypot(st.x - j, st.y - nt) - ke(lt, { height: u, facing: p }).elbows.right.y * 1e-3;
16632
- rt < U && (U = rt, H = ot);
16632
+ rt < G && (G = rt, H = ot);
16633
16633
  }
16634
16634
  return H;
16635
16635
  }, R = (_, j, nt) => Math.abs(j - d) < 2 ? _ : (w.push({ time: _, value: d - c }, { time: _ + nt, value: j - c, easing: "ease-in-out" }), d = j, _ + nt);
@@ -16659,7 +16659,7 @@ function Ql(t, e, n = {}) {
16659
16659
  P(N + kv, { stretch: 0.75, bend: 12, leftHip: 22, rightHip: 22, ...X }, _.mood, !1);
16660
16660
  const z = N + vv;
16661
16661
  P(z - 40, { stretch: 0.72 }, void 0, !1), P(z, { stretch: 1.2, bend: -6, leftShoulder: 140, rightShoulder: 140, leftElbow: 20, rightElbow: 20, leftHip: 4, rightHip: 4 }, void 0, !1);
16662
- const J = Math.hypot(L - d, F - f), Q = _.for ?? Math.min(F0[1], Math.max(F0[0], 300 + J * Mv)), H = Math.min(f, F) - xv * u, U = Math.sqrt(f - H), et = Math.sqrt(F - H), it = z + Q * U / (U + et), ot = z + Q;
16662
+ const J = Math.hypot(L - d, F - f), Q = _.for ?? Math.min(F0[1], Math.max(F0[0], 300 + J * Mv)), H = Math.min(f, F) - xv * u, G = Math.sqrt(f - H), et = Math.sqrt(F - H), it = z + Q * G / (G + et), ot = z + Q;
16663
16663
  P(it, { stretch: 1, bend: 4, leftHip: -55, leftKnee: -80, rightHip: 55, rightKnee: 80, leftShoulder: 110, rightShoulder: 110 }, void 0, !1), P(ot, { stretch: 0.72, bend: 12, leftShoulder: 75, rightShoulder: 75, leftElbow: 0, rightElbow: 0, leftHip: 18, rightHip: 18, leftKnee: 0, rightKnee: 0 }, void 0, !1), P(ot + 180, { stretch: 1.05, bend: -3 }, void 0, !1), P(ot + 340, { stretch: 1, bend: 0, leftHip: ht.leftHip, rightHip: ht.rightHip, leftShoulder: ht.leftShoulder, rightShoulder: ht.rightShoulder, leftElbow: ht.leftElbow, rightElbow: ht.rightElbow }, void 0, !1), w.push({ time: z, value: d - c }, { time: ot, value: L - c }), b.push(
16664
16664
  { time: z, value: f - h },
16665
16665
  { time: it, value: H - h, easing: "ease-out-quad" },
@@ -16672,11 +16672,11 @@ function Ql(t, e, n = {}) {
16672
16672
  const L = _.target ?? { x: d + p * u * 0.5, y: f - u * 0.6 }, F = C(L.x), N = W(j, L.x, _.mood), X = F === 1 ? L.left ?? L.x : L.right ?? L.x, z = F === 1 ? L.right ?? L.x : L.left ?? L.x, J = { ...g, turn: 1, lean: -10, bend: -8, rightElbow: 40, lookX: 1, ...B };
16673
16673
  P(N + Fo, { ...J, rightShoulder: q(J, d - p * u * 0.3, f - u * 1.1) }, _.mood, !1);
16674
16674
  const Q = { ...g, lean: 6, bend: 4, rightElbow: 0, rightWrist: 0 }, H = { ...g, lean: 14, bend: 12, rightElbow: 0, rightWrist: 0 };
16675
- R(N, V(Q, X, L.y, "arm"), Fo + Gi), P(N + Fo + Gi, { lean: -12 }, void 0, !1);
16676
- const U = N + Fo + Gi + 80;
16677
- P(U, { ...Q, rightShoulder: q(Q, X, L.y) }, void 0, !1);
16678
- const et = U + (_.for ?? Math.max(Sv, Math.abs(z - X) / Tv));
16679
- w.push({ time: U, value: d - c }), d = V(H, z, L.y, "arm"), w.push({ time: et, value: d - c }), P(et, { ...H, rightShoulder: q(H, z, L.y) }, void 0, !1), P(et + Vi, { lean: 16, bend: 14, rightShoulder: q(g, z + F * u * 0.4, L.y + u * 0.25) }, void 0, !1), P(et + Vi + L0, { lean: 0, bend: 0, rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow }), nt = et + Vi + L0, $ = U, I = et;
16675
+ R(N, V(Q, X, L.y, "arm"), Fo + Ui), P(N + Fo + Ui, { lean: -12 }, void 0, !1);
16676
+ const G = N + Fo + Ui + 80;
16677
+ P(G, { ...Q, rightShoulder: q(Q, X, L.y) }, void 0, !1);
16678
+ const et = G + (_.for ?? Math.max(Sv, Math.abs(z - X) / Tv));
16679
+ w.push({ time: G, value: d - c }), d = V(H, z, L.y, "arm"), w.push({ time: et, value: d - c }), P(et, { ...H, rightShoulder: q(H, z, L.y) }, void 0, !1), P(et + Vi, { lean: 16, bend: 14, rightShoulder: q(g, z + F * u * 0.4, L.y + u * 0.25) }, void 0, !1), P(et + Vi + L0, { lean: 0, bend: 0, rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow }), nt = et + Vi + L0, $ = G, I = et;
16680
16680
  } else if (_.do === "grab" && _.target) {
16681
16681
  const L = _.target, F = W(j, L.x, _.mood), N = L.y > f - u * 0.5, X = {
16682
16682
  ...g,
@@ -16715,29 +16715,29 @@ function Ql(t, e, n = {}) {
16715
16715
  P(J, { ...X, rightShoulder: q(X, L.x, L.y) }, _.mood, !1), P(J + ta, {}, void 0, !1), P(J + ta + q0, { bend: 0, lean: 0, stretch: 1, rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow, lookY: 0 }), nt = J + ta + q0, $ = J;
16716
16716
  } else if (_.do === "write" && _.target) {
16717
16717
  const L = _.target, F = L.left ?? L.x, N = L.right ?? L.x, X = W(j, (F + N) / 2, _.mood), z = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, ...vt.thinking, lookX: 1, lookY: 0, ...B }, J = (st) => V(z, st, L.y, "arm") + p * u * 0.08, Q = (st) => {
16718
- const Z = tt({ ...z, ...G(z, st, L.y), rightWrist: 0 });
16718
+ const Z = tt({ ...z, ...U(z, st, L.y), rightWrist: 0 });
16719
16719
  return Math.hypot(Z.x - st, Z.y - L.y) < 2;
16720
- }, H = p === 1 ? F : N, U = R(X, J((F + N) / 2), Ts), et = !Q(F) || !Q(N), it = et ? R(U, J(F), Ts) + j0 : U + j0;
16721
- P(it, { ...z, ...G(z, et ? F : H, L.y) }, _.mood, !1);
16720
+ }, H = p === 1 ? F : N, G = R(X, J((F + N) / 2), Ts), et = !Q(F) || !Q(N), it = et ? R(G, J(F), Ts) + j0 : G + j0;
16721
+ P(it, { ...z, ...U(z, et ? F : H, L.y) }, _.mood, !1);
16722
16722
  const ot = _.for ?? Math.max(_v, Math.abs(N - F) * Iv);
16723
16723
  et && w.push({ time: it, value: d - c });
16724
16724
  for (let st = Y0, Z = 0; st <= ot; st += Y0, Z++) {
16725
16725
  const rt = F + (N - F) * Math.min(st, ot) / ot;
16726
16726
  et && (d = J(rt), w.push({ time: it + st, value: d - c }));
16727
16727
  const ct = (Z % 2 === 0 ? -1 : 1) * u * 0.02;
16728
- P(it + st, G(z, rt, L.y + ct), void 0, !1);
16728
+ P(it + st, U(z, rt, L.y + ct), void 0, !1);
16729
16729
  }
16730
16730
  const lt = it + ot;
16731
- P(lt, G(z, N, L.y), void 0, !1), P(lt + K0, { rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow, ...vt.happy }), nt = lt + K0, $ = it, I = lt;
16731
+ P(lt, U(z, N, L.y), void 0, !1), P(lt + K0, { rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow, ...vt.happy }), nt = lt + K0, $ = it, I = lt;
16732
16732
  } else if (_.do === "push" && _.target) {
16733
- const L = _.target, F = _.to ?? L.x, N = W(j, d + (F >= L.x ? 1 : -1), _.mood), X = p === 1 ? L.left ?? L.x : L.right ?? L.x, z = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...B }, J = V(z, X, L.y, "arm"), Q = R(N, J + p * u * 0.06, Ts), H = G(z, X, L.y), U = { ...z, ...H, leftShoulder: -H.rightShoulder, leftElbow: -H.rightElbow }, et = Q + Cv;
16734
- P(et, U, _.mood, !1);
16733
+ const L = _.target, F = _.to ?? L.x, N = W(j, d + (F >= L.x ? 1 : -1), _.mood), X = p === 1 ? L.left ?? L.x : L.right ?? L.x, z = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...B }, J = V(z, X, L.y, "arm"), Q = R(N, J + p * u * 0.06, Ts), H = U(z, X, L.y), G = { ...z, ...H, leftShoulder: -H.rightShoulder, leftElbow: -H.rightElbow }, et = Q + Cv;
16734
+ P(et, G, _.mood, !1);
16735
16735
  const it = Math.abs(F - L.x), ot = et + (_.for ?? Math.max(600, it / Hv)), lt = it / Pa("shove", u);
16736
16736
  v.push({ time: et, value: "shove" }), E.push({ time: et, value: 0 }, { time: et + Pe, value: 1, easing: "ease-out" }, { time: ot - Pe, value: 1 }, { time: ot, value: 0, easing: "ease-in" }), S.push({ time: et, value: m }, { time: ot, value: m + lt }), m += lt, w.push({ time: et, value: d - c }, { time: ot, value: d + (F - L.x) - c }), d += F - L.x, P(ot, {}, void 0, !1), P(ot + X0, { lean: 0, bend: 0, rightShoulder: ht.rightShoulder, leftShoulder: ht.leftShoulder, rightElbow: ht.rightElbow, leftElbow: ht.leftElbow }), nt = ot + X0, $ = et, I = ot;
16737
16737
  } else if (K) {
16738
16738
  const L = _.mood ? rn(g, _.mood) : g, F = K.steps(L, _), N = og(F, { at: j, from: L });
16739
16739
  k.push(...N), g = N[N.length - 1].pose, nt = j + Math.max(mv(F), _.for ?? 0);
16740
- } else if (U0(_.do)) {
16740
+ } else if (G0(_.do)) {
16741
16741
  const L = I0(_.do, { at: j, from: _.mood ? rn(g, _.mood) : g });
16742
16742
  k.push(...L), g = L[L.length - 1].pose, nt = j + Er(_.do), _.do === "take" && A.push({ kind: "dust", time: j + 900, x: d, y: f, length: 500 }), _.do === "land" && A.push({ kind: "dust", time: j + 120, x: d, y: f, length: 500 });
16743
16743
  } else if (_.do === "look" || _.do === "face") {
@@ -16758,7 +16758,7 @@ function Ql(t, e, n = {}) {
16758
16758
  (_.mood || _.pose) && P(j + Math.min($e, L / 2), B, _.mood), nt = j + L;
16759
16759
  }
16760
16760
  if (_.say) {
16761
- const L = i(_.do) || U0(_.do) || K ? j : j + Math.min(150, (nt - j) / 4), F = i(_.do) ? nt : Math.max(L + 200, nt - 100);
16761
+ const L = i(_.do) || G0(_.do) || K ? j : j + Math.min(150, (nt - j) / 4), F = i(_.do) ? nt : Math.max(L + 200, nt - 100);
16762
16762
  M.push({ text: _.say, start: L, end: F }), _.do === "say" && qv(k, g, L, F);
16763
16763
  }
16764
16764
  _.onto !== void 0 && _.do !== "leap" && _.onto !== f && (b.push({ time: j, value: f - h }, { time: nt, value: _.onto - h, easing: "ease-in-out" }), f = _.onto), nt > k[k.length - 1].time && k.push({ time: nt, pose: g }), T.push({ start: j, end: nt, ...$ !== void 0 ? { contact: $ } : {}, ...I !== void 0 ? { release: I } : {} }), y = nt;
@@ -16775,7 +16775,7 @@ function Ql(t, e, n = {}) {
16775
16775
  _.property === "facing" && _.keyframes[0].value === -1
16776
16776
  );
16777
16777
  return {
16778
- tracks: [...Ul(t, D, M, { energy: n.energy }), ...Y],
16778
+ tracks: [...Gl(t, D, M, { energy: n.energy }), ...Y],
16779
16779
  duration: y,
16780
16780
  lines: M,
16781
16781
  keys: k,
@@ -16815,7 +16815,7 @@ function cT(t, e, n, s = {}) {
16815
16815
  throw new Error(`surfaceScript: ${o.length} problem(s) in the beats:
16816
16816
  ${o.map((d) => ` ${d.beat >= 0 ? `beat ${d.beat}: ` : ""}${d.message}`).join(`
16817
16817
  `)}`);
16818
- const r = n.map((d) => cg(d, e)), i = Ql(t, r, s), a = Uv(r, i.beats, s), l = s.ground ?? 0, c = (d) => s.ride === !1 ? d : Object.values(e).reduce((f, p) => p.ride(f, t, { ground: l }), d);
16818
+ const r = n.map((d) => cg(d, e)), i = Ql(t, r, s), a = Gv(r, i.beats, s), l = s.ground ?? 0, c = (d) => s.ride === !1 ? d : Object.values(e).reduce((f, p) => p.ride(f, t, { ground: l }), d);
16819
16819
  n.forEach((d, f) => {
16820
16820
  for (const p of Kv(d)) {
16821
16821
  const g = (b) => new Error(`surfaceScript: beat ${f} (${d.do}), ${p.edit} on ${p.surface}: ${b}`), m = (b, S) => {
@@ -16912,7 +16912,7 @@ function cg(t, e, n = !1) {
16912
16912
  }, i = { ...o };
16913
16913
  return Vo(t.target) && (i.target = r(t.target)), Vo(t.to) && (i.to = r(t.to).x), Vo(t.onto) && (i.onto = r(t.onto).top), i;
16914
16914
  }
16915
- function Uv(t, e, n) {
16915
+ function Gv(t, e, n) {
16916
16916
  let s = 0;
16917
16917
  return t.map((o) => {
16918
16918
  const r = Zl([o], n.actions).length, i = e.slice(s, s + r);
@@ -16972,10 +16972,10 @@ function hT(t) {
16972
16972
  })
16973
16973
  };
16974
16974
  }
16975
- const Gv = /* @__PURE__ */ new Set(["x", "y", "walking", "gait"]), G0 = 0.215 + 0.205;
16975
+ const Uv = /* @__PURE__ */ new Set(["x", "y", "walking", "gait"]), U0 = 0.215 + 0.205;
16976
16976
  function Vv(t, e, n = 1) {
16977
- const { points: s } = ye(t, at), o = s["hip.left"], r = s["knee.left"], i = s["ankle.left"], a = o && r && i ? Math.hypot(r.x - o.x, r.y - o.y) + Math.hypot(i.x - r.x, i.y - r.y) : G0 * t.height;
16978
- return Ll(e, a / G0, n);
16977
+ const { points: s } = ye(t, at), o = s["hip.left"], r = s["knee.left"], i = s["ankle.left"], a = o && r && i ? Math.hypot(r.x - o.x, r.y - o.y) + Math.hypot(i.x - r.x, i.y - r.y) : U0 * t.height;
16978
+ return Ll(e, a / U0, n);
16979
16979
  }
16980
16980
  function uT(t, e, n, s = {}) {
16981
16981
  const o = Ql(t, n, { ...s, height: e.height, reach: s.reach ?? Jv(e) }), r = o.tracks.find((y) => y.property === "facing")?.keyframes ?? [], i = (y) => {
@@ -16992,7 +16992,7 @@ function uT(t, e, n, s = {}) {
16992
16992
  };
16993
16993
  }), { rest: c, start: h, ...u } = s;
16994
16994
  tM(l, a, n, o, e, i, s);
16995
- const d = cv(t, l, u), f = Ul(t, d, o.lines, { energy: s.energy }), p = o.tracks.filter((y) => Gv.has(y.property)), g = o.tracks.find((y) => y.property === "walk");
16995
+ const d = cv(t, l, u), f = Gl(t, d, o.lines, { energy: s.energy }), p = o.tracks.filter((y) => Uv.has(y.property)), g = o.tracks.find((y) => y.property === "walk");
16996
16996
  return { tracks: g ? [...f, ...p, iM(t, g, o.tracks, e, s)] : [...f, ...p], duration: o.duration, lines: o.lines, keys: l, beats: o.beats, effects: o.effects };
16997
16997
  }
16998
16998
  function Jv(t) {
@@ -17016,13 +17016,13 @@ function tM(t, e, n, s, o, r, i) {
17016
17016
  const k = r(m.time), w = ke(e[y], { height: o.height, facing: k < 0 ? -1 : 1 }), b = c(m.time), S = Qv.has(h.do) && h.target ? { x: h.target.x - b.x, y: h.target.y - b.y } : void 0, E = { x: (w.hands.right.x + w.fingertips.right.x) / 2, y: (w.hands.right.y + w.fingertips.right.y) / 2 }, v = S ?? (d === "arm" ? E : w.toes.right), x = k < 0 ? "right" : "left", M = `${d}.${x}`;
17017
17017
  let T = m.pose;
17018
17018
  if (h.do === "point")
17019
- T = Ue(o, T, M, v);
17019
+ T = Ge(o, T, M, v);
17020
17020
  else if (d === "arm")
17021
- T = Ue(o, rM(o, T, x, v), M, v);
17021
+ T = Ge(o, rM(o, T, x, v), M, v);
17022
17022
  else
17023
17023
  for (let A = 0; A < 3; A++) {
17024
17024
  const P = ye(o, T).points, O = P[`ankle.${x}`], C = P[`toe.${x}`];
17025
- T = Ue(o, T, M, { x: v.x - (C.x - O.x), y: v.y - (C.y - O.y) });
17025
+ T = Ge(o, T, M, { x: v.x - (C.x - O.x), y: v.y - (C.y - O.y) });
17026
17026
  }
17027
17027
  t[y] = { ...m, pose: T };
17028
17028
  });
@@ -17340,8 +17340,8 @@ function to(t, e) {
17340
17340
  const n = Math.max(0.05, Ot(t, e, "squash")), s = 1 / Math.sqrt(n), r = [1, 0, 0, 0, 0, 1, Ot(t, e, "lean"), 0, 0, 0, 1, 0, 0, 0, 0, 1];
17341
17341
  return [
17342
17342
  on([0, Ot(t, e, "lift"), 0]),
17343
- me(Gt([1, 0, 0], -Ot(t, e, "pitch"))),
17344
- me(Gt([0, 0, 1], Ot(t, e, "roll"))),
17343
+ me(Ut([1, 0, 0], -Ot(t, e, "pitch"))),
17344
+ me(Ut([0, 0, 1], Ot(t, e, "roll"))),
17345
17345
  r,
17346
17346
  gn([s, n, s]),
17347
17347
  gn(Array(3).fill(Math.max(0, Ot(t, e, "size"))))
@@ -17356,13 +17356,13 @@ function nc(t, e) {
17356
17356
  let c = Ht(l ? r(l) : n, on(i.at ?? [0, 0, 0]));
17357
17357
  if (i.rotate) {
17358
17358
  const [h, u, d] = i.rotate;
17359
- h && (c = Ht(c, me(Gt([1, 0, 0], h)))), u && (c = Ht(c, me(Gt([0, 1, 0], u)))), d && (c = Ht(c, me(Gt([0, 0, 1], d))));
17359
+ h && (c = Ht(c, me(Ut([1, 0, 0], h)))), u && (c = Ht(c, me(Ut([0, 1, 0], u)))), d && (c = Ht(c, me(Ut([0, 0, 1], d))));
17360
17360
  }
17361
17361
  for (const { value: h, bind: u } of o)
17362
17362
  if (!(!u.parts.includes(i.id) || h === 0)) {
17363
17363
  if (u.translate && (c = Ht(c, on([u.translate[0] * h, u.translate[1] * h, u.translate[2] * h]))), u.rotate) {
17364
17364
  const d = u.rotate.pivot ?? [0, 0, 0], f = u.rotate.axis === "x" ? [1, 0, 0] : u.rotate.axis === "y" ? [0, 1, 0] : [0, 0, 1];
17365
- c = [c, on(d), me(Gt(f, u.rotate.degrees * h)), on([-d[0], -d[1], -d[2]])].reduce((p, g) => Ht(p, g));
17365
+ c = [c, on(d), me(Ut(f, u.rotate.degrees * h)), on([-d[0], -d[1], -d[2]])].reduce((p, g) => Ht(p, g));
17366
17366
  }
17367
17367
  u.scale && (c = Ht(c, gn([1 + (u.scale[0] - 1) * h, 1 + (u.scale[1] - 1) * h, 1 + (u.scale[2] - 1) * h])));
17368
17368
  }
@@ -17377,18 +17377,18 @@ const sa = (() => {
17377
17377
  })(), MM = Math.cos(35 * el);
17378
17378
  function gg(t, e, n, s, o = {}) {
17379
17379
  const r = t.derive ? { ...e, ...t.derive(e) } : e, i = nc(t, r), a = n.toView([0, 0, 0]), l = (C) => (W) => [C[0] * W[0] + C[4] * W[1] + C[8] * W[2], C[1] * W[0] + C[5] * W[1] + C[9] * W[2], C[2] * W[0] + C[6] * W[1] + C[10] * W[2]], c = to(t, r), h = o.slice === void 0 ? null : ml(c), u = h ? t.parts.map((C) => ({ part: C, mesh: Jo(C.shape), local: Ht(h, i.get(C.id)), whole: C.shape.type === "tube" })) : void 0, d = u ? bM(u, o.slice) : void 0, f = u ? dg(u.map((C) => ({ part: C.part.id, mesh: C.mesh, ...ec(C.mesh, C.local) }))) : void 0, p = (C, W, q, V) => {
17380
- const tt = (Z) => n.toView(se(q, Z)), G = W.vertices.map(tt), R = G.map((Z) => n.toScreen(Z)), D = o.perspective ? o.near : void 0, Y = (Z) => Z.map((rt) => n.toScreen(rt)), _ = (Z) => D === void 0 ? Z : V0(Z, D), j = (Z) => D === void 0 ? [Z] : uM(Z, D), nt = l(q), $ = W.faces.map((Z) => {
17380
+ const tt = (Z) => n.toView(se(q, Z)), U = W.vertices.map(tt), R = U.map((Z) => n.toScreen(Z)), D = o.perspective ? o.near : void 0, Y = (Z) => Z.map((rt) => n.toScreen(rt)), _ = (Z) => D === void 0 ? Z : V0(Z, D), j = (Z) => D === void 0 ? [Z] : uM(Z, D), nt = l(q), $ = W.faces.map((Z) => {
17381
17381
  const rt = n.toView(nt(Z.normal)), ct = [rt[0] - a[0], rt[1] - a[1], rt[2] - a[2]], ut = Math.hypot(...ct) || 1;
17382
17382
  return [ct[0] / ut, ct[1] / ut, ct[2] / ut];
17383
17383
  }), I = f && V ? fg(C.id, W, V, hg(V), f) : void 0, B = (Z) => I?.[Z] ?? !1, K = $.map((Z, rt) => {
17384
17384
  if (B(rt)) return !1;
17385
17385
  if (!o.perspective) return Z[2] > 1e-6;
17386
- const ut = W.faces[rt].corners.reduce((yt, bt) => [yt[0] + G[bt][0], yt[1] + G[bt][1], yt[2] + G[bt][2]], [0, 0, 0]);
17386
+ const ut = W.faces[rt].corners.reduce((yt, bt) => [yt[0] + U[bt][0], yt[1] + U[bt][1], yt[2] + U[bt][2]], [0, 0, 0]);
17387
17387
  return -(Z[0] * ut[0] + Z[1] * ut[1] + Z[2] * ut[2]) > 1e-9;
17388
- }), L = (Z) => W.faces[Z].corners.reduce((rt, ct) => rt + G[ct][2], 0) / W.faces[Z].corners.length, F = W.faces.map((Z, rt) => ({ face: Z, i: rt })).filter(({ i: Z }) => K[Z]).map(({ face: Z, i: rt }) => ({
17388
+ }), L = (Z) => W.faces[Z].corners.reduce((rt, ct) => rt + U[ct][2], 0) / W.faces[Z].corners.length, F = W.faces.map((Z, rt) => ({ face: Z, i: rt })).filter(({ i: Z }) => K[Z]).map(({ face: Z, i: rt }) => ({
17389
17389
  i: rt,
17390
17390
  solved: {
17391
- points: D === void 0 ? Z.corners.map((ct) => R[ct]) : Y(_(Z.corners.map((ct) => G[ct]))),
17391
+ points: D === void 0 ? Z.corners.map((ct) => R[ct]) : Y(_(Z.corners.map((ct) => U[ct]))),
17392
17392
  depth: L(rt),
17393
17393
  tone: 0.72 + 0.33 * Math.max(0, $[rt][0] * sa[0] + $[rt][1] * sa[1] + $[rt][2] * sa[2])
17394
17394
  }
@@ -17410,22 +17410,22 @@ function gg(t, e, n, s, o = {}) {
17410
17410
  const ut = rt.length === 2 && ct === 2 && W.creases !== !1 && $[rt[0]][0] * $[rt[1]][0] + $[rt[0]][1] * $[rt[1]][1] + $[rt[0]][2] * $[rt[1]][2] < MM;
17411
17411
  rt.length === 1 && (W.joined || EM(W, Z)) || (rt.length === 1 || ct === 1 || ut) && (z.push(Z.split("-").map(Number)), J.push(rt.filter((yt) => K[yt]).reduce((yt, bt) => L(bt) > L(yt) ? bt : yt)));
17412
17412
  }
17413
- const Q = (Z) => W.faces.findIndex((rt) => rt.corners.length > 4 && Math.sign($M(W.vertices[Z], rt.normal)) > 0), H = (W.marks ?? []).filter(([Z]) => Q(Z) < 0 || K[Q(Z)]), U = ([Z, rt]) => D === void 0 ? [[R[Z], R[rt]]] : j([G[Z], G[rt]]).map(Y), et = H.flatMap(U), it = (Z) => D === void 0 ? [Z.map((rt) => R[rt])] : j(Z.map((rt) => G[rt])).map(Y);
17413
+ const Q = (Z) => W.faces.findIndex((rt) => rt.corners.length > 4 && Math.sign($M(W.vertices[Z], rt.normal)) > 0), H = (W.marks ?? []).filter(([Z]) => Q(Z) < 0 || K[Q(Z)]), G = ([Z, rt]) => D === void 0 ? [[R[Z], R[rt]]] : j([U[Z], U[rt]]).map(Y), et = H.flatMap(G), it = (Z) => D === void 0 ? [Z.map((rt) => R[rt])] : j(Z.map((rt) => U[rt])).map(Y);
17414
17414
  if (o.slice !== void 0) {
17415
17415
  const Z = /* @__PURE__ */ new Map();
17416
17416
  z.forEach((rt, ct) => Z.set(J[ct], [...Z.get(J[ct]) ?? [], rt]));
17417
17417
  for (const { i: rt, solved: ct } of F) {
17418
17418
  ct.edges = ou(Z.get(rt) ?? []).flatMap(it);
17419
17419
  const ut = W.faces[rt].corners;
17420
- ct.center = ut.reduce((bt, re) => [bt[0] + G[re][0] / ut.length, bt[1] + G[re][1] / ut.length, bt[2] + G[re][2] / ut.length], [0, 0, 0]), ct.normal = $[rt];
17420
+ ct.center = ut.reduce((bt, re) => [bt[0] + U[re][0] / ut.length, bt[1] + U[re][1] / ut.length, bt[2] + U[re][2] / ut.length], [0, 0, 0]), ct.normal = $[rt];
17421
17421
  const yt = F[F.length - 1].i;
17422
- ct.marks = H.filter(([bt]) => (Q(bt) >= 0 ? Q(bt) : yt) === rt).flatMap(U);
17422
+ ct.marks = H.filter(([bt]) => (Q(bt) >= 0 ? Q(bt) : yt) === rt).flatMap(G);
17423
17423
  }
17424
17424
  }
17425
17425
  const ot = C.glow ? Math.max(0, Math.min(1, Ot(t, r, C.glow.control))) : 0, lt = C.fade ? Math.max(0, Math.min(1, Ot(t, r, C.fade.control))) : 0, st = C.fade ? Math.max(0, Math.min(1, C.fade.from + (C.fade.to - C.fade.from) * lt)) : 1;
17426
17426
  return {
17427
17427
  part: C,
17428
- depth: G.reduce((Z, rt) => Z + rt[2], 0) / Math.max(1, G.length),
17428
+ depth: U.reduce((Z, rt) => Z + rt[2], 0) / Math.max(1, U.length),
17429
17429
  faces: N,
17430
17430
  edges: ou(z).flatMap(it),
17431
17431
  marks: et,
@@ -17446,7 +17446,7 @@ function gg(t, e, n, s, o = {}) {
17446
17446
  if (d) {
17447
17447
  const C = new Map(t.parts.map((q) => {
17448
17448
  const V = i.get(q.id), tt = Jo(q.shape).vertices;
17449
- return [q.id, tt.reduce((G, R) => G + n.toView(se(V, R))[2], 0) / Math.max(1, tt.length)];
17449
+ return [q.id, tt.reduce((U, R) => U + n.toView(se(V, R))[2], 0) / Math.max(1, tt.length)];
17450
17450
  })), W = /* @__PURE__ */ new Map();
17451
17451
  for (const q of y) {
17452
17452
  const V = q.cell.join(",");
@@ -17689,8 +17689,8 @@ function gT(t, e = {}) {
17689
17689
  const D = Number.isFinite(v) ? `at ${v} ms` : "after its edits";
17690
17690
  throw new Error(`${n.kind}: ${W} turned away from the viewer ${D}; aim at an anchor (${r.map((Y) => `anchor:${Y}`).join(", ") || "none"}) or box`);
17691
17691
  }
17692
- const V = q.map((D) => D.x), tt = q.map((D) => D.y), G = Math.min(...V), R = Math.min(...tt);
17693
- return kt(T.x + G, T.y + R, Math.max(...V) - G, Math.max(...tt) - R);
17692
+ const V = q.map((D) => D.x), tt = q.map((D) => D.y), U = Math.min(...V), R = Math.min(...tt);
17693
+ return kt(T.x + U, T.y + R, Math.max(...V) - U, Math.max(...tt) - R);
17694
17694
  }
17695
17695
  }, b = (E, v) => {
17696
17696
  try {
@@ -18311,7 +18311,7 @@ function KM(t = {}) {
18311
18311
  family: "building",
18312
18312
  summary: t.summary ?? "A house: opens its door, lights its windows, puffs chimney smoke, shakes, pops up.",
18313
18313
  rig: p,
18314
- actions: UM(!!f),
18314
+ actions: GM(!!f),
18315
18315
  acting: XM,
18316
18316
  colors: { body: i.walls }
18317
18317
  };
@@ -18323,7 +18323,7 @@ const XM = {
18323
18323
  headTurns: {},
18324
18324
  drift: []
18325
18325
  };
18326
- function UM(t) {
18326
+ function GM(t) {
18327
18327
  return {
18328
18328
  door: {
18329
18329
  summary: "Opens the front door (`open: true`) or shuts it (`open: false`).",
@@ -18364,7 +18364,7 @@ function UM(t) {
18364
18364
  } : {}
18365
18365
  };
18366
18366
  }
18367
- function GM(t = {}) {
18367
+ function UM(t = {}) {
18368
18368
  const e = t.width ?? 0.46, n = t.depth ?? 0.46, s = t.seatHeight ?? 0.46, o = t.backHeight ?? 0.95, r = { wood: "#8a5a3b", seat: "#c48a4a", ...t.colors }, i = 0.05, a = 0.025, l = [
18369
18369
  { id: "seat", shape: { type: "box", size: [e, i, n] }, at: [0, s - i / 2, 0], fill: r.seat },
18370
18370
  { id: "back", shape: { type: "box", size: [e, o - s, i] }, at: [0, (o + s) / 2, -n / 2 + i / 2], fill: r.wood }
@@ -19760,7 +19760,7 @@ function Hx(t = {}) {
19760
19760
  stoop: 10
19761
19761
  });
19762
19762
  }
19763
- const eo = { car: RM, truck: FM, bus: LM, tractor: WM, cart: NM, trainCar: DM, bike: BM, motorbike: zM, tree: qM, house: KM, chair: GM, desk: ZM, bed: tx, door: nx, wheelchair: rx, helicopter: lx, airplane: hx, horse: bx, dog: wx, cat: kx, cow: vx, goat: Mx, rabbit: xx, squirrel: Sx, songbird: $x, crow: Px, chicken: Ox, pigeon: Ix, duck: _x, owl: Cx, parrot: Hx };
19763
+ const eo = { car: RM, truck: FM, bus: LM, tractor: WM, cart: NM, trainCar: DM, bike: BM, motorbike: zM, tree: qM, house: KM, chair: UM, desk: ZM, bed: tx, door: nx, wheelchair: rx, helicopter: lx, airplane: hx, horse: bx, dog: wx, cat: kx, cow: vx, goat: Mx, rabbit: xx, squirrel: Sx, songbird: $x, crow: Px, chicken: Ox, pigeon: Ix, duck: _x, owl: Cx, parrot: Hx };
19764
19764
  function xg(t, e = {}) {
19765
19765
  const n = eo[t];
19766
19766
  if (!n) throw new Error(dt("prop preset", t, Object.keys(eo)));
@@ -19923,7 +19923,7 @@ function zx(t) {
19923
19923
  n.length > 0 && n[n.length - 1].time === s.time ? n[n.length - 1] = s : n.push(s);
19924
19924
  return n;
19925
19925
  }
19926
- const Ge = Object.freeze({
19926
+ const Ue = Object.freeze({
19927
19927
  test: Object.freeze({ name: "Test", inningsPerSide: 2, oversPerInnings: null, ballsPerOver: 6, freeHitAfterNoBall: !1, summary: "Multi-day cricket. Each side can have two innings; there is no innings over limit." }),
19928
19928
  odi: Object.freeze({ name: "ODI", inningsPerSide: 1, oversPerInnings: 50, ballsPerOver: 6, freeHitAfterNoBall: !0, summary: "One innings per side, up to 50 overs. A no-ball gives a free hit on the next legitimate delivery." }),
19929
19929
  t20: Object.freeze({ name: "T20", inningsPerSide: 1, oversPerInnings: 20, ballsPerOver: 6, freeHitAfterNoBall: !0, summary: "One innings per side, up to 20 overs. A no-ball gives a free hit on the next legitimate delivery." })
@@ -20006,7 +20006,7 @@ function qe(t, e, n, s, o = "hold") {
20006
20006
  let r = { ...e.pose };
20007
20007
  for (let i = 0; i < 10; i++) {
20008
20008
  const a = { ...e, pose: r }, l = Tn(t.who.plan, r, { height: t.who.height, contact: t.who.contact }), c = co(t.who.plan, r, t.who.height), h = oe(so(t, a, n), fs(t, a, `arm.${n}`, 2)), u = oe(oe(oe(s, h), e.position), l.hip), d = gs(u, (r.roll ?? 0) * Math.PI / 180), f = St(c.root, Jt(d, -(r.turn ?? 0) * Math.PI / 2));
20009
- r = Gs(t.who.plan, r, `arm.${n}`, f, { height: t.who.height });
20009
+ r = Us(t.who.plan, r, `arm.${n}`, f, { height: t.who.height });
20010
20010
  }
20011
20011
  for (const [i, a] of Object.entries(Tt[o])) r[`hand.${n}.${i}`] = a;
20012
20012
  return { ...e, pose: r };
@@ -20021,7 +20021,7 @@ function Yx(t) {
20021
20021
  }
20022
20022
  function $g(t) {
20023
20023
  const e = Zt(t), n = Math.max(-1, Math.min(1, e[1]));
20024
- return n > 0.999999 ? [0, 0, 0, 1] : n < -0.999999 ? Gt([1, 0, 0], 180) : Gt(Zt(qs([0, 1, 0], e)), Math.acos(n) * 180 / Math.PI).map((s) => s === 0 ? 0 : s);
20024
+ return n > 0.999999 ? [0, 0, 0, 1] : n < -0.999999 ? Ut([1, 0, 0], 180) : Ut(Zt(qs([0, 1, 0], e)), Math.acos(n) * 180 / Math.PI).map((s) => s === 0 ? 0 : s);
20025
20025
  }
20026
20026
  function Pr(t, e, n) {
20027
20027
  const s = {};
@@ -20143,7 +20143,7 @@ function Xx(t) {
20143
20143
  ];
20144
20144
  return i.length > 0 && a.push({ id: `${s}-move-fov`, target: s, property: "fov", keyframes: i }), a;
20145
20145
  }
20146
- function Ux(t) {
20146
+ function Gx(t) {
20147
20147
  const e = Math.max(1, t.every ?? 33), n = t.offset ?? [0, 2, 6], s = t.lag ?? 0, o = `${t.scene}/${t.camera}`, r = [], i = [];
20148
20148
  for (let a = t.start; ; a = Math.min(t.end, a + e)) {
20149
20149
  const l = t.subjectAt(a), c = t.subjectAt(Math.max(t.start, a - s));
@@ -20155,7 +20155,7 @@ function Ux(t) {
20155
20155
  ];
20156
20156
  }
20157
20157
  const lc = Object.freeze({ pitch: "Whole pitch", batter: "Batter close-up", bowler: "Bowler close-up", keeper: "Keeper close-up", field: "Whole ground", overhead: "Overhead ground", orbit: "360° ground orbit", "follow-ball": "Follow the ball", ...Object.fromEntries(Object.entries(ei).map(([t, e]) => [t, e.name])) }), ca = Object.freeze({ pitch: 75, batter: 145, bowler: 35, keeper: 145, field: 75, overhead: 75, orbit: 75, "follow-ball": 75, "front-foot": 90, "striker-crease": 90, "bowler-crease": 90 });
20158
- function Gx(t, e = "pitch") {
20158
+ function Ux(t, e = "pitch") {
20159
20159
  const n = ce(lc, e, "cricketCamera.view");
20160
20160
  if (ac(n)) {
20161
20161
  const o = Cg(t, n);
@@ -20207,7 +20207,7 @@ function kT(t, e = {}) {
20207
20207
  if (!Number.isFinite(a) || a < 16 || a > 1e3) throw new Error("cricketCamera: every must be between 16 and 1000 ms");
20208
20208
  if (ha(e.pitch, 0, 89, "pitch"), ha(e.distance, 0.5, 2e3, "distance"), ha(e.fov, 10, 100, "fov"), e.target !== void 0 && (Re(e.target, "cricketCamera.target"), n === "follow-ball"))
20209
20209
  throw new Error("cricketCamera: target override is not supported by follow-ball");
20210
- const l = Gx(t, n), c = e.pitch ?? l.pitch, h = e.distance ?? l.distance, u = i(e.fov ?? l.fov), d = e.target ? [...e.target] : l.target ?? [0, 0, 0], f = t.scene.id + "/camera", p = (g) => {
20210
+ const l = Ux(t, n), c = e.pitch ?? l.pitch, h = e.distance ?? l.distance, u = i(e.fov ?? l.fov), d = e.target ? [...e.target] : l.target ?? [0, 0, 0], f = t.scene.id + "/camera", p = (g) => {
20211
20211
  if (e.distance === void 0 && e.target === void 0) return g;
20212
20212
  const m = g.find((w) => w.property === "position");
20213
20213
  if (!m || !("keyframes" in m)) return g;
@@ -20228,7 +20228,7 @@ function kT(t, e = {}) {
20228
20228
  for (; v < E.length - 2 && M - (S.delay ?? 0) > E[v + 1].time; ) v++;
20229
20229
  return v !== T && (x = new dn({ ...S, keyframes: E.slice(v, v + 2) })), x.getValueAtTime(M);
20230
20230
  };
20231
- }), m = (Math.atan2(5, 6) * 180 / Math.PI + o - ca["follow-ball"]) * Math.PI / 180, y = c * Math.PI / 180, k = o === ca["follow-ball"] && (e.pitch === void 0 || e.pitch === l.pitch) && (e.distance === void 0 || e.distance === l.distance) ? [5, 3, 6] : [Math.sin(m) * Math.cos(y) * h, Math.sin(y) * h, Math.cos(m) * Math.cos(y) * h], w = Ux({ scene: t.scene.id, camera: "camera", start: 0, end: t.duration, every: a, offset: k, subjectAt: (b) => g.map((S) => S(b)) });
20231
+ }), m = (Math.atan2(5, 6) * 180 / Math.PI + o - ca["follow-ball"]) * Math.PI / 180, y = c * Math.PI / 180, k = o === ca["follow-ball"] && (e.pitch === void 0 || e.pitch === l.pitch) && (e.distance === void 0 || e.distance === l.distance) ? [5, 3, 6] : [Math.sin(m) * Math.cos(y) * h, Math.sin(y) * h, Math.cos(m) * Math.cos(y) * h], w = Gx({ scene: t.scene.id, camera: "camera", start: 0, end: t.duration, every: a, offset: k, subjectAt: (b) => g.map((S) => S(b)) });
20232
20232
  return p([...w, { id: f + "-zoom-fov", target: f, property: "fov", keyframes: [{ time: 0, value: u }, { time: t.duration, value: u }] }]);
20233
20233
  }
20234
20234
  return p(Xx({ scene: t.scene.id, camera: "camera", start: 0, end: t.duration, every: a, easing: "linear", from: { target: d, yaw: o, pitch: c, distance: h, fov: u }, to: { yaw: n === "orbit" ? o + 360 : o } }));
@@ -20284,7 +20284,7 @@ const Xt = Object.freeze({ length: 20.12, width: 3.05, poppingCrease: 1.22, retu
20284
20284
  function Qx(t) {
20285
20285
  if (!t.id?.trim()) throw new Error("cricketPlayer: id is required");
20286
20286
  ce({ batter: 1, bowler: 1, keeper: 1, fielder: 1, umpire: 1 }, t.role, "cricketPlayer.role");
20287
- const e = ce(Sr, t.preset ?? "youngMan", "cricketPlayer.preset"), n = ce(Ge, t.format ?? "t20", "cricketPlayer.format"), s = ce({ none: 1, cap: 1, "sun-hat": 1 }, t.headwear ?? "none", "cricketPlayer.headwear"), o = e === "childBoy" || e === "childGirl", r = t.height ?? (o ? 1.24 : 1.78);
20287
+ const e = ce(Sr, t.preset ?? "youngMan", "cricketPlayer.preset"), n = ce(Ue, t.format ?? "t20", "cricketPlayer.format"), s = ce({ none: 1, cap: 1, "sun-hat": 1 }, t.headwear ?? "none", "cricketPlayer.headwear"), o = e === "childBoy" || e === "childGirl", r = t.height ?? (o ? 1.24 : 1.78);
20288
20288
  if (!Number.isFinite(r) || r < 0.5 || r > 3) throw new Error("cricketPlayer: height must be between .5 and 3 metres");
20289
20289
  Re(t.position ?? [0, 0, 0], "cricketPlayer.position");
20290
20290
  const i = t.role === "umpire" ? "#f5ebd5" : n === "test" ? "#f5f0df" : t.color ?? "#3577b5", a = JSON.parse(JSON.stringify({
@@ -20314,7 +20314,7 @@ function lu(t, e) {
20314
20314
  ].map((s, o) => o === 0 ? s : { ...s, parent: t });
20315
20315
  }
20316
20316
  function Hg(t = {}) {
20317
- const e = ce(Ge, t.format ?? "t20", "cricketField.format"), n = ce(Tg, t.cast ?? "adults", "cricketField.cast"), s = ce(al, t.markingProfile ?? "icc-men", "cricketField.markingProfile"), o = al[s], r = t.boundaryRadius ?? 64;
20317
+ const e = ce(Ue, t.format ?? "t20", "cricketField.format"), n = ce(Tg, t.cast ?? "adults", "cricketField.cast"), s = ce(al, t.markingProfile ?? "icc-men", "cricketField.markingProfile"), o = al[s], r = t.boundaryRadius ?? 64;
20318
20318
  if (!Number.isFinite(r) || r < 24 || r > 250) throw new Error("cricketField: boundaryRadius must be between 24 and 250 metres");
20319
20319
  const i = t.id ?? "cricket";
20320
20320
  if (!i.trim()) throw new Error("cricketField: id is required");
@@ -20414,7 +20414,7 @@ function e3(t, e, n, s, o) {
20414
20414
  }
20415
20415
  function n3(t, e) {
20416
20416
  const n = { runs: 0, extras: 0, wickets: 0, legalBall: !0, freeHitNext: !1 };
20417
- t === "running" && (n.runs = 1), t === "four" && (n.runs = 4), t === "six" && (n.runs = 6), (t === "wide" || t === "no-ball") && (n.extras = 1, n.legalBall = !1), t === "no-ball" && (n.freeHitNext = Ge[e].freeHitAfterNoBall);
20417
+ t === "running" && (n.runs = 1), t === "four" && (n.runs = 4), t === "six" && (n.runs = 6), (t === "wide" || t === "no-ball") && (n.extras = 1, n.legalBall = !1), t === "no-ball" && (n.freeHitNext = Ue[e].freeHitAfterNoBall);
20418
20418
  const o = { catch: "caught", bowled: "bowled", lbw: "lbw", stumping: "stumped", "run-out": "run-out" }[t];
20419
20419
  return o && (n.wickets = 1, n.dismissal = o), n;
20420
20420
  }
@@ -20423,7 +20423,7 @@ function s3(t, e = {}) {
20423
20423
  }
20424
20424
  function Rg(t, e, n) {
20425
20425
  const s = ce(Kn, e.action ?? "bowling", "cricketAction.action"), o = n ? n.delivery.legality === "no-ball" : s === "no-ball", r = n ? n.delivery.legality === "wide" : s === "wide", i = n ? n.delivery.style === "spin" : s === "spin";
20426
- ce(Ge, t.format, "cricketAction.format");
20426
+ ce(Ue, t.format, "cricketAction.format");
20427
20427
  const a = n?.result ?? n3(s, t.format), l = e.duration ?? 6e3;
20428
20428
  if (!Number.isFinite(l) || l < 4e3 || l > 6e4) throw new Error("cricketAction: duration must be between 4000 and 60000 ms");
20429
20429
  const c = t.scene.id;
@@ -20466,9 +20466,9 @@ function Rg(t, e, n) {
20466
20466
  F.pose = { ...F.pose, ...$ === "batter" ? Eg() : { turn: 0.15, "leg.left.knee": 8, "leg.right.knee": 8 } };
20467
20467
  let z = [0, -1, $ === "batter" ? 0.05 : 0.12], J = St(F.position, [N * 0.15, N * 0.44, N * 0.04]);
20468
20468
  if ($ === "non-striker" && (J = St(F.position, [N * 0.08, N * 0.44, N * 0.17])), $ === "batter") {
20469
- const Q = _t(Pt(I, 2100, 2600)) * (1 - _t(Pt(I, 2600, xt))), H = _t(Pt(I, 2600, xt)) * (1 - _t(Pt(I, xt, 3800))), U = _t(Pt(I, xt, 3250)) * (1 - _t(Pt(I, 3250, 4e3)));
20469
+ const Q = _t(Pt(I, 2100, 2600)) * (1 - _t(Pt(I, 2600, xt))), H = _t(Pt(I, 2600, xt)) * (1 - _t(Pt(I, xt, 3800))), G = _t(Pt(I, xt, 3250)) * (1 - _t(Pt(I, 3250, 4e3)));
20470
20470
  if (g) {
20471
- J = St(F.position, [N * (0.15 + 0.03 * Q - 0.02 * H - 0.03 * U), N * (0.44 + 0.14 * Q + 0.07 * H + 0.23 * U), N * (0.04 + 0.16 * Q - 0.12 * H - 0.06 * U)]), z = Zt([0.15 * Q + 0.25 * U, -1 + 1.85 * Q + 1.6 * U, 0.05 + 0.55 * Q - 0.4 * H - 0.8 * U]), F.pose.turn = 1 + 0.12 * H + 0.3 * U, F.pose.lean = 3 + 4 * H;
20471
+ J = St(F.position, [N * (0.15 + 0.03 * Q - 0.02 * H - 0.03 * G), N * (0.44 + 0.14 * Q + 0.07 * H + 0.23 * G), N * (0.04 + 0.16 * Q - 0.12 * H - 0.06 * G)]), z = Zt([0.15 * Q + 0.25 * G, -1 + 1.85 * Q + 1.6 * G, 0.05 + 0.55 * Q - 0.4 * H - 0.8 * G]), F.pose.turn = 1 + 0.12 * H + 0.3 * G, F.pose.lean = 3 + 4 * H;
20472
20472
  const et = 12 + 4 * H;
20473
20473
  F.pose["leg.left.spread"] = et, F.pose["leg.right.spread"] = et, s === "defend" && (z = [0, -1, -0.08], J = St(F.position, [N * 0.1, N * 0.5, -N * 0.12]));
20474
20474
  } else if (["stumping", "bowled", "lbw"].includes(s)) {
@@ -20516,19 +20516,19 @@ function Rg(t, e, n) {
20516
20516
  }
20517
20517
  if (a.wickets || s === "four" || s === "six") {
20518
20518
  const H = a.wickets ? X : 5100;
20519
- let U = N;
20519
+ let G = N;
20520
20520
  if (a.wickets) {
20521
- U = { ...z, "arm.right.swing": 165, "arm.right.elbow": 0 };
20522
- for (const [et, it] of Object.entries(Tt.point)) U[`hand.right.${et}`] = it;
20521
+ G = { ...z, "arm.right.swing": 165, "arm.right.elbow": 0 };
20522
+ for (const [et, it] of Object.entries(Tt.point)) G[`hand.right.${et}`] = it;
20523
20523
  }
20524
- J.push([H, Q], [H + 350, U]);
20524
+ J.push([H, Q], [H + 350, G]);
20525
20525
  }
20526
20526
  F.pose = ia(I, J);
20527
20527
  } else
20528
20528
  F.pose = Pr(F.pose, N, _t(Pt(I, s === "no-ball" ? qt : s === "wide" ? 3100 : X, (s === "no-ball" ? qt : s === "wide" ? 3100 : X) + 350)));
20529
20529
  }
20530
20530
  return B.set(I, F), F;
20531
- }, x = ($, I) => so(h[$], v($, I), "right"), M = g ? Yx(v("batter", xt).bat) : s === "lbw" ? sn(fs(h.batter, v("batter", xt), "leg.right", 1), fs(h.batter, v("batter", xt), "leg.right", 2), 0.6) : [m ? Xt.wicketWidth / 2 + 0.075 + 0.15 : 0, 0.45, 9.25], T = x("bowler", qt), A = [r ? 0.85 : i ? -0.35 : s === "lbw" ? M[0] * 0.6 : 0, 0.075, 3.9], P = x("keeper", s === "stumping" ? 3400 : 3500), O = x("fielder", As), C = x("fielder", Le), W = s === "run-out" ? "bowler" : "striker", q = s === "run-out" ? 5e3 : s === "stumping" ? 3900 : 3200, V = [t.boundaryRadius * 0.8, s === "six" ? 2.1 : 0.075, -t.boundaryRadius * 0.6], tt = ($, I, B, K, L, F = 0, N = 0) => Og({ target: `${c}/ball`, start: I, end: B, from: K, to: L, arc: F, curve: N }, $), G = ($) => {
20531
+ }, x = ($, I) => so(h[$], v($, I), "right"), M = g ? Yx(v("batter", xt).bat) : s === "lbw" ? sn(fs(h.batter, v("batter", xt), "leg.right", 1), fs(h.batter, v("batter", xt), "leg.right", 2), 0.6) : [m ? Xt.wicketWidth / 2 + 0.075 + 0.15 : 0, 0.45, 9.25], T = x("bowler", qt), A = [r ? 0.85 : i ? -0.35 : s === "lbw" ? M[0] * 0.6 : 0, 0.075, 3.9], P = x("keeper", s === "stumping" ? 3400 : 3500), O = x("fielder", As), C = x("fielder", Le), W = s === "run-out" ? "bowler" : "striker", q = s === "run-out" ? 5e3 : s === "stumping" ? 3900 : 3200, V = [t.boundaryRadius * 0.8, s === "six" ? 2.1 : 0.075, -t.boundaryRadius * 0.6], tt = ($, I, B, K, L, F = 0, N = 0) => Og({ target: `${c}/ball`, start: I, end: B, from: K, to: L, arc: F, curve: N }, $), U = ($) => {
20532
20532
  if ($ <= qt) return x("bowler", $);
20533
20533
  if ($ <= Es) return tt($, qt, Es, T, A, 0.15, i ? 0.35 : 0);
20534
20534
  const I = r ? St(P, [0, 0, -0.6]) : M;
@@ -20574,7 +20574,7 @@ function Rg(t, e, n) {
20574
20574
  I.label = a.wickets ? "Out" : "Not out", I.caption = `${$[n.ruling.reason]} ${a.runs} bat runs · ${a.extras} extras · ${a.wickets} wickets. ${a.legalBall ? "Counts as a legal ball." : "Does not count in the over."}${a.freeHitNext ? " The next delivery is a free hit; an illegal delivery carries it forward." : n.freeHit ? " This legal delivery consumes the free hit." : ""}`;
20575
20575
  }
20576
20576
  R.sort(($, I) => $.time - I.time);
20577
- const _ = Pg(0, l, e.every, [1400, 1800, qt, 2100, 2150, 2250, Es, 2600, 2800, xt, 3050, 3100, 3200, 3250, 3300, 3400, 3500, 3800, 3900, 3950, 4e3, As, Le, 4350, 4450, Ln, 4900, 5e3, 5100, 5150, No, ua, 5700].map(p)), j = _.map(($) => G(f($))), nt = [];
20577
+ const _ = Pg(0, l, e.every, [1400, 1800, qt, 2100, 2150, 2250, Es, 2600, 2800, xt, 3050, 3100, 3200, 3250, 3300, 3400, 3500, 3800, 3900, 3950, 4e3, As, Le, 4350, 4450, Ln, 4900, 5e3, 5100, 5150, No, ua, 5700].map(p)), j = _.map(($) => U(f($))), nt = [];
20578
20578
  for (const [$, I] of Object.entries(h)) {
20579
20579
  let B = I.object.pose?.turn ?? 0, K = B;
20580
20580
  const L = _.map((F, N) => {
@@ -20582,12 +20582,12 @@ function Rg(t, e, n) {
20582
20582
  let z = $ === "fielder" && y && X > 3050 && X < 3250 ? Do(I, X, 3050, s === "catch" ? 3800 : 3950, E, S, K) : v($, X), J = j[N];
20583
20583
  const Q = !["batter", "non-striker", "bowler", "keeper"].includes($);
20584
20584
  if (Q) {
20585
- const U = v("bowler", Math.min(X, qt)), et = St(U.position, [0, u("bowler") * 0.8, 0]);
20585
+ const G = v("bowler", Math.min(X, qt)), et = St(G.position, [0, u("bowler") * 0.8, 0]);
20586
20586
  J = X <= qt ? et : X < 2100 ? sn(et, J, _t(Pt(X, qt, 2100))) : J;
20587
20587
  }
20588
20588
  if (k && ($ === "batter" || $ === "non-striker") && X > 3050 && (J = $ === "batter" ? [1, u($) * 0.8, -10.5] : [-1, u($) * 0.8, 10.5]), $ === "bowler" && X <= xt && (J = St(v("batter", X).position, [0, u("batter") * 0.65, 0])), Q && ($ !== "fielder" || !y || X <= 3050) || $ === "bowler" && X >= 3e3) {
20589
- const U = Zn(z.position, J, B);
20590
- B = $ === "bowler" && X < 3500 ? (z.pose.turn ?? 0) + (ol(U, z.pose.turn ?? 0) - (z.pose.turn ?? 0)) * _t(Pt(X, 3e3, 3500)) : U, z = { ...z, pose: { ...z.pose, turn: B } };
20589
+ const G = Zn(z.position, J, B);
20590
+ B = $ === "bowler" && X < 3500 ? (z.pose.turn ?? 0) + (ol(G, z.pose.turn ?? 0) - (z.pose.turn ?? 0)) * _t(Pt(X, 3e3, 3500)) : G, z = { ...z, pose: { ...z.pose, turn: B } };
20591
20591
  }
20592
20592
  return $ === "fielder" && y && (X === 3050 ? K = B : X > 3050 && (B = ol(z.pose.turn ?? 0, B), z = { ...z, pose: { ...z.pose, turn: B } })), qx(I, z, J);
20593
20593
  });
@@ -20691,14 +20691,14 @@ function i3(t, e) {
20691
20691
  return { dismissal: n, reason: "dismissal" };
20692
20692
  }
20693
20693
  function a3(t, e = {}) {
20694
- const n = ce(Ge, t.format, "cricketPlay.format"), s = r3(e);
20695
- if (s.context.freeHit && !Ge[n].freeHitAfterNoBall) throw new Error("cricketPlay: Test format does not support free-hit context");
20694
+ const n = ce(Ue, t.format, "cricketPlay.format"), s = r3(e);
20695
+ if (s.context.freeHit && !Ue[n].freeHitAfterNoBall) throw new Error("cricketPlay: Test format does not support free-hit context");
20696
20696
  const o = o3(s), r = i3(s, o), i = s.delivery.legality === "legal", a = {
20697
20697
  runs: s.finish === "single" ? 1 : s.finish === "four" ? 4 : s.finish === "six" ? 6 : 0,
20698
20698
  extras: i ? 0 : 1,
20699
20699
  wickets: r.dismissal ? 1 : 0,
20700
20700
  legalBall: i,
20701
- freeHitNext: Ge[n].freeHitAfterNoBall && (s.delivery.legality === "no-ball" || s.context.freeHit && !i),
20701
+ freeHitNext: Ue[n].freeHitAfterNoBall && (s.delivery.legality === "no-ball" || s.context.freeHit && !i),
20702
20702
  ...r.dismissal ? { dismissal: r.dismissal } : {}
20703
20703
  };
20704
20704
  return { ...Rg(t, { action: o, duration: e.duration, every: e.every }, { delivery: s.delivery, result: a, ruling: r, freeHit: s.context.freeHit }), play: s, ruling: r };
@@ -20732,7 +20732,7 @@ function h3(t, e = {}) {
20732
20732
  for (const s of Object.keys(vn)) n[s] = { summary: `The ${s} gag (${Er(s)} ms).` };
20733
20733
  for (const [s, o] of Object.entries(Qr)) n[s] = { ...o };
20734
20734
  return {
20735
- sports: { cricket: { actions: { ...Kn }, formats: { ...Ge }, casts: { ...Tg }, fieldingPositions: { ...no }, markingProfiles: { ...al }, cameras: { ...lc }, decisionCameras: ei, playComponents: Qe, playExamples: l3 } },
20735
+ sports: { cricket: { actions: { ...Kn }, formats: { ...Ue }, casts: { ...Tg }, fieldingPositions: { ...no }, markingProfiles: { ...al }, cameras: { ...lc }, decisionCameras: ei, playComponents: Qe, playExamples: l3 } },
20736
20736
  ...t ? { version: t } : {},
20737
20737
  timing: "JSON timelines and tracks are in milliseconds; the GSAP-style API (live.to, tf.timeline) takes seconds. Scene x grows right, y grows down, in px.",
20738
20738
  easings: {
@@ -20765,7 +20765,7 @@ function h3(t, e = {}) {
20765
20765
  beatFields: Za,
20766
20766
  actions: n,
20767
20767
  dances: Object.fromEntries(Object.entries(xn).map(([s, o]) => [s, Object.keys(o.moves)])),
20768
- flips: Object.fromEntries(Object.entries(Gr).map(([s, o]) => [s, o.label])),
20768
+ flips: Object.fromEntries(Object.entries(Ur).map(([s, o]) => [s, o.label])),
20769
20769
  handShapes: Object.keys(Tt),
20770
20770
  mudras: Object.keys(Ca)
20771
20771
  },
@@ -20851,8 +20851,8 @@ function h3(t, e = {}) {
20851
20851
  handMeetings: Object.keys(Tr)
20852
20852
  },
20853
20853
  codePanel: {
20854
- languages: Ga,
20855
- removeStyles: Ua,
20854
+ languages: Ua,
20855
+ removeStyles: Ga,
20856
20856
  anchors: {
20857
20857
  "line(n, time?)": "line n’s text box { x, y, left, right, top, bottom, width, height }: stand on top, point at x, y",
20858
20858
  "token(n, text, occurrence?, time?)": "a word on a line",
@@ -20862,7 +20862,7 @@ function h3(t, e = {}) {
20862
20862
  },
20863
20863
  edits: tg
20864
20864
  },
20865
- surfaces: { code: Go, board: Ne, chart: jn, prop: Cs },
20865
+ surfaces: { code: Uo, board: Ne, chart: jn, prop: Cs },
20866
20866
  surfaceScript: {
20867
20867
  "surfaceScript(figureId, { name: surface }, beats, options)": "compiles beats that act on surfaces: returns the script result with `tracks` (the figure’s, ridden, then every surface’s, keyed by its name) and `figureTracks`; options are scriptTracks’ plus `figureStyle` (for carry) and `ride` (default true)",
20868
20868
  "checkSurfaceBeats(beats, surfaces, cast?)": "every problem checkBeats finds, plus unknown surfaces, places, edits and moments, with suggestions",
@@ -20888,6 +20888,7 @@ function h3(t, e = {}) {
20888
20888
  "mathTarget(spec, { x, y })": "a canvas target for videos and canvas pages; tracks animate its values and item props",
20889
20889
  "mathSteps(lesson, target, spec, { hidden })": "lesson steps: toValue, applyMatrix, drawOn, fadeIn, fadeOut, showStep (equations)",
20890
20890
  "mountMath(element) / mountAllMath()": "lesson-page embeds: <figure data-tinyfly-math> with data-tinyfly-figure and data-tinyfly-timeline JSON scripts, stepped like any embed",
20891
+ "mathSurface(figure, { x, y })": "a figure as a surface for surfaceScript: anchors box, item:ID, tip:ID, point:ID, node:GRAPH:NODE, term:ID:TEXT, value:NAME; edits drawOn, erase, show, hide, step, set",
20891
20892
  "mathExplorable(element, spec, { sliders, drag })": "reader-driven figures: sliders on number values, drag vector tips or matrix columns",
20892
20893
  "mathFigureToSvg(spec, props)": "a standalone SVG of a figure at some values",
20893
20894
  "linearMapFigure, determinantFigure, eigenFigure, vectorSumFigure, spanFigure": "ready linear algebra figures; the matrix is the value M",
@@ -21432,8 +21433,8 @@ ${o.map((w) => ` beat ${w.beat}: ${w.message}`).join(`
21432
21433
  const C = { ...r };
21433
21434
  let W = l;
21434
21435
  for (let V = 0; ; V = Math.min(x, V + S3)) {
21435
- const tt = v + Xf(T, V / x) * M, { point: G, direction: R } = Kf(E, V);
21436
- W += Mr(W, Qn([0, 0], R)), h("x", tt, G[0]), h("z", tt, G[1]), h("rotateY", tt, W);
21436
+ const tt = v + Xf(T, V / x) * M, { point: U, direction: R } = Kf(E, V);
21437
+ W += Mr(W, Qn([0, 0], R)), h("x", tt, U[0]), h("z", tt, U[1]), h("rotateY", tt, W);
21437
21438
  for (const [D, Y] of Object.entries(w.perMetre ?? {})) h(D, tt, C[D] + V * Y);
21438
21439
  for (const [D, Y] of Object.entries(w.perSecond ?? {})) h(D, tt, C[D] + (tt - v) / 1e3 * Y);
21439
21440
  if (V >= x) break;
@@ -21583,9 +21584,9 @@ function B3(t) {
21583
21584
  }, E = (T, A, P, O, C) => {
21584
21585
  const W = A("hour"), { top: q, bottom: V } = F3(W), tt = T.createLinearGradient(0, O.y, 0, O.ground);
21585
21586
  tt.addColorStop(0, q), tt.addColorStop(1, V), T.fillStyle = tt, T.fillRect(O.x, O.y, O.w, O.ground - O.y);
21586
- const G = R3(W);
21587
- if (G < 0.6) {
21588
- T.fillStyle = "#ffffff", T.globalAlpha = (0.6 - G) / 0.6 * 0.9;
21587
+ const U = R3(W);
21588
+ if (U < 0.6) {
21589
+ T.fillStyle = "#ffffff", T.globalAlpha = (0.6 - U) / 0.6 * 0.9;
21589
21590
  for (const I of g)
21590
21591
  T.beginPath(), T.arc(O.x + I.u * O.w, O.y + I.v * (O.ground - O.y), I.size, 0, Math.PI * 2), T.fill();
21591
21592
  T.globalAlpha = 1;
@@ -21596,14 +21597,14 @@ function B3(t) {
21596
21597
  T.fillStyle = a.moon, T.beginPath(), T.arc(I, B, Y * 0.8, 0, Math.PI * 2), T.fill(), T.fillStyle = q, T.beginPath(), T.arc(I - Y * 0.35, B - Y * 0.15, Y * 0.7, 0, Math.PI * 2), T.fill();
21597
21598
  }
21598
21599
  const _ = Math.max(0, Math.min(1, A("clouds"))), j = Math.max(-1, Math.min(1, A("wind"))), nt = Math.round(_ * d.length);
21599
- T.fillStyle = Bs("#ffffff", a.cloud === "#ffffff" ? "#ffffff" : a.cloud, 1), T.globalAlpha = 0.55 + 0.4 * G;
21600
+ T.fillStyle = Bs("#ffffff", a.cloud === "#ffffff" ? "#ffffff" : a.cloud, 1), T.globalAlpha = 0.55 + 0.4 * U;
21600
21601
  for (let I = 0; I < nt; I++) {
21601
21602
  const B = d[I], K = ((B.u * O.w + j * P * 0.012 * (0.6 + B.size * 0.5)) % (O.w * 1.4) + O.w * 1.4) % (O.w * 1.4) - O.w * 0.2, L = O.x + K, F = O.y + (0.08 + B.v * 0.42) * (O.ground - O.y), N = Math.min(O.w, O.h) * 0.07 * B.size;
21602
21603
  for (let X = 0; X < B.puffs; X++)
21603
21604
  T.beginPath(), T.ellipse(L + (X - (B.puffs - 1) / 2) * N * 0.9, F + X % 2 * N * 0.25, N * (X % 2 ? 0.8 : 1), N * 0.62, 0, 0, Math.PI * 2), T.fill();
21604
21605
  }
21605
21606
  T.globalAlpha = 1;
21606
- const $ = (I) => Bs(Bs(I, "#0b1530", 0.65), I, G);
21607
+ const $ = (I) => Bs(Bs(I, "#0b1530", 0.65), I, U);
21607
21608
  if (l === "hills") {
21608
21609
  T.fillStyle = $(a.hills), T.beginPath(), T.moveTo(O.x, O.ground);
21609
21610
  const I = 40;
@@ -21620,8 +21621,8 @@ function B3(t) {
21620
21621
  for (const K of y) {
21621
21622
  if (I > O.x + O.w) break;
21622
21623
  const L = B * K.w, F = O.h * 0.22 * K.h;
21623
- if (T.fillRect(I, O.ground - F, L, F), K.windows && G < 0.5) {
21624
- T.fillStyle = "#ffd66b", T.globalAlpha = 0.5 - G;
21624
+ if (T.fillRect(I, O.ground - F, L, F), K.windows && U < 0.5) {
21625
+ T.fillStyle = "#ffd66b", T.globalAlpha = 0.5 - U;
21625
21626
  for (let N = O.ground - F + 6; N < O.ground - 8; N += 9) for (let X = I + 4; X < I + L - 4; X += 8) T.fillRect(X, N, 3, 4);
21626
21627
  T.globalAlpha = 1, T.fillStyle = $(a.city);
21627
21628
  }
@@ -21633,9 +21634,9 @@ function B3(t) {
21633
21634
  const C = Math.max(-1, Math.min(1, A("wind"))), W = Math.max(0, Math.min(1, A("rain"))), q = Math.max(0, Math.min(1, A("snow")));
21634
21635
  if (W > 0) {
21635
21636
  T.strokeStyle = a.rain, T.globalAlpha = 0.35 + 0.45 * W, T.lineWidth = 1.2, T.lineCap = "round";
21636
- const V = O.h * 0.05, tt = C * 0.45, G = Math.round(W * f.length);
21637
+ const V = O.h * 0.05, tt = C * 0.45, U = Math.round(W * f.length);
21637
21638
  T.beginPath();
21638
- for (let R = 0; R < G; R++) {
21639
+ for (let R = 0; R < U; R++) {
21639
21640
  const D = f[R], Y = ((D.v * O.h + P * D.speed * 0.9) % O.h + O.h) % O.h, _ = ((D.u * O.w + Y * tt) % O.w + O.w) % O.w;
21640
21641
  T.moveTo(O.x + _, O.y + Y), T.lineTo(O.x + _ + tt * V, O.y + Y + V);
21641
21642
  }
@@ -21645,8 +21646,8 @@ function B3(t) {
21645
21646
  T.fillStyle = a.snow, T.globalAlpha = 0.85;
21646
21647
  const V = Math.round(q * p.length);
21647
21648
  for (let tt = 0; tt < V; tt++) {
21648
- const G = p[tt], R = ((G.v * O.h + P * G.speed * 0.08) % O.h + O.h) % O.h, D = Math.sin(P * 2e-3 + G.sway) * O.w * 0.02, Y = ((G.u * O.w + D + C * R * 0.3) % O.w + O.w) % O.w;
21649
- T.beginPath(), T.arc(O.x + Y, O.y + R, G.size, 0, Math.PI * 2), T.fill();
21649
+ const U = p[tt], R = ((U.v * O.h + P * U.speed * 0.08) % O.h + O.h) % O.h, D = Math.sin(P * 2e-3 + U.sway) * O.w * 0.02, Y = ((U.u * O.w + D + C * R * 0.3) % O.w + O.w) % O.w;
21650
+ T.beginPath(), T.arc(O.x + Y, O.y + R, U.size, 0, Math.PI * 2), T.fill();
21650
21651
  }
21651
21652
  T.globalAlpha = 1;
21652
21653
  }
@@ -21671,8 +21672,8 @@ function B3(t) {
21671
21672
  if (r === "sky")
21672
21673
  E(T, C, P, W), v(T, C, P, W);
21673
21674
  else if (T.fillStyle = a.wall, T.fillRect(0, 0, s, W.ground), T.fillStyle = a.floor, T.fillRect(0, W.ground, s, o - W.ground), T.fillStyle = a.skirting, T.fillRect(0, W.ground - o * 0.012, s, o * 0.012), c) {
21674
- const q = s * 0.26, V = W.ground * 0.5, tt = s * 0.62, G = W.ground * 0.14;
21675
- T.fillStyle = a.frame, T.fillRect(tt - 6, G - 6, q + 12, V + 12), T.save(), T.beginPath(), T.rect(tt, G, q, V), T.clip(), E(T, C, P, { x: tt, y: G, w: q, h: V, ground: G + V * 0.8 }), v(T, C, P, { x: tt, y: G, w: q, h: V }), T.restore(), T.strokeStyle = a.frame, T.lineWidth = 4, T.beginPath(), T.moveTo(tt + q / 2, G), T.lineTo(tt + q / 2, G + V), T.moveTo(tt, G + V / 2), T.lineTo(tt + q, G + V / 2), T.stroke();
21675
+ const q = s * 0.26, V = W.ground * 0.5, tt = s * 0.62, U = W.ground * 0.14;
21676
+ T.fillStyle = a.frame, T.fillRect(tt - 6, U - 6, q + 12, V + 12), T.save(), T.beginPath(), T.rect(tt, U, q, V), T.clip(), E(T, C, P, { x: tt, y: U, w: q, h: V, ground: U + V * 0.8 }), v(T, C, P, { x: tt, y: U, w: q, h: V }), T.restore(), T.strokeStyle = a.frame, T.lineWidth = 4, T.beginPath(), T.moveTo(tt + q / 2, U), T.lineTo(tt + q / 2, U + V), T.moveTo(tt, U + V / 2), T.lineTo(tt + q, U + V / 2), T.stroke();
21676
21677
  }
21677
21678
  T.restore();
21678
21679
  }
@@ -21784,7 +21785,7 @@ function RT(t) {
21784
21785
  };
21785
21786
  }
21786
21787
  const FT = {
21787
- timeline: Um,
21788
+ timeline: Gm,
21788
21789
  to(t, e, n) {
21789
21790
  const s = new Xn(n);
21790
21791
  return s.to(t, e), s;
@@ -21917,7 +21918,7 @@ function X3(t, e, n) {
21917
21918
  }
21918
21919
  p.translate(-u, -d), p.globalCompositeOperation = "lighter", ll(p, i, n), t.save(), t.setTransform(1, 0, 0, 1, 0, 0), t.globalAlpha = 1, t.drawImage(f, u, d), t.restore();
21919
21920
  }
21920
- const NT = de.to, DT = de.from, BT = de.fromTo, zT = de.set, qT = de.timeline, jT = de.ticker, YT = de.splitText, KT = de.context, XT = de.matchMedia, UT = de.quickTo, GT = de.imageSequence, VT = de.pageTransition;
21921
+ const NT = de.to, DT = de.from, BT = de.fromTo, zT = de.set, qT = de.timeline, jT = de.ticker, YT = de.splitText, KT = de.context, XT = de.matchMedia, GT = de.quickTo, UT = de.imageSequence, VT = de.pageTransition;
21921
21922
  F1();
21922
21923
  export {
21923
21924
  ts as ACTING_STYLES,
@@ -21939,16 +21940,16 @@ export {
21939
21940
  x0 as CHART_KINDS,
21940
21941
  jn as CHART_SURFACE,
21941
21942
  Co as CHART_THEMES,
21942
- Ga as CODE_LANGUAGES,
21943
+ Ua as CODE_LANGUAGES,
21943
21944
  tg as CODE_PANEL_EDITS,
21944
- Go as CODE_SURFACE,
21945
+ Uo as CODE_SURFACE,
21945
21946
  p5 as CODE_THEME,
21946
21947
  Kn as CRICKET_ACTIONS,
21947
21948
  ca as CRICKET_CAMERA_ANGLES,
21948
21949
  Tg as CRICKET_CASTS,
21949
21950
  ei as CRICKET_DECISION_VIEWS,
21950
21951
  no as CRICKET_FIELDING_POSITIONS,
21951
- Ge as CRICKET_FORMATS,
21952
+ Ue as CRICKET_FORMATS,
21952
21953
  al as CRICKET_MARKING_PROFILES,
21953
21954
  Xt as CRICKET_PITCH,
21954
21955
  Qe as CRICKET_PLAY_COMPONENTS,
@@ -21972,7 +21973,7 @@ export {
21972
21973
  vt as EXPRESSIONS,
21973
21974
  pf as FACIAL_HAIR_STYLES,
21974
21975
  Z1 as FINGERS,
21975
- Gr as FLIPS,
21976
+ Ur as FLIPS,
21976
21977
  _w as FOOT_SHAPES,
21977
21978
  cc as FORMAT_VERSION,
21978
21979
  dm as FRAME_ASPECTS,
@@ -22008,7 +22009,7 @@ export {
22008
22009
  N5 as MANGA_CAST,
22009
22010
  sS as MORPH_SAMPLES,
22010
22011
  Ca as MUDRAS,
22011
- G3 as ManualClock,
22012
+ U3 as ManualClock,
22012
22013
  Jc as MediaSync,
22013
22014
  $0 as OUTFIT_PRESETS,
22014
22015
  wy as Observer,
@@ -22020,7 +22021,7 @@ export {
22020
22021
  eo as PROP_PRESETS,
22021
22022
  Cs as PROP_SURFACE,
22022
22023
  vg as QUADRUPED_ACTING,
22023
- Ua as REMOVE_STYLES,
22024
+ Ga as REMOVE_STYLES,
22024
22025
  ht as REST_POSE,
22025
22026
  Fg as RIDING_POSES,
22026
22027
  cn as SAMPLE_STEP,
@@ -22091,8 +22092,8 @@ export {
22091
22092
  np as bounceOut,
22092
22093
  Kk as boxMesh,
22093
22094
  J2 as brushingPose,
22094
- US as bubblePath,
22095
- GS as bubblePop,
22095
+ GS as bubblePath,
22096
+ US as bubblePop,
22096
22097
  HT as buildScene,
22097
22098
  LM as bus,
22098
22099
  L4 as cameraFromValues,
@@ -22104,7 +22105,7 @@ export {
22104
22105
  NM as cart,
22105
22106
  V4 as castMember,
22106
22107
  kx as cat,
22107
- GM as chair,
22108
+ UM as chair,
22108
22109
  Qs as changingWindows,
22109
22110
  ho as character,
22110
22111
  E4 as characterAt,
@@ -22121,7 +22122,7 @@ export {
22121
22122
  Vv as characterStrideLength,
22122
22123
  T4 as characterTarget,
22123
22124
  qp as charactersFor,
22124
- U4 as chart,
22125
+ G4 as chart,
22125
22126
  Ar as checkBeats,
22126
22127
  ig as checkCast,
22127
22128
  i5 as checkCharacterBeats3D,
@@ -22151,7 +22152,7 @@ export {
22151
22152
  Mn as createRandom,
22152
22153
  ba as createTrack,
22153
22154
  s3 as cricketAction,
22154
- Gx as cricketCameraFraming,
22155
+ Ux as cricketCameraFraming,
22155
22156
  il as cricketCameraReview,
22156
22157
  kT as cricketCameraTracks,
22157
22158
  MT as cricketClip,
@@ -22186,7 +22187,7 @@ export {
22186
22187
  lT as defineGait,
22187
22188
  cM as describeTarget,
22188
22189
  zs as deserializeTimeline,
22189
- Up as deserializeTrack,
22190
+ Gp as deserializeTrack,
22190
22191
  ZM as desk,
22191
22192
  MS as detectTempo,
22192
22193
  wx as dog,
@@ -22197,7 +22198,7 @@ export {
22197
22198
  S4 as drawCharacterHead,
22198
22199
  x4 as drawCharacterInView,
22199
22200
  fv as drawDustPuff,
22200
- Gf as drawEraser,
22201
+ Uf as drawEraser,
22201
22202
  Jf as drawHand,
22202
22203
  Xh as drawHeldItem,
22203
22204
  iT as drawImpactStars,
@@ -22209,7 +22210,7 @@ export {
22209
22210
  I4 as drawSolvedPart,
22210
22211
  Ff as drawSolvedProp,
22211
22212
  uv as drawSpeedLines,
22212
- Ub as drawStickFigure,
22213
+ Gb as drawStickFigure,
22213
22214
  rT as drawStickSmear,
22214
22215
  WT as drawTrail,
22215
22216
  z4 as drawnPathTarget,
@@ -22219,17 +22220,17 @@ export {
22219
22220
  Mu as easeInCubic,
22220
22221
  Zg as easeInOut,
22221
22222
  Cr as easeInOutCubic,
22222
- Gg as easeInOutQuad,
22223
+ Ug as easeInOutQuad,
22223
22224
  Xg as easeInQuad,
22224
22225
  Jg as easeOut,
22225
22226
  xu as easeOutCubic,
22226
- Ug as easeOutQuad,
22227
+ Gg as easeOutQuad,
22227
22228
  cm as editDistance,
22228
22229
  Zr as editError,
22229
22230
  uo as editLog,
22230
22231
  ep as elasticOut,
22231
22232
  lr as ellipsePoints,
22232
- Uk as ellipsoidMesh,
22233
+ Gk as ellipsoidMesh,
22233
22234
  tT as embrace,
22234
22235
  Q4 as embraceSpacing,
22235
22236
  CS as envelopeAt,
@@ -22285,13 +22286,13 @@ export {
22285
22286
  pr as humanDanceFrame,
22286
22287
  w4 as humanDanceTracks,
22287
22288
  b4 as humanFieldLabel,
22288
- G2 as humanGag,
22289
+ U2 as humanGag,
22289
22290
  Fl as humanGaitPose,
22290
22291
  Ll as humanGaitStrideLength,
22291
22292
  qd as humanPlan,
22292
22293
  wt as humanPose,
22293
22294
  kd as illustrationTones,
22294
- GT as imageSequence,
22295
+ UT as imageSequence,
22295
22296
  ro as inertiaDuration,
22296
22297
  oo as inertiaRest,
22297
22298
  ga as inertiaValueAt,
@@ -22305,9 +22306,9 @@ export {
22305
22306
  Sc as interpolateString,
22306
22307
  BS as invertSimilarity,
22307
22308
  Ng as isCubicBezierEasing,
22308
- Uh as isHeld,
22309
+ Gh as isHeld,
22309
22310
  wn as isInertiaTrack,
22310
- U3 as isMotionPathPoint,
22311
+ G3 as isMotionPathPoint,
22311
22312
  bu as isMotionPathTrack,
22312
22313
  tr as isParametricEasing,
22313
22314
  io as isPathData,
@@ -22317,18 +22318,18 @@ export {
22317
22318
  gS as isUnresolved,
22318
22319
  Ku as isoDepth,
22319
22320
  Xu as isometricBoxFaces,
22320
- Uu as isometricFaces,
22321
+ Gu as isometricFaces,
22321
22322
  dk as jointsInScene,
22322
22323
  Xb as jointsToScene,
22323
22324
  tk as leafOutfit,
22324
22325
  Tf as leafOutfitContours,
22325
22326
  pa as linear,
22326
22327
  zf as lipSyncKeyframes,
22327
- Ul as lipSyncOver,
22328
+ Gl as lipSyncOver,
22328
22329
  C4 as lipSyncTracks,
22329
22330
  Df as lit,
22330
22331
  de as live,
22331
- Uf as lookFields,
22332
+ Gf as lookFields,
22332
22333
  OS as loopBeats,
22333
22334
  TS as loopEase,
22334
22335
  ES as loopNoise,
@@ -22417,13 +22418,13 @@ export {
22417
22418
  En as quadruped,
22418
22419
  rS as quat,
22419
22420
  RT as quickPlay,
22420
- UT as quickTo,
22421
+ GT as quickTo,
22421
22422
  xx as rabbit,
22422
22423
  Lu as randomBetween,
22423
22424
  uS as randomChoice,
22424
22425
  dS as randomNormal,
22425
22426
  Vp as randomSnapped,
22426
- Ue as reachCharacter,
22427
+ Ge as reachCharacter,
22427
22428
  Jv as reachOf,
22428
22429
  ng as resolveActingStyle,
22429
22430
  If as resolveCharacterPoseKeys,
@@ -22435,12 +22436,12 @@ export {
22435
22436
  K2 as resolveHeadLook,
22436
22437
  ok as resolveHolding,
22437
22438
  K1 as resolveIllustration,
22438
- Ud as resolveMeasurements,
22439
+ Gd as resolveMeasurements,
22439
22440
  jw as resolveOrganicBody,
22440
22441
  Sl as resolvePoseKeys,
22441
22442
  Jp as resolveSequence,
22442
22443
  Fd as resolveStickFrame,
22443
- Gb as resolveStickPose,
22444
+ Ub as resolveStickPose,
22444
22445
  Du as resolveValue,
22445
22446
  mm as ribbon,
22446
22447
  ym as ribbonHeadCap,
@@ -22458,7 +22459,7 @@ export {
22458
22459
  s4 as scrubOnScroll,
22459
22460
  q4 as scrubPath,
22460
22461
  c4 as seatHeight,
22461
- Gp as serializeTimeline,
22462
+ Up as serializeTimeline,
22462
22463
  Xp as serializeTrack,
22463
22464
  zT as set,
22464
22465
  Xl as shade,
@@ -22480,7 +22481,7 @@ export {
22480
22481
  Wy as snapConfig,
22481
22482
  Dy as snapDuration,
22482
22483
  Ny as snapProgress,
22483
- G4 as softCartoonCharacter,
22484
+ U4 as softCartoonCharacter,
22484
22485
  go as solveAt,
22485
22486
  co as solvePlanSpace,
22486
22487
  gg as solveProp,
@@ -22535,7 +22536,7 @@ export {
22535
22536
  Zk as tubeMesh,
22536
22537
  dt as unknownName,
22537
22538
  i4 as unmount,
22538
- Gl as valueAt,
22539
+ Ul as valueAt,
22539
22540
  ZS as vec3,
22540
22541
  Ve as vehicle,
22541
22542
  vb as walkPose,