@algorisys/tinyfly 0.91.0 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +7 -6
  2. package/bin/tinyfly.mjs +34 -1
  3. package/docs/2d-animation-roadmap.md +191 -0
  4. package/docs/3d-rotations.md +164 -0
  5. package/docs/3d-support-plan.md +628 -0
  6. package/docs/DEPLOYMENT.md +414 -0
  7. package/docs/acting.md +466 -0
  8. package/docs/api-reference.md +2353 -0
  9. package/docs/camera.md +94 -0
  10. package/docs/cartoon-hands.md +96 -0
  11. package/docs/character-system-m1.md +218 -0
  12. package/docs/character-system-plan.md +384 -0
  13. package/docs/dance.md +315 -0
  14. package/docs/editor-guide.md +1249 -0
  15. package/docs/examples.md +765 -0
  16. package/docs/extending.md +168 -0
  17. package/docs/file-format.md +690 -0
  18. package/docs/getting-started.md +314 -0
  19. package/docs/grid-and-snapping.md +64 -0
  20. package/docs/gsap-compat.md +1241 -0
  21. package/docs/llm-guide.md +123 -0
  22. package/docs/maps.md +116 -0
  23. package/docs/onion-skinning.md +41 -0
  24. package/docs/pen-tool.md +65 -0
  25. package/docs/polygon-star.md +44 -0
  26. package/docs/scene-3d.md +299 -0
  27. package/docs/scroll-animation.md +314 -0
  28. package/docs/shape-morph.md +61 -0
  29. package/docs/sprite-sheet-export.md +54 -0
  30. package/docs/symbols-and-library.md +137 -0
  31. package/docs/teaching.md +348 -0
  32. package/docs/video-rendering.md +728 -0
  33. package/lib/addons/adapters.js +22 -18
  34. package/lib/addons/characters.js +2785 -1794
  35. package/lib/addons/target-properties-BtN9skb-.js +142 -0
  36. package/lib/browser/tinyfly.iife.js +9 -4
  37. package/lib/browser/tinyfly.js +6575 -5454
  38. package/lib/browser/tinyfly.umd.js +9 -4
  39. package/lib/engine/tinyfly-engine.js +286 -258
  40. package/lib/engine/tinyfly-engine.umd.cjs +2 -2
  41. package/lib/types/adapters/canvas/canvas-adapter.d.ts +6 -0
  42. package/lib/types/adapters/canvas/index.d.ts +1 -0
  43. package/lib/types/adapters/canvas/target-properties.d.ts +68 -0
  44. package/lib/types/characters/acting/beat-check.d.ts +95 -0
  45. package/lib/types/characters/acting/hand-path.d.ts +32 -0
  46. package/lib/types/characters/acting/index.d.ts +2 -0
  47. package/lib/types/characters/acting/script.d.ts +66 -7
  48. package/lib/types/characters/capabilities.d.ts +50 -0
  49. package/lib/types/characters/code-panel.d.ts +201 -0
  50. package/lib/types/characters/figure-actions.d.ts +11 -0
  51. package/lib/types/characters/figure-props.d.ts +87 -0
  52. package/lib/types/characters/gaits.d.ts +8 -0
  53. package/lib/types/characters/index.d.ts +4 -0
  54. package/lib/types/characters/species/human-motion.d.ts +45 -0
  55. package/lib/types/characters/species/human.d.ts +2 -0
  56. package/lib/types/characters/stick-figure.d.ts +2 -0
  57. package/lib/types/engine/authoring/did-you-mean.d.ts +14 -0
  58. package/lib/types/engine/authoring/index.d.ts +1 -0
  59. package/llms-full.txt +12548 -0
  60. package/llms.txt +57 -0
  61. package/package.json +6 -2
  62. package/skills/tinyfly/SKILL.md +64 -0
  63. package/lib/addons/camera-C7bZOWMB.js +0 -33
