@algorisys/tinyfly 0.99.0 → 0.101.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 +9 -9
- package/bin/tinyfly.mjs +7 -3
- package/docs/acting.md +10 -6
- package/docs/character-appearance.md +71 -7
- package/docs/editor-guide.md +38 -3
- package/docs/examples.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +34 -9
- package/docs/maps.md +2 -2
- package/docs/props.md +61 -1
- package/docs/scene-3d.md +23 -4
- package/docs/teaching.md +1 -1
- package/docs/video-rendering.md +154 -0
- package/lib/addons/adapters.js +387 -333
- package/lib/addons/characters.js +4795 -3752
- package/lib/addons/load-scene-oWNsYYC1.js +372 -0
- package/lib/addons/scene-3d-webgl.js +1 -1
- package/lib/addons/scene-3d.js +323 -277
- package/lib/addons/shading-0lPgnXmD.js +96 -0
- package/lib/browser/tinyfly-scene-3d.iife.js +2 -2
- package/lib/browser/tinyfly.iife.js +14 -14
- package/lib/browser/tinyfly.js +7294 -5893
- package/lib/browser/tinyfly.umd.js +14 -14
- package/lib/engine/tinyfly-engine.js +1389 -1031
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/headless/headless.js +39 -0
- package/lib/types/adapters/canvas/impossible.d.ts +15 -0
- package/lib/types/adapters/canvas/index.d.ts +3 -0
- package/lib/types/adapters/canvas/nested-zoom.d.ts +40 -0
- package/lib/types/adapters/canvas/zoom-blur.d.ts +49 -0
- package/lib/types/characters/acting/character-script.d.ts +14 -2
- package/lib/types/characters/acting/script.d.ts +9 -0
- package/lib/types/characters/capabilities.d.ts +2 -0
- package/lib/types/characters/character.d.ts +28 -1
- package/lib/types/characters/hair-follow.d.ts +12 -6
- package/lib/types/characters/hands/held-items.d.ts +6 -2
- package/lib/types/characters/head/face.d.ts +23 -1
- package/lib/types/characters/index.d.ts +3 -2
- package/lib/types/characters/interactions.d.ts +60 -0
- package/lib/types/characters/props/families/animals.d.ts +6 -0
- package/lib/types/characters/props/families/birds.d.ts +16 -0
- package/lib/types/characters/props/families/furniture.d.ts +102 -0
- package/lib/types/characters/props/index.d.ts +1 -0
- package/lib/types/characters/props/presets.d.ts +15 -2
- package/lib/types/characters/props/ride-3d.d.ts +4 -1
- package/lib/types/characters/scenery.d.ts +126 -0
- package/lib/types/characters/species/human-motion.d.ts +17 -0
- package/lib/types/characters/species/human.d.ts +6 -0
- package/lib/types/characters/wardrobe/basic-outfit.d.ts +16 -5
- package/lib/types/engine/authoring/beat-loop.d.ts +46 -0
- package/lib/types/engine/authoring/curve.d.ts +26 -0
- package/lib/types/engine/authoring/index.d.ts +3 -0
- package/lib/types/engine/authoring/periodic.d.ts +89 -0
- package/lib/types/engine/path/goo.d.ts +103 -0
- package/lib/types/engine/path/impossible.d.ts +92 -0
- package/lib/types/engine/path/index.d.ts +6 -0
- package/lib/types/engine/path/similarity.d.ts +48 -0
- package/lib/types/headless/index.d.ts +1 -0
- package/lib/types/headless/loop-audio.d.ts +21 -0
- package/lib/types/headless/node-audio.d.ts +20 -0
- package/lib/types/headless/video-scene.d.ts +9 -0
- package/lib/types/scene-3d/camera.d.ts +11 -2
- package/lib/types/scene-3d/geometry/mesh.d.ts +2 -0
- package/lib/types/scene-3d/geometry/primitives.d.ts +7 -0
- package/lib/types/scene-3d/impossible-3d.d.ts +29 -0
- package/lib/types/scene-3d/index.d.ts +4 -3
- package/lib/types/scene-3d/resolve-scene.d.ts +13 -1
- package/lib/types/scene-3d/scene-3d-adapter.d.ts +2 -0
- package/lib/types/scene-3d/scene-types.d.ts +29 -4
- package/lib/types/scene-3d/shading.d.ts +2 -0
- package/llms-full.txt +423 -47
- package/llms.txt +29 -29
- package/package.json +2 -2
- package/skills/tinyfly/SKILL.md +20 -6
- package/lib/addons/load-scene-CQvcFWGJ.js +0 -331
- package/lib/addons/shading-o5T_v9DT.js +0 -89
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
function
|
|
1
|
+
function We(t) {
|
|
2
2
|
return typeof t == "object" && t !== null && t.type === "cubic-bezier";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function At(t) {
|
|
5
5
|
return typeof t == "object" && t !== null && t.type !== "cubic-bezier";
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
function
|
|
7
|
+
const Vt = 2;
|
|
8
|
+
function ue(t) {
|
|
9
9
|
return t.some((e) => e.interpolation !== void 0) ? 2 : 1;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Dt(t) {
|
|
12
12
|
return t.property === "text" && "textConfig" in t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function U(t) {
|
|
15
15
|
return t.kind === "inertia" && "inertia" in t;
|
|
16
16
|
}
|
|
17
17
|
function V(t) {
|
|
18
18
|
return t.kind === "spring" && "spring" in t;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function he(t) {
|
|
21
21
|
return t.property === "motionPath" && "motionPathConfig" in t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Ws(t) {
|
|
24
24
|
return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Qe(t) {
|
|
27
27
|
return "keyframes" in t;
|
|
28
28
|
}
|
|
29
|
-
class
|
|
29
|
+
class Qs {
|
|
30
30
|
_currentTime = 0;
|
|
31
31
|
_isRunning = !1;
|
|
32
32
|
onTick = null;
|
|
@@ -52,7 +52,7 @@ class Cs {
|
|
|
52
52
|
this._currentTime = e;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
class
|
|
55
|
+
class Gs {
|
|
56
56
|
_currentTime = 0;
|
|
57
57
|
_isRunning = !1;
|
|
58
58
|
_lastFrameTime = null;
|
|
@@ -99,12 +99,12 @@ class Ds {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Ge(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;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function le(t, e, n = "start") {
|
|
108
108
|
if (e <= 1) return 0;
|
|
109
109
|
if (typeof n == "number") {
|
|
110
110
|
const s = Math.max(0, Math.min(e - 1, n));
|
|
@@ -121,36 +121,36 @@ function oe(t, e, n = "start") {
|
|
|
121
121
|
return t;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ke(t, e = "start") {
|
|
125
125
|
if (t <= 1) return 0;
|
|
126
126
|
let n = 0;
|
|
127
127
|
for (let s = 0; s < t; s++)
|
|
128
|
-
n = Math.max(n,
|
|
128
|
+
n = Math.max(n, le(s, t, e));
|
|
129
129
|
return n;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function fe(t, e, n) {
|
|
132
132
|
if (n.offsets) return n.offsets[t] ?? 0;
|
|
133
|
-
const s = n.from ?? "start", r =
|
|
133
|
+
const s = n.from ?? "start", r = le(t, e, s);
|
|
134
134
|
if (n.amount !== void 0) {
|
|
135
|
-
const
|
|
136
|
-
return
|
|
135
|
+
const a = Ke(e, s);
|
|
136
|
+
return a === 0 ? 0 : n.amount * r / a;
|
|
137
137
|
}
|
|
138
138
|
return n.each !== void 0 ? n.each * r : 0;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return Array.from({ length: t }, (n, s) =>
|
|
140
|
+
function Ze(t, e) {
|
|
141
|
+
return Array.from({ length: t }, (n, s) => fe(s, t, e));
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return t <= 1 ? 0 : Math.max(...
|
|
143
|
+
function Et(t, e) {
|
|
144
|
+
return t <= 1 ? 0 : Math.max(...Ze(t, e));
|
|
145
145
|
}
|
|
146
|
-
const
|
|
146
|
+
const et = 1, de = 6e4, at = de / et, L = {
|
|
147
147
|
stiffness: 180,
|
|
148
148
|
damping: 12,
|
|
149
149
|
mass: 1,
|
|
150
150
|
velocity: 0,
|
|
151
151
|
restDelta: 0.01,
|
|
152
152
|
restSpeed: 0.1
|
|
153
|
-
},
|
|
153
|
+
}, Ks = {
|
|
154
154
|
gentle: { stiffness: 120, damping: 18, mass: 1 },
|
|
155
155
|
default: { stiffness: 180, damping: 12, mass: 1 },
|
|
156
156
|
snappy: { stiffness: 280, damping: 20, mass: 1 },
|
|
@@ -158,7 +158,7 @@ const tt = 1, ie = 6e4, rt = ie / tt, L = {
|
|
|
158
158
|
wobbly: { stiffness: 180, damping: 5, mass: 1 },
|
|
159
159
|
stiff: { stiffness: 400, damping: 30, mass: 1 }
|
|
160
160
|
};
|
|
161
|
-
class
|
|
161
|
+
class lt {
|
|
162
162
|
from;
|
|
163
163
|
to;
|
|
164
164
|
stiffness;
|
|
@@ -201,58 +201,58 @@ class ut {
|
|
|
201
201
|
*/
|
|
202
202
|
valueAt(e) {
|
|
203
203
|
if (e <= 0) return this.from;
|
|
204
|
-
const n = Math.floor(e /
|
|
204
|
+
const n = Math.floor(e / et);
|
|
205
205
|
if (this.simulateTo(n + 1), this.settledStep !== null && n >= this.settledStep)
|
|
206
206
|
return this.to;
|
|
207
|
-
const s = this.samples[Math.min(n, this.samples.length - 1)], r = this.samples[Math.min(n + 1, this.samples.length - 1)],
|
|
208
|
-
return s + (r - s) *
|
|
207
|
+
const s = this.samples[Math.min(n, this.samples.length - 1)], r = this.samples[Math.min(n + 1, this.samples.length - 1)], a = e / et - n;
|
|
208
|
+
return s + (r - s) * a;
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* How long the spring takes to settle, in milliseconds — the natural duration
|
|
212
212
|
* of a spring track. Runs the simulation to completion once.
|
|
213
213
|
*/
|
|
214
214
|
settleTime() {
|
|
215
|
-
return this.simulateTo(
|
|
215
|
+
return this.simulateTo(at + 1), this.settledStep !== null ? this.settledStep * et : de;
|
|
216
216
|
}
|
|
217
217
|
/** Advance the cached simulation until it holds at least `steps` samples. */
|
|
218
218
|
simulateTo(e) {
|
|
219
219
|
if (this.settledStep !== null) return;
|
|
220
|
-
const n = Math.min(e,
|
|
220
|
+
const n = Math.min(e, at + 1), s = et / 1e3;
|
|
221
221
|
for (; this.samples.length < n; ) {
|
|
222
|
-
const r = this.samples[this.samples.length - 1],
|
|
222
|
+
const r = this.samples[this.samples.length - 1], a = r - this.to, o = -this.stiffness * a, i = -this.damping * this.velocity, c = (o + i) / this.mass;
|
|
223
223
|
this.velocity += c * s;
|
|
224
|
-
const
|
|
225
|
-
if (this.samples.push(
|
|
224
|
+
const h = r + this.velocity * s;
|
|
225
|
+
if (this.samples.push(h), this.isAtRest(h)) {
|
|
226
226
|
this.settledStep = this.samples.length - 1;
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
this.samples.length >
|
|
230
|
+
this.samples.length > at && (this.settledStep = at);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return new
|
|
233
|
+
function Zs(t, e) {
|
|
234
|
+
return new lt(t).valueAt(e);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
return new
|
|
236
|
+
function Js(t) {
|
|
237
|
+
return new lt(t).settleTime();
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function tr(t) {
|
|
240
240
|
const e = t.stiffness ?? L.stiffness, n = t.damping ?? L.damping, s = t.mass ?? L.mass;
|
|
241
241
|
return n < 2 * Math.sqrt(e * s);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function er(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
|
|
248
|
-
function
|
|
249
|
-
const e = t.friction ??
|
|
250
|
-
return e > 0 ? e :
|
|
247
|
+
const Bt = 4, Je = 2e-3, tn = 1e-4, en = 6e4;
|
|
248
|
+
function ft(t) {
|
|
249
|
+
const e = t.friction ?? Bt;
|
|
250
|
+
return e > 0 ? e : Bt;
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
return t.from + t.velocity /
|
|
252
|
+
function nn(t) {
|
|
253
|
+
return t.from + t.velocity / ft(t);
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function sn(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;
|
|
@@ -262,79 +262,79 @@ function Be(t, e) {
|
|
|
262
262
|
Math.abs(s - t) < Math.abs(n - t) && (n = s);
|
|
263
263
|
return n;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
let e =
|
|
265
|
+
function dt(t) {
|
|
266
|
+
let e = sn(nn(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
|
-
function
|
|
270
|
-
const e = Math.abs(
|
|
269
|
+
function mt(t) {
|
|
270
|
+
const e = Math.abs(dt(t) - t.from);
|
|
271
271
|
if (e === 0) return 0;
|
|
272
|
-
const n = t.restDelta ?? Math.max(
|
|
272
|
+
const n = t.restDelta ?? Math.max(tn, e * Je);
|
|
273
273
|
if (n >= e) return 0;
|
|
274
|
-
const s = Math.log(e / n) /
|
|
275
|
-
return Math.min(
|
|
274
|
+
const s = Math.log(e / n) / ft(t);
|
|
275
|
+
return Math.min(en, s * 1e3);
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function St(t, e) {
|
|
278
278
|
if (e <= 0) return t.from;
|
|
279
|
-
const n =
|
|
280
|
-
if (e >=
|
|
281
|
-
const s =
|
|
279
|
+
const n = dt(t);
|
|
280
|
+
if (e >= mt(t)) return n;
|
|
281
|
+
const s = ft(t);
|
|
282
282
|
return t.from + (n - t.from) * (1 - Math.exp(-s * e / 1e3));
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
const n =
|
|
286
|
-
return e >=
|
|
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":
|
|
296
|
-
"ease-in-cubic":
|
|
297
|
-
"ease-out-cubic":
|
|
298
|
-
"ease-in-out-cubic":
|
|
284
|
+
function nr(t, e) {
|
|
285
|
+
const n = ft(t), s = dt(t);
|
|
286
|
+
return e >= mt(t) ? 0 : (s - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
|
|
287
|
+
}
|
|
288
|
+
const Pt = (t) => t, rn = (t) => t * t, an = (t) => 1 - (1 - t) * (1 - t), on = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, me = (t) => t * t * t, pe = (t) => 1 - Math.pow(1 - t, 3), ge = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, cn = me, un = pe, hn = ge, ln = {
|
|
289
|
+
linear: Pt,
|
|
290
|
+
"ease-in": cn,
|
|
291
|
+
"ease-out": un,
|
|
292
|
+
"ease-in-out": hn,
|
|
293
|
+
"ease-in-quad": rn,
|
|
294
|
+
"ease-out-quad": an,
|
|
295
|
+
"ease-in-out-quad": on,
|
|
296
|
+
"ease-in-cubic": me,
|
|
297
|
+
"ease-out-cubic": pe,
|
|
298
|
+
"ease-in-out-cubic": ge
|
|
299
299
|
};
|
|
300
|
-
function
|
|
301
|
-
const [e, n, s, r] = t,
|
|
302
|
-
let
|
|
303
|
-
for (let
|
|
304
|
-
const
|
|
305
|
-
if (Math.abs(
|
|
306
|
-
return
|
|
307
|
-
const
|
|
308
|
-
if (Math.abs(
|
|
300
|
+
function fn(t) {
|
|
301
|
+
const [e, n, s, r] = t, a = 3 * e, o = 3 * (s - e) - a, i = 1 - a - o, c = 3 * n, h = 3 * (r - n) - c, l = 1 - c - h, u = (m) => ((i * m + o) * m + a) * m, d = (m) => ((l * m + h) * m + c) * m, f = (m) => (3 * i * m + 2 * o) * m + a, p = (m) => {
|
|
302
|
+
let M = m;
|
|
303
|
+
for (let _ = 0; _ < 8; _++) {
|
|
304
|
+
const k = u(M) - m;
|
|
305
|
+
if (Math.abs(k) < 1e-7)
|
|
306
|
+
return M;
|
|
307
|
+
const x = f(M);
|
|
308
|
+
if (Math.abs(x) < 1e-7)
|
|
309
309
|
break;
|
|
310
|
-
|
|
310
|
+
M -= k / x;
|
|
311
311
|
}
|
|
312
|
-
let
|
|
313
|
-
for (
|
|
314
|
-
const
|
|
315
|
-
if (Math.abs(
|
|
316
|
-
return
|
|
317
|
-
|
|
312
|
+
let y = 0, g = 1;
|
|
313
|
+
for (M = m; y < g; ) {
|
|
314
|
+
const _ = u(M);
|
|
315
|
+
if (Math.abs(_ - m) < 1e-7)
|
|
316
|
+
return M;
|
|
317
|
+
m > _ ? y = M : g = M, M = (y + g) / 2;
|
|
318
318
|
}
|
|
319
|
-
return
|
|
319
|
+
return M;
|
|
320
320
|
};
|
|
321
|
-
return (
|
|
322
|
-
if (
|
|
323
|
-
if (
|
|
324
|
-
const
|
|
325
|
-
return
|
|
321
|
+
return (m) => {
|
|
322
|
+
if (m <= 0) return 0;
|
|
323
|
+
if (m >= 1) return 1;
|
|
324
|
+
const M = p(m);
|
|
325
|
+
return d(M);
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function _t(t, e = "out") {
|
|
329
329
|
if (e === "out") return t;
|
|
330
330
|
const n = (s) => 1 - t(1 - s);
|
|
331
331
|
return e === "in" ? n : (s) => s < 0.5 ? n(s * 2) / 2 : t(s * 2 - 1) / 2 + 0.5;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function dn(t = 1, e = 0.3) {
|
|
334
334
|
const n = Math.max(1, t), s = e / (2 * Math.PI) * Math.asin(1 / n);
|
|
335
335
|
return (r) => r <= 0 ? 0 : r >= 1 ? 1 : n * Math.pow(2, -10 * r) * Math.sin((r - s) * (2 * Math.PI) / e) + 1;
|
|
336
336
|
}
|
|
337
|
-
const
|
|
337
|
+
const mn = (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 nn = (t) => {
|
|
|
349
349
|
const s = t - 2.625 / 2.75;
|
|
350
350
|
return 7.5625 * s * s + 0.984375;
|
|
351
351
|
};
|
|
352
|
-
function
|
|
352
|
+
function pn(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 sn(t = 1.70158) {
|
|
|
357
357
|
return n * n * ((t + 1) * n + t) + 1;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function gn(t, e = "end") {
|
|
361
361
|
const n = Math.max(1, Math.floor(t));
|
|
362
362
|
return (s) => {
|
|
363
363
|
if (s >= 1) return 1;
|
|
@@ -375,22 +375,22 @@ function rn(t, e = "end") {
|
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function yn(t) {
|
|
379
379
|
switch (t.type) {
|
|
380
380
|
case "steps":
|
|
381
|
-
return
|
|
381
|
+
return gn(t.count, t.position);
|
|
382
382
|
case "elastic":
|
|
383
|
-
return
|
|
383
|
+
return _t(dn(t.amplitude, t.period), t.mode);
|
|
384
384
|
case "bounce":
|
|
385
|
-
return
|
|
385
|
+
return _t(mn, t.mode);
|
|
386
386
|
case "back":
|
|
387
|
-
return
|
|
387
|
+
return _t(pn(t.overshoot), t.mode);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
return t === void 0 ?
|
|
390
|
+
function Lt(t) {
|
|
391
|
+
return t === void 0 ? Pt : We(t) ? fn(t.points) : At(t) ? yn(t) : ln[t] ?? Pt;
|
|
392
392
|
}
|
|
393
|
-
const
|
|
393
|
+
const Ht = 32, Mn = 256, q = /* @__PURE__ */ new Map(), xn = /[MmLlHhVvCcSsQqTtAaZz]/, _n = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, bn = {
|
|
394
394
|
M: 2,
|
|
395
395
|
L: 2,
|
|
396
396
|
H: 1,
|
|
@@ -402,68 +402,68 @@ const zt = 32, an = 256, W = /* @__PURE__ */ new Map(), cn = /[MmLlHhVvCcSsQqTtA
|
|
|
402
402
|
A: 7,
|
|
403
403
|
Z: 0
|
|
404
404
|
};
|
|
405
|
-
function
|
|
405
|
+
function Tn(t) {
|
|
406
406
|
const e = [];
|
|
407
407
|
let n = 0, s = null;
|
|
408
408
|
const r = () => {
|
|
409
409
|
for (; n < t.length && /[\s,]/.test(t[n]); ) n++;
|
|
410
410
|
};
|
|
411
411
|
for (; n < t.length && (r(), !(n >= t.length)); ) {
|
|
412
|
-
const
|
|
413
|
-
if (
|
|
414
|
-
s = { type:
|
|
412
|
+
const a = t[n];
|
|
413
|
+
if (xn.test(a)) {
|
|
414
|
+
s = { type: a, args: [] }, e.push(s), n++;
|
|
415
415
|
continue;
|
|
416
416
|
}
|
|
417
417
|
if (!s) break;
|
|
418
|
-
const
|
|
419
|
-
if (
|
|
420
|
-
if (
|
|
421
|
-
s.args.push(
|
|
418
|
+
const o = s.type === "A" || s.type === "a", i = s.args.length % 7;
|
|
419
|
+
if (o && (i === 3 || i === 4)) {
|
|
420
|
+
if (a !== "0" && a !== "1") break;
|
|
421
|
+
s.args.push(a === "1" ? 1 : 0), n++;
|
|
422
422
|
continue;
|
|
423
423
|
}
|
|
424
|
-
const c =
|
|
424
|
+
const c = _n.exec(t.slice(n));
|
|
425
425
|
if (!c) break;
|
|
426
426
|
s.args.push(parseFloat(c[0])), n += c[0].length;
|
|
427
427
|
}
|
|
428
428
|
return e;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function kn(t, e, n, s, r, a, o, i, c) {
|
|
431
431
|
if (t === i && e === c) return [];
|
|
432
|
-
let
|
|
433
|
-
if (
|
|
434
|
-
const u = r * Math.PI / 180,
|
|
435
|
-
if (
|
|
436
|
-
const R = Math.sqrt(
|
|
437
|
-
|
|
438
|
-
}
|
|
439
|
-
const
|
|
440
|
-
const
|
|
441
|
-
return R *
|
|
442
|
-
}, S =
|
|
443
|
-
let $ =
|
|
444
|
-
!
|
|
445
|
-
const
|
|
446
|
-
const
|
|
447
|
-
return [
|
|
448
|
-
},
|
|
449
|
-
const
|
|
450
|
-
return [
|
|
451
|
-
},
|
|
452
|
-
for (let R = 0; R <
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
return
|
|
432
|
+
let h = Math.abs(n), l = Math.abs(s);
|
|
433
|
+
if (h === 0 || l === 0) return [[t, e, i, c, i, c]];
|
|
434
|
+
const u = r * Math.PI / 180, d = Math.cos(u), f = Math.sin(u), p = (t - i) / 2, m = (e - c) / 2, M = d * p + f * m, y = -f * p + d * m, g = M * M / (h * h) + y * y / (l * l);
|
|
435
|
+
if (g > 1) {
|
|
436
|
+
const R = Math.sqrt(g);
|
|
437
|
+
h *= R, l *= R;
|
|
438
|
+
}
|
|
439
|
+
const _ = a === o ? -1 : 1, k = h * h * l * l - h * h * y * y - l * l * M * M, x = h * h * y * y + l * l * M * M, A = _ * Math.sqrt(Math.max(0, k / x)), w = A * h * y / l, P = -A * l * M / h, b = d * w - f * P + (t + i) / 2, T = f * w + d * P + (e + c) / 2, v = (R, D, E, B) => {
|
|
440
|
+
const xt = R * E + D * B, rt = Math.sqrt((R * R + D * D) * (E * E + B * B)), Z = Math.acos(Math.max(-1, Math.min(1, xt / rt)));
|
|
441
|
+
return R * B - D * E < 0 ? -Z : Z;
|
|
442
|
+
}, S = v(1, 0, (M - w) / h, (y - P) / l);
|
|
443
|
+
let $ = v((M - w) / h, (y - P) / l, (-M - w) / h, (-y - P) / l);
|
|
444
|
+
!o && $ > 0 && ($ -= 2 * Math.PI), o && $ < 0 && ($ += 2 * Math.PI);
|
|
445
|
+
const I = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), Mt = $ / I, st = 4 / 3 * Math.tan(Mt / 4), zt = (R) => {
|
|
446
|
+
const D = h * Math.cos(R), E = l * Math.sin(R);
|
|
447
|
+
return [d * D - f * E + b, f * D + d * E + T];
|
|
448
|
+
}, jt = (R) => {
|
|
449
|
+
const D = -h * Math.sin(R), E = l * Math.cos(R);
|
|
450
|
+
return [d * D - f * E, f * D + d * E];
|
|
451
|
+
}, Ut = [];
|
|
452
|
+
for (let R = 0; R < I; R++) {
|
|
453
|
+
const D = S + R * Mt, E = D + Mt, [B, xt] = zt(D), [rt, Z] = R === I - 1 ? [i, c] : zt(E), [Ve, Be] = jt(D), [He, qe] = jt(E);
|
|
454
|
+
Ut.push([B + st * Ve, xt + st * Be, rt - st * He, Z - st * qe, rt, Z]);
|
|
455
|
+
}
|
|
456
|
+
return Ut;
|
|
457
457
|
}
|
|
458
458
|
function Y(t, e, n, s, r) {
|
|
459
|
-
const
|
|
460
|
-
return
|
|
459
|
+
const a = 1 - r;
|
|
460
|
+
return a * a * a * t + 3 * a * a * r * e + 3 * a * r * r * n + r * r * r * s;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
463
|
-
const
|
|
464
|
-
return 3 *
|
|
462
|
+
function qt(t, e, n, s, r) {
|
|
463
|
+
const a = 1 - r;
|
|
464
|
+
return 3 * a * a * (e - t) + 6 * a * r * (n - e) + 3 * r * r * (s - n);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function J(t, e, n, s) {
|
|
467
467
|
return {
|
|
468
468
|
subpath: 0,
|
|
469
469
|
type: "L",
|
|
@@ -476,105 +476,105 @@ function q(t, e, n, s) {
|
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
478
|
function ot(t, e, n) {
|
|
479
|
-
const [s, r,
|
|
480
|
-
let
|
|
481
|
-
for (let
|
|
482
|
-
const
|
|
483
|
-
|
|
479
|
+
const [s, r, a, o, i, c] = n, h = [0];
|
|
480
|
+
let l = t, u = e, d = 0;
|
|
481
|
+
for (let f = 1; f <= Ht; f++) {
|
|
482
|
+
const p = f / Ht, m = Y(t, s, a, i, p), M = Y(e, r, o, c, p);
|
|
483
|
+
d += Math.hypot(m - l, M - u), h.push(d), l = m, u = M;
|
|
484
484
|
}
|
|
485
485
|
return {
|
|
486
486
|
subpath: 0,
|
|
487
487
|
type: "C",
|
|
488
|
-
points: [s, r,
|
|
488
|
+
points: [s, r, a, o, i, c],
|
|
489
489
|
startX: t,
|
|
490
490
|
startY: e,
|
|
491
491
|
endX: i,
|
|
492
492
|
endY: c,
|
|
493
|
-
length:
|
|
494
|
-
lengths:
|
|
493
|
+
length: d,
|
|
494
|
+
lengths: h
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
const e =
|
|
497
|
+
function Q(t) {
|
|
498
|
+
const e = q.get(t);
|
|
499
499
|
if (e) return e;
|
|
500
500
|
const n = [];
|
|
501
|
-
let s = 0, r = 0,
|
|
502
|
-
const
|
|
503
|
-
|
|
501
|
+
let s = 0, r = 0, a = 0, o = 0, i = null, c = null, h = -1;
|
|
502
|
+
const l = /* @__PURE__ */ new Set(), u = (m) => {
|
|
503
|
+
h < 0 && (h = 0), m.subpath = h, n.push(m);
|
|
504
504
|
};
|
|
505
|
-
for (const { type:
|
|
506
|
-
const
|
|
507
|
-
if (
|
|
508
|
-
(s !==
|
|
505
|
+
for (const { type: m, args: M } of Tn(t)) {
|
|
506
|
+
const y = m.toUpperCase(), g = m !== y, _ = bn[y];
|
|
507
|
+
if (y === "Z") {
|
|
508
|
+
(s !== a || r !== o) && u(J(s, r, a, o)), h >= 0 && l.add(h), s = a, r = o, i = c = null;
|
|
509
509
|
continue;
|
|
510
510
|
}
|
|
511
|
-
for (let
|
|
512
|
-
const
|
|
513
|
-
let
|
|
514
|
-
switch (
|
|
511
|
+
for (let k = 0; k + _ <= M.length; k += _) {
|
|
512
|
+
const x = M.slice(k, k + _), A = g ? s : 0, w = g ? r : 0;
|
|
513
|
+
let P = null, b = null;
|
|
514
|
+
switch (y) {
|
|
515
515
|
case "M":
|
|
516
|
-
|
|
516
|
+
k === 0 ? (s = x[0] + A, r = x[1] + w, a = s, o = r, (h < 0 || n[n.length - 1]?.subpath === h) && h++) : (u(J(s, r, x[0] + A, x[1] + w)), s = x[0] + A, r = x[1] + w);
|
|
517
517
|
break;
|
|
518
518
|
case "L":
|
|
519
|
-
u(
|
|
519
|
+
u(J(s, r, x[0] + A, x[1] + w)), s = x[0] + A, r = x[1] + w;
|
|
520
520
|
break;
|
|
521
521
|
case "H":
|
|
522
|
-
u(
|
|
522
|
+
u(J(s, r, x[0] + A, r)), s = x[0] + A;
|
|
523
523
|
break;
|
|
524
524
|
case "V":
|
|
525
|
-
u(
|
|
525
|
+
u(J(s, r, s, x[0] + w)), r = x[0] + w;
|
|
526
526
|
break;
|
|
527
527
|
case "C": {
|
|
528
|
-
const T = [
|
|
529
|
-
u(ot(s, r, T)),
|
|
528
|
+
const T = [x[0] + A, x[1] + w, x[2] + A, x[3] + w, x[4] + A, x[5] + w];
|
|
529
|
+
u(ot(s, r, T)), P = [T[2], T[3]], s = T[4], r = T[5];
|
|
530
530
|
break;
|
|
531
531
|
}
|
|
532
532
|
case "S": {
|
|
533
|
-
const [T,
|
|
534
|
-
u(ot(s, r, S)),
|
|
533
|
+
const [T, v] = i ? [2 * s - i[0], 2 * r - i[1]] : [s, r], S = [T, v, x[0] + A, x[1] + w, x[2] + A, x[3] + w];
|
|
534
|
+
u(ot(s, r, S)), P = [S[2], S[3]], s = S[4], r = S[5];
|
|
535
535
|
break;
|
|
536
536
|
}
|
|
537
537
|
case "Q":
|
|
538
538
|
case "T": {
|
|
539
|
-
let T = s,
|
|
540
|
-
|
|
541
|
-
const S =
|
|
539
|
+
let T = s, v = r;
|
|
540
|
+
y === "Q" ? (T = x[0] + A, v = x[1] + w) : c && (T = 2 * s - c[0], v = 2 * r - c[1]);
|
|
541
|
+
const S = y === "Q" ? x[2] + A : x[0] + A, $ = y === "Q" ? x[3] + w : x[1] + w;
|
|
542
542
|
u(
|
|
543
543
|
ot(s, r, [
|
|
544
544
|
s + 2 / 3 * (T - s),
|
|
545
|
-
r + 2 / 3 * (
|
|
545
|
+
r + 2 / 3 * (v - r),
|
|
546
546
|
S + 2 / 3 * (T - S),
|
|
547
|
-
$ + 2 / 3 * (
|
|
547
|
+
$ + 2 / 3 * (v - $),
|
|
548
548
|
S,
|
|
549
549
|
$
|
|
550
550
|
])
|
|
551
|
-
),
|
|
551
|
+
), b = [T, v], s = S, r = $;
|
|
552
552
|
break;
|
|
553
553
|
}
|
|
554
554
|
case "A": {
|
|
555
|
-
const T =
|
|
555
|
+
const T = x[5] + A, v = x[6] + w;
|
|
556
556
|
let S = s, $ = r;
|
|
557
|
-
for (const
|
|
558
|
-
u(ot(S, $,
|
|
559
|
-
s = T, r =
|
|
557
|
+
for (const I of kn(s, r, x[0], x[1], x[2], x[3], x[4], T, v))
|
|
558
|
+
u(ot(S, $, I)), S = I[4], $ = I[5];
|
|
559
|
+
s = T, r = v;
|
|
560
560
|
break;
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
i =
|
|
563
|
+
i = P, c = b;
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
const
|
|
567
|
-
for (let
|
|
568
|
-
const
|
|
569
|
-
let
|
|
570
|
-
for (;
|
|
571
|
-
const
|
|
572
|
-
|
|
566
|
+
const d = n.reduce((m, M) => m + M.length, 0), f = [];
|
|
567
|
+
for (let m = 0; m < n.length; ) {
|
|
568
|
+
const M = n[m].subpath;
|
|
569
|
+
let y = m, g = 0;
|
|
570
|
+
for (; y < n.length && n[y].subpath === M; ) g += n[y++].length;
|
|
571
|
+
const _ = n[m], k = n[y - 1], x = l.has(M) || Math.abs(k.endX - _.startX) < 1e-9 && Math.abs(k.endY - _.startY) < 1e-9;
|
|
572
|
+
f.push({ start: m, end: y, length: g, closed: x }), m = y;
|
|
573
573
|
}
|
|
574
|
-
const
|
|
575
|
-
return
|
|
574
|
+
const p = { segments: n, totalLength: d, subpaths: f };
|
|
575
|
+
return q.size >= Mn && q.delete(q.keys().next().value), q.set(t, p), p;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function wn(t, e) {
|
|
578
578
|
const n = t.lengths;
|
|
579
579
|
if (e <= 0) return 0;
|
|
580
580
|
if (e >= t.length) return 1;
|
|
@@ -583,10 +583,10 @@ function dn(t, e) {
|
|
|
583
583
|
const i = s + r >> 1;
|
|
584
584
|
n[i] < e ? s = i : r = i;
|
|
585
585
|
}
|
|
586
|
-
const
|
|
587
|
-
return (s +
|
|
586
|
+
const a = n[r] - n[s], o = a > 0 ? (e - n[s]) / a : 0;
|
|
587
|
+
return (s + o) / (n.length - 1);
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function vn(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,396 +595,396 @@ function pn(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, s, r,
|
|
599
|
-
let
|
|
600
|
-
if (Math.hypot(
|
|
601
|
-
const u = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3),
|
|
602
|
-
|
|
598
|
+
const [n, s, r, a, o, i] = t.points, c = wn(t, e);
|
|
599
|
+
let h = qt(t.startX, n, r, o, c), l = qt(t.startY, s, a, i, c);
|
|
600
|
+
if (Math.hypot(h, l) < 1e-9) {
|
|
601
|
+
const u = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), d = Y(t.startX, n, r, o, u), f = Y(t.startY, s, a, i, u), p = Y(t.startX, n, r, o, c), m = Y(t.startY, s, a, i, c);
|
|
602
|
+
h = c < 0.5 ? d - p : p - d, l = c < 0.5 ? f - m : m - f;
|
|
603
603
|
}
|
|
604
604
|
return {
|
|
605
|
-
x: Y(t.startX, n, r,
|
|
606
|
-
y: Y(t.startY, s,
|
|
607
|
-
angle: Math.atan2(
|
|
605
|
+
x: Y(t.startX, n, r, o, c),
|
|
606
|
+
y: Y(t.startY, s, a, i, c),
|
|
607
|
+
angle: Math.atan2(l, h) * 180 / Math.PI
|
|
608
608
|
};
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function ye(t, e, n = 0, s = t.length) {
|
|
611
611
|
if (s <= n) return { x: 0, y: 0, angle: 0 };
|
|
612
612
|
let r = 0;
|
|
613
|
-
for (let
|
|
614
|
-
const
|
|
615
|
-
if (r +
|
|
616
|
-
return
|
|
617
|
-
r +=
|
|
613
|
+
for (let a = n; a < s; a++) {
|
|
614
|
+
const o = t[a];
|
|
615
|
+
if (r + o.length >= e || a === s - 1)
|
|
616
|
+
return vn(o, e - r);
|
|
617
|
+
r += o.length;
|
|
618
618
|
}
|
|
619
619
|
return { x: 0, y: 0, angle: 0 };
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
const { segments: n, totalLength: s } =
|
|
623
|
-
return
|
|
621
|
+
function An(t, e) {
|
|
622
|
+
const { segments: n, totalLength: s } = Q(t);
|
|
623
|
+
return ye(n, Math.max(0, Math.min(1, e)) * s);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
|
|
625
|
+
function sr() {
|
|
626
|
+
q.clear();
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
return
|
|
628
|
+
function rr(t) {
|
|
629
|
+
return Q(t).totalLength;
|
|
630
630
|
}
|
|
631
|
-
const
|
|
632
|
-
let
|
|
633
|
-
const
|
|
634
|
-
function
|
|
635
|
-
const { segments: n, subpaths: s, totalLength: r } =
|
|
631
|
+
const Sn = 24, Pn = 320, In = 2.5, tt = 72, ar = 64, $n = 0.2, Rn = 128, nt = /* @__PURE__ */ new Map();
|
|
632
|
+
let it = 0, X;
|
|
633
|
+
const Wt = (t) => Math.round(t * 100) / 100;
|
|
634
|
+
function Qt(t, e) {
|
|
635
|
+
const { segments: n, subpaths: s, totalLength: r } = Q(t);
|
|
636
636
|
if (n.length === 0) return [];
|
|
637
637
|
if (e) {
|
|
638
|
-
const
|
|
639
|
-
return [{ segments: n, start: 0, end: n.length, length: r, closed:
|
|
638
|
+
const a = s.every((o) => o.closed);
|
|
639
|
+
return [{ segments: n, start: 0, end: n.length, length: r, closed: a }];
|
|
640
640
|
}
|
|
641
|
-
return s.filter((
|
|
641
|
+
return s.filter((a) => a.length > 0).map((a) => ({ segments: n, start: a.start, end: a.end, length: a.length, closed: a.closed }));
|
|
642
642
|
}
|
|
643
|
-
function
|
|
644
|
-
const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), s =
|
|
643
|
+
function It(t, e) {
|
|
644
|
+
const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), s = ye(t.segments, n * t.length, t.start, t.end);
|
|
645
645
|
return [s.x, s.y];
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function Gt(t) {
|
|
648
648
|
const e = [];
|
|
649
649
|
let n = 0;
|
|
650
650
|
for (let s = t.start; s < t.end; s++)
|
|
651
651
|
n += t.segments[s].length, t.length > 0 && e.push(n / t.length);
|
|
652
652
|
return e;
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function Kt(t, e) {
|
|
655
655
|
const n = [];
|
|
656
656
|
for (let s = 0; s < e; s++)
|
|
657
|
-
n.push(
|
|
657
|
+
n.push(It(t, t.closed ? s / e : s / (e - 1)));
|
|
658
658
|
return n;
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function Zt(t) {
|
|
661
661
|
let e = 0, n = 0;
|
|
662
662
|
for (const [s, r] of t)
|
|
663
663
|
e += s, n += r;
|
|
664
664
|
return e /= t.length, n /= t.length, t.map(([s, r]) => [s - e, r - n]);
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Cn(t, e, n) {
|
|
667
667
|
const s = t.closed && e.closed;
|
|
668
668
|
if (n !== void 0)
|
|
669
|
-
return { offset: s ? Math.abs(n) %
|
|
670
|
-
const r =
|
|
669
|
+
return { offset: s ? Math.abs(n) % tt / tt : 0, reversed: n < 0 };
|
|
670
|
+
const r = Zt(Kt(t, tt)), a = Zt(Kt(e, tt)), o = tt;
|
|
671
671
|
let i = { offset: 0, reversed: !1 }, c = 1 / 0;
|
|
672
|
-
for (const
|
|
673
|
-
const
|
|
674
|
-
for (let u = 0; u <
|
|
675
|
-
let
|
|
676
|
-
for (let
|
|
677
|
-
const
|
|
678
|
-
|
|
672
|
+
for (const h of [!1, !0]) {
|
|
673
|
+
const l = s ? o : 1;
|
|
674
|
+
for (let u = 0; u < l; u++) {
|
|
675
|
+
let d = 0;
|
|
676
|
+
for (let f = 0; f < o && d < c; f++) {
|
|
677
|
+
const p = s ? h ? (u - f + o) % o : (f + u) % o : h ? o - 1 - f : f, m = r[f][0] - a[p][0], M = r[f][1] - a[p][1];
|
|
678
|
+
d += m * m + M * M;
|
|
679
679
|
}
|
|
680
|
-
|
|
680
|
+
d < c && (c = d, i = { offset: s ? u / o : 0, reversed: h });
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
return i;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Dn(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 En(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 s = t.closed && e.closed, r =
|
|
693
|
-
|
|
694
|
-
Math.min(
|
|
695
|
-
),
|
|
696
|
-
for (let u = 0; u <=
|
|
697
|
-
for (const u of
|
|
698
|
-
for (const u of
|
|
699
|
-
let c = [...
|
|
691
|
+
function Ln(t, e, n) {
|
|
692
|
+
const s = t.closed && e.closed, r = Cn(t, e, n.shapeIndex), a = Math.max(
|
|
693
|
+
Sn,
|
|
694
|
+
Math.min(Pn, Math.ceil(Math.max(t.length, e.length) / In))
|
|
695
|
+
), o = /* @__PURE__ */ new Set(), i = (u) => o.add(Math.round(u * 1e7) / 1e7);
|
|
696
|
+
for (let u = 0; u <= a; u++) i(u / a);
|
|
697
|
+
for (const u of Gt(t)) i(u);
|
|
698
|
+
for (const u of Gt(e)) i(En(u, r, s));
|
|
699
|
+
let c = [...o].sort((u, d) => u - d);
|
|
700
700
|
s && (c = c.filter((u) => u < 1));
|
|
701
|
-
const
|
|
701
|
+
const h = [], l = [];
|
|
702
702
|
for (const u of c)
|
|
703
|
-
|
|
704
|
-
return
|
|
703
|
+
h.push(...It(t, u)), l.push(...It(e, Dn(u, r, s)));
|
|
704
|
+
return Fn({ from: h, to: l, closed: s });
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function Fn(t) {
|
|
707
707
|
const e = t.from.length / 2;
|
|
708
708
|
if (e <= 3) return t;
|
|
709
709
|
const n = new Uint8Array(e);
|
|
710
710
|
n[0] = 1, n[e - 1] = 1;
|
|
711
711
|
const s = [[0, e - 1]];
|
|
712
712
|
for (; s.length > 0; ) {
|
|
713
|
-
const [
|
|
714
|
-
let c = -1,
|
|
715
|
-
for (let
|
|
716
|
-
const u = Math.max(
|
|
717
|
-
u >
|
|
713
|
+
const [o, i] = s.pop();
|
|
714
|
+
let c = -1, h = $n;
|
|
715
|
+
for (let l = o + 1; l < i; l++) {
|
|
716
|
+
const u = Math.max(Jt(t.from, o, i, l), Jt(t.to, o, i, l));
|
|
717
|
+
u > h && (h = u, c = l);
|
|
718
718
|
}
|
|
719
|
-
c !== -1 && (n[c] = 1, s.push([
|
|
719
|
+
c !== -1 && (n[c] = 1, s.push([o, c], [c, i]));
|
|
720
720
|
}
|
|
721
|
-
const r = [],
|
|
722
|
-
for (let
|
|
723
|
-
n[
|
|
724
|
-
return { from: r, to:
|
|
721
|
+
const r = [], a = [];
|
|
722
|
+
for (let o = 0; o < e; o++)
|
|
723
|
+
n[o] && (r.push(t.from[o * 2], t.from[o * 2 + 1]), a.push(t.to[o * 2], t.to[o * 2 + 1]));
|
|
724
|
+
return { from: r, to: a, closed: t.closed };
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
const r = t[e * 2],
|
|
728
|
-
return Math.hypot(c - u *
|
|
726
|
+
function Jt(t, e, n, s) {
|
|
727
|
+
const r = t[e * 2], a = t[e * 2 + 1], o = t[n * 2] - r, i = t[n * 2 + 1] - a, c = t[s * 2] - r, h = t[s * 2 + 1] - a, l = o * o + i * i, u = l === 0 ? 0 : Math.max(0, Math.min(1, (c * o + h * i) / l));
|
|
728
|
+
return Math.hypot(c - u * o, h - u * i);
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function On(t, e, n) {
|
|
731
731
|
const s = n.shapeIndex;
|
|
732
732
|
if (X && X.from === t && X.to === e && X.shapeIndex === s) return X.plan;
|
|
733
|
-
const
|
|
734
|
-
if (
|
|
735
|
-
return X = { from: t, to: e, shapeIndex: s, plan:
|
|
736
|
-
const
|
|
737
|
-
pairs: i.map((
|
|
733
|
+
const a = nt.get(String(s ?? "auto"))?.get(t)?.get(e);
|
|
734
|
+
if (a)
|
|
735
|
+
return X = { from: t, to: e, shapeIndex: s, plan: a }, a;
|
|
736
|
+
const o = Q(t).subpaths.filter((f) => f.length > 0).length === Q(e).subpaths.filter((f) => f.length > 0).length, i = Qt(t, !o), c = Qt(e, !o), h = {
|
|
737
|
+
pairs: i.map((f, p) => Ln(f, c[p], n))
|
|
738
738
|
};
|
|
739
|
-
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
const
|
|
743
|
-
return u.set(t,
|
|
739
|
+
it >= Rn && (nt.clear(), it = 0);
|
|
740
|
+
const l = String(s ?? "auto"), u = nt.get(l) ?? /* @__PURE__ */ new Map();
|
|
741
|
+
nt.set(l, u);
|
|
742
|
+
const d = u.get(t) ?? /* @__PURE__ */ new Map();
|
|
743
|
+
return u.set(t, d), d.set(e, h), it++, X = { from: t, to: e, shapeIndex: s, plan: h }, h;
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function Nn(t, e, n, s = {}) {
|
|
746
746
|
if (!t) return e;
|
|
747
747
|
if (!e) return t;
|
|
748
748
|
const r = Math.max(0, Math.min(1, n));
|
|
749
749
|
if (r === 0) return t;
|
|
750
750
|
if (r === 1) return e;
|
|
751
|
-
const
|
|
752
|
-
if (
|
|
753
|
-
let
|
|
754
|
-
for (const i of
|
|
751
|
+
const a = On(t, e, s);
|
|
752
|
+
if (a.pairs.length === 0) return r < 0.5 ? t : e;
|
|
753
|
+
let o = "";
|
|
754
|
+
for (const i of a.pairs) {
|
|
755
755
|
for (let c = 0; c < i.from.length; c += 2) {
|
|
756
|
-
const
|
|
757
|
-
|
|
756
|
+
const h = Wt(i.from[c] + (i.to[c] - i.from[c]) * r), l = Wt(i.from[c + 1] + (i.to[c + 1] - i.from[c + 1]) * r);
|
|
757
|
+
o += `${c === 0 ? o ? " M" : "M" : " L"}${h} ${l}`;
|
|
758
758
|
}
|
|
759
|
-
i.closed && (
|
|
759
|
+
i.closed && (o += " Z");
|
|
760
760
|
}
|
|
761
|
-
return
|
|
761
|
+
return o;
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
|
|
763
|
+
function or() {
|
|
764
|
+
nt.clear(), it = 0, X = void 0;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function Xn(t) {
|
|
767
767
|
return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(t);
|
|
768
768
|
}
|
|
769
|
-
const
|
|
770
|
-
function
|
|
769
|
+
const W = Math.PI / 180, Yn = 0.9995;
|
|
770
|
+
function Ft() {
|
|
771
771
|
return [0, 0, 0, 1];
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function ct(t, e) {
|
|
774
774
|
const n = Math.hypot(t[0], t[1], t[2]);
|
|
775
|
-
if (n === 0) return
|
|
776
|
-
const s = e *
|
|
775
|
+
if (n === 0) return Ft();
|
|
776
|
+
const s = e * W / 2, r = Math.sin(s) / n;
|
|
777
777
|
return [t[0] * r, t[1] * r, t[2] * r, Math.cos(s)];
|
|
778
778
|
}
|
|
779
|
-
function
|
|
780
|
-
return
|
|
779
|
+
function zn(t, e, n) {
|
|
780
|
+
return $t($t(ct([0, 1, 0], e), ct([1, 0, 0], t)), ct([0, 0, 1], n));
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
const [e, n, s, r] = z(t),
|
|
784
|
-
return Math.abs(c) < 0.9999999 ? [
|
|
782
|
+
function jn(t) {
|
|
783
|
+
const [e, n, s, r] = z(t), a = 2 * (e * s + n * r), o = 2 * (e * n + s * r), i = 1 - 2 * (e * e + s * s), c = 2 * (n * s - e * r), h = 1 - 2 * (n * n + s * s), l = 2 * (e * s - n * r), u = 1 - 2 * (e * e + n * n), d = Math.asin(Math.max(-1, Math.min(1, -c)));
|
|
784
|
+
return Math.abs(c) < 0.9999999 ? [d / W, Math.atan2(a, u) / W, Math.atan2(o, i) / W] : [d / W, Math.atan2(-l, h) / W, 0];
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
const [n, s, r,
|
|
786
|
+
function $t(t, e) {
|
|
787
|
+
const [n, s, r, a] = t, [o, i, c, h] = e;
|
|
788
788
|
return [
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
789
|
+
a * o + n * h + s * c - r * i,
|
|
790
|
+
a * i - n * c + s * h + r * o,
|
|
791
|
+
a * c + n * i - s * o + r * h,
|
|
792
|
+
a * h - n * o - s * i - r * c
|
|
793
793
|
];
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function Me(t, e) {
|
|
796
796
|
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] + t[3] * e[3];
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function xe(t) {
|
|
799
799
|
return Math.hypot(t[0], t[1], t[2], t[3]);
|
|
800
800
|
}
|
|
801
801
|
function z(t) {
|
|
802
|
-
const e =
|
|
803
|
-
return e === 0 ?
|
|
802
|
+
const e = xe(t);
|
|
803
|
+
return e === 0 ? Ft() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function Un(t) {
|
|
806
806
|
return [-t[0], -t[1], -t[2], t[3]];
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function _e(t, e, n) {
|
|
809
809
|
const s = z(t);
|
|
810
|
-
let r = z(e),
|
|
811
|
-
if (
|
|
810
|
+
let r = z(e), a = Me(s, r);
|
|
811
|
+
if (a < 0 && (r = [-r[0], -r[1], -r[2], -r[3]], a = -a), a > Yn)
|
|
812
812
|
return z([
|
|
813
813
|
s[0] + (r[0] - s[0]) * n,
|
|
814
814
|
s[1] + (r[1] - s[1]) * n,
|
|
815
815
|
s[2] + (r[2] - s[2]) * n,
|
|
816
816
|
s[3] + (r[3] - s[3]) * n
|
|
817
817
|
]);
|
|
818
|
-
const
|
|
818
|
+
const o = Math.acos(a), i = Math.sin(o), c = Math.sin((1 - n) * o) / i, h = Math.sin(n * o) / i;
|
|
819
819
|
return z([
|
|
820
|
-
s[0] * c + r[0] *
|
|
821
|
-
s[1] * c + r[1] *
|
|
822
|
-
s[2] * c + r[2] *
|
|
823
|
-
s[3] * c + r[3] *
|
|
820
|
+
s[0] * c + r[0] * h,
|
|
821
|
+
s[1] * c + r[1] * h,
|
|
822
|
+
s[2] * c + r[2] * h,
|
|
823
|
+
s[3] * c + r[3] * h
|
|
824
824
|
]);
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
const [n, s, r,
|
|
828
|
-
return [e[0] +
|
|
826
|
+
function Vn(t, e) {
|
|
827
|
+
const [n, s, r, a] = z(t), o = 2 * (s * e[2] - r * e[1]), i = 2 * (r * e[0] - n * e[2]), c = 2 * (n * e[1] - s * e[0]);
|
|
828
|
+
return [e[0] + a * o + (s * c - r * i), e[1] + a * i + (r * o - n * c), e[2] + a * c + (n * i - s * o)];
|
|
829
829
|
}
|
|
830
|
-
const
|
|
830
|
+
const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
831
831
|
__proto__: null,
|
|
832
|
-
conjugate:
|
|
833
|
-
dot:
|
|
834
|
-
fromAxisAngle:
|
|
835
|
-
fromEuler:
|
|
836
|
-
identity:
|
|
837
|
-
length:
|
|
838
|
-
multiply:
|
|
832
|
+
conjugate: Un,
|
|
833
|
+
dot: Me,
|
|
834
|
+
fromAxisAngle: ct,
|
|
835
|
+
fromEuler: zn,
|
|
836
|
+
identity: Ft,
|
|
837
|
+
length: xe,
|
|
838
|
+
multiply: $t,
|
|
839
839
|
normalize: z,
|
|
840
|
-
rotateVec3:
|
|
841
|
-
slerp:
|
|
842
|
-
toEuler:
|
|
843
|
-
}, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n,
|
|
844
|
-
function
|
|
845
|
-
const e =
|
|
840
|
+
rotateVec3: Vn,
|
|
841
|
+
slerp: _e,
|
|
842
|
+
toEuler: jn
|
|
843
|
+
}, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n, be = 512, bt = /* @__PURE__ */ new Map(), Tt = /* @__PURE__ */ new Map();
|
|
844
|
+
function te(t) {
|
|
845
|
+
const e = bt.get(t);
|
|
846
846
|
if (e) return e;
|
|
847
847
|
const n = t.replace("#", ""), s = [
|
|
848
848
|
parseInt(n.slice(0, 2), 16),
|
|
849
849
|
parseInt(n.slice(2, 4), 16),
|
|
850
850
|
parseInt(n.slice(4, 6), 16)
|
|
851
851
|
];
|
|
852
|
-
return
|
|
852
|
+
return bt.size < be && bt.set(t, s), s;
|
|
853
853
|
}
|
|
854
|
-
const
|
|
855
|
-
function
|
|
856
|
-
return `#${
|
|
854
|
+
const ee = (t) => t.charCodeAt(0) === 35, ne = (t) => t.startsWith("rgb"), se = (t) => t.startsWith("rgba"), Bn = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, kt = (t) => Math.round(t).toString(16).padStart(2, "0");
|
|
855
|
+
function Hn(t, e, n) {
|
|
856
|
+
return `#${kt(t)}${kt(e)}${kt(n)}`;
|
|
857
857
|
}
|
|
858
|
-
function
|
|
859
|
-
const e =
|
|
858
|
+
function re(t) {
|
|
859
|
+
const e = Tt.get(t);
|
|
860
860
|
if (e) return e;
|
|
861
|
-
const n = t.match(
|
|
861
|
+
const n = t.match(Bn);
|
|
862
862
|
if (!n)
|
|
863
863
|
throw new Error(`Invalid rgb color: ${t}`);
|
|
864
|
-
const s = parseInt(n[1], 10), r = parseInt(n[2], 10),
|
|
865
|
-
return
|
|
864
|
+
const s = parseInt(n[1], 10), r = parseInt(n[2], 10), a = parseInt(n[3], 10), o = n[4] !== void 0 ? [s, r, a, parseFloat(n[4])] : [s, r, a];
|
|
865
|
+
return Tt.size < be && Tt.set(t, o), o;
|
|
866
866
|
}
|
|
867
|
-
const
|
|
868
|
-
if (
|
|
869
|
-
const [s, r,
|
|
870
|
-
return
|
|
867
|
+
const qn = (t, e, n) => {
|
|
868
|
+
if (ee(t) && ee(e)) {
|
|
869
|
+
const [s, r, a] = te(t), [o, i, c] = te(e), h = N(s, o, n), l = N(r, i, n), u = N(a, c, n);
|
|
870
|
+
return Hn(h, l, u);
|
|
871
871
|
}
|
|
872
|
-
if ((
|
|
873
|
-
const s =
|
|
872
|
+
if ((ne(t) || se(t)) && (ne(e) || se(e))) {
|
|
873
|
+
const s = re(t), r = re(e), a = Math.round(N(s[0], r[0], n)), o = Math.round(N(s[1], r[1], n)), i = Math.round(N(s[2], r[2], n));
|
|
874
874
|
if (s.length === 4 || r.length === 4) {
|
|
875
|
-
const c = s[3] ?? 1,
|
|
876
|
-
return `rgba(${
|
|
875
|
+
const c = s[3] ?? 1, h = r[3] ?? 1, l = N(c, h, n);
|
|
876
|
+
return `rgba(${a}, ${o}, ${i}, ${l})`;
|
|
877
877
|
}
|
|
878
|
-
return `rgb(${
|
|
878
|
+
return `rgb(${a}, ${o}, ${i})`;
|
|
879
879
|
}
|
|
880
880
|
return n < 1 ? t : e;
|
|
881
|
-
},
|
|
881
|
+
}, Wn = (t, e, n) => {
|
|
882
882
|
const s = Math.min(t.length, e.length), r = [];
|
|
883
|
-
for (let
|
|
884
|
-
r.push(N(t[
|
|
883
|
+
for (let a = 0; a < s; a++)
|
|
884
|
+
r.push(N(t[a], e[a], n));
|
|
885
885
|
return r;
|
|
886
|
-
},
|
|
887
|
-
function
|
|
888
|
-
return e === "slerp" ?
|
|
886
|
+
}, Qn = (t, e, n) => _e(t, e, n), ae = (t, e, n) => n < 1 ? t : e, Gn = (t, e, n) => Nn(t, e, n);
|
|
887
|
+
function Te(t, e) {
|
|
888
|
+
return e === "slerp" ? Qn : typeof t == "number" ? N : Array.isArray(t) ? Wn : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? qn : Xn(t) ? Gn : ae : ae;
|
|
889
889
|
}
|
|
890
|
-
const
|
|
891
|
-
function
|
|
890
|
+
const ke = 1e3 / 60;
|
|
891
|
+
function we(t, e = {}) {
|
|
892
892
|
if (!V(t))
|
|
893
893
|
throw new Error(`bakeSpringTrack: track "${t.id}" is not a spring track`);
|
|
894
|
-
const n = new
|
|
895
|
-
return
|
|
894
|
+
const n = new lt(t.spring);
|
|
895
|
+
return Ae(t, (s) => n.valueAt(s), n.settleTime(), t.spring.from, t.spring.to, e);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
if (!
|
|
897
|
+
function ve(t, e = {}) {
|
|
898
|
+
if (!U(t))
|
|
899
899
|
throw new Error(`bakeInertiaTrack: track "${t.id}" is not an inertia track`);
|
|
900
900
|
const n = t.inertia;
|
|
901
|
-
return
|
|
901
|
+
return Ae(
|
|
902
902
|
t,
|
|
903
|
-
(s) =>
|
|
904
|
-
|
|
903
|
+
(s) => St(n, s),
|
|
904
|
+
mt(n),
|
|
905
905
|
n.from,
|
|
906
|
-
|
|
906
|
+
dt(n),
|
|
907
907
|
e
|
|
908
908
|
);
|
|
909
909
|
}
|
|
910
|
-
function
|
|
911
|
-
const
|
|
912
|
-
for (let u = 0; u <= n; u +=
|
|
913
|
-
|
|
914
|
-
const
|
|
915
|
-
return !
|
|
910
|
+
function Ae(t, e, n, s, r, a) {
|
|
911
|
+
const o = a.intervalMs ?? ke, i = a.tolerance ?? 0.01, c = t.delay ?? 0, h = [];
|
|
912
|
+
for (let u = 0; u <= n; u += o)
|
|
913
|
+
h.push({ time: u + c, value: e(u), easing: "linear" });
|
|
914
|
+
const l = h[h.length - 1];
|
|
915
|
+
return !l || l.time < n + c ? h.push({ time: n + c, value: r, easing: "linear" }) : l.value = r, c > 0 && h.unshift({ time: 0, value: s, easing: "linear" }), {
|
|
916
916
|
id: t.id,
|
|
917
917
|
target: t.target,
|
|
918
918
|
property: t.property,
|
|
919
|
-
keyframes: i > 0 ?
|
|
919
|
+
keyframes: i > 0 ? Jn(h, i) : h,
|
|
920
920
|
...t.targets && { targets: [...t.targets] },
|
|
921
921
|
...t.stagger && { stagger: { ...t.stagger } }
|
|
922
922
|
};
|
|
923
923
|
}
|
|
924
|
-
function
|
|
925
|
-
const r = s.intervalMs ??
|
|
924
|
+
function Kn(t, e, n, s = {}) {
|
|
925
|
+
const r = s.intervalMs ?? ke, a = typeof n == "function" ? n : Lt(n), o = Te(t.value, s.interpolation), i = e.time - t.time;
|
|
926
926
|
if (i <= 0) return [e];
|
|
927
927
|
const c = [];
|
|
928
|
-
for (let
|
|
929
|
-
const u =
|
|
928
|
+
for (let l = r; l < i; l += r) {
|
|
929
|
+
const u = l / i;
|
|
930
930
|
c.push({
|
|
931
|
-
time: t.time +
|
|
932
|
-
value:
|
|
931
|
+
time: t.time + l,
|
|
932
|
+
value: o(t.value, e.value, a(u)),
|
|
933
933
|
easing: "linear"
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
|
-
const
|
|
937
|
-
return c.push({ ...e, ...
|
|
936
|
+
const h = a(1);
|
|
937
|
+
return c.push({ ...e, ...h !== 1 && { value: o(t.value, e.value, h) }, easing: "linear" }), c;
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
return V(t) ?
|
|
939
|
+
function cr(t, e) {
|
|
940
|
+
return V(t) ? we(t, e) : U(t) ? ve(t, e) : t;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function Zn(t, e = {}) {
|
|
943
943
|
const n = t.keyframes;
|
|
944
|
-
if (!n.some((
|
|
944
|
+
if (!n.some((a) => At(a.easing))) return t;
|
|
945
945
|
const s = n.length > 0 ? [n[0]] : [], r = { ...e, interpolation: t.interpolation ?? e.interpolation };
|
|
946
|
-
for (let
|
|
947
|
-
const
|
|
948
|
-
|
|
946
|
+
for (let a = 1; a < n.length; a++) {
|
|
947
|
+
const o = n[a];
|
|
948
|
+
At(o.easing) ? s.push(...Kn(n[a - 1], o, o.easing, r)) : s.push(o);
|
|
949
949
|
}
|
|
950
950
|
return { ...t, keyframes: s };
|
|
951
951
|
}
|
|
952
|
-
function
|
|
953
|
-
return t.filter(
|
|
954
|
-
t.filter(V).map((n) =>
|
|
955
|
-
t.filter(
|
|
952
|
+
function ur(t, e) {
|
|
953
|
+
return t.filter(Qe).map((n) => Zn(n, e)).concat(
|
|
954
|
+
t.filter(V).map((n) => we(n, e)),
|
|
955
|
+
t.filter(U).map((n) => ve(n, e))
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Jn(t, e) {
|
|
959
959
|
if (t.length <= 2) return t;
|
|
960
960
|
const n = [t[0]];
|
|
961
961
|
for (let s = 1; s < t.length - 1; s++) {
|
|
962
|
-
const r = n[n.length - 1],
|
|
962
|
+
const r = n[n.length - 1], a = t[s], o = t[s + 1], i = o.time - r.time;
|
|
963
963
|
if (i <= 0) continue;
|
|
964
|
-
const c = (
|
|
965
|
-
Math.abs(
|
|
964
|
+
const c = (a.time - r.time) / i, h = r.value + (o.value - r.value) * c;
|
|
965
|
+
Math.abs(a.value - h) > e && n.push(a);
|
|
966
966
|
}
|
|
967
967
|
return n.push(t[t.length - 1]), n;
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function ts(t) {
|
|
970
970
|
const e = [...t.keyframes].sort((n, s) => n.time - s.time);
|
|
971
971
|
return {
|
|
972
972
|
...t,
|
|
973
973
|
keyframes: e
|
|
974
974
|
};
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function j(t) {
|
|
977
977
|
return t.targets && t.targets.length > 0 ? t.targets : [t.target];
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function G(t, e, n, s) {
|
|
980
980
|
const r = n ?? 0;
|
|
981
|
-
return !s || e <= 1 ? r : r +
|
|
981
|
+
return !s || e <= 1 ? r : r + fe(t, e, s);
|
|
982
982
|
}
|
|
983
|
-
class
|
|
983
|
+
class ut {
|
|
984
984
|
track;
|
|
985
985
|
targets;
|
|
986
986
|
constructor(e) {
|
|
987
|
-
this.track = e, this.targets =
|
|
987
|
+
this.track = e, this.targets = j(e);
|
|
988
988
|
}
|
|
989
989
|
/**
|
|
990
990
|
* Get the interpolated value at a specific time.
|
|
@@ -993,7 +993,7 @@ class _t {
|
|
|
993
993
|
* that need every target should use `getTargetValues`.
|
|
994
994
|
*/
|
|
995
995
|
getValueAtTime(e) {
|
|
996
|
-
return this.valueForOffset(e -
|
|
996
|
+
return this.valueForOffset(e - G(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
997
997
|
}
|
|
998
998
|
/**
|
|
999
999
|
* Every target's value at a specific time, in target order.
|
|
@@ -1004,8 +1004,8 @@ class _t {
|
|
|
1004
1004
|
getTargetValues(e) {
|
|
1005
1005
|
const n = this.targets.length, s = [];
|
|
1006
1006
|
for (let r = 0; r < n; r++) {
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1007
|
+
const a = G(r, n, this.track.delay, this.track.stagger), o = this.valueForOffset(e - a);
|
|
1008
|
+
o !== void 0 && s.push({ target: this.targets[r], value: o, start: a + this.track.keyframes[0].time });
|
|
1009
1009
|
}
|
|
1010
1010
|
return s;
|
|
1011
1011
|
}
|
|
@@ -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, s = this.track.stagger ?
|
|
1020
|
+
const n = e[e.length - 1].time, s = this.track.stagger ? Et(this.targets.length, this.track.stagger) : 0;
|
|
1021
1021
|
return n + (this.track.delay ?? 0) + s + (this.track.endDelay ?? 0);
|
|
1022
1022
|
}
|
|
1023
1023
|
/**
|
|
@@ -1040,8 +1040,8 @@ class _t {
|
|
|
1040
1040
|
return;
|
|
1041
1041
|
if (s.time === e)
|
|
1042
1042
|
return s.value;
|
|
1043
|
-
const
|
|
1044
|
-
return
|
|
1043
|
+
const a = r.time - s.time, o = (e - s.time) / a, c = Lt(r.easing)(o);
|
|
1044
|
+
return Te(s.value, this.track.interpolation)(s.value, r.value, c);
|
|
1045
1045
|
}
|
|
1046
1046
|
/**
|
|
1047
1047
|
* Find the keyframes surrounding a given time.
|
|
@@ -1054,107 +1054,107 @@ class _t {
|
|
|
1054
1054
|
return { from: null, to: null };
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
class
|
|
1057
|
+
class es {
|
|
1058
1058
|
track;
|
|
1059
1059
|
targets;
|
|
1060
1060
|
sampler;
|
|
1061
1061
|
constructor(e) {
|
|
1062
|
-
this.track = e, this.targets =
|
|
1062
|
+
this.track = e, this.targets = j(e), this.sampler = new lt(e.spring);
|
|
1063
1063
|
}
|
|
1064
1064
|
getValueAtTime(e) {
|
|
1065
|
-
return this.sampler.valueAt(e -
|
|
1065
|
+
return this.sampler.valueAt(e - G(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
1066
1066
|
}
|
|
1067
1067
|
getTargetValues(e) {
|
|
1068
1068
|
const n = this.targets.length, s = [];
|
|
1069
1069
|
for (let r = 0; r < n; r++) {
|
|
1070
|
-
const
|
|
1071
|
-
s.push({ target: this.targets[r], value: this.sampler.valueAt(e -
|
|
1070
|
+
const a = G(r, n, this.track.delay, this.track.stagger);
|
|
1071
|
+
s.push({ target: this.targets[r], value: this.sampler.valueAt(e - a), start: a });
|
|
1072
1072
|
}
|
|
1073
1073
|
return s;
|
|
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 ? Et(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 ns {
|
|
1085
1085
|
track;
|
|
1086
1086
|
targets;
|
|
1087
1087
|
duration;
|
|
1088
1088
|
constructor(e) {
|
|
1089
|
-
this.track = e, this.targets =
|
|
1089
|
+
this.track = e, this.targets = j(e), this.duration = mt(e.inertia);
|
|
1090
1090
|
}
|
|
1091
1091
|
getValueAtTime(e) {
|
|
1092
|
-
return
|
|
1092
|
+
return St(this.track.inertia, e - G(0, this.targets.length, this.track.delay, this.track.stagger));
|
|
1093
1093
|
}
|
|
1094
1094
|
getTargetValues(e) {
|
|
1095
1095
|
const n = this.targets.length, s = [];
|
|
1096
1096
|
for (let r = 0; r < n; r++) {
|
|
1097
|
-
const
|
|
1098
|
-
s.push({ target: this.targets[r], value:
|
|
1097
|
+
const a = G(r, n, this.track.delay, this.track.stagger);
|
|
1098
|
+
s.push({ target: this.targets[r], value: St(this.track.inertia, e - a), start: a });
|
|
1099
1099
|
}
|
|
1100
1100
|
return s;
|
|
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 ? Et(this.targets.length, this.track.stagger) : 0;
|
|
1105
1105
|
return this.duration + (this.track.delay ?? 0) + e;
|
|
1106
1106
|
}
|
|
1107
1107
|
getTrack() {
|
|
1108
1108
|
return this.track;
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const n = { ...
|
|
1111
|
+
function Se(t, e) {
|
|
1112
|
+
const n = { ...An(t.pathData, e) };
|
|
1113
1113
|
if (t.matrix) {
|
|
1114
|
-
const [s, r,
|
|
1115
|
-
n.x = s *
|
|
1116
|
-
const u = n.angle * Math.PI / 180,
|
|
1117
|
-
n.angle = Math.atan2(r *
|
|
1114
|
+
const [s, r, a, o, i, c] = t.matrix, { x: h, y: l } = n;
|
|
1115
|
+
n.x = s * h + a * l + i, n.y = r * h + o * l + c;
|
|
1116
|
+
const u = n.angle * Math.PI / 180, d = Math.cos(u), f = Math.sin(u);
|
|
1117
|
+
n.angle = Math.atan2(r * d + o * f, s * d + a * f) * 180 / Math.PI;
|
|
1118
1118
|
}
|
|
1119
1119
|
return t.autoRotate && t.rotateOffset && (n.angle += t.rotateOffset), n;
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function hr(t, e, n, s) {
|
|
1122
1122
|
const r = e + (n - e) * s;
|
|
1123
|
-
return
|
|
1123
|
+
return Se(t, r);
|
|
1124
1124
|
}
|
|
1125
|
-
const
|
|
1125
|
+
const wt = {
|
|
1126
1126
|
upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
1127
1127
|
lowerCase: "abcdefghijklmnopqrstuvwxyz",
|
|
1128
1128
|
upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
1129
1129
|
numbers: "0123456789"
|
|
1130
|
-
},
|
|
1131
|
-
function
|
|
1132
|
-
const e =
|
|
1133
|
-
return n.length > 0 ? n : Array.from(
|
|
1130
|
+
}, ss = 20;
|
|
1131
|
+
function rs(t) {
|
|
1132
|
+
const e = wt[t ?? "upperCase"] ?? t ?? wt.upperCase, n = Array.from(e);
|
|
1133
|
+
return n.length > 0 ? n : Array.from(wt.upperCase);
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function as(t, e, n) {
|
|
1136
1136
|
let s = (t | 0) ^ Math.imul(e + 1, 2654435761) ^ Math.imul(n + 1, 2246822507);
|
|
1137
1137
|
return s = Math.imul(s ^ s >>> 16, 2146121005), s = Math.imul(s ^ s >>> 15, 2221713035), (s ^ s >>> 16) >>> 0;
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1140
|
-
const s = t.from ?? "", r = t.to,
|
|
1141
|
-
if (
|
|
1142
|
-
if (
|
|
1143
|
-
const
|
|
1139
|
+
function os(t, e, n = 0) {
|
|
1140
|
+
const s = t.from ?? "", r = t.to, a = Math.max(0, Math.min(1, e));
|
|
1141
|
+
if (a <= 0) return s;
|
|
1142
|
+
if (a >= 1) return r;
|
|
1143
|
+
const o = Array.from(s), i = Array.from(r), c = t.rightToLeft ?? !1;
|
|
1144
1144
|
if (t.mode === "type") {
|
|
1145
|
-
const
|
|
1146
|
-
return c ?
|
|
1145
|
+
const g = Math.round(a * Math.max(o.length, i.length));
|
|
1146
|
+
return c ? o.slice(0, Math.max(0, o.length - g)).join("") + i.slice(Math.max(0, i.length - g)).join("") : i.slice(0, g).join("") + o.slice(g).join("");
|
|
1147
1147
|
}
|
|
1148
|
-
const
|
|
1149
|
-
let
|
|
1150
|
-
for (let
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
` ?
|
|
1148
|
+
const h = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), l = Math.max(0, (a - h) / (1 - h)), u = Math.floor(l * i.length), d = t.tweenLength === !1 ? i.length : Math.round(o.length + (i.length - o.length) * a), f = rs(t.chars), p = t.refreshRate ?? ss, m = p > 0 ? Math.floor(n * p / 1e3) : 0, M = t.seed ?? 1;
|
|
1149
|
+
let y = "";
|
|
1150
|
+
for (let g = 0; g < d; g++) {
|
|
1151
|
+
const _ = c ? g >= d - u : g < u, k = c ? i[i.length - (d - g)] : i[g];
|
|
1152
|
+
_ && k !== void 0 || k === " " || k === `
|
|
1153
|
+
` ? y += k : y += f[as(M, g, m) % f.length];
|
|
1154
1154
|
}
|
|
1155
|
-
return
|
|
1155
|
+
return y;
|
|
1156
1156
|
}
|
|
1157
|
-
class
|
|
1157
|
+
class Pe {
|
|
1158
1158
|
id;
|
|
1159
1159
|
name;
|
|
1160
1160
|
_captions;
|
|
@@ -1284,8 +1284,8 @@ class ke {
|
|
|
1284
1284
|
}
|
|
1285
1285
|
this._wrapAfterDelay && (this._wrapAfterDelay = !1, this._currentTime = 0);
|
|
1286
1286
|
}
|
|
1287
|
-
const
|
|
1288
|
-
for (let i = 0; i <
|
|
1287
|
+
const a = 1e3;
|
|
1288
|
+
for (let i = 0; i < a && r > 0 && this._playbackState === "playing"; i++)
|
|
1289
1289
|
if (this._direction === "forward") {
|
|
1290
1290
|
const c = n - this._currentTime;
|
|
1291
1291
|
if (r >= c) {
|
|
@@ -1301,21 +1301,21 @@ class ke {
|
|
|
1301
1301
|
} else
|
|
1302
1302
|
this._currentTime -= r, r = 0;
|
|
1303
1303
|
}
|
|
1304
|
-
const
|
|
1305
|
-
this.onUpdate?.(
|
|
1304
|
+
const o = this.getStateAtTime(this._currentTime);
|
|
1305
|
+
this.onUpdate?.(o);
|
|
1306
1306
|
}
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Get the animation state at a specific time.
|
|
1309
1309
|
*/
|
|
1310
1310
|
getStateAtTime(e) {
|
|
1311
1311
|
const n = /* @__PURE__ */ new Map();
|
|
1312
|
-
if (e =
|
|
1312
|
+
if (e = Ge(e, this._config.drawingRate ?? 0), this._hasSharedWrites())
|
|
1313
1313
|
this._resolveShared(e, n);
|
|
1314
1314
|
else
|
|
1315
1315
|
for (const [s, r] of this._trackPlayers) {
|
|
1316
|
-
const
|
|
1317
|
-
for (const { target:
|
|
1318
|
-
this._write(n, s,
|
|
1316
|
+
const a = r.getTrack().property;
|
|
1317
|
+
for (const { target: o, value: i, start: c } of r.getTargetValues(e))
|
|
1318
|
+
this._write(n, s, o, a, i, e - c);
|
|
1319
1319
|
}
|
|
1320
1320
|
return {
|
|
1321
1321
|
values: n,
|
|
@@ -1340,36 +1340,36 @@ class ke {
|
|
|
1340
1340
|
*/
|
|
1341
1341
|
_resolveShared(e, n) {
|
|
1342
1342
|
const s = /* @__PURE__ */ new Map();
|
|
1343
|
-
for (const [r,
|
|
1344
|
-
const
|
|
1345
|
-
for (const { target: i, value: c, start:
|
|
1346
|
-
const
|
|
1347
|
-
(!
|
|
1343
|
+
for (const [r, a] of this._trackPlayers) {
|
|
1344
|
+
const o = a.getTrack().property;
|
|
1345
|
+
for (const { target: i, value: c, start: h } of a.getTargetValues(e)) {
|
|
1346
|
+
const l = `${i}\0${o}`, u = h <= e, d = s.get(l);
|
|
1347
|
+
(!d || (u !== d.started ? u : u ? h >= d.start : h <= d.start)) && s.set(l, { trackId: r, target: i, property: o, value: c, start: h, started: u });
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
|
-
for (const { trackId: r, target:
|
|
1351
|
-
this._write(n, r,
|
|
1350
|
+
for (const { trackId: r, target: a, property: o, value: i, start: c } of s.values())
|
|
1351
|
+
this._write(n, r, a, o, i, e - c);
|
|
1352
1352
|
}
|
|
1353
1353
|
/**
|
|
1354
1354
|
* Write one track's value for a target, expanding the progress of motion paths
|
|
1355
1355
|
* (into x/y/rotation) and text tracks (into the string). `elapsed` is the time
|
|
1356
1356
|
* since this target's animation on the track started.
|
|
1357
1357
|
*/
|
|
1358
|
-
_write(e, n, s, r,
|
|
1359
|
-
if (
|
|
1358
|
+
_write(e, n, s, r, a, o) {
|
|
1359
|
+
if (a === void 0) return;
|
|
1360
1360
|
let i = e.get(s);
|
|
1361
1361
|
i || (i = /* @__PURE__ */ new Map(), e.set(s, i));
|
|
1362
1362
|
const c = this._textTracks.get(n);
|
|
1363
|
-
if (c && typeof
|
|
1364
|
-
i.set("text",
|
|
1363
|
+
if (c && typeof a == "number") {
|
|
1364
|
+
i.set("text", os(c.textConfig, a, Math.max(0, o)));
|
|
1365
1365
|
return;
|
|
1366
1366
|
}
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1369
|
-
const
|
|
1370
|
-
i.set("motionPathX",
|
|
1367
|
+
const h = this._motionPathTracks.get(n);
|
|
1368
|
+
if (h && typeof a == "number") {
|
|
1369
|
+
const l = Se(h.motionPathConfig, a);
|
|
1370
|
+
i.set("motionPathX", l.x), i.set("motionPathY", l.y), h.motionPathConfig.autoRotate && i.set("motionPathRotate", l.angle);
|
|
1371
1371
|
} else
|
|
1372
|
-
i.set(r,
|
|
1372
|
+
i.set(r, a);
|
|
1373
1373
|
}
|
|
1374
1374
|
/** Cached: does any target+property have more than one track? */
|
|
1375
1375
|
_sharedWrites = null;
|
|
@@ -1378,7 +1378,7 @@ class ke {
|
|
|
1378
1378
|
const e = /* @__PURE__ */ new Set();
|
|
1379
1379
|
this._sharedWrites = !1;
|
|
1380
1380
|
t: for (const n of this._tracks)
|
|
1381
|
-
for (const s of
|
|
1381
|
+
for (const s of j(n)) {
|
|
1382
1382
|
const r = `${s}\0${n.property}`;
|
|
1383
1383
|
if (e.has(r)) {
|
|
1384
1384
|
this._sharedWrites = !0;
|
|
@@ -1393,17 +1393,17 @@ class ke {
|
|
|
1393
1393
|
* Add a track to the timeline.
|
|
1394
1394
|
*/
|
|
1395
1395
|
addTrack(e) {
|
|
1396
|
-
if (this._tracks.push(e), this._sharedWrites = null,
|
|
1397
|
-
this._trackPlayers.set(e.id, new
|
|
1396
|
+
if (this._tracks.push(e), this._sharedWrites = null, U(e)) {
|
|
1397
|
+
this._trackPlayers.set(e.id, new ns(e));
|
|
1398
1398
|
return;
|
|
1399
1399
|
}
|
|
1400
1400
|
if (V(e)) {
|
|
1401
|
-
this._trackPlayers.set(e.id, new
|
|
1401
|
+
this._trackPlayers.set(e.id, new es(e)), this._springTracks.set(e.id, e);
|
|
1402
1402
|
return;
|
|
1403
1403
|
}
|
|
1404
|
-
if (
|
|
1405
|
-
this._trackPlayers.set(e.id, new
|
|
1406
|
-
else if (
|
|
1404
|
+
if (Dt(e))
|
|
1405
|
+
this._trackPlayers.set(e.id, new ut(e)), this._textTracks.set(e.id, e);
|
|
1406
|
+
else if (he(e)) {
|
|
1407
1407
|
const n = {
|
|
1408
1408
|
id: e.id,
|
|
1409
1409
|
target: e.target,
|
|
@@ -1414,9 +1414,9 @@ class ke {
|
|
|
1414
1414
|
targets: e.targets,
|
|
1415
1415
|
stagger: e.stagger
|
|
1416
1416
|
};
|
|
1417
|
-
this._trackPlayers.set(e.id, new
|
|
1417
|
+
this._trackPlayers.set(e.id, new ut(n)), this._motionPathTracks.set(e.id, e);
|
|
1418
1418
|
} else
|
|
1419
|
-
this._trackPlayers.set(e.id, new
|
|
1419
|
+
this._trackPlayers.set(e.id, new ut(e));
|
|
1420
1420
|
}
|
|
1421
1421
|
/**
|
|
1422
1422
|
* Replace a track with a new version, keeping its place in the track order
|
|
@@ -1424,13 +1424,13 @@ class ke {
|
|
|
1424
1424
|
* different id. Does nothing if no track has `trackId`.
|
|
1425
1425
|
*/
|
|
1426
1426
|
replaceTrack(e, n) {
|
|
1427
|
-
const s = this._tracks.findIndex((
|
|
1427
|
+
const s = this._tracks.findIndex((a) => a.id === e);
|
|
1428
1428
|
if (s < 0) return;
|
|
1429
1429
|
const r = this._tracks.slice(s + 1);
|
|
1430
1430
|
this.removeTrack(e);
|
|
1431
|
-
for (const
|
|
1431
|
+
for (const a of r) this.removeTrack(a.id);
|
|
1432
1432
|
this.addTrack(n);
|
|
1433
|
-
for (const
|
|
1433
|
+
for (const a of r) this.addTrack(a);
|
|
1434
1434
|
}
|
|
1435
1435
|
/**
|
|
1436
1436
|
* Remove a track by its ID.
|
|
@@ -1467,11 +1467,11 @@ class ke {
|
|
|
1467
1467
|
const n = this._trackPlayers.get(e);
|
|
1468
1468
|
if (!n) return;
|
|
1469
1469
|
const s = n.getTrack(), r = s.delay ?? 0;
|
|
1470
|
-
if (V(s) ||
|
|
1470
|
+
if (V(s) || U(s))
|
|
1471
1471
|
return { from: r, to: n.getDuration() };
|
|
1472
|
-
const
|
|
1473
|
-
if (!(!
|
|
1474
|
-
return { from:
|
|
1472
|
+
const a = s.keyframes;
|
|
1473
|
+
if (!(!a || a.length === 0))
|
|
1474
|
+
return { from: a[0].time + r, to: n.getDuration() };
|
|
1475
1475
|
}
|
|
1476
1476
|
/**
|
|
1477
1477
|
* Overlapping writes to the same target+property.
|
|
@@ -1486,27 +1486,27 @@ class ke {
|
|
|
1486
1486
|
for (let n = 0; n < this._tracks.length; n++) {
|
|
1487
1487
|
const s = this._tracks[n], r = this.getTrackSpan(s.id);
|
|
1488
1488
|
if (r)
|
|
1489
|
-
for (let
|
|
1490
|
-
const
|
|
1491
|
-
if (
|
|
1492
|
-
const i =
|
|
1489
|
+
for (let a = 0; a < n; a++) {
|
|
1490
|
+
const o = this._tracks[a];
|
|
1491
|
+
if (o.property !== s.property) continue;
|
|
1492
|
+
const i = j(o).filter((u) => j(s).includes(u));
|
|
1493
1493
|
if (i.length === 0) continue;
|
|
1494
|
-
const c = this.getTrackSpan(
|
|
1494
|
+
const c = this.getTrackSpan(o.id);
|
|
1495
1495
|
if (!c || !(c.from <= r.to && r.from <= c.to)) continue;
|
|
1496
|
-
const
|
|
1496
|
+
const l = r.from >= c.from;
|
|
1497
1497
|
for (const u of i)
|
|
1498
1498
|
e.push({
|
|
1499
1499
|
target: u,
|
|
1500
1500
|
property: s.property,
|
|
1501
|
-
losingTrackId:
|
|
1502
|
-
winningTrackId:
|
|
1501
|
+
losingTrackId: l ? o.id : s.id,
|
|
1502
|
+
winningTrackId: l ? s.id : o.id
|
|
1503
1503
|
});
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
1506
|
return e;
|
|
1507
1507
|
}
|
|
1508
1508
|
_matches(e, n) {
|
|
1509
|
-
if (n.id !== void 0 && e.id !== n.id || n.property !== void 0 && e.property !== n.property || n.target !== void 0 && !
|
|
1509
|
+
if (n.id !== void 0 && e.id !== n.id || n.property !== void 0 && e.property !== n.property || n.target !== void 0 && !j(e).includes(n.target)) return !1;
|
|
1510
1510
|
if (n.timeRange) {
|
|
1511
1511
|
const s = this.getTrackSpan(e.id);
|
|
1512
1512
|
if (!s || s.to < n.timeRange.from || s.from > n.timeRange.to) return !1;
|
|
@@ -1518,7 +1518,7 @@ class ke {
|
|
|
1518
1518
|
*/
|
|
1519
1519
|
toDefinition() {
|
|
1520
1520
|
return {
|
|
1521
|
-
formatVersion:
|
|
1521
|
+
formatVersion: ue(this._tracks),
|
|
1522
1522
|
id: this.id,
|
|
1523
1523
|
name: this.name,
|
|
1524
1524
|
config: { ...this._config },
|
|
@@ -1536,7 +1536,7 @@ class ke {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
/** Replace the markers (kept in time order); an empty list removes them. */
|
|
1538
1538
|
setMarkers(e) {
|
|
1539
|
-
const n = e && e.length > 0 ? [...e].sort((r,
|
|
1539
|
+
const n = e && e.length > 0 ? [...e].sort((r, a) => r.time - a.time).map((r) => ({ ...r })) : void 0, s = { ...this._config };
|
|
1540
1540
|
n ? s.markers = n : delete s.markers, this._config = s;
|
|
1541
1541
|
}
|
|
1542
1542
|
/** Caption text per language, per marker id */
|
|
@@ -1576,73 +1576,73 @@ class ke {
|
|
|
1576
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);
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
const
|
|
1580
|
-
function
|
|
1581
|
-
const r = [],
|
|
1582
|
-
|
|
1583
|
-
const
|
|
1584
|
-
t.forEach((
|
|
1585
|
-
(
|
|
1586
|
-
}),
|
|
1587
|
-
for (const
|
|
1579
|
+
const is = 100;
|
|
1580
|
+
function lr(t, e, n, s) {
|
|
1581
|
+
const r = [], a = [], { duration: o, alternate: i } = s, c = (f, p, m, M) => {
|
|
1582
|
+
a.push([f, p]);
|
|
1583
|
+
const y = [];
|
|
1584
|
+
t.forEach((g, _) => {
|
|
1585
|
+
(m === "forward" ? (M ? g >= f : g > f) && g <= p : (M ? g <= f : g < f) && g >= p) && y.push(_);
|
|
1586
|
+
}), y.sort((g, _) => (m === "forward" ? t[g] - t[_] : t[_] - t[g]) || g - _);
|
|
1587
|
+
for (const g of y) r.push({ kind: "event", index: g, direction: m });
|
|
1588
1588
|
};
|
|
1589
|
-
let
|
|
1590
|
-
const
|
|
1591
|
-
for (let
|
|
1592
|
-
const
|
|
1593
|
-
c(
|
|
1589
|
+
let h = e.time, l = e.direction, u = e.fresh === !0;
|
|
1590
|
+
const d = Math.min(is, Math.max(0, n.iteration - e.iteration));
|
|
1591
|
+
for (let f = 0; f < d; f++) {
|
|
1592
|
+
const p = l === "forward" ? o : 0;
|
|
1593
|
+
c(h, p, l, u), r.push({ kind: "repeat" }), i ? (l = l === "forward" ? "reverse" : "forward", h = p, u = !1) : (h = l === "forward" ? 0 : o, u = !0);
|
|
1594
1594
|
}
|
|
1595
|
-
return
|
|
1595
|
+
return d > 0 && s.holding && !i ? { crossings: r, passes: a } : (c(h, n.time, l, u), { crossings: r, passes: a });
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1598
|
-
return
|
|
1597
|
+
function cs(t) {
|
|
1598
|
+
return U(t) ? {
|
|
1599
1599
|
id: t.id,
|
|
1600
1600
|
target: t.target,
|
|
1601
1601
|
property: t.property,
|
|
1602
1602
|
kind: "inertia",
|
|
1603
|
-
inertia:
|
|
1604
|
-
...
|
|
1603
|
+
inertia: Ie(t.inertia),
|
|
1604
|
+
...O(t)
|
|
1605
1605
|
} : V(t) ? {
|
|
1606
1606
|
id: t.id,
|
|
1607
1607
|
target: t.target,
|
|
1608
1608
|
property: t.property,
|
|
1609
1609
|
kind: "spring",
|
|
1610
1610
|
spring: { ...t.spring },
|
|
1611
|
-
...
|
|
1612
|
-
} :
|
|
1611
|
+
...O(t)
|
|
1612
|
+
} : Dt(t) ? {
|
|
1613
1613
|
id: t.id,
|
|
1614
1614
|
target: t.target,
|
|
1615
1615
|
property: "text",
|
|
1616
1616
|
textConfig: { ...t.textConfig },
|
|
1617
|
-
keyframes: t.keyframes.map(
|
|
1618
|
-
...
|
|
1619
|
-
} :
|
|
1617
|
+
keyframes: t.keyframes.map(vt),
|
|
1618
|
+
...O(t)
|
|
1619
|
+
} : he(t) ? {
|
|
1620
1620
|
id: t.id,
|
|
1621
1621
|
target: t.target,
|
|
1622
1622
|
property: "motionPath",
|
|
1623
1623
|
motionPathConfig: { ...t.motionPathConfig },
|
|
1624
|
-
keyframes: t.keyframes.map(
|
|
1625
|
-
...
|
|
1624
|
+
keyframes: t.keyframes.map(vt),
|
|
1625
|
+
...O(t)
|
|
1626
1626
|
} : {
|
|
1627
1627
|
id: t.id,
|
|
1628
1628
|
target: t.target,
|
|
1629
1629
|
property: t.property,
|
|
1630
|
-
keyframes: t.keyframes.map(
|
|
1630
|
+
keyframes: t.keyframes.map(vt),
|
|
1631
1631
|
...t.interpolation !== void 0 && { interpolation: t.interpolation },
|
|
1632
|
-
...
|
|
1632
|
+
...O(t)
|
|
1633
1633
|
};
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Ie(t) {
|
|
1636
1636
|
return { ...t, ...Array.isArray(t.end) && { end: [...t.end] } };
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function vt(t) {
|
|
1639
1639
|
return {
|
|
1640
1640
|
time: t.time,
|
|
1641
1641
|
value: t.value,
|
|
1642
1642
|
...t.easing && { easing: t.easing }
|
|
1643
1643
|
};
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function O(t) {
|
|
1646
1646
|
const e = t.endDelay;
|
|
1647
1647
|
return {
|
|
1648
1648
|
...t.delay !== void 0 && { delay: t.delay },
|
|
@@ -1651,16 +1651,16 @@ function F(t) {
|
|
|
1651
1651
|
...t.stagger !== void 0 && { stagger: { ...t.stagger } }
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1655
|
-
if (
|
|
1654
|
+
function us(t) {
|
|
1655
|
+
if (U(t)) {
|
|
1656
1656
|
const e = t;
|
|
1657
1657
|
return {
|
|
1658
1658
|
id: e.id,
|
|
1659
1659
|
target: e.target,
|
|
1660
1660
|
property: e.property,
|
|
1661
1661
|
kind: "inertia",
|
|
1662
|
-
inertia:
|
|
1663
|
-
...
|
|
1662
|
+
inertia: Ie(e.inertia),
|
|
1663
|
+
...O(e)
|
|
1664
1664
|
};
|
|
1665
1665
|
}
|
|
1666
1666
|
if (V(t)) {
|
|
@@ -1671,10 +1671,10 @@ function qn(t) {
|
|
|
1671
1671
|
property: e.property,
|
|
1672
1672
|
kind: "spring",
|
|
1673
1673
|
spring: { ...e.spring },
|
|
1674
|
-
...
|
|
1674
|
+
...O(e)
|
|
1675
1675
|
};
|
|
1676
1676
|
}
|
|
1677
|
-
if (
|
|
1677
|
+
if (Dt(t)) {
|
|
1678
1678
|
const e = t;
|
|
1679
1679
|
return {
|
|
1680
1680
|
id: e.id,
|
|
@@ -1682,7 +1682,7 @@ function qn(t) {
|
|
|
1682
1682
|
property: "text",
|
|
1683
1683
|
textConfig: { ...e.textConfig },
|
|
1684
1684
|
keyframes: [...e.keyframes].sort((n, s) => n.time - s.time),
|
|
1685
|
-
...
|
|
1685
|
+
...O(e)
|
|
1686
1686
|
};
|
|
1687
1687
|
}
|
|
1688
1688
|
if (t.property === "motionPath" && "motionPathConfig" in t) {
|
|
@@ -1693,22 +1693,22 @@ function qn(t) {
|
|
|
1693
1693
|
property: "motionPath",
|
|
1694
1694
|
motionPathConfig: { ...e.motionPathConfig },
|
|
1695
1695
|
keyframes: n,
|
|
1696
|
-
...
|
|
1696
|
+
...O(e)
|
|
1697
1697
|
};
|
|
1698
1698
|
}
|
|
1699
|
-
return
|
|
1699
|
+
return ts({
|
|
1700
1700
|
id: t.id,
|
|
1701
1701
|
target: t.target,
|
|
1702
1702
|
property: t.property,
|
|
1703
1703
|
keyframes: t.keyframes,
|
|
1704
1704
|
...t.interpolation !== void 0 && { interpolation: t.interpolation },
|
|
1705
|
-
...
|
|
1705
|
+
...O(t)
|
|
1706
1706
|
});
|
|
1707
1707
|
}
|
|
1708
|
-
function
|
|
1708
|
+
function hs(t) {
|
|
1709
1709
|
const e = t._config.markers;
|
|
1710
1710
|
return {
|
|
1711
|
-
formatVersion:
|
|
1711
|
+
formatVersion: ue(t.tracks),
|
|
1712
1712
|
id: t.id,
|
|
1713
1713
|
name: t.name,
|
|
1714
1714
|
config: {
|
|
@@ -1720,38 +1720,38 @@ function Jn(t) {
|
|
|
1720
1720
|
...t._config.drawingRate ? { drawingRate: t._config.drawingRate } : {},
|
|
1721
1721
|
...e && { markers: e.map((n) => ({ ...n })) }
|
|
1722
1722
|
},
|
|
1723
|
-
tracks: t.tracks.map(
|
|
1723
|
+
tracks: t.tracks.map(cs),
|
|
1724
1724
|
...t.captions && { captions: JSON.parse(JSON.stringify(t.captions)) }
|
|
1725
1725
|
};
|
|
1726
1726
|
}
|
|
1727
|
-
function
|
|
1727
|
+
function ls(t) {
|
|
1728
1728
|
const e = t.formatVersion ?? 1;
|
|
1729
|
-
if (e >
|
|
1729
|
+
if (e > Vt)
|
|
1730
1730
|
throw new Error(
|
|
1731
|
-
`tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${
|
|
1731
|
+
`tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Vt}. Update tinyfly to play it.`
|
|
1732
1732
|
);
|
|
1733
|
-
return new
|
|
1733
|
+
return new Pe({
|
|
1734
1734
|
id: t.id,
|
|
1735
1735
|
name: t.name,
|
|
1736
1736
|
config: t.config,
|
|
1737
|
-
tracks: t.tracks.map(
|
|
1737
|
+
tracks: t.tracks.map(us),
|
|
1738
1738
|
captions: t.captions
|
|
1739
1739
|
});
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1742
|
-
return JSON.stringify(
|
|
1741
|
+
function fr(t) {
|
|
1742
|
+
return JSON.stringify(hs(t));
|
|
1743
1743
|
}
|
|
1744
|
-
function
|
|
1744
|
+
function dr(t) {
|
|
1745
1745
|
const e = JSON.parse(t);
|
|
1746
|
-
return
|
|
1746
|
+
return ls(e);
|
|
1747
1747
|
}
|
|
1748
|
-
function
|
|
1748
|
+
function fs(t) {
|
|
1749
1749
|
let e = 2166136261;
|
|
1750
1750
|
for (let n = 0; n < t.length; n++)
|
|
1751
1751
|
e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
|
|
1752
1752
|
return e >>> 0;
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1754
|
+
function $e(t) {
|
|
1755
1755
|
let e = t >>> 0 || 2654435769;
|
|
1756
1756
|
return {
|
|
1757
1757
|
seed: t >>> 0,
|
|
@@ -1760,28 +1760,28 @@ function Se(t) {
|
|
|
1760
1760
|
}
|
|
1761
1761
|
};
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function Re(t, e, n) {
|
|
1764
1764
|
return e + t.next() * (n - e);
|
|
1765
1765
|
}
|
|
1766
|
-
function
|
|
1767
|
-
if (s <= 0) return
|
|
1768
|
-
const r = Math.floor((n - e) / s),
|
|
1769
|
-
return e +
|
|
1766
|
+
function ds(t, e, n, s) {
|
|
1767
|
+
if (s <= 0) return Re(t, e, n);
|
|
1768
|
+
const r = Math.floor((n - e) / s), a = Math.round(t.next() * r);
|
|
1769
|
+
return e + a * s;
|
|
1770
1770
|
}
|
|
1771
|
-
function
|
|
1771
|
+
function mr(t, e) {
|
|
1772
1772
|
if (e.length !== 0)
|
|
1773
1773
|
return e[Math.floor(t.next() * e.length)];
|
|
1774
1774
|
}
|
|
1775
|
-
const
|
|
1776
|
-
function
|
|
1777
|
-
return typeof t != "string" ? !1 :
|
|
1775
|
+
const Ce = /^([+\-*/])=\s*(-?[\d.]+)$/, De = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
|
|
1776
|
+
function pr(t) {
|
|
1777
|
+
return typeof t != "string" ? !1 : Ce.test(t.trim()) || De.test(t.trim());
|
|
1778
1778
|
}
|
|
1779
|
-
function
|
|
1779
|
+
function Ee(t, e = {}) {
|
|
1780
1780
|
if (typeof t != "string") return t;
|
|
1781
|
-
const n = t.trim(), s =
|
|
1781
|
+
const n = t.trim(), s = Ce.exec(n);
|
|
1782
1782
|
if (s) {
|
|
1783
|
-
const [,
|
|
1784
|
-
switch (
|
|
1783
|
+
const [, a, o] = s, i = e.base ?? 0, c = Number.parseFloat(o);
|
|
1784
|
+
switch (a) {
|
|
1785
1785
|
case "+":
|
|
1786
1786
|
return i + c;
|
|
1787
1787
|
case "-":
|
|
@@ -1792,481 +1792,805 @@ function $e(t, e = {}) {
|
|
|
1792
1792
|
return c === 0 ? i : i / c;
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
|
-
const r =
|
|
1795
|
+
const r = De.exec(n);
|
|
1796
1796
|
if (r) {
|
|
1797
1797
|
if (!e.random)
|
|
1798
1798
|
throw new Error(
|
|
1799
1799
|
`resolveValue: "${n}" needs a random source — pass one via context.random`
|
|
1800
1800
|
);
|
|
1801
|
-
const
|
|
1802
|
-
return i !== void 0 ?
|
|
1801
|
+
const a = Number.parseFloat(r[1]), o = Number.parseFloat(r[2]), i = r[3] !== void 0 ? Number.parseFloat(r[3]) : void 0;
|
|
1802
|
+
return i !== void 0 ? ds(e.random, a, o, i) : Re(e.random, a, o);
|
|
1803
1803
|
}
|
|
1804
1804
|
return t;
|
|
1805
1805
|
}
|
|
1806
|
-
function
|
|
1806
|
+
function ms(t, e = 0, n) {
|
|
1807
1807
|
const s = [];
|
|
1808
1808
|
let r = e;
|
|
1809
|
-
for (const
|
|
1810
|
-
const
|
|
1811
|
-
s.push(
|
|
1809
|
+
for (const a of t) {
|
|
1810
|
+
const o = Ee(a, { base: r, random: n });
|
|
1811
|
+
s.push(o), typeof o == "number" && (r = o);
|
|
1812
1812
|
}
|
|
1813
1813
|
return s;
|
|
1814
1814
|
}
|
|
1815
|
-
class
|
|
1815
|
+
class gr {
|
|
1816
1816
|
random;
|
|
1817
1817
|
constructor(e) {
|
|
1818
|
-
this.random =
|
|
1818
|
+
this.random = $e(e);
|
|
1819
1819
|
}
|
|
1820
1820
|
/** The seed, to be stored alongside the timeline so this can be reproduced. */
|
|
1821
1821
|
get seed() {
|
|
1822
1822
|
return this.random.seed;
|
|
1823
1823
|
}
|
|
1824
1824
|
resolve(e, n = 0) {
|
|
1825
|
-
return
|
|
1825
|
+
return Ee(e, { base: n, random: this.random });
|
|
1826
1826
|
}
|
|
1827
1827
|
resolveSequence(e, n = 0) {
|
|
1828
|
-
return
|
|
1828
|
+
return ms(e, n, this.random);
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
|
-
const
|
|
1832
|
-
function
|
|
1831
|
+
const ps = 600;
|
|
1832
|
+
function yr(t) {
|
|
1833
1833
|
if (Array.isArray(t)) {
|
|
1834
|
-
const [f,
|
|
1835
|
-
return { fn:
|
|
1834
|
+
const [d, f, p, m] = t;
|
|
1835
|
+
return { fn: oe(d, f, p, m), bezier: [d, f, p, m] };
|
|
1836
1836
|
}
|
|
1837
|
-
const { segments: e } =
|
|
1837
|
+
const { segments: e } = Q(t);
|
|
1838
1838
|
if (e.length === 0) throw new Error(`customEase: no curve in "${t}"`);
|
|
1839
|
-
const n = e[0].startX, s = e[0].startY, r = e[e.length - 1],
|
|
1840
|
-
if (
|
|
1841
|
-
const i = (
|
|
1839
|
+
const n = e[0].startX, s = e[0].startY, r = e[e.length - 1], a = r.endX - n, o = r.endY - s;
|
|
1840
|
+
if (a === 0 || o === 0) throw new Error(`customEase: "${t}" must move along both axes`);
|
|
1841
|
+
const i = (d) => (d - n) / a, c = (d) => (d - s) / o;
|
|
1842
1842
|
if (e.length === 1 && r.type === "C") {
|
|
1843
|
-
const [f,
|
|
1844
|
-
return { fn:
|
|
1845
|
-
}
|
|
1846
|
-
const
|
|
1847
|
-
for (const
|
|
1848
|
-
for (let
|
|
1849
|
-
const [
|
|
1850
|
-
|
|
1843
|
+
const [d, f, p, m] = r.points, M = [i(d), c(f), i(p), c(m)];
|
|
1844
|
+
return { fn: oe(...M), bezier: M };
|
|
1845
|
+
}
|
|
1846
|
+
const h = [], l = [], u = Math.max(8, Math.ceil(ps / e.length));
|
|
1847
|
+
for (const d of e)
|
|
1848
|
+
for (let f = h.length === 0 ? 0 : 1; f <= u; f++) {
|
|
1849
|
+
const [p, m] = gs(d, f / u);
|
|
1850
|
+
h.push(i(p)), l.push(c(m));
|
|
1851
1851
|
}
|
|
1852
|
-
return { fn:
|
|
1852
|
+
return { fn: ys(h, l) };
|
|
1853
1853
|
}
|
|
1854
|
-
function
|
|
1854
|
+
function Mr(t = {}) {
|
|
1855
1855
|
const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, s = [1];
|
|
1856
|
-
for (let
|
|
1857
|
-
const r = s.reduce((
|
|
1858
|
-
return (
|
|
1859
|
-
if (
|
|
1860
|
-
if (
|
|
1861
|
-
let
|
|
1856
|
+
for (let a = n; a > 2e-3; a *= n) s.push(2 * Math.sqrt(a));
|
|
1857
|
+
const r = s.reduce((a, o) => a + o, 0);
|
|
1858
|
+
return (a) => {
|
|
1859
|
+
if (a <= 0) return 0;
|
|
1860
|
+
if (a >= 1) return 1;
|
|
1861
|
+
let o = a * r;
|
|
1862
1862
|
for (let i = 0; i < s.length; i++) {
|
|
1863
|
-
if (
|
|
1864
|
-
if (i === 0) return (
|
|
1865
|
-
const c = s[i] / 2,
|
|
1866
|
-
return 1 - (
|
|
1863
|
+
if (o <= s[i]) {
|
|
1864
|
+
if (i === 0) return (o / s[0]) ** 2;
|
|
1865
|
+
const c = s[i] / 2, h = c * c, l = o - c;
|
|
1866
|
+
return 1 - (h - l * l);
|
|
1867
1867
|
}
|
|
1868
|
-
|
|
1868
|
+
o -= s[i];
|
|
1869
1869
|
}
|
|
1870
1870
|
return 1;
|
|
1871
1871
|
};
|
|
1872
1872
|
}
|
|
1873
|
-
function
|
|
1873
|
+
function xr(t = {}) {
|
|
1874
1874
|
const e = Math.max(1, t.wiggles ?? 10), n = t.type ?? "easeOut", s = (r) => n === "uniform" ? 1 : n === "easeInOut" ? Math.sin(Math.PI * r) : (1 - r) ** 2;
|
|
1875
1875
|
return (r) => r <= 0 || r >= 1 ? 0 : Math.sin(r * e * Math.PI * 2) * s(r);
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function gs(t, e) {
|
|
1878
1878
|
if (t.type === "L") {
|
|
1879
|
-
const [
|
|
1880
|
-
return [t.startX + (
|
|
1879
|
+
const [h, l] = t.points;
|
|
1880
|
+
return [t.startX + (h - t.startX) * e, t.startY + (l - t.startY) * e];
|
|
1881
1881
|
}
|
|
1882
|
-
const [n, s, r,
|
|
1882
|
+
const [n, s, r, a, o, i] = t.points, c = 1 - e;
|
|
1883
1883
|
return [
|
|
1884
|
-
c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * r + e * e * e *
|
|
1885
|
-
c * c * c * t.startY + 3 * c * c * e * s + 3 * c * e * e *
|
|
1884
|
+
c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * r + e * e * e * o,
|
|
1885
|
+
c * c * c * t.startY + 3 * c * c * e * s + 3 * c * e * e * a + e * e * e * i
|
|
1886
1886
|
];
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1888
|
+
function ys(t, e) {
|
|
1889
1889
|
return (n) => {
|
|
1890
1890
|
if (n <= t[0]) return e[0];
|
|
1891
1891
|
if (n >= t[t.length - 1]) return e[e.length - 1];
|
|
1892
1892
|
let s = 0, r = t.length - 1;
|
|
1893
1893
|
for (; r - s > 1; ) {
|
|
1894
|
-
const
|
|
1895
|
-
t[
|
|
1894
|
+
const o = s + r >> 1;
|
|
1895
|
+
t[o] <= n ? s = o : r = o;
|
|
1896
1896
|
}
|
|
1897
|
-
const
|
|
1898
|
-
return
|
|
1897
|
+
const a = t[r] - t[s];
|
|
1898
|
+
return a === 0 ? e[r] : e[s] + (n - t[s]) / a * (e[r] - e[s]);
|
|
1899
1899
|
};
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1902
|
-
const r = (
|
|
1903
|
-
return (
|
|
1904
|
-
if (
|
|
1905
|
-
if (
|
|
1906
|
-
let i =
|
|
1907
|
-
for (let
|
|
1908
|
-
const u = r(i, t, n) -
|
|
1901
|
+
function oe(t, e, n, s) {
|
|
1902
|
+
const r = (o, i, c) => 3 * (1 - o) * (1 - o) * o * i + 3 * (1 - o) * o * o * c + o * o * o, a = (o, i, c) => 3 * (1 - o) * (1 - o) * i + 6 * (1 - o) * o * (c - i) + 3 * o * o * (1 - c);
|
|
1903
|
+
return (o) => {
|
|
1904
|
+
if (o <= 0) return 0;
|
|
1905
|
+
if (o >= 1) return 1;
|
|
1906
|
+
let i = o;
|
|
1907
|
+
for (let l = 0; l < 8; l++) {
|
|
1908
|
+
const u = r(i, t, n) - o, d = a(i, t, n);
|
|
1909
1909
|
if (Math.abs(u) < 1e-6) return r(i, e, s);
|
|
1910
|
-
if (Math.abs(
|
|
1911
|
-
i -= u /
|
|
1910
|
+
if (Math.abs(d) < 1e-6) break;
|
|
1911
|
+
i -= u / d;
|
|
1912
1912
|
}
|
|
1913
|
-
let c = 0,
|
|
1914
|
-
i =
|
|
1915
|
-
for (let
|
|
1916
|
-
r(i, t, n) <
|
|
1913
|
+
let c = 0, h = 1;
|
|
1914
|
+
i = o;
|
|
1915
|
+
for (let l = 0; l < 40; l++)
|
|
1916
|
+
r(i, t, n) < o ? c = i : h = i, i = (c + h) / 2;
|
|
1917
1917
|
return r(i, e, s);
|
|
1918
1918
|
};
|
|
1919
1919
|
}
|
|
1920
|
-
const
|
|
1921
|
-
function
|
|
1922
|
-
const n = e.lead ??
|
|
1923
|
-
let
|
|
1920
|
+
const Ms = 350, xs = 300, _s = 550;
|
|
1921
|
+
function _r(t, e = {}) {
|
|
1922
|
+
const n = e.lead ?? Ms, s = e.gap ?? xs, r = e.tail ?? _s, a = [];
|
|
1923
|
+
let o = 0;
|
|
1924
1924
|
return t.forEach((i, c) => {
|
|
1925
|
-
const
|
|
1926
|
-
let
|
|
1927
|
-
i.lines.forEach((
|
|
1928
|
-
if (!(
|
|
1929
|
-
throw new Error(`narration: scene ${c} line ${
|
|
1930
|
-
|
|
1931
|
-
id:
|
|
1925
|
+
const h = [];
|
|
1926
|
+
let l = o + n;
|
|
1927
|
+
i.lines.forEach((d, f) => {
|
|
1928
|
+
if (!(d.duration >= 0))
|
|
1929
|
+
throw new Error(`narration: scene ${c} line ${f} has an invalid duration (${d.duration})`);
|
|
1930
|
+
f > 0 && (l += s), h.push({
|
|
1931
|
+
id: d.id ?? `s${c}-l${f}`,
|
|
1932
1932
|
scene: c,
|
|
1933
|
-
line:
|
|
1934
|
-
start:
|
|
1935
|
-
end:
|
|
1936
|
-
text:
|
|
1937
|
-
}),
|
|
1933
|
+
line: f,
|
|
1934
|
+
start: l,
|
|
1935
|
+
end: l + d.duration,
|
|
1936
|
+
text: d.text
|
|
1937
|
+
}), l += d.duration;
|
|
1938
1938
|
});
|
|
1939
|
-
const u =
|
|
1940
|
-
|
|
1941
|
-
}), { duration:
|
|
1939
|
+
const u = l + r + (i.tail ?? 0);
|
|
1940
|
+
a.push({ id: i.id ?? `s${c}`, start: o, duration: u - o, cues: h }), o = u;
|
|
1941
|
+
}), { duration: o, scenes: a, cues: a.flatMap((i) => i.cues) };
|
|
1942
1942
|
}
|
|
1943
|
-
function
|
|
1943
|
+
function br(t) {
|
|
1944
1944
|
return t.cues.map((e) => ({ id: e.id, time: e.start, label: e.text }));
|
|
1945
1945
|
}
|
|
1946
|
-
function
|
|
1946
|
+
function Tr(t, e) {
|
|
1947
1947
|
let n = t.scenes[0];
|
|
1948
1948
|
for (const s of t.scenes)
|
|
1949
1949
|
if (e >= s.start) n = s;
|
|
1950
1950
|
else break;
|
|
1951
1951
|
return n;
|
|
1952
1952
|
}
|
|
1953
|
-
const
|
|
1954
|
-
function
|
|
1955
|
-
return t.offset + e *
|
|
1953
|
+
const pt = (t) => 6e4 / t.bpm;
|
|
1954
|
+
function Ot(t, e) {
|
|
1955
|
+
return t.offset + e * pt(t);
|
|
1956
1956
|
}
|
|
1957
|
-
function
|
|
1958
|
-
return (e - t.offset) /
|
|
1957
|
+
function gt(t, e) {
|
|
1958
|
+
return (e - t.offset) / pt(t);
|
|
1959
1959
|
}
|
|
1960
|
-
function
|
|
1961
|
-
return
|
|
1960
|
+
function kr(t, e) {
|
|
1961
|
+
return Ot(t, Math.round(gt(t, e)));
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1964
|
-
return
|
|
1963
|
+
function wr(t, e) {
|
|
1964
|
+
return Ot(t, Math.ceil(gt(t, e) - 1e-9));
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function vr(t, e, n) {
|
|
1967
1967
|
const s = Math.max(1, Math.round(t.beatsPerBar ?? 4)), r = [];
|
|
1968
1968
|
if (!(t.bpm > 0) || n < e) return r;
|
|
1969
|
-
for (let
|
|
1970
|
-
const
|
|
1971
|
-
if (
|
|
1972
|
-
r.push({ time:
|
|
1969
|
+
for (let a = Math.ceil(gt(t, e) - 1e-9); ; a++) {
|
|
1970
|
+
const o = Ot(t, a);
|
|
1971
|
+
if (o > n + 1e-9) break;
|
|
1972
|
+
r.push({ time: o, bar: (a % s + s) % s === 0, n: a });
|
|
1973
1973
|
}
|
|
1974
1974
|
return r;
|
|
1975
1975
|
}
|
|
1976
|
-
const
|
|
1977
|
-
function
|
|
1978
|
-
const s = n.minBpm ?? 70, r = n.maxBpm ?? 180,
|
|
1976
|
+
const H = 100;
|
|
1977
|
+
function Ar(t, e, n = {}) {
|
|
1978
|
+
const s = n.minBpm ?? 70, r = n.maxBpm ?? 180, a = Math.max(1, Math.round(e / H)), o = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), i = Math.floor(o / a);
|
|
1979
1979
|
if (i < 4) return { bpm: 120, offset: 0, confidence: 0 };
|
|
1980
1980
|
const c = new Float64Array(i);
|
|
1981
|
-
for (let
|
|
1981
|
+
for (let b = 0; b < i; b++) {
|
|
1982
1982
|
let T = 0;
|
|
1983
|
-
for (let
|
|
1984
|
-
c[
|
|
1985
|
-
}
|
|
1986
|
-
const
|
|
1987
|
-
for (let
|
|
1988
|
-
const
|
|
1989
|
-
for (let
|
|
1990
|
-
const u = Math.max(1, Math.floor(60 *
|
|
1983
|
+
for (let v = b * a; v < (b + 1) * a; v++) T += t[v] * t[v];
|
|
1984
|
+
c[b] = Math.log(1e-6 + T / a);
|
|
1985
|
+
}
|
|
1986
|
+
const h = new Float64Array(i);
|
|
1987
|
+
for (let b = 1; b < i; b++) h[b] = Math.max(0, c[b] - c[b - 1]);
|
|
1988
|
+
const l = h.reduce((b, T) => b + T, 0) / i;
|
|
1989
|
+
for (let b = 0; b < i; b++) h[b] = Math.max(0, h[b] - l);
|
|
1990
|
+
const u = Math.max(1, Math.floor(60 * H / r)), d = Math.min(i - 1, Math.ceil(60 * H / s)), f = (b) => {
|
|
1991
1991
|
let T = 0;
|
|
1992
|
-
for (let
|
|
1993
|
-
return T / (i -
|
|
1992
|
+
for (let v = b; v < i; v++) T += h[v] * h[v - b];
|
|
1993
|
+
return T / (i - b);
|
|
1994
1994
|
};
|
|
1995
|
-
let
|
|
1996
|
-
for (let
|
|
1997
|
-
|
|
1998
|
-
let
|
|
1999
|
-
for (let
|
|
2000
|
-
const T = 60 *
|
|
2001
|
-
S >
|
|
2002
|
-
}
|
|
2003
|
-
const
|
|
2004
|
-
const T = Math.floor(
|
|
2005
|
-
return T < 0 || T + 1 >= i ? 0 :
|
|
2006
|
-
},
|
|
2007
|
-
let
|
|
2008
|
-
for (let S = T; S < i; S +=
|
|
2009
|
-
return
|
|
1995
|
+
let p = 0;
|
|
1996
|
+
for (let b = 0; b < i; b++) p += h[b] * h[b];
|
|
1997
|
+
p /= i;
|
|
1998
|
+
let m = u, M = -1 / 0;
|
|
1999
|
+
for (let b = u; b <= d; b++) {
|
|
2000
|
+
const T = 60 * H / b, v = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = f(b) * v;
|
|
2001
|
+
S > M && (M = S, m = b);
|
|
2002
|
+
}
|
|
2003
|
+
const y = (b) => {
|
|
2004
|
+
const T = Math.floor(b);
|
|
2005
|
+
return T < 0 || T + 1 >= i ? 0 : h[T] + (h[T + 1] - h[T]) * (b - T);
|
|
2006
|
+
}, g = (b, T) => {
|
|
2007
|
+
let v = 0;
|
|
2008
|
+
for (let S = T; S < i; S += b) v += y(S);
|
|
2009
|
+
return v;
|
|
2010
2010
|
};
|
|
2011
|
-
let
|
|
2012
|
-
for (let
|
|
2013
|
-
if (
|
|
2014
|
-
const T = Math.max(1, Math.round(
|
|
2015
|
-
for (let
|
|
2016
|
-
const S =
|
|
2017
|
-
$ >
|
|
2011
|
+
let _ = m, k = 0, x = -1 / 0;
|
|
2012
|
+
for (let b = m - 0.6; b <= m + 0.6 + 1e-9; b += 0.02) {
|
|
2013
|
+
if (b < 1) continue;
|
|
2014
|
+
const T = Math.max(1, Math.round(b * 4));
|
|
2015
|
+
for (let v = 0; v < T; v++) {
|
|
2016
|
+
const S = v / T * b, $ = g(b, S);
|
|
2017
|
+
$ > x && (x = $, k = S, _ = b);
|
|
2018
2018
|
}
|
|
2019
2019
|
}
|
|
2020
|
-
const
|
|
2021
|
-
return { bpm: Math.round(
|
|
2022
|
-
}
|
|
2023
|
-
const
|
|
2024
|
-
function
|
|
2025
|
-
const n = e.target ?? "Camera", s = { x: e.stage.width / 2, y: e.stage.height / 2 }, r = {},
|
|
2026
|
-
const
|
|
2027
|
-
for (;
|
|
2028
|
-
|
|
2029
|
-
},
|
|
2030
|
-
const
|
|
2020
|
+
const A = 60 * H / _, w = p > 0 ? Math.max(0, Math.min(1, f(m) / p)) : 0, P = (k + 0.5) * 1e3 / H;
|
|
2021
|
+
return { bpm: Math.round(A * 100) / 100, offset: Math.round(P % (6e4 / A)), confidence: w };
|
|
2022
|
+
}
|
|
2023
|
+
const bs = 600, Ts = 250, ie = 1;
|
|
2024
|
+
function Sr(t, e) {
|
|
2025
|
+
const n = e.target ?? "Camera", s = { x: e.stage.width / 2, y: e.stage.height / 2 }, r = {}, a = (u, d, f, p) => {
|
|
2026
|
+
const m = r[u] ??= [];
|
|
2027
|
+
for (; m.length > 0 && m[m.length - 1].time >= d; ) m.pop();
|
|
2028
|
+
m.push({ time: d, value: f, ...p ? { easing: p } : {} });
|
|
2029
|
+
}, o = (u) => {
|
|
2030
|
+
const d = u.rotate * Math.PI / 180, f = (u.focusX - s.x) * u.scale, p = (u.focusY - s.y) * u.scale;
|
|
2031
2031
|
return {
|
|
2032
|
-
x: -(
|
|
2033
|
-
y: -(
|
|
2032
|
+
x: -(f * Math.cos(d) - p * Math.sin(d)),
|
|
2033
|
+
y: -(f * Math.sin(d) + p * Math.cos(d)),
|
|
2034
2034
|
scale: u.scale,
|
|
2035
2035
|
rotate: u.rotate
|
|
2036
2036
|
};
|
|
2037
|
-
}, i = (u,
|
|
2038
|
-
const
|
|
2039
|
-
for (const
|
|
2037
|
+
}, i = (u, d, f) => {
|
|
2038
|
+
const p = o(d);
|
|
2039
|
+
for (const m of ["x", "y", "scale", "rotate"]) a(m, u, p[m], f);
|
|
2040
2040
|
};
|
|
2041
2041
|
let c = { focusX: s.x, focusY: s.y, scale: 1, rotate: 0 };
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2044
|
-
for (const u of
|
|
2042
|
+
const h = [...t].sort((u, d) => u.at - d.at), l = h.filter((u) => !("shake" in u));
|
|
2043
|
+
l.length > 0 && i(0, c);
|
|
2044
|
+
for (const u of l)
|
|
2045
2045
|
if ("frame" in u) {
|
|
2046
|
-
const
|
|
2046
|
+
const d = Math.max(ie, u.duration ?? bs);
|
|
2047
2047
|
i(u.at, c), c = {
|
|
2048
2048
|
focusX: u.frame.focus?.x ?? s.x,
|
|
2049
2049
|
focusY: u.frame.focus?.y ?? s.y,
|
|
2050
2050
|
scale: u.frame.scale ?? 1,
|
|
2051
2051
|
rotate: u.frame.rotate ?? 0
|
|
2052
|
-
}, i(u.at +
|
|
2052
|
+
}, i(u.at + d, c, u.easing ?? (d > ie ? "ease-in-out" : void 0));
|
|
2053
2053
|
} else {
|
|
2054
|
-
const { follow:
|
|
2054
|
+
const { follow: d } = u, f = d.lag ?? Ts, p = new Pe({ id: "follow", tracks: [{ id: "x", target: "s", property: "x", keyframes: d.x }] }), m = (g) => p.getStateAtTime(g).values.get("s")?.get("x") ?? c.focusX, M = [u.at, ...d.x.map((g) => g.time).filter((g) => g > u.at && g < u.until), u.until];
|
|
2055
2055
|
i(u.at, c);
|
|
2056
|
-
const
|
|
2057
|
-
focusX:
|
|
2058
|
-
focusY:
|
|
2059
|
-
scale:
|
|
2056
|
+
const y = (g) => ({
|
|
2057
|
+
focusX: m(g) + (d.lead ?? 0),
|
|
2058
|
+
focusY: d.y ?? c.focusY,
|
|
2059
|
+
scale: d.scale ?? c.scale,
|
|
2060
2060
|
rotate: c.rotate
|
|
2061
2061
|
});
|
|
2062
|
-
for (const
|
|
2063
|
-
const
|
|
2064
|
-
i(
|
|
2062
|
+
for (const g of M) {
|
|
2063
|
+
const _ = d.x.find((k) => k.time === g)?.easing;
|
|
2064
|
+
i(g + f, y(g), g === u.at ? "ease-in-out" : _);
|
|
2065
2065
|
}
|
|
2066
|
-
c =
|
|
2066
|
+
c = y(u.until);
|
|
2067
2067
|
}
|
|
2068
|
-
for (const u of
|
|
2069
|
-
const
|
|
2070
|
-
for (const
|
|
2071
|
-
for (let
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2068
|
+
for (const u of h.filter((d) => "shake" in d)) {
|
|
2069
|
+
const d = u.shake.strength ?? 12, f = u.shake.roll ?? 1.5, p = 1e3 / (u.shake.frequency ?? 24), m = $e(u.shake.seed ?? Math.round(u.at) + 1), M = () => m.next() * 2 - 1;
|
|
2070
|
+
for (const y of ["shakeX", "shakeY", "shakeRotate"]) a(y, u.at, 0);
|
|
2071
|
+
for (let y = u.at + p; y < u.at + u.duration; y += p) {
|
|
2072
|
+
const g = 1 - (y - u.at) / u.duration;
|
|
2073
|
+
a("shakeX", y, M() * d * g), a("shakeY", y, M() * d * g), a("shakeRotate", y, M() * f * g);
|
|
2074
2074
|
}
|
|
2075
|
-
for (const
|
|
2075
|
+
for (const y of ["shakeX", "shakeY", "shakeRotate"]) a(y, u.at + u.duration, 0, "ease-out");
|
|
2076
2076
|
}
|
|
2077
|
-
return Object.entries(r).map(([u,
|
|
2077
|
+
return Object.entries(r).map(([u, d]) => ({ id: `${n}-${u}`, target: n, property: u, keyframes: d }));
|
|
2078
2078
|
}
|
|
2079
|
-
function
|
|
2079
|
+
function ks(t, e) {
|
|
2080
2080
|
const n = t.toLowerCase(), s = e.toLowerCase();
|
|
2081
|
-
let r = Array.from({ length: s.length + 1 }, (
|
|
2082
|
-
for (let
|
|
2083
|
-
const
|
|
2081
|
+
let r = Array.from({ length: s.length + 1 }, (a, o) => o);
|
|
2082
|
+
for (let a = 1; a <= n.length; a++) {
|
|
2083
|
+
const o = [a];
|
|
2084
2084
|
for (let i = 1; i <= s.length; i++)
|
|
2085
|
-
|
|
2086
|
-
r =
|
|
2085
|
+
o[i] = Math.min(r[i] + 1, o[i - 1] + 1, r[i - 1] + (n[a - 1] === s[i - 1] ? 0 : 1));
|
|
2086
|
+
r = o;
|
|
2087
2087
|
}
|
|
2088
2088
|
return r[s.length];
|
|
2089
2089
|
}
|
|
2090
|
-
function
|
|
2091
|
-
const n = t.toLowerCase(), s = e.find((
|
|
2090
|
+
function ws(t, e) {
|
|
2091
|
+
const n = t.toLowerCase(), s = e.find((o) => o.toLowerCase().includes(n) || n.includes(o.toLowerCase()));
|
|
2092
2092
|
if (s && Math.min(t.length, s.length) >= 3) return s;
|
|
2093
|
-
let r,
|
|
2094
|
-
for (const
|
|
2095
|
-
const i =
|
|
2096
|
-
i <
|
|
2093
|
+
let r, a = 1 / 0;
|
|
2094
|
+
for (const o of e) {
|
|
2095
|
+
const i = ks(t, o);
|
|
2096
|
+
i < a && (a = i, r = o);
|
|
2097
2097
|
}
|
|
2098
|
-
return r !== void 0 &&
|
|
2098
|
+
return r !== void 0 && a <= Math.max(2, Math.floor(t.length / 3)) ? r : void 0;
|
|
2099
2099
|
}
|
|
2100
|
-
function
|
|
2101
|
-
const r = typeof e == "string" ? s ??
|
|
2100
|
+
function Pr(t, e, n, s) {
|
|
2101
|
+
const r = typeof e == "string" ? s ?? ws(e, n) : void 0;
|
|
2102
2102
|
return `Unknown ${t} ${JSON.stringify(e)}${r ? `: did you mean "${r}"?` : "."} Known: ${n.join(", ")}`;
|
|
2103
2103
|
}
|
|
2104
|
-
function
|
|
2105
|
-
const n = e.step ?? 33, s = e.stiffness ?? 120, r = e.damping ?? 9,
|
|
2106
|
-
let
|
|
2107
|
-
const c = [{ time: e.start, value:
|
|
2108
|
-
let
|
|
2109
|
-
for (let
|
|
2110
|
-
const
|
|
2111
|
-
i +=
|
|
2104
|
+
function Ir(t, e) {
|
|
2105
|
+
const n = e.step ?? 33, s = e.stiffness ?? 120, r = e.damping ?? 9, a = e.mass ?? 1;
|
|
2106
|
+
let o = t(e.start), i = 0;
|
|
2107
|
+
const c = [{ time: e.start, value: o }];
|
|
2108
|
+
let h = e.start + n;
|
|
2109
|
+
for (let l = e.start + 1; l <= e.end; l++) {
|
|
2110
|
+
const d = s * (t(l) - o) - r * i;
|
|
2111
|
+
i += d / a * 1e-3, o += i * 1e-3, (l >= h || l === e.end) && (c.push({ time: l, value: o }), h += n);
|
|
2112
2112
|
}
|
|
2113
2113
|
return c;
|
|
2114
2114
|
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2115
|
+
function K(t, e, n = 1) {
|
|
2116
|
+
if (!(e > 0)) return 0;
|
|
2117
|
+
const s = t * n / e;
|
|
2118
|
+
return s - Math.floor(s);
|
|
2119
|
+
}
|
|
2120
|
+
function Le(t) {
|
|
2121
|
+
const e = t - Math.floor(t);
|
|
2122
|
+
return 1 - Math.abs(e * 2 - 1);
|
|
2123
|
+
}
|
|
2124
|
+
function $r(t, e) {
|
|
2125
|
+
const n = Math.max(1, Math.round(e.cycles ?? 1)), s = e.amplitude ?? 1, r = K(t, e.period, n) + (e.phase ?? 0), a = r - Math.floor(r);
|
|
2126
|
+
switch (e.shape ?? "sine") {
|
|
2127
|
+
case "triangle":
|
|
2128
|
+
return s * (Le(a + 0.25) * 2 - 1);
|
|
2129
|
+
case "square":
|
|
2130
|
+
return a < 0.5 ? s : -s;
|
|
2131
|
+
default:
|
|
2132
|
+
return s * Math.sin(a * Math.PI * 2);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
function Rr(t, e) {
|
|
2136
|
+
const n = Math.max(1, Math.round(e.cycles ?? 1)), s = typeof e.easing == "function" ? e.easing : Lt(e.easing ?? "ease-in-out"), r = K(t, e.period, n) + (e.phase ?? 0);
|
|
2137
|
+
return s(Le(r));
|
|
2138
|
+
}
|
|
2139
|
+
function Cr(t, e) {
|
|
2140
|
+
const n = Fe(e.seed), s = Math.max(1, Math.round(e.cycles ?? 1)), r = (K(t, e.period, 1) + (e.phase ?? 0)) * Math.PI * 2, a = s / Math.PI;
|
|
2141
|
+
return Oe([Math.cos(r) * a + 7.31, Math.sin(r) * a + 3.17], n, e.octaves ?? 1);
|
|
2142
|
+
}
|
|
2143
|
+
function Dr(t, e, n) {
|
|
2144
|
+
const s = Fe(n.seed), r = Math.max(1, Math.round(n.cycles ?? 1)), a = Math.max(1, Math.round(n.cyclesAlong ?? 1)), o = K(t, n.period, 1) * Math.PI * 2, i = K(e, n.periodAlong, 1) * Math.PI * 2, c = r / Math.PI, h = a / Math.PI;
|
|
2145
|
+
return Oe([Math.cos(o) * c + 5.13, Math.sin(o) * c + 9.47, Math.cos(i) * h + 2.71, Math.sin(i) * h + 6.29], s, n.octaves ?? 1);
|
|
2146
|
+
}
|
|
2147
|
+
const Fe = (t) => typeof t == "string" ? fs(t) : (t ?? 0) >>> 0;
|
|
2148
|
+
function Oe(t, e, n) {
|
|
2149
|
+
const s = Math.max(1, Math.min(6, Math.round(n)));
|
|
2150
|
+
let r = 0, a = 1, o = 0;
|
|
2151
|
+
for (let i = 0; i < s; i++) {
|
|
2152
|
+
const c = 2 ** i;
|
|
2153
|
+
r += a * vs(t.map((h) => h * c), e + i * 1013), o += a, a *= 0.5;
|
|
2154
|
+
}
|
|
2155
|
+
return r / o;
|
|
2156
|
+
}
|
|
2157
|
+
function vs(t, e) {
|
|
2158
|
+
const n = t.length, s = t.map(Math.floor), a = t.map((i, c) => i - s[c]).map((i) => i * i * (3 - 2 * i));
|
|
2159
|
+
let o = 0;
|
|
2160
|
+
for (let i = 0; i < 1 << n; i++) {
|
|
2161
|
+
let c = 1;
|
|
2162
|
+
const h = [];
|
|
2163
|
+
for (let l = 0; l < n; l++) {
|
|
2164
|
+
const u = i >> l & 1;
|
|
2165
|
+
c *= u ? a[l] : 1 - a[l], h.push(s[l] + u);
|
|
2166
|
+
}
|
|
2167
|
+
c !== 0 && (o += c * As(h, e));
|
|
2168
|
+
}
|
|
2169
|
+
return o;
|
|
2170
|
+
}
|
|
2171
|
+
function As(t, e) {
|
|
2172
|
+
let n = (e ^ 2654435769) >>> 0;
|
|
2173
|
+
for (const s of t)
|
|
2174
|
+
n = Math.imul(n ^ (s | 0), 2246822507) >>> 0, n = (n ^ n >>> 13) >>> 0, n = Math.imul(n, 3266489909) >>> 0, n = (n ^ n >>> 16) >>> 0;
|
|
2175
|
+
return n / 4294967296 * 2 - 1;
|
|
2176
|
+
}
|
|
2177
|
+
function Er(t, e = {}) {
|
|
2178
|
+
if (t.length === 0) throw new Error("curve: needs at least one key");
|
|
2179
|
+
const s = { id: "curve", target: "curve", property: "value", keyframes: t.map((a) => ({ time: a.at, value: a.value, easing: a.easing })).sort((a, o) => a.time - o.time), interpolation: e.interpolation }, r = new ut(s);
|
|
2180
|
+
return (a) => r.getValueAtTime(a);
|
|
2181
|
+
}
|
|
2182
|
+
function Lr(t, e) {
|
|
2183
|
+
return e * pt({ bpm: t.bpm });
|
|
2184
|
+
}
|
|
2185
|
+
function Fr(t, e) {
|
|
2186
|
+
const n = Math.max(1, Math.round(t / pt(e)));
|
|
2187
|
+
return { beats: n, grid: { ...e, bpm: n * 6e4 / t } };
|
|
2188
|
+
}
|
|
2189
|
+
function Or(t, e, n = {}) {
|
|
2190
|
+
const s = Math.max(1e-6, n.attack ?? 0.05), r = Math.max(1e-6, n.decay ?? 0.4), a = gt(e, t), o = a - Math.floor(a), i = o < s ? o / s : Math.max(0, 1 - (o - s) / r), c = n.barAccent ?? 0;
|
|
2191
|
+
if (c <= 0) return i;
|
|
2192
|
+
const h = Math.max(1, Math.round(e.beatsPerBar ?? 4)), u = (Math.floor(a) % h + h) % h === 0;
|
|
2193
|
+
return i * (u ? 1 + c : 1) / (1 + c);
|
|
2194
|
+
}
|
|
2195
|
+
function Nr(t, e, n = {}) {
|
|
2196
|
+
const s = n.fps ?? 30, r = Math.max(1, Math.round(e / s)), a = Math.max(1, Math.ceil(t.length / r)), o = new Float32Array(a), i = Math.min(0.99, Math.max(0, n.smoothing ?? 0.5));
|
|
2197
|
+
let c = 0, h = 0;
|
|
2198
|
+
for (let l = 0; l < a; l++) {
|
|
2199
|
+
let u = 0;
|
|
2200
|
+
const d = l * r, f = Math.min(t.length, d + r);
|
|
2201
|
+
for (let m = d; m < f; m++) u += t[m] * t[m];
|
|
2202
|
+
const p = f > d ? Math.sqrt(u / (f - d)) : 0;
|
|
2203
|
+
c = p > c ? p : c * i + p * (1 - i), o[l] = c, h = Math.max(h, c);
|
|
2204
|
+
}
|
|
2205
|
+
if (n.normalize !== !1 && h > 0) for (let l = 0; l < a; l++) o[l] /= h;
|
|
2206
|
+
return o;
|
|
2207
|
+
}
|
|
2208
|
+
function Xr(t, e, n = 30, s) {
|
|
2209
|
+
if (t.length === 0) return 0;
|
|
2210
|
+
const a = (s ? K(e, s) * s : e) * n / 1e3, o = Math.floor(a), i = t[Math.min(t.length - 1, Math.max(0, o))], c = t[Math.min(t.length - 1, Math.max(0, o + 1))];
|
|
2211
|
+
return i + (c - i) * (a - o);
|
|
2212
|
+
}
|
|
2213
|
+
const F = (t) => Math.round(t * 1e3) / 1e3;
|
|
2214
|
+
function Yr(t, e = {}) {
|
|
2117
2215
|
if (t.length === 0) return "";
|
|
2118
2216
|
const n = e.curviness ?? 1, s = e.closed ?? !1, r = t.length;
|
|
2119
|
-
let
|
|
2120
|
-
if (r === 1) return
|
|
2121
|
-
const
|
|
2217
|
+
let a = `M${F(t[0].x)} ${F(t[0].y)}`;
|
|
2218
|
+
if (r === 1) return a;
|
|
2219
|
+
const o = (c) => s ? t[(c % r + r) % r] : t[Math.max(0, Math.min(r - 1, c))], i = s ? r : r - 1;
|
|
2122
2220
|
for (let c = 0; c < i; c++) {
|
|
2123
|
-
const
|
|
2221
|
+
const h = o(c - 1), l = o(c), u = o(c + 1), d = o(c + 2);
|
|
2124
2222
|
if (n === 0) {
|
|
2125
|
-
|
|
2223
|
+
a += ` L${F(u.x)} ${F(u.y)}`;
|
|
2126
2224
|
continue;
|
|
2127
2225
|
}
|
|
2128
|
-
const
|
|
2129
|
-
|
|
2226
|
+
const f = n / 6, p = l.x + (u.x - h.x) * f, m = l.y + (u.y - h.y) * f, M = u.x - (d.x - l.x) * f, y = u.y - (d.y - l.y) * f;
|
|
2227
|
+
a += ` C${F(p)} ${F(m)} ${F(M)} ${F(y)} ${F(u.x)} ${F(u.y)}`;
|
|
2130
2228
|
}
|
|
2131
|
-
return s ? `${
|
|
2229
|
+
return s ? `${a} Z` : a;
|
|
2132
2230
|
}
|
|
2133
|
-
const
|
|
2231
|
+
const C = (t, e = 0) => {
|
|
2134
2232
|
const n = parseFloat(t ?? "");
|
|
2135
2233
|
return Number.isFinite(n) ? n : e;
|
|
2136
2234
|
};
|
|
2137
|
-
function
|
|
2235
|
+
function Ss(t) {
|
|
2138
2236
|
const e = (t ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), n = [];
|
|
2139
2237
|
for (let s = 0; s + 1 < e.length; s += 2) n.push({ x: e[s], y: e[s + 1] });
|
|
2140
2238
|
return n;
|
|
2141
2239
|
}
|
|
2142
|
-
function
|
|
2240
|
+
function zr(t) {
|
|
2143
2241
|
const e = t.attributes;
|
|
2144
2242
|
switch (t.tag.toLowerCase()) {
|
|
2145
2243
|
case "path":
|
|
2146
2244
|
return e.d ?? null;
|
|
2147
2245
|
case "circle":
|
|
2148
2246
|
case "ellipse": {
|
|
2149
|
-
const n =
|
|
2150
|
-
return `M${n + r} ${s} A${r} ${
|
|
2247
|
+
const n = C(e.cx), s = C(e.cy), r = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.rx), a = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.ry);
|
|
2248
|
+
return `M${n + r} ${s} A${r} ${a} 0 1 1 ${n - r} ${s} A${r} ${a} 0 1 1 ${n + r} ${s} Z`;
|
|
2151
2249
|
}
|
|
2152
2250
|
case "rect": {
|
|
2153
|
-
const n =
|
|
2154
|
-
let
|
|
2155
|
-
return
|
|
2251
|
+
const n = C(e.x), s = C(e.y), r = C(e.width), a = C(e.height);
|
|
2252
|
+
let o = e.rx != null ? C(e.rx) : e.ry != null ? C(e.ry) : 0, i = e.ry != null ? C(e.ry) : o;
|
|
2253
|
+
return o = Math.min(o, r / 2), i = Math.min(i, a / 2), o === 0 || i === 0 ? `M${n} ${s} H${n + r} V${s + a} H${n} Z` : `M${n + o} ${s} H${n + r - o} A${o} ${i} 0 0 1 ${n + r} ${s + i} V${s + a - i} A${o} ${i} 0 0 1 ${n + r - o} ${s + a} H${n + o} A${o} ${i} 0 0 1 ${n} ${s + a - i} V${s + i} A${o} ${i} 0 0 1 ${n + o} ${s} Z`;
|
|
2156
2254
|
}
|
|
2157
2255
|
case "line":
|
|
2158
|
-
return `M${
|
|
2256
|
+
return `M${C(e.x1)} ${C(e.y1)} L${C(e.x2)} ${C(e.y2)}`;
|
|
2159
2257
|
case "polyline":
|
|
2160
2258
|
case "polygon": {
|
|
2161
|
-
const n =
|
|
2259
|
+
const n = Ss(e.points);
|
|
2162
2260
|
if (n.length === 0) return null;
|
|
2163
|
-
const s = n.map((r,
|
|
2261
|
+
const s = n.map((r, a) => `${a === 0 ? "M" : "L"}${r.x} ${r.y}`).join(" ");
|
|
2164
2262
|
return t.tag.toLowerCase() === "polygon" ? `${s} Z` : s;
|
|
2165
2263
|
}
|
|
2166
2264
|
default:
|
|
2167
2265
|
return null;
|
|
2168
2266
|
}
|
|
2169
2267
|
}
|
|
2170
|
-
function
|
|
2171
|
-
const s = Math.max(2, Math.round(n.samples ?? 32)), r = Math.max(0, n.length),
|
|
2172
|
-
if (
|
|
2173
|
-
const
|
|
2268
|
+
function jr(t, e, n) {
|
|
2269
|
+
const s = Math.max(2, Math.round(n.samples ?? 32)), r = Math.max(0, n.length), a = n.since !== void 0 ? Math.max(e - r, n.since) : e - r;
|
|
2270
|
+
if (a >= e) return [];
|
|
2271
|
+
const o = n.period, i = [];
|
|
2174
2272
|
for (let c = 0; c < s; c++) {
|
|
2175
|
-
const
|
|
2176
|
-
i.push({ at: t(
|
|
2273
|
+
const h = a + (e - a) * c / (s - 1), l = o && o > 0 && c < s - 1 ? (h % o + o) % o : h;
|
|
2274
|
+
i.push({ at: t(l), time: h, age: r > 0 ? (e - h) / r : 0 });
|
|
2177
2275
|
}
|
|
2178
2276
|
return i;
|
|
2179
2277
|
}
|
|
2180
|
-
const
|
|
2181
|
-
function
|
|
2182
|
-
const e = [], n = [], s = t.length, r = (
|
|
2183
|
-
for (let i =
|
|
2184
|
-
const c = (t[i].x - t[
|
|
2185
|
-
if (
|
|
2278
|
+
const Ps = 2.5;
|
|
2279
|
+
function Ur(t) {
|
|
2280
|
+
const e = [], n = [], s = t.length, r = (a, o) => {
|
|
2281
|
+
for (let i = a + o; i >= 0 && i < s; i += o) {
|
|
2282
|
+
const c = (t[i].x - t[a].x) * o, h = (t[i].y - t[a].y) * o, l = Math.hypot(c, h);
|
|
2283
|
+
if (l > 1e-9) return [c / l, h / l];
|
|
2186
2284
|
}
|
|
2187
2285
|
return null;
|
|
2188
2286
|
};
|
|
2189
|
-
for (let
|
|
2190
|
-
const
|
|
2191
|
-
let u =
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2194
|
-
const
|
|
2195
|
-
e.push({ x:
|
|
2287
|
+
for (let a = 0; a < s; a++) {
|
|
2288
|
+
const o = t[a], i = r(a, -1), c = r(a, 1), h = i ?? c ?? [1, 0], l = c ?? i ?? [1, 0];
|
|
2289
|
+
let u = h[0] + l[0], d = h[1] + l[1];
|
|
2290
|
+
const f = Math.hypot(u, d);
|
|
2291
|
+
f < 1e-9 ? (u = h[0], d = h[1]) : (u /= f, d /= f);
|
|
2292
|
+
const p = u * h[0] + d * h[1], m = Math.min(Ps, 1 / Math.max(p, 1e-6)), M = o.width / 2 * m;
|
|
2293
|
+
e.push({ x: o.x - d * M, y: o.y + u * M }), n.push({ x: o.x + d * M, y: o.y - u * M });
|
|
2196
2294
|
}
|
|
2197
2295
|
return { left: e, right: n };
|
|
2198
2296
|
}
|
|
2199
|
-
function
|
|
2297
|
+
function Vr(t) {
|
|
2200
2298
|
const e = t.length;
|
|
2201
2299
|
if (e < 2) return null;
|
|
2202
2300
|
const n = t[e - 1];
|
|
2203
2301
|
for (let s = e - 2; s >= 0; s--) {
|
|
2204
|
-
const r = n.x - t[s].x,
|
|
2205
|
-
if (
|
|
2206
|
-
return { x: n.x, y: n.y, radius: n.width / 2, start: Math.atan2(r /
|
|
2302
|
+
const r = n.x - t[s].x, a = n.y - t[s].y, o = Math.hypot(r, a);
|
|
2303
|
+
if (o > 1e-9)
|
|
2304
|
+
return { x: n.x, y: n.y, radius: n.width / 2, start: Math.atan2(r / o, -a / o) };
|
|
2207
2305
|
}
|
|
2208
2306
|
return null;
|
|
2209
2307
|
}
|
|
2210
|
-
|
|
2308
|
+
const Br = { scale: 1, turn: 0, x: 0, y: 0 };
|
|
2309
|
+
function Hr(t = {}) {
|
|
2310
|
+
return { scale: t.scale ?? 1, turn: t.turn ?? 0, x: t.x ?? 0, y: t.y ?? 0 };
|
|
2311
|
+
}
|
|
2312
|
+
function Is(t, e, n) {
|
|
2313
|
+
const { ax: s, ay: r } = yt(t, e);
|
|
2314
|
+
return { scale: t, turn: e, x: n.x - (s * n.x - r * n.y), y: n.y - (r * n.x + s * n.y) };
|
|
2315
|
+
}
|
|
2316
|
+
function Ne(t, e) {
|
|
2317
|
+
const { ax: n, ay: s } = yt(t.scale, t.turn);
|
|
2318
|
+
return { x: n * e.x - s * e.y + t.x, y: s * e.x + n * e.y + t.y };
|
|
2319
|
+
}
|
|
2320
|
+
function qr(t, e) {
|
|
2321
|
+
const n = Ne(e, { x: t.x, y: t.y });
|
|
2322
|
+
return { scale: t.scale * e.scale, turn: t.turn + e.turn, x: n.x, y: n.y };
|
|
2323
|
+
}
|
|
2324
|
+
function Wr(t) {
|
|
2325
|
+
if (t.scale === 0) throw new Error("invertSimilarity: a scale of 0 cannot be undone");
|
|
2326
|
+
const e = { scale: 1 / t.scale, turn: -t.turn, x: 0, y: 0 }, n = Ne(e, { x: t.x, y: t.y });
|
|
2327
|
+
return { ...e, x: -n.x, y: -n.y };
|
|
2328
|
+
}
|
|
2329
|
+
function $s(t) {
|
|
2330
|
+
const { ax: e, ay: n } = yt(t.scale, t.turn), s = 1 - e, r = -n, a = s * s + r * r;
|
|
2331
|
+
return a < 1e-18 ? null : { x: (t.x * s + t.y * r) / a, y: (t.y * s - t.x * r) / a };
|
|
2332
|
+
}
|
|
2333
|
+
function Qr(t, e) {
|
|
2334
|
+
if (t.scale <= 0) throw new Error("powSimilarity: the scale must be positive");
|
|
2335
|
+
const n = Math.pow(t.scale, e), s = t.turn * e, r = $s(t);
|
|
2336
|
+
return r ? Is(n, s, r) : { scale: n, turn: s, x: t.x * e, y: t.y * e };
|
|
2337
|
+
}
|
|
2338
|
+
function Gr(t) {
|
|
2339
|
+
const { ax: e, ay: n } = yt(t.scale, t.turn);
|
|
2340
|
+
return [e, n, -n, e, t.x, t.y];
|
|
2341
|
+
}
|
|
2342
|
+
const yt = (t, e) => {
|
|
2343
|
+
const n = e * Math.PI / 180;
|
|
2344
|
+
return { ax: t * Math.cos(n), ay: t * Math.sin(n) };
|
|
2345
|
+
};
|
|
2346
|
+
function Nt([t, e, n], s = {}) {
|
|
2347
|
+
const r = s.scale ?? 1, a = s.centre ?? { x: 0, y: 0 }, o = Math.sqrt(3) / 2;
|
|
2348
|
+
return { x: a.x + (t - e) * o * r, y: a.y + ((t + e) * 0.5 - n) * r };
|
|
2349
|
+
}
|
|
2350
|
+
const Xe = ([t, e, n]) => t + e + n;
|
|
2351
|
+
function Ye(t, e = {}) {
|
|
2352
|
+
const [n, s, r] = t.min, [a, o, i] = t.max, c = (d) => Nt(d, e), h = [(n + a) / 2, (s + o) / 2, (r + i) / 2], l = Xe(h), u = [
|
|
2353
|
+
{ side: "top", depth: l, tag: t.tag, points: [c([n, s, i]), c([a, s, i]), c([a, o, i]), c([n, o, i])] },
|
|
2354
|
+
{ side: "left", depth: l, tag: t.tag, points: [c([n, o, r]), c([a, o, r]), c([a, o, i]), c([n, o, i])] },
|
|
2355
|
+
{ side: "right", depth: l, tag: t.tag, points: [c([a, s, r]), c([a, o, r]), c([a, o, i]), c([a, s, i])] }
|
|
2356
|
+
];
|
|
2357
|
+
return t.hide ? u.filter((d) => !t.hide.includes(d.side)) : u;
|
|
2358
|
+
}
|
|
2359
|
+
function ze(t, e = {}) {
|
|
2360
|
+
return t.map((n) => ({ box: n, depth: Xe([(n.min[0] + n.max[0]) / 2, (n.min[1] + n.max[1]) / 2, (n.min[2] + n.max[2]) / 2]) })).sort((n, s) => n.depth - s.depth).flatMap(({ box: n }) => Ye(n, e));
|
|
2361
|
+
}
|
|
2362
|
+
function Kr(t = {}) {
|
|
2363
|
+
const e = t.size ?? 10, s = (t.thickness ?? 2) / 2, r = [
|
|
2364
|
+
{ tag: 0, min: [-s, -s, -s], max: [e - s, s, s] },
|
|
2365
|
+
{ tag: 1, min: [e - s, -s, -s], max: [e + s, e - s, s] },
|
|
2366
|
+
{ tag: 2, min: [e - s, e - s, -s], max: [e + s, e + s, e] }
|
|
2367
|
+
], a = t.centre ?? { x: 0, y: 0 }, o = Nt([2 * e / 3, e / 3, e / 3], { scale: t.scale }), i = { centre: { x: a.x - o.x, y: a.y - o.y }, scale: t.scale };
|
|
2368
|
+
return { boxes: r, faces: [...ze(r, i), ...Ye({ ...r[0], hide: ["right"] }, i)] };
|
|
2369
|
+
}
|
|
2370
|
+
function Zr(t = {}) {
|
|
2371
|
+
const e = Math.max(2, Math.round(t.steps ?? 8)), n = t.tread ?? 1.5, s = t.rise ?? 0.25, r = t.width ?? 3, a = t.base ?? 1.5, o = Math.max(1, Math.round(e * (n - 2 * s) / (n + 2 * s))), i = 2 * (e + o), c = n * (e - o) / i, h = [
|
|
2372
|
+
{ dir: [1, 0, 0], across: [0, 1, 0], count: e },
|
|
2373
|
+
{ dir: [0, 1, 0], across: [-1, 0, 0], count: e },
|
|
2374
|
+
{ dir: [-1, 0, 0], across: [0, -1, 0], count: o },
|
|
2375
|
+
{ dir: [0, -1, 0], across: [1, 0, 0], count: o }
|
|
2376
|
+
], l = [];
|
|
2377
|
+
let u = [0, 0, 0], d = 0;
|
|
2378
|
+
for (const y of h) {
|
|
2379
|
+
for (let g = 0; g < y.count; g++) {
|
|
2380
|
+
const _ = d * c, k = [u[0] + y.dir[0] * g * n, u[1] + y.dir[1] * g * n, 0], x = [k[0] + y.dir[0] * n + y.across[0] * r, k[1] + y.dir[1] * n + y.across[1] * r, 0];
|
|
2381
|
+
l.push({
|
|
2382
|
+
tag: d,
|
|
2383
|
+
min: [Math.min(k[0], x[0]), Math.min(k[1], x[1]), 0],
|
|
2384
|
+
max: [Math.max(k[0], x[0]), Math.max(k[1], x[1]), _ + a]
|
|
2385
|
+
}), d++;
|
|
2386
|
+
}
|
|
2387
|
+
u = [u[0] + y.dir[0] * y.count * n, u[1] + y.dir[1] * y.count * n, 0];
|
|
2388
|
+
}
|
|
2389
|
+
const f = i * c, p = t.centre ?? { x: 0, y: 0 }, m = Nt([e * n / 2, e * n / 2, f / 2 + a], { scale: t.scale }), M = { centre: { x: p.x - m.x, y: p.y - m.y }, scale: t.scale };
|
|
2390
|
+
return { boxes: l, faces: ze(l, M), rise: c };
|
|
2391
|
+
}
|
|
2392
|
+
function Rs(t, e, n) {
|
|
2393
|
+
let s = 0;
|
|
2394
|
+
for (const r of t) {
|
|
2395
|
+
const a = (e - r.x) ** 2 + (n - r.y) ** 2;
|
|
2396
|
+
s += a > 1e-9 ? r.r * r.r / a : 1e9;
|
|
2397
|
+
}
|
|
2398
|
+
return s;
|
|
2399
|
+
}
|
|
2400
|
+
function Jr(t, e = {}) {
|
|
2401
|
+
if (t.length === 0) return [];
|
|
2402
|
+
const n = e.threshold ?? 1, s = Math.max(0.5, e.cell ?? 4), r = Math.sqrt(1 / n) * 1.6, a = e.bounds ?? {
|
|
2403
|
+
x: Math.min(...t.map((f) => f.x - f.r * r)),
|
|
2404
|
+
y: Math.min(...t.map((f) => f.y - f.r * r)),
|
|
2405
|
+
width: Math.max(...t.map((f) => f.x + f.r * r)) - Math.min(...t.map((f) => f.x - f.r * r)),
|
|
2406
|
+
height: Math.max(...t.map((f) => f.y + f.r * r)) - Math.min(...t.map((f) => f.y - f.r * r))
|
|
2407
|
+
}, o = Math.max(2, Math.ceil(a.width / s) + 1), i = Math.max(2, Math.ceil(a.height / s) + 1), c = new Float64Array(o * i);
|
|
2408
|
+
for (let f = 0; f < i; f++) for (let p = 0; p < o; p++) c[f * o + p] = Rs(t, a.x + p * s, a.y + f * s) - n;
|
|
2409
|
+
const h = (f, p) => c[p * o + f], l = (f, p, m, M, y, g) => {
|
|
2410
|
+
const _ = m === g ? 0.5 : m / (m - g);
|
|
2411
|
+
return { x: f + (M - f) * _, y: p + (y - p) * _ };
|
|
2412
|
+
}, u = [];
|
|
2413
|
+
for (let f = 0; f + 1 < i; f++)
|
|
2414
|
+
for (let p = 0; p + 1 < o; p++) {
|
|
2415
|
+
const m = a.x + p * s, M = a.y + f * s, y = m + s, g = M + s, _ = [h(p, f), h(p + 1, f), h(p + 1, f + 1), h(p, f + 1)], k = (_[0] > 0 ? 1 : 0) | (_[1] > 0 ? 2 : 0) | (_[2] > 0 ? 4 : 0) | (_[3] > 0 ? 8 : 0);
|
|
2416
|
+
if (k === 0 || k === 15) continue;
|
|
2417
|
+
const x = () => l(m, M, _[0], y, M, _[1]), A = () => l(y, M, _[1], y, g, _[2]), w = () => l(m, g, _[3], y, g, _[2]), P = () => l(m, M, _[0], m, g, _[3]), b = (_[0] + _[1] + _[2] + _[3]) / 4 > 0;
|
|
2418
|
+
switch (k) {
|
|
2419
|
+
case 1:
|
|
2420
|
+
case 14:
|
|
2421
|
+
u.push([P(), x()]);
|
|
2422
|
+
break;
|
|
2423
|
+
case 2:
|
|
2424
|
+
case 13:
|
|
2425
|
+
u.push([x(), A()]);
|
|
2426
|
+
break;
|
|
2427
|
+
case 3:
|
|
2428
|
+
case 12:
|
|
2429
|
+
u.push([P(), A()]);
|
|
2430
|
+
break;
|
|
2431
|
+
case 4:
|
|
2432
|
+
case 11:
|
|
2433
|
+
u.push([A(), w()]);
|
|
2434
|
+
break;
|
|
2435
|
+
case 6:
|
|
2436
|
+
case 9:
|
|
2437
|
+
u.push([x(), w()]);
|
|
2438
|
+
break;
|
|
2439
|
+
case 7:
|
|
2440
|
+
case 8:
|
|
2441
|
+
u.push([P(), w()]);
|
|
2442
|
+
break;
|
|
2443
|
+
case 5:
|
|
2444
|
+
b ? u.push([P(), w()], [x(), A()]) : u.push([P(), x()], [A(), w()]);
|
|
2445
|
+
break;
|
|
2446
|
+
case 10:
|
|
2447
|
+
b ? u.push([P(), x()], [A(), w()]) : u.push([P(), w()], [x(), A()]);
|
|
2448
|
+
break;
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
const d = Cs(u);
|
|
2452
|
+
return e.smooth === !1 ? d : d.map((f) => ce(ce(f)));
|
|
2453
|
+
}
|
|
2454
|
+
function Cs(t) {
|
|
2455
|
+
const e = (a) => `${Math.round(a.x * 1e3)},${Math.round(a.y * 1e3)}`, n = /* @__PURE__ */ new Map();
|
|
2456
|
+
t.forEach(([a, o], i) => {
|
|
2457
|
+
for (const c of [a, o]) {
|
|
2458
|
+
const h = e(c);
|
|
2459
|
+
n.has(h) || n.set(h, []), n.get(h).push(i);
|
|
2460
|
+
}
|
|
2461
|
+
});
|
|
2462
|
+
const s = new Array(t.length).fill(!1), r = [];
|
|
2463
|
+
for (let a = 0; a < t.length; a++) {
|
|
2464
|
+
if (s[a]) continue;
|
|
2465
|
+
s[a] = !0;
|
|
2466
|
+
const o = [t[a][0], t[a][1]];
|
|
2467
|
+
let i = t[a][1];
|
|
2468
|
+
for (; ; ) {
|
|
2469
|
+
const c = (n.get(e(i)) ?? []).find((u) => !s[u]);
|
|
2470
|
+
if (c === void 0) break;
|
|
2471
|
+
s[c] = !0;
|
|
2472
|
+
const [h, l] = t[c];
|
|
2473
|
+
if (i = e(h) === e(i) ? l : h, e(i) === e(o[0])) break;
|
|
2474
|
+
o.push(i);
|
|
2475
|
+
}
|
|
2476
|
+
o.length >= 3 && r.push(o);
|
|
2477
|
+
}
|
|
2478
|
+
return r;
|
|
2479
|
+
}
|
|
2480
|
+
function ce(t) {
|
|
2481
|
+
const e = [];
|
|
2482
|
+
for (let n = 0; n < t.length; n++) {
|
|
2483
|
+
const s = t[n], r = t[(n + 1) % t.length];
|
|
2484
|
+
e.push({ x: s.x * 0.75 + r.x * 0.25, y: s.y * 0.75 + r.y * 0.25 }, { x: s.x * 0.25 + r.x * 0.75, y: s.y * 0.25 + r.y * 0.75 });
|
|
2485
|
+
}
|
|
2486
|
+
return e;
|
|
2487
|
+
}
|
|
2488
|
+
function ta(t) {
|
|
2489
|
+
const e = Math.min(1, Math.max(0, t.progress));
|
|
2490
|
+
if (e <= 0) return [];
|
|
2491
|
+
const n = t.width / 2, s = n * (0.55 + 0.75 * e), r = Math.max(t.length * e, s * 1.2), a = t.x, o = t.y + r - s, i = Math.max(0.1, n * (0.35 - 0.3 * e)), c = o - Math.sqrt(Math.max(0, s * s - i * i)), h = Math.max(0, c - t.y), l = 8, u = [], d = [];
|
|
2492
|
+
for (let g = 0; g <= l; g++) {
|
|
2493
|
+
const _ = g / l, k = i + (n - i) * Math.pow(1 - _, 1.6 + 1.4 * e);
|
|
2494
|
+
u.push({ x: a - k, y: t.y + h * _ }), d.push({ x: a + k, y: t.y + h * _ });
|
|
2495
|
+
}
|
|
2496
|
+
const f = Math.max(8, Math.round(t.segments ?? 12)), p = Math.acos(Math.min(1, i / s)), m = -p, M = Math.PI + p, y = [];
|
|
2497
|
+
for (let g = 1; g < f; g++) {
|
|
2498
|
+
const _ = m + (M - m) * g / f;
|
|
2499
|
+
y.push({ x: a + Math.cos(_) * s, y: o + Math.sin(_) * s });
|
|
2500
|
+
}
|
|
2501
|
+
return [...d, ...y, ...u.reverse()];
|
|
2502
|
+
}
|
|
2503
|
+
function ea(t) {
|
|
2504
|
+
const e = Math.min(1, Math.max(0, t.grow ?? 1)), n = e >= 1 ? 1 : 1 - Math.pow(1 - e, 3) + 0.08 * Math.sin(e * Math.PI) * e, s = t.r * Math.max(0, n);
|
|
2505
|
+
if (s <= 0) return [];
|
|
2506
|
+
const r = Math.max(12, Math.round(t.segments ?? 48)), a = t.wobble ?? 0.05, o = t.time ?? 0, i = t.period ? o / t.period : o / 2500, c = (i - Math.floor(i)) * Math.PI * 2, h = t.seed ?? 0, l = [];
|
|
2507
|
+
for (let u = 0; u < r; u++) {
|
|
2508
|
+
const d = u / r * Math.PI * 2, f = 1 + a * (Math.sin(2 * d + c + h) * 0.6 + Math.sin(3 * d - 2 * c + h * 1.7) * 0.4);
|
|
2509
|
+
l.push({ x: t.x + Math.cos(d) * s * f, y: t.y + Math.sin(d) * s * f });
|
|
2510
|
+
}
|
|
2511
|
+
return l;
|
|
2512
|
+
}
|
|
2513
|
+
function na(t) {
|
|
2514
|
+
const e = t.progress;
|
|
2515
|
+
if (e <= 0 || e >= 1) return [];
|
|
2516
|
+
const n = Math.max(3, Math.round(t.pieces ?? 8)), s = [], r = t.r * (1 + 1.2 * e), a = Math.PI * 2 / n * 0.6 * (1 - e);
|
|
2517
|
+
for (let o = 0; o < n; o++) {
|
|
2518
|
+
const i = o / n * Math.PI * 2 + 0.3, c = [];
|
|
2519
|
+
for (let h = 0; h <= 4; h++) {
|
|
2520
|
+
const l = i - a / 2 + a * h / 4;
|
|
2521
|
+
c.push({ x: t.x + Math.cos(l) * r, y: t.y + Math.sin(l) * r });
|
|
2522
|
+
}
|
|
2523
|
+
s.push(c);
|
|
2524
|
+
}
|
|
2525
|
+
return s;
|
|
2526
|
+
}
|
|
2527
|
+
function sa(t, e = {}) {
|
|
2528
|
+
const n = Math.max(0.05, 1 + t);
|
|
2529
|
+
return { sx: e.keep === "volume" ? 1 / Math.sqrt(n) : 1 / n, sy: n };
|
|
2530
|
+
}
|
|
2531
|
+
function ra(t, e, n = { x: 0, y: 0 }) {
|
|
2532
|
+
return t.map((s) => ({ x: n.x + (s.x - n.x) * e.sx, y: n.y + (s.y - n.y) * e.sy }));
|
|
2533
|
+
}
|
|
2534
|
+
function Ds(t, e) {
|
|
2211
2535
|
return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
|
|
2212
2536
|
}
|
|
2213
|
-
function
|
|
2537
|
+
function Xt(t, e) {
|
|
2214
2538
|
return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
|
|
2215
2539
|
}
|
|
2216
|
-
function
|
|
2540
|
+
function je(t, e) {
|
|
2217
2541
|
return [t[0] * e, t[1] * e, t[2] * e];
|
|
2218
2542
|
}
|
|
2219
|
-
function
|
|
2543
|
+
function ht(t, e) {
|
|
2220
2544
|
return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
|
|
2221
2545
|
}
|
|
2222
|
-
function
|
|
2546
|
+
function Rt(t, e) {
|
|
2223
2547
|
return [t[1] * e[2] - t[2] * e[1], t[2] * e[0] - t[0] * e[2], t[0] * e[1] - t[1] * e[0]];
|
|
2224
2548
|
}
|
|
2225
|
-
function
|
|
2549
|
+
function Yt(t) {
|
|
2226
2550
|
return Math.hypot(t[0], t[1], t[2]);
|
|
2227
2551
|
}
|
|
2228
|
-
function
|
|
2229
|
-
return
|
|
2552
|
+
function Es(t, e) {
|
|
2553
|
+
return Yt(Xt(t, e));
|
|
2230
2554
|
}
|
|
2231
|
-
function
|
|
2232
|
-
const e =
|
|
2233
|
-
return e === 0 ? [0, 0, 0] :
|
|
2555
|
+
function Ct(t) {
|
|
2556
|
+
const e = Yt(t);
|
|
2557
|
+
return e === 0 ? [0, 0, 0] : je(t, 1 / e);
|
|
2234
2558
|
}
|
|
2235
|
-
function
|
|
2559
|
+
function Ls(t, e, n) {
|
|
2236
2560
|
return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
|
|
2237
2561
|
}
|
|
2238
|
-
const
|
|
2562
|
+
const aa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2239
2563
|
__proto__: null,
|
|
2240
|
-
add:
|
|
2241
|
-
cross:
|
|
2242
|
-
distance:
|
|
2243
|
-
dot:
|
|
2244
|
-
length:
|
|
2245
|
-
lerp:
|
|
2246
|
-
normalize:
|
|
2247
|
-
scale:
|
|
2248
|
-
subtract:
|
|
2249
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2250
|
-
function
|
|
2564
|
+
add: Ds,
|
|
2565
|
+
cross: Rt,
|
|
2566
|
+
distance: Es,
|
|
2567
|
+
dot: ht,
|
|
2568
|
+
length: Yt,
|
|
2569
|
+
lerp: Ls,
|
|
2570
|
+
normalize: Ct,
|
|
2571
|
+
scale: je,
|
|
2572
|
+
subtract: Xt
|
|
2573
|
+
}, Symbol.toStringTag, { value: "Module" })), Fs = Math.PI / 180;
|
|
2574
|
+
function Os() {
|
|
2251
2575
|
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
2252
2576
|
}
|
|
2253
|
-
function
|
|
2577
|
+
function Ns(t, e) {
|
|
2254
2578
|
const n = new Array(16);
|
|
2255
2579
|
for (let s = 0; s < 4; s++)
|
|
2256
2580
|
for (let r = 0; r < 4; r++) {
|
|
2257
|
-
let
|
|
2258
|
-
for (let
|
|
2259
|
-
n[s * 4 + r] =
|
|
2581
|
+
let a = 0;
|
|
2582
|
+
for (let o = 0; o < 4; o++) a += t[o * 4 + r] * e[s * 4 + o];
|
|
2583
|
+
n[s * 4 + r] = a;
|
|
2260
2584
|
}
|
|
2261
2585
|
return n;
|
|
2262
2586
|
}
|
|
2263
|
-
function
|
|
2587
|
+
function Xs(t) {
|
|
2264
2588
|
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t[0], t[1], t[2], 1];
|
|
2265
2589
|
}
|
|
2266
|
-
function
|
|
2590
|
+
function Ys(t) {
|
|
2267
2591
|
return [t[0], 0, 0, 0, 0, t[1], 0, 0, 0, 0, t[2], 0, 0, 0, 0, 1];
|
|
2268
2592
|
}
|
|
2269
|
-
function
|
|
2593
|
+
function Ue(t) {
|
|
2270
2594
|
const [e, n, s, r] = t;
|
|
2271
2595
|
return [
|
|
2272
2596
|
1 - 2 * (n * n + s * s),
|
|
@@ -2287,214 +2611,248 @@ function De(t) {
|
|
|
2287
2611
|
1
|
|
2288
2612
|
];
|
|
2289
2613
|
}
|
|
2290
|
-
function
|
|
2291
|
-
const s =
|
|
2614
|
+
function zs(t, e, n) {
|
|
2615
|
+
const s = Ue(e);
|
|
2292
2616
|
for (let r = 0; r < 3; r++)
|
|
2293
2617
|
s[r] *= n[0], s[4 + r] *= n[1], s[8 + r] *= n[2];
|
|
2294
2618
|
return s[12] = t[0], s[13] = t[1], s[14] = t[2], s;
|
|
2295
2619
|
}
|
|
2296
|
-
function
|
|
2620
|
+
function js(t) {
|
|
2297
2621
|
const e = new Array(16);
|
|
2298
2622
|
for (let n = 0; n < 4; n++) for (let s = 0; s < 4; s++) e[s * 4 + n] = t[n * 4 + s];
|
|
2299
2623
|
return e;
|
|
2300
2624
|
}
|
|
2301
|
-
function
|
|
2302
|
-
const [e, n, s, r,
|
|
2625
|
+
function Us(t) {
|
|
2626
|
+
const [e, n, s, r, a, o, i, c, h, l, u, d, f, p, m, M] = t, y = e * o - n * a, g = e * i - s * a, _ = e * c - r * a, k = n * i - s * o, x = n * c - r * o, A = s * c - r * i, w = h * p - l * f, P = h * m - u * f, b = h * M - d * f, T = l * m - u * p, v = l * M - d * p, S = u * M - d * m, $ = y * S - g * v + _ * T + k * b - x * P + A * w;
|
|
2303
2627
|
if (Math.abs($) < 1e-12) return null;
|
|
2304
|
-
const
|
|
2628
|
+
const I = 1 / $;
|
|
2305
2629
|
return [
|
|
2306
|
-
(
|
|
2307
|
-
(s *
|
|
2308
|
-
(
|
|
2309
|
-
(u *
|
|
2310
|
-
(i *
|
|
2311
|
-
(e * S - s *
|
|
2312
|
-
(
|
|
2313
|
-
(
|
|
2314
|
-
(
|
|
2315
|
-
(n *
|
|
2316
|
-
(
|
|
2317
|
-
(
|
|
2318
|
-
(
|
|
2319
|
-
(e * T - n *
|
|
2320
|
-
(
|
|
2321
|
-
(
|
|
2630
|
+
(o * S - i * v + c * T) * I,
|
|
2631
|
+
(s * v - n * S - r * T) * I,
|
|
2632
|
+
(p * A - m * x + M * k) * I,
|
|
2633
|
+
(u * x - l * A - d * k) * I,
|
|
2634
|
+
(i * b - a * S - c * P) * I,
|
|
2635
|
+
(e * S - s * b + r * P) * I,
|
|
2636
|
+
(m * _ - f * A - M * g) * I,
|
|
2637
|
+
(h * A - u * _ + d * g) * I,
|
|
2638
|
+
(a * v - o * b + c * w) * I,
|
|
2639
|
+
(n * b - e * v - r * w) * I,
|
|
2640
|
+
(f * x - p * _ + M * y) * I,
|
|
2641
|
+
(l * _ - h * x - d * y) * I,
|
|
2642
|
+
(o * P - a * T - i * w) * I,
|
|
2643
|
+
(e * T - n * P + s * w) * I,
|
|
2644
|
+
(p * g - f * k - m * y) * I,
|
|
2645
|
+
(h * k - l * g + u * y) * I
|
|
2322
2646
|
];
|
|
2323
2647
|
}
|
|
2324
|
-
function
|
|
2325
|
-
const r = 1 / Math.tan(t *
|
|
2326
|
-
return [r / e, 0, 0, 0, 0, r, 0, 0, 0, 0, (s + n) *
|
|
2648
|
+
function Vs(t, e, n, s) {
|
|
2649
|
+
const r = 1 / Math.tan(t * Fs / 2), a = 1 / (n - s);
|
|
2650
|
+
return [r / e, 0, 0, 0, 0, r, 0, 0, 0, 0, (s + n) * a, -1, 0, 0, 2 * s * n * a, 0];
|
|
2327
2651
|
}
|
|
2328
|
-
function
|
|
2329
|
-
const
|
|
2330
|
-
return [2 *
|
|
2652
|
+
function Bs(t, e, n, s, r, a) {
|
|
2653
|
+
const o = 1 / (e - t), i = 1 / (s - n), c = 1 / (a - r);
|
|
2654
|
+
return [2 * o, 0, 0, 0, 0, 2 * i, 0, 0, 0, 0, -2 * c, 0, -(e + t) * o, -(s + n) * i, -(a + r) * c, 1];
|
|
2331
2655
|
}
|
|
2332
|
-
function
|
|
2333
|
-
const s =
|
|
2656
|
+
function Hs(t, e, n = [0, 1, 0]) {
|
|
2657
|
+
const s = Ct(Xt(t, e)), r = Ct(Rt(n, s)), a = Rt(s, r);
|
|
2334
2658
|
return [
|
|
2335
2659
|
r[0],
|
|
2336
|
-
|
|
2660
|
+
a[0],
|
|
2337
2661
|
s[0],
|
|
2338
2662
|
0,
|
|
2339
2663
|
r[1],
|
|
2340
|
-
|
|
2664
|
+
a[1],
|
|
2341
2665
|
s[1],
|
|
2342
2666
|
0,
|
|
2343
2667
|
r[2],
|
|
2344
|
-
|
|
2668
|
+
a[2],
|
|
2345
2669
|
s[2],
|
|
2346
2670
|
0,
|
|
2347
|
-
-
|
|
2348
|
-
-
|
|
2349
|
-
-
|
|
2671
|
+
-ht(r, t),
|
|
2672
|
+
-ht(a, t),
|
|
2673
|
+
-ht(s, t),
|
|
2350
2674
|
1
|
|
2351
2675
|
];
|
|
2352
2676
|
}
|
|
2353
|
-
function
|
|
2354
|
-
const n = t[0] * e[0] + t[4] * e[1] + t[8] * e[2] + t[12], s = t[1] * e[0] + t[5] * e[1] + t[9] * e[2] + t[13], r = t[2] * e[0] + t[6] * e[1] + t[10] * e[2] + t[14],
|
|
2355
|
-
return
|
|
2677
|
+
function qs(t, e) {
|
|
2678
|
+
const n = t[0] * e[0] + t[4] * e[1] + t[8] * e[2] + t[12], s = t[1] * e[0] + t[5] * e[1] + t[9] * e[2] + t[13], r = t[2] * e[0] + t[6] * e[1] + t[10] * e[2] + t[14], a = t[3] * e[0] + t[7] * e[1] + t[11] * e[2] + t[15];
|
|
2679
|
+
return a === 1 || a === 0 ? [n, s, r] : [n / a, s / a, r / a];
|
|
2356
2680
|
}
|
|
2357
|
-
const
|
|
2681
|
+
const oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2358
2682
|
__proto__: null,
|
|
2359
|
-
compose:
|
|
2360
|
-
fromQuat:
|
|
2361
|
-
identity:
|
|
2362
|
-
invert:
|
|
2363
|
-
lookAt:
|
|
2364
|
-
multiply:
|
|
2365
|
-
orthographic:
|
|
2366
|
-
perspective:
|
|
2367
|
-
scaling:
|
|
2368
|
-
transformPoint:
|
|
2369
|
-
translation:
|
|
2370
|
-
transpose:
|
|
2683
|
+
compose: zs,
|
|
2684
|
+
fromQuat: Ue,
|
|
2685
|
+
identity: Os,
|
|
2686
|
+
invert: Us,
|
|
2687
|
+
lookAt: Hs,
|
|
2688
|
+
multiply: Ns,
|
|
2689
|
+
orthographic: Bs,
|
|
2690
|
+
perspective: Vs,
|
|
2691
|
+
scaling: Ys,
|
|
2692
|
+
transformPoint: qs,
|
|
2693
|
+
translation: Xs,
|
|
2694
|
+
transpose: js
|
|
2371
2695
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2372
2696
|
export {
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2697
|
+
Gs as Clock,
|
|
2698
|
+
ke as DEFAULT_BAKE_INTERVAL_MS,
|
|
2699
|
+
Bt as DEFAULT_INERTIA_FRICTION,
|
|
2376
2700
|
L as DEFAULT_SPRING,
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2701
|
+
Vt as FORMAT_VERSION,
|
|
2702
|
+
Br as IDENTITY_SIMILARITY,
|
|
2703
|
+
en as INERTIA_MAX_DURATION_MS,
|
|
2704
|
+
ns as InertiaTrackPlayer,
|
|
2705
|
+
ar as MORPH_SAMPLES,
|
|
2706
|
+
Qs as ManualClock,
|
|
2707
|
+
de as SPRING_MAX_DURATION_MS,
|
|
2708
|
+
Ks as SPRING_PRESETS,
|
|
2709
|
+
et as SPRING_STEP_MS,
|
|
2710
|
+
lt as SpringSampler,
|
|
2711
|
+
es as SpringTrackPlayer,
|
|
2712
|
+
Pe as Timeline,
|
|
2713
|
+
ut as TrackPlayer,
|
|
2714
|
+
gr as ValueResolver,
|
|
2715
|
+
Ne as applySimilarity,
|
|
2716
|
+
Nr as audioEnvelope,
|
|
2717
|
+
pn as backOut,
|
|
2718
|
+
Kn as bakeEasing,
|
|
2719
|
+
ve as bakeInertiaTrack,
|
|
2720
|
+
we as bakeSpringTrack,
|
|
2721
|
+
gt as beatAtTime,
|
|
2722
|
+
pt as beatLength,
|
|
2723
|
+
Lr as beatPeriod,
|
|
2724
|
+
Or as beatPulse,
|
|
2725
|
+
Ot as beatTime,
|
|
2726
|
+
vr as beatsBetween,
|
|
2727
|
+
mn as bounceOut,
|
|
2728
|
+
ea as bubblePath,
|
|
2729
|
+
na as bubblePop,
|
|
2730
|
+
Sr as cameraTracks,
|
|
2731
|
+
rs as charactersFor,
|
|
2732
|
+
or as clearMorphCache,
|
|
2733
|
+
sr as clearPathCache,
|
|
2734
|
+
ws as closestName,
|
|
2735
|
+
qr as composeSimilarity,
|
|
2736
|
+
fn as createCubicBezier,
|
|
2737
|
+
$e as createRandom,
|
|
2738
|
+
ts as createTrack,
|
|
2739
|
+
er as criticalDamping,
|
|
2740
|
+
Er as curve,
|
|
2741
|
+
Mr as customBounce,
|
|
2742
|
+
yr as customEase,
|
|
2743
|
+
xr as customWiggle,
|
|
2744
|
+
ls as deserializeTimeline,
|
|
2745
|
+
us as deserializeTrack,
|
|
2746
|
+
Ar as detectTempo,
|
|
2747
|
+
ta as dripPath,
|
|
2748
|
+
cn as easeIn,
|
|
2749
|
+
me as easeInCubic,
|
|
2750
|
+
hn as easeInOut,
|
|
2751
|
+
ge as easeInOutCubic,
|
|
2752
|
+
on as easeInOutQuad,
|
|
2753
|
+
rn as easeInQuad,
|
|
2754
|
+
un as easeOut,
|
|
2755
|
+
pe as easeOutCubic,
|
|
2756
|
+
an as easeOutQuad,
|
|
2757
|
+
ks as editDistance,
|
|
2758
|
+
dn as elasticOut,
|
|
2759
|
+
Xr as envelopeAt,
|
|
2760
|
+
Zn as expandParametricEasings,
|
|
2761
|
+
ue as formatVersionFor,
|
|
2762
|
+
dr as fromJSON,
|
|
2763
|
+
Lt as getEasingFunction,
|
|
2764
|
+
Te as getInterpolator,
|
|
2765
|
+
Se as getMotionPathPoint,
|
|
2766
|
+
rr as getPathLength,
|
|
2767
|
+
An as getPointAtProgress,
|
|
2768
|
+
Qe as hasKeyframes,
|
|
2769
|
+
fs as hashSeed,
|
|
2770
|
+
Ge as heldTime,
|
|
2771
|
+
mt as inertiaDuration,
|
|
2772
|
+
dt as inertiaRest,
|
|
2773
|
+
St as inertiaValueAt,
|
|
2774
|
+
nr as inertiaVelocityAt,
|
|
2775
|
+
Wn as interpolateArray,
|
|
2776
|
+
qn as interpolateColor,
|
|
2777
|
+
hr as interpolateMotionPath,
|
|
2443
2778
|
N as interpolateNumber,
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2779
|
+
Gn as interpolatePathString,
|
|
2780
|
+
Qn as interpolateQuaternion,
|
|
2781
|
+
ae as interpolateString,
|
|
2782
|
+
Wr as invertSimilarity,
|
|
2783
|
+
We as isCubicBezierEasing,
|
|
2784
|
+
U as isInertiaTrack,
|
|
2785
|
+
Ws as isMotionPathPoint,
|
|
2786
|
+
he as isMotionPathTrack,
|
|
2787
|
+
At as isParametricEasing,
|
|
2788
|
+
Xn as isPathData,
|
|
2453
2789
|
V as isSpringTrack,
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2790
|
+
Dt as isTextTrack,
|
|
2791
|
+
tr as isUnderdamped,
|
|
2792
|
+
pr as isUnresolved,
|
|
2793
|
+
Xe as isoDepth,
|
|
2794
|
+
Ye as isometricBoxFaces,
|
|
2795
|
+
ze as isometricFaces,
|
|
2796
|
+
Pt as linear,
|
|
2797
|
+
Fr as loopBeats,
|
|
2798
|
+
Rr as loopEase,
|
|
2799
|
+
Cr as loopNoise,
|
|
2800
|
+
oa as mat4,
|
|
2801
|
+
Ke as maxStaggerDistance,
|
|
2802
|
+
Jr as metaballContours,
|
|
2803
|
+
Rs as metaballField,
|
|
2804
|
+
Nn as morphPath,
|
|
2805
|
+
br as narrationMarkers,
|
|
2806
|
+
Tr as narrationSceneAt,
|
|
2807
|
+
nn as naturalRest,
|
|
2808
|
+
kr as nearestBeat,
|
|
2809
|
+
wr as nextBeat,
|
|
2810
|
+
yn as parametricEasing,
|
|
2811
|
+
Q as parsePath,
|
|
2812
|
+
Zr as penroseStairs,
|
|
2813
|
+
Kr as penroseTriangle,
|
|
2814
|
+
K as phaseOf,
|
|
2815
|
+
Le as pingPong,
|
|
2816
|
+
_r as planNarration,
|
|
2817
|
+
lr as playheadCrossings,
|
|
2818
|
+
ye as pointAtDistance,
|
|
2819
|
+
Yr as pointsToPath,
|
|
2820
|
+
Qr as powSimilarity,
|
|
2821
|
+
Nt as projectIsometric,
|
|
2822
|
+
ir as quat,
|
|
2823
|
+
Re as randomBetween,
|
|
2824
|
+
mr as randomChoice,
|
|
2825
|
+
ds as randomSnapped,
|
|
2826
|
+
ms as resolveSequence,
|
|
2827
|
+
Ee as resolveValue,
|
|
2828
|
+
Ur as ribbon,
|
|
2829
|
+
Vr as ribbonHeadCap,
|
|
2830
|
+
ra as scalePoints,
|
|
2831
|
+
hs as serializeTimeline,
|
|
2832
|
+
cs as serializeTrack,
|
|
2833
|
+
zr as shapeToPathData,
|
|
2834
|
+
Hr as similarity,
|
|
2835
|
+
Is as similarityAbout,
|
|
2836
|
+
$s as similarityFixedPoint,
|
|
2837
|
+
Gr as similarityMatrix,
|
|
2838
|
+
Jn as simplifyKeyframes,
|
|
2839
|
+
Js as springDuration,
|
|
2840
|
+
Ir as springFollow,
|
|
2841
|
+
Zs as springValueAt,
|
|
2842
|
+
sa as squashStretch,
|
|
2843
|
+
le as staggerDistance,
|
|
2844
|
+
fe as staggerOffset,
|
|
2845
|
+
Ze as staggerOffsets,
|
|
2846
|
+
Et as staggerSpan,
|
|
2847
|
+
gn as stepsEasing,
|
|
2848
|
+
os as textAt,
|
|
2849
|
+
fr as toJSON,
|
|
2850
|
+
cr as toKeyframedTrack,
|
|
2851
|
+
ur as toKeyframedTracks,
|
|
2852
|
+
Dr as torusNoise,
|
|
2853
|
+
j as trackTargets,
|
|
2854
|
+
jr as trailSamples,
|
|
2855
|
+
Pr as unknownName,
|
|
2856
|
+
aa as vec3,
|
|
2857
|
+
$r as wobble
|
|
2500
2858
|
};
|