modern-canvas 0.13.1 → 0.13.2
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/asset/Assets.d.ts +3 -3
- package/dist/asset/loaders/FontLoader.d.ts +1 -1
- package/dist/asset/loaders/GifLoader.d.ts +1 -1
- package/dist/asset/loaders/JsonLoader.d.ts +1 -1
- package/dist/asset/loaders/TextLoader.d.ts +1 -1
- package/dist/asset/loaders/TextureLoader.d.ts +1 -1
- package/dist/asset/parseMimeType.d.ts +1 -1
- package/dist/index.js +229 -287
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineProperty as Xt, Observable as fe, Reactivable as Ir, parseColor as Ls, property as c, RawWeakMap as Br, isGradient as Fs, isColorFillObject as mr, clearUndef as zr, idGenerator as Nr, normalizeFill as $s, isNone as
|
|
1
|
+
import { defineProperty as Xt, Observable as fe, Reactivable as Ir, parseColor as Ls, property as c, RawWeakMap as Br, isGradient as Fs, isColorFillObject as mr, clearUndef as zr, idGenerator as Nr, normalizeFill as $s, isNone as F, normalizeBackground as Vs, normalizeForeground as Gs, normalizeOutline as Ws, normalizeShadow as js, normalizeShape as qs, getDefaultStyle as Xs, normalizeText as Hs, normalizeTextContent as Ys, getDefaultTextStyle as Ks, getDefaultLayoutStyle as Zs } from "modern-idoc";
|
|
2
2
|
import { fonts as Js } from "modern-font";
|
|
3
3
|
import { extend as Qs } from "colord";
|
|
4
4
|
import ei from "colord/plugins/names";
|
|
@@ -24,7 +24,7 @@ function bl(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 Lr(r) {
|
|
85
85
|
return new Promise((e) => {
|
|
86
|
-
|
|
86
|
+
k.on(
|
|
87
87
|
() => {
|
|
88
88
|
r?.(), e();
|
|
89
89
|
},
|
|
@@ -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 kt {
|
|
|
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 kt {
|
|
|
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 Si extends
|
|
285
|
+
class Si 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 Si extends kt {
|
|
|
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;
|
|
@@ -535,9 +535,9 @@ class Oi extends fe {
|
|
|
535
535
|
this.removeEventListeners(), super.destroy();
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
let
|
|
538
|
+
let Mi = 0;
|
|
539
539
|
class pe extends Ir {
|
|
540
|
-
instanceId = ++
|
|
540
|
+
instanceId = ++Mi;
|
|
541
541
|
get json() {
|
|
542
542
|
return this.toJSON();
|
|
543
543
|
}
|
|
@@ -551,10 +551,10 @@ class pe extends Ir {
|
|
|
551
551
|
return !!(e && this.instanceId === e.instanceId);
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
class
|
|
554
|
+
class ki extends pe {
|
|
555
555
|
//
|
|
556
556
|
}
|
|
557
|
-
class _e extends
|
|
557
|
+
class _e extends ki {
|
|
558
558
|
//
|
|
559
559
|
}
|
|
560
560
|
Qs([ei]);
|
|
@@ -1544,13 +1544,13 @@ class Kt extends pe {
|
|
|
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);
|
|
@@ -1640,7 +1640,7 @@ class H {
|
|
|
1640
1640
|
destroy() {
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
|
-
class
|
|
1643
|
+
class Me {
|
|
1644
1644
|
static _properties = [
|
|
1645
1645
|
"blend",
|
|
1646
1646
|
"offsets",
|
|
@@ -1664,7 +1664,7 @@ class ke {
|
|
|
1664
1664
|
});
|
|
1665
1665
|
}
|
|
1666
1666
|
static for2D() {
|
|
1667
|
-
const e = new
|
|
1667
|
+
const e = new Me();
|
|
1668
1668
|
return e.depthTest = !1, e.blend = !0, e;
|
|
1669
1669
|
}
|
|
1670
1670
|
_blendMode = Ze.NORMAL;
|
|
@@ -1688,17 +1688,17 @@ class ke {
|
|
|
1688
1688
|
this[t] = e[t];
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
|
-
|
|
1691
|
+
Me._init();
|
|
1692
1692
|
class Fi extends H {
|
|
1693
1693
|
install(e) {
|
|
1694
1694
|
super.install(e), e.state = this;
|
|
1695
1695
|
}
|
|
1696
1696
|
_blendEq = !1;
|
|
1697
|
-
_setters =
|
|
1697
|
+
_setters = Me._properties.map((e) => this[`set${e.replace(/^\S/, (t) => t.toUpperCase())}`]);
|
|
1698
1698
|
boundStateBitmap = 0;
|
|
1699
1699
|
boundBlendMode;
|
|
1700
1700
|
blendModes;
|
|
1701
|
-
defaultState = new
|
|
1701
|
+
defaultState = new Me({ blend: !0 });
|
|
1702
1702
|
onUpdateContext() {
|
|
1703
1703
|
super.onUpdateContext(), this.blendModes = Li(this._renderer.gl);
|
|
1704
1704
|
}
|
|
@@ -1753,7 +1753,7 @@ class $i extends H {
|
|
|
1753
1753
|
install(e) {
|
|
1754
1754
|
super.install(e), e.batch2D = this;
|
|
1755
1755
|
}
|
|
1756
|
-
_state =
|
|
1756
|
+
_state = Me.for2D();
|
|
1757
1757
|
_batchSize = 4096 * 4;
|
|
1758
1758
|
_drawCallUid = 0;
|
|
1759
1759
|
_defaultModulate = [255, 255, 255, 255];
|
|
@@ -1917,13 +1917,13 @@ void main(void) {
|
|
|
1917
1917
|
let l = 0, u = 0;
|
|
1918
1918
|
const d = [];
|
|
1919
1919
|
for (let _ = s.length, p = { id: ++this._drawCallUid }, m = [], g = /* @__PURE__ */ new Map(), w = 0, P = 0, R = 0; R < _; R++) {
|
|
1920
|
-
const A = s[R].texture,
|
|
1920
|
+
const A = s[R].texture, L = R === _ - 1;
|
|
1921
1921
|
if (!A || g.has(A)) {
|
|
1922
|
-
if (!
|
|
1922
|
+
if (!L)
|
|
1923
1923
|
continue;
|
|
1924
1924
|
} else
|
|
1925
1925
|
m.push(A), g.set(A, w++);
|
|
1926
|
-
if (
|
|
1926
|
+
if (L || w >= i) {
|
|
1927
1927
|
p.textures = m, p.textureLocationMap = g, w = 0, p.first = u;
|
|
1928
1928
|
for (let G = P; G <= R; G++) {
|
|
1929
1929
|
const {
|
|
@@ -1962,11 +1962,11 @@ void main(void) {
|
|
|
1962
1962
|
for (let _ = d.length, p = 0; p < _; p++) {
|
|
1963
1963
|
const m = d[p], { first: g = 0, textures: w, textureLocationMap: P } = m;
|
|
1964
1964
|
for (let R = w.length, A = 0; A < R; A++) {
|
|
1965
|
-
const
|
|
1965
|
+
const L = w[A], G = P.get(L);
|
|
1966
1966
|
G !== void 0 && this._renderer.texture.bind({
|
|
1967
1967
|
target: "texture_2d",
|
|
1968
1968
|
location: G,
|
|
1969
|
-
value:
|
|
1969
|
+
value: L
|
|
1970
1970
|
});
|
|
1971
1971
|
}
|
|
1972
1972
|
this._state.blendMode = m.blendMode, this._renderer.state.bind(this._state), f.draw({
|
|
@@ -3000,12 +3000,12 @@ class to extends Se {
|
|
|
3000
3000
|
install(e) {
|
|
3001
3001
|
const t = async (s) => {
|
|
3002
3002
|
const { parseFont: i } = await import("modern-font");
|
|
3003
|
-
return await
|
|
3003
|
+
return await s.arrayBuffer().then((o) => i(o));
|
|
3004
3004
|
};
|
|
3005
|
-
return this.load = (s) => e.loadBy(s
|
|
3006
|
-
"woff",
|
|
3007
|
-
"ttf",
|
|
3008
|
-
"otf"
|
|
3005
|
+
return this.load = (s) => typeof s == "string" ? e.loadBy(s).then(t) : t(s), [
|
|
3006
|
+
"font/woff",
|
|
3007
|
+
"font/ttf",
|
|
3008
|
+
"font/otf"
|
|
3009
3009
|
].forEach((s) => {
|
|
3010
3010
|
e.register(s, t);
|
|
3011
3011
|
}), e.font = this, this;
|
|
@@ -3157,7 +3157,7 @@ var io = Object.defineProperty, Ce = (r, e, t, s) => {
|
|
|
3157
3157
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
3158
3158
|
return i && io(e, t, i), i;
|
|
3159
3159
|
};
|
|
3160
|
-
class
|
|
3160
|
+
class $ extends _e {
|
|
3161
3161
|
needsUpload = !1;
|
|
3162
3162
|
constructor(e) {
|
|
3163
3163
|
super(), this.setProperties({
|
|
@@ -3185,30 +3185,30 @@ class F extends _e {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
Ce([
|
|
3187
3187
|
c({ internal: !0 })
|
|
3188
|
-
],
|
|
3188
|
+
], $.prototype, "buffer");
|
|
3189
3189
|
Ce([
|
|
3190
3190
|
c({ fallback: 0 })
|
|
3191
|
-
],
|
|
3191
|
+
], $.prototype, "size");
|
|
3192
3192
|
Ce([
|
|
3193
3193
|
c({ fallback: !1 })
|
|
3194
|
-
],
|
|
3194
|
+
], $.prototype, "normalized");
|
|
3195
3195
|
Ce([
|
|
3196
3196
|
c({ fallback: "float" })
|
|
3197
|
-
],
|
|
3197
|
+
], $.prototype, "type");
|
|
3198
3198
|
Ce([
|
|
3199
3199
|
c()
|
|
3200
|
-
],
|
|
3200
|
+
], $.prototype, "stride");
|
|
3201
3201
|
Ce([
|
|
3202
3202
|
c()
|
|
3203
|
-
],
|
|
3203
|
+
], $.prototype, "offset");
|
|
3204
3204
|
Ce([
|
|
3205
3205
|
c()
|
|
3206
|
-
],
|
|
3206
|
+
], $.prototype, "divisor");
|
|
3207
3207
|
class Sl extends Jt {
|
|
3208
3208
|
constructor() {
|
|
3209
3209
|
super({
|
|
3210
3210
|
vertexAttributes: {
|
|
3211
|
-
position: new
|
|
3211
|
+
position: new $({
|
|
3212
3212
|
buffer: new ue({
|
|
3213
3213
|
data: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
|
|
3214
3214
|
dynamic: !1
|
|
@@ -3372,7 +3372,7 @@ class b extends Jt {
|
|
|
3372
3372
|
constructor() {
|
|
3373
3373
|
super({
|
|
3374
3374
|
vertexAttributes: {
|
|
3375
|
-
position: new
|
|
3375
|
+
position: new $({
|
|
3376
3376
|
buffer: new ue({
|
|
3377
3377
|
data: new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]),
|
|
3378
3378
|
dynamic: !1
|
|
@@ -3381,7 +3381,7 @@ class b extends Jt {
|
|
|
3381
3381
|
normalized: !1,
|
|
3382
3382
|
type: "float"
|
|
3383
3383
|
}),
|
|
3384
|
-
uv: new
|
|
3384
|
+
uv: new $({
|
|
3385
3385
|
buffer: new ue({
|
|
3386
3386
|
data: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
|
|
3387
3387
|
dynamic: !1
|
|
@@ -3405,13 +3405,13 @@ class Cl extends Jt {
|
|
|
3405
3405
|
const e = new ue({ data: new Float32Array(), dynamic: !0 }), t = new ue({ data: new Float32Array(), dynamic: !0 });
|
|
3406
3406
|
super({
|
|
3407
3407
|
vertexAttributes: {
|
|
3408
|
-
position: new
|
|
3408
|
+
position: new $({
|
|
3409
3409
|
buffer: e,
|
|
3410
3410
|
size: 2,
|
|
3411
3411
|
normalized: !1,
|
|
3412
3412
|
type: "float"
|
|
3413
3413
|
}),
|
|
3414
|
-
uv: new
|
|
3414
|
+
uv: new $({
|
|
3415
3415
|
buffer: t,
|
|
3416
3416
|
size: 2,
|
|
3417
3417
|
normalized: !1,
|
|
@@ -3615,7 +3615,7 @@ class Al extends T {
|
|
|
3615
3615
|
});
|
|
3616
3616
|
}
|
|
3617
3617
|
}
|
|
3618
|
-
class
|
|
3618
|
+
class kt extends T {
|
|
3619
3619
|
static test(e) {
|
|
3620
3620
|
return Fs(e);
|
|
3621
3621
|
}
|
|
@@ -3629,16 +3629,16 @@ class Mt extends T {
|
|
|
3629
3629
|
const { angle: a = 0, stops: n } = e, h = t, l = s, u = h / 2, d = l / 2, f = (a + 90) * Math.PI / 180, _ = Math.sin(f), p = -Math.cos(f), m = Math.abs(h * Math.sin(f)) + Math.abs(l * Math.cos(f)), g = u - _ * (m / 2), w = d - p * (m / 2), P = u + _ * (m / 2), R = d + p * (m / 2), A = o.createLinearGradient(g, w, P, R);
|
|
3630
3630
|
for (const G of n) A.addColorStop(G.offset, G.color);
|
|
3631
3631
|
o.fillStyle = A, o.fillRect(0, 0, h, l);
|
|
3632
|
-
const
|
|
3632
|
+
const L = o.getImageData(0, 0, i.width, i.height);
|
|
3633
3633
|
return {
|
|
3634
|
-
width:
|
|
3635
|
-
height:
|
|
3636
|
-
pixels: new Uint8Array(
|
|
3634
|
+
width: L.width,
|
|
3635
|
+
height: L.height,
|
|
3636
|
+
pixels: new Uint8Array(L.data.buffer)
|
|
3637
3637
|
};
|
|
3638
3638
|
}
|
|
3639
3639
|
constructor(e, t, s) {
|
|
3640
3640
|
super(
|
|
3641
|
-
|
|
3641
|
+
kt.linearGradient(e, t, s)
|
|
3642
3642
|
);
|
|
3643
3643
|
}
|
|
3644
3644
|
}
|
|
@@ -3830,15 +3830,15 @@ const er = class ss extends T {
|
|
|
3830
3830
|
this.autoUpdate && !this.isPlaying && (this._nextTime = 0, this.requestUpload(), this._nextTime = 0);
|
|
3831
3831
|
};
|
|
3832
3832
|
_setupAutoUpdate() {
|
|
3833
|
-
this.autoUpdate && this.isPlaying ? !this.fps && this.source.requestVideoFrameCallback ? (this._connected && (
|
|
3833
|
+
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(
|
|
3834
3834
|
this._videoFrameRequestCallback
|
|
3835
|
-
))) : (this._requestId !== void 0 && (this.source.cancelVideoFrameCallback(this._requestId), this._requestId = void 0), this._connected || (
|
|
3835
|
+
))) : (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));
|
|
3836
3836
|
}
|
|
3837
3837
|
_videoFrameRequestCallback = () => {
|
|
3838
3838
|
this.requestUpload(), this._requestId = this.source.requestVideoFrameCallback(this._videoFrameRequestCallback);
|
|
3839
3839
|
};
|
|
3840
3840
|
requestUpload = () => {
|
|
3841
|
-
const e = Math.floor(
|
|
3841
|
+
const e = Math.floor(k.elapsed * this.source.playbackRate);
|
|
3842
3842
|
this._nextTime -= e, (!this._spf || this._nextTime <= 0) && (super.requestUpload(), this._nextTime = this._spf || 0);
|
|
3843
3843
|
};
|
|
3844
3844
|
async load() {
|
|
@@ -4070,7 +4070,7 @@ function xo(r) {
|
|
|
4070
4070
|
let e = Pr[r] ?? 0;
|
|
4071
4071
|
return e++, Pr[r] = e, e;
|
|
4072
4072
|
}
|
|
4073
|
-
let
|
|
4073
|
+
let M = class extends pe {
|
|
4074
4074
|
_meta = new vo(this);
|
|
4075
4075
|
get meta() {
|
|
4076
4076
|
return this._meta;
|
|
@@ -4266,7 +4266,7 @@ let k = class extends pe {
|
|
|
4266
4266
|
const n = e.renderStack.push(this);
|
|
4267
4267
|
a = e.renderStack.currentCall, e.renderStack.currentCall = n;
|
|
4268
4268
|
}
|
|
4269
|
-
if (this.mask instanceof
|
|
4269
|
+
if (this.mask instanceof M)
|
|
4270
4270
|
this.getNode("__$mask") || (this.mask.processMode = "disabled", this.appendChild(this.mask, "front"));
|
|
4271
4271
|
else {
|
|
4272
4272
|
const n = this.getNode("__$mask");
|
|
@@ -4430,43 +4430,43 @@ let k = class extends pe {
|
|
|
4430
4430
|
static parse(r) {
|
|
4431
4431
|
if (Array.isArray(r))
|
|
4432
4432
|
return r.map((n) => this.parse(n));
|
|
4433
|
-
const { meta: e = {}, children: t, ...s } = r, { inCanvasIs: i = "Node" } = e, o = Ht.get(i) ??
|
|
4433
|
+
const { meta: e = {}, children: t, ...s } = r, { inCanvasIs: i = "Node" } = e, o = Ht.get(i) ?? M, a = new o({ ...s, meta: e });
|
|
4434
4434
|
return t?.forEach((n) => a.appendChild(this.parse(n))), a;
|
|
4435
4435
|
}
|
|
4436
4436
|
};
|
|
4437
4437
|
ne([
|
|
4438
4438
|
c({ fallback: Nr() })
|
|
4439
|
-
],
|
|
4439
|
+
], M.prototype, "id", 2);
|
|
4440
4440
|
ne([
|
|
4441
4441
|
c({ fallback: Nr() })
|
|
4442
|
-
],
|
|
4442
|
+
], M.prototype, "name", 2);
|
|
4443
4443
|
ne([
|
|
4444
4444
|
c({ internal: !0, fallback: "inherit" })
|
|
4445
|
-
],
|
|
4445
|
+
], M.prototype, "processMode", 2);
|
|
4446
4446
|
ne([
|
|
4447
4447
|
c({ internal: !0, fallback: "default" })
|
|
4448
|
-
],
|
|
4448
|
+
], M.prototype, "processSortMode", 2);
|
|
4449
4449
|
ne([
|
|
4450
4450
|
c({ internal: !0, fallback: "inherit" })
|
|
4451
|
-
],
|
|
4451
|
+
], M.prototype, "renderMode", 2);
|
|
4452
4452
|
ne([
|
|
4453
4453
|
c({ internal: !0, fallback: "inherit" })
|
|
4454
|
-
],
|
|
4454
|
+
], M.prototype, "inputMode", 2);
|
|
4455
4455
|
ne([
|
|
4456
4456
|
c({ internal: !0, fallback: "default" })
|
|
4457
|
-
],
|
|
4457
|
+
], M.prototype, "internalMode", 2);
|
|
4458
4458
|
ne([
|
|
4459
4459
|
c({ internal: !0 })
|
|
4460
|
-
],
|
|
4461
|
-
|
|
4460
|
+
], M.prototype, "mask", 2);
|
|
4461
|
+
M = ne([
|
|
4462
4462
|
v("Node")
|
|
4463
|
-
],
|
|
4463
|
+
], M);
|
|
4464
4464
|
var wo = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, Ne = (r, e, t, s) => {
|
|
4465
4465
|
for (var i = s > 1 ? void 0 : s ? Po(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
4466
4466
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
4467
4467
|
return s && i && wo(e, t, i), i;
|
|
4468
4468
|
};
|
|
4469
|
-
let W = class extends
|
|
4469
|
+
let W = class extends M {
|
|
4470
4470
|
constructor(r, e = []) {
|
|
4471
4471
|
super(), this.setProperties(r).append(e);
|
|
4472
4472
|
}
|
|
@@ -4666,7 +4666,7 @@ var So = Object.defineProperty, Co = Object.getOwnPropertyDescriptor, Le = (r, e
|
|
|
4666
4666
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
4667
4667
|
return s && i && So(e, t, i), i;
|
|
4668
4668
|
};
|
|
4669
|
-
let j = class extends
|
|
4669
|
+
let j = class extends M {
|
|
4670
4670
|
constructor(r = !1) {
|
|
4671
4671
|
super(), this.flipY = r, this.projection.flipY(r);
|
|
4672
4672
|
}
|
|
@@ -4814,7 +4814,7 @@ let y = class extends W {
|
|
|
4814
4814
|
break;
|
|
4815
4815
|
}
|
|
4816
4816
|
case "glslSrc": {
|
|
4817
|
-
e ?
|
|
4817
|
+
e ? z.text.load(e).then((s) => this.glsl = s) : this.glsl = "";
|
|
4818
4818
|
break;
|
|
4819
4819
|
}
|
|
4820
4820
|
}
|
|
@@ -4986,12 +4986,12 @@ class Oo {
|
|
|
4986
4986
|
}), this.calls = [];
|
|
4987
4987
|
}
|
|
4988
4988
|
}
|
|
4989
|
-
var
|
|
4990
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
4989
|
+
var Mo = Object.defineProperty, ko = Object.getOwnPropertyDescriptor, Fe = (r, e, t, s) => {
|
|
4990
|
+
for (var i = s > 1 ? void 0 : s ? ko(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
4991
4991
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
4992
|
-
return s && i &&
|
|
4992
|
+
return s && i && Mo(e, t, i), i;
|
|
4993
4993
|
};
|
|
4994
|
-
let oe = class extends
|
|
4994
|
+
let oe = class extends M {
|
|
4995
4995
|
static from(r, e = !1) {
|
|
4996
4996
|
const [t, s] = r ? Array.isArray(r) ? r : [0, r] : [];
|
|
4997
4997
|
return new oe({
|
|
@@ -5131,18 +5131,18 @@ var Bo = Object.getOwnPropertyDescriptor, zo = (r, e, t, s) => {
|
|
|
5131
5131
|
(a = r[o]) && (i = a(i) || i);
|
|
5132
5132
|
return i;
|
|
5133
5133
|
};
|
|
5134
|
-
let
|
|
5134
|
+
let ke = class extends y {
|
|
5135
5135
|
constructor(r, e = []) {
|
|
5136
5136
|
super(), this.setProperties(r).append(e);
|
|
5137
5137
|
}
|
|
5138
5138
|
};
|
|
5139
|
-
|
|
5139
|
+
ke = zo([
|
|
5140
5140
|
v("Transition", {
|
|
5141
5141
|
effectMode: "transition",
|
|
5142
5142
|
processMode: "pausable",
|
|
5143
5143
|
duration: 2e3
|
|
5144
5144
|
})
|
|
5145
|
-
],
|
|
5145
|
+
], ke);
|
|
5146
5146
|
var No = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, tr = (r, e, t, s) => {
|
|
5147
5147
|
for (var i = s > 1 ? void 0 : s ? Lo(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
5148
5148
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
@@ -5498,13 +5498,13 @@ var os = Object.defineProperty, Wo = Object.getOwnPropertyDescriptor, jo = (r, e
|
|
|
5498
5498
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
5499
5499
|
return s && i && os(e, t, i), i;
|
|
5500
5500
|
}, qo = (r, e, t) => jo(r, e + "", t);
|
|
5501
|
-
let
|
|
5501
|
+
let V = class extends y {
|
|
5502
5502
|
constructor(r, e = []) {
|
|
5503
5503
|
super(), this.setProperties(r).append(e);
|
|
5504
5504
|
}
|
|
5505
5505
|
apply(r, e) {
|
|
5506
5506
|
e.redraw(r, () => {
|
|
5507
|
-
b.draw(r,
|
|
5507
|
+
b.draw(r, V.material, {
|
|
5508
5508
|
sampler: 0,
|
|
5509
5509
|
saturation: this.saturation,
|
|
5510
5510
|
contrast: this.contrast,
|
|
@@ -5518,7 +5518,7 @@ let $ = class extends y {
|
|
|
5518
5518
|
});
|
|
5519
5519
|
}
|
|
5520
5520
|
};
|
|
5521
|
-
qo(
|
|
5521
|
+
qo(V, "material", new x({
|
|
5522
5522
|
vert: `precision mediump float;
|
|
5523
5523
|
attribute vec2 position;
|
|
5524
5524
|
attribute vec2 uv;
|
|
@@ -5555,31 +5555,31 @@ void main(void) {
|
|
|
5555
5555
|
}));
|
|
5556
5556
|
le([
|
|
5557
5557
|
c({ fallback: 1 })
|
|
5558
|
-
],
|
|
5558
|
+
], V.prototype, "saturation", 2);
|
|
5559
5559
|
le([
|
|
5560
5560
|
c({ fallback: 1 })
|
|
5561
|
-
],
|
|
5561
|
+
], V.prototype, "contrast", 2);
|
|
5562
5562
|
le([
|
|
5563
5563
|
c({ fallback: 1 })
|
|
5564
|
-
],
|
|
5564
|
+
], V.prototype, "brightness", 2);
|
|
5565
5565
|
le([
|
|
5566
5566
|
c({ fallback: 1 })
|
|
5567
|
-
],
|
|
5567
|
+
], V.prototype, "red", 2);
|
|
5568
5568
|
le([
|
|
5569
5569
|
c({ fallback: 1 })
|
|
5570
|
-
],
|
|
5570
|
+
], V.prototype, "green", 2);
|
|
5571
5571
|
le([
|
|
5572
5572
|
c({ fallback: 1 })
|
|
5573
|
-
],
|
|
5573
|
+
], V.prototype, "blue", 2);
|
|
5574
5574
|
le([
|
|
5575
5575
|
c({ fallback: 1 })
|
|
5576
|
-
],
|
|
5576
|
+
], V.prototype, "alpha", 2);
|
|
5577
5577
|
le([
|
|
5578
5578
|
c({ fallback: 1 })
|
|
5579
|
-
],
|
|
5580
|
-
|
|
5579
|
+
], V.prototype, "gamma", 2);
|
|
5580
|
+
V = le([
|
|
5581
5581
|
v("ColorAdjustEffect")
|
|
5582
|
-
],
|
|
5582
|
+
], V);
|
|
5583
5583
|
var as = Object.defineProperty, Xo = Object.getOwnPropertyDescriptor, Ho = (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) => {
|
|
5584
5584
|
for (var i = s > 1 ? void 0 : s ? Xo(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
5585
5585
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
@@ -6069,7 +6069,7 @@ let q = class extends y {
|
|
|
6069
6069
|
}
|
|
6070
6070
|
}
|
|
6071
6071
|
async _loadWatermark(r) {
|
|
6072
|
-
r ? this._watermark = await
|
|
6072
|
+
r ? this._watermark = await z.texture.load(r) : this._watermark = void 0;
|
|
6073
6073
|
}
|
|
6074
6074
|
_checkerboardStyleMap = {
|
|
6075
6075
|
grid: 1,
|
|
@@ -6386,7 +6386,7 @@ var vs = Object.defineProperty, ga = Object.getOwnPropertyDescriptor, va = (r, e
|
|
|
6386
6386
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
6387
6387
|
return s && i && vs(e, t, i), i;
|
|
6388
6388
|
}, ba = (r, e, t) => va(r, e + "", t);
|
|
6389
|
-
let
|
|
6389
|
+
let N = class extends y {
|
|
6390
6390
|
_canvas;
|
|
6391
6391
|
_texture;
|
|
6392
6392
|
_sizes;
|
|
@@ -6410,7 +6410,7 @@ let z = class extends y {
|
|
|
6410
6410
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
6411
6411
|
const t = e.width, s = e.height, i = this.direction * (Math.PI / 180), o = Math.sin(i), a = Math.cos(i);
|
|
6412
6412
|
e.redraw(r, () => {
|
|
6413
|
-
this._texture.activate(r, 1), b.draw(r,
|
|
6413
|
+
this._texture.activate(r, 1), b.draw(r, N.material, {
|
|
6414
6414
|
sampler: 0,
|
|
6415
6415
|
filterClamp: [0, 0, 1, 1],
|
|
6416
6416
|
filterArea: [t, s, 0, 0],
|
|
@@ -6429,7 +6429,7 @@ let z = class extends y {
|
|
|
6429
6429
|
});
|
|
6430
6430
|
}
|
|
6431
6431
|
};
|
|
6432
|
-
ba(
|
|
6432
|
+
ba(N, "material", new x({
|
|
6433
6433
|
vert: `precision mediump float;
|
|
6434
6434
|
attribute vec2 position;
|
|
6435
6435
|
attribute vec2 uv;
|
|
@@ -6536,34 +6536,34 @@ void main(void) {
|
|
|
6536
6536
|
}));
|
|
6537
6537
|
ee([
|
|
6538
6538
|
c({ fallback: 10 })
|
|
6539
|
-
],
|
|
6539
|
+
], N.prototype, "slices", 2);
|
|
6540
6540
|
ee([
|
|
6541
6541
|
c({ fallback: 512 })
|
|
6542
|
-
],
|
|
6542
|
+
], N.prototype, "sampleSize", 2);
|
|
6543
6543
|
ee([
|
|
6544
6544
|
c({ fallback: 100 })
|
|
6545
|
-
],
|
|
6545
|
+
], N.prototype, "offset", 2);
|
|
6546
6546
|
ee([
|
|
6547
6547
|
c({ fallback: 0 })
|
|
6548
|
-
],
|
|
6548
|
+
], N.prototype, "direction", 2);
|
|
6549
6549
|
ee([
|
|
6550
6550
|
c({ fallback: 2 })
|
|
6551
|
-
],
|
|
6551
|
+
], N.prototype, "fillMode", 2);
|
|
6552
6552
|
ee([
|
|
6553
6553
|
c({ fallback: 0 })
|
|
6554
|
-
],
|
|
6554
|
+
], N.prototype, "seed", 2);
|
|
6555
6555
|
ee([
|
|
6556
6556
|
c({ default: () => [2, 2] })
|
|
6557
|
-
],
|
|
6557
|
+
], N.prototype, "red", 2);
|
|
6558
6558
|
ee([
|
|
6559
6559
|
c({ default: () => [-10, 4] })
|
|
6560
|
-
],
|
|
6560
|
+
], N.prototype, "green", 2);
|
|
6561
6561
|
ee([
|
|
6562
6562
|
c({ default: () => [10, -4] })
|
|
6563
|
-
],
|
|
6564
|
-
|
|
6563
|
+
], N.prototype, "blue", 2);
|
|
6564
|
+
N = ee([
|
|
6565
6565
|
v("GlitchEffect")
|
|
6566
|
-
],
|
|
6566
|
+
], N);
|
|
6567
6567
|
var bs = Object.defineProperty, ya = Object.getOwnPropertyDescriptor, xa = (r, e, t) => e in r ? bs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ge = (r, e, t, s) => {
|
|
6568
6568
|
for (var i = s > 1 ? void 0 : s ? ya(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
6569
6569
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
@@ -6869,7 +6869,7 @@ let Te = class extends y {
|
|
|
6869
6869
|
super(), this.setProperties(r).append(e);
|
|
6870
6870
|
}
|
|
6871
6871
|
async load() {
|
|
6872
|
-
this.texture = void 0, this.src && (this.texture = await
|
|
6872
|
+
this.texture = void 0, this.src && (this.texture = await z.texture.load(this.src));
|
|
6873
6873
|
}
|
|
6874
6874
|
_updateProperty(r, e, t) {
|
|
6875
6875
|
switch (super._updateProperty(r, e, t), r) {
|
|
@@ -6948,11 +6948,11 @@ nr([
|
|
|
6948
6948
|
Te = nr([
|
|
6949
6949
|
v("MaskEffect")
|
|
6950
6950
|
], Te);
|
|
6951
|
-
var xs = Object.defineProperty,
|
|
6952
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
6951
|
+
var xs = Object.defineProperty, Ma = Object.getOwnPropertyDescriptor, ka = (r, e, t) => e in r ? xs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ve = (r, e, t, s) => {
|
|
6952
|
+
for (var i = s > 1 ? void 0 : s ? Ma(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
6953
6953
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
6954
6954
|
return s && i && xs(e, t, i), i;
|
|
6955
|
-
}, ws = (r, e, t) =>
|
|
6955
|
+
}, ws = (r, e, t) => ka(r, typeof e != "symbol" ? e + "" : e, t);
|
|
6956
6956
|
const Ua = `precision highp float;
|
|
6957
6957
|
varying vec2 vUv;
|
|
6958
6958
|
uniform sampler2D sampler;
|
|
@@ -7299,7 +7299,7 @@ class D extends pe {
|
|
|
7299
7299
|
}
|
|
7300
7300
|
setProperties(e) {
|
|
7301
7301
|
return this._setProperties(
|
|
7302
|
-
|
|
7302
|
+
F(e) ? void 0 : $s(e)
|
|
7303
7303
|
);
|
|
7304
7304
|
}
|
|
7305
7305
|
_updateProperty(e, t, s) {
|
|
@@ -7322,11 +7322,18 @@ class D extends pe {
|
|
|
7322
7322
|
}
|
|
7323
7323
|
}
|
|
7324
7324
|
async loadTexture() {
|
|
7325
|
-
this.linearGradient || this.radialGradient
|
|
7326
|
-
this.
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7325
|
+
if (this.linearGradient || this.radialGradient)
|
|
7326
|
+
this.texture = new kt(
|
|
7327
|
+
this.linearGradient ?? this.radialGradient,
|
|
7328
|
+
this.parent.size.width,
|
|
7329
|
+
this.parent.size.height
|
|
7330
|
+
);
|
|
7331
|
+
else if (!F(this.image)) {
|
|
7332
|
+
this.parent.tree?.log(`load image ${this.image}`);
|
|
7333
|
+
let e = this.image.split("?")[0].endsWith(".gif");
|
|
7334
|
+
const t = await z.loadBy(this.image);
|
|
7335
|
+
e || (e = t.type.startsWith("image/gif") ?? !1), e ? this.animatedTexture = await z.gif.load(t) : this.texture = await z.texture.load(t);
|
|
7336
|
+
}
|
|
7330
7337
|
}
|
|
7331
7338
|
async _updateTexture() {
|
|
7332
7339
|
await this.loadTexture(), this.parent.requestRedraw();
|
|
@@ -7408,7 +7415,7 @@ var $a = Object.defineProperty, Va = (r, e, t, s) => {
|
|
|
7408
7415
|
class Ss extends D {
|
|
7409
7416
|
setProperties(e) {
|
|
7410
7417
|
return super._setProperties(
|
|
7411
|
-
|
|
7418
|
+
F(e) ? void 0 : Vs(e)
|
|
7412
7419
|
);
|
|
7413
7420
|
}
|
|
7414
7421
|
_updateProperty(e, t, s) {
|
|
@@ -7430,7 +7437,7 @@ var Ga = Object.defineProperty, Wa = (r, e, t, s) => {
|
|
|
7430
7437
|
class Cs extends D {
|
|
7431
7438
|
setProperties(e) {
|
|
7432
7439
|
return super._setProperties(
|
|
7433
|
-
|
|
7440
|
+
F(e) ? void 0 : Gs(e)
|
|
7434
7441
|
);
|
|
7435
7442
|
}
|
|
7436
7443
|
_updateProperty(e, t, s) {
|
|
@@ -7452,7 +7459,7 @@ var ja = Object.defineProperty, ut = (r, e, t, s) => {
|
|
|
7452
7459
|
class Ge extends D {
|
|
7453
7460
|
setProperties(e) {
|
|
7454
7461
|
return super._setProperties(
|
|
7455
|
-
|
|
7462
|
+
F(e) ? void 0 : Ws(e)
|
|
7456
7463
|
);
|
|
7457
7464
|
}
|
|
7458
7465
|
_updateProperty(e, t, s) {
|
|
@@ -7509,7 +7516,7 @@ class We extends pe {
|
|
|
7509
7516
|
}
|
|
7510
7517
|
setProperties(e) {
|
|
7511
7518
|
return super.setProperties(
|
|
7512
|
-
|
|
7519
|
+
F(e) ? void 0 : js(e)
|
|
7513
7520
|
);
|
|
7514
7521
|
}
|
|
7515
7522
|
_updateProperty(e, t, s) {
|
|
@@ -7555,7 +7562,7 @@ class je extends pe {
|
|
|
7555
7562
|
_path2DSet = new ti();
|
|
7556
7563
|
setProperties(e) {
|
|
7557
7564
|
return super.setProperties(
|
|
7558
|
-
|
|
7565
|
+
F(e) ? void 0 : qs(e)
|
|
7559
7566
|
);
|
|
7560
7567
|
}
|
|
7561
7568
|
_updateProperty(e, t, s) {
|
|
@@ -7640,7 +7647,7 @@ class te extends pe {
|
|
|
7640
7647
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7641
7648
|
setProperties(e) {
|
|
7642
7649
|
return super.setProperties(
|
|
7643
|
-
|
|
7650
|
+
F(e) ? void 0 : Hs(e)
|
|
7644
7651
|
);
|
|
7645
7652
|
}
|
|
7646
7653
|
_updateProperty(e, t, s) {
|
|
@@ -7694,11 +7701,11 @@ class te extends pe {
|
|
|
7694
7701
|
}), this.parent.requestRedraw());
|
|
7695
7702
|
}
|
|
7696
7703
|
async _loadTexture(e, t) {
|
|
7697
|
-
return e.linearGradient || e.radialGradient ? new
|
|
7704
|
+
return e.linearGradient || e.radialGradient ? new kt(
|
|
7698
7705
|
e.linearGradient ?? e.radialGradient,
|
|
7699
7706
|
t.width,
|
|
7700
7707
|
t.height
|
|
7701
|
-
) :
|
|
7708
|
+
) : F(e.image) ? void 0 : (this.parent.tree?.log(`load image ${e.image}`), await z.texture.load(e.image));
|
|
7702
7709
|
}
|
|
7703
7710
|
setContent(e) {
|
|
7704
7711
|
this.content = Ys(e);
|
|
@@ -7726,7 +7733,7 @@ class te extends pe {
|
|
|
7726
7733
|
const i = s.getMeta();
|
|
7727
7734
|
if (i instanceof oi) {
|
|
7728
7735
|
const o = i.parent.index, a = i.parent.parent.index;
|
|
7729
|
-
if (s.style.fill && !
|
|
7736
|
+
if (s.style.fill && !F(s.style.fill))
|
|
7730
7737
|
if (typeof s.style.fill == "object") {
|
|
7731
7738
|
const n = s.style.fill, h = this._textureMap.get(`${a}.${o}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
7732
7739
|
if (n.enabled !== !1 && (h || n.color)) {
|
|
@@ -7747,7 +7754,7 @@ class te extends pe {
|
|
|
7747
7754
|
e.addPath(s), e.style = { ...s.style }, e.fill({
|
|
7748
7755
|
vertTransform: this._createVertTransform()
|
|
7749
7756
|
});
|
|
7750
|
-
if (s.style.stroke && !
|
|
7757
|
+
if (s.style.stroke && !F(s.style.stroke))
|
|
7751
7758
|
if (typeof s.style.stroke == "object") {
|
|
7752
7759
|
const n = s.style.stroke, h = this._textureMap.get(`${a}.${o}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
7753
7760
|
if (n.enabled !== !1 && (h || n.color) && (n.width === void 0 || n.width)) {
|
|
@@ -7977,7 +7984,7 @@ let st = class extends Pe {
|
|
|
7977
7984
|
this._overflowHidden = e === "hidden";
|
|
7978
7985
|
break;
|
|
7979
7986
|
case "pointerEvents":
|
|
7980
|
-
this._allowPointerEvents = !
|
|
7987
|
+
this._allowPointerEvents = !F(e);
|
|
7981
7988
|
break;
|
|
7982
7989
|
case "borderRadius":
|
|
7983
7990
|
default:
|
|
@@ -8289,14 +8296,14 @@ const E = {
|
|
|
8289
8296
|
// Justify.SpaceAround
|
|
8290
8297
|
"space-evenly": 5
|
|
8291
8298
|
// Justify.SpaceEvenly
|
|
8292
|
-
},
|
|
8299
|
+
}, Mr = {
|
|
8293
8300
|
visible: 0,
|
|
8294
8301
|
// Overflow.Visible
|
|
8295
8302
|
hidden: 1,
|
|
8296
8303
|
// Overflow.Hidden
|
|
8297
8304
|
scroll: 2
|
|
8298
8305
|
// Overflow.Scroll
|
|
8299
|
-
},
|
|
8306
|
+
}, kr = {
|
|
8300
8307
|
static: 0,
|
|
8301
8308
|
// PositionType.Static
|
|
8302
8309
|
relative: 1,
|
|
@@ -8450,7 +8457,7 @@ class lr {
|
|
|
8450
8457
|
break;
|
|
8451
8458
|
case "overflow":
|
|
8452
8459
|
this._node.setOverflow(
|
|
8453
|
-
t ?
|
|
8460
|
+
t ? Mr[t] : Mr.visible
|
|
8454
8461
|
);
|
|
8455
8462
|
break;
|
|
8456
8463
|
case "paddingTop":
|
|
@@ -8482,7 +8489,7 @@ class lr {
|
|
|
8482
8489
|
break;
|
|
8483
8490
|
case "position":
|
|
8484
8491
|
this._node.setPositionType(
|
|
8485
|
-
t ?
|
|
8492
|
+
t ? kr[t] : kr.static
|
|
8486
8493
|
);
|
|
8487
8494
|
break;
|
|
8488
8495
|
case "boxSizing":
|
|
@@ -8605,7 +8612,7 @@ let Be = class extends Ee {
|
|
|
8605
8612
|
if (this._complete = !1, r)
|
|
8606
8613
|
try {
|
|
8607
8614
|
this.setResource(
|
|
8608
|
-
this.gif || r?.includes(".gif") ? await
|
|
8615
|
+
this.gif || r?.includes(".gif") ? await z.gif.load(r) : await z.texture.load(r)
|
|
8609
8616
|
), this.requestRedraw(), this.emit("load");
|
|
8610
8617
|
} catch (e) {
|
|
8611
8618
|
console.warn(e), this.emit("error", e);
|
|
@@ -8707,7 +8714,7 @@ let Wt = class extends Rs {
|
|
|
8707
8714
|
}
|
|
8708
8715
|
}
|
|
8709
8716
|
async _load() {
|
|
8710
|
-
this.animation = await
|
|
8717
|
+
this.animation = await z.lottie.load(this.src, this.texture.source), this.duration = this.animation.getDuration(!1) * 1e3, this.texture.requestUpload(), this.requestRedraw();
|
|
8711
8718
|
}
|
|
8712
8719
|
_process(r) {
|
|
8713
8720
|
this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpload(), this.requestRedraw(), super._process(r);
|
|
@@ -8750,7 +8757,7 @@ class dn extends Ee {
|
|
|
8750
8757
|
un([
|
|
8751
8758
|
c({ fallback: 6 })
|
|
8752
8759
|
], dn.prototype, "handleSize");
|
|
8753
|
-
var fn = Object.defineProperty, pn = Object.getOwnPropertyDescriptor,
|
|
8760
|
+
var fn = Object.defineProperty, pn = Object.getOwnPropertyDescriptor, Ms = (r, e, t, s) => {
|
|
8754
8761
|
for (var i = s > 1 ? void 0 : s ? pn(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
8755
8762
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
8756
8763
|
return s && i && fn(e, t, i), i;
|
|
@@ -8774,7 +8781,7 @@ let jt = class extends Rs {
|
|
|
8774
8781
|
return this._wait;
|
|
8775
8782
|
}
|
|
8776
8783
|
async _load(r) {
|
|
8777
|
-
this.texture = await
|
|
8784
|
+
this.texture = await z.video.load(r), (!this.style.width || !this.style.height) && (this.style.width = this.texture.width, this.style.height = this.texture.height), this.requestRedraw();
|
|
8778
8785
|
}
|
|
8779
8786
|
_updateVideoCurrentTime() {
|
|
8780
8787
|
let r = this._currentTime;
|
|
@@ -8790,10 +8797,10 @@ let jt = class extends Rs {
|
|
|
8790
8797
|
this._updateVideoCurrentTime(), super._process(r);
|
|
8791
8798
|
}
|
|
8792
8799
|
};
|
|
8793
|
-
|
|
8800
|
+
Ms([
|
|
8794
8801
|
c({ fallback: "" })
|
|
8795
8802
|
], jt.prototype, "src", 2);
|
|
8796
|
-
jt =
|
|
8803
|
+
jt = Ms([
|
|
8797
8804
|
v("Video2D")
|
|
8798
8805
|
], jt);
|
|
8799
8806
|
var _n = Object.defineProperty, mn = Object.getOwnPropertyDescriptor, Dt = (r, e, t, s) => {
|
|
@@ -8806,7 +8813,7 @@ function _t(r, e, t, s) {
|
|
|
8806
8813
|
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, u = 3 * e, d = (m) => (3 * o * m + 2 * a) * m + n, f = (m) => ((o * m + a) * m + n) * m, _ = (m) => ((h * m + l) * m + u) * m;
|
|
8807
8814
|
function p(m) {
|
|
8808
8815
|
let g = m, w, P;
|
|
8809
|
-
for (let
|
|
8816
|
+
for (let L = 0; L < 8; L++) {
|
|
8810
8817
|
if (P = f(g) - m, Math.abs(P) < 1e-6)
|
|
8811
8818
|
return g;
|
|
8812
8819
|
if (w = d(g), Math.abs(w) < 1e-6)
|
|
@@ -9193,17 +9200,17 @@ class Et extends fe {
|
|
|
9193
9200
|
return;
|
|
9194
9201
|
const { start: t = 0, end: s = 0 } = e;
|
|
9195
9202
|
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 - Et.PADDING), this._end = Math.min(this._end + Et.PADDING, this._duration), this._source.onloadedmetadata = () => {
|
|
9196
|
-
this._source && (this._source.currentTime = t, this._source.onloadedmetadata = null, this.emit("progress", t, this._duration),
|
|
9203
|
+
this._source && (this._source.currentTime = t, this._source.onloadedmetadata = null, this.emit("progress", t, this._duration), k.on(this._onUpdate));
|
|
9197
9204
|
}, this._source.onended = this._onComplete.bind(this), this._source.play(), this.emit("start");
|
|
9198
9205
|
}
|
|
9199
9206
|
_onUpdate = () => {
|
|
9200
9207
|
this._source && (this.emit("progress", this.progress, this._duration), this._source.currentTime >= this._end && !this._source.loop && this._onComplete());
|
|
9201
9208
|
};
|
|
9202
9209
|
_onComplete() {
|
|
9203
|
-
|
|
9210
|
+
k.off(this._onUpdate), this._stop(), this.emit("progress", 1, this._duration), this.emit("end", this);
|
|
9204
9211
|
}
|
|
9205
9212
|
destroy() {
|
|
9206
|
-
|
|
9213
|
+
k.off(this._onUpdate), super.destroy();
|
|
9207
9214
|
const e = this._source;
|
|
9208
9215
|
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);
|
|
9209
9216
|
}
|
|
@@ -9238,7 +9245,7 @@ class wn {
|
|
|
9238
9245
|
return new Et();
|
|
9239
9246
|
}
|
|
9240
9247
|
}
|
|
9241
|
-
class
|
|
9248
|
+
class ks extends fe {
|
|
9242
9249
|
constructor(e, t) {
|
|
9243
9250
|
super(), this._input = e, this._output = t;
|
|
9244
9251
|
}
|
|
@@ -9259,7 +9266,7 @@ class Ms extends fe {
|
|
|
9259
9266
|
return this._input;
|
|
9260
9267
|
}
|
|
9261
9268
|
}
|
|
9262
|
-
class
|
|
9269
|
+
class Ml {
|
|
9263
9270
|
constructor(e, t = null) {
|
|
9264
9271
|
this.destination = e, this.source = t;
|
|
9265
9272
|
}
|
|
@@ -9288,7 +9295,7 @@ function Tn(r, e, t) {
|
|
|
9288
9295
|
} else
|
|
9289
9296
|
throw new Error("Failed to createOfflineAudioContext");
|
|
9290
9297
|
}
|
|
9291
|
-
class ye extends
|
|
9298
|
+
class ye extends ks {
|
|
9292
9299
|
/** Singleton */
|
|
9293
9300
|
static _instance;
|
|
9294
9301
|
static get instance() {
|
|
@@ -9529,13 +9536,13 @@ class En extends fe {
|
|
|
9529
9536
|
};
|
|
9530
9537
|
_updateListener = () => this._update();
|
|
9531
9538
|
_enableTicker(e) {
|
|
9532
|
-
|
|
9539
|
+
k.off(this._updateListener), e && k.on(this._updateListener);
|
|
9533
9540
|
}
|
|
9534
9541
|
destroy() {
|
|
9535
9542
|
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;
|
|
9536
9543
|
}
|
|
9537
9544
|
}
|
|
9538
|
-
class Sn extends
|
|
9545
|
+
class Sn extends ks {
|
|
9539
9546
|
constructor(e) {
|
|
9540
9547
|
const t = ye.audioContext, s = t.createBufferSource(), i = t.createGain(), o = t.createAnalyser();
|
|
9541
9548
|
s.connect(o), o.connect(i), i.connect(ye.instance.destination), super(o, i), this.parent = e, this._sourceNode = s, this.gain = i, this.analyser = o;
|
|
@@ -9589,7 +9596,7 @@ var Cn = Object.defineProperty, An = Object.getOwnPropertyDescriptor, Rn = (r, e
|
|
|
9589
9596
|
for (var i = s > 1 ? void 0 : s ? An(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
9590
9597
|
(a = r[o]) && (i = a(i) || i);
|
|
9591
9598
|
return i;
|
|
9592
|
-
},
|
|
9599
|
+
}, Mn = (r, e, t) => Rn(r, e + "", t);
|
|
9593
9600
|
let xe = class extends W {
|
|
9594
9601
|
_sounds = [];
|
|
9595
9602
|
/** PlatformAudio */
|
|
@@ -9732,17 +9739,17 @@ let xe = class extends W {
|
|
|
9732
9739
|
}, 100);
|
|
9733
9740
|
}
|
|
9734
9741
|
};
|
|
9735
|
-
|
|
9742
|
+
Mn(xe, "_soundPool", []);
|
|
9736
9743
|
xe = On([
|
|
9737
9744
|
v("Audio")
|
|
9738
9745
|
], xe);
|
|
9739
|
-
class
|
|
9746
|
+
class kl extends Pe {
|
|
9740
9747
|
//
|
|
9741
9748
|
}
|
|
9742
|
-
var
|
|
9749
|
+
var kn = Object.defineProperty, Un = Object.getOwnPropertyDescriptor, It = (r, e, t, s) => {
|
|
9743
9750
|
for (var i = s > 1 ? void 0 : s ? Un(e, t) : e, o = r.length - 1, a; o >= 0; o--)
|
|
9744
9751
|
(a = r[o]) && (i = (s ? a(e, t, i) : a(i)) || i);
|
|
9745
|
-
return s && i &&
|
|
9752
|
+
return s && i && kn(e, t, i), i;
|
|
9746
9753
|
};
|
|
9747
9754
|
let ot = class extends Ee {
|
|
9748
9755
|
_audioBuffer;
|
|
@@ -9826,7 +9833,7 @@ var Dn = Object.defineProperty, In = Object.getOwnPropertyDescriptor, Bn = (r, e
|
|
|
9826
9833
|
(a = r[o]) && (i = a(i) || i);
|
|
9827
9834
|
return i;
|
|
9828
9835
|
}, Nn = (r, e, t) => Bn(r, e + "", t);
|
|
9829
|
-
let St = class extends
|
|
9836
|
+
let St = class extends ke {
|
|
9830
9837
|
blur = 10;
|
|
9831
9838
|
quality = 10;
|
|
9832
9839
|
apply(r, e) {
|
|
@@ -9891,7 +9898,7 @@ var Ln = Object.defineProperty, Fn = Object.getOwnPropertyDescriptor, $n = (r, e
|
|
|
9891
9898
|
(a = r[o]) && (i = a(i) || i);
|
|
9892
9899
|
return i;
|
|
9893
9900
|
}, Gn = (r, e, t) => $n(r, e + "", t);
|
|
9894
|
-
let Ct = class extends
|
|
9901
|
+
let Ct = class extends ke {
|
|
9895
9902
|
apply(r) {
|
|
9896
9903
|
b.draw(r, Ct.material, {
|
|
9897
9904
|
previous: 0,
|
|
@@ -9937,7 +9944,7 @@ var Wn = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, qn = (r, e
|
|
|
9937
9944
|
(a = r[o]) && (i = a(i) || i);
|
|
9938
9945
|
return i;
|
|
9939
9946
|
}, Hn = (r, e, t) => qn(r, e + "", t);
|
|
9940
|
-
let at = class extends
|
|
9947
|
+
let at = class extends ke {
|
|
9941
9948
|
blur = 100;
|
|
9942
9949
|
gradientBlur = 600;
|
|
9943
9950
|
apply(r, e) {
|
|
@@ -10022,7 +10029,7 @@ var Yn = Object.defineProperty, Kn = Object.getOwnPropertyDescriptor, Zn = (r, e
|
|
|
10022
10029
|
(a = r[o]) && (i = a(i) || i);
|
|
10023
10030
|
return i;
|
|
10024
10031
|
}, Qn = (r, e, t) => Zn(r, e + "", t);
|
|
10025
|
-
let At = class extends
|
|
10032
|
+
let At = class extends ke {
|
|
10026
10033
|
radius;
|
|
10027
10034
|
angle = 4;
|
|
10028
10035
|
padding = 20;
|
|
@@ -10100,7 +10107,7 @@ class el extends Se {
|
|
|
10100
10107
|
install(e) {
|
|
10101
10108
|
const t = async (s) => {
|
|
10102
10109
|
const { decodeFrames: i } = await import("modern-gif");
|
|
10103
|
-
return await
|
|
10110
|
+
return await s.arrayBuffer().then((o) => i(
|
|
10104
10111
|
o,
|
|
10105
10112
|
e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0
|
|
10106
10113
|
)).then((o) => new Vt(
|
|
@@ -10110,7 +10117,7 @@ class el extends Se {
|
|
|
10110
10117
|
}))
|
|
10111
10118
|
));
|
|
10112
10119
|
};
|
|
10113
|
-
return this.load = (s) => e.loadBy(s
|
|
10120
|
+
return this.load = (s) => typeof s == "string" ? e.loadBy(s).then(t) : t(s), [
|
|
10114
10121
|
"image/gif"
|
|
10115
10122
|
].forEach((s) => {
|
|
10116
10123
|
e.register(s, t);
|
|
@@ -10119,9 +10126,9 @@ class el extends Se {
|
|
|
10119
10126
|
}
|
|
10120
10127
|
class tl extends Se {
|
|
10121
10128
|
install(e) {
|
|
10122
|
-
const t = (s) =>
|
|
10123
|
-
return this.load = (s) => e.loadBy(s
|
|
10124
|
-
"json"
|
|
10129
|
+
const t = async (s) => JSON.parse(await s.text());
|
|
10130
|
+
return this.load = (s) => typeof s == "string" ? e.loadBy(s).then(t) : t(s), [
|
|
10131
|
+
"application/json"
|
|
10125
10132
|
].forEach((s) => {
|
|
10126
10133
|
e.register(s, t);
|
|
10127
10134
|
}), e.json = this, this;
|
|
@@ -10129,37 +10136,31 @@ class tl extends Se {
|
|
|
10129
10136
|
}
|
|
10130
10137
|
class rl extends Se {
|
|
10131
10138
|
install(e) {
|
|
10132
|
-
|
|
10139
|
+
return this.load = async (t, s) => (await import("lottie-web").then((o) => o.default)).loadAnimation({
|
|
10133
10140
|
container: null,
|
|
10134
10141
|
renderer: "canvas",
|
|
10135
10142
|
rendererSettings: {
|
|
10136
|
-
context:
|
|
10143
|
+
context: s.getContext("2d")
|
|
10137
10144
|
},
|
|
10138
10145
|
loop: !1,
|
|
10139
10146
|
autoplay: !1,
|
|
10140
10147
|
animationData: await e.loadBy(
|
|
10141
|
-
|
|
10142
|
-
() => e.fetch(
|
|
10148
|
+
t,
|
|
10149
|
+
() => e.fetch(t).then((o) => o.json())
|
|
10143
10150
|
)
|
|
10144
|
-
});
|
|
10145
|
-
return this.load = (s, i) => t(s, i), [
|
|
10146
|
-
"lottie"
|
|
10147
|
-
].forEach((s) => {
|
|
10148
|
-
e.register(s, t);
|
|
10149
10151
|
}), e.lottie = this, this;
|
|
10150
10152
|
}
|
|
10151
10153
|
}
|
|
10152
10154
|
class sl extends Se {
|
|
10153
10155
|
install(e) {
|
|
10154
|
-
const t = async (s) =>
|
|
10155
|
-
return this.load = (s) => e.loadBy(s
|
|
10156
|
+
const t = async (s) => s.text();
|
|
10157
|
+
return this.load = (s) => typeof s == "string" ? e.loadBy(s).then(t) : t(s), e.text = this, this;
|
|
10156
10158
|
}
|
|
10157
10159
|
}
|
|
10158
10160
|
class il extends Se {
|
|
10159
10161
|
install(e) {
|
|
10160
10162
|
const t = (s) => e.fetchImageBitmap(s, { premultiplyAlpha: "premultiply" }).then((i) => new T(i));
|
|
10161
|
-
return this.load = (s) => e.loadBy(s
|
|
10162
|
-
"image/gif",
|
|
10163
|
+
return this.load = (s) => typeof s == "string" ? e.loadBy(s).then(t) : t(s), [
|
|
10163
10164
|
"image/jpeg",
|
|
10164
10165
|
"image/png",
|
|
10165
10166
|
"image/tiff",
|
|
@@ -10176,36 +10177,15 @@ class il extends Se {
|
|
|
10176
10177
|
}
|
|
10177
10178
|
class ol extends Se {
|
|
10178
10179
|
install(e) {
|
|
10179
|
-
|
|
10180
|
-
return this.load = (s) => e.loadBy(s, () => t(s)), [
|
|
10181
|
-
"video/3gpp",
|
|
10182
|
-
"video/mpeg",
|
|
10183
|
-
"video/quicktime",
|
|
10184
|
-
"video/x-flv",
|
|
10185
|
-
"video/x-mng",
|
|
10186
|
-
"video/x-ms-asf",
|
|
10187
|
-
"video/x-ms-wmv",
|
|
10188
|
-
"video/x-msvideo",
|
|
10189
|
-
"video/mp4"
|
|
10190
|
-
].forEach((s) => {
|
|
10191
|
-
e.register(s, t);
|
|
10192
|
-
}), e.video = this, this;
|
|
10180
|
+
return this.load = (t) => new _o(t).load(), e.video = this, this;
|
|
10193
10181
|
}
|
|
10194
10182
|
}
|
|
10195
10183
|
const al = Object.entries({
|
|
10196
|
-
"
|
|
10197
|
-
"
|
|
10198
|
-
"
|
|
10184
|
+
"font/woff": ["woff"],
|
|
10185
|
+
"font/ttf": ["ttf"],
|
|
10186
|
+
"font/otf": ["otf"],
|
|
10199
10187
|
"image/gif": ["gif"],
|
|
10200
10188
|
"image/jpeg": ["jpeg", "jpg"],
|
|
10201
|
-
"application/x-javascript": ["js"],
|
|
10202
|
-
"application/atom+xml": ["atom"],
|
|
10203
|
-
"application/rss+xml": ["rss"],
|
|
10204
|
-
"text/mathml": ["mml"],
|
|
10205
|
-
"text/plain": ["txt"],
|
|
10206
|
-
"text/vnd.sun.j2me.app-descriptor": ["jad"],
|
|
10207
|
-
"text/vnd.wap.wml": ["wml"],
|
|
10208
|
-
"text/x-component": ["htc"],
|
|
10209
10189
|
"image/png": ["png"],
|
|
10210
10190
|
"image/tiff": ["tif", "tiff"],
|
|
10211
10191
|
"image/vnd.wap.wbmp": ["wbmp"],
|
|
@@ -10214,55 +10194,14 @@ const al = Object.entries({
|
|
|
10214
10194
|
"image/x-ms-bmp": ["bmp"],
|
|
10215
10195
|
"image/svg+xml": ["svg"],
|
|
10216
10196
|
"image/webp": ["webp"],
|
|
10217
|
-
"application/
|
|
10218
|
-
"application/mac-binhex40": ["hqx"],
|
|
10219
|
-
"application/msword": ["doc"],
|
|
10220
|
-
"application/pdf": ["pdf"],
|
|
10221
|
-
"application/postscript": ["ps", "eps", "ai"],
|
|
10222
|
-
"application/rtf": ["rtf"],
|
|
10223
|
-
"application/vnd.ms-excel": ["xls"],
|
|
10224
|
-
"application/vnd.ms-powerpoint": ["ppt"],
|
|
10225
|
-
"application/vnd.wap.wmlc": ["wmlc"],
|
|
10226
|
-
"application/vnd.google-earth.kml+xml": ["kml"],
|
|
10227
|
-
"application/vnd.google-earth.kmz": ["kmz"],
|
|
10228
|
-
"application/x-7z-compressed": ["7z"],
|
|
10229
|
-
"application/x-cocoa": ["cco"],
|
|
10230
|
-
"application/x-java-archive-diff": ["jardiff"],
|
|
10231
|
-
"application/x-java-jnlp-file": ["jnlp"],
|
|
10232
|
-
"application/x-makeself": ["run"],
|
|
10233
|
-
"application/x-perl": ["pl", "pm"],
|
|
10234
|
-
"application/x-pilot": ["prc", "pdb"],
|
|
10235
|
-
"application/x-rar-compressed": ["rar"],
|
|
10236
|
-
"application/x-redhat-package-manager": ["rpm"],
|
|
10237
|
-
"application/x-sea": ["sea"],
|
|
10238
|
-
"application/x-shockwave-flash": ["swf"],
|
|
10239
|
-
"application/x-stuffit": ["sit"],
|
|
10240
|
-
"application/x-tcl": ["tcl", "tk"],
|
|
10241
|
-
"application/x-x509-ca-cert": ["der", "pem", "crt"],
|
|
10242
|
-
"application/x-xpinstall": ["xpi"],
|
|
10243
|
-
"application/xhtml+xml": ["xhtml"],
|
|
10244
|
-
"application/zip": ["zip"],
|
|
10245
|
-
"application/octet-stream": ["bin", "exe", "dll", "deb", "dmg", "eot", "iso", "img", "msi", "msp", "msm"],
|
|
10246
|
-
"audio/midi": ["mid", "midi", "kar"],
|
|
10247
|
-
"audio/mpeg": ["mp3"],
|
|
10248
|
-
"audio/ogg": ["ogg"],
|
|
10249
|
-
"audio/x-realaudio": ["ra"],
|
|
10250
|
-
"video/3gpp": ["3gpp", "3gp"],
|
|
10251
|
-
"video/mpeg": ["mpeg", "mpg"],
|
|
10252
|
-
"video/quicktime": ["mov"],
|
|
10253
|
-
"video/x-flv": ["flv"],
|
|
10254
|
-
"video/x-mng": ["mng"],
|
|
10255
|
-
"video/x-ms-asf": ["asx", "asf"],
|
|
10256
|
-
"video/x-ms-wmv": ["wmv"],
|
|
10257
|
-
"video/x-msvideo": ["avi"],
|
|
10258
|
-
"video/mp4": ["m4v", "mp4"]
|
|
10197
|
+
"application/json": ["json"]
|
|
10259
10198
|
});
|
|
10260
10199
|
function nl(r) {
|
|
10261
10200
|
for (const [e, t] of al)
|
|
10262
10201
|
if (t.includes(r))
|
|
10263
10202
|
return e;
|
|
10264
10203
|
}
|
|
10265
|
-
|
|
10204
|
+
function ll(r) {
|
|
10266
10205
|
let e;
|
|
10267
10206
|
if (r.startsWith("data:"))
|
|
10268
10207
|
e = r.match(/^data:(.+?);/)?.[1];
|
|
@@ -10270,11 +10209,11 @@ async function ll(r) {
|
|
|
10270
10209
|
const t = r.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
10271
10210
|
t && (e = nl(t));
|
|
10272
10211
|
}
|
|
10273
|
-
return e
|
|
10212
|
+
return e;
|
|
10274
10213
|
}
|
|
10275
10214
|
const vt = "WeakRef" in globalThis;
|
|
10276
10215
|
class hl extends fe {
|
|
10277
|
-
defaultHandler = (e) =>
|
|
10216
|
+
defaultHandler = (e) => e;
|
|
10278
10217
|
_handlers = /* @__PURE__ */ new Map();
|
|
10279
10218
|
_handleing = /* @__PURE__ */ new Map();
|
|
10280
10219
|
_handled = /* @__PURE__ */ new Map();
|
|
@@ -10283,7 +10222,7 @@ class hl extends fe {
|
|
|
10283
10222
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
10284
10223
|
}) : void 0;
|
|
10285
10224
|
constructor() {
|
|
10286
|
-
super(), vt ||
|
|
10225
|
+
super(), vt || k.on(this.gc.bind(this), { sort: 2 });
|
|
10287
10226
|
}
|
|
10288
10227
|
use(e) {
|
|
10289
10228
|
return e.install(this), this;
|
|
@@ -10305,26 +10244,30 @@ class hl extends fe {
|
|
|
10305
10244
|
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(s.outerHTML)}`;
|
|
10306
10245
|
}
|
|
10307
10246
|
async fetchImageBitmap(e, t) {
|
|
10308
|
-
|
|
10309
|
-
this.
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
i
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10247
|
+
if (e instanceof Blob || typeof e == "string" && e.startsWith("http")) {
|
|
10248
|
+
const s = e instanceof Blob ? e : await this.fetch(e).then((i) => i.blob());
|
|
10249
|
+
return s.type === "image/svg+xml" ? s.text().then((i) => this.fetchImageBitmap(
|
|
10250
|
+
this._fixSVG(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`),
|
|
10251
|
+
t
|
|
10252
|
+
)) : createImageBitmap(s, t);
|
|
10253
|
+
} else
|
|
10254
|
+
return e.startsWith("data:image/svg+xml;") && (e = this._fixSVG(e)), new Promise((s) => {
|
|
10255
|
+
const i = new Image();
|
|
10256
|
+
i.onerror = () => {
|
|
10257
|
+
console.warn(`Failed load image error: ${e}`), s(i);
|
|
10258
|
+
}, i.onload = () => {
|
|
10259
|
+
i.decode().finally(() => {
|
|
10260
|
+
s(i);
|
|
10261
|
+
});
|
|
10262
|
+
}, i.src = e;
|
|
10263
|
+
}).then((s) => {
|
|
10264
|
+
if (s.complete && s.naturalWidth && s.naturalHeight)
|
|
10265
|
+
return createImageBitmap(s, t);
|
|
10266
|
+
{
|
|
10267
|
+
const i = document.createElement("canvas");
|
|
10268
|
+
return i.width = 1, i.height = 1, createImageBitmap(i);
|
|
10269
|
+
}
|
|
10270
|
+
});
|
|
10328
10271
|
}
|
|
10329
10272
|
get(e) {
|
|
10330
10273
|
let t = this._handled.get(e);
|
|
@@ -10334,7 +10277,7 @@ class hl extends fe {
|
|
|
10334
10277
|
let s = t;
|
|
10335
10278
|
vt && typeof t == "object" && (this._gc.register(t, e), s = new WeakRef(t)), this._handled.set(e, s);
|
|
10336
10279
|
}
|
|
10337
|
-
async loadBy(e, t) {
|
|
10280
|
+
async loadBy(e, t = () => this.fetch(e).then((s) => s.blob())) {
|
|
10338
10281
|
const s = this.get(e) ?? this._handleing.get(e);
|
|
10339
10282
|
if (s)
|
|
10340
10283
|
return s;
|
|
@@ -10344,10 +10287,9 @@ class hl extends fe {
|
|
|
10344
10287
|
return this._handleing.set(e, i), i;
|
|
10345
10288
|
}
|
|
10346
10289
|
async load(e, t) {
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
});
|
|
10290
|
+
const s = await this.loadBy(e);
|
|
10291
|
+
let i = ll(e);
|
|
10292
|
+
return i === void 0 && (i = s.type?.split(";")[0] ?? void 0), ((i ? this._handlers.get(i) : void 0) ?? this.defaultHandler)(s, t);
|
|
10351
10293
|
}
|
|
10352
10294
|
async waitUntilLoad() {
|
|
10353
10295
|
await Promise.all(
|
|
@@ -10363,7 +10305,7 @@ class hl extends fe {
|
|
|
10363
10305
|
}), this._handled.clear();
|
|
10364
10306
|
}
|
|
10365
10307
|
}
|
|
10366
|
-
const
|
|
10308
|
+
const z = new hl().use(new to()).use(new el()).use(new tl()).use(new rl()).use(new sl()).use(new il()).use(new ol());
|
|
10367
10309
|
var cl = Object.defineProperty, cr = (r, e, t, s) => {
|
|
10368
10310
|
for (var i = void 0, o = r.length - 1, a; o >= 0; o--)
|
|
10369
10311
|
(a = r[o]) && (i = a(e, t, i) || i);
|
|
@@ -10461,10 +10403,10 @@ class Bt extends Ae {
|
|
|
10461
10403
|
return Lr();
|
|
10462
10404
|
}
|
|
10463
10405
|
async waitUntilLoad() {
|
|
10464
|
-
await
|
|
10406
|
+
await z.waitUntilLoad(), await this.nextTick();
|
|
10465
10407
|
}
|
|
10466
10408
|
async waitAndRender(e = 0) {
|
|
10467
|
-
await
|
|
10409
|
+
await z.waitUntilLoad(), this._process(e), await this.nextTick(), this._render(this.renderer);
|
|
10468
10410
|
}
|
|
10469
10411
|
render(e = 0) {
|
|
10470
10412
|
this._process(e), this._render(this.renderer);
|
|
@@ -10553,7 +10495,7 @@ async function dl(r) {
|
|
|
10553
10495
|
height: 1,
|
|
10554
10496
|
preserveDrawingBuffer: !0
|
|
10555
10497
|
}), 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) => {
|
|
10556
|
-
l instanceof
|
|
10498
|
+
l instanceof M ? (l.parent = void 0, I.root.appendChild(l)) : I.root.appendChild(M.parse(l));
|
|
10557
10499
|
}), await n?.(I), await I.waitAndRender(), a.length && await new Promise((l) => {
|
|
10558
10500
|
let u = 0;
|
|
10559
10501
|
const d = a.length, f = a[d - 1];
|
|
@@ -10580,9 +10522,9 @@ export {
|
|
|
10580
10522
|
it as Animation,
|
|
10581
10523
|
hl as Assets,
|
|
10582
10524
|
xe as Audio,
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10525
|
+
ks as AudioPipeline,
|
|
10526
|
+
Ml as AudioProcessor,
|
|
10527
|
+
kl as AudioSpectrum,
|
|
10586
10528
|
ot as AudioWaveform,
|
|
10587
10529
|
st as BaseElement2D,
|
|
10588
10530
|
Ss as BaseElement2DBackground,
|
|
@@ -10598,7 +10540,7 @@ export {
|
|
|
10598
10540
|
we as CanvasItem,
|
|
10599
10541
|
Qt as CanvasTexture,
|
|
10600
10542
|
J as Color,
|
|
10601
|
-
|
|
10543
|
+
V as ColorAdjustEffect,
|
|
10602
10544
|
Je as ColorFilterEffect,
|
|
10603
10545
|
Yr as ColorMatrix,
|
|
10604
10546
|
Ue as ColorOverlayEffect,
|
|
@@ -10623,9 +10565,9 @@ export {
|
|
|
10623
10565
|
ae as GaussianBlurEffect,
|
|
10624
10566
|
Jt as Geometry,
|
|
10625
10567
|
el as GifLoader,
|
|
10626
|
-
|
|
10568
|
+
N as GlitchEffect,
|
|
10627
10569
|
X as GodrayEffect,
|
|
10628
|
-
|
|
10570
|
+
kt as GradientTexture,
|
|
10629
10571
|
wn as HTMLAudio,
|
|
10630
10572
|
hr as HTMLAudioContext,
|
|
10631
10573
|
Et as HTMLSound,
|
|
@@ -10635,7 +10577,7 @@ export {
|
|
|
10635
10577
|
Rl as ImageTexture,
|
|
10636
10578
|
nt as IndexBuffer,
|
|
10637
10579
|
Oi as Input,
|
|
10638
|
-
|
|
10580
|
+
Mt as InputEvent,
|
|
10639
10581
|
tl as JsonLoader,
|
|
10640
10582
|
et as KawaseBlurEffect,
|
|
10641
10583
|
St as KawaseTransition,
|
|
@@ -10653,7 +10595,7 @@ export {
|
|
|
10653
10595
|
Ui as Matrix4,
|
|
10654
10596
|
vo as Meta,
|
|
10655
10597
|
Hr as MouseInputEvent,
|
|
10656
|
-
|
|
10598
|
+
M as Node,
|
|
10657
10599
|
Pe as Node2D,
|
|
10658
10600
|
U as OutlineEffect,
|
|
10659
10601
|
Yt as PI,
|
|
@@ -10667,7 +10609,7 @@ export {
|
|
|
10667
10609
|
wl as RAD_TO_DEG,
|
|
10668
10610
|
Xr as RawWeakMap,
|
|
10669
10611
|
be as Rect2,
|
|
10670
|
-
|
|
10612
|
+
ki as RefCounted,
|
|
10671
10613
|
Zt as Renderer,
|
|
10672
10614
|
_e as Resource,
|
|
10673
10615
|
Vr as SUPPORTS_AUDIO_CONTEXT,
|
|
@@ -10689,13 +10631,13 @@ export {
|
|
|
10689
10631
|
T as Texture2D,
|
|
10690
10632
|
il as TextureLoader,
|
|
10691
10633
|
Rs as TextureRect2D,
|
|
10692
|
-
|
|
10634
|
+
k as Ticker,
|
|
10693
10635
|
at as TiltShiftTransition,
|
|
10694
10636
|
oe as Timeline,
|
|
10695
10637
|
W as TimelineNode,
|
|
10696
10638
|
O as Transform2D,
|
|
10697
10639
|
dn as TransformRect2D,
|
|
10698
|
-
|
|
10640
|
+
ke as Transition,
|
|
10699
10641
|
At as TwistTransition,
|
|
10700
10642
|
Cl as UvGeometry,
|
|
10701
10643
|
xt as UvMaterial,
|
|
@@ -10703,7 +10645,7 @@ export {
|
|
|
10703
10645
|
C as Vector2,
|
|
10704
10646
|
El as Vector3,
|
|
10705
10647
|
Ii as Vector4,
|
|
10706
|
-
|
|
10648
|
+
$ as VertexAttribute,
|
|
10707
10649
|
ue as VertexBuffer,
|
|
10708
10650
|
jt as Video2D,
|
|
10709
10651
|
ol as VideoLoader,
|
|
@@ -10721,7 +10663,7 @@ export {
|
|
|
10721
10663
|
ji as WebGLProgramModule,
|
|
10722
10664
|
eo as WebGLRenderer,
|
|
10723
10665
|
Hi as WebGLScissorModule,
|
|
10724
|
-
|
|
10666
|
+
Me as WebGLState,
|
|
10725
10667
|
Fi as WebGLStateModule,
|
|
10726
10668
|
Yi as WebGLStencilModule,
|
|
10727
10669
|
Zi as WebGLTextureModule,
|
|
@@ -10732,7 +10674,7 @@ export {
|
|
|
10732
10674
|
wt as Window,
|
|
10733
10675
|
de as ZoomBlurEffect,
|
|
10734
10676
|
Re as alignMap,
|
|
10735
|
-
|
|
10677
|
+
z as assets,
|
|
10736
10678
|
Ur as boxSizingMap,
|
|
10737
10679
|
ie as clamp,
|
|
10738
10680
|
Ca as clampFrag,
|
|
@@ -10770,13 +10712,13 @@ export {
|
|
|
10770
10712
|
Li as mapWebGLBlendModes,
|
|
10771
10713
|
yr as nextPow2,
|
|
10772
10714
|
Lr as nextTick,
|
|
10773
|
-
|
|
10715
|
+
Mr as overflowMap,
|
|
10774
10716
|
Ol as parseCSSFilter,
|
|
10775
10717
|
Vo as parseCSSTransform,
|
|
10776
10718
|
Go as parseCSSTransformOrigin,
|
|
10777
10719
|
Rt as parseCssFunctions,
|
|
10778
10720
|
mt as parseCssProperty,
|
|
10779
|
-
|
|
10721
|
+
kr as positionTypeMap,
|
|
10780
10722
|
Ul as render,
|
|
10781
10723
|
Ft as timingFunctions,
|
|
10782
10724
|
ni as uid
|