@algorisys/tinyfly 0.90.0 → 0.92.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.
- package/README.md +5 -5
- package/lib/addons/adapters.js +179 -205
- package/lib/addons/camera-C7bZOWMB.js +33 -0
- package/lib/addons/characters.js +1410 -1290
- package/lib/browser/tinyfly.iife.js +4 -4
- package/lib/browser/tinyfly.js +2716 -2593
- package/lib/browser/tinyfly.umd.js +4 -4
- package/lib/cli/tools.js +16 -0
- package/lib/embed/tinyfly-embed.iife.js +4 -4
- package/lib/embed/tinyfly-embed.js +216 -203
- package/lib/engine/tinyfly-engine.js +287 -278
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/player/tinyfly-player.es.js +183 -170
- package/lib/player/tinyfly-player.iife.js +2 -2
- package/lib/player/tinyfly-player.umd.js +2 -2
- package/lib/types/characters/acting/script.d.ts +12 -1
- package/lib/types/characters/index.d.ts +2 -0
- package/lib/types/characters/species/human-motion.d.ts +45 -0
- package/lib/types/characters/species/human.d.ts +2 -0
- package/lib/types/engine/core/timeline.d.ts +3 -0
- package/lib/types/engine/types.d.ts +6 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ const Nt = 2;
|
|
|
8
8
|
function re(t) {
|
|
9
9
|
return t.some((e) => e.interpolation !== void 0) ? 2 : 1;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Rt(t) {
|
|
12
12
|
return t.property === "text" && "textConfig" in t;
|
|
13
13
|
}
|
|
14
14
|
function V(t) {
|
|
@@ -20,13 +20,13 @@ function j(t) {
|
|
|
20
20
|
function se(t) {
|
|
21
21
|
return t.property === "motionPath" && "motionPathConfig" in t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Pr(t) {
|
|
24
24
|
return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
|
|
25
25
|
}
|
|
26
26
|
function Xe(t) {
|
|
27
27
|
return "keyframes" in t;
|
|
28
28
|
}
|
|
29
|
-
class
|
|
29
|
+
class Rr {
|
|
30
30
|
_currentTime = 0;
|
|
31
31
|
_isRunning = !1;
|
|
32
32
|
onTick = null;
|
|
@@ -99,7 +99,7 @@ class $r {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Ne(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;
|
|
@@ -121,7 +121,7 @@ function oe(t, e, n = "start") {
|
|
|
121
121
|
return t;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ye(t, e = "start") {
|
|
125
125
|
if (t <= 1) return 0;
|
|
126
126
|
let n = 0;
|
|
127
127
|
for (let r = 0; r < t; r++)
|
|
@@ -132,16 +132,16 @@ function ae(t, e, n) {
|
|
|
132
132
|
if (n.offsets) return n.offsets[t] ?? 0;
|
|
133
133
|
const r = n.from ?? "start", s = oe(t, e, r);
|
|
134
134
|
if (n.amount !== void 0) {
|
|
135
|
-
const o =
|
|
135
|
+
const o = Ye(e, r);
|
|
136
136
|
return o === 0 ? 0 : n.amount * s / o;
|
|
137
137
|
}
|
|
138
138
|
return n.each !== void 0 ? n.each * s : 0;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function ze(t, e) {
|
|
141
141
|
return Array.from({ length: t }, (n, r) => ae(r, t, e));
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return t <= 1 ? 0 : Math.max(...
|
|
143
|
+
function $t(t, e) {
|
|
144
|
+
return t <= 1 ? 0 : Math.max(...ze(t, e));
|
|
145
145
|
}
|
|
146
146
|
const tt = 1, ie = 6e4, st = ie / tt, L = {
|
|
147
147
|
stiffness: 180,
|
|
@@ -244,15 +244,15 @@ function Lr(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,
|
|
247
|
+
const Yt = 4, Ue = 2e-3, Ve = 1e-4, je = 6e4;
|
|
248
248
|
function lt(t) {
|
|
249
249
|
const e = t.friction ?? Yt;
|
|
250
250
|
return e > 0 ? e : Yt;
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function He(t) {
|
|
253
253
|
return t.from + t.velocity / lt(t);
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Be(t, e) {
|
|
256
256
|
if (e === void 0) return t;
|
|
257
257
|
if (typeof e == "number")
|
|
258
258
|
return e > 0 ? Math.round(t / e) * e : t;
|
|
@@ -263,16 +263,16 @@ function He(t, e) {
|
|
|
263
263
|
return n;
|
|
264
264
|
}
|
|
265
265
|
function ht(t) {
|
|
266
|
-
let e = He(
|
|
266
|
+
let e = Be(He(t), t.end);
|
|
267
267
|
return t.min !== void 0 && (e = Math.max(t.min, e)), t.max !== void 0 && (e = Math.min(t.max, e)), e;
|
|
268
268
|
}
|
|
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(
|
|
272
|
+
const n = t.restDelta ?? Math.max(Ve, e * Ue);
|
|
273
273
|
if (n >= e) return 0;
|
|
274
274
|
const r = Math.log(e / n) / lt(t);
|
|
275
|
-
return Math.min(
|
|
275
|
+
return Math.min(je, r * 1e3);
|
|
276
276
|
}
|
|
277
277
|
function kt(t, e) {
|
|
278
278
|
if (e <= 0) return t.from;
|
|
@@ -285,29 +285,29 @@ function Or(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
|
}
|
|
288
|
-
const
|
|
289
|
-
linear:
|
|
290
|
-
"ease-in":
|
|
291
|
-
"ease-out":
|
|
292
|
-
"ease-in-out":
|
|
293
|
-
"ease-in-quad":
|
|
294
|
-
"ease-out-quad":
|
|
295
|
-
"ease-in-out-quad":
|
|
288
|
+
const wt = (t) => t, We = (t) => t * t, Qe = (t) => 1 - (1 - t) * (1 - t), Ge = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, ce = (t) => t * t * t, ue = (t) => 1 - Math.pow(1 - t, 3), le = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Ke = ce, Ze = ue, qe = le, Je = {
|
|
289
|
+
linear: wt,
|
|
290
|
+
"ease-in": Ke,
|
|
291
|
+
"ease-out": Ze,
|
|
292
|
+
"ease-in-out": qe,
|
|
293
|
+
"ease-in-quad": We,
|
|
294
|
+
"ease-out-quad": Qe,
|
|
295
|
+
"ease-in-out-quad": Ge,
|
|
296
296
|
"ease-in-cubic": ce,
|
|
297
297
|
"ease-out-cubic": ue,
|
|
298
298
|
"ease-in-out-cubic": le
|
|
299
299
|
};
|
|
300
|
-
function
|
|
300
|
+
function tn(t) {
|
|
301
301
|
const [e, n, r, s] = t, o = 3 * e, a = 3 * (r - e) - o, i = 1 - o - a, c = 3 * n, l = 3 * (s - n) - c, h = 1 - c - l, u = (p) => ((i * p + a) * p + o) * p, f = (p) => ((h * p + l) * p + c) * p, d = (p) => (3 * i * p + 2 * a) * p + o, m = (p) => {
|
|
302
302
|
let g = p;
|
|
303
303
|
for (let k = 0; k < 8; k++) {
|
|
304
|
-
const
|
|
305
|
-
if (Math.abs(
|
|
304
|
+
const w = u(g) - p;
|
|
305
|
+
if (Math.abs(w) < 1e-7)
|
|
306
306
|
return g;
|
|
307
307
|
const b = d(g);
|
|
308
308
|
if (Math.abs(b) < 1e-7)
|
|
309
309
|
break;
|
|
310
|
-
g -=
|
|
310
|
+
g -= w / b;
|
|
311
311
|
}
|
|
312
312
|
let M = 0, y = 1;
|
|
313
313
|
for (g = p; M < y; ) {
|
|
@@ -330,11 +330,11 @@ function gt(t, e = "out") {
|
|
|
330
330
|
const n = (r) => 1 - t(1 - r);
|
|
331
331
|
return e === "in" ? n : (r) => r < 0.5 ? n(r * 2) / 2 : t(r * 2 - 1) / 2 + 0.5;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function en(t = 1, e = 0.3) {
|
|
334
334
|
const n = Math.max(1, t), r = e / (2 * Math.PI) * Math.asin(1 / n);
|
|
335
335
|
return (s) => s <= 0 ? 0 : s >= 1 ? 1 : n * Math.pow(2, -10 * s) * Math.sin((s - r) * (2 * Math.PI) / e) + 1;
|
|
336
336
|
}
|
|
337
|
-
const
|
|
337
|
+
const nn = (t) => {
|
|
338
338
|
if (t <= 0) return 0;
|
|
339
339
|
if (t >= 1) return 1;
|
|
340
340
|
if (t < 1 / 2.75) return 7.5625 * t * t;
|
|
@@ -349,7 +349,7 @@ const en = (t) => {
|
|
|
349
349
|
const r = t - 2.625 / 2.75;
|
|
350
350
|
return 7.5625 * r * r + 0.984375;
|
|
351
351
|
};
|
|
352
|
-
function
|
|
352
|
+
function rn(t = 1.70158) {
|
|
353
353
|
return (e) => {
|
|
354
354
|
if (e <= 0) return 0;
|
|
355
355
|
if (e >= 1) return 1;
|
|
@@ -357,7 +357,7 @@ function nn(t = 1.70158) {
|
|
|
357
357
|
return n * n * ((t + 1) * n + t) + 1;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function sn(t, e = "end") {
|
|
361
361
|
const n = Math.max(1, Math.floor(t));
|
|
362
362
|
return (r) => {
|
|
363
363
|
if (r >= 1) return 1;
|
|
@@ -375,22 +375,22 @@ function rn(t, e = "end") {
|
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function on(t) {
|
|
379
379
|
switch (t.type) {
|
|
380
380
|
case "steps":
|
|
381
|
-
return
|
|
381
|
+
return sn(t.count, t.position);
|
|
382
382
|
case "elastic":
|
|
383
|
-
return gt(
|
|
383
|
+
return gt(en(t.amplitude, t.period), t.mode);
|
|
384
384
|
case "bounce":
|
|
385
|
-
return gt(
|
|
385
|
+
return gt(nn, t.mode);
|
|
386
386
|
case "back":
|
|
387
|
-
return gt(
|
|
387
|
+
return gt(rn(t.overshoot), t.mode);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
function he(t) {
|
|
391
|
-
return t === void 0 ?
|
|
391
|
+
return t === void 0 ? wt : Fe(t) ? tn(t.points) : xt(t) ? on(t) : Je[t] ?? wt;
|
|
392
392
|
}
|
|
393
|
-
const zt = 32,
|
|
393
|
+
const zt = 32, an = 256, W = /* @__PURE__ */ new Map(), cn = /[MmLlHhVvCcSsQqTtAaZz]/, un = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, ln = {
|
|
394
394
|
M: 2,
|
|
395
395
|
L: 2,
|
|
396
396
|
H: 1,
|
|
@@ -402,7 +402,7 @@ const zt = 32, on = 256, W = /* @__PURE__ */ new Map(), an = /[MmLlHhVvCcSsQqTtA
|
|
|
402
402
|
A: 7,
|
|
403
403
|
Z: 0
|
|
404
404
|
};
|
|
405
|
-
function
|
|
405
|
+
function hn(t) {
|
|
406
406
|
const e = [];
|
|
407
407
|
let n = 0, r = null;
|
|
408
408
|
const s = () => {
|
|
@@ -410,7 +410,7 @@ function ln(t) {
|
|
|
410
410
|
};
|
|
411
411
|
for (; n < t.length && (s(), !(n >= t.length)); ) {
|
|
412
412
|
const o = t[n];
|
|
413
|
-
if (
|
|
413
|
+
if (cn.test(o)) {
|
|
414
414
|
r = { type: o, args: [] }, e.push(r), n++;
|
|
415
415
|
continue;
|
|
416
416
|
}
|
|
@@ -421,36 +421,36 @@ function ln(t) {
|
|
|
421
421
|
r.args.push(o === "1" ? 1 : 0), n++;
|
|
422
422
|
continue;
|
|
423
423
|
}
|
|
424
|
-
const c =
|
|
424
|
+
const c = un.exec(t.slice(n));
|
|
425
425
|
if (!c) break;
|
|
426
426
|
r.args.push(parseFloat(c[0])), n += c[0].length;
|
|
427
427
|
}
|
|
428
428
|
return e;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function fn(t, e, n, r, s, o, a, i, c) {
|
|
431
431
|
if (t === i && e === c) return [];
|
|
432
432
|
let l = Math.abs(n), h = Math.abs(r);
|
|
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
|
|
437
|
-
l *=
|
|
438
|
-
}
|
|
439
|
-
const k = o === a ? -1 : 1,
|
|
440
|
-
const pt =
|
|
441
|
-
return
|
|
442
|
-
},
|
|
443
|
-
let
|
|
444
|
-
!a &&
|
|
445
|
-
const P = Math.max(1, Math.ceil(Math.abs(
|
|
446
|
-
const I = l * Math.cos(
|
|
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($);
|
|
447
447
|
return [f * I - d * E + _, d * I + f * E + T];
|
|
448
|
-
}, Ft = (
|
|
449
|
-
const I = -l * Math.sin(
|
|
448
|
+
}, Ft = ($) => {
|
|
449
|
+
const I = -l * Math.sin($), E = h * Math.cos($);
|
|
450
450
|
return [f * I - d * E, d * I + f * E];
|
|
451
451
|
}, Xt = [];
|
|
452
|
-
for (let
|
|
453
|
-
const I =
|
|
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
454
|
Xt.push([H + nt * Ie, pt + nt * Ee, rt - nt * Le, Z - nt * Oe, rt, Z]);
|
|
455
455
|
}
|
|
456
456
|
return Xt;
|
|
@@ -502,18 +502,18 @@ function G(t) {
|
|
|
502
502
|
const h = /* @__PURE__ */ new Set(), u = (p) => {
|
|
503
503
|
l < 0 && (l = 0), p.subpath = l, n.push(p);
|
|
504
504
|
};
|
|
505
|
-
for (const { type: p, args: g } of
|
|
506
|
-
const M = p.toUpperCase(), y = p !== M, k =
|
|
505
|
+
for (const { type: p, args: g } of hn(t)) {
|
|
506
|
+
const M = p.toUpperCase(), y = p !== M, k = ln[M];
|
|
507
507
|
if (M === "Z") {
|
|
508
508
|
(r !== o || s !== a) && u(q(r, s, o, a)), l >= 0 && h.add(l), r = o, s = a, i = c = null;
|
|
509
509
|
continue;
|
|
510
510
|
}
|
|
511
|
-
for (let
|
|
512
|
-
const b = g.slice(
|
|
511
|
+
for (let w = 0; w + k <= g.length; w += k) {
|
|
512
|
+
const b = g.slice(w, w + k), v = y ? r : 0, A = y ? s : 0;
|
|
513
513
|
let D = 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);
|
|
517
517
|
break;
|
|
518
518
|
case "L":
|
|
519
519
|
u(q(r, s, b[0] + v, b[1] + A)), r = b[0] + v, s = b[1] + A;
|
|
@@ -530,32 +530,32 @@ function G(t) {
|
|
|
530
530
|
break;
|
|
531
531
|
}
|
|
532
532
|
case "S": {
|
|
533
|
-
const [T, x] = i ? [2 * r - i[0], 2 * s - i[1]] : [r, s],
|
|
534
|
-
u(ot(r, s,
|
|
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];
|
|
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
|
|
541
|
+
const S = M === "Q" ? b[2] + v : b[0] + v, R = 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
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
546
|
+
S + 2 / 3 * (T - S),
|
|
547
|
+
R + 2 / 3 * (x - R),
|
|
548
|
+
S,
|
|
549
|
+
R
|
|
550
550
|
])
|
|
551
|
-
), _ = [T, x], r =
|
|
551
|
+
), _ = [T, x], r = S, s = R;
|
|
552
552
|
break;
|
|
553
553
|
}
|
|
554
554
|
case "A": {
|
|
555
555
|
const T = b[5] + v, x = b[6] + A;
|
|
556
|
-
let
|
|
557
|
-
for (const P of
|
|
558
|
-
u(ot(
|
|
556
|
+
let S = r, R = s;
|
|
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];
|
|
559
559
|
r = T, s = x;
|
|
560
560
|
break;
|
|
561
561
|
}
|
|
@@ -568,13 +568,13 @@ function G(t) {
|
|
|
568
568
|
const g = n[p].subpath;
|
|
569
569
|
let M = p, y = 0;
|
|
570
570
|
for (; M < n.length && n[M].subpath === g; ) y += n[M++].length;
|
|
571
|
-
const k = n[p],
|
|
571
|
+
const k = n[p], w = n[M - 1], b = h.has(g) || Math.abs(w.endX - k.startX) < 1e-9 && Math.abs(w.endY - k.startY) < 1e-9;
|
|
572
572
|
d.push({ start: p, end: M, length: y, closed: b }), p = M;
|
|
573
573
|
}
|
|
574
574
|
const m = { segments: n, totalLength: f, subpaths: d };
|
|
575
|
-
return W.size >=
|
|
575
|
+
return W.size >= an && W.delete(W.keys().next().value), W.set(t, m), m;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function dn(t, e) {
|
|
578
578
|
const n = t.lengths;
|
|
579
579
|
if (e <= 0) return 0;
|
|
580
580
|
if (e >= t.length) return 1;
|
|
@@ -586,7 +586,7 @@ function fn(t, e) {
|
|
|
586
586
|
const o = n[s] - n[r], a = o > 0 ? (e - n[r]) / o : 0;
|
|
587
587
|
return (r + a) / (n.length - 1);
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function pn(t, e) {
|
|
590
590
|
if (t.type === "L") {
|
|
591
591
|
const u = t.length > 0 ? Math.max(0, Math.min(1, e / t.length)) : 0;
|
|
592
592
|
return {
|
|
@@ -595,7 +595,7 @@ function dn(t, e) {
|
|
|
595
595
|
angle: Math.atan2(t.endY - t.startY, t.endX - t.startX) * 180 / Math.PI
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
|
-
const [n, r, s, o, a, i] = t.points, c =
|
|
598
|
+
const [n, r, s, o, a, i] = t.points, c = dn(t, e);
|
|
599
599
|
let l = Ut(t.startX, n, s, a, c), h = Ut(t.startY, r, o, i, c);
|
|
600
600
|
if (Math.hypot(l, h) < 1e-9) {
|
|
601
601
|
const u = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), f = Y(t.startX, n, s, a, u), d = Y(t.startY, r, o, i, u), m = Y(t.startX, n, s, a, c), p = Y(t.startY, r, o, i, c);
|
|
@@ -613,12 +613,12 @@ function fe(t, e, n = 0, r = t.length) {
|
|
|
613
613
|
for (let o = n; o < r; o++) {
|
|
614
614
|
const a = t[o];
|
|
615
615
|
if (s + a.length >= e || o === r - 1)
|
|
616
|
-
return
|
|
616
|
+
return pn(a, e - s);
|
|
617
617
|
s += a.length;
|
|
618
618
|
}
|
|
619
619
|
return { x: 0, y: 0, angle: 0 };
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
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
|
}
|
|
@@ -628,7 +628,7 @@ function Fr() {
|
|
|
628
628
|
function Xr(t) {
|
|
629
629
|
return G(t).totalLength;
|
|
630
630
|
}
|
|
631
|
-
const
|
|
631
|
+
const mn = 24, yn = 320, Mn = 2.5, J = 72, Nr = 64, _n = 0.2, bn = 128, et = /* @__PURE__ */ new Map();
|
|
632
632
|
let at = 0, N;
|
|
633
633
|
const Vt = (t) => Math.round(t * 100) / 100;
|
|
634
634
|
function jt(t, e) {
|
|
@@ -640,7 +640,7 @@ function jt(t, e) {
|
|
|
640
640
|
}
|
|
641
641
|
return r.filter((o) => o.length > 0).map((o) => ({ segments: n, start: o.start, end: o.end, length: o.length, closed: o.closed }));
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function St(t, e) {
|
|
644
644
|
const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), r = fe(t.segments, n * t.length, t.start, t.end);
|
|
645
645
|
return [r.x, r.y];
|
|
646
646
|
}
|
|
@@ -654,7 +654,7 @@ function Ht(t) {
|
|
|
654
654
|
function Bt(t, e) {
|
|
655
655
|
const n = [];
|
|
656
656
|
for (let r = 0; r < e; r++)
|
|
657
|
-
n.push(
|
|
657
|
+
n.push(St(t, t.closed ? r / e : r / (e - 1)));
|
|
658
658
|
return n;
|
|
659
659
|
}
|
|
660
660
|
function Wt(t) {
|
|
@@ -663,7 +663,7 @@ function Wt(t) {
|
|
|
663
663
|
e += r, n += s;
|
|
664
664
|
return e /= t.length, n /= t.length, t.map(([r, s]) => [r - e, s - n]);
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Tn(t, e, n) {
|
|
667
667
|
const r = t.closed && e.closed;
|
|
668
668
|
if (n !== void 0)
|
|
669
669
|
return { offset: r ? Math.abs(n) % J / J : 0, reversed: n < 0 };
|
|
@@ -682,25 +682,25 @@ function bn(t, e, n) {
|
|
|
682
682
|
}
|
|
683
683
|
return i;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function xn(t, e, n) {
|
|
686
686
|
return n ? ((e.reversed ? e.offset - t : t + e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function kn(t, e, n) {
|
|
689
689
|
return n ? ((e.reversed ? e.offset - t : t - e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
692
|
-
const r = t.closed && e.closed, s =
|
|
693
|
-
|
|
694
|
-
Math.min(
|
|
691
|
+
function wn(t, e, n) {
|
|
692
|
+
const r = t.closed && e.closed, s = Tn(t, e, n.shapeIndex), o = Math.max(
|
|
693
|
+
mn,
|
|
694
|
+
Math.min(yn, Math.ceil(Math.max(t.length, e.length) / Mn))
|
|
695
695
|
), a = /* @__PURE__ */ new Set(), i = (u) => a.add(Math.round(u * 1e7) / 1e7);
|
|
696
696
|
for (let u = 0; u <= o; u++) i(u / o);
|
|
697
697
|
for (const u of Ht(t)) i(u);
|
|
698
|
-
for (const u of Ht(e)) i(
|
|
698
|
+
for (const u of Ht(e)) i(kn(u, s, r));
|
|
699
699
|
let c = [...a].sort((u, f) => u - f);
|
|
700
700
|
r && (c = c.filter((u) => u < 1));
|
|
701
701
|
const l = [], h = [];
|
|
702
702
|
for (const u of c)
|
|
703
|
-
l.push(...
|
|
703
|
+
l.push(...St(t, u)), h.push(...St(e, xn(u, s, r)));
|
|
704
704
|
return Sn({ from: l, to: h, closed: r });
|
|
705
705
|
}
|
|
706
706
|
function Sn(t) {
|
|
@@ -711,7 +711,7 @@ function Sn(t) {
|
|
|
711
711
|
const r = [[0, e - 1]];
|
|
712
712
|
for (; r.length > 0; ) {
|
|
713
713
|
const [a, i] = r.pop();
|
|
714
|
-
let c = -1, l =
|
|
714
|
+
let c = -1, l = _n;
|
|
715
715
|
for (let h = a + 1; h < i; h++) {
|
|
716
716
|
const u = Math.max(Qt(t.from, a, i, h), Qt(t.to, a, i, h));
|
|
717
717
|
u > l && (l = u, c = h);
|
|
@@ -727,28 +727,28 @@ function Qt(t, e, n, r) {
|
|
|
727
727
|
const s = t[e * 2], o = t[e * 2 + 1], a = t[n * 2] - s, i = t[n * 2 + 1] - o, c = t[r * 2] - s, l = t[r * 2 + 1] - o, h = a * a + i * i, u = h === 0 ? 0 : Math.max(0, Math.min(1, (c * a + l * i) / h));
|
|
728
728
|
return Math.hypot(c - u * a, l - u * i);
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function An(t, e, n) {
|
|
731
731
|
const r = n.shapeIndex;
|
|
732
732
|
if (N && N.from === t && N.to === e && N.shapeIndex === r) return N.plan;
|
|
733
733
|
const o = et.get(String(r ?? "auto"))?.get(t)?.get(e);
|
|
734
734
|
if (o)
|
|
735
735
|
return N = { from: t, to: e, shapeIndex: r, plan: o }, o;
|
|
736
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 = {
|
|
737
|
-
pairs: i.map((d, m) =>
|
|
737
|
+
pairs: i.map((d, m) => wn(d, c[m], n))
|
|
738
738
|
};
|
|
739
|
-
at >=
|
|
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
743
|
return u.set(t, f), f.set(e, l), at++, N = { from: t, to: e, shapeIndex: r, plan: l }, l;
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function vn(t, e, n, r = {}) {
|
|
746
746
|
if (!t) return e;
|
|
747
747
|
if (!e) return t;
|
|
748
748
|
const s = Math.max(0, Math.min(1, n));
|
|
749
749
|
if (s === 0) return t;
|
|
750
750
|
if (s === 1) return e;
|
|
751
|
-
const o =
|
|
751
|
+
const o = An(t, e, r);
|
|
752
752
|
if (o.pairs.length === 0) return s < 0.5 ? t : e;
|
|
753
753
|
let a = "";
|
|
754
754
|
for (const i of o.pairs) {
|
|
@@ -763,10 +763,10 @@ function An(t, e, n, r = {}) {
|
|
|
763
763
|
function Yr() {
|
|
764
764
|
et.clear(), at = 0, N = void 0;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function Pn(t) {
|
|
767
767
|
return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(t);
|
|
768
768
|
}
|
|
769
|
-
const Q = Math.PI / 180,
|
|
769
|
+
const Q = Math.PI / 180, Rn = 0.9995;
|
|
770
770
|
function Dt() {
|
|
771
771
|
return [0, 0, 0, 1];
|
|
772
772
|
}
|
|
@@ -779,7 +779,7 @@ function it(t, e) {
|
|
|
779
779
|
function $n(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
|
|
782
|
+
function Dn(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
|
}
|
|
@@ -802,13 +802,13 @@ function z(t) {
|
|
|
802
802
|
const e = pe(t);
|
|
803
803
|
return e === 0 ? Dt() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function Cn(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 >
|
|
811
|
+
if (o < 0 && (s = [-s[0], -s[1], -s[2], -s[3]], o = -o), o > Rn)
|
|
812
812
|
return z([
|
|
813
813
|
r[0] + (s[0] - r[0]) * n,
|
|
814
814
|
r[1] + (s[1] - r[1]) * n,
|
|
@@ -823,13 +823,13 @@ function ge(t, e, n) {
|
|
|
823
823
|
r[3] * c + s[3] * l
|
|
824
824
|
]);
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
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
830
|
const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
831
831
|
__proto__: null,
|
|
832
|
-
conjugate:
|
|
832
|
+
conjugate: Cn,
|
|
833
833
|
dot: de,
|
|
834
834
|
fromAxisAngle: it,
|
|
835
835
|
fromEuler: $n,
|
|
@@ -837,9 +837,9 @@ const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
837
837
|
length: pe,
|
|
838
838
|
multiply: At,
|
|
839
839
|
normalize: z,
|
|
840
|
-
rotateVec3:
|
|
840
|
+
rotateVec3: In,
|
|
841
841
|
slerp: ge,
|
|
842
|
-
toEuler:
|
|
842
|
+
toEuler: Dn
|
|
843
843
|
}, Symbol.toStringTag, { value: "Module" })), X = (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);
|
|
@@ -851,23 +851,23 @@ function Gt(t) {
|
|
|
851
851
|
];
|
|
852
852
|
return mt.size < me && mt.set(t, r), r;
|
|
853
853
|
}
|
|
854
|
-
const Kt = (t) => t.charCodeAt(0) === 35, Zt = (t) => t.startsWith("rgb"), qt = (t) => t.startsWith("rgba"),
|
|
855
|
-
function
|
|
854
|
+
const Kt = (t) => t.charCodeAt(0) === 35, Zt = (t) => t.startsWith("rgb"), qt = (t) => t.startsWith("rgba"), En = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Mt = (t) => Math.round(t).toString(16).padStart(2, "0");
|
|
855
|
+
function Ln(t, e, n) {
|
|
856
856
|
return `#${Mt(t)}${Mt(e)}${Mt(n)}`;
|
|
857
857
|
}
|
|
858
858
|
function Jt(t) {
|
|
859
859
|
const e = yt.get(t);
|
|
860
860
|
if (e) return e;
|
|
861
|
-
const n = t.match(
|
|
861
|
+
const n = t.match(En);
|
|
862
862
|
if (!n)
|
|
863
863
|
throw new Error(`Invalid rgb color: ${t}`);
|
|
864
864
|
const r = parseInt(n[1], 10), s = parseInt(n[2], 10), o = parseInt(n[3], 10), a = n[4] !== void 0 ? [r, s, o, parseFloat(n[4])] : [r, s, o];
|
|
865
865
|
return yt.size < me && yt.set(t, a), a;
|
|
866
866
|
}
|
|
867
|
-
const
|
|
867
|
+
const On = (t, e, n) => {
|
|
868
868
|
if (Kt(t) && Kt(e)) {
|
|
869
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);
|
|
870
|
-
return
|
|
870
|
+
return Ln(l, h, u);
|
|
871
871
|
}
|
|
872
872
|
if ((Zt(t) || qt(t)) && (Zt(e) || qt(e))) {
|
|
873
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));
|
|
@@ -878,14 +878,14 @@ const Ln = (t, e, n) => {
|
|
|
878
878
|
return `rgb(${o}, ${a}, ${i})`;
|
|
879
879
|
}
|
|
880
880
|
return n < 1 ? t : e;
|
|
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
884
|
s.push(X(t[o], e[o], n));
|
|
885
885
|
return s;
|
|
886
|
-
},
|
|
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);
|
|
887
887
|
function ye(t, e) {
|
|
888
|
-
return e === "slerp" ?
|
|
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;
|
|
889
889
|
}
|
|
890
890
|
const Me = 1e3 / 60;
|
|
891
891
|
function _e(t, e = {}) {
|
|
@@ -916,12 +916,12 @@ function Te(t, e, n, r, s, o) {
|
|
|
916
916
|
id: t.id,
|
|
917
917
|
target: t.target,
|
|
918
918
|
property: t.property,
|
|
919
|
-
keyframes: i > 0 ?
|
|
919
|
+
keyframes: i > 0 ? Un(l, i) : l,
|
|
920
920
|
...t.targets && { targets: [...t.targets] },
|
|
921
921
|
...t.stagger && { stagger: { ...t.stagger } }
|
|
922
922
|
};
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function Yn(t, e, n, r = {}) {
|
|
925
925
|
const s = r.intervalMs ?? Me, o = typeof n == "function" ? n : he(n), a = ye(t.value, r.interpolation), i = e.time - t.time;
|
|
926
926
|
if (i <= 0) return [e];
|
|
927
927
|
const c = [];
|
|
@@ -939,23 +939,23 @@ function Nn(t, e, n, r = {}) {
|
|
|
939
939
|
function Ur(t, e) {
|
|
940
940
|
return j(t) ? _e(t, e) : V(t) ? be(t, e) : t;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function zn(t, e = {}) {
|
|
943
943
|
const n = t.keyframes;
|
|
944
944
|
if (!n.some((o) => xt(o.easing))) return t;
|
|
945
945
|
const r = n.length > 0 ? [n[0]] : [], s = { ...e, interpolation: t.interpolation ?? e.interpolation };
|
|
946
946
|
for (let o = 1; o < n.length; o++) {
|
|
947
947
|
const a = n[o];
|
|
948
|
-
xt(a.easing) ? r.push(...
|
|
948
|
+
xt(a.easing) ? r.push(...Yn(n[o - 1], a, a.easing, s)) : r.push(a);
|
|
949
949
|
}
|
|
950
950
|
return { ...t, keyframes: r };
|
|
951
951
|
}
|
|
952
952
|
function Vr(t, e) {
|
|
953
|
-
return t.filter(Xe).map((n) =>
|
|
953
|
+
return t.filter(Xe).map((n) => zn(n, e)).concat(
|
|
954
954
|
t.filter(j).map((n) => _e(n, e)),
|
|
955
955
|
t.filter(V).map((n) => be(n, e))
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Un(t, e) {
|
|
959
959
|
if (t.length <= 2) return t;
|
|
960
960
|
const n = [t[0]];
|
|
961
961
|
for (let r = 1; r < t.length - 1; r++) {
|
|
@@ -966,7 +966,7 @@ function zn(t, e) {
|
|
|
966
966
|
}
|
|
967
967
|
return n.push(t[t.length - 1]), n;
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function Vn(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 ?
|
|
1020
|
+
const n = e[e.length - 1].time, r = this.track.stagger ? $t(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
|
|
1057
|
+
class jn {
|
|
1058
1058
|
track;
|
|
1059
1059
|
targets;
|
|
1060
1060
|
sampler;
|
|
@@ -1074,14 +1074,14 @@ class Vn {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
/** Settle time plus delay and the widest stagger offset. */
|
|
1076
1076
|
getDuration() {
|
|
1077
|
-
const e = this.track.stagger ?
|
|
1077
|
+
const e = this.track.stagger ? $t(this.targets.length, this.track.stagger) : 0;
|
|
1078
1078
|
return this.sampler.settleTime() + (this.track.delay ?? 0) + e;
|
|
1079
1079
|
}
|
|
1080
1080
|
getTrack() {
|
|
1081
1081
|
return this.track;
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
|
-
class
|
|
1084
|
+
class Hn {
|
|
1085
1085
|
track;
|
|
1086
1086
|
targets;
|
|
1087
1087
|
duration;
|
|
@@ -1101,7 +1101,7 @@ class jn {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
/** Settle time plus delay and the widest stagger offset. */
|
|
1103
1103
|
getDuration() {
|
|
1104
|
-
const e = this.track.stagger ?
|
|
1104
|
+
const e = this.track.stagger ? $t(this.targets.length, this.track.stagger) : 0;
|
|
1105
1105
|
return this.duration + (this.track.delay ?? 0) + e;
|
|
1106
1106
|
}
|
|
1107
1107
|
getTrack() {
|
|
@@ -1109,7 +1109,7 @@ class jn {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
function xe(t, e) {
|
|
1112
|
-
const n = { ...
|
|
1112
|
+
const n = { ...gn(t.pathData, e) };
|
|
1113
1113
|
if (t.matrix) {
|
|
1114
1114
|
const [r, s, o, a, i, c] = t.matrix, { x: l, y: h } = n;
|
|
1115
1115
|
n.x = r * l + o * h + i, n.y = s * l + a * h + c;
|
|
@@ -1127,16 +1127,16 @@ const bt = {
|
|
|
1127
1127
|
lowerCase: "abcdefghijklmnopqrstuvwxyz",
|
|
1128
1128
|
upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
1129
1129
|
numbers: "0123456789"
|
|
1130
|
-
},
|
|
1131
|
-
function
|
|
1130
|
+
}, Bn = 20;
|
|
1131
|
+
function Wn(t) {
|
|
1132
1132
|
const e = bt[t ?? "upperCase"] ?? t ?? bt.upperCase, n = Array.from(e);
|
|
1133
1133
|
return n.length > 0 ? n : Array.from(bt.upperCase);
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function Qn(t, e, n) {
|
|
1136
1136
|
let r = (t | 0) ^ Math.imul(e + 1, 2654435761) ^ Math.imul(n + 1, 2246822507);
|
|
1137
1137
|
return r = Math.imul(r ^ r >>> 16, 2146121005), r = Math.imul(r ^ r >>> 15, 2221713035), (r ^ r >>> 16) >>> 0;
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function Gn(t, e, n = 0) {
|
|
1140
1140
|
const r = t.from ?? "", s = t.to, o = Math.max(0, Math.min(1, e));
|
|
1141
1141
|
if (o <= 0) return r;
|
|
1142
1142
|
if (o >= 1) return s;
|
|
@@ -1145,12 +1145,12 @@ function Qn(t, e, n = 0) {
|
|
|
1145
1145
|
const y = Math.round(o * Math.max(a.length, i.length));
|
|
1146
1146
|
return c ? a.slice(0, Math.max(0, a.length - y)).join("") + i.slice(Math.max(0, i.length - y)).join("") : i.slice(0, y).join("") + a.slice(y).join("");
|
|
1147
1147
|
}
|
|
1148
|
-
const l = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), h = Math.max(0, (o - l) / (1 - l)), u = Math.floor(h * i.length), f = t.tweenLength === !1 ? i.length : Math.round(a.length + (i.length - a.length) * o), d =
|
|
1148
|
+
const l = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), h = Math.max(0, (o - l) / (1 - l)), u = Math.floor(h * i.length), f = t.tweenLength === !1 ? i.length : Math.round(a.length + (i.length - a.length) * o), d = Wn(t.chars), m = t.refreshRate ?? Bn, p = m > 0 ? Math.floor(n * m / 1e3) : 0, g = t.seed ?? 1;
|
|
1149
1149
|
let M = "";
|
|
1150
1150
|
for (let y = 0; y < f; y++) {
|
|
1151
|
-
const k = c ? y >= f - u : y < u,
|
|
1152
|
-
k &&
|
|
1153
|
-
` ? M +=
|
|
1151
|
+
const k = c ? y >= f - u : y < u, w = c ? i[i.length - (f - y)] : i[y];
|
|
1152
|
+
k && w !== void 0 || w === " " || w === `
|
|
1153
|
+
` ? M += w : M += d[Qn(g, y, p) % d.length];
|
|
1154
1154
|
}
|
|
1155
1155
|
return M;
|
|
1156
1156
|
}
|
|
@@ -1223,6 +1223,14 @@ class ke {
|
|
|
1223
1223
|
set speed(e) {
|
|
1224
1224
|
this._config.speed = e;
|
|
1225
1225
|
}
|
|
1226
|
+
/** Drawings per second (0: every frame); see `TimelineConfig.drawingRate`. */
|
|
1227
|
+
get drawingRate() {
|
|
1228
|
+
return this._config.drawingRate ?? 0;
|
|
1229
|
+
}
|
|
1230
|
+
set drawingRate(e) {
|
|
1231
|
+
const n = { ...this._config };
|
|
1232
|
+
e > 0 ? n.drawingRate = e : delete n.drawingRate, this._config = n;
|
|
1233
|
+
}
|
|
1226
1234
|
/**
|
|
1227
1235
|
* Start or resume playback.
|
|
1228
1236
|
* If at the end and direction is forward, reset to beginning.
|
|
@@ -1301,7 +1309,7 @@ class ke {
|
|
|
1301
1309
|
*/
|
|
1302
1310
|
getStateAtTime(e) {
|
|
1303
1311
|
const n = /* @__PURE__ */ new Map();
|
|
1304
|
-
if (this._hasSharedWrites())
|
|
1312
|
+
if (e = Ne(e, this._config.drawingRate ?? 0), this._hasSharedWrites())
|
|
1305
1313
|
this._resolveShared(e, n);
|
|
1306
1314
|
else
|
|
1307
1315
|
for (const [r, s] of this._trackPlayers) {
|
|
@@ -1353,7 +1361,7 @@ class ke {
|
|
|
1353
1361
|
i || (i = /* @__PURE__ */ new Map(), e.set(r, i));
|
|
1354
1362
|
const c = this._textTracks.get(n);
|
|
1355
1363
|
if (c && typeof o == "number") {
|
|
1356
|
-
i.set("text",
|
|
1364
|
+
i.set("text", Gn(c.textConfig, o, Math.max(0, a)));
|
|
1357
1365
|
return;
|
|
1358
1366
|
}
|
|
1359
1367
|
const l = this._motionPathTracks.get(n);
|
|
@@ -1386,14 +1394,14 @@ class ke {
|
|
|
1386
1394
|
*/
|
|
1387
1395
|
addTrack(e) {
|
|
1388
1396
|
if (this._tracks.push(e), this._sharedWrites = null, V(e)) {
|
|
1389
|
-
this._trackPlayers.set(e.id, new
|
|
1397
|
+
this._trackPlayers.set(e.id, new Hn(e));
|
|
1390
1398
|
return;
|
|
1391
1399
|
}
|
|
1392
1400
|
if (j(e)) {
|
|
1393
|
-
this._trackPlayers.set(e.id, new
|
|
1401
|
+
this._trackPlayers.set(e.id, new jn(e)), this._springTracks.set(e.id, e);
|
|
1394
1402
|
return;
|
|
1395
1403
|
}
|
|
1396
|
-
if (
|
|
1404
|
+
if (Rt(e))
|
|
1397
1405
|
this._trackPlayers.set(e.id, new _t(e)), this._textTracks.set(e.id, e);
|
|
1398
1406
|
else if (se(e)) {
|
|
1399
1407
|
const n = {
|
|
@@ -1568,7 +1576,7 @@ class ke {
|
|
|
1568
1576
|
return this._config.alternate && (e === -1 || this._loopIteration < e) ? (this._loopIteration++, this._armRepeatDelay(), this._direction = "forward", this._repeatDelayRemaining === 0) : (this._playbackState = "idle", this.onComplete?.(), !1);
|
|
1569
1577
|
}
|
|
1570
1578
|
}
|
|
1571
|
-
const
|
|
1579
|
+
const Kn = 100;
|
|
1572
1580
|
function Hr(t, e, n, r) {
|
|
1573
1581
|
const s = [], o = [], { duration: a, alternate: i } = r, c = (d, m, p, g) => {
|
|
1574
1582
|
o.push([d, m]);
|
|
@@ -1579,20 +1587,20 @@ function Hr(t, e, n, r) {
|
|
|
1579
1587
|
for (const y of M) s.push({ kind: "event", index: y, direction: p });
|
|
1580
1588
|
};
|
|
1581
1589
|
let l = e.time, h = e.direction, u = e.fresh === !0;
|
|
1582
|
-
const f = Math.min(
|
|
1590
|
+
const f = Math.min(Kn, Math.max(0, n.iteration - e.iteration));
|
|
1583
1591
|
for (let d = 0; d < f; d++) {
|
|
1584
1592
|
const m = h === "forward" ? a : 0;
|
|
1585
1593
|
c(l, m, h, u), s.push({ kind: "repeat" }), i ? (h = h === "forward" ? "reverse" : "forward", l = m, u = !1) : (l = h === "forward" ? 0 : a, u = !0);
|
|
1586
1594
|
}
|
|
1587
1595
|
return f > 0 && r.holding && !i ? { crossings: s, passes: o } : (c(l, n.time, h, u), { crossings: s, passes: o });
|
|
1588
1596
|
}
|
|
1589
|
-
function
|
|
1597
|
+
function Zn(t) {
|
|
1590
1598
|
return V(t) ? {
|
|
1591
1599
|
id: t.id,
|
|
1592
1600
|
target: t.target,
|
|
1593
1601
|
property: t.property,
|
|
1594
1602
|
kind: "inertia",
|
|
1595
|
-
inertia:
|
|
1603
|
+
inertia: we(t.inertia),
|
|
1596
1604
|
...F(t)
|
|
1597
1605
|
} : j(t) ? {
|
|
1598
1606
|
id: t.id,
|
|
@@ -1601,7 +1609,7 @@ function Kn(t) {
|
|
|
1601
1609
|
kind: "spring",
|
|
1602
1610
|
spring: { ...t.spring },
|
|
1603
1611
|
...F(t)
|
|
1604
|
-
} :
|
|
1612
|
+
} : Rt(t) ? {
|
|
1605
1613
|
id: t.id,
|
|
1606
1614
|
target: t.target,
|
|
1607
1615
|
property: "text",
|
|
@@ -1624,7 +1632,7 @@ function Kn(t) {
|
|
|
1624
1632
|
...F(t)
|
|
1625
1633
|
};
|
|
1626
1634
|
}
|
|
1627
|
-
function
|
|
1635
|
+
function we(t) {
|
|
1628
1636
|
return { ...t, ...Array.isArray(t.end) && { end: [...t.end] } };
|
|
1629
1637
|
}
|
|
1630
1638
|
function Tt(t) {
|
|
@@ -1643,7 +1651,7 @@ function F(t) {
|
|
|
1643
1651
|
...t.stagger !== void 0 && { stagger: { ...t.stagger } }
|
|
1644
1652
|
};
|
|
1645
1653
|
}
|
|
1646
|
-
function
|
|
1654
|
+
function qn(t) {
|
|
1647
1655
|
if (V(t)) {
|
|
1648
1656
|
const e = t;
|
|
1649
1657
|
return {
|
|
@@ -1651,7 +1659,7 @@ function Zn(t) {
|
|
|
1651
1659
|
target: e.target,
|
|
1652
1660
|
property: e.property,
|
|
1653
1661
|
kind: "inertia",
|
|
1654
|
-
inertia:
|
|
1662
|
+
inertia: we(e.inertia),
|
|
1655
1663
|
...F(e)
|
|
1656
1664
|
};
|
|
1657
1665
|
}
|
|
@@ -1666,7 +1674,7 @@ function Zn(t) {
|
|
|
1666
1674
|
...F(e)
|
|
1667
1675
|
};
|
|
1668
1676
|
}
|
|
1669
|
-
if (
|
|
1677
|
+
if (Rt(t)) {
|
|
1670
1678
|
const e = t;
|
|
1671
1679
|
return {
|
|
1672
1680
|
id: e.id,
|
|
@@ -1688,7 +1696,7 @@ function Zn(t) {
|
|
|
1688
1696
|
...F(e)
|
|
1689
1697
|
};
|
|
1690
1698
|
}
|
|
1691
|
-
return
|
|
1699
|
+
return Vn({
|
|
1692
1700
|
id: t.id,
|
|
1693
1701
|
target: t.target,
|
|
1694
1702
|
property: t.property,
|
|
@@ -1697,7 +1705,7 @@ function Zn(t) {
|
|
|
1697
1705
|
...F(t)
|
|
1698
1706
|
});
|
|
1699
1707
|
}
|
|
1700
|
-
function
|
|
1708
|
+
function Jn(t) {
|
|
1701
1709
|
const e = t._config.markers;
|
|
1702
1710
|
return {
|
|
1703
1711
|
formatVersion: re(t.tracks),
|
|
@@ -1709,13 +1717,14 @@ function qn(t) {
|
|
|
1709
1717
|
speed: t._config.speed,
|
|
1710
1718
|
alternate: t._config.alternate,
|
|
1711
1719
|
repeatDelay: t._config.repeatDelay,
|
|
1720
|
+
...t._config.drawingRate ? { drawingRate: t._config.drawingRate } : {},
|
|
1712
1721
|
...e && { markers: e.map((n) => ({ ...n })) }
|
|
1713
1722
|
},
|
|
1714
|
-
tracks: t.tracks.map(
|
|
1723
|
+
tracks: t.tracks.map(Zn),
|
|
1715
1724
|
...t.captions && { captions: JSON.parse(JSON.stringify(t.captions)) }
|
|
1716
1725
|
};
|
|
1717
1726
|
}
|
|
1718
|
-
function
|
|
1727
|
+
function tr(t) {
|
|
1719
1728
|
const e = t.formatVersion ?? 1;
|
|
1720
1729
|
if (e > Nt)
|
|
1721
1730
|
throw new Error(
|
|
@@ -1725,16 +1734,16 @@ function Jn(t) {
|
|
|
1725
1734
|
id: t.id,
|
|
1726
1735
|
name: t.name,
|
|
1727
1736
|
config: t.config,
|
|
1728
|
-
tracks: t.tracks.map(
|
|
1737
|
+
tracks: t.tracks.map(qn),
|
|
1729
1738
|
captions: t.captions
|
|
1730
1739
|
});
|
|
1731
1740
|
}
|
|
1732
1741
|
function Br(t) {
|
|
1733
|
-
return JSON.stringify(
|
|
1742
|
+
return JSON.stringify(Jn(t));
|
|
1734
1743
|
}
|
|
1735
1744
|
function Wr(t) {
|
|
1736
1745
|
const e = JSON.parse(t);
|
|
1737
|
-
return
|
|
1746
|
+
return tr(e);
|
|
1738
1747
|
}
|
|
1739
1748
|
function Qr(t) {
|
|
1740
1749
|
let e = 2166136261;
|
|
@@ -1742,7 +1751,7 @@ function Qr(t) {
|
|
|
1742
1751
|
e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
|
|
1743
1752
|
return e >>> 0;
|
|
1744
1753
|
}
|
|
1745
|
-
function
|
|
1754
|
+
function Se(t) {
|
|
1746
1755
|
let e = t >>> 0 || 2654435769;
|
|
1747
1756
|
return {
|
|
1748
1757
|
seed: t >>> 0,
|
|
@@ -1754,7 +1763,7 @@ function we(t) {
|
|
|
1754
1763
|
function Ae(t, e, n) {
|
|
1755
1764
|
return e + t.next() * (n - e);
|
|
1756
1765
|
}
|
|
1757
|
-
function
|
|
1766
|
+
function er(t, e, n, r) {
|
|
1758
1767
|
if (r <= 0) return Ae(t, e, n);
|
|
1759
1768
|
const s = Math.floor((n - e) / r), o = Math.round(t.next() * s);
|
|
1760
1769
|
return e + o * r;
|
|
@@ -1767,7 +1776,7 @@ const ve = /^([+\-*/])=\s*(-?[\d.]+)$/, Pe = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\
|
|
|
1767
1776
|
function Kr(t) {
|
|
1768
1777
|
return typeof t != "string" ? !1 : ve.test(t.trim()) || Pe.test(t.trim());
|
|
1769
1778
|
}
|
|
1770
|
-
function
|
|
1779
|
+
function Re(t, e = {}) {
|
|
1771
1780
|
if (typeof t != "string") return t;
|
|
1772
1781
|
const n = t.trim(), r = ve.exec(n);
|
|
1773
1782
|
if (r) {
|
|
@@ -1790,15 +1799,15 @@ function $e(t, e = {}) {
|
|
|
1790
1799
|
`resolveValue: "${n}" needs a random source — pass one via context.random`
|
|
1791
1800
|
);
|
|
1792
1801
|
const o = Number.parseFloat(s[1]), a = Number.parseFloat(s[2]), i = s[3] !== void 0 ? Number.parseFloat(s[3]) : void 0;
|
|
1793
|
-
return i !== void 0 ?
|
|
1802
|
+
return i !== void 0 ? er(e.random, o, a, i) : Ae(e.random, o, a);
|
|
1794
1803
|
}
|
|
1795
1804
|
return t;
|
|
1796
1805
|
}
|
|
1797
|
-
function
|
|
1806
|
+
function nr(t, e = 0, n) {
|
|
1798
1807
|
const r = [];
|
|
1799
1808
|
let s = e;
|
|
1800
1809
|
for (const o of t) {
|
|
1801
|
-
const a =
|
|
1810
|
+
const a = Re(o, { base: s, random: n });
|
|
1802
1811
|
r.push(a), typeof a == "number" && (s = a);
|
|
1803
1812
|
}
|
|
1804
1813
|
return r;
|
|
@@ -1806,20 +1815,20 @@ function er(t, e = 0, n) {
|
|
|
1806
1815
|
class Zr {
|
|
1807
1816
|
random;
|
|
1808
1817
|
constructor(e) {
|
|
1809
|
-
this.random =
|
|
1818
|
+
this.random = Se(e);
|
|
1810
1819
|
}
|
|
1811
1820
|
/** The seed, to be stored alongside the timeline so this can be reproduced. */
|
|
1812
1821
|
get seed() {
|
|
1813
1822
|
return this.random.seed;
|
|
1814
1823
|
}
|
|
1815
1824
|
resolve(e, n = 0) {
|
|
1816
|
-
return
|
|
1825
|
+
return Re(e, { base: n, random: this.random });
|
|
1817
1826
|
}
|
|
1818
1827
|
resolveSequence(e, n = 0) {
|
|
1819
|
-
return
|
|
1828
|
+
return nr(e, n, this.random);
|
|
1820
1829
|
}
|
|
1821
1830
|
}
|
|
1822
|
-
const
|
|
1831
|
+
const rr = 600;
|
|
1823
1832
|
function qr(t) {
|
|
1824
1833
|
if (Array.isArray(t)) {
|
|
1825
1834
|
const [f, d, m, p] = t;
|
|
@@ -1834,13 +1843,13 @@ function qr(t) {
|
|
|
1834
1843
|
const [f, d, m, p] = s.points, g = [i(f), c(d), i(m), c(p)];
|
|
1835
1844
|
return { fn: ee(...g), bezier: g };
|
|
1836
1845
|
}
|
|
1837
|
-
const l = [], h = [], u = Math.max(8, Math.ceil(
|
|
1846
|
+
const l = [], h = [], u = Math.max(8, Math.ceil(rr / e.length));
|
|
1838
1847
|
for (const f of e)
|
|
1839
1848
|
for (let d = l.length === 0 ? 0 : 1; d <= u; d++) {
|
|
1840
|
-
const [m, p] =
|
|
1849
|
+
const [m, p] = sr(f, d / u);
|
|
1841
1850
|
l.push(i(m)), h.push(c(p));
|
|
1842
1851
|
}
|
|
1843
|
-
return { fn:
|
|
1852
|
+
return { fn: or(l, h) };
|
|
1844
1853
|
}
|
|
1845
1854
|
function Jr(t = {}) {
|
|
1846
1855
|
const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, r = [1];
|
|
@@ -1865,7 +1874,7 @@ function ts(t = {}) {
|
|
|
1865
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;
|
|
1866
1875
|
return (s) => s <= 0 || s >= 1 ? 0 : Math.sin(s * e * Math.PI * 2) * r(s);
|
|
1867
1876
|
}
|
|
1868
|
-
function
|
|
1877
|
+
function sr(t, e) {
|
|
1869
1878
|
if (t.type === "L") {
|
|
1870
1879
|
const [l, h] = t.points;
|
|
1871
1880
|
return [t.startX + (l - t.startX) * e, t.startY + (h - t.startY) * e];
|
|
@@ -1876,7 +1885,7 @@ function rr(t, e) {
|
|
|
1876
1885
|
c * c * c * t.startY + 3 * c * c * e * r + 3 * c * e * e * o + e * e * e * i
|
|
1877
1886
|
];
|
|
1878
1887
|
}
|
|
1879
|
-
function
|
|
1888
|
+
function or(t, e) {
|
|
1880
1889
|
return (n) => {
|
|
1881
1890
|
if (n <= t[0]) return e[0];
|
|
1882
1891
|
if (n >= t[t.length - 1]) return e[e.length - 1];
|
|
@@ -1908,9 +1917,9 @@ function ee(t, e, n, r) {
|
|
|
1908
1917
|
return s(i, e, r);
|
|
1909
1918
|
};
|
|
1910
1919
|
}
|
|
1911
|
-
const
|
|
1920
|
+
const ar = 350, ir = 300, cr = 550;
|
|
1912
1921
|
function es(t, e = {}) {
|
|
1913
|
-
const n = e.lead ??
|
|
1922
|
+
const n = e.lead ?? ar, r = e.gap ?? ir, s = e.tail ?? cr, o = [];
|
|
1914
1923
|
let a = 0;
|
|
1915
1924
|
return t.forEach((i, c) => {
|
|
1916
1925
|
const l = [];
|
|
@@ -1941,12 +1950,12 @@ function rs(t, e) {
|
|
|
1941
1950
|
else break;
|
|
1942
1951
|
return n;
|
|
1943
1952
|
}
|
|
1944
|
-
const
|
|
1953
|
+
const $e = (t) => 6e4 / t.bpm;
|
|
1945
1954
|
function Ct(t, e) {
|
|
1946
|
-
return t.offset + e *
|
|
1955
|
+
return t.offset + e * $e(t);
|
|
1947
1956
|
}
|
|
1948
1957
|
function It(t, e) {
|
|
1949
|
-
return (e - t.offset) /
|
|
1958
|
+
return (e - t.offset) / $e(t);
|
|
1950
1959
|
}
|
|
1951
1960
|
function ss(t, e) {
|
|
1952
1961
|
return Ct(t, Math.round(It(t, e)));
|
|
@@ -1988,30 +1997,30 @@ function is(t, e, n = {}) {
|
|
|
1988
1997
|
m /= i;
|
|
1989
1998
|
let p = u, g = -1 / 0;
|
|
1990
1999
|
for (let _ = u; _ <= f; _++) {
|
|
1991
|
-
const T = 60 * B / _, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2),
|
|
1992
|
-
|
|
2000
|
+
const T = 60 * B / _, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = d(_) * x;
|
|
2001
|
+
S > g && (g = S, p = _);
|
|
1993
2002
|
}
|
|
1994
2003
|
const M = (_) => {
|
|
1995
2004
|
const T = Math.floor(_);
|
|
1996
2005
|
return T < 0 || T + 1 >= i ? 0 : l[T] + (l[T + 1] - l[T]) * (_ - T);
|
|
1997
2006
|
}, y = (_, T) => {
|
|
1998
2007
|
let x = 0;
|
|
1999
|
-
for (let
|
|
2008
|
+
for (let S = T; S < i; S += _) x += M(S);
|
|
2000
2009
|
return x;
|
|
2001
2010
|
};
|
|
2002
|
-
let k = p,
|
|
2011
|
+
let k = p, w = 0, b = -1 / 0;
|
|
2003
2012
|
for (let _ = p - 0.6; _ <= p + 0.6 + 1e-9; _ += 0.02) {
|
|
2004
2013
|
if (_ < 1) continue;
|
|
2005
2014
|
const T = Math.max(1, Math.round(_ * 4));
|
|
2006
2015
|
for (let x = 0; x < T; x++) {
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2016
|
+
const S = x / T * _, R = y(_, S);
|
|
2017
|
+
R > b && (b = R, w = S, k = _);
|
|
2009
2018
|
}
|
|
2010
2019
|
}
|
|
2011
|
-
const v = 60 * B / k, A = m > 0 ? Math.max(0, Math.min(1, d(p) / m)) : 0, D = (
|
|
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;
|
|
2012
2021
|
return { bpm: Math.round(v * 100) / 100, offset: Math.round(D % (6e4 / v)), confidence: A };
|
|
2013
2022
|
}
|
|
2014
|
-
const
|
|
2023
|
+
const ur = 600, lr = 250, ne = 1;
|
|
2015
2024
|
function cs(t, e) {
|
|
2016
2025
|
const n = e.target ?? "Camera", r = { x: e.stage.width / 2, y: e.stage.height / 2 }, s = {}, o = (u, f, d, m) => {
|
|
2017
2026
|
const p = s[u] ??= [];
|
|
@@ -2034,7 +2043,7 @@ function cs(t, e) {
|
|
|
2034
2043
|
h.length > 0 && i(0, c);
|
|
2035
2044
|
for (const u of h)
|
|
2036
2045
|
if ("frame" in u) {
|
|
2037
|
-
const f = Math.max(ne, u.duration ??
|
|
2046
|
+
const f = Math.max(ne, u.duration ?? ur);
|
|
2038
2047
|
i(u.at, c), c = {
|
|
2039
2048
|
focusX: u.frame.focus?.x ?? r.x,
|
|
2040
2049
|
focusY: u.frame.focus?.y ?? r.y,
|
|
@@ -2042,7 +2051,7 @@ function cs(t, e) {
|
|
|
2042
2051
|
rotate: u.frame.rotate ?? 0
|
|
2043
2052
|
}, i(u.at + f, c, u.easing ?? (f > ne ? "ease-in-out" : void 0));
|
|
2044
2053
|
} else {
|
|
2045
|
-
const { follow: f } = u, d = f.lag ??
|
|
2054
|
+
const { follow: f } = u, d = f.lag ?? lr, m = new ke({ id: "follow", tracks: [{ id: "x", target: "s", property: "x", keyframes: f.x }] }), p = (y) => m.getStateAtTime(y).values.get("s")?.get("x") ?? c.focusX, g = [u.at, ...f.x.map((y) => y.time).filter((y) => y > u.at && y < u.until), u.until];
|
|
2046
2055
|
i(u.at, c);
|
|
2047
2056
|
const M = (y) => ({
|
|
2048
2057
|
focusX: p(y) + (f.lead ?? 0),
|
|
@@ -2051,13 +2060,13 @@ function cs(t, e) {
|
|
|
2051
2060
|
rotate: c.rotate
|
|
2052
2061
|
});
|
|
2053
2062
|
for (const y of g) {
|
|
2054
|
-
const k = f.x.find((
|
|
2063
|
+
const k = f.x.find((w) => w.time === y)?.easing;
|
|
2055
2064
|
i(y + d, M(y), y === u.at ? "ease-in-out" : k);
|
|
2056
2065
|
}
|
|
2057
2066
|
c = M(u.until);
|
|
2058
2067
|
}
|
|
2059
2068
|
for (const u of l.filter((f) => "shake" in f)) {
|
|
2060
|
-
const f = u.shake.strength ?? 12, d = u.shake.roll ?? 1.5, m = 1e3 / (u.shake.frequency ?? 24), p =
|
|
2069
|
+
const f = u.shake.strength ?? 12, d = u.shake.roll ?? 1.5, m = 1e3 / (u.shake.frequency ?? 24), p = Se(u.shake.seed ?? Math.round(u.at) + 1), g = () => p.next() * 2 - 1;
|
|
2061
2070
|
for (const M of ["shakeX", "shakeY", "shakeRotate"]) o(M, u.at, 0);
|
|
2062
2071
|
for (let M = u.at + m; M < u.at + u.duration; M += m) {
|
|
2063
2072
|
const y = 1 - (M - u.at) / u.duration;
|
|
@@ -2089,7 +2098,7 @@ const C = (t, e = 0) => {
|
|
|
2089
2098
|
const n = parseFloat(t ?? "");
|
|
2090
2099
|
return Number.isFinite(n) ? n : e;
|
|
2091
2100
|
};
|
|
2092
|
-
function
|
|
2101
|
+
function hr(t) {
|
|
2093
2102
|
const e = (t ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), n = [];
|
|
2094
2103
|
for (let r = 0; r + 1 < e.length; r += 2) n.push({ x: e[r], y: e[r + 1] });
|
|
2095
2104
|
return n;
|
|
@@ -2113,7 +2122,7 @@ function ls(t) {
|
|
|
2113
2122
|
return `M${C(e.x1)} ${C(e.y1)} L${C(e.x2)} ${C(e.y2)}`;
|
|
2114
2123
|
case "polyline":
|
|
2115
2124
|
case "polygon": {
|
|
2116
|
-
const n =
|
|
2125
|
+
const n = hr(e.points);
|
|
2117
2126
|
if (n.length === 0) return null;
|
|
2118
2127
|
const r = n.map((s, o) => `${o === 0 ? "M" : "L"}${s.x} ${s.y}`).join(" ");
|
|
2119
2128
|
return t.tag.toLowerCase() === "polygon" ? `${r} Z` : r;
|
|
@@ -2132,7 +2141,7 @@ function hs(t, e, n) {
|
|
|
2132
2141
|
}
|
|
2133
2142
|
return i;
|
|
2134
2143
|
}
|
|
2135
|
-
const
|
|
2144
|
+
const fr = 2.5;
|
|
2136
2145
|
function fs(t) {
|
|
2137
2146
|
const e = [], n = [], r = t.length, s = (o, a) => {
|
|
2138
2147
|
for (let i = o + a; i >= 0 && i < r; i += a) {
|
|
@@ -2146,7 +2155,7 @@ function fs(t) {
|
|
|
2146
2155
|
let u = l[0] + h[0], f = l[1] + h[1];
|
|
2147
2156
|
const d = Math.hypot(u, f);
|
|
2148
2157
|
d < 1e-9 ? (u = l[0], f = l[1]) : (u /= d, f /= d);
|
|
2149
|
-
const m = u * l[0] + f * l[1], p = Math.min(
|
|
2158
|
+
const m = u * l[0] + f * l[1], p = Math.min(fr, 1 / Math.max(m, 1e-6)), g = a.width / 2 * p;
|
|
2150
2159
|
e.push({ x: a.x - f * g, y: a.y + u * g }), n.push({ x: a.x + f * g, y: a.y - u * g });
|
|
2151
2160
|
}
|
|
2152
2161
|
return { left: e, right: n };
|
|
@@ -2162,7 +2171,7 @@ function ds(t) {
|
|
|
2162
2171
|
}
|
|
2163
2172
|
return null;
|
|
2164
2173
|
}
|
|
2165
|
-
function
|
|
2174
|
+
function dr(t, e) {
|
|
2166
2175
|
return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
|
|
2167
2176
|
}
|
|
2168
2177
|
function Et(t, e) {
|
|
@@ -2180,32 +2189,32 @@ function vt(t, e) {
|
|
|
2180
2189
|
function Lt(t) {
|
|
2181
2190
|
return Math.hypot(t[0], t[1], t[2]);
|
|
2182
2191
|
}
|
|
2183
|
-
function
|
|
2192
|
+
function pr(t, e) {
|
|
2184
2193
|
return Lt(Et(t, e));
|
|
2185
2194
|
}
|
|
2186
2195
|
function Pt(t) {
|
|
2187
2196
|
const e = Lt(t);
|
|
2188
2197
|
return e === 0 ? [0, 0, 0] : De(t, 1 / e);
|
|
2189
2198
|
}
|
|
2190
|
-
function
|
|
2199
|
+
function gr(t, e, n) {
|
|
2191
2200
|
return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
|
|
2192
2201
|
}
|
|
2193
2202
|
const ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2194
2203
|
__proto__: null,
|
|
2195
|
-
add:
|
|
2204
|
+
add: dr,
|
|
2196
2205
|
cross: vt,
|
|
2197
|
-
distance:
|
|
2206
|
+
distance: pr,
|
|
2198
2207
|
dot: ct,
|
|
2199
2208
|
length: Lt,
|
|
2200
|
-
lerp:
|
|
2209
|
+
lerp: gr,
|
|
2201
2210
|
normalize: Pt,
|
|
2202
2211
|
scale: De,
|
|
2203
2212
|
subtract: Et
|
|
2204
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2205
|
-
function
|
|
2213
|
+
}, Symbol.toStringTag, { value: "Module" })), mr = Math.PI / 180;
|
|
2214
|
+
function yr() {
|
|
2206
2215
|
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
2207
2216
|
}
|
|
2208
|
-
function
|
|
2217
|
+
function Mr(t, e) {
|
|
2209
2218
|
const n = new Array(16);
|
|
2210
2219
|
for (let r = 0; r < 4; r++)
|
|
2211
2220
|
for (let s = 0; s < 4; s++) {
|
|
@@ -2215,10 +2224,10 @@ function yr(t, e) {
|
|
|
2215
2224
|
}
|
|
2216
2225
|
return n;
|
|
2217
2226
|
}
|
|
2218
|
-
function
|
|
2227
|
+
function _r(t) {
|
|
2219
2228
|
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t[0], t[1], t[2], 1];
|
|
2220
2229
|
}
|
|
2221
|
-
function
|
|
2230
|
+
function br(t) {
|
|
2222
2231
|
return [t[0], 0, 0, 0, 0, t[1], 0, 0, 0, 0, t[2], 0, 0, 0, 0, 1];
|
|
2223
2232
|
}
|
|
2224
2233
|
function Ce(t) {
|
|
@@ -2242,28 +2251,28 @@ function Ce(t) {
|
|
|
2242
2251
|
1
|
|
2243
2252
|
];
|
|
2244
2253
|
}
|
|
2245
|
-
function
|
|
2254
|
+
function Tr(t, e, n) {
|
|
2246
2255
|
const r = Ce(e);
|
|
2247
2256
|
for (let s = 0; s < 3; s++)
|
|
2248
2257
|
r[s] *= n[0], r[4 + s] *= n[1], r[8 + s] *= n[2];
|
|
2249
2258
|
return r[12] = t[0], r[13] = t[1], r[14] = t[2], r;
|
|
2250
2259
|
}
|
|
2251
|
-
function
|
|
2260
|
+
function xr(t) {
|
|
2252
2261
|
const e = new Array(16);
|
|
2253
2262
|
for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) e[r * 4 + n] = t[n * 4 + r];
|
|
2254
2263
|
return e;
|
|
2255
2264
|
}
|
|
2256
|
-
function
|
|
2257
|
-
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,
|
|
2258
|
-
if (Math.abs(
|
|
2259
|
-
const P = 1 /
|
|
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;
|
|
2260
2269
|
return [
|
|
2261
|
-
(a *
|
|
2262
|
-
(r * x - n *
|
|
2263
|
-
(m * v - p * b + g *
|
|
2264
|
-
(u * b - h * v - f *
|
|
2265
|
-
(i * _ - o *
|
|
2266
|
-
(e *
|
|
2270
|
+
(a * S - i * x + c * T) * P,
|
|
2271
|
+
(r * x - n * S - s * T) * P,
|
|
2272
|
+
(m * v - p * b + g * w) * P,
|
|
2273
|
+
(u * b - h * v - f * w) * P,
|
|
2274
|
+
(i * _ - o * S - c * D) * P,
|
|
2275
|
+
(e * S - r * _ + s * D) * P,
|
|
2267
2276
|
(p * k - d * v - g * y) * P,
|
|
2268
2277
|
(l * v - u * k + f * y) * P,
|
|
2269
2278
|
(o * x - a * _ + c * A) * P,
|
|
@@ -2272,19 +2281,19 @@ function xr(t) {
|
|
|
2272
2281
|
(h * k - l * b - f * M) * P,
|
|
2273
2282
|
(a * D - o * T - i * A) * P,
|
|
2274
2283
|
(e * T - n * D + r * A) * P,
|
|
2275
|
-
(m * y - d *
|
|
2276
|
-
(l *
|
|
2284
|
+
(m * y - d * w - p * M) * P,
|
|
2285
|
+
(l * w - h * y + u * M) * P
|
|
2277
2286
|
];
|
|
2278
2287
|
}
|
|
2279
|
-
function
|
|
2280
|
-
const s = 1 / Math.tan(t *
|
|
2288
|
+
function wr(t, e, n, r) {
|
|
2289
|
+
const s = 1 / Math.tan(t * mr / 2), o = 1 / (n - r);
|
|
2281
2290
|
return [s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (r + n) * o, -1, 0, 0, 2 * r * n * o, 0];
|
|
2282
2291
|
}
|
|
2283
2292
|
function Sr(t, e, n, r, s, o) {
|
|
2284
2293
|
const a = 1 / (e - t), i = 1 / (r - n), c = 1 / (o - s);
|
|
2285
2294
|
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];
|
|
2286
2295
|
}
|
|
2287
|
-
function
|
|
2296
|
+
function Ar(t, e, n = [0, 1, 0]) {
|
|
2288
2297
|
const r = Pt(Et(t, e)), s = Pt(vt(n, r)), o = vt(r, s);
|
|
2289
2298
|
return [
|
|
2290
2299
|
s[0],
|
|
@@ -2305,24 +2314,24 @@ function wr(t, e, n = [0, 1, 0]) {
|
|
|
2305
2314
|
1
|
|
2306
2315
|
];
|
|
2307
2316
|
}
|
|
2308
|
-
function
|
|
2317
|
+
function vr(t, e) {
|
|
2309
2318
|
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];
|
|
2310
2319
|
return o === 1 || o === 0 ? [n, r, s] : [n / o, r / o, s / o];
|
|
2311
2320
|
}
|
|
2312
2321
|
const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2313
2322
|
__proto__: null,
|
|
2314
|
-
compose:
|
|
2323
|
+
compose: Tr,
|
|
2315
2324
|
fromQuat: Ce,
|
|
2316
|
-
identity:
|
|
2317
|
-
invert:
|
|
2318
|
-
lookAt:
|
|
2319
|
-
multiply:
|
|
2325
|
+
identity: yr,
|
|
2326
|
+
invert: kr,
|
|
2327
|
+
lookAt: Ar,
|
|
2328
|
+
multiply: Mr,
|
|
2320
2329
|
orthographic: Sr,
|
|
2321
|
-
perspective:
|
|
2322
|
-
scaling:
|
|
2323
|
-
transformPoint:
|
|
2324
|
-
translation:
|
|
2325
|
-
transpose:
|
|
2330
|
+
perspective: wr,
|
|
2331
|
+
scaling: br,
|
|
2332
|
+
transformPoint: vr,
|
|
2333
|
+
translation: _r,
|
|
2334
|
+
transpose: xr
|
|
2326
2335
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2327
2336
|
export {
|
|
2328
2337
|
$r as Clock,
|
|
@@ -2330,93 +2339,93 @@ export {
|
|
|
2330
2339
|
Yt as DEFAULT_INERTIA_FRICTION,
|
|
2331
2340
|
L as DEFAULT_SPRING,
|
|
2332
2341
|
Nt as FORMAT_VERSION,
|
|
2333
|
-
|
|
2334
|
-
|
|
2342
|
+
je as INERTIA_MAX_DURATION_MS,
|
|
2343
|
+
Hn as InertiaTrackPlayer,
|
|
2335
2344
|
Nr as MORPH_SAMPLES,
|
|
2336
|
-
|
|
2345
|
+
Rr as ManualClock,
|
|
2337
2346
|
ie as SPRING_MAX_DURATION_MS,
|
|
2338
2347
|
Dr as SPRING_PRESETS,
|
|
2339
2348
|
tt as SPRING_STEP_MS,
|
|
2340
2349
|
ut as SpringSampler,
|
|
2341
|
-
|
|
2350
|
+
jn as SpringTrackPlayer,
|
|
2342
2351
|
ke as Timeline,
|
|
2343
2352
|
_t as TrackPlayer,
|
|
2344
2353
|
Zr as ValueResolver,
|
|
2345
|
-
|
|
2346
|
-
|
|
2354
|
+
rn as backOut,
|
|
2355
|
+
Yn as bakeEasing,
|
|
2347
2356
|
be as bakeInertiaTrack,
|
|
2348
2357
|
_e as bakeSpringTrack,
|
|
2349
2358
|
It as beatAtTime,
|
|
2350
|
-
|
|
2359
|
+
$e as beatLength,
|
|
2351
2360
|
Ct as beatTime,
|
|
2352
2361
|
as as beatsBetween,
|
|
2353
|
-
|
|
2362
|
+
nn as bounceOut,
|
|
2354
2363
|
cs as cameraTracks,
|
|
2355
|
-
|
|
2364
|
+
Wn as charactersFor,
|
|
2356
2365
|
Yr as clearMorphCache,
|
|
2357
2366
|
Fr as clearPathCache,
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2367
|
+
tn as createCubicBezier,
|
|
2368
|
+
Se as createRandom,
|
|
2369
|
+
Vn as createTrack,
|
|
2361
2370
|
Lr as criticalDamping,
|
|
2362
2371
|
Jr as customBounce,
|
|
2363
2372
|
qr as customEase,
|
|
2364
2373
|
ts as customWiggle,
|
|
2365
|
-
|
|
2366
|
-
|
|
2374
|
+
tr as deserializeTimeline,
|
|
2375
|
+
qn as deserializeTrack,
|
|
2367
2376
|
is as detectTempo,
|
|
2368
|
-
|
|
2377
|
+
Ke as easeIn,
|
|
2369
2378
|
ce as easeInCubic,
|
|
2370
|
-
|
|
2379
|
+
qe as easeInOut,
|
|
2371
2380
|
le as easeInOutCubic,
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2381
|
+
Ge as easeInOutQuad,
|
|
2382
|
+
We as easeInQuad,
|
|
2383
|
+
Ze as easeOut,
|
|
2375
2384
|
ue as easeOutCubic,
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2385
|
+
Qe as easeOutQuad,
|
|
2386
|
+
en as elasticOut,
|
|
2387
|
+
zn as expandParametricEasings,
|
|
2379
2388
|
re as formatVersionFor,
|
|
2380
2389
|
Wr as fromJSON,
|
|
2381
2390
|
he as getEasingFunction,
|
|
2382
2391
|
ye as getInterpolator,
|
|
2383
2392
|
xe as getMotionPathPoint,
|
|
2384
2393
|
Xr as getPathLength,
|
|
2385
|
-
|
|
2394
|
+
gn as getPointAtProgress,
|
|
2386
2395
|
Xe as hasKeyframes,
|
|
2387
2396
|
Qr as hashSeed,
|
|
2388
|
-
|
|
2397
|
+
Ne as heldTime,
|
|
2389
2398
|
ft as inertiaDuration,
|
|
2390
2399
|
ht as inertiaRest,
|
|
2391
2400
|
kt as inertiaValueAt,
|
|
2392
2401
|
Or as inertiaVelocityAt,
|
|
2393
|
-
|
|
2394
|
-
|
|
2402
|
+
Fn as interpolateArray,
|
|
2403
|
+
On as interpolateColor,
|
|
2395
2404
|
jr as interpolateMotionPath,
|
|
2396
2405
|
X as interpolateNumber,
|
|
2397
|
-
|
|
2398
|
-
|
|
2406
|
+
Nn as interpolatePathString,
|
|
2407
|
+
Xn as interpolateQuaternion,
|
|
2399
2408
|
te as interpolateString,
|
|
2400
2409
|
Fe as isCubicBezierEasing,
|
|
2401
2410
|
V as isInertiaTrack,
|
|
2402
|
-
|
|
2411
|
+
Pr as isMotionPathPoint,
|
|
2403
2412
|
se as isMotionPathTrack,
|
|
2404
2413
|
xt as isParametricEasing,
|
|
2405
|
-
|
|
2414
|
+
Pn as isPathData,
|
|
2406
2415
|
j as isSpringTrack,
|
|
2407
|
-
|
|
2416
|
+
Rt as isTextTrack,
|
|
2408
2417
|
Er as isUnderdamped,
|
|
2409
2418
|
Kr as isUnresolved,
|
|
2410
|
-
|
|
2419
|
+
wt as linear,
|
|
2411
2420
|
gs as mat4,
|
|
2412
|
-
|
|
2413
|
-
|
|
2421
|
+
Ye as maxStaggerDistance,
|
|
2422
|
+
vn as morphPath,
|
|
2414
2423
|
ns as narrationMarkers,
|
|
2415
2424
|
rs as narrationSceneAt,
|
|
2416
|
-
|
|
2425
|
+
He as naturalRest,
|
|
2417
2426
|
ss as nearestBeat,
|
|
2418
2427
|
os as nextBeat,
|
|
2419
|
-
|
|
2428
|
+
on as parametricEasing,
|
|
2420
2429
|
G as parsePath,
|
|
2421
2430
|
es as planNarration,
|
|
2422
2431
|
Hr as playheadCrossings,
|
|
@@ -2425,23 +2434,23 @@ export {
|
|
|
2425
2434
|
zr as quat,
|
|
2426
2435
|
Ae as randomBetween,
|
|
2427
2436
|
Gr as randomChoice,
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2437
|
+
er as randomSnapped,
|
|
2438
|
+
nr as resolveSequence,
|
|
2439
|
+
Re as resolveValue,
|
|
2431
2440
|
fs as ribbon,
|
|
2432
2441
|
ds as ribbonHeadCap,
|
|
2433
|
-
|
|
2434
|
-
|
|
2442
|
+
Jn as serializeTimeline,
|
|
2443
|
+
Zn as serializeTrack,
|
|
2435
2444
|
ls as shapeToPathData,
|
|
2436
|
-
|
|
2445
|
+
Un as simplifyKeyframes,
|
|
2437
2446
|
Ir as springDuration,
|
|
2438
2447
|
Cr as springValueAt,
|
|
2439
2448
|
oe as staggerDistance,
|
|
2440
2449
|
ae as staggerOffset,
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2450
|
+
ze as staggerOffsets,
|
|
2451
|
+
$t as staggerSpan,
|
|
2452
|
+
sn as stepsEasing,
|
|
2453
|
+
Gn as textAt,
|
|
2445
2454
|
Br as toJSON,
|
|
2446
2455
|
Ur as toKeyframedTrack,
|
|
2447
2456
|
Vr as toKeyframedTracks,
|