@algorisys/tinyfly 0.88.0 → 0.89.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.
@@ -99,6 +99,11 @@ class wr {
99
99
  }
100
100
  }
101
101
  }
102
+ function vr(t, e) {
103
+ if (!(e > 0)) return t;
104
+ const n = 1e3 / e;
105
+ return Math.floor(t / n + 1e-9) * n;
106
+ }
102
107
  function se(t, e, n = "start") {
103
108
  if (e <= 1) return 0;
104
109
  if (typeof n == "number") {
@@ -145,7 +150,7 @@ const tt = 1, ie = 6e4, st = ie / tt, L = {
145
150
  velocity: 0,
146
151
  restDelta: 0.01,
147
152
  restSpeed: 0.1
148
- }, vr = {
153
+ }, Pr = {
149
154
  gentle: { stiffness: 120, damping: 18, mass: 1 },
150
155
  default: { stiffness: 180, damping: 12, mass: 1 },
151
156
  snappy: { stiffness: 280, damping: 20, mass: 1 },
@@ -225,17 +230,17 @@ class ut {
225
230
  this.samples.length > st && (this.settledStep = st);
226
231
  }
227
232
  }
228
- function Pr(t, e) {
233
+ function $r(t, e) {
229
234
  return new ut(t).valueAt(e);
230
235
  }
231
- function $r(t) {
236
+ function Rr(t) {
232
237
  return new ut(t).settleTime();
233
238
  }
234
- function Rr(t) {
239
+ function Dr(t) {
235
240
  const e = t.stiffness ?? L.stiffness, n = t.damping ?? L.damping, r = t.mass ?? L.mass;
236
241
  return n < 2 * Math.sqrt(e * r);
237
242
  }
238
- function Dr(t) {
243
+ function Cr(t) {
239
244
  const e = t.stiffness ?? L.stiffness, n = t.mass ?? L.mass;
240
245
  return 2 * Math.sqrt(e * n);
241
246
  }
@@ -276,7 +281,7 @@ function kt(t, e) {
276
281
  const r = lt(t);
277
282
  return t.from + (n - t.from) * (1 - Math.exp(-r * e / 1e3));
278
283
  }
279
- function Cr(t, e) {
284
+ function Ir(t, e) {
280
285
  const n = lt(t), r = ht(t);
281
286
  return e >= ft(t) ? 0 : (r - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
282
287
  }
@@ -617,13 +622,13 @@ function hn(t, e) {
617
622
  const { segments: n, totalLength: r } = G(t);
618
623
  return he(n, Math.max(0, Math.min(1, e)) * r);
619
624
  }
620
- function Ir() {
625
+ function Er() {
621
626
  W.clear();
622
627
  }
623
- function Er(t) {
628
+ function Lr(t) {
624
629
  return G(t).totalLength;
625
630
  }
626
- const fn = 24, pn = 320, dn = 2.5, J = 72, Lr = 64, gn = 0.2, mn = 128, et = /* @__PURE__ */ new Map();
631
+ const fn = 24, pn = 320, dn = 2.5, J = 72, Or = 64, gn = 0.2, mn = 128, et = /* @__PURE__ */ new Map();
627
632
  let it = 0, X;
628
633
  const Vt = (t) => Math.round(t * 100) / 100;
629
634
  function jt(t, e) {
@@ -755,7 +760,7 @@ function kn(t, e, n, r = {}) {
755
760
  }
756
761
  return i;
757
762
  }
758
- function Or() {
763
+ function Fr() {
759
764
  et.clear(), it = 0, X = void 0;
760
765
  }
761
766
  function Sn(t) {
@@ -822,7 +827,7 @@ function $n(t, e) {
822
827
  const [n, r, s, o] = Y(t), i = 2 * (r * e[2] - s * e[1]), a = 2 * (s * e[0] - n * e[2]), c = 2 * (n * e[1] - r * e[0]);
823
828
  return [e[0] + o * i + (r * c - s * a), e[1] + o * a + (s * i - n * c), e[2] + o * c + (n * a - r * i)];
824
829
  }
825
- const Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
830
+ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
826
831
  __proto__: null,
827
832
  conjugate: Pn,
828
833
  dot: fe,
@@ -931,7 +936,7 @@ function On(t, e, n, r = {}) {
931
936
  const u = o(1);
932
937
  return c.push({ ...e, ...u !== 1 && { value: i(t.value, e.value, u) }, easing: "linear" }), c;
933
938
  }
934
- function Nr(t, e) {
939
+ function Xr(t, e) {
935
940
  return j(t) ? Me(t, e) : V(t) ? _e(t, e) : t;
936
941
  }
937
942
  function Fn(t, e = {}) {
@@ -944,7 +949,7 @@ function Fn(t, e = {}) {
944
949
  }
945
950
  return { ...t, keyframes: r };
946
951
  }
947
- function Xr(t, e) {
952
+ function zr(t, e) {
948
953
  return t.filter(Le).map((n) => Fn(n, e)).concat(
949
954
  t.filter(j).map((n) => Me(n, e)),
950
955
  t.filter(V).map((n) => _e(n, e))
@@ -1113,7 +1118,7 @@ function Te(t, e) {
1113
1118
  }
1114
1119
  return t.autoRotate && t.rotateOffset && (n.angle += t.rotateOffset), n;
1115
1120
  }
1116
- function zr(t, e, n, r) {
1121
+ function Yr(t, e, n, r) {
1117
1122
  const s = e + (n - e) * r;
1118
1123
  return Te(t, s);
1119
1124
  }
@@ -1564,7 +1569,7 @@ class Bn {
1564
1569
  }
1565
1570
  }
1566
1571
  const Wn = 100;
1567
- function Yr(t, e, n, r) {
1572
+ function Ur(t, e, n, r) {
1568
1573
  const s = [], o = [], { duration: i, alternate: a } = r, c = (p, M, d, g) => {
1569
1574
  o.push([p, M]);
1570
1575
  const _ = [];
@@ -1724,14 +1729,14 @@ function Zn(t) {
1724
1729
  captions: t.captions
1725
1730
  });
1726
1731
  }
1727
- function Ur(t) {
1732
+ function Vr(t) {
1728
1733
  return JSON.stringify(Kn(t));
1729
1734
  }
1730
- function Vr(t) {
1735
+ function jr(t) {
1731
1736
  const e = JSON.parse(t);
1732
1737
  return Zn(e);
1733
1738
  }
1734
- function jr(t) {
1739
+ function Hr(t) {
1735
1740
  let e = 2166136261;
1736
1741
  for (let n = 0; n < t.length; n++)
1737
1742
  e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
@@ -1754,12 +1759,12 @@ function Jn(t, e, n, r) {
1754
1759
  const s = Math.floor((n - e) / r), o = Math.round(t.next() * s);
1755
1760
  return e + o * r;
1756
1761
  }
1757
- function Hr(t, e) {
1762
+ function Br(t, e) {
1758
1763
  if (e.length !== 0)
1759
1764
  return e[Math.floor(t.next() * e.length)];
1760
1765
  }
1761
1766
  const Se = /^([+\-*/])=\s*(-?[\d.]+)$/, Ae = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1762
- function Br(t) {
1767
+ function Wr(t) {
1763
1768
  return typeof t != "string" ? !1 : Se.test(t.trim()) || Ae.test(t.trim());
1764
1769
  }
1765
1770
  function we(t, e = {}) {
@@ -1798,7 +1803,7 @@ function tr(t, e = 0, n) {
1798
1803
  }
1799
1804
  return r;
1800
1805
  }
1801
- class Wr {
1806
+ class Qr {
1802
1807
  random;
1803
1808
  constructor(e) {
1804
1809
  this.random = qn(e);
@@ -1815,7 +1820,7 @@ class Wr {
1815
1820
  }
1816
1821
  }
1817
1822
  const er = 600;
1818
- function Qr(t) {
1823
+ function Gr(t) {
1819
1824
  if (Array.isArray(t)) {
1820
1825
  const [f, p, M, d] = t;
1821
1826
  return { fn: ee(f, p, M, d), bezier: [f, p, M, d] };
@@ -1837,7 +1842,7 @@ function Qr(t) {
1837
1842
  }
1838
1843
  return { fn: rr(u, l) };
1839
1844
  }
1840
- function Gr(t = {}) {
1845
+ function Kr(t = {}) {
1841
1846
  const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, r = [1];
1842
1847
  for (let o = n; o > 2e-3; o *= n) r.push(2 * Math.sqrt(o));
1843
1848
  const s = r.reduce((o, i) => o + i, 0);
@@ -1856,7 +1861,7 @@ function Gr(t = {}) {
1856
1861
  return 1;
1857
1862
  };
1858
1863
  }
1859
- function Kr(t = {}) {
1864
+ function Zr(t = {}) {
1860
1865
  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;
1861
1866
  return (s) => s <= 0 || s >= 1 ? 0 : Math.sin(s * e * Math.PI * 2) * r(s);
1862
1867
  }
@@ -1904,7 +1909,7 @@ function ee(t, e, n, r) {
1904
1909
  };
1905
1910
  }
1906
1911
  const sr = 350, or = 300, ir = 550;
1907
- function Zr(t, e = {}) {
1912
+ function qr(t, e = {}) {
1908
1913
  const n = e.lead ?? sr, r = e.gap ?? or, s = e.tail ?? ir, o = [];
1909
1914
  let i = 0;
1910
1915
  return t.forEach((a, c) => {
@@ -1926,10 +1931,10 @@ function Zr(t, e = {}) {
1926
1931
  o.push({ id: a.id ?? `s${c}`, start: i, duration: h - i, cues: u }), i = h;
1927
1932
  }), { duration: i, scenes: o, cues: o.flatMap((a) => a.cues) };
1928
1933
  }
1929
- function qr(t) {
1934
+ function Jr(t) {
1930
1935
  return t.cues.map((e) => ({ id: e.id, time: e.start, label: e.text }));
1931
1936
  }
1932
- function Jr(t, e) {
1937
+ function ts(t, e) {
1933
1938
  let n = t.scenes[0];
1934
1939
  for (const r of t.scenes)
1935
1940
  if (e >= r.start) n = r;
@@ -1943,13 +1948,13 @@ function Ct(t, e) {
1943
1948
  function It(t, e) {
1944
1949
  return (e - t.offset) / ve(t);
1945
1950
  }
1946
- function ts(t, e) {
1951
+ function es(t, e) {
1947
1952
  return Ct(t, Math.round(It(t, e)));
1948
1953
  }
1949
- function es(t, e) {
1954
+ function ns(t, e) {
1950
1955
  return Ct(t, Math.ceil(It(t, e) - 1e-9));
1951
1956
  }
1952
- function ns(t, e, n) {
1957
+ function rs(t, e, n) {
1953
1958
  const r = Math.max(1, Math.round(t.beatsPerBar ?? 4)), s = [];
1954
1959
  if (!(t.bpm > 0) || n < e) return s;
1955
1960
  for (let o = Math.ceil(It(t, e) - 1e-9); ; o++) {
@@ -1960,7 +1965,7 @@ function ns(t, e, n) {
1960
1965
  return s;
1961
1966
  }
1962
1967
  const B = 100;
1963
- function rs(t, e, n = {}) {
1968
+ function ss(t, e, n = {}) {
1964
1969
  const r = n.minBpm ?? 70, s = n.maxBpm ?? 180, o = Math.max(1, Math.round(e / B)), i = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), a = Math.floor(i / o);
1965
1970
  if (a < 4) return { bpm: 120, offset: 0, confidence: 0 };
1966
1971
  const c = new Float64Array(a);
@@ -2007,7 +2012,7 @@ function rs(t, e, n = {}) {
2007
2012
  return { bpm: Math.round(v * 100) / 100, offset: Math.round(D % (6e4 / v)), confidence: A };
2008
2013
  }
2009
2014
  const O = (t) => Math.round(t * 1e3) / 1e3;
2010
- function ss(t, e = {}) {
2015
+ function os(t, e = {}) {
2011
2016
  if (t.length === 0) return "";
2012
2017
  const n = e.curviness ?? 1, r = e.closed ?? !1, s = t.length;
2013
2018
  let o = `M${O(t[0].x)} ${O(t[0].y)}`;
@@ -2033,7 +2038,7 @@ function ar(t) {
2033
2038
  for (let r = 0; r + 1 < e.length; r += 2) n.push({ x: e[r], y: e[r + 1] });
2034
2039
  return n;
2035
2040
  }
2036
- function os(t) {
2041
+ function is(t) {
2037
2042
  const e = t.attributes;
2038
2043
  switch (t.tag.toLowerCase()) {
2039
2044
  case "path":
@@ -2061,7 +2066,7 @@ function os(t) {
2061
2066
  return null;
2062
2067
  }
2063
2068
  }
2064
- function is(t, e, n) {
2069
+ function as(t, e, n) {
2065
2070
  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;
2066
2071
  if (o >= e) return [];
2067
2072
  const i = n.period, a = [];
@@ -2072,7 +2077,7 @@ function is(t, e, n) {
2072
2077
  return a;
2073
2078
  }
2074
2079
  const cr = 2.5;
2075
- function as(t) {
2080
+ function cs(t) {
2076
2081
  const e = [], n = [], r = t.length, s = (o, i) => {
2077
2082
  for (let a = o + i; a >= 0 && a < r; a += i) {
2078
2083
  const c = (t[a].x - t[o].x) * i, u = (t[a].y - t[o].y) * i, l = Math.hypot(c, u);
@@ -2090,7 +2095,7 @@ function as(t) {
2090
2095
  }
2091
2096
  return { left: e, right: n };
2092
2097
  }
2093
- function cs(t) {
2098
+ function us(t) {
2094
2099
  const e = t.length;
2095
2100
  if (e < 2) return null;
2096
2101
  const n = t[e - 1];
@@ -2129,7 +2134,7 @@ function Pt(t) {
2129
2134
  function hr(t, e, n) {
2130
2135
  return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
2131
2136
  }
2132
- const us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2137
+ const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2133
2138
  __proto__: null,
2134
2139
  add: ur,
2135
2140
  cross: vt,
@@ -2248,7 +2253,7 @@ function kr(t, e) {
2248
2253
  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];
2249
2254
  return o === 1 || o === 0 ? [n, r, s] : [n / o, r / o, s / o];
2250
2255
  }
2251
- const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2256
+ const hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2252
2257
  __proto__: null,
2253
2258
  compose: yr,
2254
2259
  fromQuat: $e,
@@ -2271,16 +2276,16 @@ export {
2271
2276
  Xt as FORMAT_VERSION,
2272
2277
  ze as INERTIA_MAX_DURATION_MS,
2273
2278
  Yn as InertiaTrackPlayer,
2274
- Lr as MORPH_SAMPLES,
2279
+ Or as MORPH_SAMPLES,
2275
2280
  Ar as ManualClock,
2276
2281
  ie as SPRING_MAX_DURATION_MS,
2277
- vr as SPRING_PRESETS,
2282
+ Pr as SPRING_PRESETS,
2278
2283
  tt as SPRING_STEP_MS,
2279
2284
  ut as SpringSampler,
2280
2285
  zn as SpringTrackPlayer,
2281
2286
  Bn as Timeline,
2282
2287
  _t as TrackPlayer,
2283
- Wr as ValueResolver,
2288
+ Qr as ValueResolver,
2284
2289
  Je as backOut,
2285
2290
  On as bakeEasing,
2286
2291
  _e as bakeInertiaTrack,
@@ -2288,21 +2293,21 @@ export {
2288
2293
  It as beatAtTime,
2289
2294
  ve as beatLength,
2290
2295
  Ct as beatTime,
2291
- ns as beatsBetween,
2296
+ rs as beatsBetween,
2292
2297
  qe as bounceOut,
2293
2298
  Vn as charactersFor,
2294
- Or as clearMorphCache,
2295
- Ir as clearPathCache,
2299
+ Fr as clearMorphCache,
2300
+ Er as clearPathCache,
2296
2301
  Ke as createCubicBezier,
2297
2302
  qn as createRandom,
2298
2303
  Xn as createTrack,
2299
- Dr as criticalDamping,
2300
- Gr as customBounce,
2301
- Qr as customEase,
2302
- Kr as customWiggle,
2304
+ Cr as criticalDamping,
2305
+ Kr as customBounce,
2306
+ Gr as customEase,
2307
+ Zr as customWiggle,
2303
2308
  Zn as deserializeTimeline,
2304
2309
  Gn as deserializeTrack,
2305
- rs as detectTempo,
2310
+ ss as detectTempo,
2306
2311
  Be as easeIn,
2307
2312
  ae as easeInCubic,
2308
2313
  Qe as easeInOut,
@@ -2315,21 +2320,22 @@ export {
2315
2320
  Ze as elasticOut,
2316
2321
  Fn as expandParametricEasings,
2317
2322
  ne as formatVersionFor,
2318
- Vr as fromJSON,
2323
+ jr as fromJSON,
2319
2324
  le as getEasingFunction,
2320
2325
  me as getInterpolator,
2321
2326
  Te as getMotionPathPoint,
2322
- Er as getPathLength,
2327
+ Lr as getPathLength,
2323
2328
  hn as getPointAtProgress,
2324
2329
  Le as hasKeyframes,
2325
- jr as hashSeed,
2330
+ Hr as hashSeed,
2331
+ vr as heldTime,
2326
2332
  ft as inertiaDuration,
2327
2333
  ht as inertiaRest,
2328
2334
  kt as inertiaValueAt,
2329
- Cr as inertiaVelocityAt,
2335
+ Ir as inertiaVelocityAt,
2330
2336
  In as interpolateArray,
2331
2337
  Cn as interpolateColor,
2332
- zr as interpolateMotionPath,
2338
+ Yr as interpolateMotionPath,
2333
2339
  N as interpolateNumber,
2334
2340
  Ln as interpolatePathString,
2335
2341
  En as interpolateQuaternion,
@@ -2342,47 +2348,47 @@ export {
2342
2348
  Sn as isPathData,
2343
2349
  j as isSpringTrack,
2344
2350
  $t as isTextTrack,
2345
- Rr as isUnderdamped,
2346
- Br as isUnresolved,
2351
+ Dr as isUnderdamped,
2352
+ Wr as isUnresolved,
2347
2353
  St as linear,
2348
- ls as mat4,
2354
+ hs as mat4,
2349
2355
  Oe as maxStaggerDistance,
2350
2356
  kn as morphPath,
2351
- qr as narrationMarkers,
2352
- Jr as narrationSceneAt,
2357
+ Jr as narrationMarkers,
2358
+ ts as narrationSceneAt,
2353
2359
  Ye as naturalRest,
2354
- ts as nearestBeat,
2355
- es as nextBeat,
2360
+ es as nearestBeat,
2361
+ ns as nextBeat,
2356
2362
  en as parametricEasing,
2357
2363
  G as parsePath,
2358
- Zr as planNarration,
2359
- Yr as playheadCrossings,
2364
+ qr as planNarration,
2365
+ Ur as playheadCrossings,
2360
2366
  he as pointAtDistance,
2361
- ss as pointsToPath,
2362
- Fr as quat,
2367
+ os as pointsToPath,
2368
+ Nr as quat,
2363
2369
  ke as randomBetween,
2364
- Hr as randomChoice,
2370
+ Br as randomChoice,
2365
2371
  Jn as randomSnapped,
2366
2372
  tr as resolveSequence,
2367
2373
  we as resolveValue,
2368
- as as ribbon,
2369
- cs as ribbonHeadCap,
2374
+ cs as ribbon,
2375
+ us as ribbonHeadCap,
2370
2376
  Kn as serializeTimeline,
2371
2377
  Qn as serializeTrack,
2372
- os as shapeToPathData,
2378
+ is as shapeToPathData,
2373
2379
  Nn as simplifyKeyframes,
2374
- $r as springDuration,
2375
- Pr as springValueAt,
2380
+ Rr as springDuration,
2381
+ $r as springValueAt,
2376
2382
  se as staggerDistance,
2377
2383
  oe as staggerOffset,
2378
2384
  Fe as staggerOffsets,
2379
2385
  Rt as staggerSpan,
2380
2386
  tn as stepsEasing,
2381
2387
  Hn as textAt,
2382
- Ur as toJSON,
2383
- Nr as toKeyframedTrack,
2384
- Xr as toKeyframedTracks,
2388
+ Vr as toJSON,
2389
+ Xr as toKeyframedTrack,
2390
+ zr as toKeyframedTracks,
2385
2391
  U as trackTargets,
2386
- is as trailSamples,
2387
- us as vec3
2392
+ as as trailSamples,
2393
+ ls as vec3
2388
2394
  };