@@ -4,29 +4,29 @@ function Fe(t) {
4
4
  function xt(t) {
5
5
  return typeof t == "object" && t !== null && t.type !== "cubic-bezier";
6
6
  }
7
- const Nt = 2;
7
+ const Xt = 2;
8
8
  function re(t) {
9
9
  return t.some((e) => e.interpolation !== void 0) ? 2 : 1;
10
10
  }
11
- function Rt(t) {
11
+ function $t(t) {
12
12
  return t.property === "text" && "textConfig" in t;
13
13
  }
14
- function V(t) {
14
+ function j(t) {
15
15
  return t.kind === "inertia" && "inertia" in t;
16
16
  }
17
- function j(t) {
17
+ function V(t) {
18
18
  return t.kind === "spring" && "spring" in t;
19
19
  }
20
20
  function se(t) {
21
21
  return t.property === "motionPath" && "motionPathConfig" in t;
22
22
  }
23
- function Pr(t) {
23
+ function Rr(t) {
24
24
  return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
25
25
  }
26
- function Xe(t) {
26
+ function Ne(t) {
27
27
  return "keyframes" in t;
28
28
  }
29
- class Rr {
29
+ class Cr {
30
30
  _currentTime = 0;
31
31
  _isRunning = !1;
32
32
  onTick = null;
@@ -52,7 +52,7 @@ class Rr {
52
52
  this._currentTime = e;
53
53
  }
54
54
  }
55
- class $r {
55
+ class Dr {
56
56
  _currentTime = 0;
57
57
  _isRunning = !1;
58
58
  _lastFrameTime = null;
@@ -99,7 +99,7 @@ class $r {
99
99
  }
100
100
  }
101
101
  }
102
- function Ne(t, e) {
102
+ function Xe(t, e) {
103
103
  if (!(e > 0)) return t;
104
104
  const n = 1e3 / e;
105
105
  return Math.floor(t / n + 1e-9) * n;
@@ -140,7 +140,7 @@ function ae(t, e, n) {
140
140
  function ze(t, e) {
141
141
  return Array.from({ length: t }, (n, r) => ae(r, t, e));
142
142
  }
143
- function $t(t, e) {
143
+ function Rt(t, e) {
144
144
  return t <= 1 ? 0 : Math.max(...ze(t, e));
145
145
  }
146
146
  const tt = 1, ie = 6e4, st = ie / tt, L = {
@@ -150,7 +150,7 @@ const tt = 1, ie = 6e4, st = ie / tt, L = {
150
150
  velocity: 0,
151
151
  restDelta: 0.01,
152
152
  restSpeed: 0.1
153
- }, Dr = {
153
+ }, Ir = {
154
154
  gentle: { stiffness: 120, damping: 18, mass: 1 },
155
155
  default: { stiffness: 180, damping: 12, mass: 1 },
156
156
  snappy: { stiffness: 280, damping: 20, mass: 1 },
@@ -230,21 +230,21 @@ class ut {
230
230
  this.samples.length > st && (this.settledStep = st);
231
231
  }
232
232
  }
233
- function Cr(t, e) {
233
+ function Er(t, e) {
234
234
  return new ut(t).valueAt(e);
235
235
  }
236
- function Ir(t) {
236
+ function Lr(t) {
237
237
  return new ut(t).settleTime();
238
238
  }
239
- function Er(t) {
239
+ function Or(t) {
240
240
  const e = t.stiffness ?? L.stiffness, n = t.damping ?? L.damping, r = t.mass ?? L.mass;
241
241
  return n < 2 * Math.sqrt(e * r);
242
242
  }
243
- function Lr(t) {
243
+ function Fr(t) {
244
244
  const e = t.stiffness ?? L.stiffness, n = t.mass ?? L.mass;
245
245
  return 2 * Math.sqrt(e * n);
246
246
  }
247
- const Yt = 4, Ue = 2e-3, Ve = 1e-4, je = 6e4;
247
+ const Yt = 4, Ue = 2e-3, je = 1e-4, Ve = 6e4;
248
248
  function lt(t) {
249
249
  const e = t.friction ?? Yt;
250
250
  return e > 0 ? e : Yt;
@@ -269,10 +269,10 @@ function ht(t) {
269
269
  function ft(t) {
270
270
  const e = Math.abs(ht(t) - t.from);
271
271
  if (e === 0) return 0;
272
- const n = t.restDelta ?? Math.max(Ve, e * Ue);
272
+ const n = t.restDelta ?? Math.max(je, e * Ue);
273
273
  if (n >= e) return 0;
274
274
  const r = Math.log(e / n) / lt(t);
275
- return Math.min(je, r * 1e3);
275
+ return Math.min(Ve, r * 1e3);
276
276
  }
277
277
  function kt(t, e) {
278
278
  if (e <= 0) return t.from;
@@ -281,7 +281,7 @@ function kt(t, e) {
281
281
  const r = lt(t);
282
282
  return t.from + (n - t.from) * (1 - Math.exp(-r * e / 1e3));
283
283
  }
284
- function Or(t, e) {
284
+ function Nr(t, e) {
285
285
  const n = lt(t), r = ht(t);
286
286
  return e >= ft(t) ? 0 : (r - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
287
287
  }
@@ -433,27 +433,27 @@ function fn(t, e, n, r, s, o, a, i, c) {
433
433
  if (l === 0 || h === 0) return [[t, e, i, c, i, c]];
434
434
  const u = s * Math.PI / 180, f = Math.cos(u), d = Math.sin(u), m = (t - i) / 2, p = (e - c) / 2, g = f * m + d * p, M = -d * m + f * p, y = g * g / (l * l) + M * M / (h * h);
435
435
  if (y > 1) {
436
- const $ = Math.sqrt(y);
437
- l *= $, h *= $;
438
- }
439
- const k = o === a ? -1 : 1, w = l * l * h * h - l * l * M * M - h * h * g * g, b = l * l * M * M + h * h * g * g, v = k * Math.sqrt(Math.max(0, w / b)), A = v * l * M / h, D = -v * h * g / l, _ = f * A - d * D + (t + i) / 2, T = d * A + f * D + (e + c) / 2, x = ($, I, E, H) => {
440
- const pt = $ * E + I * H, rt = Math.sqrt(($ * $ + I * I) * (E * E + H * H)), Z = Math.acos(Math.max(-1, Math.min(1, pt / rt)));
441
- return $ * H - I * E < 0 ? -Z : Z;
442
- }, S = x(1, 0, (g - A) / l, (M - D) / h);
443
- let R = x((g - A) / l, (M - D) / h, (-g - A) / l, (-M - D) / h);
444
- !a && R > 0 && (R -= 2 * Math.PI), a && R < 0 && (R += 2 * Math.PI);
445
- const P = Math.max(1, Math.ceil(Math.abs(R) / (Math.PI / 2))), dt = R / P, nt = 4 / 3 * Math.tan(dt / 4), Ot = ($) => {
446
- const I = l * Math.cos($), E = h * Math.sin($);
436
+ const R = Math.sqrt(y);
437
+ l *= R, h *= R;
438
+ }
439
+ const k = o === a ? -1 : 1, w = l * l * h * h - l * l * M * M - h * h * g * g, b = l * l * M * M + h * h * g * g, v = k * Math.sqrt(Math.max(0, w / b)), A = v * l * M / h, C = -v * h * g / l, _ = f * A - d * C + (t + i) / 2, T = d * A + f * C + (e + c) / 2, x = (R, I, E, H) => {
440
+ const pt = R * E + I * H, rt = Math.sqrt((R * R + I * I) * (E * E + H * H)), Z = Math.acos(Math.max(-1, Math.min(1, pt / rt)));
441
+ return R * H - I * E < 0 ? -Z : Z;
442
+ }, S = x(1, 0, (g - A) / l, (M - C) / h);
443
+ let $ = x((g - A) / l, (M - C) / h, (-g - A) / l, (-M - C) / h);
444
+ !a && $ > 0 && ($ -= 2 * Math.PI), a && $ < 0 && ($ += 2 * Math.PI);
445
+ const P = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), dt = $ / P, nt = 4 / 3 * Math.tan(dt / 4), Ot = (R) => {
446
+ const I = l * Math.cos(R), E = h * Math.sin(R);
447
447
  return [f * I - d * E + _, d * I + f * E + T];
448
- }, Ft = ($) => {
449
- const I = -l * Math.sin($), E = h * Math.cos($);
448
+ }, Ft = (R) => {
449
+ const I = -l * Math.sin(R), E = h * Math.cos(R);
450
450
  return [f * I - d * E, d * I + f * E];
451
- }, Xt = [];
452
- for (let $ = 0; $ < P; $++) {
453
- const I = S + $ * dt, E = I + dt, [H, pt] = Ot(I), [rt, Z] = $ === P - 1 ? [i, c] : Ot(E), [Ie, Ee] = Ft(I), [Le, Oe] = Ft(E);
454
- Xt.push([H + nt * Ie, pt + nt * Ee, rt - nt * Le, Z - nt * Oe, rt, Z]);
451
+ }, Nt = [];
452
+ for (let R = 0; R < P; R++) {
453
+ const I = S + R * dt, E = I + dt, [H, pt] = Ot(I), [rt, Z] = R === P - 1 ? [i, c] : Ot(E), [Ie, Ee] = Ft(I), [Le, Oe] = Ft(E);
454
+ Nt.push([H + nt * Ie, pt + nt * Ee, rt - nt * Le, Z - nt * Oe, rt, Z]);
455
455
  }
456
- return Xt;
456
+ return Nt;
457
457
  }
458
458
  function Y(t, e, n, r, s) {
459
459
  const o = 1 - s;
@@ -510,7 +510,7 @@ function G(t) {
510
510
  }
511
511
  for (let w = 0; w + k <= g.length; w += k) {
512
512
  const b = g.slice(w, w + k), v = y ? r : 0, A = y ? s : 0;
513
- let D = null, _ = null;
513
+ let C = null, _ = null;
514
514
  switch (M) {
515
515
  case "M":
516
516
  w === 0 ? (r = b[0] + v, s = b[1] + A, o = r, a = s, (l < 0 || n[n.length - 1]?.subpath === l) && l++) : (u(q(r, s, b[0] + v, b[1] + A)), r = b[0] + v, s = b[1] + A);
@@ -526,41 +526,41 @@ function G(t) {
526
526
  break;
527
527
  case "C": {
528
528
  const T = [b[0] + v, b[1] + A, b[2] + v, b[3] + A, b[4] + v, b[5] + A];
529
- u(ot(r, s, T)), D = [T[2], T[3]], r = T[4], s = T[5];
529
+ u(ot(r, s, T)), C = [T[2], T[3]], r = T[4], s = T[5];
530
530
  break;
531
531
  }
532
532
  case "S": {
533
533
  const [T, x] = i ? [2 * r - i[0], 2 * s - i[1]] : [r, s], S = [T, x, b[0] + v, b[1] + A, b[2] + v, b[3] + A];
534
- u(ot(r, s, S)), D = [S[2], S[3]], r = S[4], s = S[5];
534
+ u(ot(r, s, S)), C = [S[2], S[3]], r = S[4], s = S[5];
535
535
  break;
536
536
  }
537
537
  case "Q":
538
538
  case "T": {
539
539
  let T = r, x = s;
540
540
  M === "Q" ? (T = b[0] + v, x = b[1] + A) : c && (T = 2 * r - c[0], x = 2 * s - c[1]);
541
- const S = M === "Q" ? b[2] + v : b[0] + v, R = M === "Q" ? b[3] + A : b[1] + A;
541
+ const S = M === "Q" ? b[2] + v : b[0] + v, $ = M === "Q" ? b[3] + A : b[1] + A;
542
542
  u(
543
543
  ot(r, s, [
544
544
  r + 2 / 3 * (T - r),
545
545
  s + 2 / 3 * (x - s),
546
546
  S + 2 / 3 * (T - S),
547
- R + 2 / 3 * (x - R),
547
+ $ + 2 / 3 * (x - $),
548
548
  S,
549
- R
549
+ $
550
550
  ])
551
- ), _ = [T, x], r = S, s = R;
551
+ ), _ = [T, x], r = S, s = $;
552
552
  break;
553
553
  }
554
554
  case "A": {
555
555
  const T = b[5] + v, x = b[6] + A;
556
- let S = r, R = s;
556
+ let S = r, $ = s;
557
557
  for (const P of fn(r, s, b[0], b[1], b[2], b[3], b[4], T, x))
558
- u(ot(S, R, P)), S = P[4], R = P[5];
558
+ u(ot(S, $, P)), S = P[4], $ = P[5];
559
559
  r = T, s = x;
560
560
  break;
561
561
  }
562
562
  }
563
- i = D, c = _;
563
+ i = C, c = _;
564
564
  }
565
565
  }
566
566
  const f = n.reduce((p, g) => p + g.length, 0), d = [];
@@ -622,16 +622,16 @@ function gn(t, e) {
622
622
  const { segments: n, totalLength: r } = G(t);
623
623
  return fe(n, Math.max(0, Math.min(1, e)) * r);
624
624
  }
625
- function Fr() {
625
+ function Xr() {
626
626
  W.clear();
627
627
  }
628
- function Xr(t) {
628
+ function Yr(t) {
629
629
  return G(t).totalLength;
630
630
  }
631
- const mn = 24, yn = 320, Mn = 2.5, J = 72, Nr = 64, _n = 0.2, bn = 128, et = /* @__PURE__ */ new Map();
632
- let at = 0, N;
633
- const Vt = (t) => Math.round(t * 100) / 100;
634
- function jt(t, e) {
631
+ const mn = 24, yn = 320, Mn = 2.5, J = 72, zr = 64, _n = 0.2, bn = 128, et = /* @__PURE__ */ new Map();
632
+ let at = 0, X;
633
+ const jt = (t) => Math.round(t * 100) / 100;
634
+ function Vt(t, e) {
635
635
  const { segments: n, subpaths: r, totalLength: s } = G(t);
636
636
  if (n.length === 0) return [];
637
637
  if (e) {
@@ -729,18 +729,18 @@ function Qt(t, e, n, r) {
729
729
  }
730
730
  function An(t, e, n) {
731
731
  const r = n.shapeIndex;
732
- if (N && N.from === t && N.to === e && N.shapeIndex === r) return N.plan;
732
+ if (X && X.from === t && X.to === e && X.shapeIndex === r) return X.plan;
733
733
  const o = et.get(String(r ?? "auto"))?.get(t)?.get(e);
734
734
  if (o)
735
- return N = { from: t, to: e, shapeIndex: r, plan: o }, o;
736
- const a = G(t).subpaths.filter((d) => d.length > 0).length === G(e).subpaths.filter((d) => d.length > 0).length, i = jt(t, !a), c = jt(e, !a), l = {
735
+ return X = { from: t, to: e, shapeIndex: r, plan: o }, o;
736
+ const a = G(t).subpaths.filter((d) => d.length > 0).length === G(e).subpaths.filter((d) => d.length > 0).length, i = Vt(t, !a), c = Vt(e, !a), l = {
737
737
  pairs: i.map((d, m) => wn(d, c[m], n))
738
738
  };
739
739
  at >= bn && (et.clear(), at = 0);
740
740
  const h = String(r ?? "auto"), u = et.get(h) ?? /* @__PURE__ */ new Map();
741
741
  et.set(h, u);
742
742
  const f = u.get(t) ?? /* @__PURE__ */ new Map();
743
- return u.set(t, f), f.set(e, l), at++, N = { from: t, to: e, shapeIndex: r, plan: l }, l;
743
+ return u.set(t, f), f.set(e, l), at++, X = { from: t, to: e, shapeIndex: r, plan: l }, l;
744
744
  }
745
745
  function vn(t, e, n, r = {}) {
746
746
  if (!t) return e;
@@ -753,33 +753,33 @@ function vn(t, e, n, r = {}) {
753
753
  let a = "";
754
754
  for (const i of o.pairs) {
755
755
  for (let c = 0; c < i.from.length; c += 2) {
756
- const l = Vt(i.from[c] + (i.to[c] - i.from[c]) * s), h = Vt(i.from[c + 1] + (i.to[c + 1] - i.from[c + 1]) * s);
756
+ const l = jt(i.from[c] + (i.to[c] - i.from[c]) * s), h = jt(i.from[c + 1] + (i.to[c + 1] - i.from[c + 1]) * s);
757
757
  a += `${c === 0 ? a ? " M" : "M" : " L"}${l} ${h}`;
758
758
  }
759
759
  i.closed && (a += " Z");
760
760
  }
761
761
  return a;
762
762
  }
763
- function Yr() {
764
- et.clear(), at = 0, N = void 0;
763
+ function Ur() {
764
+ et.clear(), at = 0, X = void 0;
765
765
  }
766
766
  function Pn(t) {
767
767
  return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(t);
768
768
  }
769
- const Q = Math.PI / 180, Rn = 0.9995;
770
- function Dt() {
769
+ const Q = Math.PI / 180, $n = 0.9995;
770
+ function Ct() {
771
771
  return [0, 0, 0, 1];
772
772
  }
773
773
  function it(t, e) {
774
774
  const n = Math.hypot(t[0], t[1], t[2]);
775
- if (n === 0) return Dt();
775
+ if (n === 0) return Ct();
776
776
  const r = e * Q / 2, s = Math.sin(r) / n;
777
777
  return [t[0] * s, t[1] * s, t[2] * s, Math.cos(r)];
778
778
  }
779
- function $n(t, e, n) {
779
+ function Rn(t, e, n) {
780
780
  return At(At(it([0, 1, 0], e), it([1, 0, 0], t)), it([0, 0, 1], n));
781
781
  }
782
- function Dn(t) {
782
+ function Cn(t) {
783
783
  const [e, n, r, s] = z(t), o = 2 * (e * r + n * s), a = 2 * (e * n + r * s), i = 1 - 2 * (e * e + r * r), c = 2 * (n * r - e * s), l = 1 - 2 * (n * n + r * r), h = 2 * (e * r - n * s), u = 1 - 2 * (e * e + n * n), f = Math.asin(Math.max(-1, Math.min(1, -c)));
784
784
  return Math.abs(c) < 0.9999999 ? [f / Q, Math.atan2(o, u) / Q, Math.atan2(a, i) / Q] : [f / Q, Math.atan2(-h, l) / Q, 0];
785
785
  }
@@ -800,15 +800,15 @@ function pe(t) {
800
800
  }
801
801
  function z(t) {
802
802
  const e = pe(t);
803
- return e === 0 ? Dt() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
803
+ return e === 0 ? Ct() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
804
804
  }
805
- function Cn(t) {
805
+ function Dn(t) {
806
806
  return [-t[0], -t[1], -t[2], t[3]];
807
807
  }
808
808
  function ge(t, e, n) {
809
809
  const r = z(t);
810
810
  let s = z(e), o = de(r, s);
811
- if (o < 0 && (s = [-s[0], -s[1], -s[2], -s[3]], o = -o), o > Rn)
811
+ if (o < 0 && (s = [-s[0], -s[1], -s[2], -s[3]], o = -o), o > $n)
812
812
  return z([
813
813
  r[0] + (s[0] - r[0]) * n,
814
814
  r[1] + (s[1] - r[1]) * n,
@@ -827,20 +827,20 @@ function In(t, e) {
827
827
  const [n, r, s, o] = z(t), a = 2 * (r * e[2] - s * e[1]), i = 2 * (s * e[0] - n * e[2]), c = 2 * (n * e[1] - r * e[0]);
828
828
  return [e[0] + o * a + (r * c - s * i), e[1] + o * i + (s * a - n * c), e[2] + o * c + (n * i - r * a)];
829
829
  }
830
- const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
830
+ const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
831
831
  __proto__: null,
832
- conjugate: Cn,
832
+ conjugate: Dn,
833
833
  dot: de,
834
834
  fromAxisAngle: it,
835
- fromEuler: $n,
836
- identity: Dt,
835
+ fromEuler: Rn,
836
+ identity: Ct,
837
837
  length: pe,
838
838
  multiply: At,
839
839
  normalize: z,
840
840
  rotateVec3: In,
841
841
  slerp: ge,
842
- toEuler: Dn
843
- }, Symbol.toStringTag, { value: "Module" })), X = (t, e, n) => t + (e - t) * n, me = 512, mt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map();
842
+ toEuler: Cn
843
+ }, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n, me = 512, mt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map();
844
844
  function Gt(t) {
845
845
  const e = mt.get(t);
846
846
  if (e) return e;
@@ -866,13 +866,13 @@ function Jt(t) {
866
866
  }
867
867
  const On = (t, e, n) => {
868
868
  if (Kt(t) && Kt(e)) {
869
- const [r, s, o] = Gt(t), [a, i, c] = Gt(e), l = X(r, a, n), h = X(s, i, n), u = X(o, c, n);
869
+ const [r, s, o] = Gt(t), [a, i, c] = Gt(e), l = N(r, a, n), h = N(s, i, n), u = N(o, c, n);
870
870
  return Ln(l, h, u);
871
871
  }
872
872
  if ((Zt(t) || qt(t)) && (Zt(e) || qt(e))) {
873
- const r = Jt(t), s = Jt(e), o = Math.round(X(r[0], s[0], n)), a = Math.round(X(r[1], s[1], n)), i = Math.round(X(r[2], s[2], n));
873
+ const r = Jt(t), s = Jt(e), o = Math.round(N(r[0], s[0], n)), a = Math.round(N(r[1], s[1], n)), i = Math.round(N(r[2], s[2], n));
874
874
  if (r.length === 4 || s.length === 4) {
875
- const c = r[3] ?? 1, l = s[3] ?? 1, h = X(c, l, n);
875
+ const c = r[3] ?? 1, l = s[3] ?? 1, h = N(c, l, n);
876
876
  return `rgba(${o}, ${a}, ${i}, ${h})`;
877
877
  }
878
878
  return `rgb(${o}, ${a}, ${i})`;
@@ -881,21 +881,21 @@ const On = (t, e, n) => {
881
881
  }, Fn = (t, e, n) => {
882
882
  const r = Math.min(t.length, e.length), s = [];
883
883
  for (let o = 0; o < r; o++)
884
- s.push(X(t[o], e[o], n));
884
+ s.push(N(t[o], e[o], n));
885
885
  return s;
886
- }, Xn = (t, e, n) => ge(t, e, n), te = (t, e, n) => n < 1 ? t : e, Nn = (t, e, n) => vn(t, e, n);
886
+ }, Nn = (t, e, n) => ge(t, e, n), te = (t, e, n) => n < 1 ? t : e, Xn = (t, e, n) => vn(t, e, n);
887
887
  function ye(t, e) {
888
- return e === "slerp" ? Xn : typeof t == "number" ? X : Array.isArray(t) ? Fn : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? On : Pn(t) ? Nn : te : te;
888
+ return e === "slerp" ? Nn : typeof t == "number" ? N : Array.isArray(t) ? Fn : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? On : Pn(t) ? Xn : te : te;
889
889
  }
890
890
  const Me = 1e3 / 60;
891
891
  function _e(t, e = {}) {
892
- if (!j(t))
892
+ if (!V(t))
893
893
  throw new Error(`bakeSpringTrack: track "${t.id}" is not a spring track`);
894
894
  const n = new ut(t.spring);
895
895
  return Te(t, (r) => n.valueAt(r), n.settleTime(), t.spring.from, t.spring.to, e);
896
896
  }
897
897
  function be(t, e = {}) {
898
- if (!V(t))
898
+ if (!j(t))
899
899
  throw new Error(`bakeInertiaTrack: track "${t.id}" is not an inertia track`);
900
900
  const n = t.inertia;
901
901
  return Te(
@@ -936,8 +936,8 @@ function Yn(t, e, n, r = {}) {
936
936
  const l = o(1);
937
937
  return c.push({ ...e, ...l !== 1 && { value: a(t.value, e.value, l) }, easing: "linear" }), c;
938
938
  }
939
- function Ur(t, e) {
940
- return j(t) ? _e(t, e) : V(t) ? be(t, e) : t;
939
+ function Vr(t, e) {
940
+ return V(t) ? _e(t, e) : j(t) ? be(t, e) : t;
941
941
  }
942
942
  function zn(t, e = {}) {
943
943
  const n = t.keyframes;
@@ -949,10 +949,10 @@ function zn(t, e = {}) {
949
949
  }
950
950
  return { ...t, keyframes: r };
951
951
  }
952
- function Vr(t, e) {
953
- return t.filter(Xe).map((n) => zn(n, e)).concat(
954
- t.filter(j).map((n) => _e(n, e)),
955
- t.filter(V).map((n) => be(n, e))
952
+ function Hr(t, e) {
953
+ return t.filter(Ne).map((n) => zn(n, e)).concat(
954
+ t.filter(V).map((n) => _e(n, e)),
955
+ t.filter(j).map((n) => be(n, e))
956
956
  );
957
957
  }
958
958
  function Un(t, e) {
@@ -966,7 +966,7 @@ function Un(t, e) {
966
966
  }
967
967
  return n.push(t[t.length - 1]), n;
968
968
  }
969
- function Vn(t) {
969
+ function jn(t) {
970
970
  const e = [...t.keyframes].sort((n, r) => n.time - r.time);
971
971
  return {
972
972
  ...t,
@@ -1017,7 +1017,7 @@ class _t {
1017
1017
  const { keyframes: e } = this.track;
1018
1018
  if (e.length === 0)
1019
1019
  return 0;
1020
- const n = e[e.length - 1].time, r = this.track.stagger ? $t(this.targets.length, this.track.stagger) : 0;
1020
+ const n = e[e.length - 1].time, r = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1021
1021
  return n + (this.track.delay ?? 0) + r + (this.track.endDelay ?? 0);
1022
1022
  }
1023
1023
  /**
@@ -1054,7 +1054,7 @@ class _t {
1054
1054
  return { from: null, to: null };
1055
1055
  }
1056
1056
  }
1057
- class jn {
1057
+ class Vn {
1058
1058
  track;
1059
1059
  targets;
1060
1060
  sampler;
@@ -1074,7 +1074,7 @@ class jn {
1074
1074
  }
1075
1075
  /** Settle time plus delay and the widest stagger offset. */
1076
1076
  getDuration() {
1077
- const e = this.track.stagger ? $t(this.targets.length, this.track.stagger) : 0;
1077
+ const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1078
1078
  return this.sampler.settleTime() + (this.track.delay ?? 0) + e;
1079
1079
  }
1080
1080
  getTrack() {
@@ -1101,7 +1101,7 @@ class Hn {
1101
1101
  }
1102
1102
  /** Settle time plus delay and the widest stagger offset. */
1103
1103
  getDuration() {
1104
- const e = this.track.stagger ? $t(this.targets.length, this.track.stagger) : 0;
1104
+ const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1105
1105
  return this.duration + (this.track.delay ?? 0) + e;
1106
1106
  }
1107
1107
  getTrack() {
@@ -1118,7 +1118,7 @@ function xe(t, e) {
1118
1118
  }
1119
1119
  return t.autoRotate && t.rotateOffset && (n.angle += t.rotateOffset), n;
1120
1120
  }
1121
- function jr(t, e, n, r) {
1121
+ function Br(t, e, n, r) {
1122
1122
  const s = e + (n - e) * r;
1123
1123
  return xe(t, s);
1124
1124
  }
@@ -1309,7 +1309,7 @@ class ke {
1309
1309
  */
1310
1310
  getStateAtTime(e) {
1311
1311
  const n = /* @__PURE__ */ new Map();
1312
- if (e = Ne(e, this._config.drawingRate ?? 0), this._hasSharedWrites())
1312
+ if (e = Xe(e, this._config.drawingRate ?? 0), this._hasSharedWrites())
1313
1313
  this._resolveShared(e, n);
1314
1314
  else
1315
1315
  for (const [r, s] of this._trackPlayers) {
@@ -1393,15 +1393,15 @@ class ke {
1393
1393
  * Add a track to the timeline.
1394
1394
  */
1395
1395
  addTrack(e) {
1396
- if (this._tracks.push(e), this._sharedWrites = null, V(e)) {
1396
+ if (this._tracks.push(e), this._sharedWrites = null, j(e)) {
1397
1397
  this._trackPlayers.set(e.id, new Hn(e));
1398
1398
  return;
1399
1399
  }
1400
- if (j(e)) {
1401
- this._trackPlayers.set(e.id, new jn(e)), this._springTracks.set(e.id, e);
1400
+ if (V(e)) {
1401
+ this._trackPlayers.set(e.id, new Vn(e)), this._springTracks.set(e.id, e);
1402
1402
  return;
1403
1403
  }
1404
- if (Rt(e))
1404
+ if ($t(e))
1405
1405
  this._trackPlayers.set(e.id, new _t(e)), this._textTracks.set(e.id, e);
1406
1406
  else if (se(e)) {
1407
1407
  const n = {
@@ -1467,7 +1467,7 @@ class ke {
1467
1467
  const n = this._trackPlayers.get(e);
1468
1468
  if (!n) return;
1469
1469
  const r = n.getTrack(), s = r.delay ?? 0;
1470
- if (j(r) || V(r))
1470
+ if (V(r) || j(r))
1471
1471
  return { from: s, to: n.getDuration() };
1472
1472
  const o = r.keyframes;
1473
1473
  if (!(!o || o.length === 0))
@@ -1577,7 +1577,7 @@ class ke {
1577
1577
  }
1578
1578
  }
1579
1579
  const Kn = 100;
1580
- function Hr(t, e, n, r) {
1580
+ function Wr(t, e, n, r) {
1581
1581
  const s = [], o = [], { duration: a, alternate: i } = r, c = (d, m, p, g) => {
1582
1582
  o.push([d, m]);
1583
1583
  const M = [];
@@ -1595,21 +1595,21 @@ function Hr(t, e, n, r) {
1595
1595
  return f > 0 && r.holding && !i ? { crossings: s, passes: o } : (c(l, n.time, h, u), { crossings: s, passes: o });
1596
1596
  }
1597
1597
  function Zn(t) {
1598
- return V(t) ? {
1598
+ return j(t) ? {
1599
1599
  id: t.id,
1600
1600
  target: t.target,
1601
1601
  property: t.property,
1602
1602
  kind: "inertia",
1603
1603
  inertia: we(t.inertia),
1604
1604
  ...F(t)
1605
- } : j(t) ? {
1605
+ } : V(t) ? {
1606
1606
  id: t.id,
1607
1607
  target: t.target,
1608
1608
  property: t.property,
1609
1609
  kind: "spring",
1610
1610
  spring: { ...t.spring },
1611
1611
  ...F(t)
1612
- } : Rt(t) ? {
1612
+ } : $t(t) ? {
1613
1613
  id: t.id,
1614
1614
  target: t.target,
1615
1615
  property: "text",
@@ -1652,7 +1652,7 @@ function F(t) {
1652
1652
  };
1653
1653
  }
1654
1654
  function qn(t) {
1655
- if (V(t)) {
1655
+ if (j(t)) {
1656
1656
  const e = t;
1657
1657
  return {
1658
1658
  id: e.id,
@@ -1663,7 +1663,7 @@ function qn(t) {
1663
1663
  ...F(e)
1664
1664
  };
1665
1665
  }
1666
- if (j(t)) {
1666
+ if (V(t)) {
1667
1667
  const e = t;
1668
1668
  return {
1669
1669
  id: e.id,
@@ -1674,7 +1674,7 @@ function qn(t) {
1674
1674
  ...F(e)
1675
1675
  };
1676
1676
  }
1677
- if (Rt(t)) {
1677
+ if ($t(t)) {
1678
1678
  const e = t;
1679
1679
  return {
1680
1680
  id: e.id,
@@ -1696,7 +1696,7 @@ function qn(t) {
1696
1696
  ...F(e)
1697
1697
  };
1698
1698
  }
1699
- return Vn({
1699
+ return jn({
1700
1700
  id: t.id,
1701
1701
  target: t.target,
1702
1702
  property: t.property,
@@ -1726,9 +1726,9 @@ function Jn(t) {
1726
1726
  }
1727
1727
  function tr(t) {
1728
1728
  const e = t.formatVersion ?? 1;
1729
- if (e > Nt)
1729
+ if (e > Xt)
1730
1730
  throw new Error(
1731
- `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Nt}. Update tinyfly to play it.`
1731
+ `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Xt}. Update tinyfly to play it.`
1732
1732
  );
1733
1733
  return new ke({
1734
1734
  id: t.id,
@@ -1738,14 +1738,14 @@ function tr(t) {
1738
1738
  captions: t.captions
1739
1739
  });
1740
1740
  }
1741
- function Br(t) {
1741
+ function Qr(t) {
1742
1742
  return JSON.stringify(Jn(t));
1743
1743
  }
1744
- function Wr(t) {
1744
+ function Gr(t) {
1745
1745
  const e = JSON.parse(t);
1746
1746
  return tr(e);
1747
1747
  }
1748
- function Qr(t) {
1748
+ function Kr(t) {
1749
1749
  let e = 2166136261;
1750
1750
  for (let n = 0; n < t.length; n++)
1751
1751
  e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
@@ -1768,15 +1768,15 @@ function er(t, e, n, r) {
1768
1768
  const s = Math.floor((n - e) / r), o = Math.round(t.next() * s);
1769
1769
  return e + o * r;
1770
1770
  }
1771
- function Gr(t, e) {
1771
+ function Zr(t, e) {
1772
1772
  if (e.length !== 0)
1773
1773
  return e[Math.floor(t.next() * e.length)];
1774
1774
  }
1775
1775
  const ve = /^([+\-*/])=\s*(-?[\d.]+)$/, Pe = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1776
- function Kr(t) {
1776
+ function qr(t) {
1777
1777
  return typeof t != "string" ? !1 : ve.test(t.trim()) || Pe.test(t.trim());
1778
1778
  }
1779
- function Re(t, e = {}) {
1779
+ function $e(t, e = {}) {
1780
1780
  if (typeof t != "string") return t;
1781
1781
  const n = t.trim(), r = ve.exec(n);
1782
1782
  if (r) {
@@ -1807,12 +1807,12 @@ function nr(t, e = 0, n) {
1807
1807
  const r = [];
1808
1808
  let s = e;
1809
1809
  for (const o of t) {
1810
- const a = Re(o, { base: s, random: n });
1810
+ const a = $e(o, { base: s, random: n });
1811
1811
  r.push(a), typeof a == "number" && (s = a);
1812
1812
  }
1813
1813
  return r;
1814
1814
  }
1815
- class Zr {
1815
+ class Jr {
1816
1816
  random;
1817
1817
  constructor(e) {
1818
1818
  this.random = Se(e);
@@ -1822,14 +1822,14 @@ class Zr {
1822
1822
  return this.random.seed;
1823
1823
  }
1824
1824
  resolve(e, n = 0) {
1825
- return Re(e, { base: n, random: this.random });
1825
+ return $e(e, { base: n, random: this.random });
1826
1826
  }
1827
1827
  resolveSequence(e, n = 0) {
1828
1828
  return nr(e, n, this.random);
1829
1829
  }
1830
1830
  }
1831
1831
  const rr = 600;
1832
- function qr(t) {
1832
+ function ts(t) {
1833
1833
  if (Array.isArray(t)) {
1834
1834
  const [f, d, m, p] = t;
1835
1835
  return { fn: ee(f, d, m, p), bezier: [f, d, m, p] };
@@ -1851,7 +1851,7 @@ function qr(t) {
1851
1851
  }
1852
1852
  return { fn: or(l, h) };
1853
1853
  }
1854
- function Jr(t = {}) {
1854
+ function es(t = {}) {
1855
1855
  const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, r = [1];
1856
1856
  for (let o = n; o > 2e-3; o *= n) r.push(2 * Math.sqrt(o));
1857
1857
  const s = r.reduce((o, a) => o + a, 0);
@@ -1870,7 +1870,7 @@ function Jr(t = {}) {
1870
1870
  return 1;
1871
1871
  };
1872
1872
  }
1873
- function ts(t = {}) {
1873
+ function ns(t = {}) {
1874
1874
  const e = Math.max(1, t.wiggles ?? 10), n = t.type ?? "easeOut", r = (s) => n === "uniform" ? 1 : n === "easeInOut" ? Math.sin(Math.PI * s) : (1 - s) ** 2;
1875
1875
  return (s) => s <= 0 || s >= 1 ? 0 : Math.sin(s * e * Math.PI * 2) * r(s);
1876
1876
  }
@@ -1918,7 +1918,7 @@ function ee(t, e, n, r) {
1918
1918
  };
1919
1919
  }
1920
1920
  const ar = 350, ir = 300, cr = 550;
1921
- function es(t, e = {}) {
1921
+ function rs(t, e = {}) {
1922
1922
  const n = e.lead ?? ar, r = e.gap ?? ir, s = e.tail ?? cr, o = [];
1923
1923
  let a = 0;
1924
1924
  return t.forEach((i, c) => {
@@ -1940,41 +1940,41 @@ function es(t, e = {}) {
1940
1940
  o.push({ id: i.id ?? `s${c}`, start: a, duration: u - a, cues: l }), a = u;
1941
1941
  }), { duration: a, scenes: o, cues: o.flatMap((i) => i.cues) };
1942
1942
  }
1943
- function ns(t) {
1943
+ function ss(t) {
1944
1944
  return t.cues.map((e) => ({ id: e.id, time: e.start, label: e.text }));
1945
1945
  }
1946
- function rs(t, e) {
1946
+ function os(t, e) {
1947
1947
  let n = t.scenes[0];
1948
1948
  for (const r of t.scenes)
1949
1949
  if (e >= r.start) n = r;
1950
1950
  else break;
1951
1951
  return n;
1952
1952
  }
1953
- const $e = (t) => 6e4 / t.bpm;
1954
- function Ct(t, e) {
1955
- return t.offset + e * $e(t);
1953
+ const Re = (t) => 6e4 / t.bpm;
1954
+ function Dt(t, e) {
1955
+ return t.offset + e * Re(t);
1956
1956
  }
1957
1957
  function It(t, e) {
1958
- return (e - t.offset) / $e(t);
1958
+ return (e - t.offset) / Re(t);
1959
1959
  }
1960
- function ss(t, e) {
1961
- return Ct(t, Math.round(It(t, e)));
1960
+ function as(t, e) {
1961
+ return Dt(t, Math.round(It(t, e)));
1962
1962
  }
1963
- function os(t, e) {
1964
- return Ct(t, Math.ceil(It(t, e) - 1e-9));
1963
+ function is(t, e) {
1964
+ return Dt(t, Math.ceil(It(t, e) - 1e-9));
1965
1965
  }
1966
- function as(t, e, n) {
1966
+ function cs(t, e, n) {
1967
1967
  const r = Math.max(1, Math.round(t.beatsPerBar ?? 4)), s = [];
1968
1968
  if (!(t.bpm > 0) || n < e) return s;
1969
1969
  for (let o = Math.ceil(It(t, e) - 1e-9); ; o++) {
1970
- const a = Ct(t, o);
1970
+ const a = Dt(t, o);
1971
1971
  if (a > n + 1e-9) break;
1972
1972
  s.push({ time: a, bar: (o % r + r) % r === 0, n: o });
1973
1973
  }
1974
1974
  return s;
1975
1975
  }
1976
1976
  const B = 100;
1977
- function is(t, e, n = {}) {
1977
+ function us(t, e, n = {}) {
1978
1978
  const r = n.minBpm ?? 70, s = n.maxBpm ?? 180, o = Math.max(1, Math.round(e / B)), a = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), i = Math.floor(a / o);
1979
1979
  if (i < 4) return { bpm: 120, offset: 0, confidence: 0 };
1980
1980
  const c = new Float64Array(i);
@@ -2013,15 +2013,15 @@ function is(t, e, n = {}) {
2013
2013
  if (_ < 1) continue;
2014
2014
  const T = Math.max(1, Math.round(_ * 4));
2015
2015
  for (let x = 0; x < T; x++) {
2016
- const S = x / T * _, R = y(_, S);
2017
- R > b && (b = R, w = S, k = _);
2016
+ const S = x / T * _, $ = y(_, S);
2017
+ $ > b && (b = $, w = S, k = _);
2018
2018
  }
2019
2019
  }
2020
- const v = 60 * B / k, A = m > 0 ? Math.max(0, Math.min(1, d(p) / m)) : 0, D = (w + 0.5) * 1e3 / B;
2021
- return { bpm: Math.round(v * 100) / 100, offset: Math.round(D % (6e4 / v)), confidence: A };
2020
+ const v = 60 * B / k, A = m > 0 ? Math.max(0, Math.min(1, d(p) / m)) : 0, C = (w + 0.5) * 1e3 / B;
2021
+ return { bpm: Math.round(v * 100) / 100, offset: Math.round(C % (6e4 / v)), confidence: A };
2022
2022
  }
2023
2023
  const ur = 600, lr = 250, ne = 1;
2024
- function cs(t, e) {
2024
+ function ls(t, e) {
2025
2025
  const n = e.target ?? "Camera", r = { x: e.stage.width / 2, y: e.stage.height / 2 }, s = {}, o = (u, f, d, m) => {
2026
2026
  const p = s[u] ??= [];
2027
2027
  for (; p.length > 0 && p[p.length - 1].time >= f; ) p.pop();
@@ -2076,8 +2076,33 @@ function cs(t, e) {
2076
2076
  }
2077
2077
  return Object.entries(s).map(([u, f]) => ({ id: `${n}-${u}`, target: n, property: u, keyframes: f }));
2078
2078
  }
2079
+ function hr(t, e) {
2080
+ const n = t.toLowerCase(), r = e.toLowerCase();
2081
+ let s = Array.from({ length: r.length + 1 }, (o, a) => a);
2082
+ for (let o = 1; o <= n.length; o++) {
2083
+ const a = [o];
2084
+ for (let i = 1; i <= r.length; i++)
2085
+ a[i] = Math.min(s[i] + 1, a[i - 1] + 1, s[i - 1] + (n[o - 1] === r[i - 1] ? 0 : 1));
2086
+ s = a;
2087
+ }
2088
+ return s[r.length];
2089
+ }
2090
+ function fr(t, e) {
2091
+ const n = t.toLowerCase(), r = e.find((a) => a.toLowerCase().includes(n) || n.includes(a.toLowerCase()));
2092
+ if (r && Math.min(t.length, r.length) >= 3) return r;
2093
+ let s, o = 1 / 0;
2094
+ for (const a of e) {
2095
+ const i = hr(t, a);
2096
+ i < o && (o = i, s = a);
2097
+ }
2098
+ return s !== void 0 && o <= Math.max(2, Math.floor(t.length / 3)) ? s : void 0;
2099
+ }
2100
+ function hs(t, e, n, r) {
2101
+ const s = typeof e == "string" ? r ?? fr(e, n) : void 0;
2102
+ return `Unknown ${t} ${JSON.stringify(e)}${s ? `: did you mean "${s}"?` : "."} Known: ${n.join(", ")}`;
2103
+ }
2079
2104
  const O = (t) => Math.round(t * 1e3) / 1e3;
2080
- function us(t, e = {}) {
2105
+ function fs(t, e = {}) {
2081
2106
  if (t.length === 0) return "";
2082
2107
  const n = e.curviness ?? 1, r = e.closed ?? !1, s = t.length;
2083
2108
  let o = `M${O(t[0].x)} ${O(t[0].y)}`;
@@ -2094,35 +2119,35 @@ function us(t, e = {}) {
2094
2119
  }
2095
2120
  return r ? `${o} Z` : o;
2096
2121
  }
2097
- const C = (t, e = 0) => {
2122
+ const D = (t, e = 0) => {
2098
2123
  const n = parseFloat(t ?? "");
2099
2124
  return Number.isFinite(n) ? n : e;
2100
2125
  };
2101
- function hr(t) {
2126
+ function dr(t) {
2102
2127
  const e = (t ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), n = [];
2103
2128
  for (let r = 0; r + 1 < e.length; r += 2) n.push({ x: e[r], y: e[r + 1] });
2104
2129
  return n;
2105
2130
  }
2106
- function ls(t) {
2131
+ function ds(t) {
2107
2132
  const e = t.attributes;
2108
2133
  switch (t.tag.toLowerCase()) {
2109
2134
  case "path":
2110
2135
  return e.d ?? null;
2111
2136
  case "circle":
2112
2137
  case "ellipse": {
2113
- const n = C(e.cx), r = C(e.cy), s = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.rx), o = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.ry);
2138
+ const n = D(e.cx), r = D(e.cy), s = t.tag.toLowerCase() === "circle" ? D(e.r) : D(e.rx), o = t.tag.toLowerCase() === "circle" ? D(e.r) : D(e.ry);
2114
2139
  return `M${n + s} ${r} A${s} ${o} 0 1 1 ${n - s} ${r} A${s} ${o} 0 1 1 ${n + s} ${r} Z`;
2115
2140
  }
2116
2141
  case "rect": {
2117
- const n = C(e.x), r = C(e.y), s = C(e.width), o = C(e.height);
2118
- let a = e.rx != null ? C(e.rx) : e.ry != null ? C(e.ry) : 0, i = e.ry != null ? C(e.ry) : a;
2142
+ const n = D(e.x), r = D(e.y), s = D(e.width), o = D(e.height);
2143
+ let a = e.rx != null ? D(e.rx) : e.ry != null ? D(e.ry) : 0, i = e.ry != null ? D(e.ry) : a;
2119
2144
  return a = Math.min(a, s / 2), i = Math.min(i, o / 2), a === 0 || i === 0 ? `M${n} ${r} H${n + s} V${r + o} H${n} Z` : `M${n + a} ${r} H${n + s - a} A${a} ${i} 0 0 1 ${n + s} ${r + i} V${r + o - i} A${a} ${i} 0 0 1 ${n + s - a} ${r + o} H${n + a} A${a} ${i} 0 0 1 ${n} ${r + o - i} V${r + i} A${a} ${i} 0 0 1 ${n + a} ${r} Z`;
2120
2145
  }
2121
2146
  case "line":
2122
- return `M${C(e.x1)} ${C(e.y1)} L${C(e.x2)} ${C(e.y2)}`;
2147
+ return `M${D(e.x1)} ${D(e.y1)} L${D(e.x2)} ${D(e.y2)}`;
2123
2148
  case "polyline":
2124
2149
  case "polygon": {
2125
- const n = hr(e.points);
2150
+ const n = dr(e.points);
2126
2151
  if (n.length === 0) return null;
2127
2152
  const r = n.map((s, o) => `${o === 0 ? "M" : "L"}${s.x} ${s.y}`).join(" ");
2128
2153
  return t.tag.toLowerCase() === "polygon" ? `${r} Z` : r;
@@ -2131,7 +2156,7 @@ function ls(t) {
2131
2156
  return null;
2132
2157
  }
2133
2158
  }
2134
- function hs(t, e, n) {
2159
+ function ps(t, e, n) {
2135
2160
  const r = Math.max(2, Math.round(n.samples ?? 32)), s = Math.max(0, n.length), o = n.since !== void 0 ? Math.max(e - s, n.since) : e - s;
2136
2161
  if (o >= e) return [];
2137
2162
  const a = n.period, i = [];
@@ -2141,8 +2166,8 @@ function hs(t, e, n) {
2141
2166
  }
2142
2167
  return i;
2143
2168
  }
2144
- const fr = 2.5;
2145
- function fs(t) {
2169
+ const pr = 2.5;
2170
+ function gs(t) {
2146
2171
  const e = [], n = [], r = t.length, s = (o, a) => {
2147
2172
  for (let i = o + a; i >= 0 && i < r; i += a) {
2148
2173
  const c = (t[i].x - t[o].x) * a, l = (t[i].y - t[o].y) * a, h = Math.hypot(c, l);
@@ -2155,12 +2180,12 @@ function fs(t) {
2155
2180
  let u = l[0] + h[0], f = l[1] + h[1];
2156
2181
  const d = Math.hypot(u, f);
2157
2182
  d < 1e-9 ? (u = l[0], f = l[1]) : (u /= d, f /= d);
2158
- const m = u * l[0] + f * l[1], p = Math.min(fr, 1 / Math.max(m, 1e-6)), g = a.width / 2 * p;
2183
+ const m = u * l[0] + f * l[1], p = Math.min(pr, 1 / Math.max(m, 1e-6)), g = a.width / 2 * p;
2159
2184
  e.push({ x: a.x - f * g, y: a.y + u * g }), n.push({ x: a.x + f * g, y: a.y - u * g });
2160
2185
  }
2161
2186
  return { left: e, right: n };
2162
2187
  }
2163
- function ds(t) {
2188
+ function ms(t) {
2164
2189
  const e = t.length;
2165
2190
  if (e < 2) return null;
2166
2191
  const n = t[e - 1];
@@ -2171,13 +2196,13 @@ function ds(t) {
2171
2196
  }
2172
2197
  return null;
2173
2198
  }
2174
- function dr(t, e) {
2199
+ function gr(t, e) {
2175
2200
  return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
2176
2201
  }
2177
2202
  function Et(t, e) {
2178
2203
  return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
2179
2204
  }
2180
- function De(t, e) {
2205
+ function Ce(t, e) {
2181
2206
  return [t[0] * e, t[1] * e, t[2] * e];
2182
2207
  }
2183
2208
  function ct(t, e) {
@@ -2189,32 +2214,32 @@ function vt(t, e) {
2189
2214
  function Lt(t) {
2190
2215
  return Math.hypot(t[0], t[1], t[2]);
2191
2216
  }
2192
- function pr(t, e) {
2217
+ function mr(t, e) {
2193
2218
  return Lt(Et(t, e));
2194
2219
  }
2195
2220
  function Pt(t) {
2196
2221
  const e = Lt(t);
2197
- return e === 0 ? [0, 0, 0] : De(t, 1 / e);
2222
+ return e === 0 ? [0, 0, 0] : Ce(t, 1 / e);
2198
2223
  }
2199
- function gr(t, e, n) {
2224
+ function yr(t, e, n) {
2200
2225
  return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
2201
2226
  }
2202
- const ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2227
+ const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2203
2228
  __proto__: null,
2204
- add: dr,
2229
+ add: gr,
2205
2230
  cross: vt,
2206
- distance: pr,
2231
+ distance: mr,
2207
2232
  dot: ct,
2208
2233
  length: Lt,
2209
- lerp: gr,
2234
+ lerp: yr,
2210
2235
  normalize: Pt,
2211
- scale: De,
2236
+ scale: Ce,
2212
2237
  subtract: Et
2213
- }, Symbol.toStringTag, { value: "Module" })), mr = Math.PI / 180;
2214
- function yr() {
2238
+ }, Symbol.toStringTag, { value: "Module" })), Mr = Math.PI / 180;
2239
+ function _r() {
2215
2240
  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
2216
2241
  }
2217
- function Mr(t, e) {
2242
+ function br(t, e) {
2218
2243
  const n = new Array(16);
2219
2244
  for (let r = 0; r < 4; r++)
2220
2245
  for (let s = 0; s < 4; s++) {
@@ -2224,13 +2249,13 @@ function Mr(t, e) {
2224
2249
  }
2225
2250
  return n;
2226
2251
  }
2227
- function _r(t) {
2252
+ function Tr(t) {
2228
2253
  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t[0], t[1], t[2], 1];
2229
2254
  }
2230
- function br(t) {
2255
+ function xr(t) {
2231
2256
  return [t[0], 0, 0, 0, 0, t[1], 0, 0, 0, 0, t[2], 0, 0, 0, 0, 1];
2232
2257
  }
2233
- function Ce(t) {
2258
+ function De(t) {
2234
2259
  const [e, n, r, s] = t;
2235
2260
  return [
2236
2261
  1 - 2 * (n * n + r * r),
@@ -2251,49 +2276,49 @@ function Ce(t) {
2251
2276
  1
2252
2277
  ];
2253
2278
  }
2254
- function Tr(t, e, n) {
2255
- const r = Ce(e);
2279
+ function kr(t, e, n) {
2280
+ const r = De(e);
2256
2281
  for (let s = 0; s < 3; s++)
2257
2282
  r[s] *= n[0], r[4 + s] *= n[1], r[8 + s] *= n[2];
2258
2283
  return r[12] = t[0], r[13] = t[1], r[14] = t[2], r;
2259
2284
  }
2260
- function xr(t) {
2285
+ function wr(t) {
2261
2286
  const e = new Array(16);
2262
2287
  for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) e[r * 4 + n] = t[n * 4 + r];
2263
2288
  return e;
2264
2289
  }
2265
- function kr(t) {
2266
- const [e, n, r, s, o, a, i, c, l, h, u, f, d, m, p, g] = t, M = e * a - n * o, y = e * i - r * o, k = e * c - s * o, w = n * i - r * a, b = n * c - s * a, v = r * c - s * i, A = l * m - h * d, D = l * p - u * d, _ = l * g - f * d, T = h * p - u * m, x = h * g - f * m, S = u * g - f * p, R = M * S - y * x + k * T + w * _ - b * D + v * A;
2267
- if (Math.abs(R) < 1e-12) return null;
2268
- const P = 1 / R;
2290
+ function Sr(t) {
2291
+ const [e, n, r, s, o, a, i, c, l, h, u, f, d, m, p, g] = t, M = e * a - n * o, y = e * i - r * o, k = e * c - s * o, w = n * i - r * a, b = n * c - s * a, v = r * c - s * i, A = l * m - h * d, C = l * p - u * d, _ = l * g - f * d, T = h * p - u * m, x = h * g - f * m, S = u * g - f * p, $ = M * S - y * x + k * T + w * _ - b * C + v * A;
2292
+ if (Math.abs($) < 1e-12) return null;
2293
+ const P = 1 / $;
2269
2294
  return [
2270
2295
  (a * S - i * x + c * T) * P,
2271
2296
  (r * x - n * S - s * T) * P,
2272
2297
  (m * v - p * b + g * w) * P,
2273
2298
  (u * b - h * v - f * w) * P,
2274
- (i * _ - o * S - c * D) * P,
2275
- (e * S - r * _ + s * D) * P,
2299
+ (i * _ - o * S - c * C) * P,
2300
+ (e * S - r * _ + s * C) * P,
2276
2301
  (p * k - d * v - g * y) * P,
2277
2302
  (l * v - u * k + f * y) * P,
2278
2303
  (o * x - a * _ + c * A) * P,
2279
2304
  (n * _ - e * x - s * A) * P,
2280
2305
  (d * b - m * k + g * M) * P,
2281
2306
  (h * k - l * b - f * M) * P,
2282
- (a * D - o * T - i * A) * P,
2283
- (e * T - n * D + r * A) * P,
2307
+ (a * C - o * T - i * A) * P,
2308
+ (e * T - n * C + r * A) * P,
2284
2309
  (m * y - d * w - p * M) * P,
2285
2310
  (l * w - h * y + u * M) * P
2286
2311
  ];
2287
2312
  }
2288
- function wr(t, e, n, r) {
2289
- const s = 1 / Math.tan(t * mr / 2), o = 1 / (n - r);
2313
+ function Ar(t, e, n, r) {
2314
+ const s = 1 / Math.tan(t * Mr / 2), o = 1 / (n - r);
2290
2315
  return [s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (r + n) * o, -1, 0, 0, 2 * r * n * o, 0];
2291
2316
  }
2292
- function Sr(t, e, n, r, s, o) {
2317
+ function vr(t, e, n, r, s, o) {
2293
2318
  const a = 1 / (e - t), i = 1 / (r - n), c = 1 / (o - s);
2294
2319
  return [2 * a, 0, 0, 0, 0, 2 * i, 0, 0, 0, 0, -2 * c, 0, -(e + t) * a, -(r + n) * i, -(o + s) * c, 1];
2295
2320
  }
2296
- function Ar(t, e, n = [0, 1, 0]) {
2321
+ function Pr(t, e, n = [0, 1, 0]) {
2297
2322
  const r = Pt(Et(t, e)), s = Pt(vt(n, r)), o = vt(r, s);
2298
2323
  return [
2299
2324
  s[0],
@@ -2314,66 +2339,67 @@ function Ar(t, e, n = [0, 1, 0]) {
2314
2339
  1
2315
2340
  ];
2316
2341
  }
2317
- function vr(t, e) {
2342
+ function $r(t, e) {
2318
2343
  const n = t[0] * e[0] + t[4] * e[1] + t[8] * e[2] + t[12], r = t[1] * e[0] + t[5] * e[1] + t[9] * e[2] + t[13], s = t[2] * e[0] + t[6] * e[1] + t[10] * e[2] + t[14], o = t[3] * e[0] + t[7] * e[1] + t[11] * e[2] + t[15];
2319
2344
  return o === 1 || o === 0 ? [n, r, s] : [n / o, r / o, s / o];
2320
2345
  }
2321
- const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2346
+ const Ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2322
2347
  __proto__: null,
2323
- compose: Tr,
2324
- fromQuat: Ce,
2325
- identity: yr,
2326
- invert: kr,
2327
- lookAt: Ar,
2328
- multiply: Mr,
2329
- orthographic: Sr,
2330
- perspective: wr,
2331
- scaling: br,
2332
- transformPoint: vr,
2333
- translation: _r,
2334
- transpose: xr
2348
+ compose: kr,
2349
+ fromQuat: De,
2350
+ identity: _r,
2351
+ invert: Sr,
2352
+ lookAt: Pr,
2353
+ multiply: br,
2354
+ orthographic: vr,
2355
+ perspective: Ar,
2356
+ scaling: xr,
2357
+ transformPoint: $r,
2358
+ translation: Tr,
2359
+ transpose: wr
2335
2360
  }, Symbol.toStringTag, { value: "Module" }));
2336
2361
  export {
2337
- $r as Clock,
2362
+ Dr as Clock,
2338
2363
  Me as DEFAULT_BAKE_INTERVAL_MS,
2339
2364
  Yt as DEFAULT_INERTIA_FRICTION,
2340
2365
  L as DEFAULT_SPRING,
2341
- Nt as FORMAT_VERSION,
2342
- je as INERTIA_MAX_DURATION_MS,
2366
+ Xt as FORMAT_VERSION,
2367
+ Ve as INERTIA_MAX_DURATION_MS,
2343
2368
  Hn as InertiaTrackPlayer,
2344
- Nr as MORPH_SAMPLES,
2345
- Rr as ManualClock,
2369
+ zr as MORPH_SAMPLES,
2370
+ Cr as ManualClock,
2346
2371
  ie as SPRING_MAX_DURATION_MS,
2347
- Dr as SPRING_PRESETS,
2372
+ Ir as SPRING_PRESETS,
2348
2373
  tt as SPRING_STEP_MS,
2349
2374
  ut as SpringSampler,
2350
- jn as SpringTrackPlayer,
2375
+ Vn as SpringTrackPlayer,
2351
2376
  ke as Timeline,
2352
2377
  _t as TrackPlayer,
2353
- Zr as ValueResolver,
2378
+ Jr as ValueResolver,
2354
2379
  rn as backOut,
2355
2380
  Yn as bakeEasing,
2356
2381
  be as bakeInertiaTrack,
2357
2382
  _e as bakeSpringTrack,
2358
2383
  It as beatAtTime,
2359
- $e as beatLength,
2360
- Ct as beatTime,
2361
- as as beatsBetween,
2384
+ Re as beatLength,
2385
+ Dt as beatTime,
2386
+ cs as beatsBetween,
2362
2387
  nn as bounceOut,
2363
- cs as cameraTracks,
2388
+ ls as cameraTracks,
2364
2389
  Wn as charactersFor,
2365
- Yr as clearMorphCache,
2366
- Fr as clearPathCache,
2390
+ Ur as clearMorphCache,
2391
+ Xr as clearPathCache,
2392
+ fr as closestName,
2367
2393
  tn as createCubicBezier,
2368
2394
  Se as createRandom,
2369
- Vn as createTrack,
2370
- Lr as criticalDamping,
2371
- Jr as customBounce,
2372
- qr as customEase,
2373
- ts as customWiggle,
2395
+ jn as createTrack,
2396
+ Fr as criticalDamping,
2397
+ es as customBounce,
2398
+ ts as customEase,
2399
+ ns as customWiggle,
2374
2400
  tr as deserializeTimeline,
2375
2401
  qn as deserializeTrack,
2376
- is as detectTempo,
2402
+ us as detectTempo,
2377
2403
  Ke as easeIn,
2378
2404
  ce as easeInCubic,
2379
2405
  qe as easeInOut,
@@ -2383,78 +2409,80 @@ export {
2383
2409
  Ze as easeOut,
2384
2410
  ue as easeOutCubic,
2385
2411
  Qe as easeOutQuad,
2412
+ hr as editDistance,
2386
2413
  en as elasticOut,
2387
2414
  zn as expandParametricEasings,
2388
2415
  re as formatVersionFor,
2389
- Wr as fromJSON,
2416
+ Gr as fromJSON,
2390
2417
  he as getEasingFunction,
2391
2418
  ye as getInterpolator,
2392
2419
  xe as getMotionPathPoint,
2393
- Xr as getPathLength,
2420
+ Yr as getPathLength,
2394
2421
  gn as getPointAtProgress,
2395
- Xe as hasKeyframes,
2396
- Qr as hashSeed,
2397
- Ne as heldTime,
2422
+ Ne as hasKeyframes,
2423
+ Kr as hashSeed,
2424
+ Xe as heldTime,
2398
2425
  ft as inertiaDuration,
2399
2426
  ht as inertiaRest,
2400
2427
  kt as inertiaValueAt,
2401
- Or as inertiaVelocityAt,
2428
+ Nr as inertiaVelocityAt,
2402
2429
  Fn as interpolateArray,
2403
2430
  On as interpolateColor,
2404
- jr as interpolateMotionPath,
2405
- X as interpolateNumber,
2406
- Nn as interpolatePathString,
2407
- Xn as interpolateQuaternion,
2431
+ Br as interpolateMotionPath,
2432
+ N as interpolateNumber,
2433
+ Xn as interpolatePathString,
2434
+ Nn as interpolateQuaternion,
2408
2435
  te as interpolateString,
2409
2436
  Fe as isCubicBezierEasing,
2410
- V as isInertiaTrack,
2411
- Pr as isMotionPathPoint,
2437
+ j as isInertiaTrack,
2438
+ Rr as isMotionPathPoint,
2412
2439
  se as isMotionPathTrack,
2413
2440
  xt as isParametricEasing,
2414
2441
  Pn as isPathData,
2415
- j as isSpringTrack,
2416
- Rt as isTextTrack,
2417
- Er as isUnderdamped,
2418
- Kr as isUnresolved,
2442
+ V as isSpringTrack,
2443
+ $t as isTextTrack,
2444
+ Or as isUnderdamped,
2445
+ qr as isUnresolved,
2419
2446
  wt as linear,
2420
- gs as mat4,
2447
+ Ms as mat4,
2421
2448
  Ye as maxStaggerDistance,
2422
2449
  vn as morphPath,
2423
- ns as narrationMarkers,
2424
- rs as narrationSceneAt,
2450
+ ss as narrationMarkers,
2451
+ os as narrationSceneAt,
2425
2452
  He as naturalRest,
2426
- ss as nearestBeat,
2427
- os as nextBeat,
2453
+ as as nearestBeat,
2454
+ is as nextBeat,
2428
2455
  on as parametricEasing,
2429
2456
  G as parsePath,
2430
- es as planNarration,
2431
- Hr as playheadCrossings,
2457
+ rs as planNarration,
2458
+ Wr as playheadCrossings,
2432
2459
  fe as pointAtDistance,
2433
- us as pointsToPath,
2434
- zr as quat,
2460
+ fs as pointsToPath,
2461
+ jr as quat,
2435
2462
  Ae as randomBetween,
2436
- Gr as randomChoice,
2463
+ Zr as randomChoice,
2437
2464
  er as randomSnapped,
2438
2465
  nr as resolveSequence,
2439
- Re as resolveValue,
2440
- fs as ribbon,
2441
- ds as ribbonHeadCap,
2466
+ $e as resolveValue,
2467
+ gs as ribbon,
2468
+ ms as ribbonHeadCap,
2442
2469
  Jn as serializeTimeline,
2443
2470
  Zn as serializeTrack,
2444
- ls as shapeToPathData,
2471
+ ds as shapeToPathData,
2445
2472
  Un as simplifyKeyframes,
2446
- Ir as springDuration,
2447
- Cr as springValueAt,
2473
+ Lr as springDuration,
2474
+ Er as springValueAt,
2448
2475
  oe as staggerDistance,
2449
2476
  ae as staggerOffset,
2450
2477
  ze as staggerOffsets,
2451
- $t as staggerSpan,
2478
+ Rt as staggerSpan,
2452
2479
  sn as stepsEasing,
2453
2480
  Gn as textAt,
2454
- Br as toJSON,
2455
- Ur as toKeyframedTrack,
2456
- Vr as toKeyframedTracks,
2481
+ Qr as toJSON,
2482
+ Vr as toKeyframedTrack,
2483
+ Hr as toKeyframedTracks,
2457
2484
  U as trackTargets,
2458
- hs as trailSamples,
2459
- ps as vec3
2485
+ ps as trailSamples,
2486
+ hs as unknownName,
2487
+ ys as vec3
2460
2488
  };