@algorisys/tinyfly 0.89.0 → 0.91.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 +24 -19
- package/lib/addons/camera-C7bZOWMB.js +33 -0
- package/lib/addons/characters.js +1929 -1622
- package/lib/browser/tinyfly.iife.js +4 -4
- package/lib/browser/tinyfly.js +4882 -4484
- 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 +849 -783
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/headless/headless.js +39 -3
- 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/adapters/canvas/camera.d.ts +46 -0
- package/lib/types/adapters/canvas/index.d.ts +1 -0
- package/lib/types/browser/index.d.ts +2 -0
- package/lib/types/characters/acting/index.d.ts +2 -0
- package/lib/types/characters/acting/lip-sync.d.ts +115 -0
- package/lib/types/characters/acting/script.d.ts +94 -0
- package/lib/types/characters/gaits.d.ts +141 -0
- package/lib/types/characters/index.d.ts +2 -0
- package/lib/types/characters/stick-figure.d.ts +15 -0
- package/lib/types/engine/authoring/camera-shots.d.ts +73 -0
- package/lib/types/engine/authoring/index.d.ts +1 -0
- package/lib/types/engine/core/timeline.d.ts +3 -0
- package/lib/types/engine/types.d.ts +6 -0
- package/lib/types/headless/video-scene.d.ts +14 -0
- package/package.json +1 -1
|
@@ -20,6 +20,11 @@ function dt(i) {
|
|
|
20
20
|
function re(i) {
|
|
21
21
|
return i.property === "motionPath" && "motionPathConfig" in i;
|
|
22
22
|
}
|
|
23
|
+
function ae(i, t) {
|
|
24
|
+
if (!(t > 0)) return i;
|
|
25
|
+
const e = 1e3 / t;
|
|
26
|
+
return Math.floor(i / e + 1e-9) * e;
|
|
27
|
+
}
|
|
23
28
|
function Nt(i, t, e = "start") {
|
|
24
29
|
if (t <= 1) return 0;
|
|
25
30
|
if (typeof e == "number") {
|
|
@@ -37,7 +42,7 @@ function Nt(i, t, e = "start") {
|
|
|
37
42
|
return i;
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
|
-
function
|
|
45
|
+
function oe(i, t = "start") {
|
|
41
46
|
if (i <= 1) return 0;
|
|
42
47
|
let e = 0;
|
|
43
48
|
for (let s = 0; s < i; s++)
|
|
@@ -48,16 +53,16 @@ function qt(i, t, e) {
|
|
|
48
53
|
if (e.offsets) return e.offsets[i] ?? 0;
|
|
49
54
|
const s = e.from ?? "start", n = Nt(i, t, s);
|
|
50
55
|
if (e.amount !== void 0) {
|
|
51
|
-
const r =
|
|
56
|
+
const r = oe(t, s);
|
|
52
57
|
return r === 0 ? 0 : e.amount * n / r;
|
|
53
58
|
}
|
|
54
59
|
return e.each !== void 0 ? e.each * n : 0;
|
|
55
60
|
}
|
|
56
|
-
function
|
|
61
|
+
function ce(i, t) {
|
|
57
62
|
return Array.from({ length: i }, (e, s) => qt(s, i, t));
|
|
58
63
|
}
|
|
59
64
|
function mt(i, t) {
|
|
60
|
-
return i <= 1 ? 0 : Math.max(...
|
|
65
|
+
return i <= 1 ? 0 : Math.max(...ce(i, t));
|
|
61
66
|
}
|
|
62
67
|
const U = 1, Vt = 6e4, Z = Vt / U, X = {
|
|
63
68
|
stiffness: 180,
|
|
@@ -67,7 +72,7 @@ const U = 1, Vt = 6e4, Z = Vt / U, X = {
|
|
|
67
72
|
restDelta: 0.01,
|
|
68
73
|
restSpeed: 0.1
|
|
69
74
|
};
|
|
70
|
-
class
|
|
75
|
+
class he {
|
|
71
76
|
from;
|
|
72
77
|
to;
|
|
73
78
|
stiffness;
|
|
@@ -139,15 +144,15 @@ class ce {
|
|
|
139
144
|
this.samples.length > Z && (this.settledStep = Z);
|
|
140
145
|
}
|
|
141
146
|
}
|
|
142
|
-
const St = 4,
|
|
147
|
+
const St = 4, le = 2e-3, ue = 1e-4, de = 6e4;
|
|
143
148
|
function gt(i) {
|
|
144
149
|
const t = i.friction ?? St;
|
|
145
150
|
return t > 0 ? t : St;
|
|
146
151
|
}
|
|
147
|
-
function
|
|
152
|
+
function fe(i) {
|
|
148
153
|
return i.from + i.velocity / gt(i);
|
|
149
154
|
}
|
|
150
|
-
function
|
|
155
|
+
function pe(i, t) {
|
|
151
156
|
if (t === void 0) return i;
|
|
152
157
|
if (typeof t == "number")
|
|
153
158
|
return t > 0 ? Math.round(i / t) * t : i;
|
|
@@ -158,47 +163,47 @@ function fe(i, t) {
|
|
|
158
163
|
return e;
|
|
159
164
|
}
|
|
160
165
|
function Wt(i) {
|
|
161
|
-
let t = fe(
|
|
166
|
+
let t = pe(fe(i), i.end);
|
|
162
167
|
return i.min !== void 0 && (t = Math.max(i.min, t)), i.max !== void 0 && (t = Math.min(i.max, t)), t;
|
|
163
168
|
}
|
|
164
169
|
function Ut(i) {
|
|
165
170
|
const t = Math.abs(Wt(i) - i.from);
|
|
166
171
|
if (t === 0) return 0;
|
|
167
|
-
const e = i.restDelta ?? Math.max(
|
|
172
|
+
const e = i.restDelta ?? Math.max(ue, t * le);
|
|
168
173
|
if (e >= t) return 0;
|
|
169
174
|
const s = Math.log(t / e) / gt(i);
|
|
170
|
-
return Math.min(
|
|
175
|
+
return Math.min(de, s * 1e3);
|
|
171
176
|
}
|
|
172
|
-
function
|
|
177
|
+
function _t(i, t) {
|
|
173
178
|
if (t <= 0) return i.from;
|
|
174
179
|
const e = Wt(i);
|
|
175
180
|
if (t >= Ut(i)) return e;
|
|
176
181
|
const s = gt(i);
|
|
177
182
|
return i.from + (e - i.from) * (1 - Math.exp(-s * t / 1e3));
|
|
178
183
|
}
|
|
179
|
-
const ft = (i) => i,
|
|
184
|
+
const ft = (i) => i, me = (i) => i * i, ge = (i) => 1 - (1 - i) * (1 - i), ye = (i) => i < 0.5 ? 2 * i * i : 1 - Math.pow(-2 * i + 2, 2) / 2, Ht = (i) => i * i * i, Qt = (i) => 1 - Math.pow(1 - i, 3), zt = (i) => i < 0.5 ? 4 * i * i * i : 1 - Math.pow(-2 * i + 2, 3) / 2, Te = Ht, be = Qt, Ae = zt, Se = {
|
|
180
185
|
linear: ft,
|
|
181
|
-
"ease-in":
|
|
182
|
-
"ease-out":
|
|
183
|
-
"ease-in-out":
|
|
184
|
-
"ease-in-quad":
|
|
185
|
-
"ease-out-quad":
|
|
186
|
-
"ease-in-out-quad":
|
|
186
|
+
"ease-in": Te,
|
|
187
|
+
"ease-out": be,
|
|
188
|
+
"ease-in-out": Ae,
|
|
189
|
+
"ease-in-quad": me,
|
|
190
|
+
"ease-out-quad": ge,
|
|
191
|
+
"ease-in-out-quad": ye,
|
|
187
192
|
"ease-in-cubic": Ht,
|
|
188
193
|
"ease-out-cubic": Qt,
|
|
189
194
|
"ease-in-out-cubic": zt
|
|
190
195
|
};
|
|
191
|
-
function
|
|
196
|
+
function _e(i) {
|
|
192
197
|
const [t, e, s, n] = i, r = 3 * t, a = 3 * (s - t) - r, o = 1 - r - a, c = 3 * e, h = 3 * (n - e) - c, u = 1 - c - h, l = (d) => ((o * d + a) * d + r) * d, g = (d) => ((u * d + h) * d + c) * d, p = (d) => (3 * o * d + 2 * a) * d + r, f = (d) => {
|
|
193
198
|
let m = d;
|
|
194
199
|
for (let A = 0; A < 8; A++) {
|
|
195
|
-
const
|
|
196
|
-
if (Math.abs(
|
|
200
|
+
const _ = l(m) - d;
|
|
201
|
+
if (Math.abs(_) < 1e-7)
|
|
197
202
|
return m;
|
|
198
203
|
const y = p(m);
|
|
199
204
|
if (Math.abs(y) < 1e-7)
|
|
200
205
|
break;
|
|
201
|
-
m -=
|
|
206
|
+
m -= _ / y;
|
|
202
207
|
}
|
|
203
208
|
let T = 0, b = 1;
|
|
204
209
|
for (m = d; T < b; ) {
|
|
@@ -225,7 +230,7 @@ function Me(i = 1, t = 0.3) {
|
|
|
225
230
|
const e = Math.max(1, i), s = t / (2 * Math.PI) * Math.asin(1 / e);
|
|
226
231
|
return (n) => n <= 0 ? 0 : n >= 1 ? 1 : e * Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / t) + 1;
|
|
227
232
|
}
|
|
228
|
-
const
|
|
233
|
+
const ke = (i) => {
|
|
229
234
|
if (i <= 0) return 0;
|
|
230
235
|
if (i >= 1) return 1;
|
|
231
236
|
if (i < 1 / 2.75) return 7.5625 * i * i;
|
|
@@ -240,7 +245,7 @@ const _e = (i) => {
|
|
|
240
245
|
const s = i - 2.625 / 2.75;
|
|
241
246
|
return 7.5625 * s * s + 0.984375;
|
|
242
247
|
};
|
|
243
|
-
function
|
|
248
|
+
function we(i = 1.70158) {
|
|
244
249
|
return (t) => {
|
|
245
250
|
if (t <= 0) return 0;
|
|
246
251
|
if (t >= 1) return 1;
|
|
@@ -248,7 +253,7 @@ function ke(i = 1.70158) {
|
|
|
248
253
|
return e * e * ((i + 1) * e + i) + 1;
|
|
249
254
|
};
|
|
250
255
|
}
|
|
251
|
-
function
|
|
256
|
+
function Pe(i, t = "end") {
|
|
252
257
|
const e = Math.max(1, Math.floor(i));
|
|
253
258
|
return (s) => {
|
|
254
259
|
if (s >= 1) return 1;
|
|
@@ -266,22 +271,22 @@ function we(i, t = "end") {
|
|
|
266
271
|
}
|
|
267
272
|
};
|
|
268
273
|
}
|
|
269
|
-
function
|
|
274
|
+
function ve(i) {
|
|
270
275
|
switch (i.type) {
|
|
271
276
|
case "steps":
|
|
272
|
-
return
|
|
277
|
+
return Pe(i.count, i.position);
|
|
273
278
|
case "elastic":
|
|
274
279
|
return nt(Me(i.amplitude, i.period), i.mode);
|
|
275
280
|
case "bounce":
|
|
276
|
-
return nt(
|
|
281
|
+
return nt(ke, i.mode);
|
|
277
282
|
case "back":
|
|
278
|
-
return nt(
|
|
283
|
+
return nt(we(i.overshoot), i.mode);
|
|
279
284
|
}
|
|
280
285
|
}
|
|
281
|
-
function
|
|
282
|
-
return i === void 0 ? ft : ie(i) ?
|
|
286
|
+
function xe(i) {
|
|
287
|
+
return i === void 0 ? ft : ie(i) ? _e(i.points) : se(i) ? ve(i) : Se[i] ?? ft;
|
|
283
288
|
}
|
|
284
|
-
const
|
|
289
|
+
const Mt = 32, Ce = 256, N = /* @__PURE__ */ new Map(), Ie = /[MmLlHhVvCcSsQqTtAaZz]/, Re = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, De = {
|
|
285
290
|
M: 2,
|
|
286
291
|
L: 2,
|
|
287
292
|
H: 1,
|
|
@@ -293,7 +298,7 @@ const _t = 32, xe = 256, N = /* @__PURE__ */ new Map(), Ce = /[MmLlHhVvCcSsQqTtA
|
|
|
293
298
|
A: 7,
|
|
294
299
|
Z: 0
|
|
295
300
|
};
|
|
296
|
-
function
|
|
301
|
+
function Ee(i) {
|
|
297
302
|
const t = [];
|
|
298
303
|
let e = 0, s = null;
|
|
299
304
|
const n = () => {
|
|
@@ -301,7 +306,7 @@ function De(i) {
|
|
|
301
306
|
};
|
|
302
307
|
for (; e < i.length && (n(), !(e >= i.length)); ) {
|
|
303
308
|
const r = i[e];
|
|
304
|
-
if (
|
|
309
|
+
if (Ie.test(r)) {
|
|
305
310
|
s = { type: r, args: [] }, t.push(s), e++;
|
|
306
311
|
continue;
|
|
307
312
|
}
|
|
@@ -312,13 +317,13 @@ function De(i) {
|
|
|
312
317
|
s.args.push(r === "1" ? 1 : 0), e++;
|
|
313
318
|
continue;
|
|
314
319
|
}
|
|
315
|
-
const c =
|
|
320
|
+
const c = Re.exec(i.slice(e));
|
|
316
321
|
if (!c) break;
|
|
317
322
|
s.args.push(parseFloat(c[0])), e += c[0].length;
|
|
318
323
|
}
|
|
319
324
|
return t;
|
|
320
325
|
}
|
|
321
|
-
function
|
|
326
|
+
function Be(i, t, e, s, n, r, a, o, c) {
|
|
322
327
|
if (i === o && t === c) return [];
|
|
323
328
|
let h = Math.abs(e), u = Math.abs(s);
|
|
324
329
|
if (h === 0 || u === 0) return [[i, t, o, c, o, c]];
|
|
@@ -327,7 +332,7 @@ function Ee(i, t, e, s, n, r, a, o, c) {
|
|
|
327
332
|
const w = Math.sqrt(b);
|
|
328
333
|
h *= w, u *= w;
|
|
329
334
|
}
|
|
330
|
-
const A = r === a ? -1 : 1,
|
|
335
|
+
const A = r === a ? -1 : 1, _ = h * h * u * u - h * h * T * T - u * u * m * m, y = h * h * T * T + u * u * m * m, M = A * Math.sqrt(Math.max(0, _ / y)), S = M * h * T / u, R = -M * u * m / h, z = g * S - p * R + (i + o) / 2, k = p * S + g * R + (t + c) / 2, C = (w, x, I, $) => {
|
|
331
336
|
const st = w * I + x * $, G = Math.sqrt((w * w + x * x) * (I * I + $ * $)), Y = Math.acos(Math.max(-1, Math.min(1, st / G)));
|
|
332
337
|
return w * $ - x * I < 0 ? -Y : Y;
|
|
333
338
|
}, P = C(1, 0, (m - S) / h, (T - R) / u);
|
|
@@ -369,8 +374,8 @@ function q(i, t, e, s) {
|
|
|
369
374
|
function K(i, t, e) {
|
|
370
375
|
const [s, n, r, a, o, c] = e, h = [0];
|
|
371
376
|
let u = i, l = t, g = 0;
|
|
372
|
-
for (let p = 1; p <=
|
|
373
|
-
const f = p /
|
|
377
|
+
for (let p = 1; p <= Mt; p++) {
|
|
378
|
+
const f = p / Mt, d = E(i, s, r, o, f), m = E(t, n, a, c, f);
|
|
374
379
|
g += Math.hypot(d - u, m - l), h.push(g), u = d, l = m;
|
|
375
380
|
}
|
|
376
381
|
return {
|
|
@@ -393,43 +398,43 @@ function tt(i) {
|
|
|
393
398
|
const u = /* @__PURE__ */ new Set(), l = (d) => {
|
|
394
399
|
h < 0 && (h = 0), d.subpath = h, e.push(d);
|
|
395
400
|
};
|
|
396
|
-
for (const { type: d, args: m } of
|
|
397
|
-
const T = d.toUpperCase(), b = d !== T, A =
|
|
401
|
+
for (const { type: d, args: m } of Ee(i)) {
|
|
402
|
+
const T = d.toUpperCase(), b = d !== T, A = De[T];
|
|
398
403
|
if (T === "Z") {
|
|
399
404
|
(s !== r || n !== a) && l(q(s, n, r, a)), h >= 0 && u.add(h), s = r, n = a, o = c = null;
|
|
400
405
|
continue;
|
|
401
406
|
}
|
|
402
|
-
for (let
|
|
403
|
-
const y = m.slice(
|
|
407
|
+
for (let _ = 0; _ + A <= m.length; _ += A) {
|
|
408
|
+
const y = m.slice(_, _ + A), M = b ? s : 0, S = b ? n : 0;
|
|
404
409
|
let R = null, z = null;
|
|
405
410
|
switch (T) {
|
|
406
411
|
case "M":
|
|
407
|
-
|
|
412
|
+
_ === 0 ? (s = y[0] + M, n = y[1] + S, r = s, a = n, (h < 0 || e[e.length - 1]?.subpath === h) && h++) : (l(q(s, n, y[0] + M, y[1] + S)), s = y[0] + M, n = y[1] + S);
|
|
408
413
|
break;
|
|
409
414
|
case "L":
|
|
410
|
-
l(q(s, n, y[0] +
|
|
415
|
+
l(q(s, n, y[0] + M, y[1] + S)), s = y[0] + M, n = y[1] + S;
|
|
411
416
|
break;
|
|
412
417
|
case "H":
|
|
413
|
-
l(q(s, n, y[0] +
|
|
418
|
+
l(q(s, n, y[0] + M, n)), s = y[0] + M;
|
|
414
419
|
break;
|
|
415
420
|
case "V":
|
|
416
421
|
l(q(s, n, s, y[0] + S)), n = y[0] + S;
|
|
417
422
|
break;
|
|
418
423
|
case "C": {
|
|
419
|
-
const k = [y[0] +
|
|
424
|
+
const k = [y[0] + M, y[1] + S, y[2] + M, y[3] + S, y[4] + M, y[5] + S];
|
|
420
425
|
l(K(s, n, k)), R = [k[2], k[3]], s = k[4], n = k[5];
|
|
421
426
|
break;
|
|
422
427
|
}
|
|
423
428
|
case "S": {
|
|
424
|
-
const [k, C] = o ? [2 * s - o[0], 2 * n - o[1]] : [s, n], P = [k, C, y[0] +
|
|
429
|
+
const [k, C] = o ? [2 * s - o[0], 2 * n - o[1]] : [s, n], P = [k, C, y[0] + M, y[1] + S, y[2] + M, y[3] + S];
|
|
425
430
|
l(K(s, n, P)), R = [P[2], P[3]], s = P[4], n = P[5];
|
|
426
431
|
break;
|
|
427
432
|
}
|
|
428
433
|
case "Q":
|
|
429
434
|
case "T": {
|
|
430
435
|
let k = s, C = n;
|
|
431
|
-
T === "Q" ? (k = y[0] +
|
|
432
|
-
const P = T === "Q" ? y[2] +
|
|
436
|
+
T === "Q" ? (k = y[0] + M, C = y[1] + S) : c && (k = 2 * s - c[0], C = 2 * n - c[1]);
|
|
437
|
+
const P = T === "Q" ? y[2] + M : y[0] + M, v = T === "Q" ? y[3] + S : y[1] + S;
|
|
433
438
|
l(
|
|
434
439
|
K(s, n, [
|
|
435
440
|
s + 2 / 3 * (k - s),
|
|
@@ -443,9 +448,9 @@ function tt(i) {
|
|
|
443
448
|
break;
|
|
444
449
|
}
|
|
445
450
|
case "A": {
|
|
446
|
-
const k = y[5] +
|
|
451
|
+
const k = y[5] + M, C = y[6] + S;
|
|
447
452
|
let P = s, v = n;
|
|
448
|
-
for (const B of
|
|
453
|
+
for (const B of Be(s, n, y[0], y[1], y[2], y[3], y[4], k, C))
|
|
449
454
|
l(K(P, v, B)), P = B[4], v = B[5];
|
|
450
455
|
s = k, n = C;
|
|
451
456
|
break;
|
|
@@ -459,13 +464,13 @@ function tt(i) {
|
|
|
459
464
|
const m = e[d].subpath;
|
|
460
465
|
let T = d, b = 0;
|
|
461
466
|
for (; T < e.length && e[T].subpath === m; ) b += e[T++].length;
|
|
462
|
-
const A = e[d],
|
|
467
|
+
const A = e[d], _ = e[T - 1], y = u.has(m) || Math.abs(_.endX - A.startX) < 1e-9 && Math.abs(_.endY - A.startY) < 1e-9;
|
|
463
468
|
p.push({ start: d, end: T, length: b, closed: y }), d = T;
|
|
464
469
|
}
|
|
465
470
|
const f = { segments: e, totalLength: g, subpaths: p };
|
|
466
|
-
return N.size >=
|
|
471
|
+
return N.size >= Ce && N.delete(N.keys().next().value), N.set(i, f), f;
|
|
467
472
|
}
|
|
468
|
-
function
|
|
473
|
+
function Le(i, t) {
|
|
469
474
|
const e = i.lengths;
|
|
470
475
|
if (t <= 0) return 0;
|
|
471
476
|
if (t >= i.length) return 1;
|
|
@@ -477,7 +482,7 @@ function Be(i, t) {
|
|
|
477
482
|
const r = e[n] - e[s], a = r > 0 ? (t - e[s]) / r : 0;
|
|
478
483
|
return (s + a) / (e.length - 1);
|
|
479
484
|
}
|
|
480
|
-
function
|
|
485
|
+
function Oe(i, t) {
|
|
481
486
|
if (i.type === "L") {
|
|
482
487
|
const l = i.length > 0 ? Math.max(0, Math.min(1, t / i.length)) : 0;
|
|
483
488
|
return {
|
|
@@ -486,7 +491,7 @@ function Le(i, t) {
|
|
|
486
491
|
angle: Math.atan2(i.endY - i.startY, i.endX - i.startX) * 180 / Math.PI
|
|
487
492
|
};
|
|
488
493
|
}
|
|
489
|
-
const [e, s, n, r, a, o] = i.points, c =
|
|
494
|
+
const [e, s, n, r, a, o] = i.points, c = Le(i, t);
|
|
490
495
|
let h = kt(i.startX, e, n, a, c), u = kt(i.startY, s, r, o, c);
|
|
491
496
|
if (Math.hypot(h, u) < 1e-9) {
|
|
492
497
|
const l = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), g = E(i.startX, e, n, a, l), p = E(i.startY, s, r, o, l), f = E(i.startX, e, n, a, c), d = E(i.startY, s, r, o, c);
|
|
@@ -504,16 +509,16 @@ function jt(i, t, e = 0, s = i.length) {
|
|
|
504
509
|
for (let r = e; r < s; r++) {
|
|
505
510
|
const a = i[r];
|
|
506
511
|
if (n + a.length >= t || r === s - 1)
|
|
507
|
-
return
|
|
512
|
+
return Oe(a, t - n);
|
|
508
513
|
n += a.length;
|
|
509
514
|
}
|
|
510
515
|
return { x: 0, y: 0, angle: 0 };
|
|
511
516
|
}
|
|
512
|
-
function
|
|
517
|
+
function $e(i, t) {
|
|
513
518
|
const { segments: e, totalLength: s } = tt(i);
|
|
514
519
|
return jt(e, Math.max(0, Math.min(1, t)) * s);
|
|
515
520
|
}
|
|
516
|
-
const
|
|
521
|
+
const Xe = 24, Fe = 320, Ye = 2.5, V = 72, Ne = 0.2, qe = 128, J = /* @__PURE__ */ new Map();
|
|
517
522
|
let rt = 0, L;
|
|
518
523
|
const wt = (i) => Math.round(i * 100) / 100;
|
|
519
524
|
function Pt(i, t) {
|
|
@@ -548,7 +553,7 @@ function Ct(i) {
|
|
|
548
553
|
t += s, e += n;
|
|
549
554
|
return t /= i.length, e /= i.length, i.map(([s, n]) => [s - t, n - e]);
|
|
550
555
|
}
|
|
551
|
-
function
|
|
556
|
+
function Ve(i, t, e) {
|
|
552
557
|
const s = i.closed && t.closed;
|
|
553
558
|
if (e !== void 0)
|
|
554
559
|
return { offset: s ? Math.abs(e) % V / V : 0, reversed: e < 0 };
|
|
@@ -567,28 +572,28 @@ function qe(i, t, e) {
|
|
|
567
572
|
}
|
|
568
573
|
return o;
|
|
569
574
|
}
|
|
570
|
-
function
|
|
575
|
+
function We(i, t, e) {
|
|
571
576
|
return e ? ((t.reversed ? t.offset - i : i + t.offset) % 1 + 1) % 1 : t.reversed ? 1 - i : i;
|
|
572
577
|
}
|
|
573
|
-
function
|
|
578
|
+
function Ue(i, t, e) {
|
|
574
579
|
return e ? ((t.reversed ? t.offset - i : i - t.offset) % 1 + 1) % 1 : t.reversed ? 1 - i : i;
|
|
575
580
|
}
|
|
576
|
-
function
|
|
577
|
-
const s = i.closed && t.closed, n =
|
|
578
|
-
|
|
579
|
-
Math.min(
|
|
581
|
+
function He(i, t, e) {
|
|
582
|
+
const s = i.closed && t.closed, n = Ve(i, t, e.shapeIndex), r = Math.max(
|
|
583
|
+
Xe,
|
|
584
|
+
Math.min(Fe, Math.ceil(Math.max(i.length, t.length) / Ye))
|
|
580
585
|
), a = /* @__PURE__ */ new Set(), o = (l) => a.add(Math.round(l * 1e7) / 1e7);
|
|
581
586
|
for (let l = 0; l <= r; l++) o(l / r);
|
|
582
587
|
for (const l of vt(i)) o(l);
|
|
583
|
-
for (const l of vt(t)) o(
|
|
588
|
+
for (const l of vt(t)) o(Ue(l, n, s));
|
|
584
589
|
let c = [...a].sort((l, g) => l - g);
|
|
585
590
|
s && (c = c.filter((l) => l < 1));
|
|
586
591
|
const h = [], u = [];
|
|
587
592
|
for (const l of c)
|
|
588
|
-
h.push(...pt(i, l)), u.push(...pt(t,
|
|
589
|
-
return
|
|
593
|
+
h.push(...pt(i, l)), u.push(...pt(t, We(l, n, s)));
|
|
594
|
+
return Qe({ from: h, to: u, closed: s });
|
|
590
595
|
}
|
|
591
|
-
function
|
|
596
|
+
function Qe(i) {
|
|
592
597
|
const t = i.from.length / 2;
|
|
593
598
|
if (t <= 3) return i;
|
|
594
599
|
const e = new Uint8Array(t);
|
|
@@ -596,7 +601,7 @@ function He(i) {
|
|
|
596
601
|
const s = [[0, t - 1]];
|
|
597
602
|
for (; s.length > 0; ) {
|
|
598
603
|
const [a, o] = s.pop();
|
|
599
|
-
let c = -1, h =
|
|
604
|
+
let c = -1, h = Ne;
|
|
600
605
|
for (let u = a + 1; u < o; u++) {
|
|
601
606
|
const l = Math.max(It(i.from, a, o, u), It(i.to, a, o, u));
|
|
602
607
|
l > h && (h = l, c = u);
|
|
@@ -612,28 +617,28 @@ function It(i, t, e, s) {
|
|
|
612
617
|
const n = i[t * 2], r = i[t * 2 + 1], a = i[e * 2] - n, o = i[e * 2 + 1] - r, c = i[s * 2] - n, h = i[s * 2 + 1] - r, u = a * a + o * o, l = u === 0 ? 0 : Math.max(0, Math.min(1, (c * a + h * o) / u));
|
|
613
618
|
return Math.hypot(c - l * a, h - l * o);
|
|
614
619
|
}
|
|
615
|
-
function
|
|
620
|
+
function ze(i, t, e) {
|
|
616
621
|
const s = e.shapeIndex;
|
|
617
622
|
if (L && L.from === i && L.to === t && L.shapeIndex === s) return L.plan;
|
|
618
623
|
const r = J.get(String(s ?? "auto"))?.get(i)?.get(t);
|
|
619
624
|
if (r)
|
|
620
625
|
return L = { from: i, to: t, shapeIndex: s, plan: r }, r;
|
|
621
626
|
const a = tt(i).subpaths.filter((p) => p.length > 0).length === tt(t).subpaths.filter((p) => p.length > 0).length, o = Pt(i, !a), c = Pt(t, !a), h = {
|
|
622
|
-
pairs: o.map((p, f) =>
|
|
627
|
+
pairs: o.map((p, f) => He(p, c[f], e))
|
|
623
628
|
};
|
|
624
|
-
rt >=
|
|
629
|
+
rt >= qe && (J.clear(), rt = 0);
|
|
625
630
|
const u = String(s ?? "auto"), l = J.get(u) ?? /* @__PURE__ */ new Map();
|
|
626
631
|
J.set(u, l);
|
|
627
632
|
const g = l.get(i) ?? /* @__PURE__ */ new Map();
|
|
628
633
|
return l.set(i, g), g.set(t, h), rt++, L = { from: i, to: t, shapeIndex: s, plan: h }, h;
|
|
629
634
|
}
|
|
630
|
-
function
|
|
635
|
+
function je(i, t, e, s = {}) {
|
|
631
636
|
if (!i) return t;
|
|
632
637
|
if (!t) return i;
|
|
633
638
|
const n = Math.max(0, Math.min(1, e));
|
|
634
639
|
if (n === 0) return i;
|
|
635
640
|
if (n === 1) return t;
|
|
636
|
-
const r =
|
|
641
|
+
const r = ze(i, t, s);
|
|
637
642
|
if (r.pairs.length === 0) return n < 0.5 ? i : t;
|
|
638
643
|
let a = "";
|
|
639
644
|
for (const o of r.pairs) {
|
|
@@ -645,27 +650,27 @@ function ze(i, t, e, s = {}) {
|
|
|
645
650
|
}
|
|
646
651
|
return a;
|
|
647
652
|
}
|
|
648
|
-
function
|
|
653
|
+
function Ge(i) {
|
|
649
654
|
return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(i);
|
|
650
655
|
}
|
|
651
|
-
const
|
|
652
|
-
function
|
|
656
|
+
const Ze = 0.9995;
|
|
657
|
+
function Ke() {
|
|
653
658
|
return [0, 0, 0, 1];
|
|
654
659
|
}
|
|
655
|
-
function
|
|
660
|
+
function Je(i, t) {
|
|
656
661
|
return i[0] * t[0] + i[1] * t[1] + i[2] * t[2] + i[3] * t[3];
|
|
657
662
|
}
|
|
658
|
-
function
|
|
663
|
+
function ti(i) {
|
|
659
664
|
return Math.hypot(i[0], i[1], i[2], i[3]);
|
|
660
665
|
}
|
|
661
666
|
function H(i) {
|
|
662
|
-
const t =
|
|
663
|
-
return t === 0 ?
|
|
667
|
+
const t = ti(i);
|
|
668
|
+
return t === 0 ? Ke() : [i[0] / t, i[1] / t, i[2] / t, i[3] / t];
|
|
664
669
|
}
|
|
665
|
-
function
|
|
670
|
+
function ei(i, t, e) {
|
|
666
671
|
const s = H(i);
|
|
667
|
-
let n = H(t), r =
|
|
668
|
-
if (r < 0 && (n = [-n[0], -n[1], -n[2], -n[3]], r = -r), r >
|
|
672
|
+
let n = H(t), r = Je(s, n);
|
|
673
|
+
if (r < 0 && (n = [-n[0], -n[1], -n[2], -n[3]], r = -r), r > Ze)
|
|
669
674
|
return H([
|
|
670
675
|
s[0] + (n[0] - s[0]) * e,
|
|
671
676
|
s[1] + (n[1] - s[1]) * e,
|
|
@@ -691,23 +696,23 @@ function Rt(i) {
|
|
|
691
696
|
];
|
|
692
697
|
return at.size < Gt && at.set(i, s), s;
|
|
693
698
|
}
|
|
694
|
-
const Dt = (i) => i.charCodeAt(0) === 35, Et = (i) => i.startsWith("rgb"), Bt = (i) => i.startsWith("rgba"),
|
|
695
|
-
function
|
|
699
|
+
const Dt = (i) => i.charCodeAt(0) === 35, Et = (i) => i.startsWith("rgb"), Bt = (i) => i.startsWith("rgba"), ii = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, ct = (i) => Math.round(i).toString(16).padStart(2, "0");
|
|
700
|
+
function si(i, t, e) {
|
|
696
701
|
return `#${ct(i)}${ct(t)}${ct(e)}`;
|
|
697
702
|
}
|
|
698
703
|
function Lt(i) {
|
|
699
704
|
const t = ot.get(i);
|
|
700
705
|
if (t) return t;
|
|
701
|
-
const e = i.match(
|
|
706
|
+
const e = i.match(ii);
|
|
702
707
|
if (!e)
|
|
703
708
|
throw new Error(`Invalid rgb color: ${i}`);
|
|
704
709
|
const s = parseInt(e[1], 10), n = parseInt(e[2], 10), r = parseInt(e[3], 10), a = e[4] !== void 0 ? [s, n, r, parseFloat(e[4])] : [s, n, r];
|
|
705
710
|
return ot.size < Gt && ot.set(i, a), a;
|
|
706
711
|
}
|
|
707
|
-
const
|
|
712
|
+
const ni = (i, t, e) => {
|
|
708
713
|
if (Dt(i) && Dt(t)) {
|
|
709
714
|
const [s, n, r] = Rt(i), [a, o, c] = Rt(t), h = D(s, a, e), u = D(n, o, e), l = D(r, c, e);
|
|
710
|
-
return
|
|
715
|
+
return si(h, u, l);
|
|
711
716
|
}
|
|
712
717
|
if ((Et(i) || Bt(i)) && (Et(t) || Bt(t))) {
|
|
713
718
|
const s = Lt(i), n = Lt(t), r = Math.round(D(s[0], n[0], e)), a = Math.round(D(s[1], n[1], e)), o = Math.round(D(s[2], n[2], e));
|
|
@@ -718,16 +723,16 @@ const si = (i, t, e) => {
|
|
|
718
723
|
return `rgb(${r}, ${a}, ${o})`;
|
|
719
724
|
}
|
|
720
725
|
return e < 1 ? i : t;
|
|
721
|
-
},
|
|
726
|
+
}, ri = (i, t, e) => {
|
|
722
727
|
const s = Math.min(i.length, t.length), n = [];
|
|
723
728
|
for (let r = 0; r < s; r++)
|
|
724
729
|
n.push(D(i[r], t[r], e));
|
|
725
730
|
return n;
|
|
726
|
-
},
|
|
727
|
-
function
|
|
728
|
-
return t === "slerp" ?
|
|
731
|
+
}, ai = (i, t, e) => ei(i, t, e), Ot = (i, t, e) => e < 1 ? i : t, oi = (i, t, e) => je(i, t, e);
|
|
732
|
+
function ci(i, t) {
|
|
733
|
+
return t === "slerp" ? ai : typeof i == "number" ? D : Array.isArray(i) ? ri : typeof i == "string" ? i.startsWith("#") || i.startsWith("rgb") ? ni : Ge(i) ? oi : Ot : Ot;
|
|
729
734
|
}
|
|
730
|
-
function
|
|
735
|
+
function hi(i) {
|
|
731
736
|
const t = [...i.keyframes].sort((e, s) => e.time - s.time);
|
|
732
737
|
return {
|
|
733
738
|
...i,
|
|
@@ -801,8 +806,8 @@ class ht {
|
|
|
801
806
|
return;
|
|
802
807
|
if (s.time === t)
|
|
803
808
|
return s.value;
|
|
804
|
-
const r = n.time - s.time, a = (t - s.time) / r, c =
|
|
805
|
-
return
|
|
809
|
+
const r = n.time - s.time, a = (t - s.time) / r, c = xe(n.easing)(a);
|
|
810
|
+
return ci(s.value, this.track.interpolation)(s.value, n.value, c);
|
|
806
811
|
}
|
|
807
812
|
/**
|
|
808
813
|
* Find the keyframes surrounding a given time.
|
|
@@ -815,12 +820,12 @@ class ht {
|
|
|
815
820
|
return { from: null, to: null };
|
|
816
821
|
}
|
|
817
822
|
}
|
|
818
|
-
class
|
|
823
|
+
class li {
|
|
819
824
|
track;
|
|
820
825
|
targets;
|
|
821
826
|
sampler;
|
|
822
827
|
constructor(t) {
|
|
823
|
-
this.track = t, this.targets = O(t), this.sampler = new
|
|
828
|
+
this.track = t, this.targets = O(t), this.sampler = new he(t.spring);
|
|
824
829
|
}
|
|
825
830
|
getValueAtTime(t) {
|
|
826
831
|
return this.sampler.valueAt(t - F(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
@@ -842,7 +847,7 @@ class hi {
|
|
|
842
847
|
return this.track;
|
|
843
848
|
}
|
|
844
849
|
}
|
|
845
|
-
class
|
|
850
|
+
class ui {
|
|
846
851
|
track;
|
|
847
852
|
targets;
|
|
848
853
|
duration;
|
|
@@ -850,13 +855,13 @@ class li {
|
|
|
850
855
|
this.track = t, this.targets = O(t), this.duration = Ut(t.inertia);
|
|
851
856
|
}
|
|
852
857
|
getValueAtTime(t) {
|
|
853
|
-
return
|
|
858
|
+
return _t(this.track.inertia, t - F(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
854
859
|
}
|
|
855
860
|
getTargetValues(t) {
|
|
856
861
|
const e = this.targets.length, s = [];
|
|
857
862
|
for (let n = 0; n < e; n++) {
|
|
858
863
|
const r = F(n, e, this.track.delay, this.track.stagger);
|
|
859
|
-
s.push({ target: this.targets[n], value:
|
|
864
|
+
s.push({ target: this.targets[n], value: _t(this.track.inertia, t - r), start: r });
|
|
860
865
|
}
|
|
861
866
|
return s;
|
|
862
867
|
}
|
|
@@ -869,8 +874,8 @@ class li {
|
|
|
869
874
|
return this.track;
|
|
870
875
|
}
|
|
871
876
|
}
|
|
872
|
-
function
|
|
873
|
-
const e = {
|
|
877
|
+
function di(i, t) {
|
|
878
|
+
const e = { ...$e(i.pathData, t) };
|
|
874
879
|
if (i.matrix) {
|
|
875
880
|
const [s, n, r, a, o, c] = i.matrix, { x: h, y: u } = e;
|
|
876
881
|
e.x = s * h + r * u + o, e.y = n * h + a * u + c;
|
|
@@ -884,16 +889,16 @@ const lt = {
|
|
|
884
889
|
lowerCase: "abcdefghijklmnopqrstuvwxyz",
|
|
885
890
|
upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
886
891
|
numbers: "0123456789"
|
|
887
|
-
},
|
|
888
|
-
function
|
|
892
|
+
}, fi = 20;
|
|
893
|
+
function pi(i) {
|
|
889
894
|
const t = lt[i ?? "upperCase"] ?? i ?? lt.upperCase, e = Array.from(t);
|
|
890
895
|
return e.length > 0 ? e : Array.from(lt.upperCase);
|
|
891
896
|
}
|
|
892
|
-
function
|
|
897
|
+
function mi(i, t, e) {
|
|
893
898
|
let s = (i | 0) ^ Math.imul(t + 1, 2654435761) ^ Math.imul(e + 1, 2246822507);
|
|
894
899
|
return s = Math.imul(s ^ s >>> 16, 2146121005), s = Math.imul(s ^ s >>> 15, 2221713035), (s ^ s >>> 16) >>> 0;
|
|
895
900
|
}
|
|
896
|
-
function
|
|
901
|
+
function gi(i, t, e = 0) {
|
|
897
902
|
const s = i.from ?? "", n = i.to, r = Math.max(0, Math.min(1, t));
|
|
898
903
|
if (r <= 0) return s;
|
|
899
904
|
if (r >= 1) return n;
|
|
@@ -902,16 +907,16 @@ function mi(i, t, e = 0) {
|
|
|
902
907
|
const b = Math.round(r * Math.max(a.length, o.length));
|
|
903
908
|
return c ? a.slice(0, Math.max(0, a.length - b)).join("") + o.slice(Math.max(0, o.length - b)).join("") : o.slice(0, b).join("") + a.slice(b).join("");
|
|
904
909
|
}
|
|
905
|
-
const h = Math.max(0, Math.min(0.999, i.revealDelay ?? 0)), u = Math.max(0, (r - h) / (1 - h)), l = Math.floor(u * o.length), g = i.tweenLength === !1 ? o.length : Math.round(a.length + (o.length - a.length) * r), p =
|
|
910
|
+
const h = Math.max(0, Math.min(0.999, i.revealDelay ?? 0)), u = Math.max(0, (r - h) / (1 - h)), l = Math.floor(u * o.length), g = i.tweenLength === !1 ? o.length : Math.round(a.length + (o.length - a.length) * r), p = pi(i.chars), f = i.refreshRate ?? fi, d = f > 0 ? Math.floor(e * f / 1e3) : 0, m = i.seed ?? 1;
|
|
906
911
|
let T = "";
|
|
907
912
|
for (let b = 0; b < g; b++) {
|
|
908
|
-
const A = c ? b >= g - l : b < l,
|
|
909
|
-
A &&
|
|
910
|
-
` ? T +=
|
|
913
|
+
const A = c ? b >= g - l : b < l, _ = c ? o[o.length - (g - b)] : o[b];
|
|
914
|
+
A && _ !== void 0 || _ === " " || _ === `
|
|
915
|
+
` ? T += _ : T += p[mi(m, b, d) % p.length];
|
|
911
916
|
}
|
|
912
917
|
return T;
|
|
913
918
|
}
|
|
914
|
-
class
|
|
919
|
+
class yi {
|
|
915
920
|
id;
|
|
916
921
|
name;
|
|
917
922
|
_captions;
|
|
@@ -980,6 +985,14 @@ class gi {
|
|
|
980
985
|
set speed(t) {
|
|
981
986
|
this._config.speed = t;
|
|
982
987
|
}
|
|
988
|
+
/** Drawings per second (0: every frame); see `TimelineConfig.drawingRate`. */
|
|
989
|
+
get drawingRate() {
|
|
990
|
+
return this._config.drawingRate ?? 0;
|
|
991
|
+
}
|
|
992
|
+
set drawingRate(t) {
|
|
993
|
+
const e = { ...this._config };
|
|
994
|
+
t > 0 ? e.drawingRate = t : delete e.drawingRate, this._config = e;
|
|
995
|
+
}
|
|
983
996
|
/**
|
|
984
997
|
* Start or resume playback.
|
|
985
998
|
* If at the end and direction is forward, reset to beginning.
|
|
@@ -1058,7 +1071,7 @@ class gi {
|
|
|
1058
1071
|
*/
|
|
1059
1072
|
getStateAtTime(t) {
|
|
1060
1073
|
const e = /* @__PURE__ */ new Map();
|
|
1061
|
-
if (this._hasSharedWrites())
|
|
1074
|
+
if (t = ae(t, this._config.drawingRate ?? 0), this._hasSharedWrites())
|
|
1062
1075
|
this._resolveShared(t, e);
|
|
1063
1076
|
else
|
|
1064
1077
|
for (const [s, n] of this._trackPlayers) {
|
|
@@ -1110,12 +1123,12 @@ class gi {
|
|
|
1110
1123
|
o || (o = /* @__PURE__ */ new Map(), t.set(s, o));
|
|
1111
1124
|
const c = this._textTracks.get(e);
|
|
1112
1125
|
if (c && typeof r == "number") {
|
|
1113
|
-
o.set("text",
|
|
1126
|
+
o.set("text", gi(c.textConfig, r, Math.max(0, a)));
|
|
1114
1127
|
return;
|
|
1115
1128
|
}
|
|
1116
1129
|
const h = this._motionPathTracks.get(e);
|
|
1117
1130
|
if (h && typeof r == "number") {
|
|
1118
|
-
const u =
|
|
1131
|
+
const u = di(h.motionPathConfig, r);
|
|
1119
1132
|
o.set("motionPathX", u.x), o.set("motionPathY", u.y), h.motionPathConfig.autoRotate && o.set("motionPathRotate", u.angle);
|
|
1120
1133
|
} else
|
|
1121
1134
|
o.set(n, r);
|
|
@@ -1143,11 +1156,11 @@ class gi {
|
|
|
1143
1156
|
*/
|
|
1144
1157
|
addTrack(t) {
|
|
1145
1158
|
if (this._tracks.push(t), this._sharedWrites = null, ut(t)) {
|
|
1146
|
-
this._trackPlayers.set(t.id, new
|
|
1159
|
+
this._trackPlayers.set(t.id, new ui(t));
|
|
1147
1160
|
return;
|
|
1148
1161
|
}
|
|
1149
1162
|
if (dt(t)) {
|
|
1150
|
-
this._trackPlayers.set(t.id, new
|
|
1163
|
+
this._trackPlayers.set(t.id, new li(t)), this._springTracks.set(t.id, t);
|
|
1151
1164
|
return;
|
|
1152
1165
|
}
|
|
1153
1166
|
if (Yt(t))
|
|
@@ -1325,8 +1338,8 @@ class gi {
|
|
|
1325
1338
|
return this._config.alternate && (t === -1 || this._loopIteration < t) ? (this._loopIteration++, this._armRepeatDelay(), this._direction = "forward", this._repeatDelayRemaining === 0) : (this._playbackState = "idle", this.onComplete?.(), !1);
|
|
1326
1339
|
}
|
|
1327
1340
|
}
|
|
1328
|
-
const
|
|
1329
|
-
function
|
|
1341
|
+
const Ti = 100;
|
|
1342
|
+
function bi(i, t, e, s) {
|
|
1330
1343
|
const n = [], r = [], { duration: a, alternate: o } = s, c = (p, f, d, m) => {
|
|
1331
1344
|
r.push([p, f]);
|
|
1332
1345
|
const T = [];
|
|
@@ -1336,14 +1349,14 @@ function Ti(i, t, e, s) {
|
|
|
1336
1349
|
for (const b of T) n.push({ kind: "event", index: b, direction: d });
|
|
1337
1350
|
};
|
|
1338
1351
|
let h = t.time, u = t.direction, l = t.fresh === !0;
|
|
1339
|
-
const g = Math.min(
|
|
1352
|
+
const g = Math.min(Ti, Math.max(0, e.iteration - t.iteration));
|
|
1340
1353
|
for (let p = 0; p < g; p++) {
|
|
1341
1354
|
const f = u === "forward" ? a : 0;
|
|
1342
1355
|
c(h, f, u, l), n.push({ kind: "repeat" }), o ? (u = u === "forward" ? "reverse" : "forward", h = f, l = !1) : (h = u === "forward" ? 0 : a, l = !0);
|
|
1343
1356
|
}
|
|
1344
1357
|
return g > 0 && s.holding && !o ? { crossings: n, passes: r } : (c(h, e.time, u, l), { crossings: n, passes: r });
|
|
1345
1358
|
}
|
|
1346
|
-
function
|
|
1359
|
+
function Ai(i) {
|
|
1347
1360
|
return { ...i, ...Array.isArray(i.end) && { end: [...i.end] } };
|
|
1348
1361
|
}
|
|
1349
1362
|
function W(i) {
|
|
@@ -1355,7 +1368,7 @@ function W(i) {
|
|
|
1355
1368
|
...i.stagger !== void 0 && { stagger: { ...i.stagger } }
|
|
1356
1369
|
};
|
|
1357
1370
|
}
|
|
1358
|
-
function
|
|
1371
|
+
function Si(i) {
|
|
1359
1372
|
if (ut(i)) {
|
|
1360
1373
|
const t = i;
|
|
1361
1374
|
return {
|
|
@@ -1363,7 +1376,7 @@ function Ai(i) {
|
|
|
1363
1376
|
target: t.target,
|
|
1364
1377
|
property: t.property,
|
|
1365
1378
|
kind: "inertia",
|
|
1366
|
-
inertia:
|
|
1379
|
+
inertia: Ai(t.inertia),
|
|
1367
1380
|
...W(t)
|
|
1368
1381
|
};
|
|
1369
1382
|
}
|
|
@@ -1400,7 +1413,7 @@ function Ai(i) {
|
|
|
1400
1413
|
...W(t)
|
|
1401
1414
|
};
|
|
1402
1415
|
}
|
|
1403
|
-
return
|
|
1416
|
+
return hi({
|
|
1404
1417
|
id: i.id,
|
|
1405
1418
|
target: i.target,
|
|
1406
1419
|
property: i.property,
|
|
@@ -1415,15 +1428,15 @@ function et(i) {
|
|
|
1415
1428
|
throw new Error(
|
|
1416
1429
|
`tinyfly: this animation uses format version ${t}, but this tinyfly reads up to version ${At}. Update tinyfly to play it.`
|
|
1417
1430
|
);
|
|
1418
|
-
return new
|
|
1431
|
+
return new yi({
|
|
1419
1432
|
id: i.id,
|
|
1420
1433
|
name: i.name,
|
|
1421
1434
|
config: i.config,
|
|
1422
|
-
tracks: i.tracks.map(
|
|
1435
|
+
tracks: i.tracks.map(Si),
|
|
1423
1436
|
captions: i.captions
|
|
1424
1437
|
});
|
|
1425
1438
|
}
|
|
1426
|
-
function
|
|
1439
|
+
function _i(i) {
|
|
1427
1440
|
const [t, e, s, n] = i;
|
|
1428
1441
|
return [
|
|
1429
1442
|
1 - 2 * (e * e + s * s),
|
|
@@ -1445,9 +1458,9 @@ function Si(i) {
|
|
|
1445
1458
|
];
|
|
1446
1459
|
}
|
|
1447
1460
|
function Mi(i) {
|
|
1448
|
-
return !Array.isArray(i) || i.length !== 4 ? null : `matrix3d(${
|
|
1461
|
+
return !Array.isArray(i) || i.length !== 4 ? null : `matrix3d(${_i(H(i)).map((e) => Math.round(e * 1e6) / 1e6 + 0).join(", ")})`;
|
|
1449
1462
|
}
|
|
1450
|
-
const
|
|
1463
|
+
const ki = /* @__PURE__ */ new Set([
|
|
1451
1464
|
"blur",
|
|
1452
1465
|
"brightness",
|
|
1453
1466
|
"glow",
|
|
@@ -1456,16 +1469,16 @@ const _i = /* @__PURE__ */ new Set([
|
|
|
1456
1469
|
"shadowY",
|
|
1457
1470
|
"shadowBlur",
|
|
1458
1471
|
"shadowColor"
|
|
1459
|
-
]),
|
|
1460
|
-
function
|
|
1472
|
+
]), wi = "#ffffff", Pi = "rgba(0, 0, 0, 0.5)";
|
|
1473
|
+
function vi(i) {
|
|
1461
1474
|
const t = [];
|
|
1462
|
-
if (i.blur !== void 0 && t.push(`blur(${Math.max(0, i.blur)}px)`), i.brightness !== void 0 && t.push(`brightness(${Math.max(0, i.brightness)})`), i.glow !== void 0 && t.push(`drop-shadow(0 0 ${Math.max(0, i.glow)}px ${i.glowColor ??
|
|
1475
|
+
if (i.blur !== void 0 && t.push(`blur(${Math.max(0, i.blur)}px)`), i.brightness !== void 0 && t.push(`brightness(${Math.max(0, i.brightness)})`), i.glow !== void 0 && t.push(`drop-shadow(0 0 ${Math.max(0, i.glow)}px ${i.glowColor ?? wi})`), i.shadowX !== void 0 || i.shadowY !== void 0 || i.shadowBlur !== void 0) {
|
|
1463
1476
|
const e = i.shadowX ?? 0, s = i.shadowY ?? 0, n = Math.max(0, i.shadowBlur ?? 0);
|
|
1464
|
-
t.push(`drop-shadow(${e}px ${s}px ${n}px ${i.shadowColor ??
|
|
1477
|
+
t.push(`drop-shadow(${e}px ${s}px ${n}px ${i.shadowColor ?? Pi})`);
|
|
1465
1478
|
}
|
|
1466
1479
|
return t.length > 0 ? t.join(" ") : null;
|
|
1467
1480
|
}
|
|
1468
|
-
function
|
|
1481
|
+
function xi(i, t) {
|
|
1469
1482
|
const e = i.childNodes.length === 1 ? i.firstChild : null;
|
|
1470
1483
|
if (e && e.nodeType === 3) {
|
|
1471
1484
|
const s = e;
|
|
@@ -1474,7 +1487,7 @@ function vi(i, t) {
|
|
|
1474
1487
|
}
|
|
1475
1488
|
i.textContent !== t && (i.textContent = t);
|
|
1476
1489
|
}
|
|
1477
|
-
function
|
|
1490
|
+
function Ci(i) {
|
|
1478
1491
|
if (!("ownerSVGElement" in i)) return;
|
|
1479
1492
|
const t = i.style;
|
|
1480
1493
|
!t || t.transformBox || (t.transformBox = "fill-box", t.transformOrigin || (t.transformOrigin = "50% 50%"));
|
|
@@ -1505,7 +1518,7 @@ const $t = /* @__PURE__ */ new Set([
|
|
|
1505
1518
|
"gap",
|
|
1506
1519
|
"rowGap",
|
|
1507
1520
|
"columnGap"
|
|
1508
|
-
]),
|
|
1521
|
+
]), Ii = /* @__PURE__ */ new Set([
|
|
1509
1522
|
"x",
|
|
1510
1523
|
"y",
|
|
1511
1524
|
"z",
|
|
@@ -1525,7 +1538,7 @@ const $t = /* @__PURE__ */ new Set([
|
|
|
1525
1538
|
"motionPathX",
|
|
1526
1539
|
"motionPathY",
|
|
1527
1540
|
"motionPathRotate"
|
|
1528
|
-
]),
|
|
1541
|
+
]), Ri = [
|
|
1529
1542
|
"x",
|
|
1530
1543
|
"motionPathX",
|
|
1531
1544
|
"y",
|
|
@@ -1543,7 +1556,7 @@ const $t = /* @__PURE__ */ new Set([
|
|
|
1543
1556
|
"scaleZ",
|
|
1544
1557
|
"skewX",
|
|
1545
1558
|
"skewY"
|
|
1546
|
-
],
|
|
1559
|
+
], Di = /* @__PURE__ */ new Set(["childPerspective", "perspectiveOriginX", "perspectiveOriginY"]), Ei = /* @__PURE__ */ new Set(["originX", "originY"]), Bi = /* @__PURE__ */ new Set(["clipTop", "clipRight", "clipBottom", "clipLeft"]), Li = /* @__PURE__ */ new Set(["drawOn"]), Oi = {
|
|
1547
1560
|
fill: "backgroundColor",
|
|
1548
1561
|
stroke: "borderColor",
|
|
1549
1562
|
strokeWidth: "borderWidth",
|
|
@@ -1558,7 +1571,7 @@ const $t = /* @__PURE__ */ new Set([
|
|
|
1558
1571
|
strokeDashoffset: "strokeDashoffset",
|
|
1559
1572
|
fillOpacity: "fillOpacity",
|
|
1560
1573
|
strokeOpacity: "strokeOpacity"
|
|
1561
|
-
},
|
|
1574
|
+
}, $i = "http://www.w3.org/2000/svg";
|
|
1562
1575
|
class Q {
|
|
1563
1576
|
targets = /* @__PURE__ */ new Map();
|
|
1564
1577
|
/**
|
|
@@ -1601,20 +1614,20 @@ class Q {
|
|
|
1601
1614
|
let s = null, n = null, r = null, a = null, o = null;
|
|
1602
1615
|
const c = e.has("motionPathX"), h = e.has("motionPathY"), u = e.has("motionPathRotate");
|
|
1603
1616
|
for (const [f, d] of e)
|
|
1604
|
-
if (!(f === "x" && c) && !(f === "y" && h) && !((f === "rotate" || f === "rotateZ") && u) && !
|
|
1605
|
-
if (
|
|
1617
|
+
if (!(f === "x" && c) && !(f === "y" && h) && !((f === "rotate" || f === "rotateZ") && u) && !Li.has(f)) {
|
|
1618
|
+
if (Ii.has(f))
|
|
1606
1619
|
(s ??= {})[f] = d;
|
|
1607
|
-
else if (Ri.has(f))
|
|
1608
|
-
typeof d == "number" && ((n ??= {})[f] = d);
|
|
1609
1620
|
else if (Di.has(f))
|
|
1610
|
-
typeof d == "number" && ((
|
|
1621
|
+
typeof d == "number" && ((n ??= {})[f] = d);
|
|
1611
1622
|
else if (Ei.has(f))
|
|
1623
|
+
typeof d == "number" && ((r ??= {})[f] = d);
|
|
1624
|
+
else if (Bi.has(f))
|
|
1612
1625
|
typeof d == "number" && ((a ??= {})[f] = d);
|
|
1613
|
-
else if (
|
|
1626
|
+
else if (ki.has(f))
|
|
1614
1627
|
(o ??= {})[f] = d;
|
|
1615
1628
|
else if (f !== "perspective") {
|
|
1616
1629
|
if (f !== "shine") if (f === "text" && typeof d == "string")
|
|
1617
|
-
|
|
1630
|
+
xi(t, d);
|
|
1618
1631
|
else if (f === "d" && typeof d == "string") {
|
|
1619
1632
|
const m = t;
|
|
1620
1633
|
(m.tagName?.toLowerCase() === "path" ? m : m.querySelector?.("path"))?.setAttribute?.("d", d);
|
|
@@ -1626,13 +1639,13 @@ class Q {
|
|
|
1626
1639
|
typeof l == "number" && this.applyShine(t, l);
|
|
1627
1640
|
const g = [], p = e.get("perspective");
|
|
1628
1641
|
if (typeof p == "number" && p > 0 && g.push(`perspective(${p}px)`), s)
|
|
1629
|
-
for (const f of
|
|
1642
|
+
for (const f of Ri) {
|
|
1630
1643
|
const d = s[f];
|
|
1631
1644
|
if (d === void 0) continue;
|
|
1632
1645
|
const m = this.buildTransformPart(f, d);
|
|
1633
1646
|
m && g.push(m);
|
|
1634
1647
|
}
|
|
1635
|
-
if (g.length > 0 && (t.style.transform = g.join(" "),
|
|
1648
|
+
if (g.length > 0 && (t.style.transform = g.join(" "), Ci(t)), n && (n.childPerspective !== void 0 && (t.style.perspective = `${n.childPerspective}px`), (n.perspectiveOriginX !== void 0 || n.perspectiveOriginY !== void 0) && (t.style.perspectiveOrigin = `${n.perspectiveOriginX ?? 50}% ${n.perspectiveOriginY ?? 50}%`)), r) {
|
|
1636
1649
|
const f = r.originX ?? 50, d = r.originY ?? 50;
|
|
1637
1650
|
t.style.transformOrigin = `${f}% ${d}%`;
|
|
1638
1651
|
}
|
|
@@ -1641,7 +1654,7 @@ class Q {
|
|
|
1641
1654
|
t.style.clipPath = `inset(${f}% ${d}% ${m}% ${T}%)`;
|
|
1642
1655
|
}
|
|
1643
1656
|
if (o) {
|
|
1644
|
-
const f =
|
|
1657
|
+
const f = vi(o);
|
|
1645
1658
|
f && (t.style.filter = f);
|
|
1646
1659
|
}
|
|
1647
1660
|
}
|
|
@@ -1702,11 +1715,11 @@ class Q {
|
|
|
1702
1715
|
*/
|
|
1703
1716
|
applyStyleProperty(t, e, s) {
|
|
1704
1717
|
let n;
|
|
1705
|
-
if (t.namespaceURI ===
|
|
1718
|
+
if (t.namespaceURI === $i && e in Xt) {
|
|
1706
1719
|
const o = Array.isArray(s) ? s.join(", ") : String(s);
|
|
1707
1720
|
t.style[Xt[e]] = o;
|
|
1708
1721
|
return;
|
|
1709
|
-
} else e === "fill" && t.dataset?.elementType === "text" ? n = "color" : n =
|
|
1722
|
+
} else e === "fill" && t.dataset?.elementType === "text" ? n = "color" : n = Oi[e] ?? e;
|
|
1710
1723
|
let a;
|
|
1711
1724
|
typeof s == "number" ? $t.has(e) || $t.has(n) ? a = `${s}px` : a = String(s) : Array.isArray(s) ? a = s.join(", ") : a = s, t.style[n] = a;
|
|
1712
1725
|
}
|
|
@@ -1750,7 +1763,7 @@ class Ft {
|
|
|
1750
1763
|
});
|
|
1751
1764
|
}
|
|
1752
1765
|
}
|
|
1753
|
-
function
|
|
1766
|
+
function Xi(i, t, e, s, n) {
|
|
1754
1767
|
const r = e - n;
|
|
1755
1768
|
if (r < 0) {
|
|
1756
1769
|
t.paused || t.pause(), t.currentTime = 0;
|
|
@@ -1996,7 +2009,7 @@ class Zt {
|
|
|
1996
2009
|
/** Sync all discovered media targets to a timeline time. */
|
|
1997
2010
|
syncAllMedia(t, e) {
|
|
1998
2011
|
for (const s of this.mediaTargets)
|
|
1999
|
-
|
|
2012
|
+
Xi(s.sync, s.el, t, e, s.startTime);
|
|
2000
2013
|
}
|
|
2001
2014
|
/**
|
|
2002
2015
|
* Load animation from inline JSON string.
|
|
@@ -2159,7 +2172,7 @@ class Zt {
|
|
|
2159
2172
|
this.playhead = s;
|
|
2160
2173
|
const n = this.markers;
|
|
2161
2174
|
if (n.length === 0) return;
|
|
2162
|
-
const { crossings: r } =
|
|
2175
|
+
const { crossings: r } = bi(
|
|
2163
2176
|
n.map((a) => a.time),
|
|
2164
2177
|
t,
|
|
2165
2178
|
s,
|
|
@@ -2187,14 +2200,14 @@ class Zt {
|
|
|
2187
2200
|
}
|
|
2188
2201
|
}
|
|
2189
2202
|
}
|
|
2190
|
-
async function
|
|
2203
|
+
async function Yi(i, t, e = {}) {
|
|
2191
2204
|
const s = new Zt(i, { ...e, autoplay: !0 });
|
|
2192
2205
|
return await s.load(t), s;
|
|
2193
2206
|
}
|
|
2194
|
-
function
|
|
2207
|
+
function Ni(i, t = {}) {
|
|
2195
2208
|
return new Zt(i, t);
|
|
2196
2209
|
}
|
|
2197
|
-
class
|
|
2210
|
+
class Fi {
|
|
2198
2211
|
container;
|
|
2199
2212
|
containerA;
|
|
2200
2213
|
containerB;
|
|
@@ -2463,18 +2476,18 @@ class Xi {
|
|
|
2463
2476
|
this.animationFrameId !== void 0 && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = void 0);
|
|
2464
2477
|
}
|
|
2465
2478
|
}
|
|
2466
|
-
async function
|
|
2467
|
-
const s = new
|
|
2479
|
+
async function qi(i, t, e = {}) {
|
|
2480
|
+
const s = new Fi(i, { ...e, autoplay: !0 });
|
|
2468
2481
|
return await s.load(t), s;
|
|
2469
2482
|
}
|
|
2470
|
-
const
|
|
2483
|
+
const Vi = { type: "none", duration: 0 };
|
|
2471
2484
|
export {
|
|
2472
|
-
|
|
2485
|
+
Vi as DEFAULT_TRANSITION,
|
|
2473
2486
|
Ft as MediaSync,
|
|
2474
2487
|
Zt as TinyflyPlayer,
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2488
|
+
Fi as TinyflySequencer,
|
|
2489
|
+
Ni as create,
|
|
2490
|
+
Yi as play,
|
|
2491
|
+
qi as playSequence,
|
|
2492
|
+
Xi as syncMediaElement
|
|
2480
2493
|
};
|