modern-canvas 0.12.13 → 0.12.14
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/dist/index.js +488 -482
- package/dist/scene/2d/Node2D.d.ts +3 -2
- package/dist/scene/2d/element/BaseElement2D.d.ts +5 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineProperty as Ht, Observable as de, Reactivable as Ir, parseColor as Ns, property as u, RawWeakMap as Br, isGradient as Ls, isColorFillObject as mr, clearUndef as Nr, idGenerator as Lr, normalizeFill as Fs, isNone as
|
|
1
|
+
import { defineProperty as Ht, Observable as de, Reactivable as Ir, parseColor as Ns, property as u, RawWeakMap as Br, isGradient as Ls, isColorFillObject as mr, clearUndef as Nr, idGenerator as Lr, normalizeFill as Fs, isNone as F, normalizeBackground as zs, normalizeForeground as $s, normalizeOutline as Vs, normalizeShadow as Gs, normalizeShape as js, getDefaultStyle as Ws, normalizeText as qs, normalizeTextContent as Xs, getDefaultTextStyle as Hs, getDefaultLayoutStyle as Ys } from "modern-idoc";
|
|
2
2
|
import { fonts as Ks } from "modern-font";
|
|
3
3
|
import { extend as Zs } from "colord";
|
|
4
4
|
import Js from "colord/plugins/names";
|
|
@@ -24,7 +24,7 @@ function _l(r = "node", e = {}) {
|
|
|
24
24
|
throw new Error(`Failed to createNode, tag: ${r}`);
|
|
25
25
|
return new t().setProperties(e);
|
|
26
26
|
}
|
|
27
|
-
class
|
|
27
|
+
class k {
|
|
28
28
|
static _queue = [];
|
|
29
29
|
static _currentTime = 0;
|
|
30
30
|
static _elapsed = 0;
|
|
@@ -80,10 +80,10 @@ class M {
|
|
|
80
80
|
this._queue = t;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
k.start();
|
|
84
84
|
async function Fr(r) {
|
|
85
85
|
return new Promise((e) => {
|
|
86
|
-
|
|
86
|
+
k.on(
|
|
87
87
|
() => {
|
|
88
88
|
r?.(), e();
|
|
89
89
|
},
|
|
@@ -187,7 +187,7 @@ function zr(r, e, t = {}) {
|
|
|
187
187
|
}
|
|
188
188
|
return n;
|
|
189
189
|
}
|
|
190
|
-
const ci = "WebGL2RenderingContext" in globalThis, ui = "ImageBitmap" in globalThis, di = "ResizeObserver" in globalThis, qe = "PointerEvent" in globalThis,
|
|
190
|
+
const ci = "WebGL2RenderingContext" in globalThis, ui = "ImageBitmap" in globalThis, di = "ResizeObserver" in globalThis, qe = "PointerEvent" in globalThis, pi = "WheelEvent" in globalThis, ml = "MouseEvent" in globalThis, he = "ontouchstart" in globalThis, fi = "onclick" in globalThis, $r = "createImageBitmap" in globalThis, Vr = "AudioContext" in globalThis, Gr = "webkitAudioContext" in globalThis, jr = "OfflineAudioContext" in globalThis, _i = "webkitOfflineAudioContext" in globalThis, mi = Vr || Gr, Rt = typeof window < "u", Wr = globalThis.devicePixelRatio || 1, qr = (r) => r !== null && typeof r == "object" && r.nodeType === 1, gi = (r) => qr(r) && r.tagName === "VIDEO", gl = (r) => qr(r) && r.tagName === "IMG";
|
|
191
191
|
function vi(r) {
|
|
192
192
|
return typeof r == "object" && r !== null && r.nodeType === 1 && r.tagName === "CANVAS";
|
|
193
193
|
}
|
|
@@ -245,7 +245,7 @@ class Xr {
|
|
|
245
245
|
return this._map.set(this._toRaw(e), this._toRaw(t)), this;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
class
|
|
248
|
+
class Mt {
|
|
249
249
|
cursor;
|
|
250
250
|
// Event
|
|
251
251
|
bubbles = !1;
|
|
@@ -253,7 +253,7 @@ class Ot {
|
|
|
253
253
|
cancelable = !1;
|
|
254
254
|
composed = !1;
|
|
255
255
|
defaultPrevented = !1;
|
|
256
|
-
eventPhase =
|
|
256
|
+
eventPhase = Mt.prototype.NONE;
|
|
257
257
|
isTrusted = !1;
|
|
258
258
|
timeStamp = 0;
|
|
259
259
|
type = "";
|
|
@@ -282,7 +282,7 @@ class Ot {
|
|
|
282
282
|
throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
class Pi extends
|
|
285
|
+
class Pi extends Mt {
|
|
286
286
|
getModifierState(...e) {
|
|
287
287
|
throw new Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
288
288
|
}
|
|
@@ -290,7 +290,7 @@ class Pi extends Ot {
|
|
|
290
290
|
throw new Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
class Hr extends
|
|
293
|
+
class Hr extends Mt {
|
|
294
294
|
client = { x: 0, y: 0 };
|
|
295
295
|
get clientX() {
|
|
296
296
|
return this.client.x;
|
|
@@ -416,7 +416,7 @@ class Si extends de {
|
|
|
416
416
|
const o = e.changedTouches[s];
|
|
417
417
|
typeof o.button > "u" && (o.button = 0), typeof o.buttons > "u" && (o.buttons = 1), typeof o.isPrimary > "u" && (o.isPrimary = e.touches.length === 1 && e.type === "touchstart"), typeof o.width > "u" && (o.width = o.radiusX || 1), typeof o.height > "u" && (o.height = o.radiusY || 1), typeof o.tiltX > "u" && (o.tiltX = 0), typeof o.tiltY > "u" && (o.tiltY = 0), typeof o.pointerType > "u" && (o.pointerType = "touch"), typeof o.pointerId > "u" && (o.pointerId = o.identifier || 0), typeof o.pressure > "u" && (o.pressure = o.force || 0.5), typeof o.twist > "u" && (o.twist = 0), typeof o.tangentialPressure > "u" && (o.tangentialPressure = 0), typeof o.layerX > "u" && (o.layerX = o.offsetX = o.clientX), typeof o.layerY > "u" && (o.layerY = o.offsetY = o.clientY), o.type = e.type, t.push(o);
|
|
418
418
|
}
|
|
419
|
-
else if (
|
|
419
|
+
else if (pi && e instanceof globalThis.WheelEvent)
|
|
420
420
|
t.push(e);
|
|
421
421
|
else if (qe && e instanceof globalThis.PointerEvent)
|
|
422
422
|
t.push(e);
|
|
@@ -536,7 +536,7 @@ class Si extends de {
|
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
let Ai = 0;
|
|
539
|
-
class
|
|
539
|
+
class pe extends Ir {
|
|
540
540
|
instanceId = ++Ai;
|
|
541
541
|
get json() {
|
|
542
542
|
return this.toJSON();
|
|
@@ -551,10 +551,10 @@ class fe extends Ir {
|
|
|
551
551
|
return !!(e && this.instanceId === e.instanceId);
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
class Ri extends
|
|
554
|
+
class Ri extends pe {
|
|
555
555
|
//
|
|
556
556
|
}
|
|
557
|
-
class
|
|
557
|
+
class fe extends Ri {
|
|
558
558
|
//
|
|
559
559
|
}
|
|
560
560
|
Zs([Js]);
|
|
@@ -653,8 +653,8 @@ class K extends de {
|
|
|
653
653
|
case "*":
|
|
654
654
|
for (let c = 0; c < i; c++) {
|
|
655
655
|
let d = 0;
|
|
656
|
-
for (let
|
|
657
|
-
d += o[c] * a[
|
|
656
|
+
for (let p = 0; p < i; p++)
|
|
657
|
+
d += o[c] * a[p * l + c];
|
|
658
658
|
h[c] = d;
|
|
659
659
|
}
|
|
660
660
|
break;
|
|
@@ -762,11 +762,11 @@ class re extends de {
|
|
|
762
762
|
const { dim: d } = t;
|
|
763
763
|
switch (e) {
|
|
764
764
|
case "*":
|
|
765
|
-
for (let
|
|
765
|
+
for (let p = 0; p < d; p++) {
|
|
766
766
|
let _ = 0;
|
|
767
|
-
for (let
|
|
768
|
-
|
|
769
|
-
c[
|
|
767
|
+
for (let f = 0; f < i; f++)
|
|
768
|
+
f < d && (_ += n[p * i + f] * (h[f] ?? 0));
|
|
769
|
+
c[p] = _;
|
|
770
770
|
}
|
|
771
771
|
break;
|
|
772
772
|
default:
|
|
@@ -776,20 +776,20 @@ class re extends de {
|
|
|
776
776
|
switch (e) {
|
|
777
777
|
case "*":
|
|
778
778
|
for (let d = 0; d < i; d++)
|
|
779
|
-
for (let
|
|
780
|
-
const _ =
|
|
781
|
-
let
|
|
779
|
+
for (let p = 0; p < o; p++) {
|
|
780
|
+
const _ = p * i;
|
|
781
|
+
let f = 0;
|
|
782
782
|
for (let m = 0; m < o; m++) {
|
|
783
783
|
const g = _ + m, w = m * i + d;
|
|
784
|
-
|
|
784
|
+
f += n[g] * (h[w] ?? 0);
|
|
785
785
|
}
|
|
786
|
-
c[_ + d] =
|
|
786
|
+
c[_ + d] = f;
|
|
787
787
|
}
|
|
788
788
|
break;
|
|
789
789
|
case "=":
|
|
790
790
|
for (let d = 0; d < a; d++) {
|
|
791
|
-
const
|
|
792
|
-
|
|
791
|
+
const p = h[d];
|
|
792
|
+
p !== void 0 && (n[d] = p);
|
|
793
793
|
}
|
|
794
794
|
return this._onUpdate(n), this.emit("update", n), this;
|
|
795
795
|
default:
|
|
@@ -843,16 +843,16 @@ class re extends de {
|
|
|
843
843
|
return this._array.slice();
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
class
|
|
846
|
+
class Mi extends re {
|
|
847
847
|
constructor(e) {
|
|
848
848
|
super(4, 4, e);
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
const
|
|
851
|
+
const Oi = Kt / 180, vl = 180 / Kt;
|
|
852
852
|
function se(r, e, t) {
|
|
853
853
|
return Math.max(e, Math.min(r, t));
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function C(r, e, t) {
|
|
856
856
|
return (1 - t) * r + t * e;
|
|
857
857
|
}
|
|
858
858
|
const bl = {
|
|
@@ -978,7 +978,7 @@ class Yr extends re {
|
|
|
978
978
|
]);
|
|
979
979
|
}
|
|
980
980
|
invert(e = 1) {
|
|
981
|
-
const t =
|
|
981
|
+
const t = C(1, -1, e), s = C(0, 255, e);
|
|
982
982
|
return this.multiply([
|
|
983
983
|
t,
|
|
984
984
|
0,
|
|
@@ -1005,19 +1005,19 @@ class Yr extends re {
|
|
|
1005
1005
|
sepia(e = 1) {
|
|
1006
1006
|
const t = se(e, 0, 1);
|
|
1007
1007
|
return this.multiply([
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1008
|
+
C(1, 0.393, t),
|
|
1009
|
+
C(0, 0.7689999, t),
|
|
1010
|
+
C(0, 0.18899999, t),
|
|
1011
1011
|
0,
|
|
1012
1012
|
0,
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1013
|
+
C(0, 0.349, t),
|
|
1014
|
+
C(1, 0.6859999, t),
|
|
1015
|
+
C(0, 0.16799999, t),
|
|
1016
1016
|
0,
|
|
1017
1017
|
0,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1018
|
+
C(0, 0.272, t),
|
|
1019
|
+
C(0, 0.5339999, t),
|
|
1020
|
+
C(1, 0.13099999, t),
|
|
1021
1021
|
0,
|
|
1022
1022
|
0,
|
|
1023
1023
|
0,
|
|
@@ -1052,7 +1052,7 @@ class Yr extends re {
|
|
|
1052
1052
|
]);
|
|
1053
1053
|
}
|
|
1054
1054
|
grayscale(e = 1) {
|
|
1055
|
-
const t = se(e, 0, 1), s =
|
|
1055
|
+
const t = se(e, 0, 1), s = C(1, 0.3, t), i = C(0, 0.3, t), o = C(1, 0.59, t), a = C(0, 0.59, t), n = C(1, 0.11, t), h = C(0, 0.11, t);
|
|
1056
1056
|
return this.multiply([
|
|
1057
1057
|
s,
|
|
1058
1058
|
a,
|
|
@@ -1107,7 +1107,7 @@ class Yr extends re {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
toMatrix4() {
|
|
1109
1109
|
const e = this._array;
|
|
1110
|
-
return new
|
|
1110
|
+
return new Mi([
|
|
1111
1111
|
e[0],
|
|
1112
1112
|
e[1],
|
|
1113
1113
|
e[2],
|
|
@@ -1151,7 +1151,7 @@ class Kr extends re {
|
|
|
1151
1151
|
n,
|
|
1152
1152
|
h,
|
|
1153
1153
|
l
|
|
1154
|
-
] = this._array, c = l * o - a * h, d = a * n - l * i,
|
|
1154
|
+
] = this._array, c = l * o - a * h, d = a * n - l * i, p = h * i - o * n, _ = e * c + t * d + s * p;
|
|
1155
1155
|
if (_ === 0)
|
|
1156
1156
|
return this.set([
|
|
1157
1157
|
0,
|
|
@@ -1164,17 +1164,17 @@ class Kr extends re {
|
|
|
1164
1164
|
0,
|
|
1165
1165
|
0
|
|
1166
1166
|
]);
|
|
1167
|
-
const
|
|
1167
|
+
const f = 1 / _;
|
|
1168
1168
|
return this.set([
|
|
1169
|
-
c *
|
|
1170
|
-
(s * h - l * t) *
|
|
1171
|
-
(a * t - s * o) *
|
|
1172
|
-
d *
|
|
1173
|
-
(l * e - s * n) *
|
|
1174
|
-
(s * i - a * e) *
|
|
1175
|
-
|
|
1176
|
-
(t * n - h * e) *
|
|
1177
|
-
(o * e - t * i) *
|
|
1169
|
+
c * f,
|
|
1170
|
+
(s * h - l * t) * f,
|
|
1171
|
+
(a * t - s * o) * f,
|
|
1172
|
+
d * f,
|
|
1173
|
+
(l * e - s * n) * f,
|
|
1174
|
+
(s * i - a * e) * f,
|
|
1175
|
+
p * f,
|
|
1176
|
+
(t * n - h * e) * f,
|
|
1177
|
+
(o * e - t * i) * f
|
|
1178
1178
|
]);
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
@@ -1209,7 +1209,7 @@ class Ui extends Kr {
|
|
|
1209
1209
|
]);
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
class
|
|
1212
|
+
class S extends K {
|
|
1213
1213
|
get x() {
|
|
1214
1214
|
return this._array[0];
|
|
1215
1215
|
}
|
|
@@ -1271,7 +1271,7 @@ class T extends K {
|
|
|
1271
1271
|
return this.set(e * s, t * s), this;
|
|
1272
1272
|
}
|
|
1273
1273
|
static lerp(e, t, s) {
|
|
1274
|
-
return new
|
|
1274
|
+
return new S(t).clone().sub(e).multiply(s).add(e);
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
1277
|
class ge {
|
|
@@ -1299,11 +1299,11 @@ class ge {
|
|
|
1299
1299
|
get height() {
|
|
1300
1300
|
return this.size.y;
|
|
1301
1301
|
}
|
|
1302
|
-
end = new
|
|
1302
|
+
end = new S();
|
|
1303
1303
|
position;
|
|
1304
1304
|
size;
|
|
1305
1305
|
constructor(...e) {
|
|
1306
|
-
const t = new
|
|
1306
|
+
const t = new S(), s = new S();
|
|
1307
1307
|
switch (e.length) {
|
|
1308
1308
|
case 0:
|
|
1309
1309
|
break;
|
|
@@ -1352,8 +1352,8 @@ class ge {
|
|
|
1352
1352
|
};
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
class
|
|
1356
|
-
static _t2d = /* @__PURE__ */ new
|
|
1355
|
+
class O extends Kr {
|
|
1356
|
+
static _t2d = /* @__PURE__ */ new O();
|
|
1357
1357
|
premultiply(e) {
|
|
1358
1358
|
return e.multiply(this, this);
|
|
1359
1359
|
}
|
|
@@ -1364,7 +1364,7 @@ class I extends Kr {
|
|
|
1364
1364
|
return this.skew(0, e);
|
|
1365
1365
|
}
|
|
1366
1366
|
skew(e, t) {
|
|
1367
|
-
return this.premultiply(
|
|
1367
|
+
return this.premultiply(O._t2d.makeSkew(e, t));
|
|
1368
1368
|
}
|
|
1369
1369
|
makeSkew(e, t) {
|
|
1370
1370
|
const s = Math.tan(e), i = Math.tan(t);
|
|
@@ -1393,7 +1393,7 @@ class I extends Kr {
|
|
|
1393
1393
|
return this.translate(e, t, s);
|
|
1394
1394
|
}
|
|
1395
1395
|
translate(e, t, s = 0) {
|
|
1396
|
-
return this.premultiply(
|
|
1396
|
+
return this.premultiply(O._t2d.makeTranslation(e, t, s));
|
|
1397
1397
|
}
|
|
1398
1398
|
makeTranslation(e, t, s = 0) {
|
|
1399
1399
|
return this.set([
|
|
@@ -1418,7 +1418,7 @@ class I extends Kr {
|
|
|
1418
1418
|
return this.scale(e, t, s);
|
|
1419
1419
|
}
|
|
1420
1420
|
scale(e, t, s = 1) {
|
|
1421
|
-
return this.premultiply(
|
|
1421
|
+
return this.premultiply(O._t2d.makeScale(e, t, s));
|
|
1422
1422
|
}
|
|
1423
1423
|
makeScale(e, t, s = 1) {
|
|
1424
1424
|
return this.set([
|
|
@@ -1443,7 +1443,7 @@ class I extends Kr {
|
|
|
1443
1443
|
return this.rotate(e);
|
|
1444
1444
|
}
|
|
1445
1445
|
rotate(e) {
|
|
1446
|
-
return this.premultiply(
|
|
1446
|
+
return this.premultiply(O._t2d.makeRotation(e));
|
|
1447
1447
|
}
|
|
1448
1448
|
rotate3d(e, t, s, i) {
|
|
1449
1449
|
const [o, a, n] = this._rotate3d(e, t, s, i);
|
|
@@ -1461,8 +1461,8 @@ class I extends Kr {
|
|
|
1461
1461
|
if (e === 0 && t === 0)
|
|
1462
1462
|
return [0, 0, i];
|
|
1463
1463
|
{
|
|
1464
|
-
const o = Math.cos(i), a = Math.sin(i), n = o + e * e * (1 - o), h = e * t * (1 - o) - s * a, l = e * s * (1 - o) + t * a, c = o + t * t * (1 - o), d = t * s * (1 - o) - e * a,
|
|
1465
|
-
return [_,
|
|
1464
|
+
const o = Math.cos(i), a = Math.sin(i), n = o + e * e * (1 - o), h = e * t * (1 - o) - s * a, l = e * s * (1 - o) + t * a, c = o + t * t * (1 - o), d = t * s * (1 - o) - e * a, p = o + s * s * (1 - o), _ = -Math.atan2(-d, c), f = -Math.atan2(l, Math.sqrt(d * d + p * p)), m = -Math.atan2(-h, n);
|
|
1465
|
+
return [_, f, m];
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
makeRotation(e) {
|
|
@@ -1489,7 +1489,7 @@ class I extends Kr {
|
|
|
1489
1489
|
return d < 1e-5 || Math.abs(B - d) < 1e-5 ? (t.rotation = c, t.skew.x = t.skew.y = 0) : (t.rotation = 0, t.skew.x = l, t.skew.y = c), t.scale.x = Math.sqrt(s * s + i * i), t.scale.y = Math.sqrt(o * o + a * a), t.position.x = n + (e.x * s + e.y * o), t.position.y = h + (e.x * i + e.y * a), t;
|
|
1490
1490
|
}
|
|
1491
1491
|
apply(e, t) {
|
|
1492
|
-
t = t || new
|
|
1492
|
+
t = t || new S();
|
|
1493
1493
|
const { a: s, c: i, tx: o, b: a, d: n, ty: h } = this.toObject(), l = e.x, c = e.y;
|
|
1494
1494
|
return t.x = s * l + i * c + o, t.y = a * l + n * c + h, t;
|
|
1495
1495
|
}
|
|
@@ -1497,7 +1497,7 @@ class I extends Kr {
|
|
|
1497
1497
|
return this.clone().affineInvert();
|
|
1498
1498
|
}
|
|
1499
1499
|
applyAffineInverse(e, t) {
|
|
1500
|
-
t = t || new
|
|
1500
|
+
t = t || new S();
|
|
1501
1501
|
const { a: s, b: i, c: o, d: a, tx: n, ty: h } = this.toObject(), l = 1 / (s * a + o * -i), c = e.x, d = e.y;
|
|
1502
1502
|
return t.x = a * l * c + -o * l * d + (h * o - n * a) * l, t.y = s * l * d + -i * l * c + (-h * s + n * i) * l, t;
|
|
1503
1503
|
}
|
|
@@ -1530,7 +1530,7 @@ var Di = Object.defineProperty, Zr = (r, e, t, s) => {
|
|
|
1530
1530
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
1531
1531
|
return i && Di(e, t, i), i;
|
|
1532
1532
|
};
|
|
1533
|
-
class Zt extends
|
|
1533
|
+
class Zt extends pe {
|
|
1534
1534
|
_starting = !1;
|
|
1535
1535
|
_nextDeltaTime = 0;
|
|
1536
1536
|
_startedProcess;
|
|
@@ -1544,13 +1544,13 @@ class Zt extends fe {
|
|
|
1544
1544
|
super(), this._onTicker = this._onTicker.bind(this), this.setProperties(e);
|
|
1545
1545
|
}
|
|
1546
1546
|
start(e) {
|
|
1547
|
-
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e),
|
|
1547
|
+
this._starting || (this._starting = !0, this._startedProcess && this.off("process", this._startedProcess), this._startedProcess = e, this.on("process", e), k.on(this._onTicker, { sort: 0 }));
|
|
1548
1548
|
}
|
|
1549
1549
|
stop() {
|
|
1550
|
-
this._starting && (this._starting = !1,
|
|
1550
|
+
this._starting && (this._starting = !1, k.off(this._onTicker, { sort: 0 }));
|
|
1551
1551
|
}
|
|
1552
1552
|
_onTicker() {
|
|
1553
|
-
const e =
|
|
1553
|
+
const e = k.elapsed * this.speed;
|
|
1554
1554
|
if ((this._nextDeltaTime -= e) <= 0) {
|
|
1555
1555
|
const s = (this._nextDeltaTime = this.spf) || e;
|
|
1556
1556
|
this.emit("process", s);
|
|
@@ -1916,7 +1916,7 @@ void main(void) {
|
|
|
1916
1916
|
const i = this._renderer.texture.maxUnits, o = this._getAttributeBuffer(e), a = new Float32Array(o), n = new Uint8Array(o), h = this._getIndexBuffer(t);
|
|
1917
1917
|
let l = 0, c = 0;
|
|
1918
1918
|
const d = [];
|
|
1919
|
-
for (let _ = s.length,
|
|
1919
|
+
for (let _ = s.length, f = { id: ++this._drawCallUid }, m = [], g = /* @__PURE__ */ new Map(), w = 0, P = 0, R = 0; R < _; R++) {
|
|
1920
1920
|
const A = s[R].texture, L = R === _ - 1;
|
|
1921
1921
|
if (!A || g.has(A)) {
|
|
1922
1922
|
if (!L)
|
|
@@ -1924,23 +1924,23 @@ void main(void) {
|
|
|
1924
1924
|
} else
|
|
1925
1925
|
m.push(A), g.set(A, w++);
|
|
1926
1926
|
if (L || w >= i) {
|
|
1927
|
-
|
|
1928
|
-
for (let
|
|
1927
|
+
f.textures = m, f.textureLocationMap = g, w = 0, f.first = c;
|
|
1928
|
+
for (let V = P; V <= R; V++) {
|
|
1929
1929
|
const {
|
|
1930
1930
|
indices: ur,
|
|
1931
1931
|
vertices: Lt,
|
|
1932
1932
|
uvs: dr = new Float32Array(0),
|
|
1933
|
-
dimension:
|
|
1934
|
-
texture:
|
|
1933
|
+
dimension: pr = new Float32Array(0),
|
|
1934
|
+
texture: fr,
|
|
1935
1935
|
modulate: je = this._defaultModulate,
|
|
1936
1936
|
backgroundColor: We = this._defaultBackgroundColor,
|
|
1937
1937
|
blendMode: _r = Ye.NORMAL,
|
|
1938
1938
|
disableWrapMode: Us = !1
|
|
1939
|
-
} = s[
|
|
1940
|
-
P <
|
|
1941
|
-
const Ds = l / this._vertexSize, Is = (
|
|
1939
|
+
} = s[V];
|
|
1940
|
+
P < V && f.blendMode !== _r && (f.count = c - f.first, d.push(f), P = V, f = { id: ++this._drawCallUid }, f.textures = m, f.first = c);
|
|
1941
|
+
const Ds = l / this._vertexSize, Is = (fr ? g.get(fr) : -1) ?? -1, Bs = Us ? 1 : 0;
|
|
1942
1942
|
for (let Ft = Lt.length, Y = 0; Y < Ft; Y += 2) {
|
|
1943
|
-
if (a[l++] = Is, a[l++] = Lt[Y], a[l++] = Lt[Y + 1], a[l++] =
|
|
1943
|
+
if (a[l++] = Is, a[l++] = Lt[Y], a[l++] = Lt[Y + 1], a[l++] = pr[0], a[l++] = pr[1], a[l++] = dr[Y], a[l++] = dr[Y + 1], je) {
|
|
1944
1944
|
const te = l * 4;
|
|
1945
1945
|
n[te] = je[0], n[te + 1] = je[1], n[te + 2] = je[2], n[te + 3] = je[3];
|
|
1946
1946
|
}
|
|
@@ -1952,24 +1952,24 @@ void main(void) {
|
|
|
1952
1952
|
}
|
|
1953
1953
|
for (let Ft = ur.length, Y = 0; Y < Ft; Y++)
|
|
1954
1954
|
h[c++] = Ds + ur[Y];
|
|
1955
|
-
|
|
1955
|
+
f.blendMode = _r;
|
|
1956
1956
|
}
|
|
1957
|
-
P = R + 1,
|
|
1957
|
+
P = R + 1, f.count = c - f.first, d.push(f), f = { id: ++this._drawCallUid }, m = [], g = /* @__PURE__ */ new Map();
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
1960
|
-
const
|
|
1961
|
-
|
|
1962
|
-
for (let _ = d.length,
|
|
1963
|
-
const m = d[
|
|
1960
|
+
const p = this._getShader(i);
|
|
1961
|
+
p.update(o, h);
|
|
1962
|
+
for (let _ = d.length, f = 0; f < _; f++) {
|
|
1963
|
+
const m = d[f], { first: g = 0, textures: w, textureLocationMap: P } = m;
|
|
1964
1964
|
for (let R = w.length, A = 0; A < R; A++) {
|
|
1965
|
-
const L = w[A],
|
|
1966
|
-
|
|
1965
|
+
const L = w[A], V = P.get(L);
|
|
1966
|
+
V !== void 0 && this._renderer.texture.bind({
|
|
1967
1967
|
target: "texture_2d",
|
|
1968
|
-
location:
|
|
1968
|
+
location: V,
|
|
1969
1969
|
value: L
|
|
1970
1970
|
});
|
|
1971
1971
|
}
|
|
1972
|
-
this._state.blendMode = m.blendMode, this._renderer.state.bind(this._state),
|
|
1972
|
+
this._state.blendMode = m.blendMode, this._renderer.state.bind(this._state), p.draw({
|
|
1973
1973
|
mode: "triangles",
|
|
1974
1974
|
count: m.count,
|
|
1975
1975
|
first: g,
|
|
@@ -2384,14 +2384,14 @@ class Vi extends X {
|
|
|
2384
2384
|
if (!c)
|
|
2385
2385
|
continue;
|
|
2386
2386
|
const d = c.name.replace(/\[.*?\]$/, "");
|
|
2387
|
-
let
|
|
2388
|
-
|
|
2387
|
+
let p = i.getUniformLocation(s, d);
|
|
2388
|
+
p || (p = i.getUniformLocation(s, c.name)), o.uniforms.set(d, {
|
|
2389
2389
|
name: d,
|
|
2390
2390
|
index: l,
|
|
2391
2391
|
type: this._renderer.bindPoints.get(c.type) ?? String(c.type),
|
|
2392
2392
|
size: c.size,
|
|
2393
2393
|
isArray: d !== c.name,
|
|
2394
|
-
location:
|
|
2394
|
+
location: p
|
|
2395
2395
|
});
|
|
2396
2396
|
}
|
|
2397
2397
|
}
|
|
@@ -2427,60 +2427,60 @@ ${s.getShaderInfoLog(i)}`);
|
|
|
2427
2427
|
const h = i[n], l = o.get(n);
|
|
2428
2428
|
if (!l)
|
|
2429
2429
|
continue;
|
|
2430
|
-
const { type: c, isArray: d, location:
|
|
2431
|
-
if (!(!
|
|
2432
|
-
switch (a.set(
|
|
2430
|
+
const { type: c, isArray: d, location: p } = l;
|
|
2431
|
+
if (!(!p || a.get(p) === h))
|
|
2432
|
+
switch (a.set(p, h), c) {
|
|
2433
2433
|
case "float":
|
|
2434
|
-
d ? s.uniform1fv(
|
|
2434
|
+
d ? s.uniform1fv(p, h) : s.uniform1f(p, h);
|
|
2435
2435
|
break;
|
|
2436
2436
|
case "unsigned_int":
|
|
2437
|
-
d ? s.uniform1uiv(
|
|
2437
|
+
d ? s.uniform1uiv(p, h) : s.uniform1ui(p, h);
|
|
2438
2438
|
break;
|
|
2439
2439
|
case "bool":
|
|
2440
2440
|
case "int":
|
|
2441
2441
|
case "sampler_2d":
|
|
2442
2442
|
case "sampler_cube":
|
|
2443
2443
|
case "sampler_2d_array":
|
|
2444
|
-
d ? s.uniform1iv(
|
|
2444
|
+
d ? s.uniform1iv(p, h) : s.uniform1i(p, h);
|
|
2445
2445
|
break;
|
|
2446
2446
|
case "bool_vec2":
|
|
2447
2447
|
case "int_vec2":
|
|
2448
|
-
s.uniform2iv(
|
|
2448
|
+
s.uniform2iv(p, h);
|
|
2449
2449
|
break;
|
|
2450
2450
|
case "unsigned_int_vec2":
|
|
2451
|
-
s.uniform2uiv(
|
|
2451
|
+
s.uniform2uiv(p, h);
|
|
2452
2452
|
break;
|
|
2453
2453
|
case "float_vec2":
|
|
2454
|
-
s.uniform2fv(
|
|
2454
|
+
s.uniform2fv(p, h);
|
|
2455
2455
|
break;
|
|
2456
2456
|
case "bool_vec3":
|
|
2457
2457
|
case "int_vec3":
|
|
2458
|
-
s.uniform3iv(
|
|
2458
|
+
s.uniform3iv(p, h);
|
|
2459
2459
|
break;
|
|
2460
2460
|
case "unsigned_int_vec3":
|
|
2461
|
-
s.uniform3uiv(
|
|
2461
|
+
s.uniform3uiv(p, h);
|
|
2462
2462
|
break;
|
|
2463
2463
|
case "float_vec3":
|
|
2464
|
-
s.uniform3fv(
|
|
2464
|
+
s.uniform3fv(p, h);
|
|
2465
2465
|
break;
|
|
2466
2466
|
case "bool_vec4":
|
|
2467
2467
|
case "int_vec4":
|
|
2468
|
-
s.uniform4iv(
|
|
2468
|
+
s.uniform4iv(p, h);
|
|
2469
2469
|
break;
|
|
2470
2470
|
case "unsigned_int_vec4":
|
|
2471
|
-
s.uniform4uiv(
|
|
2471
|
+
s.uniform4uiv(p, h);
|
|
2472
2472
|
break;
|
|
2473
2473
|
case "float_vec4":
|
|
2474
|
-
s.uniform4fv(
|
|
2474
|
+
s.uniform4fv(p, h);
|
|
2475
2475
|
break;
|
|
2476
2476
|
case "float_mat2":
|
|
2477
|
-
s.uniformMatrix2fv(
|
|
2477
|
+
s.uniformMatrix2fv(p, !1, h);
|
|
2478
2478
|
break;
|
|
2479
2479
|
case "float_mat3":
|
|
2480
|
-
s.uniformMatrix3fv(
|
|
2480
|
+
s.uniformMatrix3fv(p, !1, h);
|
|
2481
2481
|
break;
|
|
2482
2482
|
case "float_mat4":
|
|
2483
|
-
s.uniformMatrix4fv(
|
|
2483
|
+
s.uniformMatrix4fv(p, !1, h);
|
|
2484
2484
|
break;
|
|
2485
2485
|
}
|
|
2486
2486
|
}
|
|
@@ -2528,15 +2528,15 @@ function Gi(r) {
|
|
|
2528
2528
|
}
|
|
2529
2529
|
}
|
|
2530
2530
|
function gt(r, e, t) {
|
|
2531
|
-
const [s, i, o, a, n, h, l, c, d] = r,
|
|
2532
|
-
return { x:
|
|
2531
|
+
const [s, i, o, a, n, h, l, c, d] = r, p = s * e + a * t + l, _ = i * e + n * t + c, f = o * e + h * t + d;
|
|
2532
|
+
return { x: p / f, y: _ / f };
|
|
2533
2533
|
}
|
|
2534
2534
|
function ji(r, e) {
|
|
2535
|
-
const { x: t, y: s, width: i, height: o } = e, a = gt(r, t, s), n = gt(r, t + i, s), h = gt(r, t + i, s + o), l = gt(r, t, s + o), c = [a, n, h, l], d = c.map((w) => w.x),
|
|
2535
|
+
const { x: t, y: s, width: i, height: o } = e, a = gt(r, t, s), n = gt(r, t + i, s), h = gt(r, t + i, s + o), l = gt(r, t, s + o), c = [a, n, h, l], d = c.map((w) => w.x), p = c.map((w) => w.y), _ = Math.min(...d), f = Math.max(...d), m = Math.min(...p), g = Math.max(...p);
|
|
2536
2536
|
return {
|
|
2537
2537
|
x: _,
|
|
2538
2538
|
y: m,
|
|
2539
|
-
width:
|
|
2539
|
+
width: f - _,
|
|
2540
2540
|
height: g - m
|
|
2541
2541
|
};
|
|
2542
2542
|
}
|
|
@@ -2560,12 +2560,12 @@ class Wi extends X {
|
|
|
2560
2560
|
}
|
|
2561
2561
|
}
|
|
2562
2562
|
use() {
|
|
2563
|
-
const e = this._renderer, { pixelRatio: t, mask: s, viewport: i, screen: o, gl: a, program: n } = e, { viewMatrix: h } = n.uniforms, l = ji(h, s.last.mask), { x: c, y: d, width:
|
|
2564
|
-
let
|
|
2565
|
-
i.boundViewport ?
|
|
2563
|
+
const e = this._renderer, { pixelRatio: t, mask: s, viewport: i, screen: o, gl: a, program: n } = e, { viewMatrix: h } = n.uniforms, l = ji(h, s.last.mask), { x: c, y: d, width: p, height: _ } = l;
|
|
2564
|
+
let f;
|
|
2565
|
+
i.boundViewport ? f = i.boundViewport.height - (_ + d) * t : f = (o.height - (_ + d)) * t, a.scissor(
|
|
2566
2566
|
c * t,
|
|
2567
|
-
|
|
2568
|
-
|
|
2567
|
+
f,
|
|
2568
|
+
p * t,
|
|
2569
2569
|
_ * t
|
|
2570
2570
|
);
|
|
2571
2571
|
}
|
|
@@ -2690,11 +2690,11 @@ class Hi extends X {
|
|
|
2690
2690
|
if (n.anisoLevel && c === "linear" && this._renderer.extensions.anisotropicFiltering && h.anisoLevel) {
|
|
2691
2691
|
const {
|
|
2692
2692
|
MAX_TEXTURE_MAX_ANISOTROPY_EXT: d,
|
|
2693
|
-
TEXTURE_MAX_ANISOTROPY_EXT:
|
|
2693
|
+
TEXTURE_MAX_ANISOTROPY_EXT: p
|
|
2694
2694
|
} = this._renderer.extensions.anisotropicFiltering;
|
|
2695
2695
|
a.texParameterf(
|
|
2696
2696
|
l,
|
|
2697
|
-
|
|
2697
|
+
p,
|
|
2698
2698
|
Math.min(
|
|
2699
2699
|
n.anisoLevel,
|
|
2700
2700
|
a.getParameter(d)
|
|
@@ -2715,8 +2715,8 @@ class Hi extends X {
|
|
|
2715
2715
|
const h = n[i] ?? null, l = this.boundLocation, c = s !== h, d = {
|
|
2716
2716
|
location: o !== l && (c || a),
|
|
2717
2717
|
texture: c
|
|
2718
|
-
},
|
|
2719
|
-
d.location && (t.activeTexture(t.TEXTURE0 + o), this.boundLocation = o), d.texture && (t.bindTexture(
|
|
2718
|
+
}, p = this._renderer.getBindPoint(i);
|
|
2719
|
+
d.location && (t.activeTexture(t.TEXTURE0 + o), this.boundLocation = o), d.texture && (t.bindTexture(p, s ?? this.emptyTextures[i]), n[i] = s), this.boundTarget = i;
|
|
2720
2720
|
}
|
|
2721
2721
|
unbind(e, t = "texture_2d") {
|
|
2722
2722
|
const s = this._renderer.gl;
|
|
@@ -2751,10 +2751,10 @@ class Yi extends X {
|
|
|
2751
2751
|
stride: l = 0,
|
|
2752
2752
|
offset: c = 0,
|
|
2753
2753
|
divisor: d
|
|
2754
|
-
} = s,
|
|
2754
|
+
} = s, p = this._renderer.gl;
|
|
2755
2755
|
this._renderer.buffer.bind({ target: "array_buffer", value: o });
|
|
2756
2756
|
for (let _ = 0; _ < i; _++)
|
|
2757
|
-
|
|
2757
|
+
p.enableVertexAttribArray(t + _), p.vertexAttribPointer(
|
|
2758
2758
|
t + _,
|
|
2759
2759
|
a,
|
|
2760
2760
|
this._renderer.getBindPoint(n),
|
|
@@ -2762,7 +2762,7 @@ class Yi extends X {
|
|
|
2762
2762
|
l,
|
|
2763
2763
|
c + (l - c) / i * _
|
|
2764
2764
|
);
|
|
2765
|
-
d && ("vertexAttribDivisor" in
|
|
2765
|
+
d && ("vertexAttribDivisor" in p ? p.vertexAttribDivisor(t, d) : console.warn("Failed to active vertex array object, GPU Instancing is not supported on this device")), this.boundVertexArray.attributes[e] = {
|
|
2766
2766
|
enable: !0,
|
|
2767
2767
|
...s
|
|
2768
2768
|
};
|
|
@@ -2801,28 +2801,28 @@ class Yi extends X {
|
|
|
2801
2801
|
const o = this._renderer.program.getMeta(t), a = {}, n = {};
|
|
2802
2802
|
for (const l in s.attributes) {
|
|
2803
2803
|
const c = s.attributes[l], d = o.attributes.get(l);
|
|
2804
|
-
let
|
|
2805
|
-
"buffer" in c ?
|
|
2806
|
-
const _ = this._renderer.buffer.getMeta(
|
|
2804
|
+
let p;
|
|
2805
|
+
"buffer" in c ? p = { ...c } : p = { buffer: c }, p.size = p.size || d?.size || 0;
|
|
2806
|
+
const _ = this._renderer.buffer.getMeta(p.buffer), f = Number(d?.type.match(/mat(\d)/)?.[1] ?? 1);
|
|
2807
2807
|
let m;
|
|
2808
|
-
switch (
|
|
2808
|
+
switch (p.type) {
|
|
2809
2809
|
case "unsigned_byte":
|
|
2810
|
-
m =
|
|
2810
|
+
m = p.size;
|
|
2811
2811
|
break;
|
|
2812
2812
|
case "unsigned_short":
|
|
2813
|
-
m =
|
|
2813
|
+
m = p.size * 2;
|
|
2814
2814
|
break;
|
|
2815
2815
|
case "float":
|
|
2816
2816
|
default:
|
|
2817
|
-
m =
|
|
2817
|
+
m = p.size * 4;
|
|
2818
2818
|
break;
|
|
2819
2819
|
}
|
|
2820
|
-
m *=
|
|
2820
|
+
m *= f, a[_.id] ??= 0, a[_.id] += m, n[l] = { attrib: p, meta: _, info: d, byteLength: m, dimension: f };
|
|
2821
2821
|
}
|
|
2822
2822
|
const h = {};
|
|
2823
2823
|
for (const l in n) {
|
|
2824
|
-
const { attrib: c, meta: d, info:
|
|
2825
|
-
|
|
2824
|
+
const { attrib: c, meta: d, info: p, byteLength: _, dimension: f } = n[l];
|
|
2825
|
+
p?.location !== void 0 && (h[d.id] ??= 0, c.offset ??= h[d.id], c.stride ??= a[d.id] === _ ? 0 : a[d.id], this.enableVertexAttrib(l, p.location, c, f), h[d.id] += _);
|
|
2826
2826
|
}
|
|
2827
2827
|
}
|
|
2828
2828
|
const i = s.elementArrayBuffer ?? null;
|
|
@@ -3010,7 +3010,7 @@ class Ji extends Ee {
|
|
|
3010
3010
|
}), e.font = this, this;
|
|
3011
3011
|
}
|
|
3012
3012
|
}
|
|
3013
|
-
class Qt extends
|
|
3013
|
+
class Qt extends fe {
|
|
3014
3014
|
vertexAttributes;
|
|
3015
3015
|
indexBuffer;
|
|
3016
3016
|
instanceCount;
|
|
@@ -3068,7 +3068,7 @@ var Qi = Object.defineProperty, Qr = (r, e, t, s) => {
|
|
|
3068
3068
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
3069
3069
|
return i && Qi(e, t, i), i;
|
|
3070
3070
|
};
|
|
3071
|
-
class at extends
|
|
3071
|
+
class at extends fe {
|
|
3072
3072
|
needsUpload = !1;
|
|
3073
3073
|
constructor(e) {
|
|
3074
3074
|
super(), this.setProperties(e);
|
|
@@ -3112,7 +3112,7 @@ var eo = Object.defineProperty, es = (r, e, t, s) => {
|
|
|
3112
3112
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
3113
3113
|
return i && eo(e, t, i), i;
|
|
3114
3114
|
};
|
|
3115
|
-
class ce extends
|
|
3115
|
+
class ce extends fe {
|
|
3116
3116
|
needsUpload = !1;
|
|
3117
3117
|
constructor(e) {
|
|
3118
3118
|
super(), this.setProperties(e);
|
|
@@ -3156,7 +3156,7 @@ var to = Object.defineProperty, Ce = (r, e, t, s) => {
|
|
|
3156
3156
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
3157
3157
|
return i && to(e, t, i), i;
|
|
3158
3158
|
};
|
|
3159
|
-
class
|
|
3159
|
+
class z extends fe {
|
|
3160
3160
|
needsUpload = !1;
|
|
3161
3161
|
constructor(e) {
|
|
3162
3162
|
super(), this.setProperties({
|
|
@@ -3184,30 +3184,30 @@ class F extends pe {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
Ce([
|
|
3186
3186
|
u({ internal: !0 })
|
|
3187
|
-
],
|
|
3187
|
+
], z.prototype, "buffer");
|
|
3188
3188
|
Ce([
|
|
3189
3189
|
u({ fallback: 0 })
|
|
3190
|
-
],
|
|
3190
|
+
], z.prototype, "size");
|
|
3191
3191
|
Ce([
|
|
3192
3192
|
u({ fallback: !1 })
|
|
3193
|
-
],
|
|
3193
|
+
], z.prototype, "normalized");
|
|
3194
3194
|
Ce([
|
|
3195
3195
|
u({ fallback: "float" })
|
|
3196
|
-
],
|
|
3196
|
+
], z.prototype, "type");
|
|
3197
3197
|
Ce([
|
|
3198
3198
|
u()
|
|
3199
|
-
],
|
|
3199
|
+
], z.prototype, "stride");
|
|
3200
3200
|
Ce([
|
|
3201
3201
|
u()
|
|
3202
|
-
],
|
|
3202
|
+
], z.prototype, "offset");
|
|
3203
3203
|
Ce([
|
|
3204
3204
|
u()
|
|
3205
|
-
],
|
|
3205
|
+
], z.prototype, "divisor");
|
|
3206
3206
|
class wl extends Qt {
|
|
3207
3207
|
constructor() {
|
|
3208
3208
|
super({
|
|
3209
3209
|
vertexAttributes: {
|
|
3210
|
-
position: new
|
|
3210
|
+
position: new z({
|
|
3211
3211
|
buffer: new ce({
|
|
3212
3212
|
data: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
|
|
3213
3213
|
dynamic: !1
|
|
@@ -3225,7 +3225,7 @@ class wl extends Qt {
|
|
|
3225
3225
|
});
|
|
3226
3226
|
}
|
|
3227
3227
|
}
|
|
3228
|
-
class x extends
|
|
3228
|
+
class x extends fe {
|
|
3229
3229
|
static instance = new this();
|
|
3230
3230
|
vert;
|
|
3231
3231
|
frag;
|
|
@@ -3371,7 +3371,7 @@ class b extends Qt {
|
|
|
3371
3371
|
constructor() {
|
|
3372
3372
|
super({
|
|
3373
3373
|
vertexAttributes: {
|
|
3374
|
-
position: new
|
|
3374
|
+
position: new z({
|
|
3375
3375
|
buffer: new ce({
|
|
3376
3376
|
data: new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]),
|
|
3377
3377
|
dynamic: !1
|
|
@@ -3380,7 +3380,7 @@ class b extends Qt {
|
|
|
3380
3380
|
normalized: !1,
|
|
3381
3381
|
type: "float"
|
|
3382
3382
|
}),
|
|
3383
|
-
uv: new
|
|
3383
|
+
uv: new z({
|
|
3384
3384
|
buffer: new ce({
|
|
3385
3385
|
data: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
|
|
3386
3386
|
dynamic: !1
|
|
@@ -3404,13 +3404,13 @@ class Pl extends Qt {
|
|
|
3404
3404
|
const e = new ce({ data: new Float32Array(), dynamic: !0 }), t = new ce({ data: new Float32Array(), dynamic: !0 });
|
|
3405
3405
|
super({
|
|
3406
3406
|
vertexAttributes: {
|
|
3407
|
-
position: new
|
|
3407
|
+
position: new z({
|
|
3408
3408
|
buffer: e,
|
|
3409
3409
|
size: 2,
|
|
3410
3410
|
normalized: !1,
|
|
3411
3411
|
type: "float"
|
|
3412
3412
|
}),
|
|
3413
|
-
uv: new
|
|
3413
|
+
uv: new z({
|
|
3414
3414
|
buffer: t,
|
|
3415
3415
|
size: 2,
|
|
3416
3416
|
normalized: !1,
|
|
@@ -3429,7 +3429,7 @@ var oo = Object.defineProperty, Ie = (r, e, t, s) => {
|
|
|
3429
3429
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
3430
3430
|
return i && oo(e, t, i), i;
|
|
3431
3431
|
};
|
|
3432
|
-
class
|
|
3432
|
+
class T extends fe {
|
|
3433
3433
|
static get EMPTY() {
|
|
3434
3434
|
return new this({ width: 1, height: 1, pixels: null });
|
|
3435
3435
|
}
|
|
@@ -3528,23 +3528,23 @@ class E extends pe {
|
|
|
3528
3528
|
}
|
|
3529
3529
|
Ie([
|
|
3530
3530
|
u({ internal: !0 })
|
|
3531
|
-
],
|
|
3531
|
+
], T.prototype, "source");
|
|
3532
3532
|
Ie([
|
|
3533
3533
|
u({ fallback: 0 })
|
|
3534
|
-
],
|
|
3534
|
+
], T.prototype, "width");
|
|
3535
3535
|
Ie([
|
|
3536
3536
|
u({ fallback: 0 })
|
|
3537
|
-
],
|
|
3537
|
+
], T.prototype, "height");
|
|
3538
3538
|
Ie([
|
|
3539
3539
|
u({ fallback: "linear" })
|
|
3540
|
-
],
|
|
3540
|
+
], T.prototype, "filterMode");
|
|
3541
3541
|
Ie([
|
|
3542
3542
|
u({ fallback: "clamp_to_edge" })
|
|
3543
|
-
],
|
|
3543
|
+
], T.prototype, "wrapMode");
|
|
3544
3544
|
Ie([
|
|
3545
3545
|
u({ fallback: 1 })
|
|
3546
|
-
],
|
|
3547
|
-
class Gt extends
|
|
3546
|
+
], T.prototype, "pixelRatio");
|
|
3547
|
+
class Gt extends fe {
|
|
3548
3548
|
frames;
|
|
3549
3549
|
frameIndex = 0;
|
|
3550
3550
|
get currentFrame() {
|
|
@@ -3555,7 +3555,7 @@ class Gt extends pe {
|
|
|
3555
3555
|
let t;
|
|
3556
3556
|
if (Array.isArray(e))
|
|
3557
3557
|
t = e;
|
|
3558
|
-
else if (e instanceof
|
|
3558
|
+
else if (e instanceof T)
|
|
3559
3559
|
t = [{ texture: e, duration: 0 }];
|
|
3560
3560
|
else
|
|
3561
3561
|
throw new TypeError("Failed new AnimatedTexture");
|
|
@@ -3575,7 +3575,7 @@ var ao = Object.defineProperty, no = (r, e, t, s) => {
|
|
|
3575
3575
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
3576
3576
|
return i && ao(e, t, i), i;
|
|
3577
3577
|
};
|
|
3578
|
-
class er extends
|
|
3578
|
+
class er extends T {
|
|
3579
3579
|
constructor(e = document.createElement("canvas")) {
|
|
3580
3580
|
super(e);
|
|
3581
3581
|
}
|
|
@@ -3594,12 +3594,12 @@ class er extends E {
|
|
|
3594
3594
|
no([
|
|
3595
3595
|
u({ fallback: 2 })
|
|
3596
3596
|
], er.prototype, "pixelRatio");
|
|
3597
|
-
class Tl extends
|
|
3597
|
+
class Tl extends T {
|
|
3598
3598
|
static _cached = /* @__PURE__ */ new Map();
|
|
3599
3599
|
static get(e) {
|
|
3600
3600
|
const t = new Z(e), s = t.toHex();
|
|
3601
3601
|
let i = this._cached.get(s);
|
|
3602
|
-
return i || (i = new
|
|
3602
|
+
return i || (i = new T({
|
|
3603
3603
|
width: 1,
|
|
3604
3604
|
height: 1,
|
|
3605
3605
|
pixels: new Uint8Array([t.r8, t.g8, t.b8, t.a8])
|
|
@@ -3614,7 +3614,7 @@ class Tl extends E {
|
|
|
3614
3614
|
});
|
|
3615
3615
|
}
|
|
3616
3616
|
}
|
|
3617
|
-
class
|
|
3617
|
+
class Ot extends T {
|
|
3618
3618
|
static test(e) {
|
|
3619
3619
|
return Ls(e);
|
|
3620
3620
|
}
|
|
@@ -3625,8 +3625,8 @@ class Mt extends E {
|
|
|
3625
3625
|
const o = i.getContext("2d");
|
|
3626
3626
|
if (!o)
|
|
3627
3627
|
throw new Error("Failed to parse linear gradient, get canvas context is null.");
|
|
3628
|
-
const { angle: a = 0, stops: n } = e, h = t, l = s, c = h / 2, d = l / 2,
|
|
3629
|
-
for (const
|
|
3628
|
+
const { angle: a = 0, stops: n } = e, h = t, l = s, c = h / 2, d = l / 2, p = (a + 90) * Math.PI / 180, _ = Math.sin(p), f = -Math.cos(p), m = Math.abs(h * Math.sin(p)) + Math.abs(l * Math.cos(p)), g = c - _ * (m / 2), w = d - f * (m / 2), P = c + _ * (m / 2), R = d + f * (m / 2), A = o.createLinearGradient(g, w, P, R);
|
|
3629
|
+
for (const V of n) A.addColorStop(V.offset, V.color);
|
|
3630
3630
|
o.fillStyle = A, o.fillRect(0, 0, h, l);
|
|
3631
3631
|
const L = o.getImageData(0, 0, i.width, i.height);
|
|
3632
3632
|
return {
|
|
@@ -3637,7 +3637,7 @@ class Mt extends E {
|
|
|
3637
3637
|
}
|
|
3638
3638
|
constructor(e, t, s) {
|
|
3639
3639
|
super(
|
|
3640
|
-
|
|
3640
|
+
Ot.linearGradient(e, t, s)
|
|
3641
3641
|
);
|
|
3642
3642
|
}
|
|
3643
3643
|
}
|
|
@@ -3648,7 +3648,7 @@ function lo(r) {
|
|
|
3648
3648
|
crossorigin: r?.crossorigin ?? null
|
|
3649
3649
|
};
|
|
3650
3650
|
}
|
|
3651
|
-
class El extends
|
|
3651
|
+
class El extends T {
|
|
3652
3652
|
bitmap;
|
|
3653
3653
|
useBitmap;
|
|
3654
3654
|
preserveBitmap = !1;
|
|
@@ -3706,7 +3706,7 @@ class El extends E {
|
|
|
3706
3706
|
return this.preserveBitmap && this.bitmap && (this.bitmap.close(), this.bitmap = void 0), t;
|
|
3707
3707
|
}
|
|
3708
3708
|
}
|
|
3709
|
-
class ts extends
|
|
3709
|
+
class ts extends T {
|
|
3710
3710
|
constructor(e, t = 1, s = 1) {
|
|
3711
3711
|
const i = {
|
|
3712
3712
|
width: t,
|
|
@@ -3746,7 +3746,7 @@ function co(r) {
|
|
|
3746
3746
|
playsinline: !!(r?.playsinline ?? !0)
|
|
3747
3747
|
};
|
|
3748
3748
|
}
|
|
3749
|
-
const tr = class ss extends
|
|
3749
|
+
const tr = class ss extends T {
|
|
3750
3750
|
static mimeTypes = new Map(Object.entries({
|
|
3751
3751
|
ogv: "video/ogg",
|
|
3752
3752
|
mov: "video/quicktime",
|
|
@@ -3829,15 +3829,15 @@ const tr = class ss extends E {
|
|
|
3829
3829
|
this.autoUpdate && !this.isPlaying && (this._nextTime = 0, this.requestUpload(), this._nextTime = 0);
|
|
3830
3830
|
};
|
|
3831
3831
|
_setupAutoUpdate() {
|
|
3832
|
-
this.autoUpdate && this.isPlaying ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (
|
|
3832
|
+
this.autoUpdate && this.isPlaying ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (k.off(this.requestUpload), this._connected = !1, this._nextTime = 0), this._requestId === void 0 && (this._requestId = this.source.requestVideoFrameCallback(
|
|
3833
3833
|
this._videoFrameRequestCallback
|
|
3834
|
-
))) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected || (
|
|
3834
|
+
))) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected || (k.on(this.requestUpload), this._connected = !0, this._nextTime = 0)) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected && (k.off(this.requestUpload), this._connected = !1, this._nextTime = 0));
|
|
3835
3835
|
}
|
|
3836
3836
|
_videoFrameRequestCallback = () => {
|
|
3837
3837
|
this.requestUpload(), this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback);
|
|
3838
3838
|
};
|
|
3839
3839
|
requestUpload = () => {
|
|
3840
|
-
const e = Math.floor(
|
|
3840
|
+
const e = Math.floor(k.elapsed * this.source.playbackRate);
|
|
3841
3841
|
this._nextTime -= e, (!this._spf || this._nextTime <= 0) && (super.requestUpload(), this._nextTime = this._spf || 0);
|
|
3842
3842
|
};
|
|
3843
3843
|
async load() {
|
|
@@ -3865,7 +3865,7 @@ let uo = tr;
|
|
|
3865
3865
|
class wr extends ts {
|
|
3866
3866
|
//
|
|
3867
3867
|
}
|
|
3868
|
-
class
|
|
3868
|
+
class po extends bt {
|
|
3869
3869
|
fillStyle;
|
|
3870
3870
|
strokeStyle;
|
|
3871
3871
|
strokeAlignment;
|
|
@@ -3878,7 +3878,7 @@ class fo extends bt {
|
|
|
3878
3878
|
vertTransform;
|
|
3879
3879
|
_draws = [];
|
|
3880
3880
|
_parseDrawStyle(e) {
|
|
3881
|
-
return e ? e instanceof
|
|
3881
|
+
return e ? e instanceof T ? {
|
|
3882
3882
|
texture: e
|
|
3883
3883
|
} : {
|
|
3884
3884
|
backgroundColor: new Z(e).toInt8Array()
|
|
@@ -3955,8 +3955,8 @@ class fo extends bt {
|
|
|
3955
3955
|
const a = i.width, n = i.height;
|
|
3956
3956
|
for (let h = t.length, l = e; l < h; l += 2) {
|
|
3957
3957
|
const c = t[l], d = t[l + 1];
|
|
3958
|
-
let
|
|
3959
|
-
o ? [
|
|
3958
|
+
let p, _;
|
|
3959
|
+
o ? [p, _] = o.apply({ x: c, y: d }).toArray() : [p, _] = [c / a, d / n], s.push(p, _);
|
|
3960
3960
|
}
|
|
3961
3961
|
} else
|
|
3962
3962
|
for (let a = t.length, n = e; n < a; n += 2)
|
|
@@ -3993,7 +3993,7 @@ class fo extends bt {
|
|
|
3993
3993
|
return e;
|
|
3994
3994
|
}
|
|
3995
3995
|
}
|
|
3996
|
-
class
|
|
3996
|
+
class fo {
|
|
3997
3997
|
front = [];
|
|
3998
3998
|
default = [];
|
|
3999
3999
|
back = [];
|
|
@@ -4041,7 +4041,7 @@ class po {
|
|
|
4041
4041
|
return [...this.default];
|
|
4042
4042
|
}
|
|
4043
4043
|
}
|
|
4044
|
-
class _o extends
|
|
4044
|
+
class _o extends pe {
|
|
4045
4045
|
constructor(e) {
|
|
4046
4046
|
return super(), this.parent = e, new Proxy(this, {
|
|
4047
4047
|
get: (t, s, i) => Reflect.has(t, s) || String(s).startsWith("_") ? Reflect.get(t, s, i) : t.getProperty(String(s)),
|
|
@@ -4071,7 +4071,7 @@ function vo(r) {
|
|
|
4071
4071
|
let e = Pr[r] ?? 0;
|
|
4072
4072
|
return e++, Pr[r] = e, e;
|
|
4073
4073
|
}
|
|
4074
|
-
let
|
|
4074
|
+
let M = class extends pe {
|
|
4075
4075
|
_meta = new _o(this);
|
|
4076
4076
|
get meta() {
|
|
4077
4077
|
return this._meta;
|
|
@@ -4158,7 +4158,7 @@ let O = class extends fe {
|
|
|
4158
4158
|
return this;
|
|
4159
4159
|
}
|
|
4160
4160
|
/** Children */
|
|
4161
|
-
_children = new
|
|
4161
|
+
_children = new fo();
|
|
4162
4162
|
get children() {
|
|
4163
4163
|
return this._children.default;
|
|
4164
4164
|
}
|
|
@@ -4267,7 +4267,7 @@ let O = class extends fe {
|
|
|
4267
4267
|
const n = e.renderStack.push(this);
|
|
4268
4268
|
a = e.renderStack.currentCall, e.renderStack.currentCall = n;
|
|
4269
4269
|
}
|
|
4270
|
-
if (this.mask instanceof
|
|
4270
|
+
if (this.mask instanceof M)
|
|
4271
4271
|
this.getNode("__$mask") || (this.mask.processMode = "disabled", this.appendChild(this.mask, "front"));
|
|
4272
4272
|
else {
|
|
4273
4273
|
const n = this.getNode("__$mask");
|
|
@@ -4431,43 +4431,43 @@ let O = class extends fe {
|
|
|
4431
4431
|
static parse(r) {
|
|
4432
4432
|
if (Array.isArray(r))
|
|
4433
4433
|
return r.map((n) => this.parse(n));
|
|
4434
|
-
const { meta: e = {}, children: t, ...s } = r, { inCanvasIs: i = "Node" } = e, o = Yt.get(i) ??
|
|
4434
|
+
const { meta: e = {}, children: t, ...s } = r, { inCanvasIs: i = "Node" } = e, o = Yt.get(i) ?? M, a = new o({ ...s, meta: e });
|
|
4435
4435
|
return t?.forEach((n) => a.appendChild(this.parse(n))), a;
|
|
4436
4436
|
}
|
|
4437
4437
|
};
|
|
4438
4438
|
ae([
|
|
4439
4439
|
u({ fallback: Lr() })
|
|
4440
|
-
],
|
|
4440
|
+
], M.prototype, "id", 2);
|
|
4441
4441
|
ae([
|
|
4442
4442
|
u({ fallback: Lr() })
|
|
4443
|
-
],
|
|
4443
|
+
], M.prototype, "name", 2);
|
|
4444
4444
|
ae([
|
|
4445
4445
|
u({ internal: !0, fallback: "inherit" })
|
|
4446
|
-
],
|
|
4446
|
+
], M.prototype, "processMode", 2);
|
|
4447
4447
|
ae([
|
|
4448
4448
|
u({ internal: !0, fallback: "default" })
|
|
4449
|
-
],
|
|
4449
|
+
], M.prototype, "processSortMode", 2);
|
|
4450
4450
|
ae([
|
|
4451
4451
|
u({ internal: !0, fallback: "inherit" })
|
|
4452
|
-
],
|
|
4452
|
+
], M.prototype, "renderMode", 2);
|
|
4453
4453
|
ae([
|
|
4454
4454
|
u({ internal: !0, fallback: "inherit" })
|
|
4455
|
-
],
|
|
4455
|
+
], M.prototype, "inputMode", 2);
|
|
4456
4456
|
ae([
|
|
4457
4457
|
u({ internal: !0, fallback: "default" })
|
|
4458
|
-
],
|
|
4458
|
+
], M.prototype, "internalMode", 2);
|
|
4459
4459
|
ae([
|
|
4460
4460
|
u({ internal: !0 })
|
|
4461
|
-
],
|
|
4462
|
-
|
|
4461
|
+
], M.prototype, "mask", 2);
|
|
4462
|
+
M = ae([
|
|
4463
4463
|
v("Node")
|
|
4464
|
-
],
|
|
4464
|
+
], M);
|
|
4465
4465
|
var bo = Object.defineProperty, yo = Object.getOwnPropertyDescriptor, Be = (r, e, t, s) => {
|
|
4466
4466
|
for (var i = s > 1 ? void 0 : s ? yo(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
4467
4467
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
4468
4468
|
return s && i && bo(e, t, i), i;
|
|
4469
4469
|
};
|
|
4470
|
-
let G = class extends
|
|
4470
|
+
let G = class extends M {
|
|
4471
4471
|
constructor(r, e = []) {
|
|
4472
4472
|
super(), this.setProperties(r).append(e);
|
|
4473
4473
|
}
|
|
@@ -4550,7 +4550,7 @@ let ye = class extends G {
|
|
|
4550
4550
|
}
|
|
4551
4551
|
_modulate = new Z(4294967295);
|
|
4552
4552
|
// Batch render
|
|
4553
|
-
context = new
|
|
4553
|
+
context = new po();
|
|
4554
4554
|
_resetContext = !0;
|
|
4555
4555
|
_redrawing = !0;
|
|
4556
4556
|
_relayouting = !1;
|
|
@@ -4664,12 +4664,12 @@ var Po = Object.defineProperty, To = Object.getOwnPropertyDescriptor, Ne = (r, e
|
|
|
4664
4664
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
4665
4665
|
return s && i && Po(e, t, i), i;
|
|
4666
4666
|
};
|
|
4667
|
-
let j = class extends
|
|
4667
|
+
let j = class extends M {
|
|
4668
4668
|
constructor(r = !1) {
|
|
4669
4669
|
super(), this.flipY = r, this.projection.flipY(r);
|
|
4670
4670
|
}
|
|
4671
4671
|
projection = new Ui();
|
|
4672
|
-
canvasTransform = new
|
|
4672
|
+
canvasTransform = new O();
|
|
4673
4673
|
_framebufferIndex = 0;
|
|
4674
4674
|
_framebuffers = [
|
|
4675
4675
|
{ texture: new wr(), needsUpload: !1 },
|
|
@@ -4989,7 +4989,7 @@ var Ao = Object.defineProperty, Ro = Object.getOwnPropertyDescriptor, Le = (r, e
|
|
|
4989
4989
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
4990
4990
|
return s && i && Ao(e, t, i), i;
|
|
4991
4991
|
};
|
|
4992
|
-
let ie = class extends
|
|
4992
|
+
let ie = class extends M {
|
|
4993
4993
|
static from(r, e = !1) {
|
|
4994
4994
|
const [t, s] = r ? Array.isArray(r) ? r : [0, r] : [];
|
|
4995
4995
|
return new ie({
|
|
@@ -5038,10 +5038,10 @@ Le([
|
|
|
5038
5038
|
ie = Le([
|
|
5039
5039
|
v("Timeline")
|
|
5040
5040
|
], ie);
|
|
5041
|
-
var
|
|
5042
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
5041
|
+
var Mo = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, is = (r, e, t, s) => {
|
|
5042
|
+
for (var i = s > 1 ? void 0 : s ? Oo(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
5043
5043
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
5044
|
-
return s && i &&
|
|
5044
|
+
return s && i && Mo(e, t, i), i;
|
|
5045
5045
|
};
|
|
5046
5046
|
let wt = class extends j {
|
|
5047
5047
|
};
|
|
@@ -5126,32 +5126,34 @@ var Uo = Object.getOwnPropertyDescriptor, Do = (r, e, t, s) => {
|
|
|
5126
5126
|
(a = r[o]) && (i = a(i) || i);
|
|
5127
5127
|
return i;
|
|
5128
5128
|
};
|
|
5129
|
-
let
|
|
5129
|
+
let Me = class extends y {
|
|
5130
5130
|
constructor(r, e = []) {
|
|
5131
5131
|
super(), this.setProperties(r).append(e);
|
|
5132
5132
|
}
|
|
5133
5133
|
};
|
|
5134
|
-
|
|
5134
|
+
Me = Do([
|
|
5135
5135
|
v("Transition", {
|
|
5136
5136
|
effectMode: "transition",
|
|
5137
5137
|
processMode: "pausable",
|
|
5138
5138
|
duration: 2e3
|
|
5139
5139
|
})
|
|
5140
|
-
],
|
|
5140
|
+
], Me);
|
|
5141
5141
|
var Io = Object.defineProperty, Bo = Object.getOwnPropertyDescriptor, rr = (r, e, t, s) => {
|
|
5142
5142
|
for (var i = s > 1 ? void 0 : s ? Bo(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
5143
5143
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
5144
5144
|
return s && i && Io(e, t, i), i;
|
|
5145
5145
|
};
|
|
5146
5146
|
let xe = class extends ye {
|
|
5147
|
-
position = new
|
|
5148
|
-
scale = new
|
|
5149
|
-
skew = new
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5147
|
+
position = new S().on("update", () => this.updateGlobalTransform());
|
|
5148
|
+
scale = new S(1, 1).on("update", () => this.updateGlobalTransform());
|
|
5149
|
+
skew = new S().on("update", () => this.updateGlobalTransform());
|
|
5150
|
+
pivot = new S().on("update", () => this.updateGlobalTransform());
|
|
5151
|
+
extraTransform = new O();
|
|
5152
|
+
transform = new O();
|
|
5153
|
+
globalPosition = new S();
|
|
5154
|
+
globalScale = new S();
|
|
5155
|
+
globalSkew = new S();
|
|
5156
|
+
globalTransform = new O();
|
|
5155
5157
|
_parentTransformDirtyId;
|
|
5156
5158
|
constructor(r, e = []) {
|
|
5157
5159
|
super(), this.setProperties(r).append(e);
|
|
@@ -5163,12 +5165,8 @@ let xe = class extends ye {
|
|
|
5163
5165
|
break;
|
|
5164
5166
|
}
|
|
5165
5167
|
}
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
}
|
|
5169
|
-
updateTransform(r) {
|
|
5170
|
-
const e = this.getTransformOrigin(), t = this.transform.identity().translate(-e.x, -e.y).scale(this.scale.x, this.scale.y).skew(this.skew.x, this.skew.y).rotate(this.rotation);
|
|
5171
|
-
r?.(t), t.translate(this.position.x, this.position.y).translate(e.x, e.y);
|
|
5168
|
+
updateTransform() {
|
|
5169
|
+
this.transform.identity().translate(-this.pivot.x, -this.pivot.y).scale(this.scale.x, this.scale.y).skew(this.skew.x, this.skew.y).rotate(this.rotation).multiply(this.extraTransform).translate(this.position.x, this.position.y).translate(this.pivot.x, this.pivot.y);
|
|
5172
5170
|
}
|
|
5173
5171
|
updateGlobalTransform() {
|
|
5174
5172
|
this.updateTransform();
|
|
@@ -5195,8 +5193,8 @@ let xe = class extends ye {
|
|
|
5195
5193
|
[t, s, i, o, a, n] = this.globalTransform.toArray();
|
|
5196
5194
|
const h = r.slice();
|
|
5197
5195
|
for (let l = r.length, c = 0; c < l; c += 2) {
|
|
5198
|
-
const d = r[c],
|
|
5199
|
-
h[c] = t * d + s *
|
|
5196
|
+
const d = r[c], p = r[c + 1];
|
|
5197
|
+
h[c] = t * d + s * p + i, h[c + 1] = o * d + a * p + n;
|
|
5200
5198
|
}
|
|
5201
5199
|
return h;
|
|
5202
5200
|
}
|
|
@@ -5234,21 +5232,21 @@ var No = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, kt = (r, e
|
|
|
5234
5232
|
};
|
|
5235
5233
|
let Ke = class extends xe {
|
|
5236
5234
|
_screenOffset = { x: 0, y: 0 };
|
|
5237
|
-
_zoom = new
|
|
5235
|
+
_zoom = new S(1, 1).on("update", () => this.updateCanvasTransform());
|
|
5238
5236
|
get zoom() {
|
|
5239
5237
|
return this._zoom;
|
|
5240
5238
|
}
|
|
5241
5239
|
set zoom(r) {
|
|
5242
5240
|
this._zoom.set(r.x, r.y);
|
|
5243
5241
|
}
|
|
5244
|
-
_minZoom = new
|
|
5242
|
+
_minZoom = new S(0.02, 0.02);
|
|
5245
5243
|
get minZoom() {
|
|
5246
5244
|
return this._minZoom;
|
|
5247
5245
|
}
|
|
5248
5246
|
set minZoom(r) {
|
|
5249
5247
|
this._minZoom.set(r.x, r.y);
|
|
5250
5248
|
}
|
|
5251
|
-
_maxZoom = new
|
|
5249
|
+
_maxZoom = new S(256, 256);
|
|
5252
5250
|
get maxZoom() {
|
|
5253
5251
|
return this._maxZoom;
|
|
5254
5252
|
}
|
|
@@ -5414,7 +5412,7 @@ function Cl(r) {
|
|
|
5414
5412
|
}
|
|
5415
5413
|
return e;
|
|
5416
5414
|
}
|
|
5417
|
-
function Fo(r, e, t, s = new
|
|
5415
|
+
function Fo(r, e, t, s = new O()) {
|
|
5418
5416
|
return r = !r || r === "none" ? "" : r, At(r, { width: e, height: t }).reverse().forEach(({ name: i, args: o }) => {
|
|
5419
5417
|
const a = o.map((n) => n.normalizedIntValue);
|
|
5420
5418
|
switch (i) {
|
|
@@ -5506,13 +5504,13 @@ var os = Object.defineProperty, $o = Object.getOwnPropertyDescriptor, Vo = (r, e
|
|
|
5506
5504
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
5507
5505
|
return s && i && os(e, t, i), i;
|
|
5508
5506
|
}, Go = (r, e, t) => Vo(r, e + "", t);
|
|
5509
|
-
let
|
|
5507
|
+
let $ = class extends y {
|
|
5510
5508
|
constructor(r, e = []) {
|
|
5511
5509
|
super(), this.setProperties(r).append(e);
|
|
5512
5510
|
}
|
|
5513
5511
|
apply(r, e) {
|
|
5514
5512
|
e.redraw(r, () => {
|
|
5515
|
-
b.draw(r,
|
|
5513
|
+
b.draw(r, $.material, {
|
|
5516
5514
|
sampler: 0,
|
|
5517
5515
|
saturation: this.saturation,
|
|
5518
5516
|
contrast: this.contrast,
|
|
@@ -5526,7 +5524,7 @@ let z = class extends y {
|
|
|
5526
5524
|
});
|
|
5527
5525
|
}
|
|
5528
5526
|
};
|
|
5529
|
-
Go(
|
|
5527
|
+
Go($, "material", new x({
|
|
5530
5528
|
vert: `precision mediump float;
|
|
5531
5529
|
attribute vec2 position;
|
|
5532
5530
|
attribute vec2 uv;
|
|
@@ -5563,31 +5561,31 @@ void main(void) {
|
|
|
5563
5561
|
}));
|
|
5564
5562
|
ne([
|
|
5565
5563
|
u({ fallback: 1 })
|
|
5566
|
-
],
|
|
5564
|
+
], $.prototype, "saturation", 2);
|
|
5567
5565
|
ne([
|
|
5568
5566
|
u({ fallback: 1 })
|
|
5569
|
-
],
|
|
5567
|
+
], $.prototype, "contrast", 2);
|
|
5570
5568
|
ne([
|
|
5571
5569
|
u({ fallback: 1 })
|
|
5572
|
-
],
|
|
5570
|
+
], $.prototype, "brightness", 2);
|
|
5573
5571
|
ne([
|
|
5574
5572
|
u({ fallback: 1 })
|
|
5575
|
-
],
|
|
5573
|
+
], $.prototype, "red", 2);
|
|
5576
5574
|
ne([
|
|
5577
5575
|
u({ fallback: 1 })
|
|
5578
|
-
],
|
|
5576
|
+
], $.prototype, "green", 2);
|
|
5579
5577
|
ne([
|
|
5580
5578
|
u({ fallback: 1 })
|
|
5581
|
-
],
|
|
5579
|
+
], $.prototype, "blue", 2);
|
|
5582
5580
|
ne([
|
|
5583
5581
|
u({ fallback: 1 })
|
|
5584
|
-
],
|
|
5582
|
+
], $.prototype, "alpha", 2);
|
|
5585
5583
|
ne([
|
|
5586
5584
|
u({ fallback: 1 })
|
|
5587
|
-
],
|
|
5588
|
-
|
|
5585
|
+
], $.prototype, "gamma", 2);
|
|
5586
|
+
$ = ne([
|
|
5589
5587
|
v("ColorAdjustEffect")
|
|
5590
|
-
],
|
|
5588
|
+
], $);
|
|
5591
5589
|
var as = Object.defineProperty, jo = Object.getOwnPropertyDescriptor, Wo = (r, e, t) => e in r ? as(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ns = (r, e, t, s) => {
|
|
5592
5590
|
for (var i = s > 1 ? void 0 : s ? jo(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
5593
5591
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
@@ -5678,7 +5676,7 @@ var ls = Object.defineProperty, Xo = Object.getOwnPropertyDescriptor, Ho = (r, e
|
|
|
5678
5676
|
return s && i && ls(e, t, i), i;
|
|
5679
5677
|
}, Yo = (r, e, t) => Ho(r, e + "", t);
|
|
5680
5678
|
const He = 50;
|
|
5681
|
-
let
|
|
5679
|
+
let Oe = class extends y {
|
|
5682
5680
|
_color = new Z();
|
|
5683
5681
|
constructor(r, e = []) {
|
|
5684
5682
|
super(), this.setProperties(r).append(e);
|
|
@@ -5692,14 +5690,14 @@ let Me = class extends y {
|
|
|
5692
5690
|
});
|
|
5693
5691
|
for (; t.length < He; )
|
|
5694
5692
|
t.push([0, 0, 0, 0]);
|
|
5695
|
-
b.draw(r,
|
|
5693
|
+
b.draw(r, Oe.material, {
|
|
5696
5694
|
sampler: 0,
|
|
5697
5695
|
colors: t.slice(0, He).flatMap((s) => s)
|
|
5698
5696
|
});
|
|
5699
5697
|
});
|
|
5700
5698
|
}
|
|
5701
5699
|
};
|
|
5702
|
-
Yo(
|
|
5700
|
+
Yo(Oe, "material", new x({
|
|
5703
5701
|
vert: `precision mediump float;
|
|
5704
5702
|
attribute vec2 position;
|
|
5705
5703
|
attribute vec2 uv;
|
|
@@ -5748,13 +5746,13 @@ void main(void) {
|
|
|
5748
5746
|
}));
|
|
5749
5747
|
sr([
|
|
5750
5748
|
u({ default: () => [] })
|
|
5751
|
-
],
|
|
5749
|
+
], Oe.prototype, "colors", 2);
|
|
5752
5750
|
sr([
|
|
5753
5751
|
u({ fallback: 0.5 })
|
|
5754
|
-
],
|
|
5755
|
-
|
|
5752
|
+
], Oe.prototype, "alpha", 2);
|
|
5753
|
+
Oe = sr([
|
|
5756
5754
|
v("ColorOverlayEffect")
|
|
5757
|
-
],
|
|
5755
|
+
], Oe);
|
|
5758
5756
|
var hs = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, Zo = (r, e, t) => e in r ? hs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ir = (r, e, t, s) => {
|
|
5759
5757
|
for (var i = s > 1 ? void 0 : s ? Ko(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
5760
5758
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
@@ -6019,8 +6017,8 @@ var ds = Object.defineProperty, oa = Object.getOwnPropertyDescriptor, aa = (r, e
|
|
|
6019
6017
|
for (var i = s > 1 ? void 0 : s ? oa(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
6020
6018
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
6021
6019
|
return s && i && ds(e, t, i), i;
|
|
6022
|
-
},
|
|
6023
|
-
const
|
|
6020
|
+
}, ps = (r, e, t) => aa(r, typeof e != "symbol" ? e + "" : e, t);
|
|
6021
|
+
const fs = `varying vec2 vUv[9];
|
|
6024
6022
|
uniform sampler2D sampler;
|
|
6025
6023
|
|
|
6026
6024
|
void main(void) {
|
|
@@ -6077,7 +6075,7 @@ let oe = class extends y {
|
|
|
6077
6075
|
});
|
|
6078
6076
|
}
|
|
6079
6077
|
};
|
|
6080
|
-
|
|
6078
|
+
ps(oe, "materialX", new x({
|
|
6081
6079
|
vert: `attribute vec2 position;
|
|
6082
6080
|
attribute vec2 uv;
|
|
6083
6081
|
uniform float uStrength;
|
|
@@ -6095,9 +6093,9 @@ void main(void) {
|
|
|
6095
6093
|
vUv[7] = uv + vec2(3.0 * uStrength, 0.0);
|
|
6096
6094
|
vUv[8] = uv + vec2(4.0 * uStrength, 0.0);
|
|
6097
6095
|
}`,
|
|
6098
|
-
frag:
|
|
6096
|
+
frag: fs
|
|
6099
6097
|
}));
|
|
6100
|
-
|
|
6098
|
+
ps(oe, "materialY", new x({
|
|
6101
6099
|
vert: `attribute vec2 position;
|
|
6102
6100
|
attribute vec2 uv;
|
|
6103
6101
|
uniform float uStrength;
|
|
@@ -6115,7 +6113,7 @@ void main(void) {
|
|
|
6115
6113
|
vUv[7] = uv + vec2(0.0, 3.0 * uStrength);
|
|
6116
6114
|
vUv[8] = uv + vec2(0.0, 4.0 * uStrength);
|
|
6117
6115
|
}`,
|
|
6118
|
-
frag:
|
|
6116
|
+
frag: fs
|
|
6119
6117
|
}));
|
|
6120
6118
|
ar([
|
|
6121
6119
|
u({ fallback: 4 })
|
|
@@ -6249,11 +6247,11 @@ gs([
|
|
|
6249
6247
|
Je = gs([
|
|
6250
6248
|
v("EmbossEffect")
|
|
6251
6249
|
], Je);
|
|
6252
|
-
var vs = Object.defineProperty,
|
|
6253
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
6250
|
+
var vs = Object.defineProperty, pa = Object.getOwnPropertyDescriptor, fa = (r, e, t) => e in r ? vs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Q = (r, e, t, s) => {
|
|
6251
|
+
for (var i = s > 1 ? void 0 : s ? pa(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
6254
6252
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
6255
6253
|
return s && i && vs(e, t, i), i;
|
|
6256
|
-
}, _a = (r, e, t) =>
|
|
6254
|
+
}, _a = (r, e, t) => fa(r, e + "", t);
|
|
6257
6255
|
let N = class extends y {
|
|
6258
6256
|
_canvas;
|
|
6259
6257
|
_texture;
|
|
@@ -6261,7 +6259,7 @@ let N = class extends y {
|
|
|
6261
6259
|
_offsets;
|
|
6262
6260
|
_needsRedraw = !1;
|
|
6263
6261
|
constructor(r, e = []) {
|
|
6264
|
-
super(), this.setProperties(r).append(e), this._canvas = document.createElement("canvas"), this._canvas.width = 4, this._canvas.height = this.sampleSize, this._texture = new
|
|
6262
|
+
super(), this.setProperties(r).append(e), this._canvas = document.createElement("canvas"), this._canvas.width = 4, this._canvas.height = this.sampleSize, this._texture = new T(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
6265
6263
|
}
|
|
6266
6264
|
redraw() {
|
|
6267
6265
|
const r = this.sampleSize, e = this._texture, t = this._canvas.getContext("2d");
|
|
@@ -6856,12 +6854,12 @@ void main(void) {
|
|
|
6856
6854
|
vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);
|
|
6857
6855
|
gl_FragColor = contentColor + outlineColor;
|
|
6858
6856
|
}`;
|
|
6859
|
-
let
|
|
6857
|
+
let U = class extends y {
|
|
6860
6858
|
static getAngleStep(r) {
|
|
6861
6859
|
return Number.parseFloat(
|
|
6862
6860
|
(Math.PI * 2 / Math.max(
|
|
6863
|
-
r *
|
|
6864
|
-
|
|
6861
|
+
r * U.MAX_SAMPLES,
|
|
6862
|
+
U.MIN_SAMPLES
|
|
6865
6863
|
)).toFixed(7)
|
|
6866
6864
|
);
|
|
6867
6865
|
}
|
|
@@ -6878,7 +6876,7 @@ void main() {
|
|
|
6878
6876
|
}`,
|
|
6879
6877
|
frag: Ra.replace(
|
|
6880
6878
|
/\{ANGLE_STEP\}/,
|
|
6881
|
-
|
|
6879
|
+
U.getAngleStep(this.quality).toFixed(7)
|
|
6882
6880
|
)
|
|
6883
6881
|
});
|
|
6884
6882
|
}
|
|
@@ -6892,44 +6890,44 @@ void main() {
|
|
|
6892
6890
|
],
|
|
6893
6891
|
uColor: this._color.toArray().slice(0, 3),
|
|
6894
6892
|
uAlpha: this.opacity !== 1 ? this.opacity : this._color.a,
|
|
6895
|
-
uAngleStep:
|
|
6893
|
+
uAngleStep: U.getAngleStep(this.quality),
|
|
6896
6894
|
uKnockout: this.knockout ? 1 : 0,
|
|
6897
6895
|
uInputClamp: [0, 0, 1, 1]
|
|
6898
6896
|
});
|
|
6899
6897
|
});
|
|
6900
6898
|
}
|
|
6901
6899
|
};
|
|
6902
|
-
ws(
|
|
6903
|
-
ws(
|
|
6900
|
+
ws(U, "MIN_SAMPLES", 1);
|
|
6901
|
+
ws(U, "MAX_SAMPLES", 100);
|
|
6904
6902
|
me([
|
|
6905
6903
|
u({ fallback: "#000000ff" })
|
|
6906
|
-
],
|
|
6904
|
+
], U.prototype, "color", 2);
|
|
6907
6905
|
me([
|
|
6908
6906
|
u({ fallback: 1 })
|
|
6909
|
-
],
|
|
6907
|
+
], U.prototype, "width", 2);
|
|
6910
6908
|
me([
|
|
6911
6909
|
u({ fallback: "solid" })
|
|
6912
|
-
],
|
|
6910
|
+
], U.prototype, "style", 2);
|
|
6913
6911
|
me([
|
|
6914
6912
|
u()
|
|
6915
|
-
],
|
|
6913
|
+
], U.prototype, "image", 2);
|
|
6916
6914
|
me([
|
|
6917
6915
|
u({ fallback: 1 })
|
|
6918
|
-
],
|
|
6916
|
+
], U.prototype, "opacity", 2);
|
|
6919
6917
|
me([
|
|
6920
6918
|
u({ fallback: 0.1 })
|
|
6921
|
-
],
|
|
6919
|
+
], U.prototype, "quality", 2);
|
|
6922
6920
|
me([
|
|
6923
6921
|
u({ fallback: !1 })
|
|
6924
|
-
],
|
|
6925
|
-
|
|
6922
|
+
], U.prototype, "knockout", 2);
|
|
6923
|
+
U = me([
|
|
6926
6924
|
v("OutlineEffect")
|
|
6927
|
-
],
|
|
6928
|
-
var Ps = Object.defineProperty,
|
|
6929
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
6925
|
+
], U);
|
|
6926
|
+
var Ps = Object.defineProperty, Ma = Object.getOwnPropertyDescriptor, Oa = (r, e, t) => e in r ? Ps(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Ts = (r, e, t, s) => {
|
|
6927
|
+
for (var i = s > 1 ? void 0 : s ? Ma(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
6930
6928
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
6931
6929
|
return s && i && Ps(e, t, i), i;
|
|
6932
|
-
}, ka = (r, e, t) =>
|
|
6930
|
+
}, ka = (r, e, t) => Oa(r, e + "", t);
|
|
6933
6931
|
let et = class extends y {
|
|
6934
6932
|
constructor(r, e = []) {
|
|
6935
6933
|
super(), this.setProperties(r).append(e);
|
|
@@ -7114,7 +7112,7 @@ ue = ct([
|
|
|
7114
7112
|
], ue);
|
|
7115
7113
|
function Pt(r, e) {
|
|
7116
7114
|
let t = !1;
|
|
7117
|
-
const { left: s = 0, top: i = 0, width: o, height: a } = e, n = new
|
|
7115
|
+
const { left: s = 0, top: i = 0, width: o, height: a } = e, n = new O().translate(-s, -i).scale(1 / o, 1 / a);
|
|
7118
7116
|
if (r.cropRect) {
|
|
7119
7117
|
const {
|
|
7120
7118
|
left: h = 0,
|
|
@@ -7156,7 +7154,7 @@ var Ba = Object.defineProperty, H = (r, e, t, s) => {
|
|
|
7156
7154
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
7157
7155
|
return i && Ba(e, t, i), i;
|
|
7158
7156
|
};
|
|
7159
|
-
class
|
|
7157
|
+
class D extends pe {
|
|
7160
7158
|
constructor(e) {
|
|
7161
7159
|
super(), this.parent = e;
|
|
7162
7160
|
}
|
|
@@ -7167,7 +7165,7 @@ class U extends fe {
|
|
|
7167
7165
|
}
|
|
7168
7166
|
setProperties(e) {
|
|
7169
7167
|
return this._setProperties(
|
|
7170
|
-
|
|
7168
|
+
F(e) ? void 0 : Fs(e)
|
|
7171
7169
|
);
|
|
7172
7170
|
}
|
|
7173
7171
|
_updateProperty(e, t, s) {
|
|
@@ -7190,11 +7188,11 @@ class U extends fe {
|
|
|
7190
7188
|
}
|
|
7191
7189
|
}
|
|
7192
7190
|
async loadTexture() {
|
|
7193
|
-
this.linearGradient || this.radialGradient ? this.texture = new
|
|
7191
|
+
this.linearGradient || this.radialGradient ? this.texture = new Ot(
|
|
7194
7192
|
this.linearGradient ?? this.radialGradient,
|
|
7195
7193
|
this.parent.size.width,
|
|
7196
7194
|
this.parent.size.height
|
|
7197
|
-
) :
|
|
7195
|
+
) : F(this.image) || (this.parent.tree?.log(`load image ${this.image}`), this.image.split("?")[0].endsWith(".gif") ? this.animatedTexture = await q.gif.load(this.image) : this.texture = await q.texture.load(this.image));
|
|
7198
7196
|
}
|
|
7199
7197
|
async _updateTexture() {
|
|
7200
7198
|
await this.loadTexture(), this.parent.requestRedraw();
|
|
@@ -7238,46 +7236,46 @@ class U extends fe {
|
|
|
7238
7236
|
}
|
|
7239
7237
|
H([
|
|
7240
7238
|
u({ fallback: !0 })
|
|
7241
|
-
],
|
|
7239
|
+
], D.prototype, "enabled");
|
|
7242
7240
|
H([
|
|
7243
7241
|
u()
|
|
7244
|
-
],
|
|
7242
|
+
], D.prototype, "color");
|
|
7245
7243
|
H([
|
|
7246
7244
|
u()
|
|
7247
|
-
],
|
|
7245
|
+
], D.prototype, "image");
|
|
7248
7246
|
H([
|
|
7249
7247
|
u()
|
|
7250
|
-
],
|
|
7248
|
+
], D.prototype, "linearGradient");
|
|
7251
7249
|
H([
|
|
7252
7250
|
u()
|
|
7253
|
-
],
|
|
7251
|
+
], D.prototype, "radialGradient");
|
|
7254
7252
|
H([
|
|
7255
7253
|
u()
|
|
7256
|
-
],
|
|
7254
|
+
], D.prototype, "cropRect");
|
|
7257
7255
|
H([
|
|
7258
7256
|
u()
|
|
7259
|
-
],
|
|
7257
|
+
], D.prototype, "stretchRect");
|
|
7260
7258
|
H([
|
|
7261
7259
|
u()
|
|
7262
|
-
],
|
|
7260
|
+
], D.prototype, "dpi");
|
|
7263
7261
|
H([
|
|
7264
7262
|
u()
|
|
7265
|
-
],
|
|
7263
|
+
], D.prototype, "rotateWithShape");
|
|
7266
7264
|
H([
|
|
7267
7265
|
u()
|
|
7268
|
-
],
|
|
7266
|
+
], D.prototype, "tile");
|
|
7269
7267
|
H([
|
|
7270
7268
|
u()
|
|
7271
|
-
],
|
|
7269
|
+
], D.prototype, "opacity");
|
|
7272
7270
|
var Na = Object.defineProperty, La = (r, e, t, s) => {
|
|
7273
7271
|
for (var i = void 0, o = r.length - 1, a; o >= 0; o--)
|
|
7274
7272
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
7275
7273
|
return i && Na(e, t, i), i;
|
|
7276
7274
|
};
|
|
7277
|
-
class Cs extends
|
|
7275
|
+
class Cs extends D {
|
|
7278
7276
|
setProperties(e) {
|
|
7279
7277
|
return super._setProperties(
|
|
7280
|
-
|
|
7278
|
+
F(e) ? void 0 : zs(e)
|
|
7281
7279
|
);
|
|
7282
7280
|
}
|
|
7283
7281
|
_updateProperty(e, t, s) {
|
|
@@ -7296,10 +7294,10 @@ var Fa = Object.defineProperty, za = (r, e, t, s) => {
|
|
|
7296
7294
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
7297
7295
|
return i && Fa(e, t, i), i;
|
|
7298
7296
|
};
|
|
7299
|
-
class Ss extends
|
|
7297
|
+
class Ss extends D {
|
|
7300
7298
|
setProperties(e) {
|
|
7301
7299
|
return super._setProperties(
|
|
7302
|
-
|
|
7300
|
+
F(e) ? void 0 : $s(e)
|
|
7303
7301
|
);
|
|
7304
7302
|
}
|
|
7305
7303
|
_updateProperty(e, t, s) {
|
|
@@ -7318,10 +7316,10 @@ var $a = Object.defineProperty, ut = (r, e, t, s) => {
|
|
|
7318
7316
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
7319
7317
|
return i && $a(e, t, i), i;
|
|
7320
7318
|
};
|
|
7321
|
-
class $e extends
|
|
7319
|
+
class $e extends D {
|
|
7322
7320
|
setProperties(e) {
|
|
7323
7321
|
return super._setProperties(
|
|
7324
|
-
|
|
7322
|
+
F(e) ? void 0 : Vs(e)
|
|
7325
7323
|
);
|
|
7326
7324
|
}
|
|
7327
7325
|
_updateProperty(e, t, s) {
|
|
@@ -7369,13 +7367,13 @@ var Va = Object.defineProperty, dt = (r, e, t, s) => {
|
|
|
7369
7367
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
7370
7368
|
return i && Va(e, t, i), i;
|
|
7371
7369
|
};
|
|
7372
|
-
class Ve extends
|
|
7370
|
+
class Ve extends pe {
|
|
7373
7371
|
constructor(e) {
|
|
7374
7372
|
super(), this.parent = e;
|
|
7375
7373
|
}
|
|
7376
7374
|
setProperties(e) {
|
|
7377
7375
|
return super.setProperties(
|
|
7378
|
-
|
|
7376
|
+
F(e) ? void 0 : Gs(e)
|
|
7379
7377
|
);
|
|
7380
7378
|
}
|
|
7381
7379
|
_updateProperty(e, t, s) {
|
|
@@ -7409,19 +7407,19 @@ dt([
|
|
|
7409
7407
|
dt([
|
|
7410
7408
|
u({ fallback: 0 })
|
|
7411
7409
|
], Ve.prototype, "offsetX");
|
|
7412
|
-
var Ga = Object.defineProperty,
|
|
7410
|
+
var Ga = Object.defineProperty, pt = (r, e, t, s) => {
|
|
7413
7411
|
for (var i = void 0, o = r.length - 1, a; o >= 0; o--)
|
|
7414
7412
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
7415
7413
|
return i && Ga(e, t, i), i;
|
|
7416
7414
|
};
|
|
7417
|
-
class Ge extends
|
|
7415
|
+
class Ge extends pe {
|
|
7418
7416
|
constructor(e) {
|
|
7419
7417
|
super(), this.parent = e, this._updatePath2DSet();
|
|
7420
7418
|
}
|
|
7421
7419
|
_path2DSet = new Qs();
|
|
7422
7420
|
setProperties(e) {
|
|
7423
7421
|
return super.setProperties(
|
|
7424
|
-
|
|
7422
|
+
F(e) ? void 0 : js(e)
|
|
7425
7423
|
);
|
|
7426
7424
|
}
|
|
7427
7425
|
_updateProperty(e, t, s) {
|
|
@@ -7467,22 +7465,22 @@ class Ge extends fe {
|
|
|
7467
7465
|
t && s && (i ? e.roundRect(0, 0, t, s, i) : e.rect(0, 0, t, s));
|
|
7468
7466
|
}
|
|
7469
7467
|
}
|
|
7470
|
-
|
|
7468
|
+
pt([
|
|
7471
7469
|
u({ fallback: !0 })
|
|
7472
7470
|
], Ge.prototype, "enabled");
|
|
7473
|
-
|
|
7471
|
+
pt([
|
|
7474
7472
|
u()
|
|
7475
7473
|
], Ge.prototype, "preset");
|
|
7476
|
-
|
|
7474
|
+
pt([
|
|
7477
7475
|
u()
|
|
7478
7476
|
], Ge.prototype, "svg");
|
|
7479
|
-
|
|
7477
|
+
pt([
|
|
7480
7478
|
u()
|
|
7481
7479
|
], Ge.prototype, "viewBox");
|
|
7482
|
-
|
|
7480
|
+
pt([
|
|
7483
7481
|
u()
|
|
7484
7482
|
], Ge.prototype, "paths");
|
|
7485
|
-
class tt extends
|
|
7483
|
+
class tt extends fe {
|
|
7486
7484
|
constructor(e) {
|
|
7487
7485
|
super(), this.setProperties(e);
|
|
7488
7486
|
}
|
|
@@ -7497,7 +7495,7 @@ var ja = Object.defineProperty, le = (r, e, t, s) => {
|
|
|
7497
7495
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
7498
7496
|
return i && ja(e, t, i), i;
|
|
7499
7497
|
};
|
|
7500
|
-
class ee extends
|
|
7498
|
+
class ee extends pe {
|
|
7501
7499
|
constructor(e) {
|
|
7502
7500
|
super(), this.parent = e, this.base = new ri(), this.base.setPropertyAccessor(this);
|
|
7503
7501
|
}
|
|
@@ -7506,7 +7504,7 @@ class ee extends fe {
|
|
|
7506
7504
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7507
7505
|
setProperties(e) {
|
|
7508
7506
|
return super.setProperties(
|
|
7509
|
-
|
|
7507
|
+
F(e) ? void 0 : qs(e)
|
|
7510
7508
|
);
|
|
7511
7509
|
}
|
|
7512
7510
|
_updateProperty(e, t, s) {
|
|
@@ -7557,11 +7555,11 @@ class ee extends fe {
|
|
|
7557
7555
|
}), this.parent.requestRedraw());
|
|
7558
7556
|
}
|
|
7559
7557
|
async _loadTexture(e, t) {
|
|
7560
|
-
return e.linearGradient || e.radialGradient ? new
|
|
7558
|
+
return e.linearGradient || e.radialGradient ? new Ot(
|
|
7561
7559
|
e.linearGradient ?? e.radialGradient,
|
|
7562
7560
|
t.width,
|
|
7563
7561
|
t.height
|
|
7564
|
-
) :
|
|
7562
|
+
) : F(e.image) ? void 0 : (this.parent.tree?.log(`load image ${e.image}`), await q.texture.load(e.image));
|
|
7565
7563
|
}
|
|
7566
7564
|
setContent(e) {
|
|
7567
7565
|
this.content = Xs(e);
|
|
@@ -7576,8 +7574,8 @@ class ee extends fe {
|
|
|
7576
7574
|
const e = this.parent;
|
|
7577
7575
|
if (e.scale.x > 0 && e.scale.y > 0)
|
|
7578
7576
|
return;
|
|
7579
|
-
const t = e.scale.x * e.scale.y, s = e.
|
|
7580
|
-
return new
|
|
7577
|
+
const t = e.scale.x * e.scale.y, s = e.pivot;
|
|
7578
|
+
return new O().translate(-s.x, -s.y).scale(t > 0 ? 1 : -1, 1).translate(s.x, s.y);
|
|
7581
7579
|
}
|
|
7582
7580
|
useTextureDraw() {
|
|
7583
7581
|
let e = this.drawMode;
|
|
@@ -7589,7 +7587,7 @@ class ee extends fe {
|
|
|
7589
7587
|
const i = s.getMeta();
|
|
7590
7588
|
if (i instanceof si) {
|
|
7591
7589
|
const o = i.parent.index, a = i.parent.parent.index;
|
|
7592
|
-
if (s.style.fill && !
|
|
7590
|
+
if (s.style.fill && !F(s.style.fill))
|
|
7593
7591
|
if (typeof s.style.fill == "object") {
|
|
7594
7592
|
const n = s.style.fill, h = this._textureMap.get(`${a}.${o}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
7595
7593
|
if (n.enabled !== !1 && (h || n.color)) {
|
|
@@ -7604,7 +7602,7 @@ class ee extends fe {
|
|
|
7604
7602
|
}
|
|
7605
7603
|
} else
|
|
7606
7604
|
e.addPath(s), e.style = { ...s.style }, e.vertTransform = this._createVertTransform(), e.fill();
|
|
7607
|
-
if (s.style.stroke && !
|
|
7605
|
+
if (s.style.stroke && !F(s.style.stroke))
|
|
7608
7606
|
if (typeof s.style.stroke == "object") {
|
|
7609
7607
|
const n = s.style.stroke, h = this._textureMap.get(`${a}.${o}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
7610
7608
|
if (n.enabled !== !1 && (h || n.color) && (n.width === void 0 || n.width)) {
|
|
@@ -7625,7 +7623,9 @@ class ee extends fe {
|
|
|
7625
7623
|
});
|
|
7626
7624
|
}
|
|
7627
7625
|
_textureDraw(e) {
|
|
7628
|
-
this._texture.width = Math.round(this.base.boundingBox.width), this._texture.height = Math.round(this.base.boundingBox.height), this.base.render({ view: this._texture.source }), e.fillStyle = this._texture
|
|
7626
|
+
this._texture.width = Math.round(this.base.boundingBox.width), this._texture.height = Math.round(this.base.boundingBox.height), this.base.render({ view: this._texture.source }), e.fillStyle = this._texture;
|
|
7627
|
+
const { left: t = 0, top: s = 0, width: i, height: o } = this.base.boundingBox;
|
|
7628
|
+
e.uvTransform = new O().translate(-t, -s).scale(1 / i, 1 / o), e.vertTransform = this._createVertTransform(), e.fill();
|
|
7629
7629
|
}
|
|
7630
7630
|
draw() {
|
|
7631
7631
|
const e = this.parent.context;
|
|
@@ -7666,9 +7666,11 @@ var Wa = Object.getOwnPropertyDescriptor, qa = (r, e, t, s) => {
|
|
|
7666
7666
|
};
|
|
7667
7667
|
const Xa = new Set(Object.keys(Ys())), Ha = new Set(Object.keys(Hs()));
|
|
7668
7668
|
let rt = class extends xe {
|
|
7669
|
-
size = new
|
|
7670
|
-
this.updateGlobalTransform(), this.requestRedraw();
|
|
7669
|
+
size = new S().on("update", () => {
|
|
7670
|
+
this.onUpdateStyleProperty("transform", this.style.transform, void 0), this.onUpdateStyleProperty("transformOrigin", this.style.transformOrigin, void 0), this.updateGlobalTransform(), this.requestRedraw();
|
|
7671
7671
|
});
|
|
7672
|
+
_allowPointerEvents = !0;
|
|
7673
|
+
_overflowHidden = !1;
|
|
7672
7674
|
_style = new tt().on("updateProperty", (...r) => {
|
|
7673
7675
|
this.onUpdateStyleProperty(r[0], r[1], r[2]);
|
|
7674
7676
|
});
|
|
@@ -7692,7 +7694,7 @@ let rt = class extends xe {
|
|
|
7692
7694
|
set shape(r) {
|
|
7693
7695
|
this._shape.resetProperties().setProperties(r);
|
|
7694
7696
|
}
|
|
7695
|
-
_fill = new
|
|
7697
|
+
_fill = new D(this);
|
|
7696
7698
|
get fill() {
|
|
7697
7699
|
return this._fill;
|
|
7698
7700
|
}
|
|
@@ -7756,7 +7758,7 @@ let rt = class extends xe {
|
|
|
7756
7758
|
_updateStyleProperty(r, e, t) {
|
|
7757
7759
|
switch (r) {
|
|
7758
7760
|
case "rotate":
|
|
7759
|
-
this.rotation = e *
|
|
7761
|
+
this.rotation = e * Oi;
|
|
7760
7762
|
break;
|
|
7761
7763
|
case "scaleX":
|
|
7762
7764
|
this.scale.x = e, this.text.isValid() && (e ^ t) < 0 && this.requestRedraw();
|
|
@@ -7771,10 +7773,21 @@ let rt = class extends xe {
|
|
|
7771
7773
|
this.skew.y = e;
|
|
7772
7774
|
break;
|
|
7773
7775
|
case "transform":
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
+
Fo(
|
|
7777
|
+
e ?? "",
|
|
7778
|
+
this.size.width,
|
|
7779
|
+
this.size.height,
|
|
7780
|
+
this.extraTransform.identity()
|
|
7781
|
+
), this.updateGlobalTransform();
|
|
7782
|
+
break;
|
|
7783
|
+
case "transformOrigin": {
|
|
7784
|
+
const s = zo(e ?? "");
|
|
7785
|
+
this.pivot.set(
|
|
7786
|
+
s[0] * this.size.width,
|
|
7787
|
+
s[1] * this.size.height
|
|
7788
|
+
);
|
|
7776
7789
|
break;
|
|
7777
|
-
|
|
7790
|
+
}
|
|
7778
7791
|
case "opacity":
|
|
7779
7792
|
this.opacity = e;
|
|
7780
7793
|
break;
|
|
@@ -7785,7 +7798,7 @@ let rt = class extends xe {
|
|
|
7785
7798
|
this.requestRepaint();
|
|
7786
7799
|
break;
|
|
7787
7800
|
case "maskImage":
|
|
7788
|
-
this._updateMaskImage();
|
|
7801
|
+
this._updateMaskImage(e);
|
|
7789
7802
|
break;
|
|
7790
7803
|
case "backgroundColor":
|
|
7791
7804
|
this.background.color = e;
|
|
@@ -7805,6 +7818,12 @@ let rt = class extends xe {
|
|
|
7805
7818
|
case "outlineColor":
|
|
7806
7819
|
this.outline.color = e;
|
|
7807
7820
|
break;
|
|
7821
|
+
case "overflow":
|
|
7822
|
+
this._overflowHidden = e === "hidden";
|
|
7823
|
+
break;
|
|
7824
|
+
case "pointerEvents":
|
|
7825
|
+
this._allowPointerEvents = !F(e);
|
|
7826
|
+
break;
|
|
7808
7827
|
case "borderRadius":
|
|
7809
7828
|
default:
|
|
7810
7829
|
this.requestRedraw();
|
|
@@ -7815,28 +7834,18 @@ let rt = class extends xe {
|
|
|
7815
7834
|
_process(r) {
|
|
7816
7835
|
this.foreground.updateFrameIndex(), this.fill.updateFrameIndex(), this.outline.updateFrameIndex(), this.background.updateFrameIndex(), super._process(r);
|
|
7817
7836
|
}
|
|
7818
|
-
_updateMaskImage() {
|
|
7819
|
-
const
|
|
7820
|
-
if (
|
|
7821
|
-
const t = this.getNode(
|
|
7822
|
-
t ? t.src =
|
|
7837
|
+
_updateMaskImage(r) {
|
|
7838
|
+
const e = "__$style.maskImage";
|
|
7839
|
+
if (r && r !== "none") {
|
|
7840
|
+
const t = this.getNode(e);
|
|
7841
|
+
t ? t.src = r : this.appendChild(new Pe({ name: e, src: r }), "back");
|
|
7823
7842
|
} else {
|
|
7824
|
-
const t = this.getNode(
|
|
7843
|
+
const t = this.getNode(e);
|
|
7825
7844
|
t && this.removeChild(t);
|
|
7826
7845
|
}
|
|
7827
7846
|
}
|
|
7828
|
-
getTransformOrigin() {
|
|
7829
|
-
const { width: r, height: e } = this.size, [t, s] = zo(this.style.transformOrigin);
|
|
7830
|
-
return new T(t * r, s * e);
|
|
7831
|
-
}
|
|
7832
|
-
updateTransform(r) {
|
|
7833
|
-
const { width: e, height: t } = this.size;
|
|
7834
|
-
super.updateTransform((s) => {
|
|
7835
|
-
Fo(this.style.transform ?? "", e, t, s), r?.(s);
|
|
7836
|
-
});
|
|
7837
|
-
}
|
|
7838
7847
|
updateGlobalTransform() {
|
|
7839
|
-
super.updateGlobalTransform(), this.
|
|
7848
|
+
super.updateGlobalTransform(), this._updateMask();
|
|
7840
7849
|
}
|
|
7841
7850
|
_relayout(r) {
|
|
7842
7851
|
return super._relayout(r).map((e) => ({
|
|
@@ -7867,7 +7876,7 @@ let rt = class extends xe {
|
|
|
7867
7876
|
);
|
|
7868
7877
|
}
|
|
7869
7878
|
getObb() {
|
|
7870
|
-
const r = this.
|
|
7879
|
+
const r = this.pivot, e = this.transform.apply(r).sub(r);
|
|
7871
7880
|
return {
|
|
7872
7881
|
rect: new ge(
|
|
7873
7882
|
this._getPointArray().map((t) => (t.x += e.x, t.y += e.y, t))
|
|
@@ -7876,7 +7885,7 @@ let rt = class extends xe {
|
|
|
7876
7885
|
};
|
|
7877
7886
|
}
|
|
7878
7887
|
getGlobalObb() {
|
|
7879
|
-
const r = this.
|
|
7888
|
+
const r = this.pivot, e = this.globalTransform.apply(r).sub(r);
|
|
7880
7889
|
return {
|
|
7881
7890
|
rect: new ge(
|
|
7882
7891
|
this._getPointArray().map((t) => (t.x += e.x, t.y += e.y, t))
|
|
@@ -7921,8 +7930,8 @@ let rt = class extends xe {
|
|
|
7921
7930
|
// }
|
|
7922
7931
|
// return super.isVisibleInTree()
|
|
7923
7932
|
// }
|
|
7924
|
-
|
|
7925
|
-
this.
|
|
7933
|
+
_updateMask() {
|
|
7934
|
+
this._overflowHidden ? this.mask = this.getRect().toJSON() : this.mask = void 0;
|
|
7926
7935
|
}
|
|
7927
7936
|
_draw() {
|
|
7928
7937
|
super._draw(), this._background.isValid() && (this._tree?.log(this.name, "background drawing"), this._shape.draw(!this._background.fillWithShape), this._background.draw()), this._fill.isValid() && (this._tree?.log(this.name, "fill drawing"), this._shape.draw(), this._fill.draw()), this._outline.isValid() && (this._tree?.log(this.name, "outline drawing"), this._shape.draw(), this._outline.draw()), this._foreground.isValid() && (this._tree?.log(this.name, "foreground drawing"), this._shape.draw(!this._foreground.fillWithShape), this._foreground.draw()), this._text.isValid() && (this._tree?.log(this.name, "text drawing"), this._text.useTextureDraw() && this._shape.draw(!0), this._text.draw()), this._drawContent();
|
|
@@ -7936,9 +7945,6 @@ let rt = class extends xe {
|
|
|
7936
7945
|
// colorMatrixOffset: colorMatrix.toVector4().toArray(),
|
|
7937
7946
|
}));
|
|
7938
7947
|
}
|
|
7939
|
-
canPointerEvents() {
|
|
7940
|
-
return this.style.pointerEvents !== "none";
|
|
7941
|
-
}
|
|
7942
7948
|
input(r, e) {
|
|
7943
7949
|
const t = this.getChildren(!0);
|
|
7944
7950
|
for (let s = t.length - 1; s >= 0; s--)
|
|
@@ -7955,10 +7961,10 @@ let rt = class extends xe {
|
|
|
7955
7961
|
case "pointerdown":
|
|
7956
7962
|
case "pointermove":
|
|
7957
7963
|
case "pointerup": {
|
|
7958
|
-
if (this.
|
|
7964
|
+
if (this._allowPointerEvents) {
|
|
7959
7965
|
const { screenX: t, screenY: s } = r;
|
|
7960
7966
|
if (t && s) {
|
|
7961
|
-
const i = new
|
|
7967
|
+
const i = new S(t, s), o = this.getViewport();
|
|
7962
7968
|
o && o.toCanvasGlobal(i, i), this.toLocal(i, i), this._positionInput(i, e) && (r.target || (r.target = this), this.emit(e, r));
|
|
7963
7969
|
}
|
|
7964
7970
|
}
|
|
@@ -8046,7 +8052,7 @@ let Te = class extends rt {
|
|
|
8046
8052
|
Te = Za([
|
|
8047
8053
|
v("Element2D")
|
|
8048
8054
|
], Te);
|
|
8049
|
-
const
|
|
8055
|
+
const E = {
|
|
8050
8056
|
left: 0,
|
|
8051
8057
|
// Edge.Left
|
|
8052
8058
|
top: 1,
|
|
@@ -8121,7 +8127,7 @@ const C = {
|
|
|
8121
8127
|
// Wrap.Wrap
|
|
8122
8128
|
"Wrap-reverse": 2
|
|
8123
8129
|
// Wrap.WrapReverse
|
|
8124
|
-
},
|
|
8130
|
+
}, Mr = {
|
|
8125
8131
|
"flex-start": 0,
|
|
8126
8132
|
// Justify.FlexStart
|
|
8127
8133
|
center: 1,
|
|
@@ -8134,7 +8140,7 @@ const C = {
|
|
|
8134
8140
|
// Justify.SpaceAround
|
|
8135
8141
|
"space-evenly": 5
|
|
8136
8142
|
// Justify.SpaceEvenly
|
|
8137
|
-
},
|
|
8143
|
+
}, Or = {
|
|
8138
8144
|
visible: 0,
|
|
8139
8145
|
// Overflow.Visible
|
|
8140
8146
|
hidden: 1,
|
|
@@ -8207,19 +8213,19 @@ class lr {
|
|
|
8207
8213
|
this._node.setAspectRatio(t);
|
|
8208
8214
|
break;
|
|
8209
8215
|
case "borderTop":
|
|
8210
|
-
this._node.setBorder(
|
|
8216
|
+
this._node.setBorder(E.top, this._style.borderWidth);
|
|
8211
8217
|
break;
|
|
8212
8218
|
case "borderBottom":
|
|
8213
|
-
this._node.setBorder(
|
|
8219
|
+
this._node.setBorder(E.bottom, this._style.borderWidth);
|
|
8214
8220
|
break;
|
|
8215
8221
|
case "borderLeft":
|
|
8216
|
-
this._node.setBorder(
|
|
8222
|
+
this._node.setBorder(E.left, this._style.borderWidth);
|
|
8217
8223
|
break;
|
|
8218
8224
|
case "borderRight":
|
|
8219
|
-
this._node.setBorder(
|
|
8225
|
+
this._node.setBorder(E.right, this._style.borderWidth);
|
|
8220
8226
|
break;
|
|
8221
8227
|
case "border":
|
|
8222
|
-
this._node.setBorder(
|
|
8228
|
+
this._node.setBorder(E.all, this._style.borderWidth);
|
|
8223
8229
|
break;
|
|
8224
8230
|
case "direction":
|
|
8225
8231
|
this._node.setDirection(
|
|
@@ -8258,26 +8264,26 @@ class lr {
|
|
|
8258
8264
|
break;
|
|
8259
8265
|
case "justifyContent":
|
|
8260
8266
|
this._node.setJustifyContent(
|
|
8261
|
-
t ?
|
|
8267
|
+
t ? Mr[t] : Mr["flex-start"]
|
|
8262
8268
|
);
|
|
8263
8269
|
break;
|
|
8264
8270
|
case "gap":
|
|
8265
8271
|
t !== void 0 && this._node.setGap(Ja.all, t);
|
|
8266
8272
|
break;
|
|
8267
8273
|
case "marginTop":
|
|
8268
|
-
this._node.setMargin(
|
|
8274
|
+
this._node.setMargin(E.top, t);
|
|
8269
8275
|
break;
|
|
8270
8276
|
case "marginBottom":
|
|
8271
|
-
this._node.setMargin(
|
|
8277
|
+
this._node.setMargin(E.bottom, t);
|
|
8272
8278
|
break;
|
|
8273
8279
|
case "marginLeft":
|
|
8274
|
-
this._node.setMargin(
|
|
8280
|
+
this._node.setMargin(E.left, t);
|
|
8275
8281
|
break;
|
|
8276
8282
|
case "marginRight":
|
|
8277
|
-
this._node.setMargin(
|
|
8283
|
+
this._node.setMargin(E.right, t);
|
|
8278
8284
|
break;
|
|
8279
8285
|
case "margin":
|
|
8280
|
-
this._node.setMargin(
|
|
8286
|
+
this._node.setMargin(E.all, t);
|
|
8281
8287
|
break;
|
|
8282
8288
|
case "maxHeight":
|
|
8283
8289
|
this._node.setMaxHeight(t);
|
|
@@ -8295,35 +8301,35 @@ class lr {
|
|
|
8295
8301
|
break;
|
|
8296
8302
|
case "overflow":
|
|
8297
8303
|
this._node.setOverflow(
|
|
8298
|
-
t ?
|
|
8304
|
+
t ? Or[t] : Or.visible
|
|
8299
8305
|
);
|
|
8300
8306
|
break;
|
|
8301
8307
|
case "paddingTop":
|
|
8302
|
-
this._node.setPadding(
|
|
8308
|
+
this._node.setPadding(E.top, this._style.paddingTop);
|
|
8303
8309
|
break;
|
|
8304
8310
|
case "paddingBottom":
|
|
8305
|
-
this._node.setPadding(
|
|
8311
|
+
this._node.setPadding(E.bottom, this._style.paddingBottom);
|
|
8306
8312
|
break;
|
|
8307
8313
|
case "paddingLeft":
|
|
8308
|
-
this._node.setPadding(
|
|
8314
|
+
this._node.setPadding(E.left, this._style.paddingLeft);
|
|
8309
8315
|
break;
|
|
8310
8316
|
case "paddingRight":
|
|
8311
|
-
this._node.setPadding(
|
|
8317
|
+
this._node.setPadding(E.right, this._style.paddingRight);
|
|
8312
8318
|
break;
|
|
8313
8319
|
case "padding":
|
|
8314
|
-
this._node.setPadding(
|
|
8320
|
+
this._node.setPadding(E.all, this._style.padding);
|
|
8315
8321
|
break;
|
|
8316
8322
|
case "top":
|
|
8317
|
-
this._node.setPosition(
|
|
8323
|
+
this._node.setPosition(E.top, this._style.top);
|
|
8318
8324
|
break;
|
|
8319
8325
|
case "bottom":
|
|
8320
|
-
this._node.setPosition(
|
|
8326
|
+
this._node.setPosition(E.bottom, this._style.bottom);
|
|
8321
8327
|
break;
|
|
8322
8328
|
case "left":
|
|
8323
|
-
this._node.setPosition(
|
|
8329
|
+
this._node.setPosition(E.left, this._style.left);
|
|
8324
8330
|
break;
|
|
8325
8331
|
case "right":
|
|
8326
|
-
this._node.setPosition(
|
|
8332
|
+
this._node.setPosition(E.right, this._style.right);
|
|
8327
8333
|
break;
|
|
8328
8334
|
case "position":
|
|
8329
8335
|
this._node.setPositionType(
|
|
@@ -8397,7 +8403,7 @@ let Dr = class extends rt {
|
|
|
8397
8403
|
Dr = en([
|
|
8398
8404
|
v("FlexElement2D")
|
|
8399
8405
|
], Dr);
|
|
8400
|
-
var tn = Object.defineProperty, rn = Object.getOwnPropertyDescriptor,
|
|
8406
|
+
var tn = Object.defineProperty, rn = Object.getOwnPropertyDescriptor, ft = (r, e, t, s) => {
|
|
8401
8407
|
for (var i = s > 1 ? void 0 : s ? rn(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
8402
8408
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
8403
8409
|
return s && i && tn(e, t, i), i;
|
|
@@ -8488,8 +8494,8 @@ let De = class extends Te {
|
|
|
8488
8494
|
if (r?.isValid()) {
|
|
8489
8495
|
const { left: e = 0, top: t = 0, right: s = 0, bottom: i = 0 } = this.srcRect ?? {}, { width: o, height: a } = this.size;
|
|
8490
8496
|
this.context.fillStyle = r;
|
|
8491
|
-
const n = Math.abs(1 + (e + s)) * o, h = Math.abs(1 + (t + i)) * a, l = 1 / n, c = 1 / h, d = e * o * l,
|
|
8492
|
-
this.context.uvTransform = new
|
|
8497
|
+
const n = Math.abs(1 + (e + s)) * o, h = Math.abs(1 + (t + i)) * a, l = 1 / n, c = 1 / h, d = e * o * l, p = t * a * c;
|
|
8498
|
+
this.context.uvTransform = new O().scale(l, c).translate(d, p), this.shape.draw(), this.context.fill();
|
|
8493
8499
|
}
|
|
8494
8500
|
}
|
|
8495
8501
|
_repaint(r) {
|
|
@@ -8499,19 +8505,19 @@ let De = class extends Te {
|
|
|
8499
8505
|
}));
|
|
8500
8506
|
}
|
|
8501
8507
|
};
|
|
8502
|
-
|
|
8508
|
+
ft([
|
|
8503
8509
|
u({ internal: !0 })
|
|
8504
8510
|
], De.prototype, "texture", 2);
|
|
8505
|
-
|
|
8511
|
+
ft([
|
|
8506
8512
|
u({ fallback: "" })
|
|
8507
8513
|
], De.prototype, "src", 2);
|
|
8508
|
-
|
|
8514
|
+
ft([
|
|
8509
8515
|
u()
|
|
8510
8516
|
], De.prototype, "srcRect", 2);
|
|
8511
|
-
|
|
8517
|
+
ft([
|
|
8512
8518
|
u({ fallback: !1 })
|
|
8513
8519
|
], De.prototype, "gif", 2);
|
|
8514
|
-
De =
|
|
8520
|
+
De = ft([
|
|
8515
8521
|
v("Image2D")
|
|
8516
8522
|
], De);
|
|
8517
8523
|
class Rs extends Te {
|
|
@@ -8523,7 +8529,7 @@ class Rs extends Te {
|
|
|
8523
8529
|
this.texture?.isValid() && (this.shape.draw(!0), this.context.fillStyle = this.texture, this.context.fill());
|
|
8524
8530
|
}
|
|
8525
8531
|
}
|
|
8526
|
-
var sn = Object.defineProperty, on = Object.getOwnPropertyDescriptor,
|
|
8532
|
+
var sn = Object.defineProperty, on = Object.getOwnPropertyDescriptor, Ms = (r, e, t, s) => {
|
|
8527
8533
|
for (var i = s > 1 ? void 0 : s ? on(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
8528
8534
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
8529
8535
|
return s && i && sn(e, t, i), i;
|
|
@@ -8558,10 +8564,10 @@ let Wt = class extends Rs {
|
|
|
8558
8564
|
this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpload(), this.requestRedraw(), super._process(r);
|
|
8559
8565
|
}
|
|
8560
8566
|
};
|
|
8561
|
-
|
|
8567
|
+
Ms([
|
|
8562
8568
|
u({ fallback: "" })
|
|
8563
8569
|
], Wt.prototype, "src", 2);
|
|
8564
|
-
Wt =
|
|
8570
|
+
Wt = Ms([
|
|
8565
8571
|
v("Lottie2D")
|
|
8566
8572
|
], Wt);
|
|
8567
8573
|
var an = Object.defineProperty, nn = (r, e, t, s) => {
|
|
@@ -8582,10 +8588,10 @@ class ln extends Te {
|
|
|
8582
8588
|
}
|
|
8583
8589
|
}
|
|
8584
8590
|
_drawCircle(e, t) {
|
|
8585
|
-
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle =
|
|
8591
|
+
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = T.WHITE, this.context.fill(), this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
8586
8592
|
}
|
|
8587
8593
|
_drawEllipse(e, t) {
|
|
8588
|
-
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle =
|
|
8594
|
+
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = T.WHITE, this.context.fill(), this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.strokeStyle = "rgba(0, 0, 0, 0.2)", this.context.stroke();
|
|
8589
8595
|
}
|
|
8590
8596
|
_draw() {
|
|
8591
8597
|
const { width: e, height: t } = this.getRect();
|
|
@@ -8595,7 +8601,7 @@ class ln extends Te {
|
|
|
8595
8601
|
nn([
|
|
8596
8602
|
u({ fallback: 6 })
|
|
8597
8603
|
], ln.prototype, "handleSize");
|
|
8598
|
-
var hn = Object.defineProperty, cn = Object.getOwnPropertyDescriptor,
|
|
8604
|
+
var hn = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, Os = (r, e, t, s) => {
|
|
8599
8605
|
for (var i = s > 1 ? void 0 : s ? cn(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
8600
8606
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
8601
8607
|
return s && i && hn(e, t, i), i;
|
|
@@ -8635,10 +8641,10 @@ let qt = class extends Rs {
|
|
|
8635
8641
|
this._updateVideoCurrentTime(), super._process(r);
|
|
8636
8642
|
}
|
|
8637
8643
|
};
|
|
8638
|
-
|
|
8644
|
+
Os([
|
|
8639
8645
|
u({ fallback: "" })
|
|
8640
8646
|
], qt.prototype, "src", 2);
|
|
8641
|
-
qt =
|
|
8647
|
+
qt = Os([
|
|
8642
8648
|
v("Video2D")
|
|
8643
8649
|
], qt);
|
|
8644
8650
|
var un = Object.defineProperty, dn = Object.getOwnPropertyDescriptor, It = (r, e, t, s) => {
|
|
@@ -8646,13 +8652,13 @@ var un = Object.defineProperty, dn = Object.getOwnPropertyDescriptor, It = (r, e
|
|
|
8646
8652
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
8647
8653
|
return s && i && un(e, t, i), i;
|
|
8648
8654
|
};
|
|
8649
|
-
const
|
|
8655
|
+
const pn = (r) => r, fn = _t(0.25, 0.1, 0.25, 1), _n = _t(0.42, 0, 1, 1), mn = _t(0, 0, 0.58, 1), gn = _t(0.42, 0, 0.58, 1);
|
|
8650
8656
|
function _t(r, e, t, s) {
|
|
8651
|
-
const o = 3 * r - 3 * t + 1, a = 3 * t - 6 * r, n = 3 * r, h = 3 * e - 3 * s + 1, l = 3 * s - 6 * e, c = 3 * e, d = (m) => (3 * o * m + 2 * a) * m + n,
|
|
8652
|
-
function
|
|
8657
|
+
const o = 3 * r - 3 * t + 1, a = 3 * t - 6 * r, n = 3 * r, h = 3 * e - 3 * s + 1, l = 3 * s - 6 * e, c = 3 * e, d = (m) => (3 * o * m + 2 * a) * m + n, p = (m) => ((o * m + a) * m + n) * m, _ = (m) => ((h * m + l) * m + c) * m;
|
|
8658
|
+
function f(m) {
|
|
8653
8659
|
let g = m, w, P;
|
|
8654
8660
|
for (let L = 0; L < 8; L++) {
|
|
8655
|
-
if (P =
|
|
8661
|
+
if (P = p(g) - m, Math.abs(P) < 1e-6)
|
|
8656
8662
|
return g;
|
|
8657
8663
|
if (w = d(g), Math.abs(w) < 1e-6)
|
|
8658
8664
|
break;
|
|
@@ -8660,17 +8666,17 @@ function _t(r, e, t, s) {
|
|
|
8660
8666
|
}
|
|
8661
8667
|
let R = 1, A = 0;
|
|
8662
8668
|
for (g = m; R > A; ) {
|
|
8663
|
-
if (P =
|
|
8669
|
+
if (P = p(g) - m, Math.abs(P) < 1e-6)
|
|
8664
8670
|
return g;
|
|
8665
8671
|
P > 0 ? R = g : A = g, g = (R + A) / 2;
|
|
8666
8672
|
}
|
|
8667
8673
|
return g;
|
|
8668
8674
|
}
|
|
8669
|
-
return (m) => _(
|
|
8675
|
+
return (m) => _(f(m));
|
|
8670
8676
|
}
|
|
8671
8677
|
const $t = {
|
|
8672
|
-
linear:
|
|
8673
|
-
ease:
|
|
8678
|
+
linear: pn,
|
|
8679
|
+
ease: fn,
|
|
8674
8680
|
easeIn: _n,
|
|
8675
8681
|
easeOut: mn,
|
|
8676
8682
|
easeInOut: gn
|
|
@@ -8787,11 +8793,11 @@ let st = class extends G {
|
|
|
8787
8793
|
const {
|
|
8788
8794
|
offset: c,
|
|
8789
8795
|
easing: d
|
|
8790
|
-
} = t,
|
|
8791
|
-
return e.forEach((_,
|
|
8792
|
-
(!(
|
|
8796
|
+
} = t, p = { ...t.props };
|
|
8797
|
+
return e.forEach((_, f) => {
|
|
8798
|
+
(!(f in p) || p[f] === null) && (p[f] = _), (!(f in l) || l[f] === null) && (l[f] = _);
|
|
8793
8799
|
}), [
|
|
8794
|
-
{ offset: c, easing: d, props:
|
|
8800
|
+
{ offset: c, easing: d, props: p },
|
|
8795
8801
|
{ offset: n, easing: h, props: l }
|
|
8796
8802
|
];
|
|
8797
8803
|
}
|
|
@@ -8800,20 +8806,20 @@ let st = class extends G {
|
|
|
8800
8806
|
return null;
|
|
8801
8807
|
}
|
|
8802
8808
|
_commitStyle(r, e, t, s, i) {
|
|
8803
|
-
const { offset: o, easing: a, props: n } = s, { offset: h, props: l } = i, c = h - o, d = a((r - o) / c),
|
|
8809
|
+
const { offset: o, easing: a, props: n } = s, { offset: h, props: l } = i, c = h - o, d = a((r - o) / c), p = {
|
|
8804
8810
|
width: e.size.x,
|
|
8805
8811
|
height: e.size.y,
|
|
8806
8812
|
fontSize: e.style.fontSize
|
|
8807
8813
|
};
|
|
8808
|
-
t.forEach((_,
|
|
8814
|
+
t.forEach((_, f) => {
|
|
8809
8815
|
e.onUpdateStyleProperty(
|
|
8810
|
-
|
|
8816
|
+
f,
|
|
8811
8817
|
this._getDiffValue(
|
|
8812
|
-
|
|
8813
|
-
n[
|
|
8814
|
-
l[
|
|
8818
|
+
f,
|
|
8819
|
+
n[f],
|
|
8820
|
+
l[f],
|
|
8815
8821
|
d,
|
|
8816
|
-
|
|
8822
|
+
p
|
|
8817
8823
|
),
|
|
8818
8824
|
void 0
|
|
8819
8825
|
);
|
|
@@ -8832,21 +8838,21 @@ let st = class extends G {
|
|
|
8832
8838
|
o = mt(r, String(e), i), a = mt(r, String(t), i);
|
|
8833
8839
|
if (Array.isArray(o) && Array.isArray(a)) {
|
|
8834
8840
|
const n = /* @__PURE__ */ new Set(), h = {}, l = {};
|
|
8835
|
-
o.forEach(({ name: d, args:
|
|
8836
|
-
h[d] =
|
|
8837
|
-
}), a.forEach(({ name: d, args:
|
|
8838
|
-
l[d] =
|
|
8841
|
+
o.forEach(({ name: d, args: p }) => {
|
|
8842
|
+
h[d] = p, n.add(d);
|
|
8843
|
+
}), a.forEach(({ name: d, args: p }) => {
|
|
8844
|
+
l[d] = p, n.add(d);
|
|
8839
8845
|
});
|
|
8840
8846
|
let c = "";
|
|
8841
8847
|
return n.forEach((d) => {
|
|
8842
|
-
const
|
|
8843
|
-
c += `${d}(${Array.from({ length:
|
|
8844
|
-
const w = _?.[g], P =
|
|
8845
|
-
return Number.isNaN(R) || Number.isNaN(A) ? P?.value ?? 0 :
|
|
8848
|
+
const p = Math.max(h[d]?.length ?? 0, l[d]?.length ?? 0), _ = h[d], f = l[d];
|
|
8849
|
+
c += `${d}(${Array.from({ length: p }, (m, g) => {
|
|
8850
|
+
const w = _?.[g], P = f?.[g], R = w?.normalizedIntValue ?? 0, A = P?.normalizedIntValue ?? 0;
|
|
8851
|
+
return Number.isNaN(R) || Number.isNaN(A) ? P?.value ?? 0 : C(R, A, s);
|
|
8846
8852
|
}).join(", ")}) `;
|
|
8847
8853
|
}), c;
|
|
8848
8854
|
} else if (!Array.isArray(o) && !Array.isArray(a))
|
|
8849
|
-
return Number.isNaN(o.normalizedIntValue) || Number.isNaN(a.normalizedIntValue) ? a.value :
|
|
8855
|
+
return Number.isNaN(o.normalizedIntValue) || Number.isNaN(a.normalizedIntValue) ? a.value : C(o.normalizedIntValue, a.normalizedIntValue, s);
|
|
8850
8856
|
}
|
|
8851
8857
|
isPlaying() {
|
|
8852
8858
|
return !this.paused && this.isInsideTimeRange();
|
|
@@ -9038,17 +9044,17 @@ class Tt extends de {
|
|
|
9038
9044
|
return;
|
|
9039
9045
|
const { start: t = 0, end: s = 0 } = e;
|
|
9040
9046
|
s && console.assert(s > t, "End time is before start time"), e.playbackRate !== void 0 && (this._playbackRate = e.playbackRate), e.volume !== void 0 && (this._volume = e.volume), e.loop !== void 0 && (this._loop = e.loop), e.muted !== void 0 && (this._muted = e.muted), this.refresh(), this.loop && s !== null && (console.warn('Looping not support when specifying an "end" time'), this.loop = !1), this._start = t, this._end = s || this._duration, this._start = Math.max(0, this._start - Tt.PADDING), this._end = Math.min(this._end + Tt.PADDING, this._duration), this._source.onloadedmetadata = () => {
|
|
9041
|
-
this._source && (this._source.currentTime = t, this._source.onloadedmetadata = null, this.emit("progress", t, this._duration),
|
|
9047
|
+
this._source && (this._source.currentTime = t, this._source.onloadedmetadata = null, this.emit("progress", t, this._duration), k.on(this._onUpdate));
|
|
9042
9048
|
}, this._source.onended = this._onComplete.bind(this), this._source.play(), this.emit("start");
|
|
9043
9049
|
}
|
|
9044
9050
|
_onUpdate = () => {
|
|
9045
9051
|
this._source && (this.emit("progress", this.progress, this._duration), this._source.currentTime >= this._end && !this._source.loop && this._onComplete());
|
|
9046
9052
|
};
|
|
9047
9053
|
_onComplete() {
|
|
9048
|
-
|
|
9054
|
+
k.off(this._onUpdate), this._stop(), this.emit("progress", 1, this._duration), this.emit("end", this);
|
|
9049
9055
|
}
|
|
9050
9056
|
destroy() {
|
|
9051
|
-
|
|
9057
|
+
k.off(this._onUpdate), super.destroy();
|
|
9052
9058
|
const e = this._source;
|
|
9053
9059
|
e && (e.onended = null, e.onplay = null, e.onpause = null, this._stop()), this._source = null, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._end = 0, this._start = 0, this._duration = 0, this._playing = !1, this._pausedReal = !1, this._paused = !1, this._muted = !1, this._audio && (this._audio.context.off("refresh", this.refresh), this._audio.context.off("refreshPaused", this.refreshPaused), this._audio = null);
|
|
9054
9060
|
}
|
|
@@ -9183,7 +9189,7 @@ class ve extends ks {
|
|
|
9183
9189
|
2,
|
|
9184
9190
|
jr ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100
|
|
9185
9191
|
), s = e.createDynamicsCompressor(), i = e.createAnalyser();
|
|
9186
|
-
i.connect(s), s.connect(e.destination), super(i, s), this._context = e, this._offlineContext = t, this._compressor = s, this._analyser = i, this._locked = e.state === "suspended" && (he ||
|
|
9192
|
+
i.connect(s), s.connect(e.destination), super(i, s), this._context = e, this._offlineContext = t, this._compressor = s, this._analyser = i, this._locked = e.state === "suspended" && (he || fi), Rt && (this._locked && (this._unlock(), document.addEventListener("mousedown", this._unlock, !0), document.addEventListener("touchstart", this._unlock, !0), document.addEventListener("touchend", this._unlock, !0)), globalThis.addEventListener("focus", this._onFocus), globalThis.addEventListener("blur", this._onBlur));
|
|
9187
9193
|
}
|
|
9188
9194
|
_onFocus() {
|
|
9189
9195
|
if (!this.autoPause)
|
|
@@ -9374,7 +9380,7 @@ class xn extends de {
|
|
|
9374
9380
|
};
|
|
9375
9381
|
_updateListener = () => this._update();
|
|
9376
9382
|
_enableTicker(e) {
|
|
9377
|
-
|
|
9383
|
+
k.off(this._updateListener), e && k.on(this._updateListener);
|
|
9378
9384
|
}
|
|
9379
9385
|
destroy() {
|
|
9380
9386
|
super.destroy(), this._stop(), this._gain?.disconnect(), this._gain = null, this._audio?.context.off("refresh", this.refresh), this._audio?.context.off("refreshPaused", this.refreshPaused), this._audio = null, this._processors.forEach((e) => e.disconnect()), this._processors.length = 0, this._end = 0, this._playbackRate = 1, this._volume = 1, this._loop = !1, this._elapsed = 0, this._duration = 0, this._paused = !1, this._muted = !1, this._pausedReal = !1;
|
|
@@ -9591,7 +9597,7 @@ var An = Object.defineProperty, Rn = Object.getOwnPropertyDescriptor, Bt = (r, e
|
|
|
9591
9597
|
};
|
|
9592
9598
|
let it = class extends Te {
|
|
9593
9599
|
_audioBuffer;
|
|
9594
|
-
_src = Rt ? new
|
|
9600
|
+
_src = Rt ? new T(document.createElement("canvas")) : void 0;
|
|
9595
9601
|
_needsUpdateTexture = !1;
|
|
9596
9602
|
constructor(r = {}) {
|
|
9597
9603
|
super(), this.setProperties(r);
|
|
@@ -9632,13 +9638,13 @@ let it = class extends Te {
|
|
|
9632
9638
|
o.fillStyle = this.color;
|
|
9633
9639
|
const a = e.getChannelData(0), n = Math.ceil(a.length / s), h = i / 2;
|
|
9634
9640
|
for (let l = 1, c = -1, d = 0; d < s; d++) {
|
|
9635
|
-
for (let
|
|
9636
|
-
const _ = a[d * n +
|
|
9641
|
+
for (let p = 0; p < n; p++) {
|
|
9642
|
+
const _ = a[d * n + p];
|
|
9637
9643
|
_ < l && (l = _), _ > c && (c = _);
|
|
9638
9644
|
}
|
|
9639
9645
|
if (!this.gap || d % (this.gap * 2) === 0) {
|
|
9640
|
-
const
|
|
9641
|
-
o.fillRect(
|
|
9646
|
+
const p = d, _ = (1 + l) * h, f = this.gap || 1, m = Math.max(1, (c - l) * h);
|
|
9647
|
+
o.fillRect(p, _, f, m), l = 1, c = -1;
|
|
9642
9648
|
}
|
|
9643
9649
|
}
|
|
9644
9650
|
this._src?.requestUpload(), this.requestRedraw();
|
|
@@ -9648,7 +9654,7 @@ let it = class extends Te {
|
|
|
9648
9654
|
}
|
|
9649
9655
|
_drawSrc() {
|
|
9650
9656
|
const r = this._src;
|
|
9651
|
-
r?.isValid() && (this.context.fillStyle = r, this.context.uvTransform = new
|
|
9657
|
+
r?.isValid() && (this.context.fillStyle = r, this.context.uvTransform = new O().scale(
|
|
9652
9658
|
1 / this.style.width,
|
|
9653
9659
|
1 / this.style.height
|
|
9654
9660
|
));
|
|
@@ -9666,12 +9672,12 @@ Bt([
|
|
|
9666
9672
|
it = Bt([
|
|
9667
9673
|
v("AudioWaveform")
|
|
9668
9674
|
], it);
|
|
9669
|
-
var
|
|
9670
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
9675
|
+
var Mn = Object.defineProperty, On = Object.getOwnPropertyDescriptor, kn = (r, e, t) => e in r ? Mn(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Un = (r, e, t, s) => {
|
|
9676
|
+
for (var i = s > 1 ? void 0 : s ? On(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
9671
9677
|
(a = r[o]) && (i = a(i) || i);
|
|
9672
9678
|
return i;
|
|
9673
9679
|
}, Dn = (r, e, t) => kn(r, e + "", t);
|
|
9674
|
-
let Et = class extends
|
|
9680
|
+
let Et = class extends Me {
|
|
9675
9681
|
blur = 10;
|
|
9676
9682
|
quality = 10;
|
|
9677
9683
|
apply(r, e) {
|
|
@@ -9685,14 +9691,14 @@ let Et = class extends Oe {
|
|
|
9685
9691
|
for (let P = 1; P < a; P++)
|
|
9686
9692
|
g -= w, c.push(g);
|
|
9687
9693
|
}
|
|
9688
|
-
const d = 1 / n,
|
|
9689
|
-
let
|
|
9694
|
+
const d = 1 / n, p = 1 / h, _ = [];
|
|
9695
|
+
let f;
|
|
9690
9696
|
const m = a - 1;
|
|
9691
9697
|
for (let g = 0; g < m; g++)
|
|
9692
|
-
|
|
9698
|
+
f = c[g] + 0.5, _[0] = f * d, _[1] = f * p, l.push({
|
|
9693
9699
|
offset: _
|
|
9694
9700
|
});
|
|
9695
|
-
|
|
9701
|
+
f = c[m] + 0.5, _[0] = f * d, _[1] = f * p, l.push({
|
|
9696
9702
|
offset: _
|
|
9697
9703
|
}), l.forEach((g) => {
|
|
9698
9704
|
b.draw(r, Et.material, {
|
|
@@ -9736,7 +9742,7 @@ var In = Object.defineProperty, Bn = Object.getOwnPropertyDescriptor, Nn = (r, e
|
|
|
9736
9742
|
(a = r[o]) && (i = a(i) || i);
|
|
9737
9743
|
return i;
|
|
9738
9744
|
}, Fn = (r, e, t) => Nn(r, e + "", t);
|
|
9739
|
-
let Ct = class extends
|
|
9745
|
+
let Ct = class extends Me {
|
|
9740
9746
|
apply(r) {
|
|
9741
9747
|
b.draw(r, Ct.material, {
|
|
9742
9748
|
previous: 0,
|
|
@@ -9782,14 +9788,14 @@ var zn = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Vn = (r, e
|
|
|
9782
9788
|
(a = r[o]) && (i = a(i) || i);
|
|
9783
9789
|
return i;
|
|
9784
9790
|
}, jn = (r, e, t) => Vn(r, e + "", t);
|
|
9785
|
-
let ot = class extends
|
|
9791
|
+
let ot = class extends Me {
|
|
9786
9792
|
blur = 100;
|
|
9787
9793
|
gradientBlur = 600;
|
|
9788
9794
|
apply(r, e) {
|
|
9789
9795
|
const t = this.currentTimeProgress;
|
|
9790
9796
|
let s, i;
|
|
9791
9797
|
t < 0.5 ? (s = 0, i = (0.5 - t) / 0.5) : (s = 1, i = (t - 0.5) / 0.5);
|
|
9792
|
-
const o = e.width, a = e.height, n = [0, a / 2], h = [600, a / 2], l = [o, a], c = h[0] - n[0], d = h[1] - n[1],
|
|
9798
|
+
const o = e.width, a = e.height, n = [0, a / 2], h = [600, a / 2], l = [o, a], c = h[0] - n[0], d = h[1] - n[1], p = Math.sqrt(c * c + d * d);
|
|
9793
9799
|
b.draw(r, ot.material, {
|
|
9794
9800
|
sampler: s,
|
|
9795
9801
|
progress: i,
|
|
@@ -9797,7 +9803,7 @@ let ot = class extends Oe {
|
|
|
9797
9803
|
gradientBlur: this.gradientBlur,
|
|
9798
9804
|
start: n,
|
|
9799
9805
|
end: h,
|
|
9800
|
-
delta: [c /
|
|
9806
|
+
delta: [c / p, d / p],
|
|
9801
9807
|
texSize: l
|
|
9802
9808
|
}), b.draw(r, ot.material, {
|
|
9803
9809
|
sampler: s,
|
|
@@ -9806,7 +9812,7 @@ let ot = class extends Oe {
|
|
|
9806
9812
|
gradientBlur: this.gradientBlur,
|
|
9807
9813
|
start: n,
|
|
9808
9814
|
end: h,
|
|
9809
|
-
delta: [-d /
|
|
9815
|
+
delta: [-d / p, c / p],
|
|
9810
9816
|
texSize: l
|
|
9811
9817
|
});
|
|
9812
9818
|
}
|
|
@@ -9867,7 +9873,7 @@ var Wn = Object.defineProperty, qn = Object.getOwnPropertyDescriptor, Xn = (r, e
|
|
|
9867
9873
|
(a = r[o]) && (i = a(i) || i);
|
|
9868
9874
|
return i;
|
|
9869
9875
|
}, Yn = (r, e, t) => Xn(r, e + "", t);
|
|
9870
|
-
let St = class extends
|
|
9876
|
+
let St = class extends Me {
|
|
9871
9877
|
radius;
|
|
9872
9878
|
angle = 4;
|
|
9873
9879
|
padding = 20;
|
|
@@ -9999,7 +10005,7 @@ class Qn extends Ee {
|
|
|
9999
10005
|
}
|
|
10000
10006
|
class el extends Ee {
|
|
10001
10007
|
install(e) {
|
|
10002
|
-
const t = (s) => e.fetchImageBitmap(s, { premultiplyAlpha: "premultiply" }).then((i) => new
|
|
10008
|
+
const t = (s) => e.fetchImageBitmap(s, { premultiplyAlpha: "premultiply" }).then((i) => new T(i));
|
|
10003
10009
|
return this.load = (s) => e.loadBy(s, () => t(s)), [
|
|
10004
10010
|
"image/gif",
|
|
10005
10011
|
"image/jpeg",
|
|
@@ -10125,7 +10131,7 @@ class ol extends de {
|
|
|
10125
10131
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
10126
10132
|
}) : void 0;
|
|
10127
10133
|
constructor() {
|
|
10128
|
-
super(), vt ||
|
|
10134
|
+
super(), vt || k.on(this.gc.bind(this), { sort: 2 });
|
|
10129
10135
|
}
|
|
10130
10136
|
use(e) {
|
|
10131
10137
|
return e.install(this), this;
|
|
@@ -10350,7 +10356,7 @@ cr([
|
|
|
10350
10356
|
cr([
|
|
10351
10357
|
u({ fallback: !1 })
|
|
10352
10358
|
], Nt.prototype, "autoStart");
|
|
10353
|
-
let
|
|
10359
|
+
let I;
|
|
10354
10360
|
const Xt = [];
|
|
10355
10361
|
let Vt = !1;
|
|
10356
10362
|
async function nl(r = 100) {
|
|
@@ -10380,28 +10386,28 @@ async function ll(r) {
|
|
|
10380
10386
|
onBefore: n,
|
|
10381
10387
|
onFrame: h
|
|
10382
10388
|
} = r;
|
|
10383
|
-
return
|
|
10389
|
+
return I ??= new Nt({
|
|
10384
10390
|
pixelRatio: 1,
|
|
10385
10391
|
width: 1,
|
|
10386
10392
|
height: 1,
|
|
10387
10393
|
preserveDrawingBuffer: !0
|
|
10388
|
-
}),
|
|
10389
|
-
l instanceof
|
|
10390
|
-
}), await n?.(
|
|
10394
|
+
}), I.debug = e, I.fonts = t, I.timeline.currentTime = 0, I.root.removeChildren(), I.resize(s, i, !0), (Array.isArray(o) ? o : [o]).forEach((l) => {
|
|
10395
|
+
l instanceof M ? (l.parent = void 0, I.root.appendChild(l)) : I.root.appendChild(M.parse(l));
|
|
10396
|
+
}), await n?.(I), await I.waitAndRender(), await new Promise((l) => {
|
|
10391
10397
|
let c = 0;
|
|
10392
|
-
const d = a.length,
|
|
10398
|
+
const d = a.length, p = a[d - 1];
|
|
10393
10399
|
async function _() {
|
|
10394
10400
|
if (c === d)
|
|
10395
10401
|
return l();
|
|
10396
|
-
const
|
|
10397
|
-
|
|
10398
|
-
currentTime:
|
|
10402
|
+
const f = a[c++], g = (a[c] || f) - f;
|
|
10403
|
+
I.timeline.currentTime = f, I.render(), await h?.(I.toPixels(), {
|
|
10404
|
+
currentTime: f,
|
|
10399
10405
|
duration: g,
|
|
10400
|
-
progress:
|
|
10406
|
+
progress: f / p
|
|
10401
10407
|
}), requestAnimationFrame(_);
|
|
10402
10408
|
}
|
|
10403
10409
|
_();
|
|
10404
|
-
}),
|
|
10410
|
+
}), I.toCanvas2D();
|
|
10405
10411
|
}
|
|
10406
10412
|
async function Rl(r) {
|
|
10407
10413
|
return new Promise((e) => {
|
|
@@ -10419,7 +10425,7 @@ export {
|
|
|
10419
10425
|
it as AudioWaveform,
|
|
10420
10426
|
rt as BaseElement2D,
|
|
10421
10427
|
Cs as BaseElement2DBackground,
|
|
10422
|
-
|
|
10428
|
+
D as BaseElement2DFill,
|
|
10423
10429
|
Ss as BaseElement2DForeground,
|
|
10424
10430
|
$e as BaseElement2DOutline,
|
|
10425
10431
|
Ve as BaseElement2DShadow,
|
|
@@ -10427,19 +10433,19 @@ export {
|
|
|
10427
10433
|
tt as BaseElement2DStyle,
|
|
10428
10434
|
ee as BaseElement2DText,
|
|
10429
10435
|
Ke as Camera2D,
|
|
10430
|
-
|
|
10436
|
+
po as CanvasContext,
|
|
10431
10437
|
ye as CanvasItem,
|
|
10432
10438
|
er as CanvasTexture,
|
|
10433
10439
|
Z as Color,
|
|
10434
|
-
|
|
10440
|
+
$ as ColorAdjustEffect,
|
|
10435
10441
|
Ze as ColorFilterEffect,
|
|
10436
10442
|
Yr as ColorMatrix,
|
|
10437
|
-
|
|
10443
|
+
Oe as ColorOverlayEffect,
|
|
10438
10444
|
ke as ColorRemoveEffect,
|
|
10439
10445
|
Ue as ColorReplaceEffect,
|
|
10440
10446
|
Tl as ColorTexture,
|
|
10441
|
-
|
|
10442
|
-
|
|
10447
|
+
pe as CoreObject,
|
|
10448
|
+
Oi as DEG_TO_RAD,
|
|
10443
10449
|
Wr as DEVICE_PIXEL_RATIO,
|
|
10444
10450
|
we as DrawboardEffect,
|
|
10445
10451
|
J as DropShadowEffect,
|
|
@@ -10458,7 +10464,7 @@ export {
|
|
|
10458
10464
|
Kn as GifLoader,
|
|
10459
10465
|
N as GlitchEffect,
|
|
10460
10466
|
W as GodrayEffect,
|
|
10461
|
-
|
|
10467
|
+
Ot as GradientTexture,
|
|
10462
10468
|
vn as HTMLAudio,
|
|
10463
10469
|
hr as HTMLAudioContext,
|
|
10464
10470
|
Tt as HTMLSound,
|
|
@@ -10467,7 +10473,7 @@ export {
|
|
|
10467
10473
|
El as ImageTexture,
|
|
10468
10474
|
at as IndexBuffer,
|
|
10469
10475
|
Si as Input,
|
|
10470
|
-
|
|
10476
|
+
Mt as InputEvent,
|
|
10471
10477
|
Zn as JsonLoader,
|
|
10472
10478
|
Qe as KawaseBlurEffect,
|
|
10473
10479
|
Et as KawaseTransition,
|
|
@@ -10482,12 +10488,12 @@ export {
|
|
|
10482
10488
|
re as Matrix,
|
|
10483
10489
|
yl as Matrix2,
|
|
10484
10490
|
Kr as Matrix3,
|
|
10485
|
-
|
|
10491
|
+
Mi as Matrix4,
|
|
10486
10492
|
_o as Meta,
|
|
10487
10493
|
Hr as MouseInputEvent,
|
|
10488
|
-
|
|
10494
|
+
M as Node,
|
|
10489
10495
|
xe as Node2D,
|
|
10490
|
-
|
|
10496
|
+
U as OutlineEffect,
|
|
10491
10497
|
Kt as PI,
|
|
10492
10498
|
B as PI_2,
|
|
10493
10499
|
et as PixelateEffect,
|
|
@@ -10501,9 +10507,9 @@ export {
|
|
|
10501
10507
|
ge as Rect2,
|
|
10502
10508
|
Ri as RefCounted,
|
|
10503
10509
|
Jt as Renderer,
|
|
10504
|
-
|
|
10510
|
+
fe as Resource,
|
|
10505
10511
|
Vr as SUPPORTS_AUDIO_CONTEXT,
|
|
10506
|
-
|
|
10512
|
+
fi as SUPPORTS_CLICK_EVENTS,
|
|
10507
10513
|
$r as SUPPORTS_CREATE_IMAGE_BITMAP,
|
|
10508
10514
|
ui as SUPPORTS_IMAGE_BITMAP,
|
|
10509
10515
|
ml as SUPPORTS_MOUSE_EVENTS,
|
|
@@ -10515,27 +10521,27 @@ export {
|
|
|
10515
10521
|
Gr as SUPPORTS_WEBKIT_AUDIO_CONTEXT,
|
|
10516
10522
|
_i as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT,
|
|
10517
10523
|
mi as SUPPORTS_WEB_AUDIO,
|
|
10518
|
-
|
|
10524
|
+
pi as SUPPORTS_WHEEL_EVENTS,
|
|
10519
10525
|
Fe as SceneTree,
|
|
10520
10526
|
Qn as TextLoader,
|
|
10521
|
-
|
|
10527
|
+
T as Texture2D,
|
|
10522
10528
|
el as TextureLoader,
|
|
10523
10529
|
Rs as TextureRect2D,
|
|
10524
|
-
|
|
10530
|
+
k as Ticker,
|
|
10525
10531
|
ot as TiltShiftTransition,
|
|
10526
10532
|
ie as Timeline,
|
|
10527
10533
|
G as TimelineNode,
|
|
10528
|
-
|
|
10534
|
+
O as Transform2D,
|
|
10529
10535
|
ln as TransformRect2D,
|
|
10530
|
-
|
|
10536
|
+
Me as Transition,
|
|
10531
10537
|
St as TwistTransition,
|
|
10532
10538
|
Pl as UvGeometry,
|
|
10533
10539
|
xt as UvMaterial,
|
|
10534
10540
|
K as Vector,
|
|
10535
|
-
|
|
10541
|
+
S as Vector2,
|
|
10536
10542
|
xl as Vector3,
|
|
10537
10543
|
ki as Vector4,
|
|
10538
|
-
|
|
10544
|
+
z as VertexAttribute,
|
|
10539
10545
|
ce as VertexBuffer,
|
|
10540
10546
|
qt as Video2D,
|
|
10541
10547
|
tl as VideoLoader,
|
|
@@ -10579,11 +10585,11 @@ export {
|
|
|
10579
10585
|
xi as determineCrossOrigin,
|
|
10580
10586
|
jt as directionMap,
|
|
10581
10587
|
Sr as displayMap,
|
|
10582
|
-
|
|
10588
|
+
fn as ease,
|
|
10583
10589
|
_n as easeIn,
|
|
10584
10590
|
gn as easeInOut,
|
|
10585
10591
|
mn as easeOut,
|
|
10586
|
-
|
|
10592
|
+
E as edgeMap,
|
|
10587
10593
|
Ar as flexDirectionMap,
|
|
10588
10594
|
Rr as flexWrapMap,
|
|
10589
10595
|
wa as frag,
|
|
@@ -10595,14 +10601,14 @@ export {
|
|
|
10595
10601
|
vr as isPow2,
|
|
10596
10602
|
gi as isVideoElement,
|
|
10597
10603
|
bi as isWebgl2,
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10604
|
+
Mr as justifyMap,
|
|
10605
|
+
C as lerp,
|
|
10606
|
+
pn as linear,
|
|
10601
10607
|
xr as log2,
|
|
10602
10608
|
Bi as mapWebGLBlendModes,
|
|
10603
10609
|
yr as nextPow2,
|
|
10604
10610
|
Fr as nextTick,
|
|
10605
|
-
|
|
10611
|
+
Or as overflowMap,
|
|
10606
10612
|
Cl as parseCSSFilter,
|
|
10607
10613
|
Fo as parseCSSTransform,
|
|
10608
10614
|
zo as parseCSSTransformOrigin,
|