@algorisys/tinyfly 0.118.0 → 0.120.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 +6 -6
- package/docs/editor-guide.md +1 -1
- 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 +5 -1
- package/docs/maps.md +2 -2
- package/docs/math.md +89 -7
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +1852 -1844
- package/lib/addons/math.js +2229 -1533
- package/lib/browser/tinyfly-math.iife.js +4 -4
- package/lib/browser/tinyfly.iife.js +11 -11
- package/lib/browser/tinyfly.js +438 -430
- package/lib/browser/tinyfly.umd.js +11 -11
- package/lib/types/math/figure/display-list.d.ts +2 -0
- package/lib/types/math/figure/figure-spec.d.ts +101 -1
- package/lib/types/math/figure/items/ml.d.ts +47 -0
- package/lib/types/math/index.d.ts +8 -0
- package/lib/types/math/ml/classify.d.ts +30 -0
- package/lib/types/math/ml/colormap.d.ts +14 -0
- package/lib/types/math/ml/contours.d.ts +15 -0
- package/lib/types/math/ml/descent.d.ts +11 -0
- package/lib/types/math/ml/kmeans.d.ts +11 -0
- package/lib/types/math/ml/network.d.ts +19 -0
- package/lib/types/math/presets/ml.d.ts +50 -0
- package/lib/types/math/surface/math-surface.d.ts +69 -0
- package/llms-full.txt +110 -16
- package/llms.txt +31 -31
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +4 -1
package/lib/browser/tinyfly.js
CHANGED
|
@@ -20,13 +20,13 @@ function kn(t) {
|
|
|
20
20
|
function bu(t) {
|
|
21
21
|
return t.property === "motionPath" && "motionPathConfig" in t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function G3(t) {
|
|
24
24
|
return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
|
|
25
25
|
}
|
|
26
26
|
function Dg(t) {
|
|
27
27
|
return "keyframes" in t;
|
|
28
28
|
}
|
|
29
|
-
class
|
|
29
|
+
class U3 {
|
|
30
30
|
_currentTime = 0;
|
|
31
31
|
_isRunning = !1;
|
|
32
32
|
onTick = null;
|
|
@@ -285,14 +285,14 @@ function tS(t, e) {
|
|
|
285
285
|
const n = _r(t), s = oo(t);
|
|
286
286
|
return e >= ro(t) ? 0 : (s - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
|
|
287
287
|
}
|
|
288
|
-
const pa = (t) => t, Xg = (t) => t * t,
|
|
288
|
+
const pa = (t) => t, Xg = (t) => t * t, Gg = (t) => 1 - (1 - t) * (1 - t), Ug = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, Mu = (t) => t * t * t, xu = (t) => 1 - Math.pow(1 - t, 3), Cr = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Vg = Mu, Jg = xu, Zg = Cr, Qg = {
|
|
289
289
|
linear: pa,
|
|
290
290
|
"ease-in": Vg,
|
|
291
291
|
"ease-out": Jg,
|
|
292
292
|
"ease-in-out": Zg,
|
|
293
293
|
"ease-in-quad": Xg,
|
|
294
|
-
"ease-out-quad":
|
|
295
|
-
"ease-in-out-quad":
|
|
294
|
+
"ease-out-quad": Gg,
|
|
295
|
+
"ease-in-out-quad": Ug,
|
|
296
296
|
"ease-in-cubic": Mu,
|
|
297
297
|
"ease-out-cubic": xu,
|
|
298
298
|
"ease-in-out-cubic": Cr
|
|
@@ -448,12 +448,12 @@ function up(t, e, n, s, o, r, i, a, l) {
|
|
|
448
448
|
}, tt = (R) => {
|
|
449
449
|
const D = -c * Math.sin(R), Y = h * Math.cos(R);
|
|
450
450
|
return [d * D - f * Y, f * D + d * Y];
|
|
451
|
-
},
|
|
451
|
+
}, U = [];
|
|
452
452
|
for (let R = 0; R < C; R++) {
|
|
453
453
|
const D = P + R * W, Y = D + W, [_, j] = V(D), [nt, $] = R === C - 1 ? [a, l] : V(Y), [I, B] = tt(D), [K, L] = tt(Y);
|
|
454
|
-
|
|
454
|
+
U.push([_ + q * I, j + q * B, nt - q * K, $ - q * L, nt, $]);
|
|
455
455
|
}
|
|
456
|
-
return
|
|
456
|
+
return U;
|
|
457
457
|
}
|
|
458
458
|
function De(t, e, n, s, o) {
|
|
459
459
|
const r = 1 - o;
|
|
@@ -770,14 +770,14 @@ const Dn = Math.PI / 180, Ap = 0.9995;
|
|
|
770
770
|
function ul() {
|
|
771
771
|
return [0, 0, 0, 1];
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Ut(t, e) {
|
|
774
774
|
const n = Math.hypot(t[0], t[1], t[2]);
|
|
775
775
|
if (n === 0) return ul();
|
|
776
776
|
const s = e * Dn / 2, o = Math.sin(s) / n;
|
|
777
777
|
return [t[0] * o, t[1] * o, t[2] * o, Math.cos(s)];
|
|
778
778
|
}
|
|
779
779
|
function $p(t, e, n) {
|
|
780
|
-
return ya(ya(
|
|
780
|
+
return ya(ya(Ut([0, 1, 0], e), Ut([1, 0, 0], t)), Ut([0, 0, 1], n));
|
|
781
781
|
}
|
|
782
782
|
function Pp(t) {
|
|
783
783
|
const [e, n, s, o] = Ye(t), r = 2 * (e * s + n * o), i = 2 * (e * n + s * o), a = 1 - 2 * (e * e + s * s), l = 2 * (n * s - e * o), c = 1 - 2 * (n * n + s * s), h = 2 * (e * s - n * o), u = 1 - 2 * (e * e + n * n), d = Math.asin(Math.max(-1, Math.min(1, -l)));
|
|
@@ -831,7 +831,7 @@ const rS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
831
831
|
__proto__: null,
|
|
832
832
|
conjugate: Op,
|
|
833
833
|
dot: Tu,
|
|
834
|
-
fromAxisAngle:
|
|
834
|
+
fromAxisAngle: Ut,
|
|
835
835
|
fromEuler: $p,
|
|
836
836
|
identity: ul,
|
|
837
837
|
length: Eu,
|
|
@@ -1651,7 +1651,7 @@ function ve(t) {
|
|
|
1651
1651
|
...t.stagger !== void 0 && { stagger: { ...t.stagger } }
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1654
|
+
function Gp(t) {
|
|
1655
1655
|
if (wn(t)) {
|
|
1656
1656
|
const e = t;
|
|
1657
1657
|
return {
|
|
@@ -1705,7 +1705,7 @@ function Up(t) {
|
|
|
1705
1705
|
...ve(t)
|
|
1706
1706
|
});
|
|
1707
1707
|
}
|
|
1708
|
-
function
|
|
1708
|
+
function Up(t) {
|
|
1709
1709
|
const e = t._config.markers;
|
|
1710
1710
|
return {
|
|
1711
1711
|
formatVersion: yu(t.tracks),
|
|
@@ -1734,12 +1734,12 @@ function zs(t) {
|
|
|
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(Gp),
|
|
1738
1738
|
captions: t.captions
|
|
1739
1739
|
});
|
|
1740
1740
|
}
|
|
1741
1741
|
function cS(t) {
|
|
1742
|
-
return JSON.stringify(
|
|
1742
|
+
return JSON.stringify(Up(t));
|
|
1743
1743
|
}
|
|
1744
1744
|
function hS(t) {
|
|
1745
1745
|
const e = JSON.parse(t);
|
|
@@ -2398,7 +2398,7 @@ function Xu(t, e = {}) {
|
|
|
2398
2398
|
];
|
|
2399
2399
|
return t.hide ? u.filter((d) => !t.hide.includes(d.side)) : u;
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2401
|
+
function Gu(t, e = {}) {
|
|
2402
2402
|
return t.map((n) => ({ box: n, depth: Ku([(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 }) => Xu(n, e));
|
|
2403
2403
|
}
|
|
2404
2404
|
function jS(t = {}) {
|
|
@@ -2407,7 +2407,7 @@ function jS(t = {}) {
|
|
|
2407
2407
|
{ tag: 1, min: [e - s, -s, -s], max: [e + s, e - s, s] },
|
|
2408
2408
|
{ tag: 2, min: [e - s, e - s, -s], max: [e + s, e + s, e] }
|
|
2409
2409
|
], r = t.centre ?? { x: 0, y: 0 }, i = gl([2 * e / 3, e / 3, e / 3], { scale: t.scale }), a = { centre: { x: r.x - i.x, y: r.y - i.y }, scale: t.scale };
|
|
2410
|
-
return { boxes: o, faces: [...
|
|
2410
|
+
return { boxes: o, faces: [...Gu(o, a), ...Xu({ ...o[0], hide: ["right"] }, a)] };
|
|
2411
2411
|
}
|
|
2412
2412
|
function YS(t = {}) {
|
|
2413
2413
|
const e = Math.max(2, Math.round(t.steps ?? 8)), n = t.tread ?? 1.5, s = t.rise ?? 0.25, o = t.width ?? 3, r = t.base ?? 1.5, i = Math.max(1, Math.round(e * (n - 2 * s) / (n + 2 * s))), a = 2 * (e + i), l = n * (e - i) / a, c = [
|
|
@@ -2429,7 +2429,7 @@ function YS(t = {}) {
|
|
|
2429
2429
|
u = [u[0] + y.dir[0] * y.count * n, u[1] + y.dir[1] * y.count * n, 0];
|
|
2430
2430
|
}
|
|
2431
2431
|
const f = a * l, p = t.centre ?? { x: 0, y: 0 }, g = gl([e * n / 2, e * n / 2, f / 2 + r], { scale: t.scale }), m = { centre: { x: p.x - g.x, y: p.y - g.y }, scale: t.scale };
|
|
2432
|
-
return { boxes: h, faces:
|
|
2432
|
+
return { boxes: h, faces: Gu(h, m), rise: l };
|
|
2433
2433
|
}
|
|
2434
2434
|
function km(t, e, n) {
|
|
2435
2435
|
let s = 0;
|
|
@@ -2542,7 +2542,7 @@ function XS(t) {
|
|
|
2542
2542
|
}
|
|
2543
2543
|
return [...d, ...y, ...u.reverse()];
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2545
|
+
function GS(t) {
|
|
2546
2546
|
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);
|
|
2547
2547
|
if (s <= 0) return [];
|
|
2548
2548
|
const o = Math.max(12, Math.round(t.segments ?? 48)), r = t.wobble ?? 0.05, i = t.time ?? 0, a = t.period ? i / t.period : i / 2500, l = (a - Math.floor(a)) * Math.PI * 2, c = t.seed ?? 0, h = [];
|
|
@@ -2552,7 +2552,7 @@ function US(t) {
|
|
|
2552
2552
|
}
|
|
2553
2553
|
return h;
|
|
2554
2554
|
}
|
|
2555
|
-
function
|
|
2555
|
+
function US(t) {
|
|
2556
2556
|
const e = t.progress;
|
|
2557
2557
|
if (e <= 0 || e >= 1) return [];
|
|
2558
2558
|
const n = Math.max(3, Math.round(t.pieces ?? 8)), s = [], o = t.r * (1 + 1.2 * e), r = Math.PI * 2 / n * 0.6 * (1 - e);
|
|
@@ -2780,7 +2780,7 @@ function Am(t) {
|
|
|
2780
2780
|
zt({ type: "bounce", mode: "in" });
|
|
2781
2781
|
zt({ type: "bounce", mode: "in-out" });
|
|
2782
2782
|
function or(t) {
|
|
2783
|
-
const e =
|
|
2783
|
+
const e = Uu.get(t.trim().toLowerCase());
|
|
2784
2784
|
if (e) return e;
|
|
2785
2785
|
const n = Am(t), s = /^steps\(\s*(\d+)\s*\)$/.exec(n);
|
|
2786
2786
|
if (s) {
|
|
@@ -2797,9 +2797,9 @@ function or(t) {
|
|
|
2797
2797
|
}
|
|
2798
2798
|
return n in $c ? { easing: $c[n] } : n in bo ? { easing: { type: "cubic-bezier", points: bo[n] } } : { easing: "ease-out" };
|
|
2799
2799
|
}
|
|
2800
|
-
const
|
|
2800
|
+
const Uu = /* @__PURE__ */ new Map();
|
|
2801
2801
|
function yl(t, e) {
|
|
2802
|
-
return
|
|
2802
|
+
return Uu.set(
|
|
2803
2803
|
t.trim().toLowerCase(),
|
|
2804
2804
|
e.bezier ? { easing: { type: "cubic-bezier", points: e.bezier }, fn: e.fn } : { fn: e.fn, requiresBaking: "custom" }
|
|
2805
2805
|
), t;
|
|
@@ -3352,7 +3352,7 @@ class Xn {
|
|
|
3352
3352
|
from: C,
|
|
3353
3353
|
to: O,
|
|
3354
3354
|
velocity: Xm(w, A) ?? this.options.startVelocity?.(d[0], A) ?? 0
|
|
3355
|
-
}, tt = this.nextTrackId(`${d[0]}-${A}-spring`),
|
|
3355
|
+
}, tt = this.nextTrackId(`${d[0]}-${A}-spring`), U = {
|
|
3356
3356
|
id: tt,
|
|
3357
3357
|
target: d[0],
|
|
3358
3358
|
...d.length > 1 && { targets: d },
|
|
@@ -3362,7 +3362,7 @@ class Xn {
|
|
|
3362
3362
|
spring: V,
|
|
3363
3363
|
delay: f + p
|
|
3364
3364
|
};
|
|
3365
|
-
this.timeline.addTrack(
|
|
3365
|
+
this.timeline.addTrack(U), k.push(tt), b = Math.max(b, zg(V));
|
|
3366
3366
|
for (const R of d) this.lastValues.set(`${R}|${A}`, O);
|
|
3367
3367
|
continue;
|
|
3368
3368
|
}
|
|
@@ -3512,13 +3512,13 @@ function ui(t) {
|
|
|
3512
3512
|
}
|
|
3513
3513
|
return String(t ?? "");
|
|
3514
3514
|
}
|
|
3515
|
-
function
|
|
3515
|
+
function Gm(t) {
|
|
3516
3516
|
return new Xn(t);
|
|
3517
3517
|
}
|
|
3518
3518
|
function ws(t) {
|
|
3519
3519
|
return zm(Wm(t));
|
|
3520
3520
|
}
|
|
3521
|
-
function
|
|
3521
|
+
function Um(t) {
|
|
3522
3522
|
return !Array.isArray(t) || t.length !== 4 ? null : `matrix3d(${me(Ye(t)).map((n) => Math.round(n * 1e6) / 1e6 + 0).join(", ")})`;
|
|
3523
3523
|
}
|
|
3524
3524
|
const Vm = /* @__PURE__ */ new Set([
|
|
@@ -3723,7 +3723,7 @@ class pn {
|
|
|
3723
3723
|
* Build a transform function string for a property.
|
|
3724
3724
|
*/
|
|
3725
3725
|
buildTransformPart(e, n) {
|
|
3726
|
-
if (e === "quaternion") return
|
|
3726
|
+
if (e === "quaternion") return Um(n);
|
|
3727
3727
|
if (typeof n != "number") return null;
|
|
3728
3728
|
switch (e) {
|
|
3729
3729
|
case "x":
|
|
@@ -5406,7 +5406,7 @@ function mi(t, e) {
|
|
|
5406
5406
|
function Xy(t) {
|
|
5407
5407
|
return Math.round(t * 100) / 100;
|
|
5408
5408
|
}
|
|
5409
|
-
function
|
|
5409
|
+
function Gy(t, e) {
|
|
5410
5410
|
switch (e) {
|
|
5411
5411
|
// Play forward from wherever it is; reverse() flips a reversed timeline and plays.
|
|
5412
5412
|
// Neither restarts an animation that is already at that end.
|
|
@@ -5445,7 +5445,7 @@ function kl(t, e, n, s, o = () => {
|
|
|
5445
5445
|
const a = e.scrub === void 0 || e.scrub === !1 ? !1 : e.scrub, l = (e.toggleActions ?? "play none none none").trim().split(/\s+/);
|
|
5446
5446
|
let c = 0, h;
|
|
5447
5447
|
const u = (f, p) => () => {
|
|
5448
|
-
p?.(), n && !a &&
|
|
5448
|
+
p?.(), n && !a && Gy(n, l[f] ?? "none"), e.once && f === 0 && queueMicrotask(() => h.destroy());
|
|
5449
5449
|
}, d = e.containerAnimation ? Jy(t, e.containerAnimation, i, o) : void 0;
|
|
5450
5450
|
return h = new Nr({
|
|
5451
5451
|
trigger: i,
|
|
@@ -5457,7 +5457,7 @@ function kl(t, e, n, s, o = () => {
|
|
|
5457
5457
|
horizontal: e.horizontal,
|
|
5458
5458
|
pinSpacing: e.pinSpacing,
|
|
5459
5459
|
onRefresh: e.invalidateOnRefresh && n?.invalidate ? () => n.invalidate() : void 0,
|
|
5460
|
-
snap: e.snap === void 0 ? void 0 :
|
|
5460
|
+
snap: e.snap === void 0 ? void 0 : Uy(e.snap, n),
|
|
5461
5461
|
markers: e.markers,
|
|
5462
5462
|
container: d,
|
|
5463
5463
|
onUpdate: (f, p) => {
|
|
@@ -5473,7 +5473,7 @@ function kl(t, e, n, s, o = () => {
|
|
|
5473
5473
|
onLeaveBack: u(3, e.onLeaveBack)
|
|
5474
5474
|
}), n && a === !1 && n.progress(0), h.start(), t.own(h);
|
|
5475
5475
|
}
|
|
5476
|
-
function
|
|
5476
|
+
function Uy(t, e) {
|
|
5477
5477
|
const n = (o) => o === "labels" ? (r) => Vy(r, e?.labelProgresses?.() ?? []) : o;
|
|
5478
5478
|
if (typeof t != "object" || Array.isArray(t)) return n(t);
|
|
5479
5479
|
const s = t.ease ? or(t.ease) : void 0;
|
|
@@ -5881,7 +5881,7 @@ class _e {
|
|
|
5881
5881
|
}
|
|
5882
5882
|
},
|
|
5883
5883
|
startVelocity: (o, r) => e.velocityOf(o, r),
|
|
5884
|
-
layoutColumns: (o) =>
|
|
5884
|
+
layoutColumns: (o) => Uc(o.map((r) => e.elementFor(r))),
|
|
5885
5885
|
random: () => e.utils.random(0, 1)
|
|
5886
5886
|
}), this.compat.timeline.onComplete = () => {
|
|
5887
5887
|
this.finishedThisFrame = !0;
|
|
@@ -6178,7 +6178,7 @@ class _e {
|
|
|
6178
6178
|
staggerContext(e) {
|
|
6179
6179
|
return {
|
|
6180
6180
|
count: e.length,
|
|
6181
|
-
columnsFromLayout: () =>
|
|
6181
|
+
columnsFromLayout: () => Uc(e.map((n) => this.stage.elementFor(n))),
|
|
6182
6182
|
random: () => this.stage.utils.random(0, 1)
|
|
6183
6183
|
};
|
|
6184
6184
|
}
|
|
@@ -6186,12 +6186,12 @@ class _e {
|
|
|
6186
6186
|
const r = e.map((d) => this.targetFor(d));
|
|
6187
6187
|
if (!(e.length > 1 && (n.some(g1) || e.some((d) => this.stage.objectFor(d) !== void 0)))) {
|
|
6188
6188
|
const d = this.targetFor(e[0]);
|
|
6189
|
-
o(n.map((f) => this.prepare(
|
|
6189
|
+
o(n.map((f) => this.prepare(Gc(f, 0, d, this.stage.utils, r), e)), e, s);
|
|
6190
6190
|
return;
|
|
6191
6191
|
}
|
|
6192
6192
|
const a = n.length - 1, { stagger: l, ...c } = n[a], h = ka(l, this.staggerContext(e)), u = h ? fa(e.length, h).map((d) => d / 1e3) : e.map(() => 0);
|
|
6193
6193
|
e.forEach((d, f) => {
|
|
6194
|
-
const p = f === 0 ? rr(c.delay, 0) / 1e3 + u[0] : 0, g = f === 0 ? 0 : u[f] - u[f - 1], m = f === 0 ? s : `<${g < 0 ? "-" : "+"}${Math.abs(g).toFixed(6)}`, k = n.map((w, b) => b === a ? { ...c, delay: p } : w).map((w) => this.prepare(
|
|
6194
|
+
const p = f === 0 ? rr(c.delay, 0) / 1e3 + u[0] : 0, g = f === 0 ? 0 : u[f] - u[f - 1], m = f === 0 ? s : `<${g < 0 ? "-" : "+"}${Math.abs(g).toFixed(6)}`, k = n.map((w, b) => b === a ? { ...c, delay: p } : w).map((w) => this.prepare(Gc(w, f, this.targetFor(d), this.stage.utils, r), [d]));
|
|
6195
6195
|
o(k, [d], m);
|
|
6196
6196
|
});
|
|
6197
6197
|
}
|
|
@@ -6351,14 +6351,14 @@ function g1(t) {
|
|
|
6351
6351
|
function hd(t) {
|
|
6352
6352
|
return Object.entries(t).some(([e, n]) => (typeof n == "function" || Ju(n)) && !bl.has(e));
|
|
6353
6353
|
}
|
|
6354
|
-
function
|
|
6354
|
+
function Gc(t, e, n, s, o) {
|
|
6355
6355
|
if (!hd(t)) return t;
|
|
6356
6356
|
const r = {};
|
|
6357
6357
|
for (const [i, a] of Object.entries(t))
|
|
6358
6358
|
bl.has(i) ? r[i] = a : typeof a == "function" ? r[i] = a(e, n, o) : Ju(a) ? r[i] = s.resolveRandomString(a) : r[i] = a;
|
|
6359
6359
|
return r;
|
|
6360
6360
|
}
|
|
6361
|
-
function
|
|
6361
|
+
function Uc(t) {
|
|
6362
6362
|
const e = t.map((s) => s?.getBoundingClientRect().top);
|
|
6363
6363
|
if (e[0] === void 0) return t.length;
|
|
6364
6364
|
let n = 0;
|
|
@@ -6948,8 +6948,8 @@ function M1(t, e, n = {}) {
|
|
|
6948
6948
|
const c = s.createElement("div");
|
|
6949
6949
|
c.className = "tf-ctl-bar", c.setAttribute("role", "group");
|
|
6950
6950
|
const h = (W, q, V, tt = "") => {
|
|
6951
|
-
const
|
|
6952
|
-
return
|
|
6951
|
+
const U = s.createElement("button");
|
|
6952
|
+
return U.type = "button", U.className = `tf-ctl-btn ${tt}`.trim(), U.setAttribute("aria-label", W), U.title = W, U.textContent = q, U.addEventListener("click", V), U;
|
|
6953
6953
|
}, u = h(o.restart, "⟲", () => {
|
|
6954
6954
|
t.pause(), t.seek(0);
|
|
6955
6955
|
}), d = h(o.prev, "|◀", () => t.prev()), f = h(o.play, "▶", () => t.isPlaying ? t.pause() : g(), "tf-ctl-primary"), p = h(o.next, "▶|", () => t.next()), g = () => {
|
|
@@ -6986,8 +6986,8 @@ function M1(t, e, n = {}) {
|
|
|
6986
6986
|
s.activeElement !== m && (m.value = String(q > 0 ? Math.round(t.currentTime / q * 1e3) : 0));
|
|
6987
6987
|
const V = t.markers;
|
|
6988
6988
|
if (d.hidden = p.hidden = y.hidden = V.length === 0, V.length > 0) {
|
|
6989
|
-
const tt = t.currentMarker,
|
|
6990
|
-
y.textContent = o.stepFormat.replace("{index}", String(
|
|
6989
|
+
const tt = t.currentMarker, U = tt ? V.indexOf(tt) + 1 : 0;
|
|
6990
|
+
y.textContent = o.stepFormat.replace("{index}", String(U)).replace("{total}", String(V.length)), y.setAttribute("aria-label", `${o.step} ${U} ${o.of} ${V.length}`), d.disabled = t.currentTime <= 0.5, p.disabled = t.currentTime >= q - 0.5;
|
|
6991
6991
|
const R = t.caption() ?? "";
|
|
6992
6992
|
b.textContent !== R && (b.textContent = R), b.hidden = !a();
|
|
6993
6993
|
const D = !W && tt?.question !== void 0 && Math.abs(t.currentTime - tt.time) < 1;
|
|
@@ -7876,7 +7876,7 @@ function vo(t, e) {
|
|
|
7876
7876
|
for (const n of e.slice(1)) t.lineTo(n.x, n.y);
|
|
7877
7877
|
t.closePath();
|
|
7878
7878
|
}
|
|
7879
|
-
function
|
|
7879
|
+
function G1(t, e, n, s) {
|
|
7880
7880
|
const [o, r] = s.light, i = (u) => {
|
|
7881
7881
|
const d = u.x * o + u.y * r;
|
|
7882
7882
|
return 1 - s.weight * d * (d > 0 ? 0.55 : 1);
|
|
@@ -7949,7 +7949,7 @@ function Br(t, e) {
|
|
|
7949
7949
|
if (e.look === "pencil") return J1(t, e);
|
|
7950
7950
|
if (e.look === "illustrated") {
|
|
7951
7951
|
if (!e.illustrated) throw new Error("createPen: the illustrated look needs its resolved style");
|
|
7952
|
-
return
|
|
7952
|
+
return G1(t, e.ink, e.lineWidth, e.illustrated);
|
|
7953
7953
|
}
|
|
7954
7954
|
return vd(t, e.ink, e.look);
|
|
7955
7955
|
}
|
|
@@ -7987,7 +7987,7 @@ function vd(t, e, n, s = !0) {
|
|
|
7987
7987
|
}
|
|
7988
7988
|
};
|
|
7989
7989
|
}
|
|
7990
|
-
function
|
|
7990
|
+
function U1(t, e) {
|
|
7991
7991
|
const n = [t[0]];
|
|
7992
7992
|
let s = 0;
|
|
7993
7993
|
for (let i = 1; i < t.length; i++) {
|
|
@@ -8023,14 +8023,14 @@ function J1(t, e) {
|
|
|
8023
8023
|
const h = (p, g, m = !1) => Mn(ue(`${e.seed}:${m ? "paper" : l}:${p}:${g}`)), u = (p, g, m, y, k, w = 0) => {
|
|
8024
8024
|
if (p.length < 2) return;
|
|
8025
8025
|
const b = p.slice(1).reduce((A, P, O) => A + Math.hypot(P.x - p[O].x, P.y - p[O].y), 0);
|
|
8026
|
-
let S =
|
|
8026
|
+
let S = U1(p, Math.max(1.5, Math.min(e.lineWidth * 0.8, b / 24)));
|
|
8027
8027
|
if (w > 0 && S.length >= 2) {
|
|
8028
8028
|
const [A, P] = [S[S.length - 2], S[S.length - 1]], O = Math.hypot(P.x - A.x, P.y - A.y) || 1;
|
|
8029
8029
|
S = [...S, { x: P.x + (P.x - A.x) / O * w, y: P.y + (P.y - A.y) / O * w }];
|
|
8030
8030
|
}
|
|
8031
8031
|
const E = sh(m), v = sh(m), x = S.length, M = [], T = [];
|
|
8032
8032
|
S.forEach((A, P) => {
|
|
8033
|
-
const O = x === 1 ? 0 : P / (x - 1), C = S[Math.max(0, P - 1)], W = S[Math.min(x - 1, P + 1)], q = Math.hypot(W.x - C.x, W.y - C.y) || 1, V = -(W.y - C.y) / q, tt = (W.x - C.x) / q,
|
|
8033
|
+
const O = x === 1 ? 0 : P / (x - 1), C = S[Math.max(0, P - 1)], W = S[Math.min(x - 1, P + 1)], q = Math.hypot(W.x - C.x, W.y - C.y) || 1, V = -(W.y - C.y) / q, tt = (W.x - C.x) / q, U = E(O) * k, R = Math.min(1, O / 0.08, (1 - O) / 0.08), D = (0.55 + 0.45 * Math.sqrt(Math.max(0, R))) * (1 + i * v(O)), Y = Math.max(0.3, g(O) * D / 2), _ = A.x + V * U, j = A.y + tt * U;
|
|
8034
8034
|
M.push({ x: _ + V * Y, y: j + tt * Y }), T.push({ x: _ - V * Y, y: j - tt * Y });
|
|
8035
8035
|
}), t.save(), t.globalAlpha *= y, t.fillStyle = s, cr(t, [...M, ...T.reverse()], !0), t.fill(), t.restore();
|
|
8036
8036
|
}, d = (p, g) => {
|
|
@@ -8588,15 +8588,15 @@ function qb(t, e, n, s, o, r) {
|
|
|
8588
8588
|
function Cd(t, e) {
|
|
8589
8589
|
const n = e.height ?? 300, s = Math.min(3, Math.max(0.3, t.stretch ?? 1)), o = Math.sqrt(s), r = e.armLength ?? 1;
|
|
8590
8590
|
if (!Number.isFinite(r) || r <= 0) throw new Error("stick figure: armLength must be a positive finite multiplier");
|
|
8591
|
-
const i = (e.headSize ?? 2 * Td) / 2, a = e.headSize === void 0 ? Sb : 1 - 2 * i, l = i * n, c = an(t.sit), h = t.leftHip + (-Mo - t.leftHip) * c, u = t.leftKnee + (-Mo - t.leftKnee) * c, d = t.rightHip + (Mo - t.rightHip) * c, f = t.rightKnee + (Mo - t.rightKnee) * c, p = e.classic === !0, g = an(t.turn), m = (
|
|
8592
|
-
const j = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, Math.abs(le(R - D) / 2) + le(Y))), nt = Math.max(-1, Math.min(1, Cb + _)), $ = g + (1 - g) *
|
|
8591
|
+
const i = (e.headSize ?? 2 * Td) / 2, a = e.headSize === void 0 ? Sb : 1 - 2 * i, l = i * n, c = an(t.sit), h = t.leftHip + (-Mo - t.leftHip) * c, u = t.leftKnee + (-Mo - t.leftKnee) * c, d = t.rightHip + (Mo - t.rightHip) * c, f = t.rightKnee + (Mo - t.rightKnee) * c, p = e.classic === !0, g = an(t.turn), m = (U, R, D, Y, _) => {
|
|
8592
|
+
const j = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, Math.abs(le(R - D) / 2) + le(Y))), nt = Math.max(-1, Math.min(1, Cb + _)), $ = g + (1 - g) * U * nt;
|
|
8593
8593
|
return p ? { x: 0, y: 0 } : { x: Math.cos(j) * dh * $, y: Math.sin(j) * dh };
|
|
8594
8594
|
}, y = { left: t.leftAnkle ?? 0, right: t.rightAnkle ?? 0 }, k = { left: t.leftFootOut ?? 0, right: t.rightFootOut ?? 0 };
|
|
8595
8595
|
let w = 0;
|
|
8596
8596
|
if (c > 0 || !p) {
|
|
8597
|
-
const
|
|
8598
|
-
|
|
8599
|
-
|
|
8597
|
+
const U = (_, j, nt, $, I) => Ia * Math.cos(le(j)) + hr * Math.cos(le(j - nt)) + Math.max(0, m(_, j, nt, $, I).y), R = Math.max(
|
|
8598
|
+
U(-1, h, u, y.left, k.left),
|
|
8599
|
+
U(1, d, f, y.right, k.right)
|
|
8600
8600
|
), D = 1 - an((t.rise ?? 0) / Bb), Y = (p ? Math.min(1, c / Db) : 1) * D;
|
|
8601
8601
|
w = (lh - R) * Y * n * s;
|
|
8602
8602
|
}
|
|
@@ -8604,25 +8604,25 @@ function Cd(t, e) {
|
|
|
8604
8604
|
let M;
|
|
8605
8605
|
if (v !== 0) {
|
|
8606
8606
|
M = [];
|
|
8607
|
-
for (let
|
|
8608
|
-
const R =
|
|
8607
|
+
for (let U = 0; U <= fh; U++) {
|
|
8608
|
+
const R = U / fh, D = gh(b, S, v, R);
|
|
8609
8609
|
M.push({ x: D.x - E * Math.sin(Math.PI * R), y: D.y });
|
|
8610
8610
|
}
|
|
8611
8611
|
} else
|
|
8612
8612
|
M = E === 0 ? [{ x: 0, y: b }, { x: 0, y: S }] : as({ x: 0, y: b }, { x: -E, y: (b + S) / 2 }, { x: 0, y: S }, 1, 8);
|
|
8613
|
-
const T = S + Tb * n * s, A = (e.shoulderWidth ?? 0) * n * Math.cos(g * Math.PI / 2), P = (
|
|
8613
|
+
const T = S + Tb * n * s, A = (e.shoulderWidth ?? 0) * n * Math.cos(g * Math.PI / 2), P = (U, R, D, Y, _) => {
|
|
8614
8614
|
const j = zb(D, Y);
|
|
8615
|
-
return { x:
|
|
8616
|
-
}, O = (
|
|
8617
|
-
const Y = P(0, b, R,
|
|
8618
|
-
return { root: { x: 0, y: b }, joint: Y, end: P(Y.x, Y.y, R - D,
|
|
8619
|
-
}, C = (
|
|
8620
|
-
const Y = { x:
|
|
8621
|
-
return { root: Y, joint: _, end: P(_.x, _.y, R + D,
|
|
8622
|
-
}, W = { left: O(-1, h, u), right: O(1, d, f) }, q = (
|
|
8623
|
-
const nt = m(
|
|
8615
|
+
return { x: U + j.x * _ * n, y: R + j.y * _ * n };
|
|
8616
|
+
}, O = (U, R, D) => {
|
|
8617
|
+
const Y = P(0, b, R, U, Ia * s);
|
|
8618
|
+
return { root: { x: 0, y: b }, joint: Y, end: P(Y.x, Y.y, R - D, U, hr * s) };
|
|
8619
|
+
}, C = (U, R, D) => {
|
|
8620
|
+
const Y = { x: U * A, y: T }, _ = P(Y.x, Y.y, R, U, Eb * o * r);
|
|
8621
|
+
return { root: Y, joint: _, end: P(_.x, _.y, R + D, U, Ab * o * r) };
|
|
8622
|
+
}, W = { left: O(-1, h, u), right: O(1, d, f) }, q = (U, R, D, Y, _, j) => {
|
|
8623
|
+
const nt = m(U, D, Y, _, j);
|
|
8624
8624
|
return { x: R.end.x + nt.x * n * s, y: R.end.y + nt.y * n * s };
|
|
8625
|
-
}, V = (
|
|
8625
|
+
}, V = (U, R, D, Y, _) => P(R.end.x, R.end.y, D + Y + _, U, $d * o), tt = {
|
|
8626
8626
|
left: C(-1, t.leftShoulder, t.leftElbow),
|
|
8627
8627
|
right: C(1, t.rightShoulder, t.rightElbow)
|
|
8628
8628
|
};
|
|
@@ -8664,11 +8664,11 @@ function gh(t, e, n, s) {
|
|
|
8664
8664
|
}
|
|
8665
8665
|
function jb(t, e) {
|
|
8666
8666
|
if (t.chest.bend === 0) return e;
|
|
8667
|
-
const n =
|
|
8667
|
+
const n = Gs(e, { x: 0, y: t.neckY }, t.chest.bend);
|
|
8668
8668
|
return { x: n.x + t.chest.end.x, y: n.y + t.chest.end.y - t.neckY };
|
|
8669
8669
|
}
|
|
8670
8670
|
const _s = (t, e) => e === 0 ? [t.root, t.joint, t.end] : as(t.root, t.joint, t.end, e);
|
|
8671
|
-
function
|
|
8671
|
+
function Gs(t, e, n) {
|
|
8672
8672
|
const s = Math.cos(n), o = Math.sin(n), r = t.x - e.x, i = t.y - e.y;
|
|
8673
8673
|
return { x: e.x + r * s - i * o, y: e.y + r * o + i * s };
|
|
8674
8674
|
}
|
|
@@ -8681,7 +8681,7 @@ function Rd(t, e, n) {
|
|
|
8681
8681
|
}
|
|
8682
8682
|
function Yb(t, e, n, s) {
|
|
8683
8683
|
const { pivot: o, angle: r, lift: i } = Rd(e, n, s), a = (d) => {
|
|
8684
|
-
const f =
|
|
8684
|
+
const f = Gs(d, o, r);
|
|
8685
8685
|
return { x: f.x, y: f.y - i };
|
|
8686
8686
|
}, l = (d) => ({ left: a(d.left), right: a(d.right) }), c = { left: Math.max(a(t.feet.left).y, a(t.toes.left).y), right: Math.max(a(t.feet.right).y, a(t.toes.right).y) }, h = Math.max(c.left, c.right), u = Pd * e.height;
|
|
8687
8687
|
return {
|
|
@@ -8709,7 +8709,7 @@ function Yb(t, e, n, s) {
|
|
|
8709
8709
|
};
|
|
8710
8710
|
}
|
|
8711
8711
|
function Kb(t, e) {
|
|
8712
|
-
const n = le(t.lean), s = le(e.headTilt), o = { x: 0, y: t.hipY }, r = (b) => ({ x: t.facing * b.x, y: b.y }), i = (b) => r(
|
|
8712
|
+
const n = le(t.lean), s = le(e.headTilt), o = { x: 0, y: t.hipY }, r = (b) => ({ x: t.facing * b.x, y: b.y }), i = (b) => r(Gs(b, o, n)), a = (b) => i(jb(t, b)), l = (b) => a(Gs({ x: b.x, y: b.y + t.neckY }, { x: 0, y: t.neckY }, s)), c = _s(t.arms.left, t.rubber).map(a), h = _s(t.arms.right, t.rubber).map(a), u = (b, S) => Math.atan2(S.y - b.y, S.x - b.x), d = { left: a(t.handTips.left), right: a(t.handTips.right) }, f = (b, S) => {
|
|
8713
8713
|
const [E, v] = b.slice(-2), x = t.arms[S], M = u(a(x.end), d[S]) - u(a(x.joint), a(x.end));
|
|
8714
8714
|
return u(E, v) + M;
|
|
8715
8715
|
};
|
|
@@ -8763,7 +8763,7 @@ function ke(t, e = {}) {
|
|
|
8763
8763
|
return Hd(Cd(t, e), t);
|
|
8764
8764
|
}
|
|
8765
8765
|
function h4(t, e, n) {
|
|
8766
|
-
return
|
|
8766
|
+
return Gs({ x: t.center.x + e * t.rx, y: t.center.y + n * t.ry }, t.center, t.angle);
|
|
8767
8767
|
}
|
|
8768
8768
|
function Xb(t, e, n) {
|
|
8769
8769
|
const s = (r) => ({ x: r.x + e, y: r.y + n }), o = (r) => ({ left: s(r.left), right: s(r.right) });
|
|
@@ -8791,7 +8791,7 @@ function Xb(t, e, n) {
|
|
|
8791
8791
|
head: { ...t.head, center: s(t.head.center) }
|
|
8792
8792
|
};
|
|
8793
8793
|
}
|
|
8794
|
-
function
|
|
8794
|
+
function Gb(t, e, n = {}, s = 0) {
|
|
8795
8795
|
const o = Cd(e, n), r = n.color ?? "#1e293b", i = n.layers ?? {}, a = n.layers ? Hd(o, e, !1) : void 0, l = n.sketch ? Ta(t, n.sketch, s) : void 0, c = n.sketch && n.layers ? Ta(t, n.sketch, s) : void 0, h = (v) => {
|
|
8796
8796
|
t.save(), v(), t.restore();
|
|
8797
8797
|
}, u = (v) => {
|
|
@@ -8883,7 +8883,7 @@ function Fd(t, e, n, s) {
|
|
|
8883
8883
|
}
|
|
8884
8884
|
return t.talk > 0 && (i = { ...i, mouth: Math.max(i.mouth, t.talk * xb(e)) }), { pose: i, hands: a };
|
|
8885
8885
|
}
|
|
8886
|
-
function
|
|
8886
|
+
function Ub(t, e, n, s) {
|
|
8887
8887
|
return Fd(t, e, n, s).pose;
|
|
8888
8888
|
}
|
|
8889
8889
|
const Ld = (t, e) => (t.facing ?? e.facing ?? 1) < 0 ? -1 : 1, ur = (t, e) => `hand.${t}.${e}`;
|
|
@@ -8917,7 +8917,7 @@ function Wd(t) {
|
|
|
8917
8917
|
figureGaits: t.cast?.gaits,
|
|
8918
8918
|
draw(i, a, l) {
|
|
8919
8919
|
const c = a.props, h = Fd(c, l, t.dance, t.cast?.gaits);
|
|
8920
|
-
i.translate(s / 2, n),
|
|
8920
|
+
i.translate(s / 2, n), Gb(i, h.pose, Jb({ ...e, rubber: c.rubber, facing: Ld(c, e) }, h.hands), l);
|
|
8921
8921
|
}
|
|
8922
8922
|
};
|
|
8923
8923
|
}
|
|
@@ -8944,7 +8944,7 @@ function Nd(t, e, n) {
|
|
|
8944
8944
|
let r = 0, i = 0;
|
|
8945
8945
|
for (const [c, h] of e.state?.values.get(n) ?? [])
|
|
8946
8946
|
c === "gait" && typeof h == "string" && (o.gait = h), typeof h == "number" && (c === "x" || c === "motionPathX" ? r = h : c === "y" || c === "motionPathY" ? i = h : c in o && (o[c] = h));
|
|
8947
|
-
const a =
|
|
8947
|
+
const a = Ub(o, e.time, t.figureDance, t.figureGaits), l = ke(a, { ...s, rubber: o.rubber, facing: Ld(o, s) });
|
|
8948
8948
|
return { pose: a, joints: Xb(l, t.x + r + t.width / 2, t.y + i + t.height) };
|
|
8949
8949
|
}
|
|
8950
8950
|
function Sl(t) {
|
|
@@ -10315,7 +10315,7 @@ function bh(t) {
|
|
|
10315
10315
|
const [e, n, s] = La(t);
|
|
10316
10316
|
return { swing: Math.asin(Math.max(-1, Math.min(1, s))), spread: Math.atan2(e, -n) };
|
|
10317
10317
|
}
|
|
10318
|
-
function
|
|
10318
|
+
function Us(t, e, n, s, o) {
|
|
10319
10319
|
const r = t.chains.find((P) => P.id === n);
|
|
10320
10320
|
if (!r) throw new Error(`reach: no chain ${n} in ${t.id}`);
|
|
10321
10321
|
if (r.bones.length < 2 || r.rest[1] > -0.99) throw new Error(`reach: ${n} is not a hanging limb of two bones or more`);
|
|
@@ -10335,13 +10335,13 @@ function Gs(t, e, n, s, o) {
|
|
|
10335
10335
|
];
|
|
10336
10336
|
return t.withAngles(e, r, A);
|
|
10337
10337
|
}
|
|
10338
|
-
const
|
|
10338
|
+
const Gn = (t, e) => (t % e + e) % e, wh = (t) => t * t * (3 - 2 * t), Fw = (t) => Object.fromEntries(
|
|
10339
10339
|
["left", "right"].flatMap((e) => Object.entries(Tt[t]).map(([n, s]) => [`hand.${e}.${n}`, s]))
|
|
10340
10340
|
);
|
|
10341
10341
|
function Ii(t, e = !1) {
|
|
10342
|
-
const n = qd(), s =
|
|
10342
|
+
const n = qd(), s = Us(n, at, "arm.left", [0.015, 0.68, 0.2], { height: 1 }), o = Us(n, s, "arm.right", [-0.015, 0.68, 0.2], { height: 1 });
|
|
10343
10343
|
return Array.from({ length: 32 }, (r, i) => {
|
|
10344
|
-
const a = i / 4, l = Math.floor(a), c = a - l, h = l % 2 === 0, u = Math.sin(Math.PI * c), d = Math.max(0, ...t.map((p) => 1 - Math.min(
|
|
10344
|
+
const a = i / 4, l = Math.floor(a), c = a - l, h = l % 2 === 0, u = Math.sin(Math.PI * c), d = Math.max(0, ...t.map((p) => 1 - Math.min(Gn(a - p, 8), Gn(p - a, 8)) / 0.5)), f = {
|
|
10345
10345
|
side: (h ? 1 : -1) * 5 * Math.sin(Math.PI * c),
|
|
10346
10346
|
bend: 2 + 3 * u,
|
|
10347
10347
|
"head.tilt": (h ? -1 : 1) * 3 * u,
|
|
@@ -10381,7 +10381,7 @@ function Yd(t) {
|
|
|
10381
10381
|
function pr(t, e, n = at) {
|
|
10382
10382
|
const s = Yd(t);
|
|
10383
10383
|
if (!Number.isFinite(e)) throw new Error("humanDanceFrame: beat must be finite");
|
|
10384
|
-
const o =
|
|
10384
|
+
const o = Gn(e, s.beats);
|
|
10385
10385
|
let r = s.keys.length - 1;
|
|
10386
10386
|
for (let m = 0; m < s.keys.length; m++) s.keys[m].beat <= o && (r = m);
|
|
10387
10387
|
const i = s.keys[r], a = s.keys[(r + 1) % s.keys.length], l = i.beat > o ? i.beat - s.beats : i.beat, c = a.beat <= i.beat ? a.beat + s.beats : a.beat, h = wh((o - l) / (c - i.beat)), u = { ...at, ...n };
|
|
@@ -10390,8 +10390,8 @@ function pr(t, e, n = at) {
|
|
|
10390
10390
|
const y = m.match(/^hand\.(?:left|right)\.(.+)$/)?.[1], k = n[m] ?? at[m] ?? (y ? Rt[y] : void 0) ?? 0, w = i.pose[m] ?? k;
|
|
10391
10391
|
u[m] = w + ((a.pose[m] ?? k) - w) * h;
|
|
10392
10392
|
}
|
|
10393
|
-
const d = Math.floor(e), f = e - d, p = f <= 0.6 ? 1 : 1 - wh((f - 0.6) / 0.4), g = Math.max(0, ...s.strikes.map((m) => 1 - Math.min(
|
|
10394
|
-
return { pose: u, contact: { side:
|
|
10393
|
+
const d = Math.floor(e), f = e - d, p = f <= 0.6 ? 1 : 1 - wh((f - 0.6) / 0.4), g = Math.max(0, ...s.strikes.map((m) => 1 - Math.min(Gn(o - m, s.beats), Gn(m - o, s.beats)) / 0.25));
|
|
10394
|
+
return { pose: u, contact: { side: Gn(d, 2) === 0 ? "left" : "right", start: d, weight: p }, strike: g };
|
|
10395
10395
|
}
|
|
10396
10396
|
function w4(t, e) {
|
|
10397
10397
|
const n = Yd(e.style), s = e.bpm ?? n.bpm, o = e.beats ?? n.beats, r = e.samplesPerBeat ?? 16;
|
|
@@ -10434,7 +10434,7 @@ function Bw(t, e, n, s) {
|
|
|
10434
10434
|
function Ko(t, e) {
|
|
10435
10435
|
return t / (Math.PI * Math.sqrt(2 * (1 + e * e)));
|
|
10436
10436
|
}
|
|
10437
|
-
function
|
|
10437
|
+
function Gd(t) {
|
|
10438
10438
|
if (typeof t == "string") {
|
|
10439
10439
|
if (!Object.prototype.hasOwnProperty.call(Wa, t)) throw new Error(`body shape: unknown shape '${t}'`);
|
|
10440
10440
|
t = Wa[t];
|
|
@@ -10448,7 +10448,7 @@ function Ud(t) {
|
|
|
10448
10448
|
return { height: e, bust: n, underbust: r, waist: s, hip: o };
|
|
10449
10449
|
}
|
|
10450
10450
|
function zw(t, e) {
|
|
10451
|
-
const n =
|
|
10451
|
+
const n = Gd(t), s = (d) => d / n.height, o = Ko(s(n.hip), Na), r = Ko(s(n.waist), vh), i = Ko(s(n.underbust), kh), a = o * Na, l = r * vh, c = i * kh, h = s(n.bust - n.underbust) * Lw, u = Math.min(0.25, Math.max(0, n.waist / n.hip - 0.8));
|
|
10452
10452
|
return {
|
|
10453
10453
|
torso: [
|
|
10454
10454
|
{ at: 0, width: o },
|
|
@@ -10477,21 +10477,21 @@ function zw(t, e) {
|
|
|
10477
10477
|
hipHalfWidth: o
|
|
10478
10478
|
};
|
|
10479
10479
|
}
|
|
10480
|
-
function
|
|
10480
|
+
function Ud(t) {
|
|
10481
10481
|
return t * 0.4;
|
|
10482
10482
|
}
|
|
10483
10483
|
function qw(t) {
|
|
10484
|
-
const e =
|
|
10485
|
-
return Math.max(0.02, n - Math.max(0.042,
|
|
10484
|
+
const e = Gd(t), n = Ko(e.hip / e.height, Na);
|
|
10485
|
+
return Math.max(0.02, n - Math.max(0.042, Ud(n)));
|
|
10486
10486
|
}
|
|
10487
|
-
function
|
|
10487
|
+
function Un(t, e, n, s) {
|
|
10488
10488
|
if (!Number.isFinite(t) || t < n || t > s) throw new Error(`organic body: ${e} must be ${n}..${s}`);
|
|
10489
10489
|
return t;
|
|
10490
10490
|
}
|
|
10491
10491
|
function Pn(t, e) {
|
|
10492
10492
|
if (t.length < 2 || t[0].at !== 0 || t.at(-1).at !== 1) throw new Error(`organic body: ${e} must run from 0 to 1`);
|
|
10493
10493
|
return t.map((n, s) => {
|
|
10494
|
-
if (
|
|
10494
|
+
if (Un(n.at, `${e}.at`, 0, 1), Un(n.width, `${e}.width`, 1e-3, 0.3), s > 0 && n.at <= t[s - 1].at) throw new Error(`organic body: ${e} positions must increase`);
|
|
10495
10495
|
return { at: n.at, width: n.width };
|
|
10496
10496
|
});
|
|
10497
10497
|
}
|
|
@@ -10506,7 +10506,7 @@ function jw(t, e) {
|
|
|
10506
10506
|
{ at: 0.68, width: n * 0.9 },
|
|
10507
10507
|
{ at: 0.86, width: n },
|
|
10508
10508
|
{ at: 1, width: 0.024 }
|
|
10509
|
-
], "torso"), l =
|
|
10509
|
+
], "torso"), l = Un(t.depth ?? 0.55, "depth", 0.2, 1), c = (u) => u.map((d) => ({ at: d.at, width: Math.max(1e-3, d.width * l) })), h = i ? Math.max(1, Ud(i.hipHalfWidth) / 0.042) : 1;
|
|
10510
10510
|
return {
|
|
10511
10511
|
torso: a,
|
|
10512
10512
|
torsoFront: Pn(t.torsoFront ?? i?.torsoFront ?? c(a), "torsoFront"),
|
|
@@ -10528,13 +10528,13 @@ function jw(t, e) {
|
|
|
10528
10528
|
neck: Pn(t.neck ?? [{ at: 0, width: 0.024 }, { at: 1, width: 0.023 }], "neck"),
|
|
10529
10529
|
depth: l,
|
|
10530
10530
|
fill: t.fill ?? e.skin,
|
|
10531
|
-
outline: { color: t.outline?.color ?? e.ink, width:
|
|
10531
|
+
outline: { color: t.outline?.color ?? e.ink, width: Un(t.outline?.width ?? e.lineWidth, "outline.width", 0, 100) },
|
|
10532
10532
|
shading: {
|
|
10533
10533
|
mode: o.mode ?? "cel",
|
|
10534
10534
|
light: [...r],
|
|
10535
10535
|
shadow: o.shadow ?? "#633923",
|
|
10536
|
-
opacity:
|
|
10537
|
-
highlight:
|
|
10536
|
+
opacity: Un(o.opacity ?? 0.17, "shading.opacity", 0, 1),
|
|
10537
|
+
highlight: Un(o.highlight ?? 0.12, "shading.highlight", 0, 1)
|
|
10538
10538
|
}
|
|
10539
10539
|
};
|
|
10540
10540
|
}
|
|
@@ -10644,7 +10644,7 @@ function Th(t, e) {
|
|
|
10644
10644
|
for (const n of e.slice(1)) t.lineTo(n.x, n.y);
|
|
10645
10645
|
t.closePath();
|
|
10646
10646
|
}
|
|
10647
|
-
function
|
|
10647
|
+
function Gw(t, e, n) {
|
|
10648
10648
|
const s = n.shading;
|
|
10649
10649
|
if (s.mode === "none" || n.fill === "none") return;
|
|
10650
10650
|
const o = Math.hypot(...s.light), r = { x: s.light[0] / o, y: s.light[1] / o }, i = t.globalAlpha;
|
|
@@ -10668,7 +10668,7 @@ function Uw(t, e, n) {
|
|
|
10668
10668
|
}
|
|
10669
10669
|
t.restore();
|
|
10670
10670
|
}
|
|
10671
|
-
function
|
|
10671
|
+
function Uw(t, e, n, s) {
|
|
10672
10672
|
const o = s.bodyContours, r = (i) => o[i] && Vd(t, o[i].outline);
|
|
10673
10673
|
if (n.startsWith("arm.")) return e < 0.2 && r("spine");
|
|
10674
10674
|
if (n.startsWith("leg.")) return e < 0.2 && r("spine") || e > 0.85 && r(n.replace("leg.", "foot."));
|
|
@@ -10696,12 +10696,12 @@ function Vw(t) {
|
|
|
10696
10696
|
function Eh(t, e, n, s, o) {
|
|
10697
10697
|
const r = s.bodyContours?.[o];
|
|
10698
10698
|
if (!r) return !1;
|
|
10699
|
-
if (n.fill === "none" && (e = lo(t, e)), e.shape(r.outline, n.fill === "none" ? null : n.fill, 0), e.look === "clean" &&
|
|
10699
|
+
if (n.fill === "none" && (e = lo(t, e)), e.shape(r.outline, n.fill === "none" ? null : n.fill, 0), e.look === "clean" && Gw(t, r, n), (e.look !== "silhouette" || n.fill === "none") && s.lineWidth > 0) {
|
|
10700
10700
|
const i = Vw(r.outline);
|
|
10701
10701
|
let a = [];
|
|
10702
10702
|
for (let l = 0; l <= r.outline.length; l++) {
|
|
10703
10703
|
const c = l % r.outline.length, h = r.outline[c], u = r.outline[(c + 1) % r.outline.length], d = { x: (h.x + u.x) / 2, y: (h.y + u.y) / 2 };
|
|
10704
|
-
o.startsWith("arm.") && r.positions[c] === 1 ||
|
|
10704
|
+
o.startsWith("arm.") && r.positions[c] === 1 || Uw(d, r.positions[c], o, s) ? (a.length >= 2 && e.line(a, s.lineWidth, i), a = []) : (a.length === 0 && a.push(h), a.push(u));
|
|
10705
10705
|
}
|
|
10706
10706
|
a.length >= 2 && e.line(a, s.lineWidth, i);
|
|
10707
10707
|
}
|
|
@@ -10835,8 +10835,8 @@ function r2(t, e, n, s, o = {}, r) {
|
|
|
10835
10835
|
t.shape(a([{ x: W - F, y: K + 0.02 }, { x: W + F, y: K + 0.02 }, { x: W + F, y: L }, { x: W - F, y: L }], q), o.skin ?? "#ffffff", 0, !0), t.line(a([{ x: W - F, y: L }, { x: W + F, y: L }], q), i);
|
|
10836
10836
|
}
|
|
10837
10837
|
}
|
|
10838
|
-
const tt = Kt + (o.style === "anime" ? 0.38 : 0.3) + Yt(n, `brow.${C}`, 0) * 0.14 + Math.max(0, V - 1) * 0.12,
|
|
10839
|
-
t.line(a([
|
|
10838
|
+
const tt = Kt + (o.style === "anime" ? 0.38 : 0.3) + Yt(n, `brow.${C}`, 0) * 0.14 + Math.max(0, V - 1) * 0.12, U = { x: W + O * 0.13, y: tt }, R = { x: W - O * 0.13, y: tt + f * 0.1 }, D = y ? 0.035 : 0;
|
|
10839
|
+
t.line(a([U, { x: (U.x + R.x) / 2, y: (U.y + R.y) / 2 + D }, R], { x: W, y: tt }), i * (y ? 2.2 : 1));
|
|
10840
10840
|
}
|
|
10841
10841
|
h2(t, e, n, i, o.projection), c2(t, e, o.ageLines ?? 0, i, o.projection);
|
|
10842
10842
|
const k = { x: 0, y: Bt };
|
|
@@ -10877,7 +10877,7 @@ function r2(t, e, n, s, o = {}, r) {
|
|
|
10877
10877
|
}
|
|
10878
10878
|
}
|
|
10879
10879
|
function i2(t, e, n, s, o, r, i, a, l, c, h, u, d) {
|
|
10880
|
-
const { x: f, y: p } = n, g = Math.min(1.2, Math.max(0.5, u.eyeScale ?? 1)), m = Math.min(1.2, Math.max(0.45, u.eyeAspect ?? 1)), y = 0.21 * g * (1 + i * 0.15), k = 0.25 * g * m * Math.min(o, 1.6) * (1 - r) * (1 + i * 0.3), w = { x: f - y, y: p }, b = { x: f + y, y: p }, S = { x: f, y: p + k * 1.9 }, E = { x: f, y: p - k * 1.35 }, v = xe(w, S, b), x = xe(b, E, w), M = (
|
|
10880
|
+
const { x: f, y: p } = n, g = Math.min(1.2, Math.max(0.5, u.eyeScale ?? 1)), m = Math.min(1.2, Math.max(0.45, u.eyeAspect ?? 1)), y = 0.21 * g * (1 + i * 0.15), k = 0.25 * g * m * Math.min(o, 1.6) * (1 - r) * (1 + i * 0.3), w = { x: f - y, y: p }, b = { x: f + y, y: p }, S = { x: f, y: p + k * 1.9 }, E = { x: f, y: p - k * 1.35 }, v = xe(w, S, b), x = xe(b, E, w), M = (U) => Mt(e, U, n, u.projection).points, T = (U) => U.map((R) => {
|
|
10881
10881
|
const D = Math.min(b.x, Math.max(w.x, R.x));
|
|
10882
10882
|
return { x: D, y: Math.min(Ws(w, S, b, D), Math.max(Ws(b, E, w, D), R.y)) };
|
|
10883
10883
|
});
|
|
@@ -10888,20 +10888,20 @@ function i2(t, e, n, s, o, r, i, a, l, c, h, u, d) {
|
|
|
10888
10888
|
q && t.shape(M(T(pe(A, P - C * 0.5, O * 0.7, C * 0.32))), q, 0, !0);
|
|
10889
10889
|
const V = Math.min(0.085, 0.042 * a) * g, tt = T(pe(A, P, V, V * 1.35));
|
|
10890
10890
|
if (t.shape(M(tt), t.ink, 0, !0), u.inPupil && d) {
|
|
10891
|
-
const [
|
|
10892
|
-
R > 0.5 && (d.save(), d.beginPath(), d.arc(
|
|
10891
|
+
const [U] = M([{ x: A, y: P }]), R = Math.min(...M(tt).map((D) => Math.hypot(D.x - U.x, D.y - U.y)));
|
|
10892
|
+
R > 0.5 && (d.save(), d.beginPath(), d.arc(U.x, U.y, R, 0, Math.PI * 2), d.clip(), u.inPupil(d, { ...U, r: R, side: s === 1 ? "left" : "right" }), d.restore());
|
|
10893
10893
|
}
|
|
10894
10894
|
if (t.shape(M(T(pe(A - 0.038 * g, P + 0.075 * g, 0.035 * g, 0.045 * g))), "#ffffff", 0, !0), t.shape(M(T(pe(A + 0.04 * g, P - 0.04 * g, 0.014 * g, 0.02 * g))), "#ffffff", 0, !0), W) {
|
|
10895
|
-
const
|
|
10896
|
-
t.shape(M([...v, ...
|
|
10895
|
+
const U = xe(w, { x: f, y: p + k * 1.2 }, b);
|
|
10896
|
+
t.shape(M([...v, ...U.slice(1, -1).reverse()]), "rgba(70, 35, 30, 0.22)", 0, !0);
|
|
10897
10897
|
const R = xe({ x: f - y * 0.7, y: p + k * 0.55 + 0.03 }, { x: f, y: p + k * 1.4 + 0.09 }, { x: f + y * 0.85, y: p + k * 0.5 + 0.03 });
|
|
10898
10898
|
t.line(M(R), h * 0.45);
|
|
10899
10899
|
const D = x.filter((Y) => s * (Y.x - f) > y * 0.25);
|
|
10900
10900
|
D.length >= 2 && t.line(M(D), h * 0.55);
|
|
10901
10901
|
}
|
|
10902
10902
|
if (t.line(M(v), h * (W ? 1.9 : 1.1)), u.lashes !== !1)
|
|
10903
|
-
for (const
|
|
10904
|
-
const R = f + s * (y -
|
|
10903
|
+
for (const U of [0, 0.035]) {
|
|
10904
|
+
const R = f + s * (y - U), D = Ws(w, S, b, R);
|
|
10905
10905
|
t.line(M([{ x: R, y: D }, { x: R + s * 0.055, y: D + 0.07 }]), h * 0.75);
|
|
10906
10906
|
}
|
|
10907
10907
|
}
|
|
@@ -11019,7 +11019,7 @@ function qr(t, e, n = 64) {
|
|
|
11019
11019
|
for (let O = 0; O < n; O++) {
|
|
11020
11020
|
const C = P * g + O, W = (m[C] > 0 ? 8 : 0) | (m[C + 1] > 0 ? 4 : 0) | (m[C + g + 1] > 0 ? 2 : 0) | (m[C + g] > 0 ? 1 : 0);
|
|
11021
11021
|
if (W === 0 || W === 15) continue;
|
|
11022
|
-
const q = () => v(!1, O, P), V = () => v(!1, O, P + 1), tt = () => v(!0, O, P),
|
|
11022
|
+
const q = () => v(!1, O, P), V = () => v(!1, O, P + 1), tt = () => v(!0, O, P), U = () => v(!0, O + 1, P);
|
|
11023
11023
|
switch (W) {
|
|
11024
11024
|
case 1:
|
|
11025
11025
|
case 14:
|
|
@@ -11027,15 +11027,15 @@ function qr(t, e, n = 64) {
|
|
|
11027
11027
|
break;
|
|
11028
11028
|
case 2:
|
|
11029
11029
|
case 13:
|
|
11030
|
-
M(V(),
|
|
11030
|
+
M(V(), U());
|
|
11031
11031
|
break;
|
|
11032
11032
|
case 3:
|
|
11033
11033
|
case 12:
|
|
11034
|
-
M(tt(),
|
|
11034
|
+
M(tt(), U());
|
|
11035
11035
|
break;
|
|
11036
11036
|
case 4:
|
|
11037
11037
|
case 11:
|
|
11038
|
-
M(q(),
|
|
11038
|
+
M(q(), U());
|
|
11039
11039
|
break;
|
|
11040
11040
|
case 6:
|
|
11041
11041
|
case 9:
|
|
@@ -11048,7 +11048,7 @@ function qr(t, e, n = 64) {
|
|
|
11048
11048
|
case 5:
|
|
11049
11049
|
case 10: {
|
|
11050
11050
|
const R = (y(O, P) + y(O + 1, P) + y(O + 1, P + 1) + y(O, P + 1)) / 4 > 0;
|
|
11051
|
-
W === 5 === R ? (M(tt(), q()), M(V(),
|
|
11051
|
+
W === 5 === R ? (M(tt(), q()), M(V(), U())) : (M(tt(), V()), M(q(), U()));
|
|
11052
11052
|
break;
|
|
11053
11053
|
}
|
|
11054
11054
|
}
|
|
@@ -11630,7 +11630,7 @@ function O2(t, e) {
|
|
|
11630
11630
|
beard: n.beard ?? s?.beard ?? "none"
|
|
11631
11631
|
};
|
|
11632
11632
|
}
|
|
11633
|
-
const Be = (t) => t * Math.PI / 180,
|
|
11633
|
+
const Be = (t) => t * Math.PI / 180, Go = (t, e, n) => {
|
|
11634
11634
|
const s = Math.min(1, Math.max(0, (n - t) / (e - t)));
|
|
11635
11635
|
return s * s * (3 - 2 * s);
|
|
11636
11636
|
}, mf = {
|
|
@@ -11645,7 +11645,7 @@ const Be = (t) => t * Math.PI / 180, Uo = (t, e, n) => {
|
|
|
11645
11645
|
sideburns: { top: [0.08, 0.08], reach: 100, band: 0.42, length: 0, shape: "round", volume: 0.05, aroundMouth: !1 },
|
|
11646
11646
|
muttonChops: { top: [0.08, 0.08], reach: 100, band: 0.75, length: 0, shape: "round", volume: 0.08, aroundMouth: !1 }
|
|
11647
11647
|
}, I2 = (t, e) => {
|
|
11648
|
-
const n =
|
|
11648
|
+
const n = Go(Be(48), Be(100), mr(e, 0));
|
|
11649
11649
|
return t.top[0] + (t.top[1] - t.top[0]) * n;
|
|
11650
11650
|
}, _2 = (t) => t === "sideburns" || t === "muttonChops";
|
|
11651
11651
|
function ja(t, e) {
|
|
@@ -11653,7 +11653,7 @@ function ja(t, e) {
|
|
|
11653
11653
|
if (!n) return null;
|
|
11654
11654
|
const s = Be(n.reach), o = (r) => {
|
|
11655
11655
|
const i = mr(r, 0);
|
|
11656
|
-
return n.shape === "point" ? Math.exp(-((i / 0.42) ** 2)) : n.shape === "square" ? 1 -
|
|
11656
|
+
return n.shape === "point" ? Math.exp(-((i / 0.42) ** 2)) : n.shape === "square" ? 1 - Go(Be(45), Be(85), i) : Math.cos(Math.min(i, Math.PI / 2)) ** 0.7;
|
|
11657
11657
|
};
|
|
11658
11658
|
return {
|
|
11659
11659
|
top: Math.max(n.top[0], n.top[1]) + 0.05,
|
|
@@ -11662,13 +11662,13 @@ function ja(t, e) {
|
|
|
11662
11662
|
const a = mr(r, 0), l = I2(n, r);
|
|
11663
11663
|
let c = Math.min(l - i, s - a);
|
|
11664
11664
|
if (n.band > 0 && (c = Math.min(c, i - (l - n.band))), _2(t)) {
|
|
11665
|
-
const h = t === "muttonChops" ? Be(70) - Be(22) *
|
|
11665
|
+
const h = t === "muttonChops" ? Be(70) - Be(22) * Go(0.08, -0.6, i) : Be(72);
|
|
11666
11666
|
c = Math.min(c, a - h);
|
|
11667
11667
|
}
|
|
11668
11668
|
return c;
|
|
11669
11669
|
},
|
|
11670
11670
|
position(r, i) {
|
|
11671
|
-
const [a, l, c] = Te(r, i), h = 1 + e + n.volume, u = n.length * o(r) *
|
|
11671
|
+
const [a, l, c] = Te(r, i), h = 1 + e + n.volume, u = n.length * o(r) * Go(-0.45, -1, i);
|
|
11672
11672
|
return [a * h, l * h - u, c * h + u * 0.25];
|
|
11673
11673
|
},
|
|
11674
11674
|
normal: (r, i) => Te(r, i)
|
|
@@ -11890,7 +11890,7 @@ function X2(t, e, n, s, o, r, i) {
|
|
|
11890
11890
|
function xf(t, e, n, s, o, r) {
|
|
11891
11891
|
kf(s) && (n.hair && qa(e, s, n.hair, { ...r, motion: yr(o) }), n.hat && bf(e, s, n.hat, { lineWidth: r.lineWidth, hairVolume: n.hair?.volume ?? 0 }));
|
|
11892
11892
|
}
|
|
11893
|
-
const Nh = 40,
|
|
11893
|
+
const Nh = 40, G2 = 0.215 + 0.205, ne = (t, e) => {
|
|
11894
11894
|
const n = {};
|
|
11895
11895
|
for (const s of ["left", "right"]) for (const [o, r] of Object.entries(e)) n[`${t}.${s}.${o}`] = r;
|
|
11896
11896
|
return n;
|
|
@@ -11904,7 +11904,7 @@ function Fl(t, e, n = at, s = 1) {
|
|
|
11904
11904
|
}
|
|
11905
11905
|
function Ll(t, e, n = 1, s = 1) {
|
|
11906
11906
|
const o = zr(t);
|
|
11907
|
-
return 4 *
|
|
11907
|
+
return 4 * G2 * s * e * Math.sin(o.swing * n * Math.PI / 180);
|
|
11908
11908
|
}
|
|
11909
11909
|
const On = (t) => jd[t], Wl = {
|
|
11910
11910
|
/** Squash down in a squint, shoot up stretched with arms flung up, hang, land squashed, end surprised. */
|
|
@@ -11982,7 +11982,7 @@ const On = (t) => jd[t], Wl = {
|
|
|
11982
11982
|
{ after: 900, pose: { ...On("sad"), bend: 18, stretch: 0.92, lean: ft(t, "lean") + 5, "head.nod": 14, ...ne("arm", { spread: 6, swing: 0, elbow: 4, bend: 0 }) }, easing: "ease-in-out" }
|
|
11983
11983
|
]
|
|
11984
11984
|
};
|
|
11985
|
-
function
|
|
11985
|
+
function U2(t, e) {
|
|
11986
11986
|
const n = wt(e.from ?? {}), s = e.speed ?? 1;
|
|
11987
11987
|
let o = n;
|
|
11988
11988
|
return [
|
|
@@ -12108,7 +12108,7 @@ const ek = { apron: "#d8b48a", labCoat: "#f4f6f8", hoodie: "#6b7280", cardigan:
|
|
|
12108
12108
|
function nk(t) {
|
|
12109
12109
|
return t.parts["leg.left"].order > t.parts["leg.right"].order ? "left" : "right";
|
|
12110
12110
|
}
|
|
12111
|
-
const jh = (t) => Math.max(t.parts["leg.left"].order, t.parts["leg.right"].order) > t.parts.spine.order,
|
|
12111
|
+
const jh = (t) => Math.max(t.parts["leg.left"].order, t.parts["leg.right"].order) > t.parts.spine.order, Gt = (t) => t.bodyForward?.[2] ?? Math.cos(t.turn * Math.PI / 2), Ae = (t) => t.bodyForward?.[0] ?? Math.sin(t.turn * Math.PI / 2);
|
|
12112
12112
|
function Yh(t, e, n) {
|
|
12113
12113
|
t.save(), t.beginPath(), t.moveTo(e[0].x, e[0].y);
|
|
12114
12114
|
for (const s of e.slice(1)) t.lineTo(s.x, s.y);
|
|
@@ -12125,7 +12125,7 @@ function sk(t = {}) {
|
|
|
12125
12125
|
const L = I.parts[`leg.${K}`].points;
|
|
12126
12126
|
if (a === "skirt" && !u) return;
|
|
12127
12127
|
const F = a === "shorts" && !u, N = I.bodyContours?.[`leg.${K}`], X = N ? Ri(N, 0, F ? 0.5 : 1, I.height * 6e-3) : jt(F ? Ni(L, 0, 0.5) : L, I.height * (F ? 0.085 : 0.08), I.height * (F ? 0.07 : 0.05));
|
|
12128
|
-
B.shape(X, r, m(I)), !(n === "plain" ||
|
|
12128
|
+
B.shape(X, r, m(I)), !(n === "plain" || Gt(I) < 0.15) && Yh($, X, () => {
|
|
12129
12129
|
const z = (J, Q = 0) => Kh(L, J, Q * I.height);
|
|
12130
12130
|
if (n === "jeans")
|
|
12131
12131
|
B.line([z(0.07, -0.018), z(0.17, -0.02), z(0.23, 0), z(0.17, 0.02), z(0.07, 0.018)], m(I) * 0.65), B.line([z(0.27, 0.013), ...[0.4, 0.55, 0.7, 0.85, 0.96].filter((J) => !F || J < 0.5).map((J) => z(J, 0.013))], m(I) * 0.5);
|
|
@@ -12162,7 +12162,7 @@ function sk(t = {}) {
|
|
|
12162
12162
|
const B = c ? f : o;
|
|
12163
12163
|
I.shape(b($), B, m($));
|
|
12164
12164
|
}, v = ($, I, B) => {
|
|
12165
|
-
const K =
|
|
12165
|
+
const K = Gt(I);
|
|
12166
12166
|
if (!e || K < 0.2 || c) return;
|
|
12167
12167
|
const { top: L, hip: F } = w(I), N = Ae(I) * I.height * 0.025, X = [L, F], z = (J, Q = 0) => Kh(X, J, N + Q * I.height * K);
|
|
12168
12168
|
Yh($, b(I), () => {
|
|
@@ -12179,7 +12179,7 @@ function sk(t = {}) {
|
|
|
12179
12179
|
} else e === "dress" ? B.line([z(0.04, -0.035), z(0.17, -0.028), z(0.17, 0.028), z(0.04, 0.035)], m(I) * 0.75) : B.line([z(0.025, -0.035), z(0.1, -0.02), z(0.12), z(0.1, 0.02), z(0.025, 0.035)], m(I) * 0.65);
|
|
12180
12180
|
});
|
|
12181
12181
|
}, x = ($, I) => {
|
|
12182
|
-
const B =
|
|
12182
|
+
const B = Gt($), { top: K, hip: L } = w($), F = $.height * 0.07, N = { x: (K.x - L.x) * 0.16, y: (K.y - L.y) * 0.16 };
|
|
12183
12183
|
if (B >= 0) {
|
|
12184
12184
|
I.shape(
|
|
12185
12185
|
[
|
|
@@ -12207,14 +12207,14 @@ function sk(t = {}) {
|
|
|
12207
12207
|
m($)
|
|
12208
12208
|
);
|
|
12209
12209
|
}, M = ($, I) => {
|
|
12210
|
-
const B =
|
|
12210
|
+
const B = Gt($);
|
|
12211
12211
|
if (B < 0.2) return;
|
|
12212
12212
|
const { top: K, hip: L } = w($), F = Ae($) * $.height * 0.03, N = $.height * 0.06 * B, X = mt(K, L, 0.62), z = mt(K, L, 0.9);
|
|
12213
12213
|
I.line([{ x: X.x + F - N, y: X.y }, { x: z.x + F - N * 1.1, y: z.y }], m($) * 0.7), I.line([{ x: X.x + F + N, y: X.y }, { x: z.x + F + N * 1.1, y: z.y }], m($) * 0.7);
|
|
12214
12214
|
const J = mt(K, L, 0.1);
|
|
12215
12215
|
for (const Q of [-1, 1]) I.line([{ x: J.x + F + Q * N * 0.2, y: J.y }, { x: J.x + F + Q * N * 0.35, y: J.y + $.height * 0.07 }], m($) * 0.6);
|
|
12216
12216
|
}, T = ($, I) => {
|
|
12217
|
-
const { top: B, hip: K } = w($), L =
|
|
12217
|
+
const { top: B, hip: K } = w($), L = Gt($);
|
|
12218
12218
|
if (I.shape(jt([B, mt(B, K, 0.5), mt(B, K, 1.08)], $.height * 0.155, $.height * 0.15), f, m($)), L < 0.2) return;
|
|
12219
12219
|
const F = Ae($) * $.height * 0.03, N = $.height * 0.02 * L, X = mt(B, K, 0.12), z = mt(B, K, 1.05);
|
|
12220
12220
|
I.shape([{ x: X.x + F - N, y: X.y }, { x: X.x + F + N, y: X.y }, { x: z.x + F + N * 1.3, y: z.y }, { x: z.x + F - N * 1.3, y: z.y }], o, m($) * 0.7);
|
|
@@ -12223,11 +12223,11 @@ function sk(t = {}) {
|
|
|
12223
12223
|
I.dot(Q.x + F + N * 1.6, Q.y, m($) * 1.2);
|
|
12224
12224
|
}
|
|
12225
12225
|
}, A = ($, I) => {
|
|
12226
|
-
const B =
|
|
12226
|
+
const B = Gt($), { top: K, hip: L } = w($), F = Ae($) * $.height * 0.04, N = mt(L, K, 0.12), X = mt(L, K, 0.74);
|
|
12227
12227
|
if (B < 0.15) {
|
|
12228
12228
|
if (B < -0.3) {
|
|
12229
|
-
const H = $.points["shoulder.left"],
|
|
12230
|
-
I.line([H, { x: N.x + $.height * 0.03, y: N.y }], m($) * 0.8), I.line([
|
|
12229
|
+
const H = $.points["shoulder.left"], G = $.points["shoulder.right"];
|
|
12230
|
+
I.line([H, { x: N.x + $.height * 0.03, y: N.y }], m($) * 0.8), I.line([G, { x: N.x - $.height * 0.03, y: N.y }], m($) * 0.8);
|
|
12231
12231
|
}
|
|
12232
12232
|
return;
|
|
12233
12233
|
}
|
|
@@ -12243,34 +12243,34 @@ function sk(t = {}) {
|
|
|
12243
12243
|
m($)
|
|
12244
12244
|
);
|
|
12245
12245
|
for (const H of ["left", "right"]) {
|
|
12246
|
-
const
|
|
12247
|
-
I.line([et, { x:
|
|
12246
|
+
const G = $.points[`shoulder.${H}`], et = { x: X.x + F + (G.x > X.x + F ? 1 : -1) * z * 0.55, y: X.y };
|
|
12247
|
+
I.line([et, { x: G.x + (et.x - G.x) * 0.15, y: G.y + (et.y - G.y) * 0.15 }], m($) * 1.6);
|
|
12248
12248
|
}
|
|
12249
12249
|
const J = mt(X, N, 0.3), Q = z * 0.4;
|
|
12250
12250
|
I.line([{ x: J.x + F - Q, y: J.y }, { x: J.x + F - Q, y: J.y + Q * 1.4 }, { x: J.x + F + Q, y: J.y + Q * 1.4 }, { x: J.x + F + Q, y: J.y }], m($) * 0.6);
|
|
12251
12251
|
}, P = ($, I) => {
|
|
12252
|
-
const { hip: B, top: K } = w($), L = mt(B, K, 0.2), F = [$.points["ankle.left"], $.points["ankle.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 0.98), X = $.height * 0.075, z = Math.max($.height * 0.12, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.07), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1,
|
|
12252
|
+
const { hip: B, top: K } = w($), L = mt(B, K, 0.2), F = [$.points["ankle.left"], $.points["ankle.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 0.98), X = $.height * 0.075, z = Math.max($.height * 0.12, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.07), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1, G = { x: -Q / H, y: J / H };
|
|
12253
12253
|
if (I.shape(
|
|
12254
12254
|
[
|
|
12255
|
-
{ x: L.x +
|
|
12256
|
-
{ x: N.x +
|
|
12257
|
-
{ x: N.x -
|
|
12258
|
-
{ x: L.x -
|
|
12255
|
+
{ x: L.x + G.x * X, y: L.y + G.y * X },
|
|
12256
|
+
{ x: N.x + G.x * z, y: N.y + G.y * z },
|
|
12257
|
+
{ x: N.x - G.x * z, y: N.y - G.y * z },
|
|
12258
|
+
{ x: L.x - G.x * X, y: L.y - G.y * X }
|
|
12259
12259
|
],
|
|
12260
12260
|
f,
|
|
12261
12261
|
m($)
|
|
12262
|
-
),
|
|
12262
|
+
), Gt($) > 0.2) {
|
|
12263
12263
|
const it = Ae($) * $.height * 0.03;
|
|
12264
12264
|
for (const ot of [-0.35, 0, 0.35]) {
|
|
12265
12265
|
const lt = X * 0.5 * ot, st = z * 0.45 * ot;
|
|
12266
|
-
I.line([{ x: L.x + it +
|
|
12266
|
+
I.line([{ x: L.x + it + G.x * lt, y: L.y + G.y * lt + $.height * 0.02 }, { x: N.x + it + G.x * st, y: N.y + G.y * st }], m($) * 0.5);
|
|
12267
12267
|
}
|
|
12268
12268
|
}
|
|
12269
12269
|
}, O = ($, I) => {
|
|
12270
|
-
const B =
|
|
12270
|
+
const B = Gt($), { top: K, hip: L } = w($), F = Ae($), N = F >= 0 ? "left" : "right", X = N === "left" ? "right" : "left", z = $.points[`shoulder.${N}`], J = $.height * 0.035;
|
|
12271
12271
|
if (B < 0.15) {
|
|
12272
|
-
const
|
|
12273
|
-
I.shape(jt([z, { x:
|
|
12272
|
+
const G = mt(K, L, 0.9);
|
|
12273
|
+
I.shape(jt([z, { x: G.x + (z.x - K.x) * 0.5, y: G.y }], J * 2.2, J * 2.6), f, m($));
|
|
12274
12274
|
return;
|
|
12275
12275
|
}
|
|
12276
12276
|
const Q = { x: L.x + ($.points[`hip.${X}`].x - L.x) * 1.2, y: mt(L, K, 0.08).y };
|
|
@@ -12282,19 +12282,19 @@ function sk(t = {}) {
|
|
|
12282
12282
|
I.shape(Tf($, { top: !1, length: 0.45 }).skirt, r, m($));
|
|
12283
12283
|
return;
|
|
12284
12284
|
}
|
|
12285
|
-
const { hip: B, top: K } = w($), L = mt(B, K, 0.18), F = [$.points["knee.left"], $.points["knee.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 1.05), X = $.height * 0.075, z = Math.max($.height * 0.13, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.08), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1,
|
|
12285
|
+
const { hip: B, top: K } = w($), L = mt(B, K, 0.18), F = [$.points["knee.left"], $.points["knee.right"]], N = mt(B, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 1.05), X = $.height * 0.075, z = Math.max($.height * 0.13, Math.abs(F[0].x - F[1].x) / 2 + $.height * 0.08), J = N.x - L.x, Q = N.y - L.y, H = Math.hypot(J, Q) || 1, G = { x: -Q / H, y: J / H };
|
|
12286
12286
|
I.shape(
|
|
12287
12287
|
[
|
|
12288
|
-
{ x: L.x +
|
|
12289
|
-
{ x: N.x +
|
|
12290
|
-
{ x: N.x -
|
|
12291
|
-
{ x: L.x -
|
|
12288
|
+
{ x: L.x + G.x * X, y: L.y + G.y * X },
|
|
12289
|
+
{ x: N.x + G.x * z, y: N.y + G.y * z },
|
|
12290
|
+
{ x: N.x - G.x * z, y: N.y - G.y * z },
|
|
12291
|
+
{ x: L.x - G.x * X, y: L.y - G.y * X }
|
|
12292
12292
|
],
|
|
12293
12293
|
r,
|
|
12294
12294
|
m($)
|
|
12295
12295
|
);
|
|
12296
12296
|
}, W = ($, I) => {
|
|
12297
|
-
const B =
|
|
12297
|
+
const B = Gt($);
|
|
12298
12298
|
if (B < 0.2) return;
|
|
12299
12299
|
const { top: K, hip: L } = w($), F = { x: (L.x - K.x) * 0.12, y: (L.y - K.y) * 0.12 }, N = $.height * 0.045 * B;
|
|
12300
12300
|
for (const X of [-1, 1])
|
|
@@ -12308,12 +12308,12 @@ function sk(t = {}) {
|
|
|
12308
12308
|
m($) * 0.8
|
|
12309
12309
|
);
|
|
12310
12310
|
}, q = ($, I, B) => {
|
|
12311
|
-
const K =
|
|
12311
|
+
const K = Gt($);
|
|
12312
12312
|
if (K < 0.25) return;
|
|
12313
12313
|
const { top: L, hip: F } = w($), N = Ae($) * $.height * 0.03, X = (H) => ({ x: mt(L, F, H).x + N, y: mt(L, F, H).y }), z = $.height * 0.022 * K, J = X(0.08), Q = X(0.62);
|
|
12314
12314
|
I.shape([{ x: J.x - z, y: J.y - z }, { x: J.x + z, y: J.y - z }, { x: J.x + z * 0.6, y: J.y + z }, { x: J.x - z * 0.6, y: J.y + z }], B, m($) * 0.7), I.shape([{ x: J.x - z * 0.6, y: J.y + z }, { x: J.x + z * 0.6, y: J.y + z }, { x: Q.x + z * 1.4, y: Q.y - z * 2 }, Q, { x: Q.x - z * 1.4, y: Q.y - z * 2 }], B, m($) * 0.7);
|
|
12315
12315
|
}, V = ($, I) => {
|
|
12316
|
-
const B =
|
|
12316
|
+
const B = Gt($), { top: K, hip: L } = w($), F = mt(L, K, 0.72), N = [$.points["knee.left"], $.points["knee.right"]], X = mt(L, { x: (N[0].x + N[1].x) / 2, y: (N[0].y + N[1].y) / 2 }, 0.9), z = Ae($) * $.height * 0.04;
|
|
12317
12317
|
if (B < 0.15) {
|
|
12318
12318
|
const H = mt(L, K, 0.2);
|
|
12319
12319
|
B < -0.3 && I.line([{ x: H.x - $.height * 0.05, y: H.y }, { x: H.x + $.height * 0.05, y: H.y }], m($));
|
|
@@ -12335,15 +12335,15 @@ function sk(t = {}) {
|
|
|
12335
12335
|
}, tt = ($, I, B) => {
|
|
12336
12336
|
const { top: K, hip: L } = w($), F = [$.points["knee.left"], $.points["knee.right"]], N = mt(L, { x: (F[0].x + F[1].x) / 2, y: (F[0].y + F[1].y) / 2 }, 0.95);
|
|
12337
12337
|
B ? I.shape(jt([mt(K, L, 0.8), L, N], $.height * 0.145, $.height * 0.17), f, m($)) : I.shape(jt([K, mt(K, L, 0.5), L], $.height * 0.14, $.height * 0.15), f, m($));
|
|
12338
|
-
const X =
|
|
12338
|
+
const X = Gt($);
|
|
12339
12339
|
if (X > 0.2) {
|
|
12340
12340
|
const z = Ae($) * $.height * 0.03, [J, Q] = B ? [L, N] : [K, L];
|
|
12341
12341
|
if (I.line([{ x: J.x + z, y: J.y }, { x: Q.x + z, y: Q.y }], m($) * 0.8), !B) {
|
|
12342
|
-
const H = mt(K, L, 0.35),
|
|
12343
|
-
I.shape([{ x: H.x + z -
|
|
12342
|
+
const H = mt(K, L, 0.35), G = $.height * 0.025 * X;
|
|
12343
|
+
I.shape([{ x: H.x + z - G * 2.4, y: H.y }, { x: H.x + z - G * 0.6, y: H.y }, { x: H.x + z - G * 0.6, y: H.y + G * 1.6 }, { x: H.x + z - G * 2.4, y: H.y + G * 1.6 }], f, m($) * 0.6);
|
|
12344
12344
|
}
|
|
12345
12345
|
}
|
|
12346
|
-
},
|
|
12346
|
+
}, U = ($, I, B, K, L) => {
|
|
12347
12347
|
const F = $.bodyContours?.[`arm.${B}`];
|
|
12348
12348
|
if (F) {
|
|
12349
12349
|
const Z = Ri(F, 0, L, $.height * 6e-3);
|
|
@@ -12355,10 +12355,10 @@ function sk(t = {}) {
|
|
|
12355
12355
|
}
|
|
12356
12356
|
return;
|
|
12357
12357
|
}
|
|
12358
|
-
const N = $.parts[`arm.${B}`].points, X = N[0], z = $.chains.spine[$.chains.spine.length - 1], Q = [{ x: X.x + (z.x - X.x) * 0.45, y: X.y + (z.y - X.y) * 0.45 }, ...Ni(N, 0, L)], H = jt(Q, $.height * 0.085, $.height * (L > 0.6 ? 0.045 : 0.06)),
|
|
12358
|
+
const N = $.parts[`arm.${B}`].points, X = N[0], z = $.chains.spine[$.chains.spine.length - 1], Q = [{ x: X.x + (z.x - X.x) * 0.45, y: X.y + (z.y - X.y) * 0.45 }, ...Ni(N, 0, L)], H = jt(Q, $.height * 0.085, $.height * (L > 0.6 ? 0.045 : 0.06)), G = Q.length, et = H.slice(0, G), it = H.slice(G).reverse();
|
|
12359
12359
|
I.shape(H, K, 0);
|
|
12360
12360
|
const ot = (Z) => Math.hypot(Z[1].x - z.x, Z[1].y - z.y), [lt, st] = ot(et) > ot(it) ? [et, it] : [it, et];
|
|
12361
|
-
I.line(lt.slice(1), m($)), I.line(st.slice(Math.ceil(
|
|
12361
|
+
I.line(lt.slice(1), m($)), I.line(st.slice(Math.ceil(G * 0.45)), m($)), I.line([et[G - 1], it[G - 1]], m($));
|
|
12362
12362
|
}, R = l || c || h, D = R ? f : o, Y = R || i === "long" ? 0.95 : 0.45, _ = R || i !== "none", j = ($, I) => {
|
|
12363
12363
|
a === "skirt" && !u && !d && C($, I), d && P($, I), l && tt($, I, !0), t.over === "apron" && V($, I);
|
|
12364
12364
|
}, nt = ($) => (I, B, K) => {
|
|
@@ -12370,11 +12370,11 @@ function sk(t = {}) {
|
|
|
12370
12370
|
"leg.right": { clip: S, over: nt("right") },
|
|
12371
12371
|
spine: {
|
|
12372
12372
|
over: ($, I, B) => {
|
|
12373
|
-
c &&
|
|
12373
|
+
c && Gt(I) >= 0 && x(I, B), E(I, B), v($, I, B), s && !c && W(I, B), t.tie && !c && q(I, B, t.tie), l && tt(I, B, !1), h && T(I, B), c && (Gt(I) < 0 && x(I, B), M(I, B)), u && A(I, B), d && O(I, B), jh(I) || j(I, B);
|
|
12374
12374
|
}
|
|
12375
12375
|
},
|
|
12376
|
-
"arm.left": { over: _ ? ($, I, B) =>
|
|
12377
|
-
"arm.right": { over: _ ? ($, I, B) =>
|
|
12376
|
+
"arm.left": { over: _ ? ($, I, B) => U(I, B, "left", D, Y) : void 0 },
|
|
12377
|
+
"arm.right": { over: _ ? ($, I, B) => U(I, B, "right", D, Y) : void 0 }
|
|
12378
12378
|
}
|
|
12379
12379
|
};
|
|
12380
12380
|
}
|
|
@@ -12486,20 +12486,20 @@ function Xh(t, e, n, s, o, r = 1, i) {
|
|
|
12486
12486
|
}
|
|
12487
12487
|
}
|
|
12488
12488
|
}
|
|
12489
|
-
const
|
|
12489
|
+
const Gh = (t, e) => (t[`held.${e}`] ?? 1) >= 0.5, Uh = (t) => Math.sin(t * Math.PI / 2);
|
|
12490
12490
|
function rk(t) {
|
|
12491
12491
|
const e = (r) => Math.max(1, r.lineWidth * 0.45), n = (r) => (i, a, l, c, h) => {
|
|
12492
12492
|
const u = t[r];
|
|
12493
|
-
u &&
|
|
12493
|
+
u && Gh(h ?? {}, r) && Xh(l, u, Di(a, r), a.height, e(a), Uh(a.turn), a.head.center.y - a.head.ry);
|
|
12494
12494
|
}, s = (r, i, a, l, c) => {
|
|
12495
12495
|
const h = t.both;
|
|
12496
|
-
if (!h || !
|
|
12496
|
+
if (!h || !Gh(c ?? {}, "both")) return;
|
|
12497
12497
|
const u = Di(i, "left"), d = Di(i, "right"), f = {
|
|
12498
12498
|
point: { x: (u.point.x + d.point.x) / 2, y: (u.point.y + d.point.y) / 2 },
|
|
12499
12499
|
along: { x: (u.along.x + d.along.x) / 2, y: (u.along.y + d.along.y) / 2 },
|
|
12500
12500
|
depth: (u.depth + d.depth) / 2
|
|
12501
12501
|
};
|
|
12502
|
-
Xh(a, h, f, i.height, e(i),
|
|
12502
|
+
Xh(a, h, f, i.height, e(i), Uh(i.turn), i.head.center.y - i.head.ry);
|
|
12503
12503
|
}, o = { parts: {} };
|
|
12504
12504
|
if (t.left && (o.parts["arm.left"] = { over: n("left") }), t.right && (o.parts["arm.right"] = { over: n("right") }), t.both) {
|
|
12505
12505
|
const r = (i) => (a, l, c, h, u) => {
|
|
@@ -12758,7 +12758,7 @@ function Pf(t, e, n) {
|
|
|
12758
12758
|
}
|
|
12759
12759
|
return s;
|
|
12760
12760
|
}
|
|
12761
|
-
function
|
|
12761
|
+
function Ge(t, e, n, s) {
|
|
12762
12762
|
const o = t.plan.id === "human" ? { ...at, ...e } : e;
|
|
12763
12763
|
let r;
|
|
12764
12764
|
if (Array.isArray(s))
|
|
@@ -12767,7 +12767,7 @@ function Ue(t, e, n, s) {
|
|
|
12767
12767
|
const { skeleton: i } = Zs(t, o), a = Pl(t.plan, { ...o, roll: 0 }, { height: t.height, contact: "none" }), l = (o.roll ?? 0) * Math.PI / 180, c = s.x - i.hip.x, h = s.y - i.hip.y, u = a.hip.x + c * Math.cos(-l) - h * Math.sin(-l), d = a.hip.y + c * Math.sin(-l) + h * Math.cos(-l), f = Math.PI / 2 * (o.turn ?? 0), p = s.depth ?? i.chains[n].depths[i.chains[n].depths.length - 1], g = Math.cos(f), m = Math.sin(f);
|
|
12768
12768
|
r = [u * g - p * m, -d, u * m + p * g];
|
|
12769
12769
|
}
|
|
12770
|
-
return
|
|
12770
|
+
return Us(t.plan, o, n, r, { height: t.height });
|
|
12771
12771
|
}
|
|
12772
12772
|
const Of = /* @__PURE__ */ new Set(["walk", "walking", "gait"]);
|
|
12773
12773
|
function Dl(t, e = at, n) {
|
|
@@ -12843,17 +12843,17 @@ function A4(t, e, n = at) {
|
|
|
12843
12843
|
}))
|
|
12844
12844
|
}));
|
|
12845
12845
|
}
|
|
12846
|
-
const Xr = (t, e) => [t[0] + e[0], t[1] + e[1], t[2] + e[2]], Se = (t, e) => [t[0] - e[0], t[1] - e[1], t[2] - e[2]], wr = (t, e) => [t[0] * e, t[1] * e, t[2] * e], Bl = (t) => Math.hypot(...t), _f = (t) => wr(t, 1 / (Bl(t) || 1)),
|
|
12846
|
+
const Xr = (t, e) => [t[0] + e[0], t[1] + e[1], t[2] + e[2]], Se = (t, e) => [t[0] - e[0], t[1] - e[1], t[2] - e[2]], wr = (t, e) => [t[0] * e, t[1] * e, t[2] * e], Bl = (t) => Math.hypot(...t), _f = (t) => wr(t, 1 / (Bl(t) || 1)), Gr = (t) => ({ ...at, ...t }), zl = (t) => Tn(t.character.plan, Gr(t.pose), { height: t.character.height, contact: t.character.contact });
|
|
12847
12847
|
function hs(t, e, n) {
|
|
12848
12848
|
return Xr(t.position, zl(t).chains[e][n]);
|
|
12849
12849
|
}
|
|
12850
12850
|
function Cf(t, e, n) {
|
|
12851
|
-
const s =
|
|
12852
|
-
return
|
|
12851
|
+
const s = Gr(t.pose), o = zl(t).hip, r = co(t.character.plan, s, t.character.height), i = Se(Se(n, t.position), o), a = gs(i, (s.roll ?? 0) * Math.PI / 180), l = Xr(r.root, Jt(a, -(s.turn ?? 0) * Math.PI / 2));
|
|
12852
|
+
return Us(t.character.plan, s, e, l, { height: t.character.height });
|
|
12853
12853
|
}
|
|
12854
12854
|
function fk(t, e, n, s = "toe") {
|
|
12855
12855
|
const o = `leg.${e}`, r = s === "toe" ? 3 : 2;
|
|
12856
|
-
let i = { ...t, pose:
|
|
12856
|
+
let i = { ...t, pose: Gr(t.pose), position: [...t.position] };
|
|
12857
12857
|
for (let l = 0; l < 6; l++) {
|
|
12858
12858
|
const c = zl(i).chains[o], h = Se(c[r], c[2]);
|
|
12859
12859
|
i = { ...i, pose: Cf(i, o, Se(n, h)) };
|
|
@@ -12872,7 +12872,7 @@ function $4(t, e, n = {}) {
|
|
|
12872
12872
|
if (!(o > 0) || !Number.isFinite(o)) throw new Error("meetDandiya: stick length must be positive and finite");
|
|
12873
12873
|
const r = n.point ?? [(t.position[0] + e.position[0]) / 2, Math.max(t.position[1], e.position[1]) + s * 0.62, (t.position[2] + e.position[2]) / 2], i = (c, h) => {
|
|
12874
12874
|
const u = _f([r[0] - c.position[0], s * 0.2, r[2] - c.position[2]]), d = Se(r, wr(u, o));
|
|
12875
|
-
let f =
|
|
12875
|
+
let f = Gr(c.pose);
|
|
12876
12876
|
for (let g = 0; g < 6; g++) {
|
|
12877
12877
|
const m = { ...c, pose: f }, y = hs(m, `arm.${h}`, 2);
|
|
12878
12878
|
f = Cf(m, `arm.${h}`, Se(d, Se(Jh(m, h), y)));
|
|
@@ -12947,7 +12947,7 @@ function bk(t, e) {
|
|
|
12947
12947
|
return (e - t.takeoff) / (t.landing - t.takeoff);
|
|
12948
12948
|
}
|
|
12949
12949
|
function wk(t, e) {
|
|
12950
|
-
const n = typeof t == "string" ?
|
|
12950
|
+
const n = typeof t == "string" ? Ur[t] : t, s = pk(n), o = kr(e);
|
|
12951
12951
|
let r = 0;
|
|
12952
12952
|
for (let u = 0; u < s.length; u++) s[u].at <= o && (r = u);
|
|
12953
12953
|
const i = s[r], a = s[Math.min(r + 1, s.length - 1)], l = a.at > i.at ? (o - i.at) / (a.at - i.at) : 0, c = Xs(i.pose, a.pose, zt(a.easing ?? "ease-in-out")(kr(l))), h = bk(n, o);
|
|
@@ -12958,11 +12958,11 @@ function wk(t, e) {
|
|
|
12958
12958
|
};
|
|
12959
12959
|
}
|
|
12960
12960
|
function kk(t, e, n) {
|
|
12961
|
-
const s = typeof t == "string" ?
|
|
12961
|
+
const s = typeof t == "string" ? Ur[t] : t, o = kr(e), r = kr((o - s.takeoff) / (s.landing - s.takeoff));
|
|
12962
12962
|
return s.travel * n * r;
|
|
12963
12963
|
}
|
|
12964
12964
|
function O4(t, e, n = {}) {
|
|
12965
|
-
const s = typeof e == "string" ?
|
|
12965
|
+
const s = typeof e == "string" ? Ur[e] : e, o = n.start ?? 0, r = n.duration ?? s.duration, i = n.samples ?? 48, a = Array.from({ length: i + 1 }, (h, u) => {
|
|
12966
12966
|
const d = u / i;
|
|
12967
12967
|
return { time: o + d * r, progress: d, pose: wk(s, d) };
|
|
12968
12968
|
}), c = Object.keys(ht).filter((h) => a.some((u) => u.pose[h] !== ht[h])).map((h) => ({
|
|
@@ -13070,7 +13070,7 @@ function Cn(t, e, n, s, o, r = 1300) {
|
|
|
13070
13070
|
]
|
|
13071
13071
|
};
|
|
13072
13072
|
}
|
|
13073
|
-
const
|
|
13073
|
+
const Ur = {
|
|
13074
13074
|
frontFlip: Cn("Front flip (tuck)", 360, 0.56, 0.35, [
|
|
13075
13075
|
{ at: 0.38, pose: Po, easing: "ease-out-cubic" },
|
|
13076
13076
|
{ at: 0.64, pose: Po }
|
|
@@ -13464,9 +13464,9 @@ function Wk(t, e, n) {
|
|
|
13464
13464
|
function Nk(t) {
|
|
13465
13465
|
const e = Ce([0, 1, 0], t);
|
|
13466
13466
|
if (e > 0.999999) return Wr();
|
|
13467
|
-
if (e < -0.999999) return me(
|
|
13467
|
+
if (e < -0.999999) return me(Ut([1, 0, 0], 180));
|
|
13468
13468
|
const n = qs([0, 1, 0], t);
|
|
13469
|
-
return me(
|
|
13469
|
+
return me(Ut(n, Math.acos(e) * 180 / Math.PI));
|
|
13470
13470
|
}
|
|
13471
13471
|
function Dk(t, e, n, s, o) {
|
|
13472
13472
|
const r = t.solid ?? {}, i = r.outline === !1 ? void 0 : r.outline ?? { width: 2, color: "#0f172a" }, a = { color: r.color ?? "#475569", shading: r.shading ?? "toon", outline: i }, l = { color: r.skin ?? "#f2c49b", shading: r.shading ?? "toon", outline: i }, c = { color: "#0f172a", shading: "unlit" }, h = s.height * 0.034, u = [], d = (w, b, S) => u.push({ mesh: w, world: Ht(o, b), material: S }), f = (w, b, S) => d(e.sphere, pl(w, [0, 0, 0, 1], [b, b, b]), S);
|
|
@@ -13643,7 +13643,7 @@ function C4(t, e, n = {}) {
|
|
|
13643
13643
|
}
|
|
13644
13644
|
return Object.entries(s).map(([o, r]) => ({ id: `${t}-${o}`, target: t, property: o, keyframes: r }));
|
|
13645
13645
|
}
|
|
13646
|
-
function
|
|
13646
|
+
function Gl(t, e, n, s = {}) {
|
|
13647
13647
|
if (n.length === 0) return e;
|
|
13648
13648
|
const o = s.fields?.mouth ?? "mouth", r = s.fields?.mouthWidth ?? "mouthWidth", i = { [o]: en.rest.mouth, [r]: en.rest.mouthWidth, ...s.rest }, a = new Ft({ id: "before-speech", tracks: e }), l = (u, d) => a.getStateAtTime(d).values.get(t)?.get(u) ?? i[u], c = [o, r], h = e.filter((u) => u.target !== t || !c.includes(u.property));
|
|
13649
13649
|
for (const u of c) {
|
|
@@ -13711,7 +13711,7 @@ function Xk(t, e, n = "x", s = 20, o = 0) {
|
|
|
13711
13711
|
}
|
|
13712
13712
|
return { vertices: r, faces: a, marks: l, creases: !0 };
|
|
13713
13713
|
}
|
|
13714
|
-
function
|
|
13714
|
+
function Gk([t, e, n], s = 16) {
|
|
13715
13715
|
const o = Math.max(4, Math.round(s / 2)), r = [[0, e, 0]];
|
|
13716
13716
|
for (let h = 1; h < o; h++) {
|
|
13717
13717
|
const u = Math.PI * h / o;
|
|
@@ -13736,12 +13736,12 @@ function Uk([t, e, n], s = 16) {
|
|
|
13736
13736
|
}
|
|
13737
13737
|
return { vertices: r, faces: c, creases: !1 };
|
|
13738
13738
|
}
|
|
13739
|
-
const
|
|
13739
|
+
const Uk = (t) => t.reduce((e, [n, s], o) => {
|
|
13740
13740
|
const [r, i] = t[(o + 1) % t.length];
|
|
13741
13741
|
return e + n * i - r * s;
|
|
13742
13742
|
}, 0) / 2;
|
|
13743
13743
|
function Vk(t, e) {
|
|
13744
|
-
const n =
|
|
13744
|
+
const n = Uk(t) < 0 ? [...t].reverse() : t, s = n.length, o = e / 2, r = [...n.map(([a, l]) => [o, l, a]), ...n.map(([a, l]) => [-o, l, a])], i = [
|
|
13745
13745
|
// Seen from +x, (forward, up) = (z, y) runs anticlockwise when z points left on screen: so reverse for the left cap.
|
|
13746
13746
|
{ corners: Array.from({ length: s }, (a, l) => s - 1 - l), normal: [1, 0, 0] },
|
|
13747
13747
|
{ corners: Array.from({ length: s }, (a, l) => s + l), normal: [-1, 0, 0] }
|
|
@@ -13788,7 +13788,7 @@ function Qk(t) {
|
|
|
13788
13788
|
case "cylinder":
|
|
13789
13789
|
return Xk(t.radius, t.length, t.axis, t.segments, t.spokes);
|
|
13790
13790
|
case "ellipsoid":
|
|
13791
|
-
return
|
|
13791
|
+
return Gk(t.radii, t.segments);
|
|
13792
13792
|
case "extrude":
|
|
13793
13793
|
return Vk(t.profile, t.width);
|
|
13794
13794
|
case "panel":
|
|
@@ -13846,7 +13846,7 @@ function Xf(t, e) {
|
|
|
13846
13846
|
return (n + s) / 2;
|
|
13847
13847
|
}
|
|
13848
13848
|
const Ss = 520, u0 = ["do", "at", "for", "to", "through", "toward", "speed", "pose", "gag", "say", "look", "turns", "dance", "bpm", "beats"], t5 = (t) => Math.max(700, Array.from(t).length * 65), d0 = 70, f0 = 35;
|
|
13849
|
-
function
|
|
13849
|
+
function Gf(t, e) {
|
|
13850
13850
|
const n = e[0] - t.x, s = e[1] - t.eyeHeight, o = e[2] - t.z, r = t.heading * Math.PI / 180, i = n * Math.cos(r) - o * Math.sin(r), a = n * Math.sin(r) + o * Math.cos(r), l = Math.atan2(i, a) * 180 / Math.PI, c = Math.hypot(i, a), h = -Math.atan2(s, c) * 180 / Math.PI, u = Math.max(-d0, Math.min(d0, l * 0.75)), d = Math.max(-f0, Math.min(f0, h * 0.7));
|
|
13851
13851
|
return {
|
|
13852
13852
|
"head.turn": u,
|
|
@@ -13924,14 +13924,14 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
|
|
|
13924
13924
|
const A = g(M, Qn(T[0].point, T[1].point)), P = T[T.length - 1].at, O = x.speed ?? e5[v] * Math.sqrt(o / 1.7), C = x.for ?? P / O * 1e3, W = Ll(v, o), q = zt("ease-in-out"), V = Math.min(r5, C / 4);
|
|
13925
13925
|
d.push({ time: A, value: v }), p("walking", A, 0), f("walking", A + V, 1, "ease-out"), f("walking", A + C - V, 1), f("walking", A + C, 0, "ease-in");
|
|
13926
13926
|
const tt = h;
|
|
13927
|
-
let
|
|
13927
|
+
let U = c;
|
|
13928
13928
|
for (let R = 0; ; R = Math.min(P, R + n5)) {
|
|
13929
13929
|
const D = A + Xf(q, R / P) * C, { point: Y, direction: _ } = Kf(T, R);
|
|
13930
|
-
|
|
13930
|
+
U += Mr(U, Qn([0, 0], _));
|
|
13931
13931
|
const j = R === 0 ? p : f;
|
|
13932
|
-
if (j("x", D, Y[0]), j("z", D, Y[1]), j("rotateY", D,
|
|
13932
|
+
if (j("x", D, Y[0]), j("z", D, Y[1]), j("rotateY", D, U), j("walk", D, tt + R / W), R >= P) break;
|
|
13933
13933
|
}
|
|
13934
|
-
return h = tt + P / W, [a, l] = T[T.length - 1].point, c =
|
|
13934
|
+
return h = tt + P / W, [a, l] = T[T.length - 1].point, c = U, A + C;
|
|
13935
13935
|
}, k = [], w = [];
|
|
13936
13936
|
let b = 0;
|
|
13937
13937
|
for (const v of e) {
|
|
@@ -13947,9 +13947,9 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
|
|
|
13947
13947
|
const O = { ...r }, C = Math.max(1, Math.ceil(P * 16)), W = Array.from({ length: C + 1 }, (V, tt) => pr(v.dance, P * tt / C, O).pose), q = Math.min(150, (M - x) / 4);
|
|
13948
13948
|
for (const V of Object.keys(W[0])) {
|
|
13949
13949
|
const tt = i(V, O);
|
|
13950
|
-
V === "turn" || V === "roll" || W.every((
|
|
13950
|
+
V === "turn" || V === "roll" || W.every((U) => U[V] === tt) || (p(V, x, tt), W.slice(1).forEach((U, R) => {
|
|
13951
13951
|
const D = x + (M - x) * (R + 1) / C, Y = Math.min(1, (D - x) / q), _ = Y * Y * (3 - 2 * Y);
|
|
13952
|
-
f(V, D, tt + (
|
|
13952
|
+
f(V, D, tt + (U[V] - tt) * _);
|
|
13953
13953
|
}), r[V] = W[C][V]);
|
|
13954
13954
|
}
|
|
13955
13955
|
} else if (v.do === "hold") M = x + (v.for ?? 1e3);
|
|
@@ -13960,7 +13960,7 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
|
|
|
13960
13960
|
const T = typeof v.pose == "string" ? Me[v.pose] : v.pose;
|
|
13961
13961
|
m(x, M, T);
|
|
13962
13962
|
} else if (v.do === "gag") {
|
|
13963
|
-
const T =
|
|
13963
|
+
const T = U2(v.gag, { at: x, from: { ...r } });
|
|
13964
13964
|
let A = T[0];
|
|
13965
13965
|
for (const P of T.slice(1))
|
|
13966
13966
|
m(A.time, P.time, Object.fromEntries(Object.entries(P.pose).filter(([O, C]) => r[O] !== C)), P.easing ?? "ease-in-out"), A = P;
|
|
@@ -13976,13 +13976,13 @@ ${s.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
|
|
|
13976
13976
|
A > 0 && m(M - Ss / 2, M, { "head.tilt": T.tilt, "brow.left": T.left, "brow.right": T.right });
|
|
13977
13977
|
} else if (v.do === "look") {
|
|
13978
13978
|
const T = v.look ?? v.toward, A = o * 0.9, P = T === "camera" ? n.camera ?? [0, 1.6, 8] : T.length === 3 ? T : [T[0], A, T[1]];
|
|
13979
|
-
M = x + (v.for ?? 500), m(x, M,
|
|
13979
|
+
M = x + (v.for ?? 500), m(x, M, Gf({ x: a, z: l, heading: c, eyeHeight: A }, P), "ease-out");
|
|
13980
13980
|
}
|
|
13981
13981
|
k.push({ do: v.do, start: x, end: M }), b = M;
|
|
13982
13982
|
}
|
|
13983
13983
|
const S = `${n.scene}/${t}`;
|
|
13984
13984
|
let E = [...u].map(([v, x]) => ({ id: `${t}-${v}`, target: S, property: v, keyframes: jf(x) }));
|
|
13985
|
-
return d.length > 0 && E.push({ id: `${t}-gait`, target: S, property: "gait", keyframes: d }), w.length > 0 && (E =
|
|
13985
|
+
return d.length > 0 && E.push({ id: `${t}-gait`, target: S, property: "gait", keyframes: d }), w.length > 0 && (E = Gl(S, E, w, { rest: { mouth: n.pose?.mouth ?? at.mouth ?? 0, mouthWidth: n.pose?.mouthWidth ?? at.mouthWidth ?? 1 } })), { tracks: E, duration: b, beats: k, end: { position: [a, l], heading: c, pose: { ...r } } };
|
|
13986
13986
|
}
|
|
13987
13987
|
function g0(t, e, n = [0, 0, 0]) {
|
|
13988
13988
|
const s = t.filter((r) => r.target === e), o = new Ft({ id: `${e}-position`, tracks: s });
|
|
@@ -14008,7 +14008,7 @@ function R4(t, e) {
|
|
|
14008
14008
|
const d = i.getStateAtTime(u).values.get(n), f = (g, m) => {
|
|
14009
14009
|
const y = d?.get(g);
|
|
14010
14010
|
return typeof y == "number" ? y : m;
|
|
14011
|
-
}, p =
|
|
14011
|
+
}, p = Gf({ x: f("x", r[0]), z: f("z", r[2]), heading: f("rotateY", 0), eyeHeight: f("y", r[1]) + s * 0.9 }, l(u));
|
|
14012
14012
|
for (const g of c) h[g].push({ time: u, value: p[g] ?? 0 });
|
|
14013
14013
|
if (u >= e.end) break;
|
|
14014
14014
|
}
|
|
@@ -14087,7 +14087,7 @@ function l5(t, e, n = {}, s) {
|
|
|
14087
14087
|
for (const c of l) Zf(t, c, s);
|
|
14088
14088
|
t.restore();
|
|
14089
14089
|
}
|
|
14090
|
-
function
|
|
14090
|
+
function Uf(t, e, n = {}, s) {
|
|
14091
14091
|
const o = n.length ?? 90, r = n.thickness ?? 34;
|
|
14092
14092
|
t.save(), t.translate(e.x, e.y), t.rotate((n.angle ?? -35) * Math.PI / 180);
|
|
14093
14093
|
const i = -r / 2;
|
|
@@ -14126,7 +14126,7 @@ function Jf(t, e, n = {}, s) {
|
|
|
14126
14126
|
prop: {
|
|
14127
14127
|
depth: k.depth,
|
|
14128
14128
|
draw: () => {
|
|
14129
|
-
t.save(), t.translate(d.x, d.y), t.scale(a, a), o === "eraser" ?
|
|
14129
|
+
t.save(), t.translate(d.x, d.y), t.scale(a, a), o === "eraser" ? Uf(t, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, outline: i }, s) : l5(t, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, length: 190, outline: i }, s), t.restore();
|
|
14130
14130
|
}
|
|
14131
14131
|
}
|
|
14132
14132
|
});
|
|
@@ -14247,7 +14247,7 @@ function Y4(t, e) {
|
|
|
14247
14247
|
const l = Number(i.props?.erase ?? 0);
|
|
14248
14248
|
if (r.save(), Qf(r, e.path, n, l), t.draw(r, i, a), r.restore(), !o || l <= 0 || l >= 1) return;
|
|
14249
14249
|
const c = Ml(e.path, l);
|
|
14250
|
-
s ? Jf(r, c, { ...s, tool: "eraser" }) :
|
|
14250
|
+
s ? Jf(r, c, { ...s, tool: "eraser" }) : Uf(r, c, o);
|
|
14251
14251
|
}
|
|
14252
14252
|
};
|
|
14253
14253
|
}
|
|
@@ -14263,7 +14263,7 @@ function uo() {
|
|
|
14263
14263
|
const o = t.get(n);
|
|
14264
14264
|
return o ? [...o].sort((r, i) => r.time - i.time)[o.length - 1].value : s;
|
|
14265
14265
|
},
|
|
14266
|
-
valueAt: (n, s) =>
|
|
14266
|
+
valueAt: (n, s) => Ul(t.get(n), s),
|
|
14267
14267
|
cutAfter(n, s) {
|
|
14268
14268
|
for (const o of n) t.set(o, (t.get(o) ?? []).filter((r) => r.time <= s));
|
|
14269
14269
|
},
|
|
@@ -14277,7 +14277,7 @@ function uo() {
|
|
|
14277
14277
|
}
|
|
14278
14278
|
};
|
|
14279
14279
|
}
|
|
14280
|
-
function
|
|
14280
|
+
function Ul(t, e) {
|
|
14281
14281
|
if (!t || t.length === 0) return 0;
|
|
14282
14282
|
const n = [...t].sort((s, o) => s.time - o.time);
|
|
14283
14283
|
if (e <= n[0].time) return n[0].value;
|
|
@@ -14388,7 +14388,7 @@ const p5 = {
|
|
|
14388
14388
|
highlight: "rgba(249, 226, 175, 0.22)",
|
|
14389
14389
|
strike: "#f38ba8",
|
|
14390
14390
|
font: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
14391
|
-
},
|
|
14391
|
+
}, Ga = ["wipe", "fly", "blur"], Uo = {
|
|
14392
14392
|
kind: "code",
|
|
14393
14393
|
create: "codePanel({ code, language?, x, y, fontSize?, lineHeight?, width?, hidden? })",
|
|
14394
14394
|
anchors: {
|
|
@@ -14412,7 +14412,7 @@ const p5 = {
|
|
|
14412
14412
|
function K4(t) {
|
|
14413
14413
|
const e = { ...p5, ...t.theme }, n = t.code.replace(/\t/g, " ").replace(/\n$/, "").split(`
|
|
14414
14414
|
`), s = t.fontSize ?? 16, o = (t.lineHeight ?? 1.6) * s, r = (t.charWidth ?? 0.6) * s, i = t.padding ?? 12, a = t.lineNumbers === !1 ? 0 : (String(n.length).length + 2) * r, l = Math.max(1, ...n.map((R) => R.length)), c = t.width ?? i * 2 + a + l * r, h = i * 2 + n.length * o, u = t.x + i + a, d = new Set(t.hidden ?? []), f = t.language ?? "plain";
|
|
14415
|
-
if (!
|
|
14415
|
+
if (!Ua.includes(f)) throw new Error(`codePanel: ${dt("language", f, Ua)}`);
|
|
14416
14416
|
const p = n.map((R) => v5(R, f).flatMap((D) => Array.from(D.text, () => e[D.kind]))), g = uo(), m = Jr(g), y = [], k = /* @__PURE__ */ new Map(), w = [], b = [], S = (R) => {
|
|
14417
14417
|
if (!Number.isInteger(R) || R < 1 || R > n.length) throw new Error(`codePanel: no line ${R} (it has ${n.length})`);
|
|
14418
14418
|
}, E = g.tween, v = g.last, x = (R, D, Y, _, j, nt = 300) => {
|
|
@@ -14462,9 +14462,9 @@ function K4(t) {
|
|
|
14462
14462
|
...w.filter((ot) => ot.line === K).map((ot) => ({ column: ot.column, length: ot.text.length, piece: ot, insert: void 0 })),
|
|
14463
14463
|
...b.filter((ot) => ot.line === K).map((ot) => ({ column: ot.column, length: 0, piece: void 0, insert: ot }))
|
|
14464
14464
|
].sort((ot, lt) => ot.column - lt.column || ot.length - lt.length);
|
|
14465
|
-
let
|
|
14465
|
+
let G = 0, et = j;
|
|
14466
14466
|
for (const ot of H) {
|
|
14467
|
-
$(K,
|
|
14467
|
+
$(K, G, Math.min(ot.column, z), et, N), et += (ot.column - G) * r;
|
|
14468
14468
|
let lt = ot.length, st = "";
|
|
14469
14469
|
if (ot.piece) {
|
|
14470
14470
|
const Z = ot.piece.written ?? "", rt = _(`piece.${ot.piece.id}.write`);
|
|
@@ -14472,9 +14472,9 @@ function K4(t) {
|
|
|
14472
14472
|
} else ot.insert && (lt = ot.insert.chars * _(`insert.${ot.insert.id}.open`), ot.insert.text && (st = ot.insert.text.slice(0, Math.round(_(`insert.${ot.insert.id}.type`) * ot.insert.text.length))));
|
|
14473
14473
|
R.fillStyle = e.text;
|
|
14474
14474
|
for (let Z = 0; Z < st.length; Z++) st[Z] !== " " && R.fillText(st[Z], et + Z * r, N);
|
|
14475
|
-
et += lt * r,
|
|
14475
|
+
et += lt * r, G = ot.column + ot.length;
|
|
14476
14476
|
}
|
|
14477
|
-
$(K,
|
|
14477
|
+
$(K, G, Math.max(G, z), et, N);
|
|
14478
14478
|
const it = _(`line.${K}.strike`);
|
|
14479
14479
|
it > 0 && (R.strokeStyle = e.strike, R.lineWidth = Math.max(1.5, s / 10), R.beginPath(), R.moveTo(j, N), R.lineTo(j + X * Math.min(1, it), N), R.stroke()), R.restore();
|
|
14480
14480
|
});
|
|
@@ -14487,7 +14487,7 @@ function K4(t) {
|
|
|
14487
14487
|
R.restore();
|
|
14488
14488
|
}
|
|
14489
14489
|
}, q = (R) => {
|
|
14490
|
-
const { kind: D, rest: Y } = ds(R), _ = (j) => hn("codePanel", R,
|
|
14490
|
+
const { kind: D, rest: Y } = ds(R), _ = (j) => hn("codePanel", R, Uo, j);
|
|
14491
14491
|
if (D === "box") {
|
|
14492
14492
|
if (Y) throw _("box takes no arguments");
|
|
14493
14493
|
return { kind: D };
|
|
@@ -14518,9 +14518,9 @@ function K4(t) {
|
|
|
14518
14518
|
}, tt = (R, D) => {
|
|
14519
14519
|
if (typeof D.text != "string") throw new Error(`codePanel.edit: ${R} needs \`text\` (the text to write)`);
|
|
14520
14520
|
return D.text;
|
|
14521
|
-
},
|
|
14521
|
+
}, U = {
|
|
14522
14522
|
kind: "code",
|
|
14523
|
-
about:
|
|
14523
|
+
about: Uo,
|
|
14524
14524
|
target: W,
|
|
14525
14525
|
lines: n,
|
|
14526
14526
|
box: T(t.x, t.y, c, h),
|
|
@@ -14537,15 +14537,15 @@ function K4(t) {
|
|
|
14537
14537
|
const _ = v(`line.${Y}.highlight`, 0);
|
|
14538
14538
|
x(Y, "highlight", _, D.on === !1 ? 0 : 1, D, 200);
|
|
14539
14539
|
}
|
|
14540
|
-
return
|
|
14540
|
+
return U;
|
|
14541
14541
|
},
|
|
14542
14542
|
strike(R, D) {
|
|
14543
14543
|
for (const Y of P(R)) x(Y, "strike", v(`line.${Y}.strike`, 0), 1, D);
|
|
14544
|
-
return
|
|
14544
|
+
return U;
|
|
14545
14545
|
},
|
|
14546
14546
|
remove(R, D) {
|
|
14547
14547
|
const Y = P(R), _ = D.style ?? "wipe";
|
|
14548
|
-
if (!
|
|
14548
|
+
if (!Ga.includes(_)) throw new Error(`codePanel.remove: ${dt("style", _, Ga)}`);
|
|
14549
14549
|
const j = _ === "wipe" ? 300 : 450, nt = D.at + (D.duration ?? j), $ = D.close ?? 250;
|
|
14550
14550
|
for (const I of Y)
|
|
14551
14551
|
x(I, "wipe", 0, 1, { ...D, easing: D.easing ?? (_ === "fly" ? "ease-in" : void 0) }, j), k.set(I, { style: _, from: D.from ?? "left" }), y.push({ line: I, closed: nt + $ });
|
|
@@ -14556,16 +14556,16 @@ function K4(t) {
|
|
|
14556
14556
|
const K = v(`line.${I}.shift`, 0);
|
|
14557
14557
|
x(I, "shift", K, K + B, { at: nt, duration: $, easing: "ease-in-out" });
|
|
14558
14558
|
}
|
|
14559
|
-
return
|
|
14559
|
+
return U;
|
|
14560
14560
|
},
|
|
14561
14561
|
type(R, D) {
|
|
14562
|
-
return x(R, "reveal", 0, 1, { duration: n[R - 1].length * 45, ...D }),
|
|
14562
|
+
return x(R, "reveal", 0, 1, { duration: n[R - 1].length * 45, ...D }), U;
|
|
14563
14563
|
},
|
|
14564
14564
|
piece(R, D, Y = 1) {
|
|
14565
14565
|
if (typeof R == "string") {
|
|
14566
14566
|
const I = q(R);
|
|
14567
14567
|
if (I.kind !== "token") throw new Error(`codePanel.piece: a piece is a word, token:N:TEXT, not "${R}"`);
|
|
14568
|
-
return
|
|
14568
|
+
return U.piece(I.n, I.text, I.occurrence);
|
|
14569
14569
|
}
|
|
14570
14570
|
const _ = R;
|
|
14571
14571
|
if (D === void 0) throw new Error('codePanel.piece: which word? piece(n, text) or piece("token:N:TEXT")');
|
|
@@ -14574,22 +14574,22 @@ function K4(t) {
|
|
|
14574
14574
|
if (nt) return nt;
|
|
14575
14575
|
if (w.some((I) => I.line === _ && j < I.column + I.text.length && I.column < j + D.length))
|
|
14576
14576
|
throw new Error(`codePanel: "${D}" on line ${_} overlaps another piece`);
|
|
14577
|
-
const $ = { id: w.length + 1, line: _, column: j, text: D, home:
|
|
14577
|
+
const $ = { id: w.length + 1, line: _, column: j, text: D, home: U.token(_, D, Y, 0) };
|
|
14578
14578
|
w.push($);
|
|
14579
14579
|
for (const I of ["x", "y", "rotate", "write", "away"]) C[`piece.${$.id}.${I}`] = 0;
|
|
14580
14580
|
return C[`piece.${$.id}.opacity`] = 1, $;
|
|
14581
14581
|
},
|
|
14582
14582
|
follow(R, D) {
|
|
14583
|
-
return m.follow(R, D),
|
|
14583
|
+
return m.follow(R, D), U;
|
|
14584
14584
|
},
|
|
14585
14585
|
fling(R, D) {
|
|
14586
|
-
return m.fling(R, D),
|
|
14586
|
+
return m.fling(R, D), U;
|
|
14587
14587
|
},
|
|
14588
14588
|
move(R, D) {
|
|
14589
|
-
return m.move(R, D),
|
|
14589
|
+
return m.move(R, D), U;
|
|
14590
14590
|
},
|
|
14591
14591
|
write(R, D, Y) {
|
|
14592
|
-
return R.written = D, E(`piece.${R.id}.write`, 0, 1, { duration: Math.max(1, D.length) * 70, ...Y }),
|
|
14592
|
+
return R.written = D, E(`piece.${R.id}.write`, 0, 1, { duration: Math.max(1, D.length) * 70, ...Y }), U;
|
|
14593
14593
|
},
|
|
14594
14594
|
spot(R, D, Y = 1, _ = 1 / 0) {
|
|
14595
14595
|
S(R);
|
|
@@ -14601,59 +14601,59 @@ function K4(t) {
|
|
|
14601
14601
|
const j = { id: b.length + 1, line: R, column: D, chars: Y.length, text: Y, at: _.at };
|
|
14602
14602
|
b.push(j), C[`insert.${j.id}.open`] = 0, C[`insert.${j.id}.type`] = 0;
|
|
14603
14603
|
const nt = _.duration ?? Y.length * 70;
|
|
14604
|
-
return E(`insert.${j.id}.open`, 0, 1, { at: _.at, duration: nt * 0.6, easing: "ease-out" }), E(`insert.${j.id}.type`, 0, 1, { at: _.at, duration: nt }),
|
|
14604
|
+
return E(`insert.${j.id}.open`, 0, 1, { at: _.at, duration: nt * 0.6, easing: "ease-out" }), E(`insert.${j.id}.type`, 0, 1, { at: _.at, duration: nt }), U;
|
|
14605
14605
|
},
|
|
14606
14606
|
drop(R, D, Y, _) {
|
|
14607
14607
|
S(D);
|
|
14608
|
-
const j = _.duration ?? 250, nt = D === R.line, $ = _.easing ?? (nt ? "linear" : "ease-out"), I =
|
|
14609
|
-
return b.push(B), C[`insert.${B.id}.open`] = 0, E(`insert.${B.id}.open`, 0, 1, { at: _.at, duration: j, easing: nt ? $ : "ease-out" }), E(`piece.${R.id}.away`, v(`piece.${R.id}.away`, 0), 1, { at: _.at, duration: j, easing: nt ? $ : "ease-in-out" }), m.cutAfter(R, _.at),
|
|
14608
|
+
const j = _.duration ?? 250, nt = D === R.line, $ = _.easing ?? (nt ? "linear" : "ease-out"), I = U.landing(R, D, Y, _.at), B = { id: b.length + 1, line: D, column: Y, chars: R.text.length, at: _.at };
|
|
14609
|
+
return b.push(B), C[`insert.${B.id}.open`] = 0, E(`insert.${B.id}.open`, 0, 1, { at: _.at, duration: j, easing: nt ? $ : "ease-out" }), E(`piece.${R.id}.away`, v(`piece.${R.id}.away`, 0), 1, { at: _.at, duration: j, easing: nt ? $ : "ease-in-out" }), m.cutAfter(R, _.at), U.move(R, { at: _.at, duration: j, easing: $, to: { x: I.x, y: I.y } }), E(`piece.${R.id}.rotate`, g.valueAt(`piece.${R.id}.rotate`, _.at), 0, { at: _.at, duration: j }), U;
|
|
14610
14610
|
},
|
|
14611
14611
|
landing(R, D, Y, _ = 1 / 0) {
|
|
14612
|
-
const j =
|
|
14612
|
+
const j = U.spot(D, Y, R.text.length, _), nt = D === R.line && Y > R.column ? R.text.length * r : 0;
|
|
14613
14613
|
return T(j.left - nt, j.top, j.width, j.height);
|
|
14614
14614
|
},
|
|
14615
14615
|
ride(R, D, Y) {
|
|
14616
14616
|
const _ = n.map((j, nt) => {
|
|
14617
14617
|
const $ = g.keys(`line.${nt + 1}.shift`) ?? [];
|
|
14618
|
-
return { top: A(nt + 1), offset: (I) => -
|
|
14618
|
+
return { top: A(nt + 1), offset: (I) => -Ul($, I) * o, windows: Qs($) };
|
|
14619
14619
|
});
|
|
14620
14620
|
return Vl(R, D, { ground: Y.ground, every: Y.every ?? cn, floors: _ });
|
|
14621
14621
|
},
|
|
14622
14622
|
tracks: g.tracks,
|
|
14623
14623
|
anchor(R, D = 1 / 0) {
|
|
14624
14624
|
const Y = q(R);
|
|
14625
|
-
return Y.kind === "box" ?
|
|
14625
|
+
return Y.kind === "box" ? U.box : Y.kind === "line" ? U.line(Y.n, D) : Y.kind === "token" ? U.token(Y.n, Y.text, Y.occurrence, D) : U.spot(Y.n, Y.column, Y.width, D);
|
|
14626
14626
|
},
|
|
14627
14627
|
edit(R, D, Y) {
|
|
14628
14628
|
const _ = () => V(R, D, "line").map((j) => j.n);
|
|
14629
|
-
if (R === "highlight") return
|
|
14630
|
-
if (R === "strike") return
|
|
14631
|
-
if (R === "remove") return
|
|
14629
|
+
if (R === "highlight") return U.highlight(_(), Y);
|
|
14630
|
+
if (R === "strike") return U.strike(_(), Y);
|
|
14631
|
+
if (R === "remove") return U.remove(_(), Y);
|
|
14632
14632
|
if (R === "type") {
|
|
14633
|
-
for (const j of _())
|
|
14634
|
-
return
|
|
14633
|
+
for (const j of _()) U.type(j, Y);
|
|
14634
|
+
return U;
|
|
14635
14635
|
}
|
|
14636
14636
|
if (R === "insert") {
|
|
14637
14637
|
const [j] = V(R, D, "spot", !0);
|
|
14638
|
-
return
|
|
14638
|
+
return U.insert(j.n, j.column, tt(R, Y), Y);
|
|
14639
14639
|
}
|
|
14640
14640
|
if (R === "write" || R === "drop" || R === "move" || R === "fling") {
|
|
14641
|
-
const [j] = V(R, D, "token", !0), nt =
|
|
14642
|
-
if (R === "write") return
|
|
14643
|
-
if (R === "fling") return
|
|
14641
|
+
const [j] = V(R, D, "token", !0), nt = U.piece(j.n, j.text, j.occurrence);
|
|
14642
|
+
if (R === "write") return U.write(nt, tt(R, Y), Y);
|
|
14643
|
+
if (R === "fling") return U.fling(nt, Y);
|
|
14644
14644
|
if (R === "drop") {
|
|
14645
14645
|
const I = typeof Y.into == "string" ? q(Y.into) : void 0;
|
|
14646
14646
|
if (I?.kind !== "spot") throw new Error("codePanel.edit: drop needs `into`, a spot anchor (spot:N:C)");
|
|
14647
|
-
return
|
|
14647
|
+
return U.drop(nt, I.n, I.column, Y);
|
|
14648
14648
|
}
|
|
14649
|
-
const $ = typeof Y.to == "string" ?
|
|
14649
|
+
const $ = typeof Y.to == "string" ? U.anchor(Y.to, Y.at) : Y.to;
|
|
14650
14650
|
if (!$ || typeof $.x != "number" || typeof $.y != "number") throw new Error("codePanel.edit: move needs `to`, an anchor name or { x, y }");
|
|
14651
|
-
return
|
|
14651
|
+
return U.move(nt, { ...Y, to: $ });
|
|
14652
14652
|
}
|
|
14653
|
-
throw Zr("codePanel", R,
|
|
14653
|
+
throw Zr("codePanel", R, Uo);
|
|
14654
14654
|
}
|
|
14655
14655
|
};
|
|
14656
|
-
return
|
|
14656
|
+
return U;
|
|
14657
14657
|
}
|
|
14658
14658
|
function b5(t, e, n, s, o) {
|
|
14659
14659
|
if (e.style === "wipe") {
|
|
@@ -14717,7 +14717,7 @@ const xr = {
|
|
|
14717
14717
|
plain: []
|
|
14718
14718
|
};
|
|
14719
14719
|
xr.typescript = [...xr.javascript, "enum", "interface", "type", "implements", "private", "public", "readonly", "keyof", "as", "declare", "namespace"];
|
|
14720
|
-
const
|
|
14720
|
+
const Ua = Object.keys(xr), k5 = {
|
|
14721
14721
|
go: "//",
|
|
14722
14722
|
rust: "//",
|
|
14723
14723
|
csharp: "//",
|
|
@@ -15161,7 +15161,7 @@ const x0 = ["bar", "line", "pie", "donut"], S0 = 'system-ui, -apple-system, "Seg
|
|
|
15161
15161
|
pull: "slice anchors; { at, duration?, on? }: pull the slice out from the centre (on: false puts it back)"
|
|
15162
15162
|
}
|
|
15163
15163
|
}, $5 = 600, P5 = 500, O5 = 200, I5 = 400, _5 = 0.14, C5 = Math.PI * 2;
|
|
15164
|
-
function
|
|
15164
|
+
function G4(t) {
|
|
15165
15165
|
if (!x0.includes(t.kind)) throw new Error(`chart: ${dt("kind", t.kind, x0)}`);
|
|
15166
15166
|
const e = typeof t.theme == "string" ? t.theme : "light";
|
|
15167
15167
|
if (!(e in Co)) throw new Error(`chart: ${dt("theme", e, Object.keys(Co))}`);
|
|
@@ -15175,46 +15175,46 @@ function U4(t) {
|
|
|
15175
15175
|
if (a.has(H.id)) throw new Error(`chart: two series are called "${H.id}"`);
|
|
15176
15176
|
a.add(H.id);
|
|
15177
15177
|
}
|
|
15178
|
-
const l = new Map(i.map((H,
|
|
15179
|
-
const et = H.values?.[
|
|
15178
|
+
const l = new Map(i.map((H, G) => [H.id, G])), c = (H) => i[l.get(H)].color ?? (l.get(H) === 0 ? n.color : n.palette[l.get(H) % n.palette.length]), h = /* @__PURE__ */ new Set(), u = (H, G) => {
|
|
15179
|
+
const et = H.values?.[G.id] ?? (t.series ? void 0 : H.value) ?? H.value;
|
|
15180
15180
|
if (typeof et != "number" || !Number.isFinite(et))
|
|
15181
|
-
throw new Error(r ? `chart: "${H.id}" needs a value for series "${
|
|
15181
|
+
throw new Error(r ? `chart: "${H.id}" needs a value for series "${G.id}" (\`values: { ${G.id}: … }\`)` : `chart: "${H.id}" needs a \`value\`, a number`);
|
|
15182
15182
|
return et;
|
|
15183
15183
|
};
|
|
15184
15184
|
for (const H of t.data) {
|
|
15185
15185
|
if (typeof H?.id != "string" || !H.id || /[:.]/.test(H.id)) throw new Error(`chart: every datum needs an \`id\` without ":" or "." (got ${JSON.stringify(H?.id)})`);
|
|
15186
15186
|
if (h.has(H.id)) throw new Error(`chart: two data are called "${H.id}"`);
|
|
15187
|
-
for (const
|
|
15187
|
+
for (const G of i) u(H, G);
|
|
15188
15188
|
h.add(H.id);
|
|
15189
15189
|
}
|
|
15190
|
-
const d = s === "bar" ? "bar" : s === "line" ? "point" : "slice", f = Math.max(...t.data.flatMap((H) => i.map((
|
|
15190
|
+
const d = s === "bar" ? "bar" : s === "line" ? "point" : "slice", f = Math.max(...t.data.flatMap((H) => i.map((G) => u(H, G)))), p = o ? t.data.reduce((H, G) => H + u(G, i[0]), 0) : t.max ?? H5(f * 1.1);
|
|
15191
15191
|
if (!o && !(p > 0)) throw new Error(`chart: \`max\` must be above 0 (got ${p})`);
|
|
15192
15192
|
const g = Math.max(10, Math.min(16, t.height / 20)), m = r && t.legend !== !1, y = o ? void 0 : t.axis?.x, k = o ? void 0 : t.axis?.y, w = t.title ? g * 2.3 : g * 0.5, b = {
|
|
15193
15193
|
left: g * 3.6 + (k ? g * 1.5 : 0),
|
|
15194
15194
|
right: t.width - g,
|
|
15195
15195
|
top: (t.title ? g * 3 : g * 1.6) + (m ? g * 1.6 : 0),
|
|
15196
15196
|
bottom: t.height - g * 2.4 - (y ? g * 1.4 : 0)
|
|
15197
|
-
}, S = b.bottom - b.top, E = (b.right - b.left) / t.data.length, v = r ? E * 0.72 / i.length : E * 0.6, x = r ? v * 0.86 : v, M = Math.max(4, g * 0.35), T = S / p, A = new Map(t.data.map((H,
|
|
15197
|
+
}, S = b.bottom - b.top, E = (b.right - b.left) / t.data.length, v = r ? E * 0.72 / i.length : E * 0.6, x = r ? v * 0.86 : v, M = Math.max(4, g * 0.35), T = S / p, A = new Map(t.data.map((H, G) => [H.id, G])), P = (H) => b.left + E * (A.get(H) + 0.5), O = (H, G) => r ? P(H) - E * 0.36 + v * l.get(G) + (v - x) / 2 : P(H) - x / 2, C = (H, G) => O(H, G) + x / 2, W = t.height - g * 1.2, q = {
|
|
15198
15198
|
cx: t.width / 2,
|
|
15199
15199
|
cy: (b.top + W) / 2,
|
|
15200
15200
|
r: Math.max(10, Math.min(t.width / 2, (W - b.top) / 2) - g * 2.6)
|
|
15201
|
-
}, V = s === "donut" ? q.r * 0.55 : 0, tt = s === "donut" ? (V + q.r) / 2 : q.r * 0.62,
|
|
15201
|
+
}, V = s === "donut" ? q.r * 0.55 : 0, tt = s === "donut" ? (V + q.r) / 2 : q.r * 0.62, U = /* @__PURE__ */ new Map();
|
|
15202
15202
|
if (m) {
|
|
15203
15203
|
let H = b.right;
|
|
15204
|
-
for (const
|
|
15205
|
-
const et =
|
|
15206
|
-
|
|
15204
|
+
for (const G of [...i].reverse()) {
|
|
15205
|
+
const et = G.label ?? G.id, it = g * 0.62 * et.length + g * 1.9;
|
|
15206
|
+
U.set(G.id, kt(H - it, w, it, g * 1.4)), H -= it + g * 0.6;
|
|
15207
15207
|
}
|
|
15208
15208
|
}
|
|
15209
|
-
const R = uo(), D = Jr(R), Y = {}, _ = (H,
|
|
15209
|
+
const R = uo(), D = Jr(R), Y = {}, _ = (H, G, et) => r ? `${d}.${H}.${G}.${et}` : `${d}.${H}.${et}`;
|
|
15210
15210
|
for (const H of t.data)
|
|
15211
|
-
for (const
|
|
15212
|
-
Y[_(H.id,
|
|
15213
|
-
const j = (H,
|
|
15214
|
-
const
|
|
15211
|
+
for (const G of i)
|
|
15212
|
+
Y[_(H.id, G.id, "value")] = u(H, G), Y[_(H.id, G.id, "show")] = H.hidden ? 0 : 1, Y[_(H.id, G.id, "highlight")] = 0, o && (Y[_(H.id, G.id, "pull")] = 0);
|
|
15213
|
+
const j = (H, G) => R.keys(H)?.length ? Ul(R.keys(H), G) : Y[H], nt = (H, G, et) => j(_(H, G, "value"), et) * (s === "bar" ? j(_(H, G, "show"), et) : 1) * T, $ = (H) => {
|
|
15214
|
+
const G = i[0].id, et = t.data.map((st) => Math.max(0, H(_(st.id, G, "value"))) * Math.max(0, Math.min(1, H(_(st.id, G, "show"))))), it = et.reduce((st, Z) => st + Z, 0), ot = /* @__PURE__ */ new Map();
|
|
15215
15215
|
let lt = -Math.PI / 2;
|
|
15216
15216
|
return t.data.forEach((st, Z) => {
|
|
15217
|
-
const rt = it > 0 ? C5 * et[Z] / it : 0, ct = lt + rt / 2, ut = Math.max(0, Math.min(1, H(_(st.id,
|
|
15217
|
+
const rt = it > 0 ? C5 * et[Z] / it : 0, ct = lt + rt / 2, ut = Math.max(0, Math.min(1, H(_(st.id, G, "pull")))) * q.r * _5;
|
|
15218
15218
|
ot.set(st.id, {
|
|
15219
15219
|
start: lt,
|
|
15220
15220
|
sweep: rt,
|
|
@@ -15223,43 +15223,43 @@ function U4(t) {
|
|
|
15223
15223
|
centre: { x: q.cx + Math.cos(ct) * (tt + ut), y: q.cy + Math.sin(ct) * (tt + ut) }
|
|
15224
15224
|
}), lt += rt;
|
|
15225
15225
|
}), ot;
|
|
15226
|
-
}, I = (H) => $((
|
|
15227
|
-
const { kind:
|
|
15228
|
-
if (
|
|
15226
|
+
}, I = (H) => $((G) => j(G, H)), B = (H) => {
|
|
15227
|
+
const { kind: G, rest: et } = ds(H), it = (ot) => hn("chart", H, jn, ot);
|
|
15228
|
+
if (G === "box") {
|
|
15229
15229
|
if (et) throw it("box takes no arguments");
|
|
15230
15230
|
return { kind: "box" };
|
|
15231
15231
|
}
|
|
15232
|
-
if (
|
|
15233
|
-
if (!
|
|
15232
|
+
if (G === "legend") {
|
|
15233
|
+
if (!U.has(et)) throw it(m ? `there is no series "${et}" (series: ${i.map((ot) => ot.id).join(", ")})` : "only a chart with several series has a legend");
|
|
15234
15234
|
return { kind: "legend", series: et };
|
|
15235
15235
|
}
|
|
15236
|
-
if (
|
|
15237
|
-
if (!et) throw it(`write it ${
|
|
15236
|
+
if (G === "bar" || G === "point" || G === "slice" || G === "label" || G === "value") {
|
|
15237
|
+
if (!et) throw it(`write it ${G}:ID`);
|
|
15238
15238
|
const ot = et.indexOf(":"), lt = ot < 0 ? et : et.slice(0, ot), st = ot < 0 ? i[0].id : et.slice(ot + 1);
|
|
15239
15239
|
if (!A.has(lt)) throw it(`there is no "${lt}" (data: ${[...A.keys()].join(", ")})`);
|
|
15240
15240
|
if (!a.has(st)) throw it(`there is no series "${st}" (series: ${i.map((Z) => Z.id).join(", ")})`);
|
|
15241
|
-
if (
|
|
15242
|
-
if ((
|
|
15243
|
-
return { kind:
|
|
15241
|
+
if (G === "label" && ot >= 0) throw it("a label is one per datum: label:ID");
|
|
15242
|
+
if ((G === "bar" || G === "point" || G === "slice") && G !== d) throw it(`a ${s} chart has ${d}s, not ${G}s: ${d}:${lt}`);
|
|
15243
|
+
return { kind: G, id: lt, series: st };
|
|
15244
15244
|
}
|
|
15245
15245
|
throw it();
|
|
15246
|
-
}, K = (H,
|
|
15246
|
+
}, K = (H, G) => {
|
|
15247
15247
|
if (H.kind === "box") return kt(0, 0, t.width, t.height);
|
|
15248
|
-
if (H.kind === "legend") return
|
|
15248
|
+
if (H.kind === "legend") return U.get(H.series);
|
|
15249
15249
|
if (o) {
|
|
15250
|
-
const st = I(
|
|
15250
|
+
const st = I(G).get(H.id), Z = Math.max(g * 1.5, q.r * 0.42);
|
|
15251
15251
|
if (H.kind === "slice") return kt(st.centre.x - Z / 2, st.centre.y - Z / 2, Z, Z);
|
|
15252
15252
|
const rt = L(st);
|
|
15253
15253
|
return H.kind === "label" ? rt : st.sweep >= 0.3 ? kt(st.centre.x - g * 1.6, st.centre.y - g * 0.65, g * 3.2, g * 1.3) : kt(rt.left, rt.bottom, rt.width, g * 1.3);
|
|
15254
15254
|
}
|
|
15255
|
-
const et = H.kind === "label" ? P(H.id) : C(H.id, H.series), it = b.bottom - nt(H.id, H.series,
|
|
15255
|
+
const et = H.kind === "label" ? P(H.id) : C(H.id, H.series), it = b.bottom - nt(H.id, H.series, G);
|
|
15256
15256
|
if (H.kind === "bar") return kt(et - x / 2, it, x, b.bottom - it);
|
|
15257
15257
|
if (H.kind === "point") return kt(P(H.id) - M, it - M, M * 2, M * 2);
|
|
15258
15258
|
if (H.kind === "label") return kt(et - E / 2, b.bottom + g * 0.4, E, g * 1.4);
|
|
15259
15259
|
const ot = it - (s === "line" ? M : 0) - g * 0.3, lt = r && s === "bar" ? v : E;
|
|
15260
15260
|
return kt((s === "line" ? P(H.id) : et) - lt / 2, ot - g * 1.3, lt, g * 1.3);
|
|
15261
15261
|
}, L = (H) => {
|
|
15262
|
-
const
|
|
15262
|
+
const G = q.r + H.out + g * 0.9, et = { x: q.cx + Math.cos(H.mid) * G, y: q.cy + Math.sin(H.mid) * G }, it = g * 4.2, ot = Math.cos(H.mid), lt = ot > 0.2 ? et.x : ot < -0.2 ? et.x - it : et.x - it / 2;
|
|
15263
15263
|
return kt(lt, et.y - g * 0.7, it, g * 1.4);
|
|
15264
15264
|
}, F = (H) => kt(t.x + H.left, t.y + H.top, H.width, H.height), N = (H) => `${t.prefix ?? ""}${H.toFixed(t.decimals ?? 0)}${t.suffix ?? ""}`, X = /* @__PURE__ */ new Map(), z = {
|
|
15265
15265
|
type: "custom",
|
|
@@ -15274,12 +15274,12 @@ function U4(t) {
|
|
|
15274
15274
|
props: Object.fromEntries(Object.keys(Y).map((H) => [H, L5(H)])),
|
|
15275
15275
|
actions: jn.edits
|
|
15276
15276
|
},
|
|
15277
|
-
draw(H,
|
|
15278
|
-
const et =
|
|
15277
|
+
draw(H, G) {
|
|
15278
|
+
const et = G.props ?? {}, it = (st) => Number(et[st] ?? Y[st] ?? 0);
|
|
15279
15279
|
if (H.save(), H.fillStyle = n.background, T0(H, 0, 0, t.width, t.height, 8), H.fill(), H.font = `${g}px ${n.font}`, H.textBaseline = "middle", t.title && (H.fillStyle = n.text, H.textAlign = "left", H.font = `600 ${g * 1.2}px ${n.font}`, H.fillText(t.title, o ? g : b.left, g * 1.5), H.font = `${g}px ${n.font}`), m) {
|
|
15280
15280
|
H.textAlign = "left";
|
|
15281
15281
|
for (const st of i) {
|
|
15282
|
-
const Z =
|
|
15282
|
+
const Z = U.get(st.id);
|
|
15283
15283
|
H.fillStyle = c(st.id), T0(H, Z.left, Z.top + g * 0.25, g * 0.9, g * 0.9, 2), H.fill(), H.fillStyle = n.text, H.fillText(st.label ?? st.id, Z.left + g * 1.3, Z.top + Z.height / 2);
|
|
15284
15284
|
}
|
|
15285
15285
|
}
|
|
@@ -15324,20 +15324,20 @@ function U4(t) {
|
|
|
15324
15324
|
H.strokeStyle = n.text, H.lineWidth = 1.5, H.beginPath(), H.moveTo(b.left, b.bottom), H.lineTo(b.right, b.bottom), H.stroke(), H.restore();
|
|
15325
15325
|
}
|
|
15326
15326
|
};
|
|
15327
|
-
function J(H,
|
|
15328
|
-
const et = i[0].id, it = $(
|
|
15327
|
+
function J(H, G) {
|
|
15328
|
+
const et = i[0].id, it = $(G);
|
|
15329
15329
|
t.data.forEach((ot, lt) => {
|
|
15330
15330
|
const st = it.get(ot.id);
|
|
15331
15331
|
if (st.sweep <= 1e-4) return;
|
|
15332
|
-
const Z = X.get(ot.id), rt = Z ? { x:
|
|
15332
|
+
const Z = X.get(ot.id), rt = Z ? { x: G(`piece.${Z.id}.x`), y: G(`piece.${Z.id}.y`) } : { x: 0, y: 0 }, ct = Z ? G(`piece.${Z.id}.rotate`) * Math.PI / 180 : 0, ut = Z ? G(`piece.${Z.id}.opacity`) : 1;
|
|
15333
15333
|
if (ut <= 0) return;
|
|
15334
15334
|
H.save(), H.globalAlpha = ut;
|
|
15335
15335
|
const yt = { x: q.cx + Math.cos(st.mid) * st.out, y: q.cy + Math.sin(st.mid) * st.out };
|
|
15336
|
-
H.translate(st.centre.x + rt.x, st.centre.y + rt.y), H.rotate(ct), H.translate(-st.centre.x, -st.centre.y), H.beginPath(), H.arc(yt.x, yt.y, q.r, st.start, st.start + st.sweep), V > 0 ? H.arc(yt.x, yt.y, V, st.start + st.sweep, st.start, !0) : H.lineTo(yt.x, yt.y), H.closePath(), H.fillStyle = Ki(n.palette[lt % n.palette.length], n.highlight,
|
|
15336
|
+
H.translate(st.centre.x + rt.x, st.centre.y + rt.y), H.rotate(ct), H.translate(-st.centre.x, -st.centre.y), H.beginPath(), H.arc(yt.x, yt.y, q.r, st.start, st.start + st.sweep), V > 0 ? H.arc(yt.x, yt.y, V, st.start + st.sweep, st.start, !0) : H.lineTo(yt.x, yt.y), H.closePath(), H.fillStyle = Ki(n.palette[lt % n.palette.length], n.highlight, G(_(ot.id, et, "highlight"))), H.fill(), H.strokeStyle = n.background, H.lineWidth = Math.max(1.5, g * 0.15), H.stroke(), t.values !== !1 && st.sweep >= 0.3 && (H.fillStyle = n.background, H.font = `600 ${g}px ${n.font}`, H.textAlign = "center", H.fillText(N(G(_(ot.id, et, "value"))), st.centre.x, st.centre.y), H.font = `${g}px ${n.font}`), H.restore();
|
|
15337
15337
|
const bt = L(st), re = Math.cos(st.mid);
|
|
15338
15338
|
H.globalAlpha = ut, H.fillStyle = n.text, H.textAlign = re > 0.2 ? "left" : re < -0.2 ? "right" : "center";
|
|
15339
15339
|
const ps = re > 0.2 ? bt.left : re < -0.2 ? bt.right : bt.left + bt.width / 2;
|
|
15340
|
-
H.fillText(ot.label ?? ot.id, ps, bt.top + bt.height / 2), t.values !== !1 && st.sweep < 0.3 && (H.globalAlpha = ut * 0.8, H.fillText(N(
|
|
15340
|
+
H.fillText(ot.label ?? ot.id, ps, bt.top + bt.height / 2), t.values !== !1 && st.sweep < 0.3 && (H.globalAlpha = ut * 0.8, H.fillText(N(G(_(ot.id, et, "value"))), ps, bt.bottom + g * 0.65)), H.globalAlpha = 1;
|
|
15341
15341
|
});
|
|
15342
15342
|
}
|
|
15343
15343
|
const Q = {
|
|
@@ -15347,22 +15347,22 @@ function U4(t) {
|
|
|
15347
15347
|
target: z,
|
|
15348
15348
|
max: p,
|
|
15349
15349
|
box: kt(t.x, t.y, t.width, t.height),
|
|
15350
|
-
anchor(H,
|
|
15351
|
-
return F(K(B(H),
|
|
15350
|
+
anchor(H, G = 1 / 0) {
|
|
15351
|
+
return F(K(B(H), G));
|
|
15352
15352
|
},
|
|
15353
15353
|
piece(H) {
|
|
15354
|
-
const
|
|
15355
|
-
if (
|
|
15354
|
+
const G = B(H);
|
|
15355
|
+
if (G.kind !== "slice")
|
|
15356
15356
|
throw new Error(o ? `chart: a piece is a slice, slice:ID, not "${H}"` : `chart: a ${d} is not a piece; slices of a pie or donut are (slice:ID). Change a ${d} with edit('set' | 'show' | 'highlight', …)`);
|
|
15357
|
-
const et = X.get(
|
|
15357
|
+
const et = X.get(G.id);
|
|
15358
15358
|
if (et) return et;
|
|
15359
|
-
const it = { id: X.size + 1, datum:
|
|
15360
|
-
X.set(
|
|
15359
|
+
const it = { id: X.size + 1, datum: G.id, home: F(K(G, 0)) };
|
|
15360
|
+
X.set(G.id, it);
|
|
15361
15361
|
for (const ot of ["x", "y", "rotate"]) Y[`piece.${it.id}.${ot}`] = 0;
|
|
15362
15362
|
return Y[`piece.${it.id}.opacity`] = 1, it;
|
|
15363
15363
|
},
|
|
15364
|
-
edit(H,
|
|
15365
|
-
const it = Array.isArray(
|
|
15364
|
+
edit(H, G, et) {
|
|
15365
|
+
const it = Array.isArray(G) ? G : [G];
|
|
15366
15366
|
if (it.length === 0) throw new Error(`chart.edit: ${H} takes at least one anchor`);
|
|
15367
15367
|
if (!(H in jn.edits)) throw Zr("chart", H, jn);
|
|
15368
15368
|
if (H === "pull" && !o) throw new Error(`chart.edit: pull takes slice anchors of a pie or donut; a ${s} chart has ${d}s`);
|
|
@@ -15380,16 +15380,16 @@ function U4(t) {
|
|
|
15380
15380
|
}
|
|
15381
15381
|
return Q;
|
|
15382
15382
|
},
|
|
15383
|
-
follow(H,
|
|
15384
|
-
return D.follow(H,
|
|
15383
|
+
follow(H, G) {
|
|
15384
|
+
return D.follow(H, G), Q;
|
|
15385
15385
|
},
|
|
15386
|
-
fling(H,
|
|
15387
|
-
return D.fling(H,
|
|
15386
|
+
fling(H, G) {
|
|
15387
|
+
return D.fling(H, G), Q;
|
|
15388
15388
|
},
|
|
15389
|
-
move(H,
|
|
15390
|
-
return D.move(H,
|
|
15389
|
+
move(H, G) {
|
|
15390
|
+
return D.move(H, G), Q;
|
|
15391
15391
|
},
|
|
15392
|
-
ride(H,
|
|
15392
|
+
ride(H, G, et) {
|
|
15393
15393
|
if (s !== "bar") return H;
|
|
15394
15394
|
const it = t.data.flatMap(
|
|
15395
15395
|
(ot) => i.map((lt) => {
|
|
@@ -15397,7 +15397,7 @@ function U4(t) {
|
|
|
15397
15397
|
return { top: t.y + b.bottom - st, offset: (rt) => st - nt(ot.id, lt.id, rt), windows: Z };
|
|
15398
15398
|
})
|
|
15399
15399
|
);
|
|
15400
|
-
return Vl(H,
|
|
15400
|
+
return Vl(H, G, { ground: et.ground, every: et.every ?? cn, floors: it });
|
|
15401
15401
|
},
|
|
15402
15402
|
tracks: R.tracks
|
|
15403
15403
|
};
|
|
@@ -15504,7 +15504,7 @@ const Sr = {
|
|
|
15504
15504
|
outfit: { shirt: "#ae7396", trousers: "#648769", sleeves: "short", bottom: "skirt" }
|
|
15505
15505
|
}
|
|
15506
15506
|
};
|
|
15507
|
-
function
|
|
15507
|
+
function U4(t, e = {}) {
|
|
15508
15508
|
if (!Object.prototype.hasOwnProperty.call(Sr, t)) throw new Error(`softCartoonCharacter: unknown actor '${t}'`);
|
|
15509
15509
|
const n = Sr[t], s = { ...n.body };
|
|
15510
15510
|
return e.body?.measurements !== void 0 && delete s.torso, ho({ ...n, ...e, body: { ...s, ...e.body }, face: { ...n.face, ...e.face } });
|
|
@@ -15873,7 +15873,7 @@ function Z4(t, e, n, s = {}) {
|
|
|
15873
15873
|
const k = y ? a ? 1 : 0.62 : a ? 3 : 3.38;
|
|
15874
15874
|
let w = { ...at, ...m.pose, turn: k, lean: (m.pose?.lean ?? 0) + o.lean };
|
|
15875
15875
|
const b = y ? 1 : -1, S = (E, v, x) => {
|
|
15876
|
-
w =
|
|
15876
|
+
w = Ge(m.character, w, E, { x: c.x + v - m.x, y: c.y, depth: x });
|
|
15877
15877
|
};
|
|
15878
15878
|
if (t === "handOver") {
|
|
15879
15879
|
const E = A0 * l;
|
|
@@ -15899,7 +15899,7 @@ function tT(t, e, n = {}) {
|
|
|
15899
15899
|
const y = m ? r ? 1 : 0.62 : r ? 3 : 3.38, k = m ? 1 : -1;
|
|
15900
15900
|
let w = { ...at, ...p.pose, turn: y, lean: (p.pose?.lean ?? 0) + Va.lean, "head.tilt": (p.pose?.["head.tilt"] ?? 0) + k * Va.tilt };
|
|
15901
15901
|
const { over: b, round: S } = a(p, g, k);
|
|
15902
|
-
return w =
|
|
15902
|
+
return w = Ge(p.character, w, "arm.right", b), w = Ge(p.character, w, "arm.left", S), w;
|
|
15903
15903
|
}, c = l(s, o, !0), h = l(o, s, !1), u = 0.05 * i, d = (p, g, m, y) => {
|
|
15904
15904
|
const k = ye(p.character, y).points, { over: w, round: b } = a(p, g, m);
|
|
15905
15905
|
return Math.hypot(k["hand.right"].x - w.x, k["hand.right"].y - w.y) < u && Math.hypot(k["hand.left"].x - b.x, k["hand.left"].y - b.y) < u;
|
|
@@ -15913,10 +15913,10 @@ function eT(t, e) {
|
|
|
15913
15913
|
function nT(t, e, n, s = {}) {
|
|
15914
15914
|
const o = Math.max(0, Math.min(1, n)), r = s.view === "side", i = t.x <= e.x, a = Math.min(t.character.height, e.character.height), l = { x: (t.x + e.x) / 2, y: -(Yn.low + (Yn.high - Yn.low) * o) * a }, c = (m) => m ? r ? 1 : 0.62 : r ? 3 : 3.38;
|
|
15915
15915
|
let h = { ...at, ...t.pose, turn: c(i), lean: (t.pose?.lean ?? 0) + Yn.helperLean * (1 - o) + 4, bend: (t.pose?.bend ?? 0) + Yn.helperBend * (1 - o), "head.nod": 18 * (1 - o) };
|
|
15916
|
-
h =
|
|
15916
|
+
h = Ge(t.character, h, "arm.right", { x: l.x - t.x, y: l.y });
|
|
15917
15917
|
const u = { ...Me.sitFloor, ...e.pose, turn: c(!i) }, d = { ...at, ...e.pose, turn: c(!i) };
|
|
15918
15918
|
let f = Pf(u, d, o);
|
|
15919
|
-
f =
|
|
15919
|
+
f = Ge(e.character, f, "arm.right", { x: l.x - e.x, y: l.y });
|
|
15920
15920
|
const p = 0.04 * a, g = (m, y) => {
|
|
15921
15921
|
const k = ye(m.character, y).points["hand.right"];
|
|
15922
15922
|
return Math.hypot(k.x + m.x - l.x, k.y - l.y) < p;
|
|
@@ -15933,7 +15933,7 @@ function D5(t, e = {}) {
|
|
|
15933
15933
|
const n = { ...$0[t], ...e };
|
|
15934
15934
|
return e.top && e.top !== "shirt" && (n.collar = e.collar ?? !1, n.tie = e.tie ?? null), n.top === "dress" && (n.bottom = "skirt"), n;
|
|
15935
15935
|
}
|
|
15936
|
-
const B5 = 0.7, z5 = 50, q5 = 1.2, j5 = 0.8, Y5 = 3, K5 = 30, X5 = 0.8,
|
|
15936
|
+
const B5 = 0.7, z5 = 50, q5 = 1.2, j5 = 0.8, Y5 = 3, K5 = 30, X5 = 0.8, G5 = 0.6, Xi = (t, e) => Math.max(-e, Math.min(e, t)), U5 = ["hair.swing", "hair.trail", "hair.lift"];
|
|
15937
15937
|
function V5(t, e) {
|
|
15938
15938
|
const n = e.start ?? 0, s = e.amount ?? 1, o = Math.max(1e-6, e.headRadius);
|
|
15939
15939
|
let r = NaN, i = { x: 0, y: 0, turn: 0 };
|
|
@@ -15942,7 +15942,7 @@ function V5(t, e) {
|
|
|
15942
15942
|
return p.turn * 90 + (p.headTurn ?? 0);
|
|
15943
15943
|
}, c = { start: n, end: e.end, step: e.step, stiffness: e.stiffness ?? 70, damping: e.damping ?? 6 }, h = zo(l, c), u = zo((f) => a(f).x, c), d = zo((f) => a(f).y, c);
|
|
15944
15944
|
return h.map((f, p) => {
|
|
15945
|
-
const g = a(f.time), m = f.value - l(f.time), y = u[p].value - g.x - (e.wind ?? 0) * B5 * o, k = d[p].value - g.y, w = Math.sin(g.turn * Math.PI / 2), b = Math.cos(g.turn * Math.PI / 2), S = m * Y5 + y * b / o * K5, E = -y * w / o * X5, v = -k / o *
|
|
15945
|
+
const g = a(f.time), m = f.value - l(f.time), y = u[p].value - g.x - (e.wind ?? 0) * B5 * o, k = d[p].value - g.y, w = Math.sin(g.turn * Math.PI / 2), b = Math.cos(g.turn * Math.PI / 2), S = m * Y5 + y * b / o * K5, E = -y * w / o * X5, v = -k / o * G5;
|
|
15946
15946
|
return {
|
|
15947
15947
|
time: f.time,
|
|
15948
15948
|
swing: Xi(S * s, z5),
|
|
@@ -16008,7 +16008,7 @@ function oT(t, e, n, s = {}) {
|
|
|
16008
16008
|
wind: s.wind
|
|
16009
16009
|
}
|
|
16010
16010
|
), y = [];
|
|
16011
|
-
for (const k of
|
|
16011
|
+
for (const k of U5) {
|
|
16012
16012
|
const w = k.slice(5);
|
|
16013
16013
|
let b = m.map((E) => ({ time: E.time, value: E[w] }));
|
|
16014
16014
|
if (b.every((E) => Math.abs(E.value) < 1e-3)) continue;
|
|
@@ -16089,7 +16089,7 @@ function ng(t) {
|
|
|
16089
16089
|
const { base: e, ...n } = t;
|
|
16090
16090
|
return { ...ts[e ?? "full"], ...n };
|
|
16091
16091
|
}
|
|
16092
|
-
const Ja = 160, Z5 = 120, Q5 = 700,
|
|
16092
|
+
const Ja = 160, Z5 = 120, Q5 = 700, Gi = 60, tv = 90, Ho = 3200, es = 1, un = 1e-6;
|
|
16093
16093
|
function Jl(t, e, n = {}) {
|
|
16094
16094
|
const s = ng(n.style), o = n.seed ?? 1, r = {};
|
|
16095
16095
|
if (t.length === 0) return r;
|
|
@@ -16161,7 +16161,7 @@ function ev(t, e, n, s, o) {
|
|
|
16161
16161
|
return h;
|
|
16162
16162
|
}
|
|
16163
16163
|
function nv(t, e, n, s, o) {
|
|
16164
|
-
const r = [], i =
|
|
16164
|
+
const r = [], i = Gi + tv;
|
|
16165
16165
|
for (let f = 1; f < t.length; f++) {
|
|
16166
16166
|
const p = t[f - 1].pose, g = t[f].pose;
|
|
16167
16167
|
Object.entries(e.headTurns).some(([y, k]) => Math.abs((g[y] ?? 0) - (p[y] ?? 0)) > k) && t[f].act !== !1 && r.push(Math.max(t[0].time, t[f - 1].time - n.eyeLead));
|
|
@@ -16177,7 +16177,7 @@ function nv(t, e, n, s, o) {
|
|
|
16177
16177
|
const d = [{ time: a, value: o }];
|
|
16178
16178
|
for (const f of r) {
|
|
16179
16179
|
const p = d[d.length - 1].time;
|
|
16180
|
-
f +
|
|
16180
|
+
f + Gi <= p + es || (f > p + es && d.push({ time: f, value: o }), d.push({ time: f + Gi, value: 1, easing: "ease-in" }), d.push({ time: f + i, value: o, easing: "ease-out" }));
|
|
16181
16181
|
}
|
|
16182
16182
|
return d.length > 1 ? d : [];
|
|
16183
16183
|
}
|
|
@@ -16598,7 +16598,7 @@ const H0 = {
|
|
|
16598
16598
|
tired: 1500,
|
|
16599
16599
|
shove: 1300,
|
|
16600
16600
|
run: 560
|
|
16601
|
-
}, yv = 450, bv = 2.4, wv = 160, R0 = 2.5, kv = 200, vv = 340, Mv = 1.1, F0 = [380, 900], xv = 0.35, Fo = 300,
|
|
16601
|
+
}, yv = 450, bv = 2.4, wv = 160, R0 = 2.5, kv = 200, vv = 340, Mv = 1.1, F0 = [380, 900], xv = 0.35, Fo = 300, Ui = 150, Sv = 260, Tv = 1.2, Vi = 160, L0 = 400, Ts = 300, Ev = 450, W0 = 500, Ji = 350, N0 = 150, Av = 120, Zi = 180, D0 = 420, $v = 300, B0 = 300, Pv = 140, Qi = 150, z0 = 450, Ov = 450, ta = 150, q0 = 350, j0 = 400, Iv = 12, _v = 600, Y0 = 90, K0 = 400, Cv = 200, Hv = 0.09, X0 = 350, $e = 450, ea = 1200, Rv = 700, Fn = 320, Pe = 220, Fv = 65, Lv = 700, G0 = (t) => t in vn, Wv = (t) => t in he;
|
|
16602
16602
|
function Nv(t) {
|
|
16603
16603
|
return Math.max(Lv, Array.from(t).length * Fv);
|
|
16604
16604
|
}
|
|
@@ -16623,13 +16623,13 @@ function Ql(t, e, n = {}) {
|
|
|
16623
16623
|
}, tt = (_) => {
|
|
16624
16624
|
const j = ke(_, { height: u, facing: p });
|
|
16625
16625
|
return { x: d + (j.hands.right.x + j.fingertips.right.x) / 2, y: f + (j.hands.right.y + j.fingertips.right.y) / 2 };
|
|
16626
|
-
},
|
|
16626
|
+
}, U = (_, j, nt) => {
|
|
16627
16627
|
const $ = { ..._, rightWrist: 0, rightElbow: 0, rightShoulder: q(_, j, nt) }, I = ke($, { height: u, facing: p }), B = { x: d + I.shoulders.right.x, y: f + I.shoulders.right.y }, K = { x: d + I.elbows.right.x, y: f + I.elbows.right.y }, L = tt($), F = Math.hypot(K.x - B.x, K.y - B.y), N = Math.hypot(L.x - K.x, L.y - K.y), X = Math.min(F + N - 0.01, Math.max(Math.abs(F - N) + 0.01, Math.hypot(j - B.x, nt - B.y))), z = (et) => et * 180 / Math.PI, J = z(Math.acos((F * F + X * X - N * N) / (2 * F * X))), Q = 180 - z(Math.acos((F * F + N * N - X * X) / (2 * F * N)));
|
|
16628
|
-
let H = { rightShoulder: $.rightShoulder, rightElbow: 0 },
|
|
16628
|
+
let H = { rightShoulder: $.rightShoulder, rightElbow: 0 }, G = 1 / 0;
|
|
16629
16629
|
for (const et of [1, -1])
|
|
16630
16630
|
for (const it of [1, -1]) {
|
|
16631
16631
|
const ot = { rightShoulder: $.rightShoulder + et * J, rightElbow: it * Q }, lt = { ..._, rightWrist: 0, ...ot }, st = tt(lt), rt = Math.hypot(st.x - j, st.y - nt) - ke(lt, { height: u, facing: p }).elbows.right.y * 1e-3;
|
|
16632
|
-
rt <
|
|
16632
|
+
rt < G && (G = rt, H = ot);
|
|
16633
16633
|
}
|
|
16634
16634
|
return H;
|
|
16635
16635
|
}, R = (_, j, nt) => Math.abs(j - d) < 2 ? _ : (w.push({ time: _, value: d - c }, { time: _ + nt, value: j - c, easing: "ease-in-out" }), d = j, _ + nt);
|
|
@@ -16659,7 +16659,7 @@ function Ql(t, e, n = {}) {
|
|
|
16659
16659
|
P(N + kv, { stretch: 0.75, bend: 12, leftHip: 22, rightHip: 22, ...X }, _.mood, !1);
|
|
16660
16660
|
const z = N + vv;
|
|
16661
16661
|
P(z - 40, { stretch: 0.72 }, void 0, !1), P(z, { stretch: 1.2, bend: -6, leftShoulder: 140, rightShoulder: 140, leftElbow: 20, rightElbow: 20, leftHip: 4, rightHip: 4 }, void 0, !1);
|
|
16662
|
-
const J = Math.hypot(L - d, F - f), Q = _.for ?? Math.min(F0[1], Math.max(F0[0], 300 + J * Mv)), H = Math.min(f, F) - xv * u,
|
|
16662
|
+
const J = Math.hypot(L - d, F - f), Q = _.for ?? Math.min(F0[1], Math.max(F0[0], 300 + J * Mv)), H = Math.min(f, F) - xv * u, G = Math.sqrt(f - H), et = Math.sqrt(F - H), it = z + Q * G / (G + et), ot = z + Q;
|
|
16663
16663
|
P(it, { stretch: 1, bend: 4, leftHip: -55, leftKnee: -80, rightHip: 55, rightKnee: 80, leftShoulder: 110, rightShoulder: 110 }, void 0, !1), P(ot, { stretch: 0.72, bend: 12, leftShoulder: 75, rightShoulder: 75, leftElbow: 0, rightElbow: 0, leftHip: 18, rightHip: 18, leftKnee: 0, rightKnee: 0 }, void 0, !1), P(ot + 180, { stretch: 1.05, bend: -3 }, void 0, !1), P(ot + 340, { stretch: 1, bend: 0, leftHip: ht.leftHip, rightHip: ht.rightHip, leftShoulder: ht.leftShoulder, rightShoulder: ht.rightShoulder, leftElbow: ht.leftElbow, rightElbow: ht.rightElbow }, void 0, !1), w.push({ time: z, value: d - c }, { time: ot, value: L - c }), b.push(
|
|
16664
16664
|
{ time: z, value: f - h },
|
|
16665
16665
|
{ time: it, value: H - h, easing: "ease-out-quad" },
|
|
@@ -16672,11 +16672,11 @@ function Ql(t, e, n = {}) {
|
|
|
16672
16672
|
const L = _.target ?? { x: d + p * u * 0.5, y: f - u * 0.6 }, F = C(L.x), N = W(j, L.x, _.mood), X = F === 1 ? L.left ?? L.x : L.right ?? L.x, z = F === 1 ? L.right ?? L.x : L.left ?? L.x, J = { ...g, turn: 1, lean: -10, bend: -8, rightElbow: 40, lookX: 1, ...B };
|
|
16673
16673
|
P(N + Fo, { ...J, rightShoulder: q(J, d - p * u * 0.3, f - u * 1.1) }, _.mood, !1);
|
|
16674
16674
|
const Q = { ...g, lean: 6, bend: 4, rightElbow: 0, rightWrist: 0 }, H = { ...g, lean: 14, bend: 12, rightElbow: 0, rightWrist: 0 };
|
|
16675
|
-
R(N, V(Q, X, L.y, "arm"), Fo +
|
|
16676
|
-
const
|
|
16677
|
-
P(
|
|
16678
|
-
const et =
|
|
16679
|
-
w.push({ time:
|
|
16675
|
+
R(N, V(Q, X, L.y, "arm"), Fo + Ui), P(N + Fo + Ui, { lean: -12 }, void 0, !1);
|
|
16676
|
+
const G = N + Fo + Ui + 80;
|
|
16677
|
+
P(G, { ...Q, rightShoulder: q(Q, X, L.y) }, void 0, !1);
|
|
16678
|
+
const et = G + (_.for ?? Math.max(Sv, Math.abs(z - X) / Tv));
|
|
16679
|
+
w.push({ time: G, value: d - c }), d = V(H, z, L.y, "arm"), w.push({ time: et, value: d - c }), P(et, { ...H, rightShoulder: q(H, z, L.y) }, void 0, !1), P(et + Vi, { lean: 16, bend: 14, rightShoulder: q(g, z + F * u * 0.4, L.y + u * 0.25) }, void 0, !1), P(et + Vi + L0, { lean: 0, bend: 0, rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow }), nt = et + Vi + L0, $ = G, I = et;
|
|
16680
16680
|
} else if (_.do === "grab" && _.target) {
|
|
16681
16681
|
const L = _.target, F = W(j, L.x, _.mood), N = L.y > f - u * 0.5, X = {
|
|
16682
16682
|
...g,
|
|
@@ -16715,29 +16715,29 @@ function Ql(t, e, n = {}) {
|
|
|
16715
16715
|
P(J, { ...X, rightShoulder: q(X, L.x, L.y) }, _.mood, !1), P(J + ta, {}, void 0, !1), P(J + ta + q0, { bend: 0, lean: 0, stretch: 1, rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow, lookY: 0 }), nt = J + ta + q0, $ = J;
|
|
16716
16716
|
} else if (_.do === "write" && _.target) {
|
|
16717
16717
|
const L = _.target, F = L.left ?? L.x, N = L.right ?? L.x, X = W(j, (F + N) / 2, _.mood), z = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, ...vt.thinking, lookX: 1, lookY: 0, ...B }, J = (st) => V(z, st, L.y, "arm") + p * u * 0.08, Q = (st) => {
|
|
16718
|
-
const Z = tt({ ...z, ...
|
|
16718
|
+
const Z = tt({ ...z, ...U(z, st, L.y), rightWrist: 0 });
|
|
16719
16719
|
return Math.hypot(Z.x - st, Z.y - L.y) < 2;
|
|
16720
|
-
}, H = p === 1 ? F : N,
|
|
16721
|
-
P(it, { ...z, ...
|
|
16720
|
+
}, H = p === 1 ? F : N, G = R(X, J((F + N) / 2), Ts), et = !Q(F) || !Q(N), it = et ? R(G, J(F), Ts) + j0 : G + j0;
|
|
16721
|
+
P(it, { ...z, ...U(z, et ? F : H, L.y) }, _.mood, !1);
|
|
16722
16722
|
const ot = _.for ?? Math.max(_v, Math.abs(N - F) * Iv);
|
|
16723
16723
|
et && w.push({ time: it, value: d - c });
|
|
16724
16724
|
for (let st = Y0, Z = 0; st <= ot; st += Y0, Z++) {
|
|
16725
16725
|
const rt = F + (N - F) * Math.min(st, ot) / ot;
|
|
16726
16726
|
et && (d = J(rt), w.push({ time: it + st, value: d - c }));
|
|
16727
16727
|
const ct = (Z % 2 === 0 ? -1 : 1) * u * 0.02;
|
|
16728
|
-
P(it + st,
|
|
16728
|
+
P(it + st, U(z, rt, L.y + ct), void 0, !1);
|
|
16729
16729
|
}
|
|
16730
16730
|
const lt = it + ot;
|
|
16731
|
-
P(lt,
|
|
16731
|
+
P(lt, U(z, N, L.y), void 0, !1), P(lt + K0, { rightShoulder: ht.rightShoulder, rightElbow: ht.rightElbow, ...vt.happy }), nt = lt + K0, $ = it, I = lt;
|
|
16732
16732
|
} else if (_.do === "push" && _.target) {
|
|
16733
|
-
const L = _.target, F = _.to ?? L.x, N = W(j, d + (F >= L.x ? 1 : -1), _.mood), X = p === 1 ? L.left ?? L.x : L.right ?? L.x, z = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...B }, J = V(z, X, L.y, "arm"), Q = R(N, J + p * u * 0.06, Ts), H =
|
|
16734
|
-
P(et,
|
|
16733
|
+
const L = _.target, F = _.to ?? L.x, N = W(j, d + (F >= L.x ? 1 : -1), _.mood), X = p === 1 ? L.left ?? L.x : L.right ?? L.x, z = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...B }, J = V(z, X, L.y, "arm"), Q = R(N, J + p * u * 0.06, Ts), H = U(z, X, L.y), G = { ...z, ...H, leftShoulder: -H.rightShoulder, leftElbow: -H.rightElbow }, et = Q + Cv;
|
|
16734
|
+
P(et, G, _.mood, !1);
|
|
16735
16735
|
const it = Math.abs(F - L.x), ot = et + (_.for ?? Math.max(600, it / Hv)), lt = it / Pa("shove", u);
|
|
16736
16736
|
v.push({ time: et, value: "shove" }), E.push({ time: et, value: 0 }, { time: et + Pe, value: 1, easing: "ease-out" }, { time: ot - Pe, value: 1 }, { time: ot, value: 0, easing: "ease-in" }), S.push({ time: et, value: m }, { time: ot, value: m + lt }), m += lt, w.push({ time: et, value: d - c }, { time: ot, value: d + (F - L.x) - c }), d += F - L.x, P(ot, {}, void 0, !1), P(ot + X0, { lean: 0, bend: 0, rightShoulder: ht.rightShoulder, leftShoulder: ht.leftShoulder, rightElbow: ht.rightElbow, leftElbow: ht.leftElbow }), nt = ot + X0, $ = et, I = ot;
|
|
16737
16737
|
} else if (K) {
|
|
16738
16738
|
const L = _.mood ? rn(g, _.mood) : g, F = K.steps(L, _), N = og(F, { at: j, from: L });
|
|
16739
16739
|
k.push(...N), g = N[N.length - 1].pose, nt = j + Math.max(mv(F), _.for ?? 0);
|
|
16740
|
-
} else if (
|
|
16740
|
+
} else if (G0(_.do)) {
|
|
16741
16741
|
const L = I0(_.do, { at: j, from: _.mood ? rn(g, _.mood) : g });
|
|
16742
16742
|
k.push(...L), g = L[L.length - 1].pose, nt = j + Er(_.do), _.do === "take" && A.push({ kind: "dust", time: j + 900, x: d, y: f, length: 500 }), _.do === "land" && A.push({ kind: "dust", time: j + 120, x: d, y: f, length: 500 });
|
|
16743
16743
|
} else if (_.do === "look" || _.do === "face") {
|
|
@@ -16758,7 +16758,7 @@ function Ql(t, e, n = {}) {
|
|
|
16758
16758
|
(_.mood || _.pose) && P(j + Math.min($e, L / 2), B, _.mood), nt = j + L;
|
|
16759
16759
|
}
|
|
16760
16760
|
if (_.say) {
|
|
16761
|
-
const L = i(_.do) ||
|
|
16761
|
+
const L = i(_.do) || G0(_.do) || K ? j : j + Math.min(150, (nt - j) / 4), F = i(_.do) ? nt : Math.max(L + 200, nt - 100);
|
|
16762
16762
|
M.push({ text: _.say, start: L, end: F }), _.do === "say" && qv(k, g, L, F);
|
|
16763
16763
|
}
|
|
16764
16764
|
_.onto !== void 0 && _.do !== "leap" && _.onto !== f && (b.push({ time: j, value: f - h }, { time: nt, value: _.onto - h, easing: "ease-in-out" }), f = _.onto), nt > k[k.length - 1].time && k.push({ time: nt, pose: g }), T.push({ start: j, end: nt, ...$ !== void 0 ? { contact: $ } : {}, ...I !== void 0 ? { release: I } : {} }), y = nt;
|
|
@@ -16775,7 +16775,7 @@ function Ql(t, e, n = {}) {
|
|
|
16775
16775
|
_.property === "facing" && _.keyframes[0].value === -1
|
|
16776
16776
|
);
|
|
16777
16777
|
return {
|
|
16778
|
-
tracks: [...
|
|
16778
|
+
tracks: [...Gl(t, D, M, { energy: n.energy }), ...Y],
|
|
16779
16779
|
duration: y,
|
|
16780
16780
|
lines: M,
|
|
16781
16781
|
keys: k,
|
|
@@ -16815,7 +16815,7 @@ function cT(t, e, n, s = {}) {
|
|
|
16815
16815
|
throw new Error(`surfaceScript: ${o.length} problem(s) in the beats:
|
|
16816
16816
|
${o.map((d) => ` ${d.beat >= 0 ? `beat ${d.beat}: ` : ""}${d.message}`).join(`
|
|
16817
16817
|
`)}`);
|
|
16818
|
-
const r = n.map((d) => cg(d, e)), i = Ql(t, r, s), a =
|
|
16818
|
+
const r = n.map((d) => cg(d, e)), i = Ql(t, r, s), a = Gv(r, i.beats, s), l = s.ground ?? 0, c = (d) => s.ride === !1 ? d : Object.values(e).reduce((f, p) => p.ride(f, t, { ground: l }), d);
|
|
16819
16819
|
n.forEach((d, f) => {
|
|
16820
16820
|
for (const p of Kv(d)) {
|
|
16821
16821
|
const g = (b) => new Error(`surfaceScript: beat ${f} (${d.do}), ${p.edit} on ${p.surface}: ${b}`), m = (b, S) => {
|
|
@@ -16912,7 +16912,7 @@ function cg(t, e, n = !1) {
|
|
|
16912
16912
|
}, i = { ...o };
|
|
16913
16913
|
return Vo(t.target) && (i.target = r(t.target)), Vo(t.to) && (i.to = r(t.to).x), Vo(t.onto) && (i.onto = r(t.onto).top), i;
|
|
16914
16914
|
}
|
|
16915
|
-
function
|
|
16915
|
+
function Gv(t, e, n) {
|
|
16916
16916
|
let s = 0;
|
|
16917
16917
|
return t.map((o) => {
|
|
16918
16918
|
const r = Zl([o], n.actions).length, i = e.slice(s, s + r);
|
|
@@ -16972,10 +16972,10 @@ function hT(t) {
|
|
|
16972
16972
|
})
|
|
16973
16973
|
};
|
|
16974
16974
|
}
|
|
16975
|
-
const
|
|
16975
|
+
const Uv = /* @__PURE__ */ new Set(["x", "y", "walking", "gait"]), U0 = 0.215 + 0.205;
|
|
16976
16976
|
function Vv(t, e, n = 1) {
|
|
16977
|
-
const { points: s } = ye(t, at), o = s["hip.left"], r = s["knee.left"], i = s["ankle.left"], a = o && r && i ? Math.hypot(r.x - o.x, r.y - o.y) + Math.hypot(i.x - r.x, i.y - r.y) :
|
|
16978
|
-
return Ll(e, a /
|
|
16977
|
+
const { points: s } = ye(t, at), o = s["hip.left"], r = s["knee.left"], i = s["ankle.left"], a = o && r && i ? Math.hypot(r.x - o.x, r.y - o.y) + Math.hypot(i.x - r.x, i.y - r.y) : U0 * t.height;
|
|
16978
|
+
return Ll(e, a / U0, n);
|
|
16979
16979
|
}
|
|
16980
16980
|
function uT(t, e, n, s = {}) {
|
|
16981
16981
|
const o = Ql(t, n, { ...s, height: e.height, reach: s.reach ?? Jv(e) }), r = o.tracks.find((y) => y.property === "facing")?.keyframes ?? [], i = (y) => {
|
|
@@ -16992,7 +16992,7 @@ function uT(t, e, n, s = {}) {
|
|
|
16992
16992
|
};
|
|
16993
16993
|
}), { rest: c, start: h, ...u } = s;
|
|
16994
16994
|
tM(l, a, n, o, e, i, s);
|
|
16995
|
-
const d = cv(t, l, u), f =
|
|
16995
|
+
const d = cv(t, l, u), f = Gl(t, d, o.lines, { energy: s.energy }), p = o.tracks.filter((y) => Uv.has(y.property)), g = o.tracks.find((y) => y.property === "walk");
|
|
16996
16996
|
return { tracks: g ? [...f, ...p, iM(t, g, o.tracks, e, s)] : [...f, ...p], duration: o.duration, lines: o.lines, keys: l, beats: o.beats, effects: o.effects };
|
|
16997
16997
|
}
|
|
16998
16998
|
function Jv(t) {
|
|
@@ -17016,13 +17016,13 @@ function tM(t, e, n, s, o, r, i) {
|
|
|
17016
17016
|
const k = r(m.time), w = ke(e[y], { height: o.height, facing: k < 0 ? -1 : 1 }), b = c(m.time), S = Qv.has(h.do) && h.target ? { x: h.target.x - b.x, y: h.target.y - b.y } : void 0, E = { x: (w.hands.right.x + w.fingertips.right.x) / 2, y: (w.hands.right.y + w.fingertips.right.y) / 2 }, v = S ?? (d === "arm" ? E : w.toes.right), x = k < 0 ? "right" : "left", M = `${d}.${x}`;
|
|
17017
17017
|
let T = m.pose;
|
|
17018
17018
|
if (h.do === "point")
|
|
17019
|
-
T =
|
|
17019
|
+
T = Ge(o, T, M, v);
|
|
17020
17020
|
else if (d === "arm")
|
|
17021
|
-
T =
|
|
17021
|
+
T = Ge(o, rM(o, T, x, v), M, v);
|
|
17022
17022
|
else
|
|
17023
17023
|
for (let A = 0; A < 3; A++) {
|
|
17024
17024
|
const P = ye(o, T).points, O = P[`ankle.${x}`], C = P[`toe.${x}`];
|
|
17025
|
-
T =
|
|
17025
|
+
T = Ge(o, T, M, { x: v.x - (C.x - O.x), y: v.y - (C.y - O.y) });
|
|
17026
17026
|
}
|
|
17027
17027
|
t[y] = { ...m, pose: T };
|
|
17028
17028
|
});
|
|
@@ -17340,8 +17340,8 @@ function to(t, e) {
|
|
|
17340
17340
|
const n = Math.max(0.05, Ot(t, e, "squash")), s = 1 / Math.sqrt(n), r = [1, 0, 0, 0, 0, 1, Ot(t, e, "lean"), 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
17341
17341
|
return [
|
|
17342
17342
|
on([0, Ot(t, e, "lift"), 0]),
|
|
17343
|
-
me(
|
|
17344
|
-
me(
|
|
17343
|
+
me(Ut([1, 0, 0], -Ot(t, e, "pitch"))),
|
|
17344
|
+
me(Ut([0, 0, 1], Ot(t, e, "roll"))),
|
|
17345
17345
|
r,
|
|
17346
17346
|
gn([s, n, s]),
|
|
17347
17347
|
gn(Array(3).fill(Math.max(0, Ot(t, e, "size"))))
|
|
@@ -17356,13 +17356,13 @@ function nc(t, e) {
|
|
|
17356
17356
|
let c = Ht(l ? r(l) : n, on(i.at ?? [0, 0, 0]));
|
|
17357
17357
|
if (i.rotate) {
|
|
17358
17358
|
const [h, u, d] = i.rotate;
|
|
17359
|
-
h && (c = Ht(c, me(
|
|
17359
|
+
h && (c = Ht(c, me(Ut([1, 0, 0], h)))), u && (c = Ht(c, me(Ut([0, 1, 0], u)))), d && (c = Ht(c, me(Ut([0, 0, 1], d))));
|
|
17360
17360
|
}
|
|
17361
17361
|
for (const { value: h, bind: u } of o)
|
|
17362
17362
|
if (!(!u.parts.includes(i.id) || h === 0)) {
|
|
17363
17363
|
if (u.translate && (c = Ht(c, on([u.translate[0] * h, u.translate[1] * h, u.translate[2] * h]))), u.rotate) {
|
|
17364
17364
|
const d = u.rotate.pivot ?? [0, 0, 0], f = u.rotate.axis === "x" ? [1, 0, 0] : u.rotate.axis === "y" ? [0, 1, 0] : [0, 0, 1];
|
|
17365
|
-
c = [c, on(d), me(
|
|
17365
|
+
c = [c, on(d), me(Ut(f, u.rotate.degrees * h)), on([-d[0], -d[1], -d[2]])].reduce((p, g) => Ht(p, g));
|
|
17366
17366
|
}
|
|
17367
17367
|
u.scale && (c = Ht(c, gn([1 + (u.scale[0] - 1) * h, 1 + (u.scale[1] - 1) * h, 1 + (u.scale[2] - 1) * h])));
|
|
17368
17368
|
}
|
|
@@ -17377,18 +17377,18 @@ const sa = (() => {
|
|
|
17377
17377
|
})(), MM = Math.cos(35 * el);
|
|
17378
17378
|
function gg(t, e, n, s, o = {}) {
|
|
17379
17379
|
const r = t.derive ? { ...e, ...t.derive(e) } : e, i = nc(t, r), a = n.toView([0, 0, 0]), l = (C) => (W) => [C[0] * W[0] + C[4] * W[1] + C[8] * W[2], C[1] * W[0] + C[5] * W[1] + C[9] * W[2], C[2] * W[0] + C[6] * W[1] + C[10] * W[2]], c = to(t, r), h = o.slice === void 0 ? null : ml(c), u = h ? t.parts.map((C) => ({ part: C, mesh: Jo(C.shape), local: Ht(h, i.get(C.id)), whole: C.shape.type === "tube" })) : void 0, d = u ? bM(u, o.slice) : void 0, f = u ? dg(u.map((C) => ({ part: C.part.id, mesh: C.mesh, ...ec(C.mesh, C.local) }))) : void 0, p = (C, W, q, V) => {
|
|
17380
|
-
const tt = (Z) => n.toView(se(q, Z)),
|
|
17380
|
+
const tt = (Z) => n.toView(se(q, Z)), U = W.vertices.map(tt), R = U.map((Z) => n.toScreen(Z)), D = o.perspective ? o.near : void 0, Y = (Z) => Z.map((rt) => n.toScreen(rt)), _ = (Z) => D === void 0 ? Z : V0(Z, D), j = (Z) => D === void 0 ? [Z] : uM(Z, D), nt = l(q), $ = W.faces.map((Z) => {
|
|
17381
17381
|
const rt = n.toView(nt(Z.normal)), ct = [rt[0] - a[0], rt[1] - a[1], rt[2] - a[2]], ut = Math.hypot(...ct) || 1;
|
|
17382
17382
|
return [ct[0] / ut, ct[1] / ut, ct[2] / ut];
|
|
17383
17383
|
}), I = f && V ? fg(C.id, W, V, hg(V), f) : void 0, B = (Z) => I?.[Z] ?? !1, K = $.map((Z, rt) => {
|
|
17384
17384
|
if (B(rt)) return !1;
|
|
17385
17385
|
if (!o.perspective) return Z[2] > 1e-6;
|
|
17386
|
-
const ut = W.faces[rt].corners.reduce((yt, bt) => [yt[0] +
|
|
17386
|
+
const ut = W.faces[rt].corners.reduce((yt, bt) => [yt[0] + U[bt][0], yt[1] + U[bt][1], yt[2] + U[bt][2]], [0, 0, 0]);
|
|
17387
17387
|
return -(Z[0] * ut[0] + Z[1] * ut[1] + Z[2] * ut[2]) > 1e-9;
|
|
17388
|
-
}), L = (Z) => W.faces[Z].corners.reduce((rt, ct) => rt +
|
|
17388
|
+
}), L = (Z) => W.faces[Z].corners.reduce((rt, ct) => rt + U[ct][2], 0) / W.faces[Z].corners.length, F = W.faces.map((Z, rt) => ({ face: Z, i: rt })).filter(({ i: Z }) => K[Z]).map(({ face: Z, i: rt }) => ({
|
|
17389
17389
|
i: rt,
|
|
17390
17390
|
solved: {
|
|
17391
|
-
points: D === void 0 ? Z.corners.map((ct) => R[ct]) : Y(_(Z.corners.map((ct) =>
|
|
17391
|
+
points: D === void 0 ? Z.corners.map((ct) => R[ct]) : Y(_(Z.corners.map((ct) => U[ct]))),
|
|
17392
17392
|
depth: L(rt),
|
|
17393
17393
|
tone: 0.72 + 0.33 * Math.max(0, $[rt][0] * sa[0] + $[rt][1] * sa[1] + $[rt][2] * sa[2])
|
|
17394
17394
|
}
|
|
@@ -17410,22 +17410,22 @@ function gg(t, e, n, s, o = {}) {
|
|
|
17410
17410
|
const ut = rt.length === 2 && ct === 2 && W.creases !== !1 && $[rt[0]][0] * $[rt[1]][0] + $[rt[0]][1] * $[rt[1]][1] + $[rt[0]][2] * $[rt[1]][2] < MM;
|
|
17411
17411
|
rt.length === 1 && (W.joined || EM(W, Z)) || (rt.length === 1 || ct === 1 || ut) && (z.push(Z.split("-").map(Number)), J.push(rt.filter((yt) => K[yt]).reduce((yt, bt) => L(bt) > L(yt) ? bt : yt)));
|
|
17412
17412
|
}
|
|
17413
|
-
const Q = (Z) => W.faces.findIndex((rt) => rt.corners.length > 4 && Math.sign($M(W.vertices[Z], rt.normal)) > 0), H = (W.marks ?? []).filter(([Z]) => Q(Z) < 0 || K[Q(Z)]),
|
|
17413
|
+
const Q = (Z) => W.faces.findIndex((rt) => rt.corners.length > 4 && Math.sign($M(W.vertices[Z], rt.normal)) > 0), H = (W.marks ?? []).filter(([Z]) => Q(Z) < 0 || K[Q(Z)]), G = ([Z, rt]) => D === void 0 ? [[R[Z], R[rt]]] : j([U[Z], U[rt]]).map(Y), et = H.flatMap(G), it = (Z) => D === void 0 ? [Z.map((rt) => R[rt])] : j(Z.map((rt) => U[rt])).map(Y);
|
|
17414
17414
|
if (o.slice !== void 0) {
|
|
17415
17415
|
const Z = /* @__PURE__ */ new Map();
|
|
17416
17416
|
z.forEach((rt, ct) => Z.set(J[ct], [...Z.get(J[ct]) ?? [], rt]));
|
|
17417
17417
|
for (const { i: rt, solved: ct } of F) {
|
|
17418
17418
|
ct.edges = ou(Z.get(rt) ?? []).flatMap(it);
|
|
17419
17419
|
const ut = W.faces[rt].corners;
|
|
17420
|
-
ct.center = ut.reduce((bt, re) => [bt[0] +
|
|
17420
|
+
ct.center = ut.reduce((bt, re) => [bt[0] + U[re][0] / ut.length, bt[1] + U[re][1] / ut.length, bt[2] + U[re][2] / ut.length], [0, 0, 0]), ct.normal = $[rt];
|
|
17421
17421
|
const yt = F[F.length - 1].i;
|
|
17422
|
-
ct.marks = H.filter(([bt]) => (Q(bt) >= 0 ? Q(bt) : yt) === rt).flatMap(
|
|
17422
|
+
ct.marks = H.filter(([bt]) => (Q(bt) >= 0 ? Q(bt) : yt) === rt).flatMap(G);
|
|
17423
17423
|
}
|
|
17424
17424
|
}
|
|
17425
17425
|
const ot = C.glow ? Math.max(0, Math.min(1, Ot(t, r, C.glow.control))) : 0, lt = C.fade ? Math.max(0, Math.min(1, Ot(t, r, C.fade.control))) : 0, st = C.fade ? Math.max(0, Math.min(1, C.fade.from + (C.fade.to - C.fade.from) * lt)) : 1;
|
|
17426
17426
|
return {
|
|
17427
17427
|
part: C,
|
|
17428
|
-
depth:
|
|
17428
|
+
depth: U.reduce((Z, rt) => Z + rt[2], 0) / Math.max(1, U.length),
|
|
17429
17429
|
faces: N,
|
|
17430
17430
|
edges: ou(z).flatMap(it),
|
|
17431
17431
|
marks: et,
|
|
@@ -17446,7 +17446,7 @@ function gg(t, e, n, s, o = {}) {
|
|
|
17446
17446
|
if (d) {
|
|
17447
17447
|
const C = new Map(t.parts.map((q) => {
|
|
17448
17448
|
const V = i.get(q.id), tt = Jo(q.shape).vertices;
|
|
17449
|
-
return [q.id, tt.reduce((
|
|
17449
|
+
return [q.id, tt.reduce((U, R) => U + n.toView(se(V, R))[2], 0) / Math.max(1, tt.length)];
|
|
17450
17450
|
})), W = /* @__PURE__ */ new Map();
|
|
17451
17451
|
for (const q of y) {
|
|
17452
17452
|
const V = q.cell.join(",");
|
|
@@ -17689,8 +17689,8 @@ function gT(t, e = {}) {
|
|
|
17689
17689
|
const D = Number.isFinite(v) ? `at ${v} ms` : "after its edits";
|
|
17690
17690
|
throw new Error(`${n.kind}: ${W} turned away from the viewer ${D}; aim at an anchor (${r.map((Y) => `anchor:${Y}`).join(", ") || "none"}) or box`);
|
|
17691
17691
|
}
|
|
17692
|
-
const V = q.map((D) => D.x), tt = q.map((D) => D.y),
|
|
17693
|
-
return kt(T.x +
|
|
17692
|
+
const V = q.map((D) => D.x), tt = q.map((D) => D.y), U = Math.min(...V), R = Math.min(...tt);
|
|
17693
|
+
return kt(T.x + U, T.y + R, Math.max(...V) - U, Math.max(...tt) - R);
|
|
17694
17694
|
}
|
|
17695
17695
|
}, b = (E, v) => {
|
|
17696
17696
|
try {
|
|
@@ -18311,7 +18311,7 @@ function KM(t = {}) {
|
|
|
18311
18311
|
family: "building",
|
|
18312
18312
|
summary: t.summary ?? "A house: opens its door, lights its windows, puffs chimney smoke, shakes, pops up.",
|
|
18313
18313
|
rig: p,
|
|
18314
|
-
actions:
|
|
18314
|
+
actions: GM(!!f),
|
|
18315
18315
|
acting: XM,
|
|
18316
18316
|
colors: { body: i.walls }
|
|
18317
18317
|
};
|
|
@@ -18323,7 +18323,7 @@ const XM = {
|
|
|
18323
18323
|
headTurns: {},
|
|
18324
18324
|
drift: []
|
|
18325
18325
|
};
|
|
18326
|
-
function
|
|
18326
|
+
function GM(t) {
|
|
18327
18327
|
return {
|
|
18328
18328
|
door: {
|
|
18329
18329
|
summary: "Opens the front door (`open: true`) or shuts it (`open: false`).",
|
|
@@ -18364,7 +18364,7 @@ function UM(t) {
|
|
|
18364
18364
|
} : {}
|
|
18365
18365
|
};
|
|
18366
18366
|
}
|
|
18367
|
-
function
|
|
18367
|
+
function UM(t = {}) {
|
|
18368
18368
|
const e = t.width ?? 0.46, n = t.depth ?? 0.46, s = t.seatHeight ?? 0.46, o = t.backHeight ?? 0.95, r = { wood: "#8a5a3b", seat: "#c48a4a", ...t.colors }, i = 0.05, a = 0.025, l = [
|
|
18369
18369
|
{ id: "seat", shape: { type: "box", size: [e, i, n] }, at: [0, s - i / 2, 0], fill: r.seat },
|
|
18370
18370
|
{ id: "back", shape: { type: "box", size: [e, o - s, i] }, at: [0, (o + s) / 2, -n / 2 + i / 2], fill: r.wood }
|
|
@@ -19760,7 +19760,7 @@ function Hx(t = {}) {
|
|
|
19760
19760
|
stoop: 10
|
|
19761
19761
|
});
|
|
19762
19762
|
}
|
|
19763
|
-
const eo = { car: RM, truck: FM, bus: LM, tractor: WM, cart: NM, trainCar: DM, bike: BM, motorbike: zM, tree: qM, house: KM, chair:
|
|
19763
|
+
const eo = { car: RM, truck: FM, bus: LM, tractor: WM, cart: NM, trainCar: DM, bike: BM, motorbike: zM, tree: qM, house: KM, chair: UM, desk: ZM, bed: tx, door: nx, wheelchair: rx, helicopter: lx, airplane: hx, horse: bx, dog: wx, cat: kx, cow: vx, goat: Mx, rabbit: xx, squirrel: Sx, songbird: $x, crow: Px, chicken: Ox, pigeon: Ix, duck: _x, owl: Cx, parrot: Hx };
|
|
19764
19764
|
function xg(t, e = {}) {
|
|
19765
19765
|
const n = eo[t];
|
|
19766
19766
|
if (!n) throw new Error(dt("prop preset", t, Object.keys(eo)));
|
|
@@ -19923,7 +19923,7 @@ function zx(t) {
|
|
|
19923
19923
|
n.length > 0 && n[n.length - 1].time === s.time ? n[n.length - 1] = s : n.push(s);
|
|
19924
19924
|
return n;
|
|
19925
19925
|
}
|
|
19926
|
-
const
|
|
19926
|
+
const Ue = Object.freeze({
|
|
19927
19927
|
test: Object.freeze({ name: "Test", inningsPerSide: 2, oversPerInnings: null, ballsPerOver: 6, freeHitAfterNoBall: !1, summary: "Multi-day cricket. Each side can have two innings; there is no innings over limit." }),
|
|
19928
19928
|
odi: Object.freeze({ name: "ODI", inningsPerSide: 1, oversPerInnings: 50, ballsPerOver: 6, freeHitAfterNoBall: !0, summary: "One innings per side, up to 50 overs. A no-ball gives a free hit on the next legitimate delivery." }),
|
|
19929
19929
|
t20: Object.freeze({ name: "T20", inningsPerSide: 1, oversPerInnings: 20, ballsPerOver: 6, freeHitAfterNoBall: !0, summary: "One innings per side, up to 20 overs. A no-ball gives a free hit on the next legitimate delivery." })
|
|
@@ -20006,7 +20006,7 @@ function qe(t, e, n, s, o = "hold") {
|
|
|
20006
20006
|
let r = { ...e.pose };
|
|
20007
20007
|
for (let i = 0; i < 10; i++) {
|
|
20008
20008
|
const a = { ...e, pose: r }, l = Tn(t.who.plan, r, { height: t.who.height, contact: t.who.contact }), c = co(t.who.plan, r, t.who.height), h = oe(so(t, a, n), fs(t, a, `arm.${n}`, 2)), u = oe(oe(oe(s, h), e.position), l.hip), d = gs(u, (r.roll ?? 0) * Math.PI / 180), f = St(c.root, Jt(d, -(r.turn ?? 0) * Math.PI / 2));
|
|
20009
|
-
r =
|
|
20009
|
+
r = Us(t.who.plan, r, `arm.${n}`, f, { height: t.who.height });
|
|
20010
20010
|
}
|
|
20011
20011
|
for (const [i, a] of Object.entries(Tt[o])) r[`hand.${n}.${i}`] = a;
|
|
20012
20012
|
return { ...e, pose: r };
|
|
@@ -20021,7 +20021,7 @@ function Yx(t) {
|
|
|
20021
20021
|
}
|
|
20022
20022
|
function $g(t) {
|
|
20023
20023
|
const e = Zt(t), n = Math.max(-1, Math.min(1, e[1]));
|
|
20024
|
-
return n > 0.999999 ? [0, 0, 0, 1] : n < -0.999999 ?
|
|
20024
|
+
return n > 0.999999 ? [0, 0, 0, 1] : n < -0.999999 ? Ut([1, 0, 0], 180) : Ut(Zt(qs([0, 1, 0], e)), Math.acos(n) * 180 / Math.PI).map((s) => s === 0 ? 0 : s);
|
|
20025
20025
|
}
|
|
20026
20026
|
function Pr(t, e, n) {
|
|
20027
20027
|
const s = {};
|
|
@@ -20143,7 +20143,7 @@ function Xx(t) {
|
|
|
20143
20143
|
];
|
|
20144
20144
|
return i.length > 0 && a.push({ id: `${s}-move-fov`, target: s, property: "fov", keyframes: i }), a;
|
|
20145
20145
|
}
|
|
20146
|
-
function
|
|
20146
|
+
function Gx(t) {
|
|
20147
20147
|
const e = Math.max(1, t.every ?? 33), n = t.offset ?? [0, 2, 6], s = t.lag ?? 0, o = `${t.scene}/${t.camera}`, r = [], i = [];
|
|
20148
20148
|
for (let a = t.start; ; a = Math.min(t.end, a + e)) {
|
|
20149
20149
|
const l = t.subjectAt(a), c = t.subjectAt(Math.max(t.start, a - s));
|
|
@@ -20155,7 +20155,7 @@ function Ux(t) {
|
|
|
20155
20155
|
];
|
|
20156
20156
|
}
|
|
20157
20157
|
const lc = Object.freeze({ pitch: "Whole pitch", batter: "Batter close-up", bowler: "Bowler close-up", keeper: "Keeper close-up", field: "Whole ground", overhead: "Overhead ground", orbit: "360° ground orbit", "follow-ball": "Follow the ball", ...Object.fromEntries(Object.entries(ei).map(([t, e]) => [t, e.name])) }), ca = Object.freeze({ pitch: 75, batter: 145, bowler: 35, keeper: 145, field: 75, overhead: 75, orbit: 75, "follow-ball": 75, "front-foot": 90, "striker-crease": 90, "bowler-crease": 90 });
|
|
20158
|
-
function
|
|
20158
|
+
function Ux(t, e = "pitch") {
|
|
20159
20159
|
const n = ce(lc, e, "cricketCamera.view");
|
|
20160
20160
|
if (ac(n)) {
|
|
20161
20161
|
const o = Cg(t, n);
|
|
@@ -20207,7 +20207,7 @@ function kT(t, e = {}) {
|
|
|
20207
20207
|
if (!Number.isFinite(a) || a < 16 || a > 1e3) throw new Error("cricketCamera: every must be between 16 and 1000 ms");
|
|
20208
20208
|
if (ha(e.pitch, 0, 89, "pitch"), ha(e.distance, 0.5, 2e3, "distance"), ha(e.fov, 10, 100, "fov"), e.target !== void 0 && (Re(e.target, "cricketCamera.target"), n === "follow-ball"))
|
|
20209
20209
|
throw new Error("cricketCamera: target override is not supported by follow-ball");
|
|
20210
|
-
const l =
|
|
20210
|
+
const l = Ux(t, n), c = e.pitch ?? l.pitch, h = e.distance ?? l.distance, u = i(e.fov ?? l.fov), d = e.target ? [...e.target] : l.target ?? [0, 0, 0], f = t.scene.id + "/camera", p = (g) => {
|
|
20211
20211
|
if (e.distance === void 0 && e.target === void 0) return g;
|
|
20212
20212
|
const m = g.find((w) => w.property === "position");
|
|
20213
20213
|
if (!m || !("keyframes" in m)) return g;
|
|
@@ -20228,7 +20228,7 @@ function kT(t, e = {}) {
|
|
|
20228
20228
|
for (; v < E.length - 2 && M - (S.delay ?? 0) > E[v + 1].time; ) v++;
|
|
20229
20229
|
return v !== T && (x = new dn({ ...S, keyframes: E.slice(v, v + 2) })), x.getValueAtTime(M);
|
|
20230
20230
|
};
|
|
20231
|
-
}), m = (Math.atan2(5, 6) * 180 / Math.PI + o - ca["follow-ball"]) * Math.PI / 180, y = c * Math.PI / 180, k = o === ca["follow-ball"] && (e.pitch === void 0 || e.pitch === l.pitch) && (e.distance === void 0 || e.distance === l.distance) ? [5, 3, 6] : [Math.sin(m) * Math.cos(y) * h, Math.sin(y) * h, Math.cos(m) * Math.cos(y) * h], w =
|
|
20231
|
+
}), m = (Math.atan2(5, 6) * 180 / Math.PI + o - ca["follow-ball"]) * Math.PI / 180, y = c * Math.PI / 180, k = o === ca["follow-ball"] && (e.pitch === void 0 || e.pitch === l.pitch) && (e.distance === void 0 || e.distance === l.distance) ? [5, 3, 6] : [Math.sin(m) * Math.cos(y) * h, Math.sin(y) * h, Math.cos(m) * Math.cos(y) * h], w = Gx({ scene: t.scene.id, camera: "camera", start: 0, end: t.duration, every: a, offset: k, subjectAt: (b) => g.map((S) => S(b)) });
|
|
20232
20232
|
return p([...w, { id: f + "-zoom-fov", target: f, property: "fov", keyframes: [{ time: 0, value: u }, { time: t.duration, value: u }] }]);
|
|
20233
20233
|
}
|
|
20234
20234
|
return p(Xx({ scene: t.scene.id, camera: "camera", start: 0, end: t.duration, every: a, easing: "linear", from: { target: d, yaw: o, pitch: c, distance: h, fov: u }, to: { yaw: n === "orbit" ? o + 360 : o } }));
|
|
@@ -20284,7 +20284,7 @@ const Xt = Object.freeze({ length: 20.12, width: 3.05, poppingCrease: 1.22, retu
|
|
|
20284
20284
|
function Qx(t) {
|
|
20285
20285
|
if (!t.id?.trim()) throw new Error("cricketPlayer: id is required");
|
|
20286
20286
|
ce({ batter: 1, bowler: 1, keeper: 1, fielder: 1, umpire: 1 }, t.role, "cricketPlayer.role");
|
|
20287
|
-
const e = ce(Sr, t.preset ?? "youngMan", "cricketPlayer.preset"), n = ce(
|
|
20287
|
+
const e = ce(Sr, t.preset ?? "youngMan", "cricketPlayer.preset"), n = ce(Ue, t.format ?? "t20", "cricketPlayer.format"), s = ce({ none: 1, cap: 1, "sun-hat": 1 }, t.headwear ?? "none", "cricketPlayer.headwear"), o = e === "childBoy" || e === "childGirl", r = t.height ?? (o ? 1.24 : 1.78);
|
|
20288
20288
|
if (!Number.isFinite(r) || r < 0.5 || r > 3) throw new Error("cricketPlayer: height must be between .5 and 3 metres");
|
|
20289
20289
|
Re(t.position ?? [0, 0, 0], "cricketPlayer.position");
|
|
20290
20290
|
const i = t.role === "umpire" ? "#f5ebd5" : n === "test" ? "#f5f0df" : t.color ?? "#3577b5", a = JSON.parse(JSON.stringify({
|
|
@@ -20314,7 +20314,7 @@ function lu(t, e) {
|
|
|
20314
20314
|
].map((s, o) => o === 0 ? s : { ...s, parent: t });
|
|
20315
20315
|
}
|
|
20316
20316
|
function Hg(t = {}) {
|
|
20317
|
-
const e = ce(
|
|
20317
|
+
const e = ce(Ue, t.format ?? "t20", "cricketField.format"), n = ce(Tg, t.cast ?? "adults", "cricketField.cast"), s = ce(al, t.markingProfile ?? "icc-men", "cricketField.markingProfile"), o = al[s], r = t.boundaryRadius ?? 64;
|
|
20318
20318
|
if (!Number.isFinite(r) || r < 24 || r > 250) throw new Error("cricketField: boundaryRadius must be between 24 and 250 metres");
|
|
20319
20319
|
const i = t.id ?? "cricket";
|
|
20320
20320
|
if (!i.trim()) throw new Error("cricketField: id is required");
|
|
@@ -20414,7 +20414,7 @@ function e3(t, e, n, s, o) {
|
|
|
20414
20414
|
}
|
|
20415
20415
|
function n3(t, e) {
|
|
20416
20416
|
const n = { runs: 0, extras: 0, wickets: 0, legalBall: !0, freeHitNext: !1 };
|
|
20417
|
-
t === "running" && (n.runs = 1), t === "four" && (n.runs = 4), t === "six" && (n.runs = 6), (t === "wide" || t === "no-ball") && (n.extras = 1, n.legalBall = !1), t === "no-ball" && (n.freeHitNext =
|
|
20417
|
+
t === "running" && (n.runs = 1), t === "four" && (n.runs = 4), t === "six" && (n.runs = 6), (t === "wide" || t === "no-ball") && (n.extras = 1, n.legalBall = !1), t === "no-ball" && (n.freeHitNext = Ue[e].freeHitAfterNoBall);
|
|
20418
20418
|
const o = { catch: "caught", bowled: "bowled", lbw: "lbw", stumping: "stumped", "run-out": "run-out" }[t];
|
|
20419
20419
|
return o && (n.wickets = 1, n.dismissal = o), n;
|
|
20420
20420
|
}
|
|
@@ -20423,7 +20423,7 @@ function s3(t, e = {}) {
|
|
|
20423
20423
|
}
|
|
20424
20424
|
function Rg(t, e, n) {
|
|
20425
20425
|
const s = ce(Kn, e.action ?? "bowling", "cricketAction.action"), o = n ? n.delivery.legality === "no-ball" : s === "no-ball", r = n ? n.delivery.legality === "wide" : s === "wide", i = n ? n.delivery.style === "spin" : s === "spin";
|
|
20426
|
-
ce(
|
|
20426
|
+
ce(Ue, t.format, "cricketAction.format");
|
|
20427
20427
|
const a = n?.result ?? n3(s, t.format), l = e.duration ?? 6e3;
|
|
20428
20428
|
if (!Number.isFinite(l) || l < 4e3 || l > 6e4) throw new Error("cricketAction: duration must be between 4000 and 60000 ms");
|
|
20429
20429
|
const c = t.scene.id;
|
|
@@ -20466,9 +20466,9 @@ function Rg(t, e, n) {
|
|
|
20466
20466
|
F.pose = { ...F.pose, ...$ === "batter" ? Eg() : { turn: 0.15, "leg.left.knee": 8, "leg.right.knee": 8 } };
|
|
20467
20467
|
let z = [0, -1, $ === "batter" ? 0.05 : 0.12], J = St(F.position, [N * 0.15, N * 0.44, N * 0.04]);
|
|
20468
20468
|
if ($ === "non-striker" && (J = St(F.position, [N * 0.08, N * 0.44, N * 0.17])), $ === "batter") {
|
|
20469
|
-
const Q = _t(Pt(I, 2100, 2600)) * (1 - _t(Pt(I, 2600, xt))), H = _t(Pt(I, 2600, xt)) * (1 - _t(Pt(I, xt, 3800))),
|
|
20469
|
+
const Q = _t(Pt(I, 2100, 2600)) * (1 - _t(Pt(I, 2600, xt))), H = _t(Pt(I, 2600, xt)) * (1 - _t(Pt(I, xt, 3800))), G = _t(Pt(I, xt, 3250)) * (1 - _t(Pt(I, 3250, 4e3)));
|
|
20470
20470
|
if (g) {
|
|
20471
|
-
J = St(F.position, [N * (0.15 + 0.03 * Q - 0.02 * H - 0.03 *
|
|
20471
|
+
J = St(F.position, [N * (0.15 + 0.03 * Q - 0.02 * H - 0.03 * G), N * (0.44 + 0.14 * Q + 0.07 * H + 0.23 * G), N * (0.04 + 0.16 * Q - 0.12 * H - 0.06 * G)]), z = Zt([0.15 * Q + 0.25 * G, -1 + 1.85 * Q + 1.6 * G, 0.05 + 0.55 * Q - 0.4 * H - 0.8 * G]), F.pose.turn = 1 + 0.12 * H + 0.3 * G, F.pose.lean = 3 + 4 * H;
|
|
20472
20472
|
const et = 12 + 4 * H;
|
|
20473
20473
|
F.pose["leg.left.spread"] = et, F.pose["leg.right.spread"] = et, s === "defend" && (z = [0, -1, -0.08], J = St(F.position, [N * 0.1, N * 0.5, -N * 0.12]));
|
|
20474
20474
|
} else if (["stumping", "bowled", "lbw"].includes(s)) {
|
|
@@ -20516,19 +20516,19 @@ function Rg(t, e, n) {
|
|
|
20516
20516
|
}
|
|
20517
20517
|
if (a.wickets || s === "four" || s === "six") {
|
|
20518
20518
|
const H = a.wickets ? X : 5100;
|
|
20519
|
-
let
|
|
20519
|
+
let G = N;
|
|
20520
20520
|
if (a.wickets) {
|
|
20521
|
-
|
|
20522
|
-
for (const [et, it] of Object.entries(Tt.point))
|
|
20521
|
+
G = { ...z, "arm.right.swing": 165, "arm.right.elbow": 0 };
|
|
20522
|
+
for (const [et, it] of Object.entries(Tt.point)) G[`hand.right.${et}`] = it;
|
|
20523
20523
|
}
|
|
20524
|
-
J.push([H, Q], [H + 350,
|
|
20524
|
+
J.push([H, Q], [H + 350, G]);
|
|
20525
20525
|
}
|
|
20526
20526
|
F.pose = ia(I, J);
|
|
20527
20527
|
} else
|
|
20528
20528
|
F.pose = Pr(F.pose, N, _t(Pt(I, s === "no-ball" ? qt : s === "wide" ? 3100 : X, (s === "no-ball" ? qt : s === "wide" ? 3100 : X) + 350)));
|
|
20529
20529
|
}
|
|
20530
20530
|
return B.set(I, F), F;
|
|
20531
|
-
}, x = ($, I) => so(h[$], v($, I), "right"), M = g ? Yx(v("batter", xt).bat) : s === "lbw" ? sn(fs(h.batter, v("batter", xt), "leg.right", 1), fs(h.batter, v("batter", xt), "leg.right", 2), 0.6) : [m ? Xt.wicketWidth / 2 + 0.075 + 0.15 : 0, 0.45, 9.25], T = x("bowler", qt), A = [r ? 0.85 : i ? -0.35 : s === "lbw" ? M[0] * 0.6 : 0, 0.075, 3.9], P = x("keeper", s === "stumping" ? 3400 : 3500), O = x("fielder", As), C = x("fielder", Le), W = s === "run-out" ? "bowler" : "striker", q = s === "run-out" ? 5e3 : s === "stumping" ? 3900 : 3200, V = [t.boundaryRadius * 0.8, s === "six" ? 2.1 : 0.075, -t.boundaryRadius * 0.6], tt = ($, I, B, K, L, F = 0, N = 0) => Og({ target: `${c}/ball`, start: I, end: B, from: K, to: L, arc: F, curve: N }, $),
|
|
20531
|
+
}, x = ($, I) => so(h[$], v($, I), "right"), M = g ? Yx(v("batter", xt).bat) : s === "lbw" ? sn(fs(h.batter, v("batter", xt), "leg.right", 1), fs(h.batter, v("batter", xt), "leg.right", 2), 0.6) : [m ? Xt.wicketWidth / 2 + 0.075 + 0.15 : 0, 0.45, 9.25], T = x("bowler", qt), A = [r ? 0.85 : i ? -0.35 : s === "lbw" ? M[0] * 0.6 : 0, 0.075, 3.9], P = x("keeper", s === "stumping" ? 3400 : 3500), O = x("fielder", As), C = x("fielder", Le), W = s === "run-out" ? "bowler" : "striker", q = s === "run-out" ? 5e3 : s === "stumping" ? 3900 : 3200, V = [t.boundaryRadius * 0.8, s === "six" ? 2.1 : 0.075, -t.boundaryRadius * 0.6], tt = ($, I, B, K, L, F = 0, N = 0) => Og({ target: `${c}/ball`, start: I, end: B, from: K, to: L, arc: F, curve: N }, $), U = ($) => {
|
|
20532
20532
|
if ($ <= qt) return x("bowler", $);
|
|
20533
20533
|
if ($ <= Es) return tt($, qt, Es, T, A, 0.15, i ? 0.35 : 0);
|
|
20534
20534
|
const I = r ? St(P, [0, 0, -0.6]) : M;
|
|
@@ -20574,7 +20574,7 @@ function Rg(t, e, n) {
|
|
|
20574
20574
|
I.label = a.wickets ? "Out" : "Not out", I.caption = `${$[n.ruling.reason]} ${a.runs} bat runs · ${a.extras} extras · ${a.wickets} wickets. ${a.legalBall ? "Counts as a legal ball." : "Does not count in the over."}${a.freeHitNext ? " The next delivery is a free hit; an illegal delivery carries it forward." : n.freeHit ? " This legal delivery consumes the free hit." : ""}`;
|
|
20575
20575
|
}
|
|
20576
20576
|
R.sort(($, I) => $.time - I.time);
|
|
20577
|
-
const _ = Pg(0, l, e.every, [1400, 1800, qt, 2100, 2150, 2250, Es, 2600, 2800, xt, 3050, 3100, 3200, 3250, 3300, 3400, 3500, 3800, 3900, 3950, 4e3, As, Le, 4350, 4450, Ln, 4900, 5e3, 5100, 5150, No, ua, 5700].map(p)), j = _.map(($) =>
|
|
20577
|
+
const _ = Pg(0, l, e.every, [1400, 1800, qt, 2100, 2150, 2250, Es, 2600, 2800, xt, 3050, 3100, 3200, 3250, 3300, 3400, 3500, 3800, 3900, 3950, 4e3, As, Le, 4350, 4450, Ln, 4900, 5e3, 5100, 5150, No, ua, 5700].map(p)), j = _.map(($) => U(f($))), nt = [];
|
|
20578
20578
|
for (const [$, I] of Object.entries(h)) {
|
|
20579
20579
|
let B = I.object.pose?.turn ?? 0, K = B;
|
|
20580
20580
|
const L = _.map((F, N) => {
|
|
@@ -20582,12 +20582,12 @@ function Rg(t, e, n) {
|
|
|
20582
20582
|
let z = $ === "fielder" && y && X > 3050 && X < 3250 ? Do(I, X, 3050, s === "catch" ? 3800 : 3950, E, S, K) : v($, X), J = j[N];
|
|
20583
20583
|
const Q = !["batter", "non-striker", "bowler", "keeper"].includes($);
|
|
20584
20584
|
if (Q) {
|
|
20585
|
-
const
|
|
20585
|
+
const G = v("bowler", Math.min(X, qt)), et = St(G.position, [0, u("bowler") * 0.8, 0]);
|
|
20586
20586
|
J = X <= qt ? et : X < 2100 ? sn(et, J, _t(Pt(X, qt, 2100))) : J;
|
|
20587
20587
|
}
|
|
20588
20588
|
if (k && ($ === "batter" || $ === "non-striker") && X > 3050 && (J = $ === "batter" ? [1, u($) * 0.8, -10.5] : [-1, u($) * 0.8, 10.5]), $ === "bowler" && X <= xt && (J = St(v("batter", X).position, [0, u("batter") * 0.65, 0])), Q && ($ !== "fielder" || !y || X <= 3050) || $ === "bowler" && X >= 3e3) {
|
|
20589
|
-
const
|
|
20590
|
-
B = $ === "bowler" && X < 3500 ? (z.pose.turn ?? 0) + (ol(
|
|
20589
|
+
const G = Zn(z.position, J, B);
|
|
20590
|
+
B = $ === "bowler" && X < 3500 ? (z.pose.turn ?? 0) + (ol(G, z.pose.turn ?? 0) - (z.pose.turn ?? 0)) * _t(Pt(X, 3e3, 3500)) : G, z = { ...z, pose: { ...z.pose, turn: B } };
|
|
20591
20591
|
}
|
|
20592
20592
|
return $ === "fielder" && y && (X === 3050 ? K = B : X > 3050 && (B = ol(z.pose.turn ?? 0, B), z = { ...z, pose: { ...z.pose, turn: B } })), qx(I, z, J);
|
|
20593
20593
|
});
|
|
@@ -20691,14 +20691,14 @@ function i3(t, e) {
|
|
|
20691
20691
|
return { dismissal: n, reason: "dismissal" };
|
|
20692
20692
|
}
|
|
20693
20693
|
function a3(t, e = {}) {
|
|
20694
|
-
const n = ce(
|
|
20695
|
-
if (s.context.freeHit && !
|
|
20694
|
+
const n = ce(Ue, t.format, "cricketPlay.format"), s = r3(e);
|
|
20695
|
+
if (s.context.freeHit && !Ue[n].freeHitAfterNoBall) throw new Error("cricketPlay: Test format does not support free-hit context");
|
|
20696
20696
|
const o = o3(s), r = i3(s, o), i = s.delivery.legality === "legal", a = {
|
|
20697
20697
|
runs: s.finish === "single" ? 1 : s.finish === "four" ? 4 : s.finish === "six" ? 6 : 0,
|
|
20698
20698
|
extras: i ? 0 : 1,
|
|
20699
20699
|
wickets: r.dismissal ? 1 : 0,
|
|
20700
20700
|
legalBall: i,
|
|
20701
|
-
freeHitNext:
|
|
20701
|
+
freeHitNext: Ue[n].freeHitAfterNoBall && (s.delivery.legality === "no-ball" || s.context.freeHit && !i),
|
|
20702
20702
|
...r.dismissal ? { dismissal: r.dismissal } : {}
|
|
20703
20703
|
};
|
|
20704
20704
|
return { ...Rg(t, { action: o, duration: e.duration, every: e.every }, { delivery: s.delivery, result: a, ruling: r, freeHit: s.context.freeHit }), play: s, ruling: r };
|
|
@@ -20732,7 +20732,7 @@ function h3(t, e = {}) {
|
|
|
20732
20732
|
for (const s of Object.keys(vn)) n[s] = { summary: `The ${s} gag (${Er(s)} ms).` };
|
|
20733
20733
|
for (const [s, o] of Object.entries(Qr)) n[s] = { ...o };
|
|
20734
20734
|
return {
|
|
20735
|
-
sports: { cricket: { actions: { ...Kn }, formats: { ...
|
|
20735
|
+
sports: { cricket: { actions: { ...Kn }, formats: { ...Ue }, casts: { ...Tg }, fieldingPositions: { ...no }, markingProfiles: { ...al }, cameras: { ...lc }, decisionCameras: ei, playComponents: Qe, playExamples: l3 } },
|
|
20736
20736
|
...t ? { version: t } : {},
|
|
20737
20737
|
timing: "JSON timelines and tracks are in milliseconds; the GSAP-style API (live.to, tf.timeline) takes seconds. Scene x grows right, y grows down, in px.",
|
|
20738
20738
|
easings: {
|
|
@@ -20765,7 +20765,7 @@ function h3(t, e = {}) {
|
|
|
20765
20765
|
beatFields: Za,
|
|
20766
20766
|
actions: n,
|
|
20767
20767
|
dances: Object.fromEntries(Object.entries(xn).map(([s, o]) => [s, Object.keys(o.moves)])),
|
|
20768
|
-
flips: Object.fromEntries(Object.entries(
|
|
20768
|
+
flips: Object.fromEntries(Object.entries(Ur).map(([s, o]) => [s, o.label])),
|
|
20769
20769
|
handShapes: Object.keys(Tt),
|
|
20770
20770
|
mudras: Object.keys(Ca)
|
|
20771
20771
|
},
|
|
@@ -20851,8 +20851,8 @@ function h3(t, e = {}) {
|
|
|
20851
20851
|
handMeetings: Object.keys(Tr)
|
|
20852
20852
|
},
|
|
20853
20853
|
codePanel: {
|
|
20854
|
-
languages:
|
|
20855
|
-
removeStyles:
|
|
20854
|
+
languages: Ua,
|
|
20855
|
+
removeStyles: Ga,
|
|
20856
20856
|
anchors: {
|
|
20857
20857
|
"line(n, time?)": "line n’s text box { x, y, left, right, top, bottom, width, height }: stand on top, point at x, y",
|
|
20858
20858
|
"token(n, text, occurrence?, time?)": "a word on a line",
|
|
@@ -20862,7 +20862,7 @@ function h3(t, e = {}) {
|
|
|
20862
20862
|
},
|
|
20863
20863
|
edits: tg
|
|
20864
20864
|
},
|
|
20865
|
-
surfaces: { code:
|
|
20865
|
+
surfaces: { code: Uo, board: Ne, chart: jn, prop: Cs },
|
|
20866
20866
|
surfaceScript: {
|
|
20867
20867
|
"surfaceScript(figureId, { name: surface }, beats, options)": "compiles beats that act on surfaces: returns the script result with `tracks` (the figure’s, ridden, then every surface’s, keyed by its name) and `figureTracks`; options are scriptTracks’ plus `figureStyle` (for carry) and `ride` (default true)",
|
|
20868
20868
|
"checkSurfaceBeats(beats, surfaces, cast?)": "every problem checkBeats finds, plus unknown surfaces, places, edits and moments, with suggestions",
|
|
@@ -20888,6 +20888,7 @@ function h3(t, e = {}) {
|
|
|
20888
20888
|
"mathTarget(spec, { x, y })": "a canvas target for videos and canvas pages; tracks animate its values and item props",
|
|
20889
20889
|
"mathSteps(lesson, target, spec, { hidden })": "lesson steps: toValue, applyMatrix, drawOn, fadeIn, fadeOut, showStep (equations)",
|
|
20890
20890
|
"mountMath(element) / mountAllMath()": "lesson-page embeds: <figure data-tinyfly-math> with data-tinyfly-figure and data-tinyfly-timeline JSON scripts, stepped like any embed",
|
|
20891
|
+
"mathSurface(figure, { x, y })": "a figure as a surface for surfaceScript: anchors box, item:ID, tip:ID, point:ID, node:GRAPH:NODE, term:ID:TEXT, value:NAME; edits drawOn, erase, show, hide, step, set",
|
|
20891
20892
|
"mathExplorable(element, spec, { sliders, drag })": "reader-driven figures: sliders on number values, drag vector tips or matrix columns",
|
|
20892
20893
|
"mathFigureToSvg(spec, props)": "a standalone SVG of a figure at some values",
|
|
20893
20894
|
"linearMapFigure, determinantFigure, eigenFigure, vectorSumFigure, spanFigure": "ready linear algebra figures; the matrix is the value M",
|
|
@@ -20896,6 +20897,7 @@ function h3(t, e = {}) {
|
|
|
20896
20897
|
"normalFigure, binomialFigure, cltFigure, galtonFigure, monteCarloPiFigure, regressionFigure, bayesFigure": "ready probability and statistics figures",
|
|
20897
20898
|
"graphSearchFigure, shortestPathFigure, recursionTreeFigure, vennFigure, clockFigure": "ready discrete maths figures; searches move with the value step",
|
|
20898
20899
|
"searchEvents / parseSetExpression / regionCells": "graph searches as data; set expressions and their Venn cells",
|
|
20900
|
+
"neuralNetworkFigure, gradientDescentFigure, attentionFigure, decisionBoundaryFigure, kmeansFigure, activationFigure": "ready AI/ML figures",
|
|
20899
20901
|
distributions: "{ kind: normal | uniform | exponential | binomial | poisson | dice | mean, …numbers or value names }; density, meanOf, sdOf, samples (seeded)",
|
|
20900
20902
|
"layoutTex(tex) / morphEquation(a, b, t)": "the built-in TeX subset, and term-by-term transitions",
|
|
20901
20903
|
"vec2, mat2": "2D vectors and 2×2 matrices (apply, multiply, determinant, inverse, eigen)"
|
|
@@ -20923,7 +20925,13 @@ function h3(t, e = {}) {
|
|
|
20923
20925
|
bayes: "{ prior, truePositive, falsePositive }: Bayes as areas; \\val{ID.posterior}",
|
|
20924
20926
|
graph: "{ nodes, edges, directed?, tree?, search?: { kind: bfs | dfs | dijkstra, start }, step?, frontier? }: searches step by step",
|
|
20925
20927
|
venn: "{ sets (2 or 3), highlight?: set expression like (A | B)' }: shaded by clipping",
|
|
20926
|
-
clock: "{ modulus, value }: clock arithmetic; \\val{ID.hour}"
|
|
20928
|
+
clock: "{ modulus, value }: clock arithmetic; \\val{ID.hour}",
|
|
20929
|
+
network: "{ layers, activation?, inputs?, flow?, seed?, labels? }: a forward pass, layer by layer",
|
|
20930
|
+
heatmap: "{ cells (softmax? per row) or expr in x, y; colormap?, rowLabels?, colLabels?, values? }: attention maps, loss fields",
|
|
20931
|
+
contours: "{ expr in x, y, levels? }: level curves (marching squares)",
|
|
20932
|
+
descent: "{ expr in x, y, start, rate, steps, momentum? }: gradient descent with an exact gradient",
|
|
20933
|
+
classifier: "{ epochs, centres?, rate?, start? }: logistic regression training; \\val{ID.accuracy}",
|
|
20934
|
+
kmeans: "{ centres, iteration, k? }: Lloyd iterations; \\val{ID.inertia}"
|
|
20927
20935
|
},
|
|
20928
20936
|
props: {
|
|
20929
20937
|
NAME: "a value: a number, [x, y] vector or [a, b, c, d] matrix (row by row; columns are where î and ĵ land)",
|
|
@@ -21425,8 +21433,8 @@ ${o.map((w) => ` beat ${w.beat}: ${w.message}`).join(`
|
|
|
21425
21433
|
const C = { ...r };
|
|
21426
21434
|
let W = l;
|
|
21427
21435
|
for (let V = 0; ; V = Math.min(x, V + S3)) {
|
|
21428
|
-
const tt = v + Xf(T, V / x) * M, { point:
|
|
21429
|
-
W += Mr(W, Qn([0, 0], R)), h("x", tt,
|
|
21436
|
+
const tt = v + Xf(T, V / x) * M, { point: U, direction: R } = Kf(E, V);
|
|
21437
|
+
W += Mr(W, Qn([0, 0], R)), h("x", tt, U[0]), h("z", tt, U[1]), h("rotateY", tt, W);
|
|
21430
21438
|
for (const [D, Y] of Object.entries(w.perMetre ?? {})) h(D, tt, C[D] + V * Y);
|
|
21431
21439
|
for (const [D, Y] of Object.entries(w.perSecond ?? {})) h(D, tt, C[D] + (tt - v) / 1e3 * Y);
|
|
21432
21440
|
if (V >= x) break;
|
|
@@ -21576,9 +21584,9 @@ function B3(t) {
|
|
|
21576
21584
|
}, E = (T, A, P, O, C) => {
|
|
21577
21585
|
const W = A("hour"), { top: q, bottom: V } = F3(W), tt = T.createLinearGradient(0, O.y, 0, O.ground);
|
|
21578
21586
|
tt.addColorStop(0, q), tt.addColorStop(1, V), T.fillStyle = tt, T.fillRect(O.x, O.y, O.w, O.ground - O.y);
|
|
21579
|
-
const
|
|
21580
|
-
if (
|
|
21581
|
-
T.fillStyle = "#ffffff", T.globalAlpha = (0.6 -
|
|
21587
|
+
const U = R3(W);
|
|
21588
|
+
if (U < 0.6) {
|
|
21589
|
+
T.fillStyle = "#ffffff", T.globalAlpha = (0.6 - U) / 0.6 * 0.9;
|
|
21582
21590
|
for (const I of g)
|
|
21583
21591
|
T.beginPath(), T.arc(O.x + I.u * O.w, O.y + I.v * (O.ground - O.y), I.size, 0, Math.PI * 2), T.fill();
|
|
21584
21592
|
T.globalAlpha = 1;
|
|
@@ -21589,14 +21597,14 @@ function B3(t) {
|
|
|
21589
21597
|
T.fillStyle = a.moon, T.beginPath(), T.arc(I, B, Y * 0.8, 0, Math.PI * 2), T.fill(), T.fillStyle = q, T.beginPath(), T.arc(I - Y * 0.35, B - Y * 0.15, Y * 0.7, 0, Math.PI * 2), T.fill();
|
|
21590
21598
|
}
|
|
21591
21599
|
const _ = Math.max(0, Math.min(1, A("clouds"))), j = Math.max(-1, Math.min(1, A("wind"))), nt = Math.round(_ * d.length);
|
|
21592
|
-
T.fillStyle = Bs("#ffffff", a.cloud === "#ffffff" ? "#ffffff" : a.cloud, 1), T.globalAlpha = 0.55 + 0.4 *
|
|
21600
|
+
T.fillStyle = Bs("#ffffff", a.cloud === "#ffffff" ? "#ffffff" : a.cloud, 1), T.globalAlpha = 0.55 + 0.4 * U;
|
|
21593
21601
|
for (let I = 0; I < nt; I++) {
|
|
21594
21602
|
const B = d[I], K = ((B.u * O.w + j * P * 0.012 * (0.6 + B.size * 0.5)) % (O.w * 1.4) + O.w * 1.4) % (O.w * 1.4) - O.w * 0.2, L = O.x + K, F = O.y + (0.08 + B.v * 0.42) * (O.ground - O.y), N = Math.min(O.w, O.h) * 0.07 * B.size;
|
|
21595
21603
|
for (let X = 0; X < B.puffs; X++)
|
|
21596
21604
|
T.beginPath(), T.ellipse(L + (X - (B.puffs - 1) / 2) * N * 0.9, F + X % 2 * N * 0.25, N * (X % 2 ? 0.8 : 1), N * 0.62, 0, 0, Math.PI * 2), T.fill();
|
|
21597
21605
|
}
|
|
21598
21606
|
T.globalAlpha = 1;
|
|
21599
|
-
const $ = (I) => Bs(Bs(I, "#0b1530", 0.65), I,
|
|
21607
|
+
const $ = (I) => Bs(Bs(I, "#0b1530", 0.65), I, U);
|
|
21600
21608
|
if (l === "hills") {
|
|
21601
21609
|
T.fillStyle = $(a.hills), T.beginPath(), T.moveTo(O.x, O.ground);
|
|
21602
21610
|
const I = 40;
|
|
@@ -21613,8 +21621,8 @@ function B3(t) {
|
|
|
21613
21621
|
for (const K of y) {
|
|
21614
21622
|
if (I > O.x + O.w) break;
|
|
21615
21623
|
const L = B * K.w, F = O.h * 0.22 * K.h;
|
|
21616
|
-
if (T.fillRect(I, O.ground - F, L, F), K.windows &&
|
|
21617
|
-
T.fillStyle = "#ffd66b", T.globalAlpha = 0.5 -
|
|
21624
|
+
if (T.fillRect(I, O.ground - F, L, F), K.windows && U < 0.5) {
|
|
21625
|
+
T.fillStyle = "#ffd66b", T.globalAlpha = 0.5 - U;
|
|
21618
21626
|
for (let N = O.ground - F + 6; N < O.ground - 8; N += 9) for (let X = I + 4; X < I + L - 4; X += 8) T.fillRect(X, N, 3, 4);
|
|
21619
21627
|
T.globalAlpha = 1, T.fillStyle = $(a.city);
|
|
21620
21628
|
}
|
|
@@ -21626,9 +21634,9 @@ function B3(t) {
|
|
|
21626
21634
|
const C = Math.max(-1, Math.min(1, A("wind"))), W = Math.max(0, Math.min(1, A("rain"))), q = Math.max(0, Math.min(1, A("snow")));
|
|
21627
21635
|
if (W > 0) {
|
|
21628
21636
|
T.strokeStyle = a.rain, T.globalAlpha = 0.35 + 0.45 * W, T.lineWidth = 1.2, T.lineCap = "round";
|
|
21629
|
-
const V = O.h * 0.05, tt = C * 0.45,
|
|
21637
|
+
const V = O.h * 0.05, tt = C * 0.45, U = Math.round(W * f.length);
|
|
21630
21638
|
T.beginPath();
|
|
21631
|
-
for (let R = 0; R <
|
|
21639
|
+
for (let R = 0; R < U; R++) {
|
|
21632
21640
|
const D = f[R], Y = ((D.v * O.h + P * D.speed * 0.9) % O.h + O.h) % O.h, _ = ((D.u * O.w + Y * tt) % O.w + O.w) % O.w;
|
|
21633
21641
|
T.moveTo(O.x + _, O.y + Y), T.lineTo(O.x + _ + tt * V, O.y + Y + V);
|
|
21634
21642
|
}
|
|
@@ -21638,8 +21646,8 @@ function B3(t) {
|
|
|
21638
21646
|
T.fillStyle = a.snow, T.globalAlpha = 0.85;
|
|
21639
21647
|
const V = Math.round(q * p.length);
|
|
21640
21648
|
for (let tt = 0; tt < V; tt++) {
|
|
21641
|
-
const
|
|
21642
|
-
T.beginPath(), T.arc(O.x + Y, O.y + R,
|
|
21649
|
+
const U = p[tt], R = ((U.v * O.h + P * U.speed * 0.08) % O.h + O.h) % O.h, D = Math.sin(P * 2e-3 + U.sway) * O.w * 0.02, Y = ((U.u * O.w + D + C * R * 0.3) % O.w + O.w) % O.w;
|
|
21650
|
+
T.beginPath(), T.arc(O.x + Y, O.y + R, U.size, 0, Math.PI * 2), T.fill();
|
|
21643
21651
|
}
|
|
21644
21652
|
T.globalAlpha = 1;
|
|
21645
21653
|
}
|
|
@@ -21664,8 +21672,8 @@ function B3(t) {
|
|
|
21664
21672
|
if (r === "sky")
|
|
21665
21673
|
E(T, C, P, W), v(T, C, P, W);
|
|
21666
21674
|
else if (T.fillStyle = a.wall, T.fillRect(0, 0, s, W.ground), T.fillStyle = a.floor, T.fillRect(0, W.ground, s, o - W.ground), T.fillStyle = a.skirting, T.fillRect(0, W.ground - o * 0.012, s, o * 0.012), c) {
|
|
21667
|
-
const q = s * 0.26, V = W.ground * 0.5, tt = s * 0.62,
|
|
21668
|
-
T.fillStyle = a.frame, T.fillRect(tt - 6,
|
|
21675
|
+
const q = s * 0.26, V = W.ground * 0.5, tt = s * 0.62, U = W.ground * 0.14;
|
|
21676
|
+
T.fillStyle = a.frame, T.fillRect(tt - 6, U - 6, q + 12, V + 12), T.save(), T.beginPath(), T.rect(tt, U, q, V), T.clip(), E(T, C, P, { x: tt, y: U, w: q, h: V, ground: U + V * 0.8 }), v(T, C, P, { x: tt, y: U, w: q, h: V }), T.restore(), T.strokeStyle = a.frame, T.lineWidth = 4, T.beginPath(), T.moveTo(tt + q / 2, U), T.lineTo(tt + q / 2, U + V), T.moveTo(tt, U + V / 2), T.lineTo(tt + q, U + V / 2), T.stroke();
|
|
21669
21677
|
}
|
|
21670
21678
|
T.restore();
|
|
21671
21679
|
}
|
|
@@ -21777,7 +21785,7 @@ function RT(t) {
|
|
|
21777
21785
|
};
|
|
21778
21786
|
}
|
|
21779
21787
|
const FT = {
|
|
21780
|
-
timeline:
|
|
21788
|
+
timeline: Gm,
|
|
21781
21789
|
to(t, e, n) {
|
|
21782
21790
|
const s = new Xn(n);
|
|
21783
21791
|
return s.to(t, e), s;
|
|
@@ -21910,7 +21918,7 @@ function X3(t, e, n) {
|
|
|
21910
21918
|
}
|
|
21911
21919
|
p.translate(-u, -d), p.globalCompositeOperation = "lighter", ll(p, i, n), t.save(), t.setTransform(1, 0, 0, 1, 0, 0), t.globalAlpha = 1, t.drawImage(f, u, d), t.restore();
|
|
21912
21920
|
}
|
|
21913
|
-
const NT = de.to, DT = de.from, BT = de.fromTo, zT = de.set, qT = de.timeline, jT = de.ticker, YT = de.splitText, KT = de.context, XT = de.matchMedia,
|
|
21921
|
+
const NT = de.to, DT = de.from, BT = de.fromTo, zT = de.set, qT = de.timeline, jT = de.ticker, YT = de.splitText, KT = de.context, XT = de.matchMedia, GT = de.quickTo, UT = de.imageSequence, VT = de.pageTransition;
|
|
21914
21922
|
F1();
|
|
21915
21923
|
export {
|
|
21916
21924
|
ts as ACTING_STYLES,
|
|
@@ -21932,16 +21940,16 @@ export {
|
|
|
21932
21940
|
x0 as CHART_KINDS,
|
|
21933
21941
|
jn as CHART_SURFACE,
|
|
21934
21942
|
Co as CHART_THEMES,
|
|
21935
|
-
|
|
21943
|
+
Ua as CODE_LANGUAGES,
|
|
21936
21944
|
tg as CODE_PANEL_EDITS,
|
|
21937
|
-
|
|
21945
|
+
Uo as CODE_SURFACE,
|
|
21938
21946
|
p5 as CODE_THEME,
|
|
21939
21947
|
Kn as CRICKET_ACTIONS,
|
|
21940
21948
|
ca as CRICKET_CAMERA_ANGLES,
|
|
21941
21949
|
Tg as CRICKET_CASTS,
|
|
21942
21950
|
ei as CRICKET_DECISION_VIEWS,
|
|
21943
21951
|
no as CRICKET_FIELDING_POSITIONS,
|
|
21944
|
-
|
|
21952
|
+
Ue as CRICKET_FORMATS,
|
|
21945
21953
|
al as CRICKET_MARKING_PROFILES,
|
|
21946
21954
|
Xt as CRICKET_PITCH,
|
|
21947
21955
|
Qe as CRICKET_PLAY_COMPONENTS,
|
|
@@ -21965,7 +21973,7 @@ export {
|
|
|
21965
21973
|
vt as EXPRESSIONS,
|
|
21966
21974
|
pf as FACIAL_HAIR_STYLES,
|
|
21967
21975
|
Z1 as FINGERS,
|
|
21968
|
-
|
|
21976
|
+
Ur as FLIPS,
|
|
21969
21977
|
_w as FOOT_SHAPES,
|
|
21970
21978
|
cc as FORMAT_VERSION,
|
|
21971
21979
|
dm as FRAME_ASPECTS,
|
|
@@ -22001,7 +22009,7 @@ export {
|
|
|
22001
22009
|
N5 as MANGA_CAST,
|
|
22002
22010
|
sS as MORPH_SAMPLES,
|
|
22003
22011
|
Ca as MUDRAS,
|
|
22004
|
-
|
|
22012
|
+
U3 as ManualClock,
|
|
22005
22013
|
Jc as MediaSync,
|
|
22006
22014
|
$0 as OUTFIT_PRESETS,
|
|
22007
22015
|
wy as Observer,
|
|
@@ -22013,7 +22021,7 @@ export {
|
|
|
22013
22021
|
eo as PROP_PRESETS,
|
|
22014
22022
|
Cs as PROP_SURFACE,
|
|
22015
22023
|
vg as QUADRUPED_ACTING,
|
|
22016
|
-
|
|
22024
|
+
Ga as REMOVE_STYLES,
|
|
22017
22025
|
ht as REST_POSE,
|
|
22018
22026
|
Fg as RIDING_POSES,
|
|
22019
22027
|
cn as SAMPLE_STEP,
|
|
@@ -22084,8 +22092,8 @@ export {
|
|
|
22084
22092
|
np as bounceOut,
|
|
22085
22093
|
Kk as boxMesh,
|
|
22086
22094
|
J2 as brushingPose,
|
|
22087
|
-
|
|
22088
|
-
|
|
22095
|
+
GS as bubblePath,
|
|
22096
|
+
US as bubblePop,
|
|
22089
22097
|
HT as buildScene,
|
|
22090
22098
|
LM as bus,
|
|
22091
22099
|
L4 as cameraFromValues,
|
|
@@ -22097,7 +22105,7 @@ export {
|
|
|
22097
22105
|
NM as cart,
|
|
22098
22106
|
V4 as castMember,
|
|
22099
22107
|
kx as cat,
|
|
22100
|
-
|
|
22108
|
+
UM as chair,
|
|
22101
22109
|
Qs as changingWindows,
|
|
22102
22110
|
ho as character,
|
|
22103
22111
|
E4 as characterAt,
|
|
@@ -22114,7 +22122,7 @@ export {
|
|
|
22114
22122
|
Vv as characterStrideLength,
|
|
22115
22123
|
T4 as characterTarget,
|
|
22116
22124
|
qp as charactersFor,
|
|
22117
|
-
|
|
22125
|
+
G4 as chart,
|
|
22118
22126
|
Ar as checkBeats,
|
|
22119
22127
|
ig as checkCast,
|
|
22120
22128
|
i5 as checkCharacterBeats3D,
|
|
@@ -22144,7 +22152,7 @@ export {
|
|
|
22144
22152
|
Mn as createRandom,
|
|
22145
22153
|
ba as createTrack,
|
|
22146
22154
|
s3 as cricketAction,
|
|
22147
|
-
|
|
22155
|
+
Ux as cricketCameraFraming,
|
|
22148
22156
|
il as cricketCameraReview,
|
|
22149
22157
|
kT as cricketCameraTracks,
|
|
22150
22158
|
MT as cricketClip,
|
|
@@ -22179,7 +22187,7 @@ export {
|
|
|
22179
22187
|
lT as defineGait,
|
|
22180
22188
|
cM as describeTarget,
|
|
22181
22189
|
zs as deserializeTimeline,
|
|
22182
|
-
|
|
22190
|
+
Gp as deserializeTrack,
|
|
22183
22191
|
ZM as desk,
|
|
22184
22192
|
MS as detectTempo,
|
|
22185
22193
|
wx as dog,
|
|
@@ -22190,7 +22198,7 @@ export {
|
|
|
22190
22198
|
S4 as drawCharacterHead,
|
|
22191
22199
|
x4 as drawCharacterInView,
|
|
22192
22200
|
fv as drawDustPuff,
|
|
22193
|
-
|
|
22201
|
+
Uf as drawEraser,
|
|
22194
22202
|
Jf as drawHand,
|
|
22195
22203
|
Xh as drawHeldItem,
|
|
22196
22204
|
iT as drawImpactStars,
|
|
@@ -22202,7 +22210,7 @@ export {
|
|
|
22202
22210
|
I4 as drawSolvedPart,
|
|
22203
22211
|
Ff as drawSolvedProp,
|
|
22204
22212
|
uv as drawSpeedLines,
|
|
22205
|
-
|
|
22213
|
+
Gb as drawStickFigure,
|
|
22206
22214
|
rT as drawStickSmear,
|
|
22207
22215
|
WT as drawTrail,
|
|
22208
22216
|
z4 as drawnPathTarget,
|
|
@@ -22212,17 +22220,17 @@ export {
|
|
|
22212
22220
|
Mu as easeInCubic,
|
|
22213
22221
|
Zg as easeInOut,
|
|
22214
22222
|
Cr as easeInOutCubic,
|
|
22215
|
-
|
|
22223
|
+
Ug as easeInOutQuad,
|
|
22216
22224
|
Xg as easeInQuad,
|
|
22217
22225
|
Jg as easeOut,
|
|
22218
22226
|
xu as easeOutCubic,
|
|
22219
|
-
|
|
22227
|
+
Gg as easeOutQuad,
|
|
22220
22228
|
cm as editDistance,
|
|
22221
22229
|
Zr as editError,
|
|
22222
22230
|
uo as editLog,
|
|
22223
22231
|
ep as elasticOut,
|
|
22224
22232
|
lr as ellipsePoints,
|
|
22225
|
-
|
|
22233
|
+
Gk as ellipsoidMesh,
|
|
22226
22234
|
tT as embrace,
|
|
22227
22235
|
Q4 as embraceSpacing,
|
|
22228
22236
|
CS as envelopeAt,
|
|
@@ -22278,13 +22286,13 @@ export {
|
|
|
22278
22286
|
pr as humanDanceFrame,
|
|
22279
22287
|
w4 as humanDanceTracks,
|
|
22280
22288
|
b4 as humanFieldLabel,
|
|
22281
|
-
|
|
22289
|
+
U2 as humanGag,
|
|
22282
22290
|
Fl as humanGaitPose,
|
|
22283
22291
|
Ll as humanGaitStrideLength,
|
|
22284
22292
|
qd as humanPlan,
|
|
22285
22293
|
wt as humanPose,
|
|
22286
22294
|
kd as illustrationTones,
|
|
22287
|
-
|
|
22295
|
+
UT as imageSequence,
|
|
22288
22296
|
ro as inertiaDuration,
|
|
22289
22297
|
oo as inertiaRest,
|
|
22290
22298
|
ga as inertiaValueAt,
|
|
@@ -22298,9 +22306,9 @@ export {
|
|
|
22298
22306
|
Sc as interpolateString,
|
|
22299
22307
|
BS as invertSimilarity,
|
|
22300
22308
|
Ng as isCubicBezierEasing,
|
|
22301
|
-
|
|
22309
|
+
Gh as isHeld,
|
|
22302
22310
|
wn as isInertiaTrack,
|
|
22303
|
-
|
|
22311
|
+
G3 as isMotionPathPoint,
|
|
22304
22312
|
bu as isMotionPathTrack,
|
|
22305
22313
|
tr as isParametricEasing,
|
|
22306
22314
|
io as isPathData,
|
|
@@ -22310,18 +22318,18 @@ export {
|
|
|
22310
22318
|
gS as isUnresolved,
|
|
22311
22319
|
Ku as isoDepth,
|
|
22312
22320
|
Xu as isometricBoxFaces,
|
|
22313
|
-
|
|
22321
|
+
Gu as isometricFaces,
|
|
22314
22322
|
dk as jointsInScene,
|
|
22315
22323
|
Xb as jointsToScene,
|
|
22316
22324
|
tk as leafOutfit,
|
|
22317
22325
|
Tf as leafOutfitContours,
|
|
22318
22326
|
pa as linear,
|
|
22319
22327
|
zf as lipSyncKeyframes,
|
|
22320
|
-
|
|
22328
|
+
Gl as lipSyncOver,
|
|
22321
22329
|
C4 as lipSyncTracks,
|
|
22322
22330
|
Df as lit,
|
|
22323
22331
|
de as live,
|
|
22324
|
-
|
|
22332
|
+
Gf as lookFields,
|
|
22325
22333
|
OS as loopBeats,
|
|
22326
22334
|
TS as loopEase,
|
|
22327
22335
|
ES as loopNoise,
|
|
@@ -22410,13 +22418,13 @@ export {
|
|
|
22410
22418
|
En as quadruped,
|
|
22411
22419
|
rS as quat,
|
|
22412
22420
|
RT as quickPlay,
|
|
22413
|
-
|
|
22421
|
+
GT as quickTo,
|
|
22414
22422
|
xx as rabbit,
|
|
22415
22423
|
Lu as randomBetween,
|
|
22416
22424
|
uS as randomChoice,
|
|
22417
22425
|
dS as randomNormal,
|
|
22418
22426
|
Vp as randomSnapped,
|
|
22419
|
-
|
|
22427
|
+
Ge as reachCharacter,
|
|
22420
22428
|
Jv as reachOf,
|
|
22421
22429
|
ng as resolveActingStyle,
|
|
22422
22430
|
If as resolveCharacterPoseKeys,
|
|
@@ -22428,12 +22436,12 @@ export {
|
|
|
22428
22436
|
K2 as resolveHeadLook,
|
|
22429
22437
|
ok as resolveHolding,
|
|
22430
22438
|
K1 as resolveIllustration,
|
|
22431
|
-
|
|
22439
|
+
Gd as resolveMeasurements,
|
|
22432
22440
|
jw as resolveOrganicBody,
|
|
22433
22441
|
Sl as resolvePoseKeys,
|
|
22434
22442
|
Jp as resolveSequence,
|
|
22435
22443
|
Fd as resolveStickFrame,
|
|
22436
|
-
|
|
22444
|
+
Ub as resolveStickPose,
|
|
22437
22445
|
Du as resolveValue,
|
|
22438
22446
|
mm as ribbon,
|
|
22439
22447
|
ym as ribbonHeadCap,
|
|
@@ -22451,7 +22459,7 @@ export {
|
|
|
22451
22459
|
s4 as scrubOnScroll,
|
|
22452
22460
|
q4 as scrubPath,
|
|
22453
22461
|
c4 as seatHeight,
|
|
22454
|
-
|
|
22462
|
+
Up as serializeTimeline,
|
|
22455
22463
|
Xp as serializeTrack,
|
|
22456
22464
|
zT as set,
|
|
22457
22465
|
Xl as shade,
|
|
@@ -22473,7 +22481,7 @@ export {
|
|
|
22473
22481
|
Wy as snapConfig,
|
|
22474
22482
|
Dy as snapDuration,
|
|
22475
22483
|
Ny as snapProgress,
|
|
22476
|
-
|
|
22484
|
+
U4 as softCartoonCharacter,
|
|
22477
22485
|
go as solveAt,
|
|
22478
22486
|
co as solvePlanSpace,
|
|
22479
22487
|
gg as solveProp,
|
|
@@ -22528,7 +22536,7 @@ export {
|
|
|
22528
22536
|
Zk as tubeMesh,
|
|
22529
22537
|
dt as unknownName,
|
|
22530
22538
|
i4 as unmount,
|
|
22531
|
-
|
|
22539
|
+
Ul as valueAt,
|
|
22532
22540
|
ZS as vec3,
|
|
22533
22541
|
Ve as vehicle,
|
|
22534
22542
|
vb as walkPose,
|