modern-canvas 0.23.9 → 0.23.11
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
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Observable as e, RawWeakMap as t, Reactivable as n, clearUndef as r, defineProperty as i, getDefaultLayoutStyle as a, getDefaultStyle as o, getDefaultTextStyle as s, idGenerator as c, isColorFillObject as l, isGradient as u, isNone as d, normalizeBackground as f, normalizeChart as p, normalizeConnection as m, normalizeFill as h, normalizeForeground as g, normalizeOutline as ee, normalizeShadow as te, normalizeShape as ne, normalizeTable as re, normalizeText as ie, normalizeTextContent as ae, parseColor as oe, property as _, stringifyFilter as se } from "modern-idoc";
|
|
2
|
-
import { BoundingBox as ce, Path2D as le, Path2DSet as ue, Transform2D as v, Vector2 as y, svgToDom as
|
|
3
|
-
import { extend as
|
|
4
|
-
import
|
|
5
|
-
import { fonts as
|
|
6
|
-
import { Character as
|
|
2
|
+
import { BoundingBox as ce, Path2D as le, Path2DSet as ue, PathMeasure as de, Transform2D as v, Vector2 as y, svgToDom as fe, svgToPath2DSet as pe } from "modern-path2d";
|
|
3
|
+
import { extend as me } from "colord";
|
|
4
|
+
import he from "colord/plugins/names";
|
|
5
|
+
import { fonts as ge } from "modern-font";
|
|
6
|
+
import { Character as _e, Text as ve } from "modern-text";
|
|
7
7
|
//#region src/core/decorators/customNode.ts
|
|
8
|
-
var
|
|
8
|
+
var ye = /* @__PURE__ */ new Map();
|
|
9
9
|
function b(e, t) {
|
|
10
10
|
return function(n) {
|
|
11
11
|
Object.defineProperty(n.prototype, "is", {
|
|
@@ -14,13 +14,13 @@ function b(e, t) {
|
|
|
14
14
|
configurable: !0
|
|
15
15
|
}), t && Object.keys(t).forEach((e) => {
|
|
16
16
|
i(n, e, { fallback: t[e] });
|
|
17
|
-
}),
|
|
17
|
+
}), ye.set(e, n);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/core/global/createNode.ts
|
|
22
|
-
function
|
|
23
|
-
let n =
|
|
22
|
+
function be(e = "node", t = {}) {
|
|
23
|
+
let n = ye.get(e);
|
|
24
24
|
if (!n) throw Error(`Failed to createNode, tag: ${e}`);
|
|
25
25
|
return new n().setProperties(t);
|
|
26
26
|
}
|
|
@@ -86,7 +86,7 @@ var x = class {
|
|
|
86
86
|
x.start();
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/core/global/nextTick.ts
|
|
89
|
-
async function
|
|
89
|
+
async function xe(e) {
|
|
90
90
|
return new Promise((t) => {
|
|
91
91
|
x.on(() => {
|
|
92
92
|
e?.(), t();
|
|
@@ -98,14 +98,14 @@ async function be(e) {
|
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/core/shared/utils.ts
|
|
101
|
-
var
|
|
102
|
-
function
|
|
101
|
+
var Se = Math.PI, Ce = Se * 2;
|
|
102
|
+
function we(e) {
|
|
103
103
|
return !(e & e - 1) && !!e;
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/core/shared/css.ts
|
|
107
|
-
var
|
|
108
|
-
function
|
|
107
|
+
var Te = /([\w-]+)\((.+?)\)/g, Ee = /[^,]+/g, De = /([-e.\d]+)(.*)/;
|
|
108
|
+
function Oe(e) {
|
|
109
109
|
return Array.isArray(e) ? e.map((e) => ({
|
|
110
110
|
name: e.name,
|
|
111
111
|
args: e.args.map((e) => ({
|
|
@@ -117,31 +117,31 @@ function De(e) {
|
|
|
117
117
|
normalizedIntValue: e.normalizedDefaultIntValue
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
let r =
|
|
122
|
-
return r.length ? r :
|
|
120
|
+
function ke(e, t, n = {}) {
|
|
121
|
+
let r = Ae(t, n);
|
|
122
|
+
return r.length ? r : Me(e, t, n);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ae(e, t = {}) {
|
|
125
125
|
let n = [], r;
|
|
126
|
-
for (; (r =
|
|
126
|
+
for (; (r = Te.exec(e)) !== null;) {
|
|
127
127
|
let [, e, i] = r;
|
|
128
128
|
e && n.push({
|
|
129
129
|
name: e,
|
|
130
|
-
args:
|
|
130
|
+
args: je(e, i, t)
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
return n;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function je(e, t, n = {}) {
|
|
136
136
|
let r = [], i, a = 0;
|
|
137
|
-
for (; (i =
|
|
137
|
+
for (; (i = Ee.exec(t)) !== null;) r.push(Me(e, i[0], {
|
|
138
138
|
...n,
|
|
139
139
|
index: a++
|
|
140
140
|
}));
|
|
141
141
|
return r;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(
|
|
143
|
+
function Me(e, t, n = {}) {
|
|
144
|
+
let { width: r = 1, height: i = 1, index: a = 0 } = n, o = t.match(De), s = {
|
|
145
145
|
unit: o?.[2] ?? null,
|
|
146
146
|
value: t,
|
|
147
147
|
intValue: Number(o?.[1]),
|
|
@@ -161,7 +161,7 @@ function je(e, t, n = {}) {
|
|
|
161
161
|
s.normalizedIntValue = s.intValue / 100;
|
|
162
162
|
break;
|
|
163
163
|
case "rad":
|
|
164
|
-
s.normalizedIntValue = s.intValue /
|
|
164
|
+
s.normalizedIntValue = s.intValue / Ce;
|
|
165
165
|
break;
|
|
166
166
|
case "deg":
|
|
167
167
|
s.normalizedIntValue = s.intValue / 360;
|
|
@@ -184,48 +184,48 @@ function je(e, t, n = {}) {
|
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region src/core/shared/dom.ts
|
|
187
|
-
var
|
|
188
|
-
function
|
|
187
|
+
var Ne = "WebGL2RenderingContext" in globalThis, Pe = "ImageBitmap" in globalThis, Fe = "ResizeObserver" in globalThis, Ie = "PointerEvent" in globalThis, Le = "WheelEvent" in globalThis, Re = "MouseEvent" in globalThis, ze = "ontouchstart" in globalThis, Be = "onclick" in globalThis, Ve = "createImageBitmap" in globalThis, He = "AudioContext" in globalThis, Ue = "webkitAudioContext" in globalThis, We = "OfflineAudioContext" in globalThis, Ge = "webkitOfflineAudioContext" in globalThis, Ke = He || Ue, qe = typeof window < "u", Je = typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0, Ye = globalThis.devicePixelRatio || 1, Xe = (e) => typeof e == "object" && !!e && e.nodeType === 1, Ze = (e) => Xe(e) && e.tagName === "VIDEO", Qe = (e) => Xe(e) && e.tagName === "IMG";
|
|
188
|
+
function $e(e) {
|
|
189
189
|
return typeof e == "object" && !!e && e.nodeType === 1 && e.tagName === "CANVAS";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
return
|
|
191
|
+
function et(e) {
|
|
192
|
+
return Ne && e instanceof globalThis.WebGL2RenderingContext;
|
|
193
193
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
196
|
-
|
|
194
|
+
var tt;
|
|
195
|
+
function nt(e) {
|
|
196
|
+
tt = e;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
198
|
+
function rt() {
|
|
199
|
+
return tt;
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
203
|
-
|
|
201
|
+
var it;
|
|
202
|
+
function at(e) {
|
|
203
|
+
it = e;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
205
|
+
function ot() {
|
|
206
|
+
return it;
|
|
207
207
|
}
|
|
208
208
|
function S(e, t) {
|
|
209
209
|
let n;
|
|
210
|
-
return
|
|
210
|
+
return tt ? n = tt(e, t) : qe && (n = globalThis.document.createElement("canvas")), n && (e !== void 0 && (n.width = e), t !== void 0 && (n.height = t)), n;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function st(e, t = globalThis.location) {
|
|
213
213
|
if (e.startsWith("data:") || !t || typeof document > "u") return "";
|
|
214
214
|
let n = new URL(e, document.baseURI);
|
|
215
215
|
return n.hostname !== t.hostname || n.port !== t.port || n.protocol !== t.protocol ? "anonymous" : "";
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
n === null && !t.startsWith("data:") ? e.crossOrigin =
|
|
217
|
+
function ct(e, t, n) {
|
|
218
|
+
n === null && !t.startsWith("data:") ? e.crossOrigin = st(t) : n !== !1 && (e.crossOrigin = typeof n == "string" ? n : "anonymous");
|
|
219
219
|
}
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/core/shared/id.ts
|
|
222
|
-
var
|
|
223
|
-
function
|
|
224
|
-
return ++
|
|
222
|
+
var lt = 0;
|
|
223
|
+
function ut() {
|
|
224
|
+
return ++lt;
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region src/core/input/InputEvent.ts
|
|
228
|
-
var
|
|
228
|
+
var dt = class e {
|
|
229
229
|
cursor;
|
|
230
230
|
bubbles = !1;
|
|
231
231
|
cancelBubble = !1;
|
|
@@ -260,14 +260,14 @@ var ut = class e {
|
|
|
260
260
|
initUIEvent(...e) {
|
|
261
261
|
throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
262
262
|
}
|
|
263
|
-
},
|
|
263
|
+
}, ft = class extends dt {
|
|
264
264
|
getModifierState(...e) {
|
|
265
265
|
throw Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
266
266
|
}
|
|
267
267
|
initKeyboardEvent(...e) {
|
|
268
268
|
throw Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
269
269
|
}
|
|
270
|
-
},
|
|
270
|
+
}, pt = class extends dt {
|
|
271
271
|
client = {
|
|
272
272
|
x: 0,
|
|
273
273
|
y: 0
|
|
@@ -350,7 +350,7 @@ var ut = class e {
|
|
|
350
350
|
get globalY() {
|
|
351
351
|
return this.global.y;
|
|
352
352
|
}
|
|
353
|
-
},
|
|
353
|
+
}, mt = class extends pt {
|
|
354
354
|
width = 0;
|
|
355
355
|
height = 0;
|
|
356
356
|
isPrimary = !1;
|
|
@@ -360,20 +360,20 @@ var ut = class e {
|
|
|
360
360
|
getPredictedEvents() {
|
|
361
361
|
throw Error("getPredictedEvents is not supported!");
|
|
362
362
|
}
|
|
363
|
-
},
|
|
363
|
+
}, ht = class extends pt {
|
|
364
364
|
static DOM_DELTA_PIXEL = 0;
|
|
365
365
|
DOM_DELTA_PIXEL = 0;
|
|
366
366
|
static DOM_DELTA_LINE = 1;
|
|
367
367
|
DOM_DELTA_LINE = 1;
|
|
368
368
|
static DOM_DELTA_PAGE = 2;
|
|
369
369
|
DOM_DELTA_PAGE = 2;
|
|
370
|
-
},
|
|
370
|
+
}, gt = {
|
|
371
371
|
touchstart: "pointerdown",
|
|
372
372
|
touchend: "pointerup",
|
|
373
373
|
touchendoutside: "pointerupoutside",
|
|
374
374
|
touchmove: "pointermove",
|
|
375
375
|
touchcancel: "pointercancel"
|
|
376
|
-
},
|
|
376
|
+
}, _t = class extends e {
|
|
377
377
|
event;
|
|
378
378
|
target;
|
|
379
379
|
cursor = "default";
|
|
@@ -391,21 +391,21 @@ var ut = class e {
|
|
|
391
391
|
removeEventListeners() {
|
|
392
392
|
if (!this.setuped || !this.target) return;
|
|
393
393
|
let e = this.target.style;
|
|
394
|
-
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") :
|
|
394
|
+
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : Ie && (e.touchAction = ""), Ie ? (this.target.removeEventListener("pointerdown", this._onPointerDown), this.target.removeEventListener("pointerleave", this._onPointerOver), this.target.removeEventListener("pointerover", this._onPointerOver), this.target.removeEventListener("pointermove", this._onPointerMove), this.target.removeEventListener("pointerup", this._onPointerUp)) : (this.target.removeEventListener("mousedown", this._onPointerDown), this.target.removeEventListener("mouseout", this._onPointerOver), this.target.removeEventListener("mouseover", this._onPointerOver), this.target.removeEventListener("mousemove", this._onPointerMove), this.target.removeEventListener("mouseup", this._onPointerUp)), ze && (this.target.removeEventListener("touchstart", this._onPointerDown), this.target.removeEventListener("touchmove", this._onPointerMove), this.target.removeEventListener("touchend", this._onPointerUp)), this.target.removeEventListener("wheel", this._onWheel), typeof document < "u" && (document.removeEventListener("keydown", this._onKeyDown), document.removeEventListener("keypress", this._onKeyPress), document.removeEventListener("keyup", this._onKeyUp)), this.target = void 0, this.setuped = !1;
|
|
395
395
|
}
|
|
396
396
|
addEventListeners() {
|
|
397
397
|
if (this.setuped || !this.target) return;
|
|
398
398
|
let e = this.target.style;
|
|
399
|
-
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") :
|
|
399
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : Ie && (e.touchAction = "none")), Ie ? (this.target.addEventListener("pointerdown", this._onPointerDown), this.target.addEventListener("pointerleave", this._onPointerOver), this.target.addEventListener("pointerover", this._onPointerOver), this.target.addEventListener("pointermove", this._onPointerMove), this.target.addEventListener("pointerup", this._onPointerUp)) : (this.target.addEventListener("mousedown", this._onPointerDown), this.target.addEventListener("mouseout", this._onPointerOver), this.target.addEventListener("mouseover", this._onPointerOver), this.target.addEventListener("mousemove", this._onPointerMove), this.target.addEventListener("mouseup", this._onPointerUp)), ze && (this.target.addEventListener("touchstart", this._onPointerDown), this.target.addEventListener("touchmove", this._onPointerMove), this.target.addEventListener("touchend", this._onPointerUp)), this.target.addEventListener("wheel", this._onWheel), typeof document < "u" && (document.addEventListener("keydown", this._onKeyDown), document.addEventListener("keypress", this._onKeyPress), document.addEventListener("keyup", this._onKeyUp)), this.setuped = !0;
|
|
400
400
|
}
|
|
401
401
|
normalize(e) {
|
|
402
402
|
let t = [];
|
|
403
|
-
if (
|
|
403
|
+
if (ze && e instanceof globalThis.TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
|
|
404
404
|
let r = e.changedTouches[n];
|
|
405
405
|
r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.type = e.type, t.push(r);
|
|
406
406
|
}
|
|
407
|
-
else if (
|
|
408
|
-
else if (
|
|
407
|
+
else if (Le && e instanceof globalThis.WheelEvent) t.push(e);
|
|
408
|
+
else if (Ie && e instanceof globalThis.PointerEvent) t.push(e);
|
|
409
409
|
else {
|
|
410
410
|
let n = e;
|
|
411
411
|
n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId = 1), n.pressure === void 0 && (n.pressure = .5), n.twist === void 0 && (n.twist = 0), n.tangentialPressure === void 0 && (n.tangentialPressure = 0), t.push(n);
|
|
@@ -413,8 +413,8 @@ var ut = class e {
|
|
|
413
413
|
return t;
|
|
414
414
|
}
|
|
415
415
|
_clonePointerEvent(e) {
|
|
416
|
-
let t = new
|
|
417
|
-
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type =
|
|
416
|
+
let t = new mt();
|
|
417
|
+
return t.nativeEvent = e, t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.isTrusted = e.isTrusted, this._copyMouseEvent(t, e), this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t.type === "pointerleave" ? t.type = "pointerout" : t.type.startsWith("mouse") ? t.type = t.type.replace("mouse", "pointer") : t.type.startsWith("touch") && (t.type = gt[t.type] || t.type), t;
|
|
418
418
|
}
|
|
419
419
|
_copyInputEvent(e, t) {
|
|
420
420
|
e.nativeEvent = t, e.bubbles = t.bubbles, e.cancelBubble = t.cancelBubble, e.cancelable = t.cancelable, e.composed = t.composed, e.currentTarget = t.currentTarget, e.defaultPrevented = t.defaultPrevented, e.eventPhase = t.eventPhase, e.isTrusted = t.isTrusted, e.returnValue = t.returnValue, e.srcElement = t.srcElement, e.timeStamp = t.timeStamp, e.type = t.type;
|
|
@@ -423,11 +423,11 @@ var ut = class e {
|
|
|
423
423
|
this._copyInputEvent(e, t), e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
|
|
424
424
|
}
|
|
425
425
|
_cloneWheelEvent(e) {
|
|
426
|
-
let t = new
|
|
426
|
+
let t = new ht();
|
|
427
427
|
return this._copyMouseEvent(t, e), t.wheelDeltaY = e.wheelDeltaY, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.x = t.screen.x, t.global.y = t.screen.y, t.offset.x = t.screen.x, t.offset.y = t.screen.y, t;
|
|
428
428
|
}
|
|
429
429
|
_cloneKeyboardEvent(e) {
|
|
430
|
-
let t = new
|
|
430
|
+
let t = new ft();
|
|
431
431
|
return this._copyInputEvent(t, e), t.altKey = e.altKey, t.charCode = e.charCode, t.code = e.code, t.ctrlKey = e.ctrlKey, t.isComposing = e.isComposing, t.key = e.key, t.keyCode = e.keyCode, t.location = e.location, t.metaKey = e.metaKey, t.repeat = e.repeat, t.shiftKey = e.shiftKey, t;
|
|
432
432
|
}
|
|
433
433
|
setCursor(e = "default") {
|
|
@@ -475,25 +475,25 @@ var ut = class e {
|
|
|
475
475
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
476
476
|
};
|
|
477
477
|
_onPointerDown = (e) => {
|
|
478
|
-
if (
|
|
478
|
+
if (ze && e.pointerType === "touch") return;
|
|
479
479
|
let t = this.normalize(e);
|
|
480
480
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerdown", this.event = this._clonePointerEvent(t[e]));
|
|
481
481
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
482
482
|
};
|
|
483
483
|
_onPointerOver = (e) => {
|
|
484
|
-
if (!this.enableClickEvent ||
|
|
484
|
+
if (!this.enableClickEvent || ze && e.pointerType === "touch") return;
|
|
485
485
|
let t = this.normalize(e);
|
|
486
486
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointerover", this.event = this._clonePointerEvent(t[e]));
|
|
487
487
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
488
488
|
};
|
|
489
489
|
_onPointerMove = (e) => {
|
|
490
|
-
if (!this.enableMoveEvent ||
|
|
490
|
+
if (!this.enableMoveEvent || ze && e.pointerType === "touch") return;
|
|
491
491
|
let t = this.normalize(e);
|
|
492
492
|
for (let e = 0, n = t.length; e < n; e++) this.emit("pointermove", this.event = this._clonePointerEvent(t[e]));
|
|
493
493
|
this.event?.cursor && this.setCursor(this.event.cursor);
|
|
494
494
|
};
|
|
495
495
|
_onPointerUp = (e) => {
|
|
496
|
-
if (!this.enableClickEvent ||
|
|
496
|
+
if (!this.enableClickEvent || ze && e.pointerType === "touch") return;
|
|
497
497
|
let t = e.target;
|
|
498
498
|
e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
|
|
499
499
|
let n = t === this.target ? "" : "outside", r = this.normalize(e);
|
|
@@ -513,7 +513,7 @@ var ut = class e {
|
|
|
513
513
|
this.removeEventListeners(), super.destroy();
|
|
514
514
|
}
|
|
515
515
|
}, C = class extends n {
|
|
516
|
-
instanceId =
|
|
516
|
+
instanceId = ut();
|
|
517
517
|
destroyed = !1;
|
|
518
518
|
get json() {
|
|
519
519
|
return this.toJSON();
|
|
@@ -522,7 +522,7 @@ var ut = class e {
|
|
|
522
522
|
this.setProperties(e);
|
|
523
523
|
}
|
|
524
524
|
_nextTick() {
|
|
525
|
-
return
|
|
525
|
+
return xe();
|
|
526
526
|
}
|
|
527
527
|
equal(e) {
|
|
528
528
|
return !!(e && this.instanceId === e.instanceId);
|
|
@@ -531,7 +531,7 @@ var ut = class e {
|
|
|
531
531
|
destroy() {
|
|
532
532
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
533
533
|
}
|
|
534
|
-
},
|
|
534
|
+
}, vt = class extends C {}, w = class extends vt {}, yt = class e {
|
|
535
535
|
get x() {
|
|
536
536
|
return this.min.x;
|
|
537
537
|
}
|
|
@@ -664,7 +664,7 @@ var ut = class e {
|
|
|
664
664
|
};
|
|
665
665
|
//#endregion
|
|
666
666
|
//#region src/core/math/Color.ts
|
|
667
|
-
|
|
667
|
+
me([he]);
|
|
668
668
|
var T = class {
|
|
669
669
|
get value() {
|
|
670
670
|
return this._value;
|
|
@@ -748,11 +748,11 @@ var T = class {
|
|
|
748
748
|
this.a
|
|
749
749
|
];
|
|
750
750
|
}
|
|
751
|
-
},
|
|
752
|
-
function
|
|
751
|
+
}, bt = Se / 180, xt = 180 / Se;
|
|
752
|
+
function E(e, t, n) {
|
|
753
753
|
return Math.max(t, Math.min(e, n));
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function D(e, t, n) {
|
|
756
756
|
return (1 - n) * e + n * t;
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
@@ -887,7 +887,7 @@ var St = class {
|
|
|
887
887
|
]);
|
|
888
888
|
}
|
|
889
889
|
invert(e = 1) {
|
|
890
|
-
let t =
|
|
890
|
+
let t = D(1, -1, e), n = D(0, 255, e);
|
|
891
891
|
return this.multiply([
|
|
892
892
|
t,
|
|
893
893
|
0,
|
|
@@ -912,21 +912,21 @@ var St = class {
|
|
|
912
912
|
]);
|
|
913
913
|
}
|
|
914
914
|
sepia(e = 1) {
|
|
915
|
-
let t =
|
|
915
|
+
let t = E(e, 0, 1);
|
|
916
916
|
return this.multiply([
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
917
|
+
D(1, .393, t),
|
|
918
|
+
D(0, .7689999, t),
|
|
919
|
+
D(0, .18899999, t),
|
|
920
920
|
0,
|
|
921
921
|
0,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
922
|
+
D(0, .349, t),
|
|
923
|
+
D(1, .6859999, t),
|
|
924
|
+
D(0, .16799999, t),
|
|
925
925
|
0,
|
|
926
926
|
0,
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
927
|
+
D(0, .272, t),
|
|
928
|
+
D(0, .5339999, t),
|
|
929
|
+
D(1, .13099999, t),
|
|
930
930
|
0,
|
|
931
931
|
0,
|
|
932
932
|
0,
|
|
@@ -961,7 +961,7 @@ var St = class {
|
|
|
961
961
|
]);
|
|
962
962
|
}
|
|
963
963
|
grayscale(e = 1) {
|
|
964
|
-
let t =
|
|
964
|
+
let t = E(e, 0, 1), n = D(1, .3, t), r = D(0, .3, t), i = D(1, .59, t), a = D(0, .59, t), o = D(1, .11, t), s = D(0, .11, t);
|
|
965
965
|
return this.multiply([
|
|
966
966
|
n,
|
|
967
967
|
a,
|
|
@@ -1013,10 +1013,10 @@ var St = class {
|
|
|
1013
1013
|
toArray() {
|
|
1014
1014
|
return this._array;
|
|
1015
1015
|
}
|
|
1016
|
-
}, Ct = class e extends
|
|
1016
|
+
}, Ct = class e extends yt {
|
|
1017
1017
|
rotation;
|
|
1018
1018
|
get rotationDegrees() {
|
|
1019
|
-
return this.rotation /
|
|
1019
|
+
return this.rotation / bt;
|
|
1020
1020
|
}
|
|
1021
1021
|
constructor(...e) {
|
|
1022
1022
|
let t, n;
|
|
@@ -1026,7 +1026,7 @@ var St = class {
|
|
|
1026
1026
|
if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
|
|
1027
1027
|
{
|
|
1028
1028
|
let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
|
|
1029
|
-
let { width: n, height: r, rotation: i = 0 } = e, a = i /
|
|
1029
|
+
let { width: n, height: r, rotation: i = 0 } = e, a = i / bt;
|
|
1030
1030
|
a = -a % 180;
|
|
1031
1031
|
let o = a / 180 * Math.PI, s = {
|
|
1032
1032
|
x: Math.cos(o),
|
|
@@ -1092,12 +1092,12 @@ var St = class {
|
|
|
1092
1092
|
};
|
|
1093
1093
|
//#endregion
|
|
1094
1094
|
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateMetadata.js
|
|
1095
|
-
function
|
|
1095
|
+
function O(e, t) {
|
|
1096
1096
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
1097
1097
|
}
|
|
1098
1098
|
//#endregion
|
|
1099
1099
|
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
1100
|
-
function
|
|
1100
|
+
function k(e, t, n, r) {
|
|
1101
1101
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
1102
1102
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
1103
1103
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -1135,7 +1135,7 @@ var Tt = class extends C {
|
|
|
1135
1135
|
super._destroy(), this.stop();
|
|
1136
1136
|
}
|
|
1137
1137
|
};
|
|
1138
|
-
|
|
1138
|
+
k([_({ fallback: 60 }), O("design:type", Number)], Tt.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Tt.prototype, "speed", void 0);
|
|
1139
1139
|
//#endregion
|
|
1140
1140
|
//#region src/core/renderers/gl/buffer/const.ts
|
|
1141
1141
|
var Et = /* @__PURE__ */ function(e) {
|
|
@@ -1148,7 +1148,7 @@ var Et = /* @__PURE__ */ function(e) {
|
|
|
1148
1148
|
constructor(e) {
|
|
1149
1149
|
this.native = e;
|
|
1150
1150
|
}
|
|
1151
|
-
},
|
|
1151
|
+
}, A = /* @__PURE__ */ function(e) {
|
|
1152
1152
|
return e[e.mapRead = 1] = "mapRead", e[e.mapWrite = 2] = "mapWrite", e[e.copySrc = 4] = "copySrc", e[e.copyDst = 8] = "copyDst", e[e.index = 16] = "index", e[e.vertex = 32] = "vertex", e[e.uniform = 64] = "uniform", e[e.storage = 128] = "storage", e[e.indirect = 256] = "indirect", e[e.queryResolve = 512] = "queryResolve", e[e.static = 1024] = "static", e;
|
|
1153
1153
|
}({}), Ot = class extends n {
|
|
1154
1154
|
screen = {
|
|
@@ -1169,7 +1169,7 @@ var Et = /* @__PURE__ */ function(e) {
|
|
|
1169
1169
|
this.view && (this.view.width = Math.floor(e * this.pixelRatio), this.view.height = Math.floor(t * this.pixelRatio)), this.screen.width = e, this.screen.height = t, n && this.view && (this.view.style.width = `${e}px`, this.view.style.height = `${t}px`);
|
|
1170
1170
|
}
|
|
1171
1171
|
};
|
|
1172
|
-
|
|
1172
|
+
k([_({ fallback: Ye }), O("design:type", Number)], Ot.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], Ot.prototype, "view", void 0);
|
|
1173
1173
|
//#endregion
|
|
1174
1174
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1175
1175
|
var kt = 0, At = class {
|
|
@@ -1192,7 +1192,7 @@ function Nt(e, t) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
//#endregion
|
|
1194
1194
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
1195
|
-
var
|
|
1195
|
+
var j = class extends e {
|
|
1196
1196
|
get _gl() {
|
|
1197
1197
|
return this._renderer.gl;
|
|
1198
1198
|
}
|
|
@@ -1206,7 +1206,7 @@ var A = class extends e {
|
|
|
1206
1206
|
_setup() {}
|
|
1207
1207
|
flush() {}
|
|
1208
1208
|
reset() {}
|
|
1209
|
-
}, Pt = class extends
|
|
1209
|
+
}, Pt = class extends j {
|
|
1210
1210
|
install(e) {
|
|
1211
1211
|
super.install(e), e.buffer = this;
|
|
1212
1212
|
}
|
|
@@ -1217,7 +1217,7 @@ var A = class extends e {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
_createGlBuffer(e) {
|
|
1219
1219
|
let t = this._gl, n = new Dt(t.createBuffer()), r = Et.arrayBuffer;
|
|
1220
|
-
return e.usage &
|
|
1220
|
+
return e.usage & A.index ? r = Et.elementArrayBuffer : e.usage & A.uniform && (r = Et.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1221
1221
|
switch (e) {
|
|
1222
1222
|
case "usage":
|
|
1223
1223
|
case "data":
|
|
@@ -1240,7 +1240,7 @@ var A = class extends e {
|
|
|
1240
1240
|
n.dirty = !1;
|
|
1241
1241
|
let { _gl: r } = this, { usage: i, data: a } = e;
|
|
1242
1242
|
r.bindBuffer(n.target, n.native);
|
|
1243
|
-
let o = i &
|
|
1243
|
+
let o = i & A.static ? r.STATIC_DRAW : r.DYNAMIC_DRAW;
|
|
1244
1244
|
if (a) if (n.byteLength >= a.byteLength) {
|
|
1245
1245
|
let e = a.length * a.BYTES_PER_ELEMENT;
|
|
1246
1246
|
r.bufferSubData(n.target, 0, a, 0, e / a.BYTES_PER_ELEMENT);
|
|
@@ -1576,7 +1576,7 @@ function en(e, t) {
|
|
|
1576
1576
|
}
|
|
1577
1577
|
//#endregion
|
|
1578
1578
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1579
|
-
var tn = class extends
|
|
1579
|
+
var tn = class extends j {
|
|
1580
1580
|
install(e) {
|
|
1581
1581
|
super.install(e), e.shader = this;
|
|
1582
1582
|
}
|
|
@@ -1901,7 +1901,7 @@ var sn = class e {
|
|
|
1901
1901
|
}
|
|
1902
1902
|
};
|
|
1903
1903
|
sn._init();
|
|
1904
|
-
var cn = class extends
|
|
1904
|
+
var cn = class extends j {
|
|
1905
1905
|
install(e) {
|
|
1906
1906
|
super.install(e), e.state = this;
|
|
1907
1907
|
}
|
|
@@ -1958,7 +1958,7 @@ var cn = class extends A {
|
|
|
1958
1958
|
let e = (1 << sn._properties.length) - 1;
|
|
1959
1959
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
1960
1960
|
}
|
|
1961
|
-
}, ln = class extends
|
|
1961
|
+
}, ln = class extends j {
|
|
1962
1962
|
install(e) {
|
|
1963
1963
|
super.install(e), e.batch2D = this;
|
|
1964
1964
|
}
|
|
@@ -1983,7 +1983,7 @@ var cn = class extends A {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
_createShader(e) {
|
|
1985
1985
|
let t = this._renderer, n = {
|
|
1986
|
-
instanceId:
|
|
1986
|
+
instanceId: ut(),
|
|
1987
1987
|
glProgram: new Kt({
|
|
1988
1988
|
vertex: "precision highp float;\nin vec2 aPosition;\nin vec2 aUv;\nin vec4 aTextureParams;\nin vec4 aModulate;\n\nuniform vec2 size;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\n\nout float vTextureId;\nout float vClipOutsideUv;\nout vec2 vUv;\nout vec4 vModulate;\n\nvec2 roundPixels(vec2 position, vec2 targetSize) {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void) {\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n mat3 modelViewProjectionMatrix = projectionMatrix * viewMatrix * modelMatrix;\n gl_Position = vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vTextureId = aTextureParams.x;\n vClipOutsideUv = aTextureParams.y;\n if (aTextureParams.z == 1.) {\n gl_Position.xy = roundPixels(gl_Position.xy, size);\n }\n vUv = aUv;\n vModulate = aModulate;\n}",
|
|
1989
1989
|
fragment: `precision highp float;
|
|
@@ -2013,15 +2013,15 @@ void main(void) {
|
|
|
2013
2013
|
}`
|
|
2014
2014
|
})
|
|
2015
2015
|
}, r = {
|
|
2016
|
-
instanceId:
|
|
2017
|
-
usage:
|
|
2016
|
+
instanceId: ut(),
|
|
2017
|
+
usage: A.vertex,
|
|
2018
2018
|
data: new Float32Array()
|
|
2019
2019
|
}, i = {
|
|
2020
|
-
instanceId:
|
|
2021
|
-
usage:
|
|
2020
|
+
instanceId: ut(),
|
|
2021
|
+
usage: A.index,
|
|
2022
2022
|
data: new Uint32Array()
|
|
2023
2023
|
}, a = {
|
|
2024
|
-
instanceId:
|
|
2024
|
+
instanceId: ut(),
|
|
2025
2025
|
topology: "triangle-list",
|
|
2026
2026
|
attributes: Object.fromEntries(Object.entries(this._attributes).map(([e, t]) => [e, {
|
|
2027
2027
|
...t,
|
|
@@ -2068,8 +2068,8 @@ void main(void) {
|
|
|
2068
2068
|
255
|
|
2069
2069
|
] } = n[e];
|
|
2070
2070
|
m < e && t.blendMode !== te && (t.size = l - t.start, u.push(t), m = e, t = { id: ++d }, t.textures = i, t.textureLocationMap = f, t.start = l);
|
|
2071
|
-
let { width: ae, height: oe } = g, _ = c / this._vertexSize, se = (ee ? f.get(ee) : 255) ?? 255, ce = +!!re, le = +!!ne, ue,
|
|
2072
|
-
for (let e = p.length, t = 0; t < e; t += 2) ue = h[t],
|
|
2071
|
+
let { width: ae, height: oe } = g, _ = c / this._vertexSize, se = (ee ? f.get(ee) : 255) ?? 255, ce = +!!re, le = +!!ne, ue, de, v;
|
|
2072
|
+
for (let e = p.length, t = 0; t < e; t += 2) ue = h[t], de = h[t + 1], ae > 0 && oe > 0 && (ue = Math.ceil(ue * ae) / ae, de = Math.ceil(de * oe) / oe), a[c++] = p[t], a[c++] = p[t + 1], a[c++] = ue, a[c++] = de, v = c * 4, o[v] = se, o[v + 1] = le, o[v + 2] = ce, o[v + 3] = 0, c++, v = c * 4, o[v] = ie[0], o[v + 1] = ie[1], o[v + 2] = ie[2], o[v + 3] = ie[3], c++;
|
|
2073
2073
|
for (let e = r.length, t = 0; t < e; t++) s[l++] = _ + r[t];
|
|
2074
2074
|
t.blendMode = te;
|
|
2075
2075
|
}
|
|
@@ -2114,11 +2114,11 @@ function dn(e) {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
//#endregion
|
|
2116
2116
|
//#region src/core/renderers/gl/const.ts
|
|
2117
|
-
var
|
|
2117
|
+
var M = /* @__PURE__ */ function(e) {
|
|
2118
2118
|
return e[e.disabled = 0] = "disabled", e[e.renderingMaskAdd = 1] = "renderingMaskAdd", e[e.maskActive = 2] = "maskActive", e[e.inverseMaskActive = 3] = "inverseMaskActive", e[e.renderingMaskRemove = 4] = "renderingMaskRemove", e[e.none = 5] = "none", e;
|
|
2119
2119
|
}({}), fn = /* @__PURE__ */ function(e) {
|
|
2120
2120
|
return e[e.none = 0] = "none", e[e.color = 16384] = "color", e[e.stencil = 1024] = "stencil", e[e.depth = 256] = "depth", e[e.colorDepth = 16640] = "colorDepth", e[e.colorStencil = 17408] = "colorStencil", e[e.depthStencil = 1280] = "depthStencil", e[e.all = 17664] = "all", e;
|
|
2121
|
-
}({}), pn = class extends
|
|
2121
|
+
}({}), pn = class extends j {
|
|
2122
2122
|
install(e) {
|
|
2123
2123
|
super.install(e), e.mask = this;
|
|
2124
2124
|
}
|
|
@@ -2137,16 +2137,16 @@ var j = /* @__PURE__ */ function(e) {
|
|
|
2137
2137
|
};
|
|
2138
2138
|
this.stack.push(n);
|
|
2139
2139
|
let r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2140
|
-
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(
|
|
2140
|
+
"x" in t ? this._renderer.scissor.push(t) : "render" in t && (this._renderer.flush(), this._renderer.renderTarget.ensureDepthStencil(), this._renderer.stencil.bind(M.renderingMaskAdd, i), this._renderer.colorMask.bind(0), i++, t.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2141
2141
|
}
|
|
2142
2142
|
pop(e) {
|
|
2143
2143
|
let t = this.stack.pop();
|
|
2144
2144
|
if (!t || t.source !== e) return;
|
|
2145
2145
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2146
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(fn.stencil), this._renderer.stencil.bind(
|
|
2146
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(fn.stencil), this._renderer.stencil.bind(M.disabled, i)) : this._renderer.stencil.bind(M.renderingMaskRemove, i), i--, n.render(this._renderer), this._renderer.flush(), this._renderer.stencil.bind(M.maskActive, i), this._renderer.colorMask.bind(15)), this._maskStackHash[r] = i;
|
|
2147
2147
|
}
|
|
2148
2148
|
}, mn = [];
|
|
2149
|
-
mn[
|
|
2149
|
+
mn[M.none] = {}, mn[M.disabled] = {}, mn[M.renderingMaskAdd] = {
|
|
2150
2150
|
stencilFront: {
|
|
2151
2151
|
compare: "equal",
|
|
2152
2152
|
passOp: "increment-clamp"
|
|
@@ -2155,7 +2155,7 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2155
2155
|
compare: "equal",
|
|
2156
2156
|
passOp: "increment-clamp"
|
|
2157
2157
|
}
|
|
2158
|
-
}, mn[
|
|
2158
|
+
}, mn[M.renderingMaskRemove] = {
|
|
2159
2159
|
stencilFront: {
|
|
2160
2160
|
compare: "equal",
|
|
2161
2161
|
passOp: "decrement-clamp"
|
|
@@ -2164,7 +2164,7 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2164
2164
|
compare: "equal",
|
|
2165
2165
|
passOp: "decrement-clamp"
|
|
2166
2166
|
}
|
|
2167
|
-
}, mn[
|
|
2167
|
+
}, mn[M.maskActive] = {
|
|
2168
2168
|
stencilFront: {
|
|
2169
2169
|
compare: "equal",
|
|
2170
2170
|
passOp: "keep"
|
|
@@ -2173,7 +2173,7 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2173
2173
|
compare: "equal",
|
|
2174
2174
|
passOp: "keep"
|
|
2175
2175
|
}
|
|
2176
|
-
}, mn[
|
|
2176
|
+
}, mn[M.inverseMaskActive] = {
|
|
2177
2177
|
stencilFront: {
|
|
2178
2178
|
compare: "not-equal",
|
|
2179
2179
|
passOp: "keep"
|
|
@@ -2183,17 +2183,17 @@ mn[j.none] = {}, mn[j.disabled] = {}, mn[j.renderingMaskAdd] = {
|
|
|
2183
2183
|
passOp: "keep"
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
|
-
var hn = class extends
|
|
2186
|
+
var hn = class extends j {
|
|
2187
2187
|
install(e) {
|
|
2188
2188
|
super.install(e), e.stencil = this;
|
|
2189
2189
|
}
|
|
2190
2190
|
_cache = {
|
|
2191
2191
|
enabled: !1,
|
|
2192
|
-
stencilMode:
|
|
2192
|
+
stencilMode: M.none,
|
|
2193
2193
|
refCount: 0
|
|
2194
2194
|
};
|
|
2195
2195
|
current = { [-1]: {
|
|
2196
|
-
stencilMode:
|
|
2196
|
+
stencilMode: M.disabled,
|
|
2197
2197
|
refCount: 0
|
|
2198
2198
|
} };
|
|
2199
2199
|
_passOpMap;
|
|
@@ -2223,20 +2223,20 @@ var hn = class extends A {
|
|
|
2223
2223
|
super._setup(), this._renderer.renderTarget.on("updateRenderTarget", this._updateRenderTarget);
|
|
2224
2224
|
}
|
|
2225
2225
|
reset() {
|
|
2226
|
-
this._cache.enabled = !1, this._cache.stencilMode =
|
|
2226
|
+
this._cache.enabled = !1, this._cache.stencilMode = M.none, this._cache.refCount = 0;
|
|
2227
2227
|
}
|
|
2228
2228
|
_updateRenderTarget = (e) => {
|
|
2229
2229
|
if (e) {
|
|
2230
2230
|
let t = this.current[e.instanceId];
|
|
2231
2231
|
t ||= this.current[e.instanceId] = {
|
|
2232
|
-
stencilMode:
|
|
2232
|
+
stencilMode: M.disabled,
|
|
2233
2233
|
refCount: 0
|
|
2234
2234
|
}, this.bind(t.stencilMode, t.refCount);
|
|
2235
2235
|
}
|
|
2236
2236
|
};
|
|
2237
2237
|
bind(e, t) {
|
|
2238
2238
|
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = mn[e], a = this._cache;
|
|
2239
|
-
if (n.stencilMode = e, n.refCount = t, e ===
|
|
2239
|
+
if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
|
|
2240
2240
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2241
2241
|
return;
|
|
2242
2242
|
}
|
|
@@ -2245,8 +2245,8 @@ var hn = class extends A {
|
|
|
2245
2245
|
destroy() {
|
|
2246
2246
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2247
2247
|
}
|
|
2248
|
-
}, gn = class extends
|
|
2249
|
-
current = new
|
|
2248
|
+
}, gn = class extends j {
|
|
2249
|
+
current = new yt(0, 0, 0, 0);
|
|
2250
2250
|
install(e) {
|
|
2251
2251
|
super.install(e), e.viewport = this;
|
|
2252
2252
|
}
|
|
@@ -2265,7 +2265,7 @@ var hn = class extends A {
|
|
|
2265
2265
|
constructor(e) {
|
|
2266
2266
|
this.framebuffer = e;
|
|
2267
2267
|
}
|
|
2268
|
-
}, vn = class extends
|
|
2268
|
+
}, vn = class extends j {
|
|
2269
2269
|
install(e) {
|
|
2270
2270
|
super.install(e), e.renderTarget = this;
|
|
2271
2271
|
}
|
|
@@ -2392,7 +2392,7 @@ var hn = class extends A {
|
|
|
2392
2392
|
return e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e;
|
|
2393
2393
|
}({}), bn = /* @__PURE__ */ function(e) {
|
|
2394
2394
|
return e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e;
|
|
2395
|
-
}({}),
|
|
2395
|
+
}({}), N = /* @__PURE__ */ function(e) {
|
|
2396
2396
|
return e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e;
|
|
2397
2397
|
}({}), xn = class {
|
|
2398
2398
|
native;
|
|
@@ -2400,7 +2400,7 @@ var hn = class extends A {
|
|
|
2400
2400
|
width = -1;
|
|
2401
2401
|
height = -1;
|
|
2402
2402
|
mipmap = !1;
|
|
2403
|
-
type =
|
|
2403
|
+
type = N.UNSIGNED_BYTE;
|
|
2404
2404
|
internalFormat = yn.RGBA;
|
|
2405
2405
|
format = yn.RGBA;
|
|
2406
2406
|
constructor(e) {
|
|
@@ -2681,7 +2681,7 @@ var An = {
|
|
|
2681
2681
|
c < o || l < s ? ((i !== o || a !== s) && n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, null), r === 2 ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, c, l, t.format, t.type, e.source) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source)) : i === o && a === s ? n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, t.format, t.type, e.source) : r === 2 ? n.texImage2D(t.target, 0, t.internalFormat, o, s, 0, t.format, t.type, e.source) : n.texImage2D(t.target, 0, t.internalFormat, t.format, t.type, e.source), t.width = o, t.height = s;
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
}, jn = class extends
|
|
2684
|
+
}, jn = class extends j {
|
|
2685
2685
|
uploaders = { ...An };
|
|
2686
2686
|
textures = /* @__PURE__ */ new Map();
|
|
2687
2687
|
glTextures = /* @__PURE__ */ new Map();
|
|
@@ -2780,36 +2780,36 @@ var An = {
|
|
|
2780
2780
|
this._renderer.contextLost || this.glTextures.forEach((t) => e.deleteTexture(t.native)), this.textures.clear(), this.glTextures.clear(), this._location = 0, this.current.length = 0, this._premultiplyAlpha = !1, this._renderer.contextLost || e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
|
|
2781
2781
|
}
|
|
2782
2782
|
}, Mn = {
|
|
2783
|
-
uint8x2:
|
|
2784
|
-
uint8x4:
|
|
2785
|
-
sint8x2:
|
|
2786
|
-
sint8x4:
|
|
2787
|
-
unorm8x2:
|
|
2788
|
-
unorm8x4:
|
|
2789
|
-
snorm8x2:
|
|
2790
|
-
snorm8x4:
|
|
2791
|
-
uint16x2:
|
|
2792
|
-
uint16x4:
|
|
2793
|
-
sint16x2:
|
|
2794
|
-
sint16x4:
|
|
2795
|
-
unorm16x2:
|
|
2796
|
-
unorm16x4:
|
|
2797
|
-
snorm16x2:
|
|
2798
|
-
snorm16x4:
|
|
2799
|
-
float16x2:
|
|
2800
|
-
float16x4:
|
|
2801
|
-
float32:
|
|
2802
|
-
float32x2:
|
|
2803
|
-
float32x3:
|
|
2804
|
-
float32x4:
|
|
2805
|
-
uint32:
|
|
2806
|
-
uint32x2:
|
|
2807
|
-
uint32x3:
|
|
2808
|
-
uint32x4:
|
|
2809
|
-
sint32:
|
|
2810
|
-
sint32x2:
|
|
2811
|
-
sint32x3:
|
|
2812
|
-
sint32x4:
|
|
2783
|
+
uint8x2: N.UNSIGNED_BYTE,
|
|
2784
|
+
uint8x4: N.UNSIGNED_BYTE,
|
|
2785
|
+
sint8x2: N.BYTE,
|
|
2786
|
+
sint8x4: N.BYTE,
|
|
2787
|
+
unorm8x2: N.UNSIGNED_BYTE,
|
|
2788
|
+
unorm8x4: N.UNSIGNED_BYTE,
|
|
2789
|
+
snorm8x2: N.BYTE,
|
|
2790
|
+
snorm8x4: N.BYTE,
|
|
2791
|
+
uint16x2: N.UNSIGNED_SHORT,
|
|
2792
|
+
uint16x4: N.UNSIGNED_SHORT,
|
|
2793
|
+
sint16x2: N.SHORT,
|
|
2794
|
+
sint16x4: N.SHORT,
|
|
2795
|
+
unorm16x2: N.UNSIGNED_SHORT,
|
|
2796
|
+
unorm16x4: N.UNSIGNED_SHORT,
|
|
2797
|
+
snorm16x2: N.SHORT,
|
|
2798
|
+
snorm16x4: N.SHORT,
|
|
2799
|
+
float16x2: N.HALF_FLOAT,
|
|
2800
|
+
float16x4: N.HALF_FLOAT,
|
|
2801
|
+
float32: N.FLOAT,
|
|
2802
|
+
float32x2: N.FLOAT,
|
|
2803
|
+
float32x3: N.FLOAT,
|
|
2804
|
+
float32x4: N.FLOAT,
|
|
2805
|
+
uint32: N.UNSIGNED_INT,
|
|
2806
|
+
uint32x2: N.UNSIGNED_INT,
|
|
2807
|
+
uint32x3: N.UNSIGNED_INT,
|
|
2808
|
+
uint32x4: N.UNSIGNED_INT,
|
|
2809
|
+
sint32: N.INT,
|
|
2810
|
+
sint32x2: N.INT,
|
|
2811
|
+
sint32x3: N.INT,
|
|
2812
|
+
sint32x4: N.INT
|
|
2813
2813
|
};
|
|
2814
2814
|
function Nn(e) {
|
|
2815
2815
|
return Mn[e] ?? Mn.float32;
|
|
@@ -2822,7 +2822,7 @@ var Pn = {
|
|
|
2822
2822
|
"line-strip": 3,
|
|
2823
2823
|
"triangle-list": 4,
|
|
2824
2824
|
"triangle-strip": 5
|
|
2825
|
-
}, Fn = class extends
|
|
2825
|
+
}, Fn = class extends j {
|
|
2826
2826
|
_geometryVaoHash = {};
|
|
2827
2827
|
hasInstance = !1;
|
|
2828
2828
|
current = null;
|
|
@@ -2954,7 +2954,7 @@ var Pn = {
|
|
|
2954
2954
|
}
|
|
2955
2955
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
2956
2956
|
}
|
|
2957
|
-
}, In = class extends
|
|
2957
|
+
}, In = class extends j {
|
|
2958
2958
|
install(e) {
|
|
2959
2959
|
super.install(e), e.colorMask = this;
|
|
2960
2960
|
}
|
|
@@ -2986,7 +2986,7 @@ function Rn(e, t) {
|
|
|
2986
2986
|
height: f - d
|
|
2987
2987
|
};
|
|
2988
2988
|
}
|
|
2989
|
-
var zn = class extends
|
|
2989
|
+
var zn = class extends j {
|
|
2990
2990
|
install(e) {
|
|
2991
2991
|
super.install(e), e.scissor = this;
|
|
2992
2992
|
}
|
|
@@ -3048,11 +3048,11 @@ var zn = class extends A {
|
|
|
3048
3048
|
};
|
|
3049
3049
|
constructor(e = S(), t) {
|
|
3050
3050
|
if (super(), !e) throw Error("Failed to createHTMLCanvas");
|
|
3051
|
-
|
|
3051
|
+
$e(e) ? this._setupContext(e, t) : (this.gl = e, this.version = et(this.gl) ? 2 : 1), this._setupBindPoints()._setupExtensions()._setupPolyfill()._setupSupports(), this._systems.forEach((e) => e.install(this)), this._systems.forEach((e) => e.emit("updateContext", this.gl)), this._systems.forEach((e) => e.emit("setup"));
|
|
3052
3052
|
}
|
|
3053
3053
|
_setupContext(e, t) {
|
|
3054
3054
|
this.view = e;
|
|
3055
|
-
let n =
|
|
3055
|
+
let n = ot()?.(e, t), r = n && et(n) ? 2 : 1;
|
|
3056
3056
|
if (n || (n = e.getContext("webgl2", t) || e.getContext("experimental-webgl2", t), r = 2), n || (n = e.getContext("webgl", t) || e.getContext("experimental-webgl", t), r = 1), !n) throw Error("Unable to getContext");
|
|
3057
3057
|
return this.gl = n, this.version = r, this._contextLost = this._contextLost.bind(this), this._contextRestored = this._contextRestored.bind(this), typeof e.addEventListener == "function" && (e.addEventListener("webglcontextlost", this._contextLost, !1), e.addEventListener("webglcontextrestored", this._contextRestored, !1)), this;
|
|
3058
3058
|
}
|
|
@@ -3165,7 +3165,7 @@ var zn = class extends A {
|
|
|
3165
3165
|
super(), this.setProperties(e);
|
|
3166
3166
|
}
|
|
3167
3167
|
};
|
|
3168
|
-
|
|
3168
|
+
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], Un.prototype, "usage", void 0), k([_({ default: () => new Uint32Array() }), O("design:type", Object)], Un.prototype, "data", void 0);
|
|
3169
3169
|
//#endregion
|
|
3170
3170
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3171
3171
|
var Wn = class extends w {
|
|
@@ -3176,32 +3176,32 @@ var Wn = class extends w {
|
|
|
3176
3176
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3177
3177
|
}
|
|
3178
3178
|
};
|
|
3179
|
-
|
|
3179
|
+
k([_({ fallback: "triangle-list" }), O("design:type", Object)], Wn.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], Wn.prototype, "attributes", void 0), k([_({ default: () => new Un() }), O("design:type", Un === void 0 ? Object : Un)], Wn.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Wn.prototype, "instanceCount", void 0);
|
|
3180
3180
|
//#endregion
|
|
3181
3181
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3182
|
-
var
|
|
3182
|
+
var P = class extends w {
|
|
3183
3183
|
constructor(e) {
|
|
3184
3184
|
super(), this.setProperties(e);
|
|
3185
3185
|
}
|
|
3186
3186
|
};
|
|
3187
|
-
|
|
3187
|
+
k([_({ fallback: A.vertex }), O("design:type", A === void 0 ? Object : A)], P.prototype, "usage", void 0), k([_({ default: () => new Float32Array() }), O("design:type", Object)], P.prototype, "data", void 0);
|
|
3188
3188
|
//#endregion
|
|
3189
3189
|
//#region src/scene/resources/geometries/VertexAttribute.ts
|
|
3190
|
-
var
|
|
3190
|
+
var F = class extends w {
|
|
3191
3191
|
constructor(e) {
|
|
3192
3192
|
super(), this.setProperties(e);
|
|
3193
3193
|
}
|
|
3194
3194
|
};
|
|
3195
|
-
|
|
3195
|
+
k([_({ default: () => new P() }), O("design:type", P === void 0 ? Object : P)], F.prototype, "buffer", void 0), k([_({ fallback: "float32" }), O("design:type", Object)], F.prototype, "format", void 0), k([_(), O("design:type", Boolean)], F.prototype, "instance", void 0), k([_(), O("design:type", Number)], F.prototype, "stride", void 0), k([_(), O("design:type", Number)], F.prototype, "offset", void 0), k([_(), O("design:type", Number)], F.prototype, "start", void 0), k([_(), O("design:type", Number)], F.prototype, "divisor", void 0);
|
|
3196
3196
|
//#endregion
|
|
3197
3197
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3198
3198
|
var Gn = class extends Wn {
|
|
3199
3199
|
constructor() {
|
|
3200
3200
|
super({
|
|
3201
3201
|
topology: "triangle-strip",
|
|
3202
|
-
attributes: { position: new
|
|
3202
|
+
attributes: { position: new F({
|
|
3203
3203
|
format: "float32x2",
|
|
3204
|
-
buffer: new
|
|
3204
|
+
buffer: new P({ data: new Float32Array([
|
|
3205
3205
|
0,
|
|
3206
3206
|
0,
|
|
3207
3207
|
1,
|
|
@@ -3255,7 +3255,7 @@ function Kn() {
|
|
|
3255
3255
|
])
|
|
3256
3256
|
};
|
|
3257
3257
|
}
|
|
3258
|
-
var
|
|
3258
|
+
var I = class extends w {
|
|
3259
3259
|
static instance = new this();
|
|
3260
3260
|
glProgram;
|
|
3261
3261
|
constructor(e = {}) {
|
|
@@ -3274,7 +3274,7 @@ var F = class extends w {
|
|
|
3274
3274
|
}, e.shader.updateUniforms(this);
|
|
3275
3275
|
}
|
|
3276
3276
|
};
|
|
3277
|
-
|
|
3277
|
+
k([_({ default: Kn }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
|
|
3278
3278
|
//#endregion
|
|
3279
3279
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3280
3280
|
var qn = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, Jn = /vec(\d)\((.*)\)/;
|
|
@@ -3289,7 +3289,7 @@ function Yn(e) {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
return Number(e);
|
|
3291
3291
|
}
|
|
3292
|
-
var Xn = class e extends
|
|
3292
|
+
var Xn = class e extends I {
|
|
3293
3293
|
static RE = {
|
|
3294
3294
|
getColor: /\sgetColor\s*\(/,
|
|
3295
3295
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3330,7 +3330,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3330
3330
|
this.uniforms[t.trim()] = Yn(e[2]);
|
|
3331
3331
|
});
|
|
3332
3332
|
}
|
|
3333
|
-
}, Zn = class extends
|
|
3333
|
+
}, Zn = class extends I {
|
|
3334
3334
|
static _instance;
|
|
3335
3335
|
static get instance() {
|
|
3336
3336
|
return this._instance ??= new this();
|
|
@@ -3374,7 +3374,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3374
3374
|
}
|
|
3375
3375
|
});
|
|
3376
3376
|
}
|
|
3377
|
-
},
|
|
3377
|
+
}, L = class extends Wn {
|
|
3378
3378
|
static _instance;
|
|
3379
3379
|
static get instance() {
|
|
3380
3380
|
return this._instance ??= new this();
|
|
@@ -3385,9 +3385,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3385
3385
|
constructor() {
|
|
3386
3386
|
super({
|
|
3387
3387
|
attributes: {
|
|
3388
|
-
position: new
|
|
3388
|
+
position: new F({
|
|
3389
3389
|
format: "float32x2",
|
|
3390
|
-
buffer: new
|
|
3390
|
+
buffer: new P({ data: new Float32Array([
|
|
3391
3391
|
-1,
|
|
3392
3392
|
-1,
|
|
3393
3393
|
1,
|
|
@@ -3398,9 +3398,9 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3398
3398
|
1
|
|
3399
3399
|
]) })
|
|
3400
3400
|
}),
|
|
3401
|
-
uv: new
|
|
3401
|
+
uv: new F({
|
|
3402
3402
|
format: "float32x2",
|
|
3403
|
-
buffer: new
|
|
3403
|
+
buffer: new P({ data: new Float32Array([
|
|
3404
3404
|
0,
|
|
3405
3405
|
0,
|
|
3406
3406
|
1,
|
|
@@ -3426,15 +3426,15 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3426
3426
|
positionBuffer;
|
|
3427
3427
|
uvBuffer;
|
|
3428
3428
|
constructor(e) {
|
|
3429
|
-
let t = new
|
|
3429
|
+
let t = new P({ data: new Float32Array() }), n = new P({ data: new Float32Array() });
|
|
3430
3430
|
super({
|
|
3431
3431
|
...e,
|
|
3432
3432
|
attributes: {
|
|
3433
|
-
position: new
|
|
3433
|
+
position: new F({
|
|
3434
3434
|
format: "float32x2",
|
|
3435
3435
|
buffer: t
|
|
3436
3436
|
}),
|
|
3437
|
-
uv: new
|
|
3437
|
+
uv: new F({
|
|
3438
3438
|
format: "float32x2",
|
|
3439
3439
|
buffer: n
|
|
3440
3440
|
})
|
|
@@ -3442,7 +3442,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3442
3442
|
indexBuffer: new Un({ data: new Uint32Array() })
|
|
3443
3443
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3444
3444
|
}
|
|
3445
|
-
},
|
|
3445
|
+
}, R = class extends w {
|
|
3446
3446
|
get valid() {
|
|
3447
3447
|
return !!(this.width && this.height);
|
|
3448
3448
|
}
|
|
@@ -3456,10 +3456,10 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3456
3456
|
super._destroy(), this.colorTextures.forEach((e) => e.destroy());
|
|
3457
3457
|
}
|
|
3458
3458
|
};
|
|
3459
|
-
|
|
3459
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "isRoot", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], R.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], R.prototype, "msaa", void 0), k([_({ default: () => [new z()] }), O("design:type", Array)], R.prototype, "colorTextures", void 0);
|
|
3460
3460
|
//#endregion
|
|
3461
3461
|
//#region src/scene/resources/textures/Texture2D.ts
|
|
3462
|
-
var
|
|
3462
|
+
var z = class extends w {
|
|
3463
3463
|
static get EMPTY() {
|
|
3464
3464
|
return new this({
|
|
3465
3465
|
width: 1,
|
|
@@ -3550,7 +3550,7 @@ var R = class extends w {
|
|
|
3550
3550
|
switch (super._updateProperty(e, t, n), e) {
|
|
3551
3551
|
case "width":
|
|
3552
3552
|
case "height":
|
|
3553
|
-
this.isPowerOfTwo =
|
|
3553
|
+
this.isPowerOfTwo = we(this.pixelWidth) && we(this.pixelHeight);
|
|
3554
3554
|
break;
|
|
3555
3555
|
case "source":
|
|
3556
3556
|
this.updateSize();
|
|
@@ -3567,10 +3567,10 @@ var R = class extends w {
|
|
|
3567
3567
|
e.texture.unbind(this);
|
|
3568
3568
|
}
|
|
3569
3569
|
_destroy() {
|
|
3570
|
-
super._destroy(),
|
|
3570
|
+
super._destroy(), Pe && this.source instanceof ImageBitmap && this.source.close();
|
|
3571
3571
|
}
|
|
3572
3572
|
};
|
|
3573
|
-
|
|
3573
|
+
k([_({ fallback: "unknown" }), O("design:type", String)], z.prototype, "uploadMethodId", void 0), k([_({ internal: !0 }), O("design:type", Object)], z.prototype, "source", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], z.prototype, "height", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "pixelRatio", void 0), k([_({ fallback: "bgra8unorm" }), O("design:type", Object)], z.prototype, "format", void 0), k([_({ fallback: "premultiply-alpha-on-upload" }), O("design:type", Object)], z.prototype, "alphaMode", void 0), k([_({ fallback: 1 }), O("design:type", Number)], z.prototype, "mipLevelCount", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "mipmap", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeU", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeV", void 0), k([_({ fallback: "clamp-to-edge" }), O("design:type", Object)], z.prototype, "addressModeW", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "magFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "minFilter", void 0), k([_({ fallback: "linear" }), O("design:type", Object)], z.prototype, "mipmapFilter", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], z.prototype, "isPowerOfTwo", void 0);
|
|
3574
3574
|
//#endregion
|
|
3575
3575
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3576
3576
|
var $n = class extends w {
|
|
@@ -3583,7 +3583,7 @@ var $n = class extends w {
|
|
|
3583
3583
|
super();
|
|
3584
3584
|
let t;
|
|
3585
3585
|
if (Array.isArray(e)) t = e;
|
|
3586
|
-
else if (e instanceof
|
|
3586
|
+
else if (e instanceof z) t = [{
|
|
3587
3587
|
texture: e,
|
|
3588
3588
|
duration: 0
|
|
3589
3589
|
}];
|
|
@@ -3598,7 +3598,7 @@ var $n = class extends w {
|
|
|
3598
3598
|
e.texture.destroy();
|
|
3599
3599
|
});
|
|
3600
3600
|
}
|
|
3601
|
-
}, er = class extends
|
|
3601
|
+
}, er = class extends z {
|
|
3602
3602
|
constructor(e = {}) {
|
|
3603
3603
|
super({
|
|
3604
3604
|
pixelRatio: 2,
|
|
@@ -3618,7 +3618,7 @@ var $n = class extends w {
|
|
|
3618
3618
|
}
|
|
3619
3619
|
super._updateProperty(e, t, n);
|
|
3620
3620
|
}
|
|
3621
|
-
}, tr = class e extends
|
|
3621
|
+
}, tr = class e extends z {
|
|
3622
3622
|
static _cached = /* @__PURE__ */ new Map();
|
|
3623
3623
|
static get(t) {
|
|
3624
3624
|
let n = new T(t), r = n.toHex(), i = this._cached.get(r);
|
|
@@ -3639,7 +3639,7 @@ var $n = class extends w {
|
|
|
3639
3639
|
mipmap: !0
|
|
3640
3640
|
});
|
|
3641
3641
|
}
|
|
3642
|
-
}, nr = class e extends
|
|
3642
|
+
}, nr = class e extends z {
|
|
3643
3643
|
static test(e) {
|
|
3644
3644
|
return u(e);
|
|
3645
3645
|
}
|
|
@@ -3673,7 +3673,7 @@ var $n = class extends w {
|
|
|
3673
3673
|
constructor(t, n, r) {
|
|
3674
3674
|
super(e.linearGradient(t, n, r));
|
|
3675
3675
|
}
|
|
3676
|
-
}, rr = class extends
|
|
3676
|
+
}, rr = class extends z {
|
|
3677
3677
|
constructor(e = {}) {
|
|
3678
3678
|
super({
|
|
3679
3679
|
...e,
|
|
@@ -3694,7 +3694,7 @@ function ir(e) {
|
|
|
3694
3694
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3695
3695
|
};
|
|
3696
3696
|
}
|
|
3697
|
-
var ar = class e extends
|
|
3697
|
+
var ar = class e extends z {
|
|
3698
3698
|
static mimeTypes = new Map(Object.entries({
|
|
3699
3699
|
ogv: "video/ogg",
|
|
3700
3700
|
mov: "video/quicktime",
|
|
@@ -3729,12 +3729,12 @@ var ar = class e extends R {
|
|
|
3729
3729
|
_seekResolves = [];
|
|
3730
3730
|
constructor(t, n) {
|
|
3731
3731
|
let r = ir(n);
|
|
3732
|
-
if (!
|
|
3732
|
+
if (!Ze(t)) {
|
|
3733
3733
|
typeof t == "string" && (t = [t]);
|
|
3734
3734
|
let n = t[0].src || t[0];
|
|
3735
3735
|
if (typeof document > "u") throw TypeError("VideoTexture requires a DOM <video> element and is not supported in non-browser environments.");
|
|
3736
3736
|
let i = document.createElement("video");
|
|
3737
|
-
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""),
|
|
3737
|
+
r.autoLoad && i.setAttribute("preload", "auto"), r.playsinline && (i.setAttribute("webkit-playsinline", ""), i.setAttribute("playsinline", "")), r.muted && (i.setAttribute("muted", ""), i.muted = !0), r.loop && i.setAttribute("loop", ""), r.autoPlay && i.setAttribute("autoplay", ""), ct(i, n, r.crossorigin);
|
|
3738
3738
|
for (let n = 0; n < t.length; ++n) {
|
|
3739
3739
|
let { src: r, mime: a } = t[n];
|
|
3740
3740
|
if (r ||= t[n], r.startsWith("data:")) a = r.slice(5, r.indexOf(";"));
|
|
@@ -3821,16 +3821,16 @@ var ar = class e extends R {
|
|
|
3821
3821
|
e && (e.removeEventListener("play", this._onPlayStart), e.removeEventListener("pause", this._onPlayStop), e.removeEventListener("seeked", this._onSeeked), e.removeEventListener("canplay", this._onCanPlay), e.removeEventListener("canplaythrough", this._onCanPlay), e.removeEventListener("error", this._onError, !0), e.pause(), e.src = "", e.load());
|
|
3822
3822
|
}
|
|
3823
3823
|
};
|
|
3824
|
-
|
|
3824
|
+
k([_({
|
|
3825
3825
|
internal: !0,
|
|
3826
3826
|
fallback: !0
|
|
3827
|
-
}),
|
|
3827
|
+
}), O("design:type", Boolean)], ar.prototype, "autoUpdate", void 0), k([_({
|
|
3828
3828
|
internal: !0,
|
|
3829
3829
|
fallback: 0
|
|
3830
|
-
}),
|
|
3830
|
+
}), O("design:type", Number)], ar.prototype, "fps", void 0);
|
|
3831
3831
|
//#endregion
|
|
3832
3832
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
3833
|
-
var or = class extends
|
|
3833
|
+
var or = class extends z {}, sr = class extends le {
|
|
3834
3834
|
fillStyle;
|
|
3835
3835
|
fillRule;
|
|
3836
3836
|
strokeStyle;
|
|
@@ -3844,7 +3844,7 @@ var or = class extends R {}, sr = class extends le {
|
|
|
3844
3844
|
_draws = [];
|
|
3845
3845
|
_triCache = [];
|
|
3846
3846
|
_parseDrawStyle(e) {
|
|
3847
|
-
return e ? e instanceof
|
|
3847
|
+
return e ? e instanceof z ? { texture: e } : { texture: tr.get(e) } : {};
|
|
3848
3848
|
}
|
|
3849
3849
|
stroke(e) {
|
|
3850
3850
|
if (!this.curves.length) return;
|
|
@@ -4008,10 +4008,10 @@ function fr(e) {
|
|
|
4008
4008
|
let t = dr[e] ?? 0;
|
|
4009
4009
|
return t++, dr[e] = t, t;
|
|
4010
4010
|
}
|
|
4011
|
-
var
|
|
4011
|
+
var B = ur = class extends C {
|
|
4012
4012
|
static parse(e, t = "Node") {
|
|
4013
4013
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4014
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((
|
|
4014
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ye.get(n ?? r.inCanvasIs ?? t)) ?? ur)({
|
|
4015
4015
|
...a,
|
|
4016
4016
|
meta: r
|
|
4017
4017
|
});
|
|
@@ -4371,13 +4371,13 @@ var z = ur = class extends C {
|
|
|
4371
4371
|
});
|
|
4372
4372
|
}
|
|
4373
4373
|
};
|
|
4374
|
-
|
|
4374
|
+
k([_({ default: () => c() }), O("design:type", String)], B.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], B.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], B.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], B.prototype, "internalMode", void 0), k([_({
|
|
4375
4375
|
internal: !0,
|
|
4376
4376
|
default: !0
|
|
4377
|
-
}),
|
|
4377
|
+
}), O("design:type", Boolean)], B.prototype, "needsRender", void 0), B = ur = k([b("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], B);
|
|
4378
4378
|
//#endregion
|
|
4379
4379
|
//#region src/scene/main/TimelineNode.ts
|
|
4380
|
-
var
|
|
4380
|
+
var V = class extends B {
|
|
4381
4381
|
insideTimeRange = !1;
|
|
4382
4382
|
get _timeline() {
|
|
4383
4383
|
return this._tree?.timeline;
|
|
@@ -4408,7 +4408,7 @@ var B = class extends z {
|
|
|
4408
4408
|
return this._globalStartTime + this._globalDuration;
|
|
4409
4409
|
}
|
|
4410
4410
|
get currentTimeProgress() {
|
|
4411
|
-
return this._duration ?
|
|
4411
|
+
return this._duration ? E(this._currentTime / this._duration, 0, 1) : 0;
|
|
4412
4412
|
}
|
|
4413
4413
|
isInsideTimeRange() {
|
|
4414
4414
|
let e = this._currentTime;
|
|
@@ -4448,7 +4448,7 @@ var B = class extends z {
|
|
|
4448
4448
|
super._process(e), this._updateCurrentTime();
|
|
4449
4449
|
}
|
|
4450
4450
|
};
|
|
4451
|
-
|
|
4451
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], V.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], V.prototype, "paused", void 0), V = k([b("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
|
|
4452
4452
|
//#endregion
|
|
4453
4453
|
//#region src/scene/main/CanvasItem.ts
|
|
4454
4454
|
var pr = [], mr = 0;
|
|
@@ -4459,7 +4459,7 @@ function gr(e, t, n, r) {
|
|
|
4459
4459
|
let i = pr[mr];
|
|
4460
4460
|
return i || (i = {}, pr[mr] = i), mr++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i;
|
|
4461
4461
|
}
|
|
4462
|
-
var _r = class extends
|
|
4462
|
+
var _r = class extends V {
|
|
4463
4463
|
_blendMode;
|
|
4464
4464
|
_parentGlobalVisible;
|
|
4465
4465
|
_globalVisible;
|
|
@@ -4539,7 +4539,7 @@ var _r = class extends B {
|
|
|
4539
4539
|
}
|
|
4540
4540
|
_updateGlobalOpacity() {
|
|
4541
4541
|
this._parentGlobalOpacity = this.getParent()?.opacity;
|
|
4542
|
-
let e =
|
|
4542
|
+
let e = E(this.opacity, 0, 1) * (this._parentGlobalOpacity ?? 1);
|
|
4543
4543
|
this._globalOpacity !== e && (this._globalOpacity = e, this._updateModulate(), this.requestPaint(), this.updateRenderable());
|
|
4544
4544
|
}
|
|
4545
4545
|
_draw() {
|
|
@@ -4617,19 +4617,19 @@ var _r = class extends B {
|
|
|
4617
4617
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4618
4618
|
}
|
|
4619
4619
|
};
|
|
4620
|
-
|
|
4620
|
+
k([_(), O("design:type", Object)], _r.prototype, "blendMode", void 0), k([_({
|
|
4621
4621
|
internal: !0,
|
|
4622
4622
|
fallback: !0
|
|
4623
|
-
}),
|
|
4623
|
+
}), O("design:type", Boolean)], _r.prototype, "visible", void 0), k([_({
|
|
4624
4624
|
internal: !0,
|
|
4625
4625
|
fallback: 1
|
|
4626
|
-
}),
|
|
4626
|
+
}), O("design:type", Number)], _r.prototype, "opacity", void 0), _r = k([b("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], _r);
|
|
4627
4627
|
//#endregion
|
|
4628
4628
|
//#region src/scene/main/Viewport.ts
|
|
4629
|
-
var
|
|
4629
|
+
var H = class extends B {
|
|
4630
4630
|
canvasTransform = new v();
|
|
4631
4631
|
renderTargetIndex = 0;
|
|
4632
|
-
renderTargets = [new
|
|
4632
|
+
renderTargets = [new R(), new R()];
|
|
4633
4633
|
get valid() {
|
|
4634
4634
|
return !!(this.width && this.height);
|
|
4635
4635
|
}
|
|
@@ -4676,7 +4676,7 @@ var V = class extends z {
|
|
|
4676
4676
|
return !1;
|
|
4677
4677
|
}
|
|
4678
4678
|
activateWithCopy(e, t) {
|
|
4679
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0),
|
|
4679
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, Zn.instance, { sampler: 0 }));
|
|
4680
4680
|
}
|
|
4681
4681
|
renderStart(e, t) {
|
|
4682
4682
|
this.activate(e, t) && e.clear();
|
|
@@ -4689,7 +4689,7 @@ var V = class extends z {
|
|
|
4689
4689
|
this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
|
|
4690
4690
|
}
|
|
4691
4691
|
getRect() {
|
|
4692
|
-
return new
|
|
4692
|
+
return new yt(this.x, this.y, this.width, this.height);
|
|
4693
4693
|
}
|
|
4694
4694
|
toCanvasGlobal(e, t) {
|
|
4695
4695
|
return this.canvasTransform.applyAffineInverse(e, t);
|
|
@@ -4701,16 +4701,16 @@ var V = class extends z {
|
|
|
4701
4701
|
super._destroy(), this.canvasTransform.destroy(), this.renderTargets.forEach((e) => e.destroy());
|
|
4702
4702
|
}
|
|
4703
4703
|
};
|
|
4704
|
-
|
|
4704
|
+
k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "x", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "y", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "width", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "height", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "mipLevel", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "msaa", void 0), H = k([b("Viewport")], H);
|
|
4705
4705
|
//#endregion
|
|
4706
4706
|
//#region src/scene/main/Effect.ts
|
|
4707
|
-
var
|
|
4707
|
+
var U = class extends V {
|
|
4708
4708
|
material;
|
|
4709
4709
|
get _effectMode() {
|
|
4710
4710
|
return this.effectMode ?? "parent";
|
|
4711
4711
|
}
|
|
4712
|
-
viewport1 = new
|
|
4713
|
-
viewport2 = new
|
|
4712
|
+
viewport1 = new H();
|
|
4713
|
+
viewport2 = new H();
|
|
4714
4714
|
_renderId = 0;
|
|
4715
4715
|
_renderViewport;
|
|
4716
4716
|
_previousSibling;
|
|
@@ -4762,7 +4762,7 @@ var H = class extends B {
|
|
|
4762
4762
|
}
|
|
4763
4763
|
}
|
|
4764
4764
|
getRect() {
|
|
4765
|
-
return new
|
|
4765
|
+
return new yt(this._rect);
|
|
4766
4766
|
}
|
|
4767
4767
|
_processParent() {
|
|
4768
4768
|
let e = this._tree?.renderStack;
|
|
@@ -4915,13 +4915,13 @@ var H = class extends B {
|
|
|
4915
4915
|
}
|
|
4916
4916
|
apply(e, t, n) {
|
|
4917
4917
|
this.material && (n?.redraw ? t.redraw(e, () => {
|
|
4918
|
-
|
|
4918
|
+
L.draw(e, this.material, {
|
|
4919
4919
|
from: 0,
|
|
4920
4920
|
to: 1,
|
|
4921
4921
|
progress: this.currentTimeProgress,
|
|
4922
4922
|
ratio: t.width / t.height
|
|
4923
4923
|
});
|
|
4924
|
-
}) :
|
|
4924
|
+
}) : L.draw(e, this.material, {
|
|
4925
4925
|
from: 0,
|
|
4926
4926
|
to: 1,
|
|
4927
4927
|
progress: this.currentTimeProgress,
|
|
@@ -4932,7 +4932,7 @@ var H = class extends B {
|
|
|
4932
4932
|
super._destroy(), this.viewport1.destroy(), this.viewport2.destroy();
|
|
4933
4933
|
}
|
|
4934
4934
|
};
|
|
4935
|
-
|
|
4935
|
+
k([_({ internal: !0 }), O("design:type", Object)], U.prototype, "material", void 0), k([_(), O("design:type", Object)], U.prototype, "effectMode", void 0), k([_(), O("design:type", String)], U.prototype, "glsl", void 0), k([_(), O("design:type", String)], U.prototype, "glslSrc", void 0), U = k([b("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], U);
|
|
4936
4936
|
//#endregion
|
|
4937
4937
|
//#region src/scene/main/RenderStack.ts
|
|
4938
4938
|
var vr = class {
|
|
@@ -4957,7 +4957,7 @@ var vr = class {
|
|
|
4957
4957
|
});
|
|
4958
4958
|
}), this.calls = [];
|
|
4959
4959
|
}
|
|
4960
|
-
}, yr, br = yr = class extends
|
|
4960
|
+
}, yr, br = yr = class extends B {
|
|
4961
4961
|
currentTime = 0;
|
|
4962
4962
|
static from(e, t = !1) {
|
|
4963
4963
|
let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
|
|
@@ -4979,16 +4979,16 @@ var vr = class {
|
|
|
4979
4979
|
}
|
|
4980
4980
|
addTime(e) {
|
|
4981
4981
|
let t = this.endTime, n = Math.min(this.startTime, this.endTime), r = this.currentTime;
|
|
4982
|
-
return r += e, this.loop && r > t && (r = n + r % t), r =
|
|
4982
|
+
return r += e, this.loop && r > t && (r = n + r % t), r = E(r, n, t), this.currentTime = r, this.emit("updateCurrentTime", r, e), this;
|
|
4983
4983
|
}
|
|
4984
4984
|
_process(e) {
|
|
4985
4985
|
super._process(e), this.paused || this.addTime(e);
|
|
4986
4986
|
}
|
|
4987
4987
|
};
|
|
4988
|
-
|
|
4988
|
+
k([_({ fallback: 0 }), O("design:type", Number)], br.prototype, "startTime", void 0), k([_({ fallback: 2 ** 53 - 1 }), O("design:type", Number)], br.prototype, "endTime", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], br.prototype, "loop", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], br.prototype, "paused", void 0), br = yr = k([b("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], br);
|
|
4989
4989
|
//#endregion
|
|
4990
4990
|
//#region src/scene/main/Window.ts
|
|
4991
|
-
var xr = class extends
|
|
4991
|
+
var xr = class extends H {
|
|
4992
4992
|
constructor() {
|
|
4993
4993
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
4994
4994
|
}
|
|
@@ -4999,18 +4999,21 @@ var xr = class extends V {
|
|
|
4999
4999
|
super.flush(e), this.finish(e);
|
|
5000
5000
|
}
|
|
5001
5001
|
};
|
|
5002
|
-
xr =
|
|
5002
|
+
xr = k([b("Window", {
|
|
5003
5003
|
processMode: "always",
|
|
5004
5004
|
renderMode: "always"
|
|
5005
|
-
}),
|
|
5005
|
+
}), O("design:paramtypes", [])], xr);
|
|
5006
5006
|
//#endregion
|
|
5007
5007
|
//#region src/scene/main/SceneTree.ts
|
|
5008
5008
|
var Sr = class extends Tt {
|
|
5009
|
-
input = new
|
|
5009
|
+
input = new _t();
|
|
5010
5010
|
renderStack = new vr();
|
|
5011
5011
|
root = new xr().setTree(this);
|
|
5012
5012
|
timeline = new br().setTree(this);
|
|
5013
5013
|
nodeMap = /* @__PURE__ */ new Map();
|
|
5014
|
+
_boundFonts;
|
|
5015
|
+
_textRemeasureScheduled = !1;
|
|
5016
|
+
_onFontLoad = () => this._scheduleTextRemeasure();
|
|
5014
5017
|
_backgroundColor = new T();
|
|
5015
5018
|
_previousViewport;
|
|
5016
5019
|
_currentViewport;
|
|
@@ -5027,13 +5030,27 @@ var Sr = class extends Tt {
|
|
|
5027
5030
|
return this.nodeMap.get(e);
|
|
5028
5031
|
}
|
|
5029
5032
|
constructor(e) {
|
|
5030
|
-
super(), this.on("nodeEnter", (e) => this.nodeMap.set(e.id, e)), this.on("nodeExit", (e) => this.nodeMap.delete(e.id)), this.setProperties(e);
|
|
5033
|
+
super(), this.on("nodeEnter", (e) => this.nodeMap.set(e.id, e)), this.on("nodeExit", (e) => this.nodeMap.delete(e.id)), this.setProperties(e), this._bindFonts(this.fonts);
|
|
5034
|
+
}
|
|
5035
|
+
_bindFonts(e) {
|
|
5036
|
+
this._boundFonts !== e && (this._boundFonts?.off("load", this._onFontLoad), this._boundFonts = e, e?.on("load", this._onFontLoad));
|
|
5037
|
+
}
|
|
5038
|
+
_scheduleTextRemeasure() {
|
|
5039
|
+
this._textRemeasureScheduled || (this._textRemeasureScheduled = !0, queueMicrotask(() => {
|
|
5040
|
+
this._textRemeasureScheduled = !1, this.nodeMap.forEach((e) => {
|
|
5041
|
+
let t = e.text;
|
|
5042
|
+
t?.enabled && typeof t.update == "function" && t.update();
|
|
5043
|
+
});
|
|
5044
|
+
}));
|
|
5031
5045
|
}
|
|
5032
5046
|
_updateProperty(e, t, n) {
|
|
5033
5047
|
switch (super._updateProperty(e, t, n), e) {
|
|
5034
5048
|
case "backgroundColor":
|
|
5035
5049
|
this._backgroundColor.value = t;
|
|
5036
5050
|
break;
|
|
5051
|
+
case "fonts":
|
|
5052
|
+
this._bindFonts(t), this._scheduleTextRemeasure();
|
|
5053
|
+
break;
|
|
5037
5054
|
}
|
|
5038
5055
|
}
|
|
5039
5056
|
setProperties(e) {
|
|
@@ -5055,33 +5072,33 @@ var Sr = class extends Tt {
|
|
|
5055
5072
|
_renderScreen(e) {
|
|
5056
5073
|
this.root.finish(e), e.state.reset(), e.renderTarget.unbind(), this.backgroundColor && e.gl.clearColor(...this._backgroundColor.toArray()), e.clear(), this.backgroundColor && e.gl.clearColor(0, 0, 0, 0);
|
|
5057
5074
|
let t = this.root.texture;
|
|
5058
|
-
t.activate(e, 0),
|
|
5075
|
+
t.activate(e, 0), L.draw(e), t.inactivate(e);
|
|
5059
5076
|
}
|
|
5060
5077
|
_destroy() {
|
|
5061
|
-
super._destroy(), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5078
|
+
super._destroy(), this._bindFonts(void 0), this.root.destroy(), this.input.destroy(), this.nodeMap.clear();
|
|
5062
5079
|
}
|
|
5063
5080
|
};
|
|
5064
|
-
|
|
5081
|
+
k([_({ alias: "root.msaa" }), O("design:type", Boolean)], Sr.prototype, "msaa", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Sr.prototype, "pixelate", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Sr.prototype, "roundPixels", void 0), k([_(), O("design:type", Object)], Sr.prototype, "backgroundColor", void 0), k([_({
|
|
5065
5082
|
internal: !0,
|
|
5066
5083
|
fallback: !1
|
|
5067
|
-
}),
|
|
5084
|
+
}), O("design:type", Boolean)], Sr.prototype, "debug", void 0), k([_({
|
|
5068
5085
|
internal: !0,
|
|
5069
5086
|
fallback: !1
|
|
5070
|
-
}),
|
|
5087
|
+
}), O("design:type", Boolean)], Sr.prototype, "processPaused", void 0), k([_({
|
|
5071
5088
|
internal: !0,
|
|
5072
|
-
default: () =>
|
|
5073
|
-
}),
|
|
5089
|
+
default: () => ge
|
|
5090
|
+
}), O("design:type", Object)], Sr.prototype, "fonts", void 0);
|
|
5074
5091
|
//#endregion
|
|
5075
5092
|
//#region src/scene/main/Transition.ts
|
|
5076
|
-
var Cr = class extends
|
|
5093
|
+
var Cr = class extends U {
|
|
5077
5094
|
constructor(e, t = []) {
|
|
5078
5095
|
super(), this.setProperties(e).append(t);
|
|
5079
5096
|
}
|
|
5080
5097
|
};
|
|
5081
|
-
Cr =
|
|
5098
|
+
Cr = k([b("Transition", {
|
|
5082
5099
|
effectMode: "transition",
|
|
5083
5100
|
duration: 2e3
|
|
5084
|
-
}),
|
|
5101
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Cr);
|
|
5085
5102
|
//#endregion
|
|
5086
5103
|
//#region src/scene/2d/Node2D.ts
|
|
5087
5104
|
var wr = class extends _r {
|
|
@@ -5136,7 +5153,7 @@ var wr = class extends _r {
|
|
|
5136
5153
|
super._destroy(), this.position.destroy(), this.scale.destroy(), this.skew.destroy(), this.pivot.destroy(), this.extraTransform.destroy(), this.transform.destroy(), this.globalPosition.destroy(), this.globalScale.destroy(), this.globalSkew.destroy(), this.globalTransform.destroy();
|
|
5137
5154
|
}
|
|
5138
5155
|
};
|
|
5139
|
-
wr =
|
|
5156
|
+
wr = k([b("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], wr);
|
|
5140
5157
|
//#endregion
|
|
5141
5158
|
//#region src/scene/2d/Camera2D.ts
|
|
5142
5159
|
var Tr = class extends wr {
|
|
@@ -5180,7 +5197,7 @@ var Tr = class extends wr {
|
|
|
5180
5197
|
return this.setZoom(this._zoom.x + e, this._zoom.y + t);
|
|
5181
5198
|
}
|
|
5182
5199
|
setZoom(e, t = e) {
|
|
5183
|
-
return this._zoom.set(
|
|
5200
|
+
return this._zoom.set(E(e, this._minZoom.x, this._maxZoom.x), E(t, this._minZoom.y, this._maxZoom.y)), this;
|
|
5184
5201
|
}
|
|
5185
5202
|
setZoomAtOrigin(e, t, n) {
|
|
5186
5203
|
let r;
|
|
@@ -5253,7 +5270,7 @@ var Tr = class extends wr {
|
|
|
5253
5270
|
});
|
|
5254
5271
|
}
|
|
5255
5272
|
_getZoomByWheel(e, t) {
|
|
5256
|
-
let n = e.ctrlKey &&
|
|
5273
|
+
let n = e.ctrlKey && Je ? 10 : 1, r = -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * n, i = Math.log(t) + r;
|
|
5257
5274
|
return Math.round(Math.exp(i) * 1e4) / 1e4;
|
|
5258
5275
|
}
|
|
5259
5276
|
_updateTransform() {
|
|
@@ -5283,16 +5300,16 @@ var Tr = class extends wr {
|
|
|
5283
5300
|
};
|
|
5284
5301
|
}
|
|
5285
5302
|
};
|
|
5286
|
-
|
|
5303
|
+
k([_({
|
|
5287
5304
|
internal: !0,
|
|
5288
5305
|
fallback: !1
|
|
5289
|
-
}),
|
|
5306
|
+
}), O("design:type", Boolean)], Tr.prototype, "spaceKey", void 0), k([_({
|
|
5290
5307
|
internal: !0,
|
|
5291
5308
|
fallback: !1
|
|
5292
|
-
}),
|
|
5309
|
+
}), O("design:type", Boolean)], Tr.prototype, "grabbing", void 0), Tr = k([b("Camera2D", {
|
|
5293
5310
|
processMode: "disabled",
|
|
5294
5311
|
renderMode: "disabled"
|
|
5295
|
-
}),
|
|
5312
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Tr);
|
|
5296
5313
|
//#endregion
|
|
5297
5314
|
//#region src/scene/2d/element/connectionRouter.ts
|
|
5298
5315
|
function Er(e, t) {
|
|
@@ -5442,7 +5459,7 @@ var Nr = {
|
|
|
5442
5459
|
function Pr(e) {
|
|
5443
5460
|
let t = new St();
|
|
5444
5461
|
if (e === "none") return t;
|
|
5445
|
-
let n =
|
|
5462
|
+
let n = Ae(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5446
5463
|
Object.keys(Nr).forEach((e) => {
|
|
5447
5464
|
n[e] = n[e] ?? Nr[e];
|
|
5448
5465
|
});
|
|
@@ -5450,7 +5467,7 @@ function Pr(e) {
|
|
|
5450
5467
|
let r = n[e];
|
|
5451
5468
|
switch (e) {
|
|
5452
5469
|
case "hue-rotate":
|
|
5453
|
-
t.hueRotate(r *
|
|
5470
|
+
t.hueRotate(r * Ce);
|
|
5454
5471
|
break;
|
|
5455
5472
|
case "saturate":
|
|
5456
5473
|
t.saturate(r);
|
|
@@ -5494,11 +5511,11 @@ function Fr(e) {
|
|
|
5494
5511
|
}
|
|
5495
5512
|
//#endregion
|
|
5496
5513
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5497
|
-
var Ir,
|
|
5514
|
+
var Ir, W = class extends U {
|
|
5498
5515
|
static {
|
|
5499
5516
|
Ir = this;
|
|
5500
5517
|
}
|
|
5501
|
-
static material = new
|
|
5518
|
+
static material = new I({ gl: {
|
|
5502
5519
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5503
5520
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n c.rgb *= c.a;\n }\n gl_FragColor = c * alpha;\n}"
|
|
5504
5521
|
} });
|
|
@@ -5507,7 +5524,7 @@ var Ir, U = class extends H {
|
|
|
5507
5524
|
}
|
|
5508
5525
|
apply(e, t) {
|
|
5509
5526
|
t.redraw(e, () => {
|
|
5510
|
-
|
|
5527
|
+
L.draw(e, Ir.material, {
|
|
5511
5528
|
sampler: 0,
|
|
5512
5529
|
saturation: this.saturation,
|
|
5513
5530
|
contrast: this.contrast,
|
|
@@ -5521,14 +5538,14 @@ var Ir, U = class extends H {
|
|
|
5521
5538
|
});
|
|
5522
5539
|
}
|
|
5523
5540
|
};
|
|
5524
|
-
|
|
5541
|
+
k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], W.prototype, "gamma", void 0), W = Ir = k([b("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
|
|
5525
5542
|
//#endregion
|
|
5526
5543
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5527
|
-
var Lr, Rr = class extends
|
|
5544
|
+
var Lr, Rr = class extends U {
|
|
5528
5545
|
static {
|
|
5529
5546
|
Lr = this;
|
|
5530
5547
|
}
|
|
5531
|
-
static material = new
|
|
5548
|
+
static material = new I({ gl: {
|
|
5532
5549
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5533
5550
|
fragment: "in vec2 vUv;\nuniform sampler2D sampler;\nuniform float m[20];\n\nvoid main(void) {\n vec4 c = texture2D(sampler, vUv);\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n gl_FragColor = vec4(\n m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4] / 255.0,\n m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9] / 255.0,\n m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,\n m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0\n );\n}"
|
|
5534
5551
|
} });
|
|
@@ -5545,13 +5562,13 @@ var Lr, Rr = class extends H {
|
|
|
5545
5562
|
}
|
|
5546
5563
|
apply(e, t) {
|
|
5547
5564
|
if (!this.filter) return;
|
|
5548
|
-
let n =
|
|
5565
|
+
let n = Ae(this.filter), r = this._colorMatrix.identity();
|
|
5549
5566
|
n.forEach(({ name: e, args: t }) => {
|
|
5550
5567
|
let n = t.map((e) => e.normalizedIntValue);
|
|
5551
5568
|
switch (e) {
|
|
5552
5569
|
case "hue-rotate":
|
|
5553
5570
|
case "hueRotate":
|
|
5554
|
-
r.hueRotate(n[0] *
|
|
5571
|
+
r.hueRotate(n[0] * Ce);
|
|
5555
5572
|
break;
|
|
5556
5573
|
case "saturate":
|
|
5557
5574
|
r.saturate(n[0]);
|
|
@@ -5576,21 +5593,21 @@ var Lr, Rr = class extends H {
|
|
|
5576
5593
|
break;
|
|
5577
5594
|
}
|
|
5578
5595
|
}), t.redraw(e, () => {
|
|
5579
|
-
|
|
5596
|
+
L.draw(e, Lr.material, {
|
|
5580
5597
|
sampler: 0,
|
|
5581
5598
|
m: r.toArray()
|
|
5582
5599
|
});
|
|
5583
5600
|
});
|
|
5584
5601
|
}
|
|
5585
5602
|
};
|
|
5586
|
-
|
|
5603
|
+
k([_(), O("design:type", String)], Rr.prototype, "filter", void 0), Rr = Lr = k([b("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Rr);
|
|
5587
5604
|
//#endregion
|
|
5588
5605
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
5589
|
-
var zr, Br = 50, Vr = class extends
|
|
5606
|
+
var zr, Br = 50, Vr = class extends U {
|
|
5590
5607
|
static {
|
|
5591
5608
|
zr = this;
|
|
5592
5609
|
}
|
|
5593
|
-
static material = new
|
|
5610
|
+
static material = new I({ gl: {
|
|
5594
5611
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5595
5612
|
fragment: `precision mediump float;
|
|
5596
5613
|
uniform sampler2D sampler;
|
|
@@ -5647,21 +5664,21 @@ void main(void) {
|
|
|
5647
5664
|
0,
|
|
5648
5665
|
0
|
|
5649
5666
|
]);
|
|
5650
|
-
|
|
5667
|
+
L.draw(e, zr.material, {
|
|
5651
5668
|
sampler: 0,
|
|
5652
5669
|
colors: t.slice(0, Br).flatMap((e) => e)
|
|
5653
5670
|
});
|
|
5654
5671
|
});
|
|
5655
5672
|
}
|
|
5656
5673
|
};
|
|
5657
|
-
|
|
5674
|
+
k([_({ default: () => [] }), O("design:type", Array)], Vr.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Vr.prototype, "alpha", void 0), Vr = zr = k([b("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Vr);
|
|
5658
5675
|
//#endregion
|
|
5659
5676
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
5660
|
-
var Hr, Ur = class extends
|
|
5677
|
+
var Hr, Ur = class extends U {
|
|
5661
5678
|
static {
|
|
5662
5679
|
Hr = this;
|
|
5663
5680
|
}
|
|
5664
|
-
static material = new
|
|
5681
|
+
static material = new I({ gl: {
|
|
5665
5682
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5666
5683
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform float epsilon;\nconst int MAX_COLORS = 50;\nuniform vec3 originalColors[MAX_COLORS];\n\nvoid main(void) {\n vec4 color = texture2D(sampler, vUv);\n\n for (int i = 0; i < MAX_COLORS; i++) {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0) {\n break;\n }\n vec3 colorDiff = origColor - color.rgb;\n if (length(colorDiff) < epsilon) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n }\n\n gl_FragColor = color;\n}"
|
|
5667
5684
|
} });
|
|
@@ -5679,7 +5696,7 @@ var Hr, Ur = class extends H {
|
|
|
5679
5696
|
r.slice(0, 50).forEach((e, t) => {
|
|
5680
5697
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
5681
5698
|
}), t.redraw(e, () => {
|
|
5682
|
-
|
|
5699
|
+
L.draw(e, Hr.material, {
|
|
5683
5700
|
sampler: 0,
|
|
5684
5701
|
epsilon: this.epsilon,
|
|
5685
5702
|
originalColors: n
|
|
@@ -5687,14 +5704,14 @@ var Hr, Ur = class extends H {
|
|
|
5687
5704
|
});
|
|
5688
5705
|
}
|
|
5689
5706
|
};
|
|
5690
|
-
|
|
5707
|
+
k([_({ default: () => [] }), O("design:type", Array)], Ur.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ur.prototype, "epsilon", void 0), Ur = Hr = k([b("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ur);
|
|
5691
5708
|
//#endregion
|
|
5692
5709
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
5693
|
-
var Wr, Gr = 50, Kr = class extends
|
|
5710
|
+
var Wr, Gr = 50, Kr = class extends U {
|
|
5694
5711
|
static {
|
|
5695
5712
|
Wr = this;
|
|
5696
5713
|
}
|
|
5697
|
-
static material = new
|
|
5714
|
+
static material = new I({ gl: {
|
|
5698
5715
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5699
5716
|
fragment: `varying vec2 vUv;
|
|
5700
5717
|
uniform sampler2D sampler;
|
|
@@ -5750,7 +5767,7 @@ void main(void) {
|
|
|
5750
5767
|
n.slice(0, Gr).forEach(([e, t], n) => {
|
|
5751
5768
|
i[n * 3] = e[0], i[n * 3 + 1] = e[1], i[n * 3 + 2] = e[2], a[n * 3] = t[0], a[n * 3 + 1] = t[1], a[n * 3 + 2] = t[2];
|
|
5752
5769
|
}), t.redraw(e, () => {
|
|
5753
|
-
|
|
5770
|
+
L.draw(e, Wr.material, {
|
|
5754
5771
|
sampler: 0,
|
|
5755
5772
|
epsilon: r,
|
|
5756
5773
|
originalColors: i,
|
|
@@ -5759,15 +5776,15 @@ void main(void) {
|
|
|
5759
5776
|
});
|
|
5760
5777
|
}
|
|
5761
5778
|
};
|
|
5762
|
-
|
|
5779
|
+
k([_({ default: () => [] }), O("design:type", Array)], Kr.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], Kr.prototype, "epsilon", void 0), Kr = Wr = k([b("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Kr);
|
|
5763
5780
|
//#endregion
|
|
5764
5781
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
5765
|
-
var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Jr,
|
|
5782
|
+
var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nuniform vec2 inputSize;\nuniform vec2 zoom;\nuniform vec2 translate;\nuniform float gridScale;\nuniform vec2 gridSize;\nuniform int checkerboard;\nuniform int checkerboardStyle;\nuniform float dotBackgroundBaseColor;\nuniform float dotBackgroundZoomedOutColor;\nuniform float dotColorDiff;\nuniform int pixelGrid;\nuniform int watermark;\nuniform sampler2D watermarkTexture;\nuniform vec2 watermarkSize;\nuniform vec2 watermarkOffset;\nuniform vec2 watermarkSpacing;\nuniform float watermarkRotation;\nuniform float watermarkAlpha;\n\nconst float VIEWPORT_SPACE_MIN_DOT_RADIUS = 0.5;\nconst float CANVAS_SPACE_DOT_RADIUS = 1.;\nconst float CANVAS_SPACE_DOT_GRID_SIZE_PX = 16.;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_GRID_DARK = 2;\nconst int CHECKERBOARD_STYLE_DOTS = 3;\nconst int CHECKERBOARD_STYLE_DOTS_DARK = 4;\n\nfloat _round(float val) {\n return floor(val + .5);\n}\n\nvec2 _round(vec2 pt) {\n return floor(pt + .5);\n}\n\nfloat scaledGridSize(float zoomScale) {\n if (zoomScale < 0.03125) {\n return 32.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.0625) {\n return 16.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.125) {\n return 8.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.25) {\n return 4.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else if (zoomScale < 0.5) {\n return 2.0 * CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n else {\n return CANVAS_SPACE_DOT_GRID_SIZE_PX;\n }\n}\n\nvec4 renderCheckerboard(vec2 coord, vec4 color) {\n float value;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 1.0 : 0.95;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_GRID_DARK) {\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n value = fractValue.x * fractValue.y < 0.0 ? 0.12 : 0.17;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS || checkerboardStyle == CHECKERBOARD_STYLE_DOTS_DARK) {\n // light vs dark dots share this path; the base/dot colours are supplied as\n // uniforms (set per style on the CPU side), so only the values differ.\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n float dotColor = dotBackgroundZoomedOutColor + dotColorDiff * zoomInterpolationFactor;\n vec2 nearestGridPoint = _round(coord / gridPixelSize) * gridPixelSize;\n float canvasSpaceDist = length(coord - nearestGridPoint);\n float viewportSpaceDist = canvasSpaceDist * zoomScale;\n float viewportSpaceDotRadius = max(VIEWPORT_SPACE_MIN_DOT_RADIUS, CANVAS_SPACE_DOT_RADIUS * zoomScale);\n float dist = 1.0 - smoothstep(0., 1., (viewportSpaceDist - viewportSpaceDotRadius + .5));\n value = mix(dotBackgroundBaseColor, dotColor, dist);\n }\n return vec4(value * (1.0 - color.a) + color.rgb, 1);\n}\n\nvec4 renderPixelGrid(vec2 coord, vec4 color) {\n vec3 rgb = color.rgb;\n vec2 corner = fract(coord);\n float gridWeight = max(float(corner.x < gridSize.x), float(corner.y < gridSize.y));\n vec3 gridColor;\n vec3 weights = vec3(0.299, 0.587, 0.114);\n float c2 = dot(rgb * rgb, weights);\n float luminance = sqrt(c2);\n if (luminance > 0.5) {\n float target = (luminance - 0.05) / luminance;\n gridColor = rgb * target;\n }\n else {\n float target = luminance * 0.8 + 0.15;\n float c1 = dot(rgb, weights);\n float a = 1.0 - 2.0 * c1 + c2;\n float b = c2 - c1;\n gridColor = mix(rgb, vec3(1), (b + sqrt(b * b - a * (c2 - target * target))) / a);\n }\n return vec4(mix(rgb, gridColor, gridWeight), color.a);\n}\n\nvec4 renderWatermark(vec2 coord, vec4 color) {\n float hw = watermarkSize.x * 0.5;\n float hh = watermarkSize.y * 0.5;\n float c = cos(-watermarkRotation);\n float s = sin(-watermarkRotation);\n vec2 blockSize = watermarkSize + watermarkSpacing;\n vec2 tiles = max(floor(inputSize / blockSize), vec2(1.0));\n vec2 gridCoverage = tiles * blockSize;\n vec2 startPos = watermarkOffset;\n vec2 localPix = coord - startPos;\n vec2 blockIndex = floor(localPix / blockSize);\n vec2 wmCenter = startPos + blockIndex * blockSize + watermarkSize * 0.5 + watermarkSpacing / 2.0;\n vec2 local = coord - wmCenter;\n vec2 inv = vec2(\n local.x * c + local.y * s,\n -local.x * s + local.y * c\n );\n if (inv.x >= -hw && inv.x <= hw && inv.y >= -hh && inv.y <= hh) {\n vec2 wmUV = (inv + vec2(hw, hh)) / watermarkSize;\n vec4 wmColor = texture(watermarkTexture, wmUV);\n float alpha = wmColor.a * watermarkAlpha;\n return mix(color, wmColor, alpha);\n } else {\n return color;\n }\n}\n\nvoid main(void) {\n vec4 color = texture(uTexture, vUv);\n vec2 coord = vec2(vUv.x, 1.0 - vUv.y);\n coord = (coord * inputSize - translate) / zoom;\n if (checkerboard > 0) {\n color = renderCheckerboard(coord, color);\n }\n if (watermark > 0) {\n color = renderWatermark(coord, color);\n }\n if (pixelGrid > 0) {\n color = renderPixelGrid(coord, color);\n }\n gl_FragColor = color;\n}\n", Jr, G = class extends U {
|
|
5766
5783
|
static {
|
|
5767
5784
|
Jr = this;
|
|
5768
5785
|
}
|
|
5769
5786
|
_watermark;
|
|
5770
|
-
static material = new
|
|
5787
|
+
static material = new I({ gl: {
|
|
5771
5788
|
vertex: "attribute vec2 position;\nin vec2 uv;\nuniform mat3 projectionMatrix;\nuniform mat3 viewMatrix;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position.xy, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5772
5789
|
fragment: qr
|
|
5773
5790
|
} });
|
|
@@ -5818,7 +5835,7 @@ var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5818
5835
|
zoomedOut: this.dotColor ?? a.zoomedOut,
|
|
5819
5836
|
diff: this.dotZoomDiff ?? a.diff
|
|
5820
5837
|
};
|
|
5821
|
-
|
|
5838
|
+
L.draw(e, Jr.material, {
|
|
5822
5839
|
uTexture: 0,
|
|
5823
5840
|
inputSize: [t.width, t.height],
|
|
5824
5841
|
zoom: [n[0], n[4]],
|
|
@@ -5842,18 +5859,18 @@ var qr = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
5842
5859
|
});
|
|
5843
5860
|
}
|
|
5844
5861
|
};
|
|
5845
|
-
|
|
5862
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], G.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], G.prototype, "pixelGrid", void 0), k([_(), O("design:type", Number)], G.prototype, "dotBaseColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotColor", void 0), k([_(), O("design:type", Number)], G.prototype, "dotZoomDiff", void 0), k([_(), O("design:type", String)], G.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], G.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], G.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], G.prototype, "watermarkRotation", void 0), G = Jr = k([b("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], G);
|
|
5846
5863
|
//#endregion
|
|
5847
5864
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
5848
|
-
var Yr, Xr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", Zr = class extends
|
|
5865
|
+
var Yr, Xr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void) {\n gl_FragColor = vec4(0.0);\n float flag = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 uv = vUv[i];\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {\n flag = 1.0;\n break;\n }\n }\n if (flag == 1.0) {\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;\n } else {\n gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;\n gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;\n gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;\n gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;\n gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;\n gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;\n }\n}", Zr = class extends U {
|
|
5849
5866
|
static {
|
|
5850
5867
|
Yr = this;
|
|
5851
5868
|
}
|
|
5852
|
-
static materialX = new
|
|
5869
|
+
static materialX = new I({ gl: {
|
|
5853
5870
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);\n vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);\n vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);\n vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);\n vUv[4] = uv + vec2(0.0 * uStrength, 0.0);\n vUv[5] = uv + vec2(1.0 * uStrength, 0.0);\n vUv[6] = uv + vec2(2.0 * uStrength, 0.0);\n vUv[7] = uv + vec2(3.0 * uStrength, 0.0);\n vUv[8] = uv + vec2(4.0 * uStrength, 0.0);\n}",
|
|
5854
5871
|
fragment: Xr
|
|
5855
5872
|
} });
|
|
5856
|
-
static materialY = new
|
|
5873
|
+
static materialY = new I({ gl: {
|
|
5857
5874
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nuniform float uStrength;\nvarying vec2 vUv[9];\n\nvoid main(void) {\n gl_Position = vec4(position, 0, 1);\n vUv[0] = uv + vec2(0.0, -4.0 * uStrength);\n vUv[1] = uv + vec2(0.0, -3.0 * uStrength);\n vUv[2] = uv + vec2(0.0, -2.0 * uStrength);\n vUv[3] = uv + vec2(0.0, -1.0 * uStrength);\n vUv[4] = uv + vec2(0.0, 0.0 * uStrength);\n vUv[5] = uv + vec2(0.0, 1.0 * uStrength);\n vUv[6] = uv + vec2(0.0, 2.0 * uStrength);\n vUv[7] = uv + vec2(0.0, 3.0 * uStrength);\n vUv[8] = uv + vec2(0.0, 4.0 * uStrength);\n}",
|
|
5858
5875
|
fragment: Xr
|
|
5859
5876
|
} });
|
|
@@ -5863,39 +5880,39 @@ var Yr, Xr = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
5863
5880
|
apply(e, t) {
|
|
5864
5881
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
5865
5882
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
5866
|
-
|
|
5883
|
+
L.draw(e, Yr.materialX, {
|
|
5867
5884
|
sampler: 0,
|
|
5868
5885
|
uStrength: n * (this.strength / i)
|
|
5869
5886
|
});
|
|
5870
5887
|
});
|
|
5871
5888
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
5872
|
-
|
|
5889
|
+
L.draw(e, Yr.materialY, {
|
|
5873
5890
|
sampler: 0,
|
|
5874
5891
|
uStrength: r * (this.strength / i)
|
|
5875
5892
|
});
|
|
5876
5893
|
});
|
|
5877
5894
|
}
|
|
5878
5895
|
};
|
|
5879
|
-
|
|
5896
|
+
k([_({ fallback: 4 }), O("design:type", Number)], Zr.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Zr.prototype, "quality", void 0), Zr = Yr = k([b("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Zr);
|
|
5880
5897
|
//#endregion
|
|
5881
5898
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
5882
|
-
var Qr, $r = class extends
|
|
5899
|
+
var Qr, $r = class extends U {
|
|
5883
5900
|
static {
|
|
5884
5901
|
Qr = this;
|
|
5885
5902
|
}
|
|
5886
|
-
static material = new
|
|
5903
|
+
static material = new I({ gl: {
|
|
5887
5904
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5888
5905
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float uAlpha;\nuniform vec3 uColor;\nuniform vec2 uOffset;\nuniform vec4 uInputSize;\n\nvoid main(void) {\n vec4 sample = texture2D(sampler, vUv + uOffset * uInputSize.zw);\n sample.rgb = uColor.rgb * sample.a;\n sample *= uAlpha;\n gl_FragColor = sample;\n}"
|
|
5889
5906
|
} });
|
|
5890
5907
|
blurEffect = new Zr();
|
|
5891
|
-
viewport3 = new
|
|
5908
|
+
viewport3 = new H();
|
|
5892
5909
|
_color = new T();
|
|
5893
5910
|
constructor(e, t = []) {
|
|
5894
5911
|
super(), this.setProperties(e).append(t);
|
|
5895
5912
|
}
|
|
5896
5913
|
apply(e, t) {
|
|
5897
5914
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
5898
|
-
this._color.value = this.color,
|
|
5915
|
+
this._color.value = this.color, L.draw(e, Qr.material, {
|
|
5899
5916
|
sampler: 0,
|
|
5900
5917
|
uAlpha: this._color.a,
|
|
5901
5918
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -5908,18 +5925,18 @@ var Qr, $r = class extends H {
|
|
|
5908
5925
|
]
|
|
5909
5926
|
});
|
|
5910
5927
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
5911
|
-
this.viewport3.texture.activate(e, 1),
|
|
5928
|
+
this.viewport3.texture.activate(e, 1), L.draw(e, Zn.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, Zn.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
5912
5929
|
});
|
|
5913
5930
|
}
|
|
5914
5931
|
};
|
|
5915
|
-
|
|
5932
|
+
k([_({ fallback: "#000000FF" }), O("design:type", Object)], $r.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], $r.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], $r.prototype, "shadowOnly", void 0), $r = Qr = k([b("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], $r);
|
|
5916
5933
|
//#endregion
|
|
5917
5934
|
//#region src/scene/effects/EmbossEffect.ts
|
|
5918
|
-
var ei, ti = class extends
|
|
5935
|
+
var ei, ti = class extends U {
|
|
5919
5936
|
static {
|
|
5920
5937
|
ei = this;
|
|
5921
5938
|
}
|
|
5922
|
-
static material = new
|
|
5939
|
+
static material = new I({ gl: {
|
|
5923
5940
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5924
5941
|
fragment: "precision mediump float;\nuniform sampler2D sampler;\nuniform vec4 inputSize;\nuniform float strength;\nvarying vec2 vUv;\n\nvoid main(void) {\n vec2 onePixel = inputSize.zw;\n vec4 color;\n color.rgb = vec3(0.5);\n color -= texture2D(sampler, vUv - onePixel) * strength;\n color += texture2D(sampler, vUv + onePixel) * strength;\n color.rgb = vec3((color.r + color.g + color.b) / 3.0);\n float alpha = texture2D(sampler, vUv).a;\n gl_FragColor = vec4(color.rgb * alpha, alpha);\n}"
|
|
5925
5942
|
} });
|
|
@@ -5928,7 +5945,7 @@ var ei, ti = class extends H {
|
|
|
5928
5945
|
}
|
|
5929
5946
|
apply(e, t) {
|
|
5930
5947
|
t.redraw(e, () => {
|
|
5931
|
-
|
|
5948
|
+
L.draw(e, ei.material, {
|
|
5932
5949
|
sampler: 0,
|
|
5933
5950
|
strength: this.strength,
|
|
5934
5951
|
inputSize: [
|
|
@@ -5941,14 +5958,14 @@ var ei, ti = class extends H {
|
|
|
5941
5958
|
});
|
|
5942
5959
|
}
|
|
5943
5960
|
};
|
|
5944
|
-
|
|
5961
|
+
k([_({ fallback: 5 }), O("design:type", Number)], ti.prototype, "strength", void 0), ti = ei = k([b("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ti);
|
|
5945
5962
|
//#endregion
|
|
5946
5963
|
//#region src/scene/effects/GlitchEffect.ts
|
|
5947
|
-
var ni,
|
|
5964
|
+
var ni, K = class extends U {
|
|
5948
5965
|
static {
|
|
5949
5966
|
ni = this;
|
|
5950
5967
|
}
|
|
5951
|
-
static material = new
|
|
5968
|
+
static material = new I({ gl: {
|
|
5952
5969
|
vertex: "in vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
5953
5970
|
fragment: "\nin vec2 vUv;\nuniform sampler2D sampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void) {\n vec2 coord = (vUv * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vUv + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if (coord.x > filterClamp.z) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if (coord.x < filterClamp.x) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if (coord.y > filterClamp.w) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if (coord.y < filterClamp.y) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture(sampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture(sampler, coord).a;\n}"
|
|
5954
5971
|
} });
|
|
@@ -5961,7 +5978,7 @@ var ni, G = class extends H {
|
|
|
5961
5978
|
super(), this.setProperties(e).append(t);
|
|
5962
5979
|
let n = S(4, this.sampleSize);
|
|
5963
5980
|
if (!n) throw Error("GlitchEffect requires a canvas; call setCanvasFactory() in non-browser environments.");
|
|
5964
|
-
this._canvas = n, this._texture = new
|
|
5981
|
+
this._canvas = n, this._texture = new z(this._canvas), this._sizes = new Float32Array(this.slices), this._offsets = new Float32Array(this.slices);
|
|
5965
5982
|
}
|
|
5966
5983
|
redraw() {
|
|
5967
5984
|
let e = this.sampleSize, t = this._texture, n = this._canvas.getContext("2d");
|
|
@@ -5978,7 +5995,7 @@ var ni, G = class extends H {
|
|
|
5978
5995
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
5979
5996
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
5980
5997
|
t.redraw(e, () => {
|
|
5981
|
-
this._texture.activate(e, 1),
|
|
5998
|
+
this._texture.activate(e, 1), L.draw(e, ni.material, {
|
|
5982
5999
|
sampler: 0,
|
|
5983
6000
|
filterClamp: [
|
|
5984
6001
|
0,
|
|
@@ -6007,14 +6024,14 @@ var ni, G = class extends H {
|
|
|
6007
6024
|
});
|
|
6008
6025
|
}
|
|
6009
6026
|
};
|
|
6010
|
-
|
|
6027
|
+
k([_({ fallback: 10 }), O("design:type", Number)], K.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], K.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], K.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], K.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], K.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], K.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], K.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], K.prototype, "blue", void 0), K = ni = k([b("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
6011
6028
|
//#endregion
|
|
6012
6029
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6013
|
-
var ri, ii = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}",
|
|
6030
|
+
var ri, ii = "vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain) {\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++) {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}", q = class extends U {
|
|
6014
6031
|
static {
|
|
6015
6032
|
ri = this;
|
|
6016
6033
|
}
|
|
6017
|
-
static material = new
|
|
6034
|
+
static material = new I({ gl: {
|
|
6018
6035
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6019
6036
|
fragment: `precision highp float;
|
|
6020
6037
|
varying vec2 vUv;
|
|
@@ -6066,7 +6083,7 @@ void main(void) {
|
|
|
6066
6083
|
apply(e, t) {
|
|
6067
6084
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
6068
6085
|
t.redraw(e, () => {
|
|
6069
|
-
|
|
6086
|
+
L.draw(e, ri.material, {
|
|
6070
6087
|
sampler: 0,
|
|
6071
6088
|
uDimensions: [t.width, t.height],
|
|
6072
6089
|
uParallel: +!!this.parallel,
|
|
@@ -6088,13 +6105,13 @@ void main(void) {
|
|
|
6088
6105
|
});
|
|
6089
6106
|
}
|
|
6090
6107
|
};
|
|
6091
|
-
|
|
6108
|
+
k([_({ fallback: 0 }), O("design:type", Number)], q.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], q.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], q.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], q.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], q.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], q.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], q.prototype, "alpha", void 0), q = ri = k([b("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
6092
6109
|
//#endregion
|
|
6093
6110
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6094
|
-
var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", oi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", si = class extends
|
|
6111
|
+
var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));\n color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));\n color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));\n color *= 0.25;\n gl_FragColor = color;\n}", oi = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\nuniform vec4 uInputClamp;\nvoid main(void) {\n vec4 color = vec4(0.0);\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));\n color *= 0.25;\n gl_FragColor = color;\n}", si = class extends U {
|
|
6095
6112
|
_kernels = [0];
|
|
6096
6113
|
constructor(e, t = []) {
|
|
6097
|
-
super(), this.material = new
|
|
6114
|
+
super(), this.material = new I({ gl: {
|
|
6098
6115
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6099
6116
|
fragment: e?.clamp ? oi : ai
|
|
6100
6117
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
@@ -6120,7 +6137,7 @@ var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6120
6137
|
this._kernels.forEach((i) => {
|
|
6121
6138
|
let a = i + .5;
|
|
6122
6139
|
t.redraw(e, () => {
|
|
6123
|
-
|
|
6140
|
+
L.draw(e, this.material, {
|
|
6124
6141
|
sampler: 0,
|
|
6125
6142
|
uOffset: [a * n, a * r],
|
|
6126
6143
|
uInputClamp: [
|
|
@@ -6134,14 +6151,14 @@ var ai = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6134
6151
|
});
|
|
6135
6152
|
}
|
|
6136
6153
|
};
|
|
6137
|
-
|
|
6154
|
+
k([_({ fallback: 4 }), O("design:type", Number)], si.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], si.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], si.prototype, "pixelSize", void 0), si = k([b("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], si);
|
|
6138
6155
|
//#endregion
|
|
6139
6156
|
//#region src/scene/effects/MaskEffect.ts
|
|
6140
|
-
var ci, li = class extends
|
|
6157
|
+
var ci, li = class extends U {
|
|
6141
6158
|
static {
|
|
6142
6159
|
ci = this;
|
|
6143
6160
|
}
|
|
6144
|
-
static material = new
|
|
6161
|
+
static material = new I({ gl: {
|
|
6145
6162
|
vertex: "attribute vec2 position;\nin vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6146
6163
|
fragment: "in vec2 vUv;\n\nuniform sampler2D sampler;\nuniform sampler2D mask;\nuniform float rotation;\n\nvec2 rotateUV(vec2 uv, float angle) {\n uv -= 0.5;\n float cosAngle = cos(angle);\n float sinAngle = sin(angle);\n mat2 rotationMatrix = mat2(\n cosAngle, -sinAngle,\n sinAngle, cosAngle\n );\n uv = rotationMatrix * uv;\n uv += 0.5;\n return uv;\n}\n\nvoid main(void) {\n vec4 color = texture(sampler, vUv);\n vec4 maskColor = texture(mask, rotateUV(vUv, rotation));\n gl_FragColor = mix(vec4(0.), color, maskColor.a);\n}"
|
|
6147
6164
|
} });
|
|
@@ -6161,7 +6178,7 @@ var ci, li = class extends H {
|
|
|
6161
6178
|
}
|
|
6162
6179
|
apply(e, t, n) {
|
|
6163
6180
|
this.texture && t.redraw(e, () => {
|
|
6164
|
-
this.texture.activate(e, 1),
|
|
6181
|
+
this.texture.activate(e, 1), L.draw(e, ci.material, {
|
|
6165
6182
|
sampler: 0,
|
|
6166
6183
|
mask: 1,
|
|
6167
6184
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6169,10 +6186,10 @@ var ci, li = class extends H {
|
|
|
6169
6186
|
});
|
|
6170
6187
|
}
|
|
6171
6188
|
};
|
|
6172
|
-
|
|
6189
|
+
k([_({ fallback: "" }), O("design:type", String)], li.prototype, "image", void 0), li = ci = k([b("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], li);
|
|
6173
6190
|
//#endregion
|
|
6174
6191
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6175
|
-
var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}",
|
|
6192
|
+
var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uThickness;\nuniform vec3 uColor;\nuniform float uAlpha;\nuniform float uKnockout;\nuniform vec4 uInputClamp;\n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP = {ANGLE_STEP};\n\nfloat outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.) {\n return 0.;\n }\n vec4 displacedColor;\n vec2 displacedPos;\n float maxAlpha = 0.;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) {\n displacedPos.x = vUv.x + uThickness.x * cos(angle);\n displacedPos.y = vUv.y + uThickness.y * sin(angle);\n displacedColor = texture2D(sampler, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor = texture2D(sampler, vUv);\n vec4 contentColor = sourceColor * float(uKnockout < 0.5);\n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor + outlineColor;\n}", J = class extends U {
|
|
6176
6193
|
static {
|
|
6177
6194
|
ui = this;
|
|
6178
6195
|
}
|
|
@@ -6183,14 +6200,14 @@ var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6183
6200
|
}
|
|
6184
6201
|
_color = new T();
|
|
6185
6202
|
constructor(e, t = []) {
|
|
6186
|
-
super(), this.setProperties(e).append(t), this.material = new
|
|
6203
|
+
super(), this.setProperties(e).append(t), this.material = new I({ gl: {
|
|
6187
6204
|
vertex: "precision mediump float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6188
6205
|
fragment: di.replace(/\{ANGLE_STEP\}/, ui.getAngleStep(this.quality).toFixed(7))
|
|
6189
6206
|
} });
|
|
6190
6207
|
}
|
|
6191
6208
|
apply(e, t) {
|
|
6192
6209
|
t.redraw(e, () => {
|
|
6193
|
-
this._color.value = this.color,
|
|
6210
|
+
this._color.value = this.color, L.draw(e, this.material, {
|
|
6194
6211
|
sampler: 0,
|
|
6195
6212
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6196
6213
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -6207,14 +6224,14 @@ var ui, di = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6207
6224
|
});
|
|
6208
6225
|
}
|
|
6209
6226
|
};
|
|
6210
|
-
|
|
6227
|
+
k([_({ fallback: "#000000ff" }), O("design:type", Object)], J.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], J.prototype, "style", void 0), k([_(), O("design:type", Object)], J.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], J.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], J.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], J.prototype, "knockout", void 0), J = ui = k([b("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6211
6228
|
//#endregion
|
|
6212
6229
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6213
|
-
var fi, pi = class extends
|
|
6230
|
+
var fi, pi = class extends U {
|
|
6214
6231
|
static {
|
|
6215
6232
|
fi = this;
|
|
6216
6233
|
}
|
|
6217
|
-
static material = new
|
|
6234
|
+
static material = new I({ gl: {
|
|
6218
6235
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6219
6236
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform vec2 step;\n\nvoid main(void) {\n vec2 uv = vUv;\n uv = floor((uv - offset) / step) * step + offset + step / 2.0;\n gl_FragColor = texture2D(sampler, uv);\n}"
|
|
6220
6237
|
} });
|
|
@@ -6228,18 +6245,18 @@ var fi, pi = class extends H {
|
|
|
6228
6245
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6229
6246
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6230
6247
|
};
|
|
6231
|
-
|
|
6248
|
+
L.draw(e, fi.material, a);
|
|
6232
6249
|
});
|
|
6233
6250
|
}
|
|
6234
6251
|
};
|
|
6235
|
-
|
|
6252
|
+
k([_({ fallback: 10 }), O("design:type", Number)], pi.prototype, "strength", void 0), pi = fi = k([b("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], pi);
|
|
6236
6253
|
//#endregion
|
|
6237
6254
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6238
|
-
var mi, hi = class extends
|
|
6255
|
+
var mi, hi = class extends U {
|
|
6239
6256
|
static {
|
|
6240
6257
|
mi = this;
|
|
6241
6258
|
}
|
|
6242
|
-
static material = new
|
|
6259
|
+
static material = new I({ gl: {
|
|
6243
6260
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
6244
6261
|
fragment: "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec4 uInputSize;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n float minGradient = uInnerRadius * 0.3;\n float innerRadius1 = (uInnerRadius + minGradient * 0.5) / uInputSize.x;\n\n float gradient = uRadius * 0.3;\n float radius1 = (uRadius - gradient * 0.5) / uInputSize.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / uInputSize.xy - vUv);\n float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x));\n\n float strength1 = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius1) {\n delta = innerRadius1 - dist;\n gap = minGradient;\n } else if (radius1 >= 0.0 && dist > radius1) { // radius1 < 0 means it's infinity\n delta = dist - radius1;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / uInputSize.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength1 *= delta;\n if (countLimit < 1.0) {\n gl_FragColor = texture2D(sampler, vUv);\n return;\n }\n }\n\n float offset = rand(vUv, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength1;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vUv + dir * percent;\n color += texture2D(sampler, p) * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n\n gl_FragColor = color;\n}"
|
|
6245
6262
|
} });
|
|
@@ -6248,7 +6265,7 @@ var mi, hi = class extends H {
|
|
|
6248
6265
|
}
|
|
6249
6266
|
apply(e, t) {
|
|
6250
6267
|
t.redraw(e, () => {
|
|
6251
|
-
|
|
6268
|
+
L.draw(e, mi.material, {
|
|
6252
6269
|
sampler: 0,
|
|
6253
6270
|
uCenter: [t.width / 2, t.height / 2],
|
|
6254
6271
|
uInnerRadius: this.innerRadius,
|
|
@@ -6264,7 +6281,7 @@ var mi, hi = class extends H {
|
|
|
6264
6281
|
});
|
|
6265
6282
|
}
|
|
6266
6283
|
};
|
|
6267
|
-
|
|
6284
|
+
k([_(), O("design:type", Array)], hi.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], hi.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], hi.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], hi.prototype, "strength", void 0), hi = mi = k([b("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], hi);
|
|
6268
6285
|
//#endregion
|
|
6269
6286
|
//#region src/scene/2d/element/utils.ts
|
|
6270
6287
|
function gi(e, t) {
|
|
@@ -6289,7 +6306,7 @@ function gi(e, t) {
|
|
|
6289
6306
|
}
|
|
6290
6307
|
//#endregion
|
|
6291
6308
|
//#region src/scene/2d/element/Element2DFill.ts
|
|
6292
|
-
var
|
|
6309
|
+
var Y = class extends C {
|
|
6293
6310
|
_parent;
|
|
6294
6311
|
texture;
|
|
6295
6312
|
animatedTexture;
|
|
@@ -6384,10 +6401,10 @@ var J = class extends C {
|
|
|
6384
6401
|
this.updateFrameIndex();
|
|
6385
6402
|
}
|
|
6386
6403
|
};
|
|
6387
|
-
|
|
6404
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Y.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Y.prototype, "color", void 0), k([_(), O("design:type", Object)], Y.prototype, "image", void 0), k([_(), O("design:type", Object)], Y.prototype, "linearGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "radialGradient", void 0), k([_(), O("design:type", Object)], Y.prototype, "cropRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "stretchRect", void 0), k([_(), O("design:type", Object)], Y.prototype, "dpi", void 0), k([_(), O("design:type", Object)], Y.prototype, "rotateWithShape", void 0), k([_(), O("design:type", Object)], Y.prototype, "tile", void 0), k([_(), O("design:type", Object)], Y.prototype, "opacity", void 0);
|
|
6388
6405
|
//#endregion
|
|
6389
6406
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6390
|
-
var _i = class extends
|
|
6407
|
+
var _i = class extends Y {
|
|
6391
6408
|
setProperties(e) {
|
|
6392
6409
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6393
6410
|
}
|
|
@@ -6399,7 +6416,7 @@ var _i = class extends J {
|
|
|
6399
6416
|
}
|
|
6400
6417
|
}
|
|
6401
6418
|
};
|
|
6402
|
-
|
|
6419
|
+
k([_(), O("design:type", Object)], _i.prototype, "fillWithShape", void 0);
|
|
6403
6420
|
//#endregion
|
|
6404
6421
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6405
6422
|
var vi;
|
|
@@ -6429,7 +6446,7 @@ function bi(e) {
|
|
|
6429
6446
|
};
|
|
6430
6447
|
}
|
|
6431
6448
|
}
|
|
6432
|
-
var
|
|
6449
|
+
var X = class extends C {
|
|
6433
6450
|
_parent;
|
|
6434
6451
|
_instance;
|
|
6435
6452
|
_container;
|
|
@@ -6474,7 +6491,7 @@ var Y = class extends C {
|
|
|
6474
6491
|
}
|
|
6475
6492
|
let n = await yi();
|
|
6476
6493
|
if (!n) {
|
|
6477
|
-
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)");
|
|
6494
|
+
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)"), this._renderPlaceholder(e, t);
|
|
6478
6495
|
return;
|
|
6479
6496
|
}
|
|
6480
6497
|
if (!(this.destroyed || !this.isValid())) {
|
|
@@ -6505,6 +6522,16 @@ var Y = class extends C {
|
|
|
6505
6522
|
this._texture.requestUpdate("source"), this._parent.requestDraw();
|
|
6506
6523
|
}
|
|
6507
6524
|
}
|
|
6525
|
+
_renderPlaceholder(e, t) {
|
|
6526
|
+
if (typeof document > "u" || !e || !t) return;
|
|
6527
|
+
let n = document.createElement("canvas");
|
|
6528
|
+
n.width = Math.ceil(e), n.height = Math.ceil(t);
|
|
6529
|
+
let r = n.getContext("2d");
|
|
6530
|
+
r && (r.fillStyle = "#f3f4f6", r.fillRect(0, 0, e, t), r.strokeStyle = "#d1d5db", r.setLineDash([6, 4]), r.strokeRect(1, 1, e - 2, t - 2), r.fillStyle = "#9ca3af", r.font = "14px sans-serif", r.textAlign = "center", r.textBaseline = "middle", r.fillText("图表需安装 echarts", e / 2, t / 2), this._texture ? this._texture.source = n : this._texture = new er({
|
|
6531
|
+
source: n,
|
|
6532
|
+
pixelRatio: 1
|
|
6533
|
+
}), this._texture.requestUpdate("source"), this._parent.requestDraw());
|
|
6534
|
+
}
|
|
6508
6535
|
draw() {
|
|
6509
6536
|
let e = this._texture;
|
|
6510
6537
|
if (!e?.isValid()) return;
|
|
@@ -6565,7 +6592,7 @@ var Y = class extends C {
|
|
|
6565
6592
|
this._teardown();
|
|
6566
6593
|
}
|
|
6567
6594
|
};
|
|
6568
|
-
|
|
6595
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], X.prototype, "enabled", void 0), k([_({ fallback: "column" }), O("design:type", Object)], X.prototype, "type", void 0), k([_(), O("design:type", Object)], X.prototype, "grouping", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "categories", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], X.prototype, "series", void 0), k([_(), O("design:type", Object)], X.prototype, "title", void 0), k([_(), O("design:type", Object)], X.prototype, "legend", void 0), k([_(), O("design:type", Object)], X.prototype, "categoryAxis", void 0), k([_(), O("design:type", Object)], X.prototype, "valueAxis", void 0);
|
|
6569
6596
|
//#endregion
|
|
6570
6597
|
//#region src/scene/2d/element/Element2DConnection.ts
|
|
6571
6598
|
var xi = class extends C {
|
|
@@ -6642,7 +6669,7 @@ var xi = class extends C {
|
|
|
6642
6669
|
return (r !== this._routeSig || !this._routePath) && (this._routeSig = r, this._routePath = Dr(this.mode, e ?? t, t ?? e)), this._routePath;
|
|
6643
6670
|
}
|
|
6644
6671
|
};
|
|
6645
|
-
|
|
6672
|
+
k([_(), O("design:type", Object)], xi.prototype, "start", void 0), k([_(), O("design:type", Object)], xi.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], xi.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], xi.prototype, "labelPosition", void 0);
|
|
6646
6673
|
function Si(e, t) {
|
|
6647
6674
|
if (!t) return e;
|
|
6648
6675
|
let n = Math.cos(t), r = Math.sin(t);
|
|
@@ -6715,7 +6742,7 @@ function Oi(e, t, n, r, i = {}) {
|
|
|
6715
6742
|
}
|
|
6716
6743
|
//#endregion
|
|
6717
6744
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
6718
|
-
var ki = class extends
|
|
6745
|
+
var ki = class extends Y {
|
|
6719
6746
|
_sourceCanvas;
|
|
6720
6747
|
_sourceImage;
|
|
6721
6748
|
setProperties(e) {
|
|
@@ -6742,7 +6769,7 @@ var ki = class extends J {
|
|
|
6742
6769
|
let e = await this._resolveSourceCanvas();
|
|
6743
6770
|
if (!e) return;
|
|
6744
6771
|
let t = e.width, n = e.height, r = await this._resolvePatterns(), i = Oi(e, this.effects, t, n, r);
|
|
6745
|
-
this.texture = new
|
|
6772
|
+
this.texture = new z({
|
|
6746
6773
|
source: i,
|
|
6747
6774
|
width: t,
|
|
6748
6775
|
height: n,
|
|
@@ -6756,7 +6783,7 @@ var ki = class extends J {
|
|
|
6756
6783
|
if (!n || d(n) || e[n]) continue;
|
|
6757
6784
|
let r = await $.loadBy(`${n}#mc-foreground-pattern`, async () => {
|
|
6758
6785
|
let e = await $.fetchImageBitmap(n), t = this._snapshot(e);
|
|
6759
|
-
return
|
|
6786
|
+
return Pe && e instanceof ImageBitmap && e.close(), t;
|
|
6760
6787
|
});
|
|
6761
6788
|
r && (e[n] = r);
|
|
6762
6789
|
}
|
|
@@ -6767,7 +6794,7 @@ var ki = class extends J {
|
|
|
6767
6794
|
if (d(this.image) || this.image === "viewport") return;
|
|
6768
6795
|
let e = this.image, t = await $.loadBy(`${e}#mc-foreground-source`, async () => {
|
|
6769
6796
|
let t = await $.fetchImageBitmap(e), n = this._snapshot(t);
|
|
6770
|
-
return
|
|
6797
|
+
return Pe && t instanceof ImageBitmap && t.close(), n;
|
|
6771
6798
|
});
|
|
6772
6799
|
return this._sourceImage === e && t && (this._sourceCanvas = t), t;
|
|
6773
6800
|
}
|
|
@@ -6776,14 +6803,14 @@ var ki = class extends J {
|
|
|
6776
6803
|
if (!(!r || !i)) return i.drawImage(e, 0, 0, t, n), r;
|
|
6777
6804
|
}
|
|
6778
6805
|
};
|
|
6779
|
-
|
|
6806
|
+
k([_(), O("design:type", Object)], ki.prototype, "fillWithShape", void 0), k([_(), O("design:type", Array)], ki.prototype, "effects", void 0);
|
|
6780
6807
|
//#endregion
|
|
6781
6808
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
6782
6809
|
var Ai = {
|
|
6783
6810
|
sm: 4,
|
|
6784
6811
|
md: 6,
|
|
6785
6812
|
lg: 8
|
|
6786
|
-
}, ji = class extends
|
|
6813
|
+
}, ji = class extends Y {
|
|
6787
6814
|
setProperties(e) {
|
|
6788
6815
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
6789
6816
|
}
|
|
@@ -6832,7 +6859,7 @@ var Ai = {
|
|
|
6832
6859
|
ee.fillStyle = i, ee.moveTo(e.x, e.y).lineTo(p + h, m + g).lineTo(p - h, m - g).closePath().fill();
|
|
6833
6860
|
}
|
|
6834
6861
|
};
|
|
6835
|
-
|
|
6862
|
+
k([_(), O("design:type", Object)], ji.prototype, "color", void 0), k([_(), O("design:type", Object)], ji.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], ji.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], ji.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], ji.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], ji.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], ji.prototype, "tailEnd", void 0);
|
|
6836
6863
|
//#endregion
|
|
6837
6864
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
6838
6865
|
var Mi = class extends C {
|
|
@@ -6859,7 +6886,7 @@ var Mi = class extends C {
|
|
|
6859
6886
|
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new $r({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
6860
6887
|
}
|
|
6861
6888
|
};
|
|
6862
|
-
|
|
6889
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Mi.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Mi.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Mi.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Mi.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Mi.prototype, "offsetX", void 0);
|
|
6863
6890
|
//#endregion
|
|
6864
6891
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
6865
6892
|
var Ni = class extends C {
|
|
@@ -6921,8 +6948,8 @@ var Ni = class extends C {
|
|
|
6921
6948
|
_updatePath2DSet() {
|
|
6922
6949
|
let e;
|
|
6923
6950
|
if (this.svg) {
|
|
6924
|
-
let t =
|
|
6925
|
-
this._path2DSet =
|
|
6951
|
+
let t = fe(this.svg);
|
|
6952
|
+
this._path2DSet = pe(t), e = this._path2DSet.viewBox;
|
|
6926
6953
|
} else this._path2DSet.paths.length = 0, this.paths?.forEach((e, t) => {
|
|
6927
6954
|
let { data: n, ...r } = e, i = new le();
|
|
6928
6955
|
i.style = r, i.addData(n), this._path2DSet.paths[t] = i;
|
|
@@ -6960,7 +6987,7 @@ var Ni = class extends C {
|
|
|
6960
6987
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
6961
6988
|
}
|
|
6962
6989
|
};
|
|
6963
|
-
|
|
6990
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Ni.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Ni.prototype, "preset", void 0), k([_(), O("design:type", Object)], Ni.prototype, "svg", void 0), k([_(), O("design:type", Object)], Ni.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Ni.prototype, "paths", void 0), k([_(), O("design:type", Object)], Ni.prototype, "connectionPoints", void 0);
|
|
6964
6991
|
//#endregion
|
|
6965
6992
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
6966
6993
|
var Pi = class extends w {
|
|
@@ -7037,7 +7064,7 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7037
7064
|
}, r = `${JSON.stringify(e)}|${n.left},${n.top},${n.width},${n.height}`;
|
|
7038
7065
|
if (this._cellNodes.has(t) && this._cellSnapshots.get(t) === r) continue;
|
|
7039
7066
|
let i = this._cellNodes.get(t);
|
|
7040
|
-
i || (i =
|
|
7067
|
+
i || (i = B.parse({ is: "Element2D" }, "Element2D"), this._parent.appendChild(i, "back"), this._cellNodes.set(t, i)), this._applyCell(i, e, n), this._cellSnapshots.set(t, r);
|
|
7041
7068
|
}
|
|
7042
7069
|
for (let [e, t] of this._cellNodes) s.has(e) || (this._parent.removeChild(t), t.destroy(), this._cellNodes.delete(e), this._cellSnapshots.delete(e));
|
|
7043
7070
|
this._parent.requestDraw();
|
|
@@ -7049,7 +7076,7 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7049
7076
|
}, e.background = t.background;
|
|
7050
7077
|
for (let t of [...e.getChildren(!0)]) e.removeChild(t), t.destroy();
|
|
7051
7078
|
t.children?.forEach((t) => {
|
|
7052
|
-
e.appendChild(
|
|
7079
|
+
e.appendChild(B.parse(t, "Element2D"));
|
|
7053
7080
|
});
|
|
7054
7081
|
}
|
|
7055
7082
|
_clearCells() {
|
|
@@ -7060,10 +7087,10 @@ var Ii = 100, Li = 40, Ri = class extends C {
|
|
|
7060
7087
|
this._clearCells();
|
|
7061
7088
|
}
|
|
7062
7089
|
};
|
|
7063
|
-
|
|
7090
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Ri.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ri.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ri.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ri.prototype, "cells", void 0);
|
|
7064
7091
|
//#endregion
|
|
7065
7092
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7066
|
-
var
|
|
7093
|
+
var Z = class extends C {
|
|
7067
7094
|
_parent;
|
|
7068
7095
|
base;
|
|
7069
7096
|
get textContent() {
|
|
@@ -7077,7 +7104,7 @@ var X = class extends C {
|
|
|
7077
7104
|
_texture = new er({ mipmap: !0 });
|
|
7078
7105
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7079
7106
|
constructor(e) {
|
|
7080
|
-
super(), this._parent = e, this.base = new
|
|
7107
|
+
super(), this._parent = e, this.base = new ve(), this.base.setPropertyAccessor(this);
|
|
7081
7108
|
}
|
|
7082
7109
|
setProperties(e) {
|
|
7083
7110
|
return super.setProperties(d(e) ? void 0 : ie(e));
|
|
@@ -7170,7 +7197,7 @@ var X = class extends C {
|
|
|
7170
7197
|
this.base.pathSets.forEach((n) => {
|
|
7171
7198
|
n.paths.forEach((n) => {
|
|
7172
7199
|
let r = n.getMeta();
|
|
7173
|
-
if (r instanceof
|
|
7200
|
+
if (r instanceof _e) {
|
|
7174
7201
|
let i = r.parent.index, a = r.parent.parent.index;
|
|
7175
7202
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7176
7203
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
@@ -7217,10 +7244,10 @@ var X = class extends C {
|
|
|
7217
7244
|
}
|
|
7218
7245
|
process(e) {}
|
|
7219
7246
|
};
|
|
7220
|
-
|
|
7247
|
+
k([_({ fallback: !0 }), O("design:type", Object)], Z.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Z.prototype, "content", void 0), k([_({ alias: "_parent.style.json" }), O("design:type", Object)], Z.prototype, "style", void 0), k([_(), O("design:type", Object)], Z.prototype, "effects", void 0), k([_(), O("design:type", Object)], Z.prototype, "fill", void 0), k([_(), O("design:type", Object)], Z.prototype, "outline", void 0), k([_(), O("design:type", Object)], Z.prototype, "deformation", void 0), k([_({ alias: "base.measureDom" }), O("design:type", typeof HTMLElement > "u" ? Object : HTMLElement)], Z.prototype, "measureDom", void 0), k([_({ alias: "base.fonts" }), O("design:type", Object)], Z.prototype, "fonts", void 0), k([_({ fallback: "auto" }), O("design:type", Object)], Z.prototype, "drawMode", void 0);
|
|
7221
7248
|
//#endregion
|
|
7222
7249
|
//#region src/scene/2d/element/Flexbox.ts
|
|
7223
|
-
var
|
|
7250
|
+
var Q = {
|
|
7224
7251
|
left: 0,
|
|
7225
7252
|
top: 1,
|
|
7226
7253
|
right: 2,
|
|
@@ -7234,7 +7261,7 @@ var Z = {
|
|
|
7234
7261
|
column: 0,
|
|
7235
7262
|
row: 1,
|
|
7236
7263
|
all: 2
|
|
7237
|
-
},
|
|
7264
|
+
}, Bi = {
|
|
7238
7265
|
auto: 0,
|
|
7239
7266
|
"flex-start": 1,
|
|
7240
7267
|
center: 2,
|
|
@@ -7244,42 +7271,42 @@ var Z = {
|
|
|
7244
7271
|
"space-between": 6,
|
|
7245
7272
|
"space-around": 7,
|
|
7246
7273
|
"space-evenly": 8
|
|
7247
|
-
},
|
|
7274
|
+
}, Vi = {
|
|
7248
7275
|
flex: 0,
|
|
7249
7276
|
none: 1,
|
|
7250
7277
|
contents: 2
|
|
7251
|
-
},
|
|
7278
|
+
}, Hi = {
|
|
7252
7279
|
inherit: 0,
|
|
7253
7280
|
ltr: 1,
|
|
7254
7281
|
rtl: 2
|
|
7255
|
-
},
|
|
7282
|
+
}, Ui = {
|
|
7256
7283
|
column: 0,
|
|
7257
7284
|
"column-reverse": 1,
|
|
7258
7285
|
row: 2,
|
|
7259
7286
|
"row-reverse": 3
|
|
7260
|
-
},
|
|
7287
|
+
}, Wi = {
|
|
7261
7288
|
"no-wrap": 0,
|
|
7262
7289
|
wrap: 1,
|
|
7263
7290
|
"Wrap-reverse": 2
|
|
7264
|
-
},
|
|
7291
|
+
}, Gi = {
|
|
7265
7292
|
"flex-start": 0,
|
|
7266
7293
|
center: 1,
|
|
7267
7294
|
"flex-end": 2,
|
|
7268
7295
|
"space-between": 3,
|
|
7269
7296
|
"space-around": 4,
|
|
7270
7297
|
"space-evenly": 5
|
|
7271
|
-
},
|
|
7298
|
+
}, Ki = {
|
|
7272
7299
|
visible: 0,
|
|
7273
7300
|
hidden: 1,
|
|
7274
7301
|
scroll: 2
|
|
7275
|
-
},
|
|
7302
|
+
}, qi = {
|
|
7276
7303
|
static: 0,
|
|
7277
7304
|
relative: 1,
|
|
7278
7305
|
absolute: 2
|
|
7279
|
-
},
|
|
7306
|
+
}, Ji = {
|
|
7280
7307
|
"border-box": 0,
|
|
7281
7308
|
"content-box": 1
|
|
7282
|
-
},
|
|
7309
|
+
}, Yi = class e {
|
|
7283
7310
|
_parent;
|
|
7284
7311
|
static _yoga;
|
|
7285
7312
|
static async load() {
|
|
@@ -7291,51 +7318,51 @@ var Z = {
|
|
|
7291
7318
|
this._parent = e, this._addChild = this._addChild.bind(this), this._removeChild = this._removeChild.bind(this), this._parent.on("addChild", this._addChild), this._parent.on("removeChild", this._removeChild);
|
|
7292
7319
|
}
|
|
7293
7320
|
_addChild(e, t) {
|
|
7294
|
-
if (e instanceof
|
|
7321
|
+
if (e instanceof ea && e.flexbox.node && this.node) {
|
|
7295
7322
|
this.node.insertChild(e.flexbox.node, t);
|
|
7296
7323
|
let n = e.style.getProperties();
|
|
7297
7324
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7298
7325
|
}
|
|
7299
7326
|
}
|
|
7300
7327
|
_removeChild(e, t) {
|
|
7301
|
-
e instanceof
|
|
7328
|
+
e instanceof ea && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7302
7329
|
}
|
|
7303
7330
|
updateStyleProperty(e, t) {
|
|
7304
7331
|
let n = this.node;
|
|
7305
7332
|
if (n) {
|
|
7306
7333
|
switch (e) {
|
|
7307
7334
|
case "alignContent":
|
|
7308
|
-
n.setAlignContent(t ?
|
|
7335
|
+
n.setAlignContent(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7309
7336
|
break;
|
|
7310
7337
|
case "alignItems":
|
|
7311
|
-
n.setAlignItems(t ?
|
|
7338
|
+
n.setAlignItems(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7312
7339
|
break;
|
|
7313
7340
|
case "alignSelf":
|
|
7314
|
-
n.setAlignSelf(t ?
|
|
7341
|
+
n.setAlignSelf(t ? Bi[t] ?? Bi["flex-start"] : Bi["flex-start"]);
|
|
7315
7342
|
break;
|
|
7316
7343
|
case "aspectRatio":
|
|
7317
7344
|
n.setAspectRatio(t);
|
|
7318
7345
|
break;
|
|
7319
7346
|
case "borderTop":
|
|
7320
|
-
n.setBorder(
|
|
7347
|
+
n.setBorder(Q.top, this._parent.style.borderWidth);
|
|
7321
7348
|
break;
|
|
7322
7349
|
case "borderBottom":
|
|
7323
|
-
n.setBorder(
|
|
7350
|
+
n.setBorder(Q.bottom, this._parent.style.borderWidth);
|
|
7324
7351
|
break;
|
|
7325
7352
|
case "borderLeft":
|
|
7326
|
-
n.setBorder(
|
|
7353
|
+
n.setBorder(Q.left, this._parent.style.borderWidth);
|
|
7327
7354
|
break;
|
|
7328
7355
|
case "borderRight":
|
|
7329
|
-
n.setBorder(
|
|
7356
|
+
n.setBorder(Q.right, this._parent.style.borderWidth);
|
|
7330
7357
|
break;
|
|
7331
7358
|
case "border":
|
|
7332
|
-
n.setBorder(
|
|
7359
|
+
n.setBorder(Q.all, this._parent.style.borderWidth);
|
|
7333
7360
|
break;
|
|
7334
7361
|
case "direction":
|
|
7335
|
-
n.setDirection(t ?
|
|
7362
|
+
n.setDirection(t ? Hi[t] ?? Hi.inherit : Hi.inherit);
|
|
7336
7363
|
break;
|
|
7337
7364
|
case "display":
|
|
7338
|
-
n.setDisplay(t ?
|
|
7365
|
+
n.setDisplay(t ? Vi[t] ?? Vi.flex : Vi.flex);
|
|
7339
7366
|
break;
|
|
7340
7367
|
case "flex":
|
|
7341
7368
|
n.setFlex(t);
|
|
@@ -7344,7 +7371,7 @@ var Z = {
|
|
|
7344
7371
|
n.setFlexBasis(t);
|
|
7345
7372
|
break;
|
|
7346
7373
|
case "flexDirection":
|
|
7347
|
-
n.setFlexDirection(t ?
|
|
7374
|
+
n.setFlexDirection(t ? Ui[t] ?? Ui.row : Ui.row);
|
|
7348
7375
|
break;
|
|
7349
7376
|
case "flexGrow":
|
|
7350
7377
|
n.setFlexGrow(t);
|
|
@@ -7353,31 +7380,31 @@ var Z = {
|
|
|
7353
7380
|
n.setFlexShrink(t);
|
|
7354
7381
|
break;
|
|
7355
7382
|
case "flexWrap":
|
|
7356
|
-
n.setFlexWrap(t ?
|
|
7383
|
+
n.setFlexWrap(t ? Wi[t] ?? Wi.wrap : Wi.wrap);
|
|
7357
7384
|
break;
|
|
7358
7385
|
case "height":
|
|
7359
7386
|
n.setHeight(t);
|
|
7360
7387
|
break;
|
|
7361
7388
|
case "justifyContent":
|
|
7362
|
-
n.setJustifyContent(t ?
|
|
7389
|
+
n.setJustifyContent(t ? Gi[t] ?? Gi["flex-start"] : Gi["flex-start"]);
|
|
7363
7390
|
break;
|
|
7364
7391
|
case "gap":
|
|
7365
7392
|
t !== void 0 && n.setGap(zi.all, t);
|
|
7366
7393
|
break;
|
|
7367
7394
|
case "marginTop":
|
|
7368
|
-
n.setMargin(
|
|
7395
|
+
n.setMargin(Q.top, t);
|
|
7369
7396
|
break;
|
|
7370
7397
|
case "marginBottom":
|
|
7371
|
-
n.setMargin(
|
|
7398
|
+
n.setMargin(Q.bottom, t);
|
|
7372
7399
|
break;
|
|
7373
7400
|
case "marginLeft":
|
|
7374
|
-
n.setMargin(
|
|
7401
|
+
n.setMargin(Q.left, t);
|
|
7375
7402
|
break;
|
|
7376
7403
|
case "marginRight":
|
|
7377
|
-
n.setMargin(
|
|
7404
|
+
n.setMargin(Q.right, t);
|
|
7378
7405
|
break;
|
|
7379
7406
|
case "margin":
|
|
7380
|
-
n.setMargin(
|
|
7407
|
+
n.setMargin(Q.all, t);
|
|
7381
7408
|
break;
|
|
7382
7409
|
case "maxHeight":
|
|
7383
7410
|
n.setMaxHeight(t);
|
|
@@ -7392,40 +7419,40 @@ var Z = {
|
|
|
7392
7419
|
n.setMinWidth(t);
|
|
7393
7420
|
break;
|
|
7394
7421
|
case "overflow":
|
|
7395
|
-
n.setOverflow(t ?
|
|
7422
|
+
n.setOverflow(t ? Ki[t] ?? Ki.visible : Ki.visible);
|
|
7396
7423
|
break;
|
|
7397
7424
|
case "paddingTop":
|
|
7398
|
-
n.setPadding(
|
|
7425
|
+
n.setPadding(Q.top, t);
|
|
7399
7426
|
break;
|
|
7400
7427
|
case "paddingBottom":
|
|
7401
|
-
n.setPadding(
|
|
7428
|
+
n.setPadding(Q.bottom, t);
|
|
7402
7429
|
break;
|
|
7403
7430
|
case "paddingLeft":
|
|
7404
|
-
n.setPadding(
|
|
7431
|
+
n.setPadding(Q.left, t);
|
|
7405
7432
|
break;
|
|
7406
7433
|
case "paddingRight":
|
|
7407
|
-
n.setPadding(
|
|
7434
|
+
n.setPadding(Q.right, t);
|
|
7408
7435
|
break;
|
|
7409
7436
|
case "padding":
|
|
7410
|
-
n.setPadding(
|
|
7437
|
+
n.setPadding(Q.all, t);
|
|
7411
7438
|
break;
|
|
7412
7439
|
case "top":
|
|
7413
|
-
n.setPosition(
|
|
7440
|
+
n.setPosition(Q.top, t);
|
|
7414
7441
|
break;
|
|
7415
7442
|
case "bottom":
|
|
7416
|
-
n.setPosition(
|
|
7443
|
+
n.setPosition(Q.bottom, t);
|
|
7417
7444
|
break;
|
|
7418
7445
|
case "left":
|
|
7419
|
-
n.setPosition(
|
|
7446
|
+
n.setPosition(Q.left, t);
|
|
7420
7447
|
break;
|
|
7421
7448
|
case "right":
|
|
7422
|
-
n.setPosition(
|
|
7449
|
+
n.setPosition(Q.right, t);
|
|
7423
7450
|
break;
|
|
7424
7451
|
case "position":
|
|
7425
|
-
n.setPositionType(t ?
|
|
7452
|
+
n.setPositionType(t ? qi[t] ?? qi.relative : qi.relative);
|
|
7426
7453
|
break;
|
|
7427
7454
|
case "boxSizing":
|
|
7428
|
-
n.setBoxSizing(t ?
|
|
7455
|
+
n.setBoxSizing(t ? Ji[t] ?? Ji["content-box"] : Ji["content-box"]);
|
|
7429
7456
|
break;
|
|
7430
7457
|
case "width":
|
|
7431
7458
|
n.setWidth(t);
|
|
@@ -7436,7 +7463,7 @@ var Z = {
|
|
|
7436
7463
|
}
|
|
7437
7464
|
update() {
|
|
7438
7465
|
let e = this._parent, t = this.node;
|
|
7439
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
7466
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, Hi.ltr), t.hasNewLayout())) {
|
|
7440
7467
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout();
|
|
7441
7468
|
(!Number.isNaN(n) && n !== e.position.x || !Number.isNaN(r) && r !== e.position.y) && e.position.set(n, r), (!Number.isNaN(i) && i !== e.size.x || !Number.isNaN(a) && a !== e.size.y) && e.size.set(i, a), t.markLayoutSeen();
|
|
7442
7469
|
}
|
|
@@ -7444,15 +7471,15 @@ var Z = {
|
|
|
7444
7471
|
destroy() {
|
|
7445
7472
|
this.node?.free(), this.node = void 0;
|
|
7446
7473
|
}
|
|
7447
|
-
},
|
|
7474
|
+
}, Xi = new Set(Object.keys(a())), Zi = new Set(Object.keys(s())), Qi = new y(), $i = [
|
|
7448
7475
|
[0, 0],
|
|
7449
7476
|
[1, 0],
|
|
7450
7477
|
[1, 1],
|
|
7451
7478
|
[0, 1]
|
|
7452
|
-
],
|
|
7453
|
-
flexbox = new
|
|
7454
|
-
aabb = new
|
|
7455
|
-
globalAabb = new
|
|
7479
|
+
], ea = class extends wr {
|
|
7480
|
+
flexbox = new Yi(this);
|
|
7481
|
+
aabb = new yt();
|
|
7482
|
+
globalAabb = new yt();
|
|
7456
7483
|
_parentGlobalDisplay;
|
|
7457
7484
|
_globalDisplay;
|
|
7458
7485
|
get globalDisplay() {
|
|
@@ -7491,7 +7518,7 @@ var Z = {
|
|
|
7491
7518
|
set shape(e) {
|
|
7492
7519
|
this._shape.resetProperties().setProperties(e);
|
|
7493
7520
|
}
|
|
7494
|
-
_fill = new
|
|
7521
|
+
_fill = new Y(this);
|
|
7495
7522
|
get fill() {
|
|
7496
7523
|
return this._fill;
|
|
7497
7524
|
}
|
|
@@ -7512,7 +7539,7 @@ var Z = {
|
|
|
7512
7539
|
set foreground(e) {
|
|
7513
7540
|
this._foreground.resetProperties().setProperties(e);
|
|
7514
7541
|
}
|
|
7515
|
-
_text = new
|
|
7542
|
+
_text = new Z(this);
|
|
7516
7543
|
get text() {
|
|
7517
7544
|
return this._text;
|
|
7518
7545
|
}
|
|
@@ -7540,7 +7567,7 @@ var Z = {
|
|
|
7540
7567
|
set table(e) {
|
|
7541
7568
|
this._table.resetProperties().setProperties(e);
|
|
7542
7569
|
}
|
|
7543
|
-
_chart = new
|
|
7570
|
+
_chart = new X(this);
|
|
7544
7571
|
get chart() {
|
|
7545
7572
|
return this._chart;
|
|
7546
7573
|
}
|
|
@@ -7625,7 +7652,7 @@ var Z = {
|
|
|
7625
7652
|
this._updateGlobalDisplay();
|
|
7626
7653
|
break;
|
|
7627
7654
|
case "rotate":
|
|
7628
|
-
this.rotation = (t || 0) *
|
|
7655
|
+
this.rotation = (t || 0) * bt, this.updateGlobalTransform();
|
|
7629
7656
|
break;
|
|
7630
7657
|
case "scaleX":
|
|
7631
7658
|
this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
|
|
@@ -7690,7 +7717,7 @@ var Z = {
|
|
|
7690
7717
|
this.requestDraw();
|
|
7691
7718
|
break;
|
|
7692
7719
|
}
|
|
7693
|
-
if ((
|
|
7720
|
+
if ((Zi.has(e) || Xi.has(e)) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
7694
7721
|
else switch (e) {
|
|
7695
7722
|
case "left":
|
|
7696
7723
|
this.position.x = Number(t);
|
|
@@ -7730,10 +7757,10 @@ var Z = {
|
|
|
7730
7757
|
}
|
|
7731
7758
|
_intersectsViewport(e) {
|
|
7732
7759
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
7733
|
-
for (let [e, c] of
|
|
7760
|
+
for (let [e, c] of $i) t.applyAffineInverse({
|
|
7734
7761
|
x: e * n,
|
|
7735
7762
|
y: c * r
|
|
7736
|
-
},
|
|
7763
|
+
}, Qi), i = Math.min(i, Qi.x), a = Math.max(a, Qi.x), o = Math.min(o, Qi.y), s = Math.max(s, Qi.y);
|
|
7737
7764
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
7738
7765
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
7739
7766
|
}
|
|
@@ -7843,10 +7870,10 @@ var Z = {
|
|
|
7843
7870
|
super._destroy(), this.flexbox.destroy(), this.aabb.destroy(), this.globalAabb.destroy(), this.size.destroy(), this.style.destroy(), this.background.destroy(), this.shape.destroy(), this.fill.destroy(), this.outline.destroy(), this.text.destroy(), this.foreground.destroy(), this.shadow.destroy(), this.connection.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
7844
7871
|
}
|
|
7845
7872
|
};
|
|
7846
|
-
|
|
7873
|
+
ea = k([b("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ea);
|
|
7847
7874
|
//#endregion
|
|
7848
7875
|
//#region src/scene/2d/TextureRect2D.ts
|
|
7849
|
-
var
|
|
7876
|
+
var ta = class extends ea {
|
|
7850
7877
|
texture;
|
|
7851
7878
|
constructor(e, t = []) {
|
|
7852
7879
|
super(), this.setProperties(e).append(t);
|
|
@@ -7860,7 +7887,7 @@ var ea = class extends $i {
|
|
|
7860
7887
|
} });
|
|
7861
7888
|
}
|
|
7862
7889
|
}
|
|
7863
|
-
},
|
|
7890
|
+
}, na = class extends ta {
|
|
7864
7891
|
texture = new er();
|
|
7865
7892
|
animation;
|
|
7866
7893
|
_lastTime = NaN;
|
|
@@ -7891,10 +7918,10 @@ var ea = class extends $i {
|
|
|
7891
7918
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
7892
7919
|
}
|
|
7893
7920
|
};
|
|
7894
|
-
|
|
7921
|
+
k([_({ fallback: "" }), O("design:type", String)], na.prototype, "src", void 0), na = k([b("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], na);
|
|
7895
7922
|
//#endregion
|
|
7896
7923
|
//#region src/scene/2d/TransformRect2D.ts
|
|
7897
|
-
var
|
|
7924
|
+
var ra = class extends ea {
|
|
7898
7925
|
constructor(e, t = []) {
|
|
7899
7926
|
super(), this.setProperties(e).append(t);
|
|
7900
7927
|
}
|
|
@@ -7907,20 +7934,20 @@ var na = class extends $i {
|
|
|
7907
7934
|
}
|
|
7908
7935
|
}
|
|
7909
7936
|
_drawCircle(e, t) {
|
|
7910
|
-
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle =
|
|
7937
|
+
this.context.arc(e, t, this.handleSize, 0, Math.PI * 2, !0), this.context.fillStyle = z.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();
|
|
7911
7938
|
}
|
|
7912
7939
|
_drawEllipse(e, t) {
|
|
7913
|
-
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle =
|
|
7940
|
+
this.context.roundRect(e - this.handleSize, t - this.handleSize * 2, this.handleSize * 2, this.handleSize * 4, this.handleSize), this.context.fillStyle = z.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();
|
|
7914
7941
|
}
|
|
7915
7942
|
_draw() {
|
|
7916
7943
|
let { width: e, height: t } = this.getRect();
|
|
7917
7944
|
this.context.rect(0, 0, e, t), this.context.strokeStyle = "#00FF00", this.context.stroke(), this._drawCircle(0, 0), this._drawCircle(e, t), this._drawCircle(0, t), this._drawEllipse(0, t / 2), this._drawCircle(e, 0), this._drawEllipse(e, t / 2);
|
|
7918
7945
|
}
|
|
7919
7946
|
};
|
|
7920
|
-
|
|
7947
|
+
k([_({ fallback: 6 }), O("design:type", Number)], ra.prototype, "handleSize", void 0);
|
|
7921
7948
|
//#endregion
|
|
7922
7949
|
//#region src/scene/2d/Video2D.ts
|
|
7923
|
-
var
|
|
7950
|
+
var ia = class extends ta {
|
|
7924
7951
|
get videoDuration() {
|
|
7925
7952
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
7926
7953
|
}
|
|
@@ -7960,11 +7987,29 @@ var ra = class extends ea {
|
|
|
7960
7987
|
super._process(e), this._updateVideoCurrentTime();
|
|
7961
7988
|
}
|
|
7962
7989
|
};
|
|
7963
|
-
|
|
7990
|
+
k([_({ fallback: "" }), O("design:type", String)], ia.prototype, "src", void 0), ia = k([b("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ia);
|
|
7964
7991
|
//#endregion
|
|
7965
7992
|
//#region src/scene/animation/Animation.ts
|
|
7966
|
-
|
|
7967
|
-
|
|
7993
|
+
function aa(e) {
|
|
7994
|
+
if (e == null) return 0;
|
|
7995
|
+
let t = String(e).trim(), n = Number.parseFloat(t);
|
|
7996
|
+
return Number.isNaN(n) ? 0 : n / 100;
|
|
7997
|
+
}
|
|
7998
|
+
function oa(e, t) {
|
|
7999
|
+
let n = t * 180 / Math.PI;
|
|
8000
|
+
if (e == null || e === "auto") return n;
|
|
8001
|
+
let r = String(e).trim();
|
|
8002
|
+
if (r === "reverse") return n + 180;
|
|
8003
|
+
if (r.startsWith("auto")) return n + (Number.parseFloat(r.slice(4)) || 0);
|
|
8004
|
+
let i = Number.parseFloat(r);
|
|
8005
|
+
return Number.isNaN(i) ? n : i;
|
|
8006
|
+
}
|
|
8007
|
+
function sa(e) {
|
|
8008
|
+
let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
|
|
8009
|
+
return n && (t = n[1].trim()), t.length >= 2 && (t[0] === "\"" || t[0] === "'") && t[t.length - 1] === t[0] && (t = t.slice(1, -1)), t.trim();
|
|
8010
|
+
}
|
|
8011
|
+
var ca = (e) => e, la = pa(.25, .1, .25, 1), ua = pa(.42, 0, 1, 1), da = pa(0, 0, .58, 1), fa = pa(.42, 0, .58, 1);
|
|
8012
|
+
function pa(e, t, n, r) {
|
|
7968
8013
|
let i = 1e-6, a = 3 * e - 3 * n + 1, o = 3 * n - 6 * e, s = 3 * e, c = 3 * t - 3 * r + 1, l = 3 * r - 6 * t, u = 3 * t, d = (e) => (3 * a * e + 2 * o) * e + s, f = (e) => ((a * e + o) * e + s) * e, p = (e) => ((c * e + l) * e + u) * e;
|
|
7969
8014
|
function m(e) {
|
|
7970
8015
|
let t = e, n, r;
|
|
@@ -7984,17 +8029,18 @@ function la(e, t, n, r) {
|
|
|
7984
8029
|
}
|
|
7985
8030
|
return (e) => p(m(e));
|
|
7986
8031
|
}
|
|
7987
|
-
var
|
|
7988
|
-
linear:
|
|
7989
|
-
ease:
|
|
7990
|
-
easeIn:
|
|
7991
|
-
easeOut:
|
|
7992
|
-
easeInOut:
|
|
7993
|
-
},
|
|
8032
|
+
var ma = {
|
|
8033
|
+
linear: ca,
|
|
8034
|
+
ease: la,
|
|
8035
|
+
easeIn: ua,
|
|
8036
|
+
easeOut: da,
|
|
8037
|
+
easeInOut: fa
|
|
8038
|
+
}, ha = class extends V {
|
|
7994
8039
|
_keyframes = [];
|
|
7995
8040
|
_isFirstUpdatePosition = !1;
|
|
7996
8041
|
_cachedProps = new t();
|
|
7997
8042
|
_stoped = !1;
|
|
8043
|
+
_pathMeasures = /* @__PURE__ */ new Map();
|
|
7998
8044
|
constructor(e, t = []) {
|
|
7999
8045
|
super(), this.setProperties(e).append(t);
|
|
8000
8046
|
}
|
|
@@ -8025,9 +8071,10 @@ var ua = {
|
|
|
8025
8071
|
e = [this.getParent()].filter(Boolean);
|
|
8026
8072
|
break;
|
|
8027
8073
|
}
|
|
8028
|
-
return e.filter((e) => e instanceof
|
|
8074
|
+
return e.filter((e) => e instanceof ea);
|
|
8029
8075
|
}
|
|
8030
8076
|
_updateKeyframes() {
|
|
8077
|
+
this._pathMeasures.clear();
|
|
8031
8078
|
let e = [], t = this.keyframes;
|
|
8032
8079
|
for (let n = t.length, r = 0; r < n; r++) {
|
|
8033
8080
|
let { offset: i = r === 0 ? 0 : r / (n - 1), easing: a = "linear", ...o } = t[r];
|
|
@@ -8057,26 +8104,28 @@ var ua = {
|
|
|
8057
8104
|
}
|
|
8058
8105
|
let e = this._getTargets(), t = 1 / e.length, n = this.currentTimeProgress;
|
|
8059
8106
|
e.forEach((e, r) => {
|
|
8060
|
-
let i = t === 1 ? n :
|
|
8107
|
+
let i = t === 1 ? n : E(Math.max(0, n - t * r) / t, 0, 1), a = this._cachedProps.get(e);
|
|
8061
8108
|
if (!a) return;
|
|
8062
8109
|
let o = this._parseKeyframes(i, a);
|
|
8063
8110
|
o?.length && this._commitStyle(i, e, a, o[0], o[1]);
|
|
8064
8111
|
});
|
|
8065
8112
|
}
|
|
8066
8113
|
_updateCachedProps() {
|
|
8067
|
-
this.cancel()
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8114
|
+
this.cancel();
|
|
8115
|
+
let e = this._keyframes.some((e) => "offsetPath" in e.props);
|
|
8116
|
+
this._getTargets().forEach((t) => {
|
|
8117
|
+
let n = /* @__PURE__ */ new Map(), r = this._keyframes;
|
|
8118
|
+
for (let e = r.length, i = 0; i < e; i++) Object.keys(r[i].props).forEach((e) => {
|
|
8119
|
+
n.set(e, t.style[e]);
|
|
8071
8120
|
});
|
|
8072
|
-
this._cachedProps.set(
|
|
8121
|
+
e && n.set("transform", t.style.transform), this._cachedProps.set(t, n);
|
|
8073
8122
|
});
|
|
8074
8123
|
}
|
|
8075
8124
|
_parseEasing(e) {
|
|
8076
|
-
if (!e) return
|
|
8077
|
-
if (e in
|
|
8125
|
+
if (!e) return ma.linear;
|
|
8126
|
+
if (e in ma) return ma[e];
|
|
8078
8127
|
let t = e.replace(/cubic-bezier\((.+)\)/, "$1").split(",").map((e) => Number(e));
|
|
8079
|
-
return
|
|
8128
|
+
return pa(t[0], t[1], t[2], t[3]);
|
|
8080
8129
|
}
|
|
8081
8130
|
_parseKeyframes(e, t) {
|
|
8082
8131
|
let n, r = this._keyframes;
|
|
@@ -8105,17 +8154,32 @@ var ua = {
|
|
|
8105
8154
|
width: t.size.x,
|
|
8106
8155
|
height: t.size.y,
|
|
8107
8156
|
fontSize: t.style.fontSize
|
|
8108
|
-
};
|
|
8109
|
-
n.forEach((e, n) => {
|
|
8110
|
-
t.onUpdateStyleProperty(n, this._getDiffValue(n, s[n], l[n], d, f), void 0);
|
|
8157
|
+
}, p = l.offsetPath ?? s.offsetPath, m = p != null;
|
|
8158
|
+
m && this._commitOffsetPath(t, String(p), n, s, l, d), n.forEach((e, n) => {
|
|
8159
|
+
n === "offsetPath" || n === "offsetDistance" || n === "offsetRotate" || m && n === "transform" || t.onUpdateStyleProperty(n, this._getDiffValue(n, s[n], l[n], d, f), void 0);
|
|
8111
8160
|
});
|
|
8112
8161
|
}
|
|
8162
|
+
_commitOffsetPath(e, t, n, r, i, a) {
|
|
8163
|
+
let o = sa(t);
|
|
8164
|
+
if (!o) return;
|
|
8165
|
+
let s = this._pathMeasures.get(o);
|
|
8166
|
+
if (!s) {
|
|
8167
|
+
let e = new de(new le(o)), t = e.getPosTanAtProgress(0).position;
|
|
8168
|
+
s = {
|
|
8169
|
+
measure: e,
|
|
8170
|
+
startX: t.x,
|
|
8171
|
+
startY: t.y
|
|
8172
|
+
}, this._pathMeasures.set(o, s);
|
|
8173
|
+
}
|
|
8174
|
+
let c = E(D(aa(r.offsetDistance ?? i.offsetDistance), aa(i.offsetDistance ?? r.offsetDistance), a), 0, 1), { position: l, angle: u } = s.measure.getPosTanAtProgress(c), d = l.x - s.startX, f = l.y - s.startY, p = oa(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
8175
|
+
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
8176
|
+
}
|
|
8113
8177
|
_getDiffValue(e, t, n, r, i) {
|
|
8114
8178
|
let a, o;
|
|
8115
|
-
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a =
|
|
8116
|
-
else if (n !== void 0) o =
|
|
8179
|
+
if (t === "none" && (t = void 0), n === "none" && (n = void 0), t === void 0 || n === void 0) if (t !== void 0) a = ke(e, String(t), i), o = Oe(a);
|
|
8180
|
+
else if (n !== void 0) o = ke(e, String(n), i), a = Oe(o);
|
|
8117
8181
|
else return;
|
|
8118
|
-
else a =
|
|
8182
|
+
else a = ke(e, String(t), i), o = ke(e, String(n), i);
|
|
8119
8183
|
if (Array.isArray(a) && Array.isArray(o)) {
|
|
8120
8184
|
let e = /* @__PURE__ */ new Set(), t = {}, n = {};
|
|
8121
8185
|
a.forEach(({ name: n, args: r }) => {
|
|
@@ -8128,10 +8192,10 @@ var ua = {
|
|
|
8128
8192
|
let a = Math.max(t[e]?.length ?? 0, n[e]?.length ?? 0), o = t[e], s = n[e];
|
|
8129
8193
|
i += `${e}(${Array.from({ length: a }, (e, t) => {
|
|
8130
8194
|
let n = o?.[t], i = s?.[t], a = n?.normalizedIntValue ?? 0, c = i?.normalizedIntValue ?? 0;
|
|
8131
|
-
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 :
|
|
8195
|
+
return Number.isNaN(a) || Number.isNaN(c) ? i?.value ?? 0 : D(a, c, r);
|
|
8132
8196
|
}).join(", ")}) `;
|
|
8133
8197
|
}), i;
|
|
8134
|
-
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value :
|
|
8198
|
+
} else if (!Array.isArray(a) && !Array.isArray(o)) return Number.isNaN(a.normalizedIntValue) || Number.isNaN(o.normalizedIntValue) ? o.value : D(a.normalizedIntValue, o.normalizedIntValue, r);
|
|
8135
8199
|
}
|
|
8136
8200
|
isPlaying() {
|
|
8137
8201
|
return !this.paused && this.isInsideTimeRange();
|
|
@@ -8154,14 +8218,14 @@ var ua = {
|
|
|
8154
8218
|
});
|
|
8155
8219
|
}
|
|
8156
8220
|
};
|
|
8157
|
-
|
|
8221
|
+
k([_({ fallback: "parent" }), O("design:type", Object)], ha.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], ha.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], ha.prototype, "easing", void 0), ha = k([b("Animation", {
|
|
8158
8222
|
renderMode: "disabled",
|
|
8159
8223
|
processSortMode: "parent-before",
|
|
8160
8224
|
duration: 2e3
|
|
8161
|
-
}),
|
|
8225
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ha);
|
|
8162
8226
|
//#endregion
|
|
8163
8227
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
8164
|
-
var
|
|
8228
|
+
var ga = class t extends e {
|
|
8165
8229
|
static _instance;
|
|
8166
8230
|
static get instance() {
|
|
8167
8231
|
return this._instance ||= new t(), this._instance;
|
|
@@ -8191,7 +8255,7 @@ var fa = class t extends e {
|
|
|
8191
8255
|
togglePause() {
|
|
8192
8256
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
8193
8257
|
}
|
|
8194
|
-
},
|
|
8258
|
+
}, _a = class t extends e {
|
|
8195
8259
|
static PADDING = .1;
|
|
8196
8260
|
_source = null;
|
|
8197
8261
|
_audio = null;
|
|
@@ -8318,7 +8382,7 @@ var fa = class t extends e {
|
|
|
8318
8382
|
let e = this._source;
|
|
8319
8383
|
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), null);
|
|
8320
8384
|
}
|
|
8321
|
-
},
|
|
8385
|
+
}, va = class {
|
|
8322
8386
|
parent;
|
|
8323
8387
|
source = new globalThis.Audio();
|
|
8324
8388
|
_src = "";
|
|
@@ -8335,7 +8399,7 @@ var fa = class t extends e {
|
|
|
8335
8399
|
return !!this.source && this.source.readyState === 4;
|
|
8336
8400
|
}
|
|
8337
8401
|
get context() {
|
|
8338
|
-
return
|
|
8402
|
+
return ga.instance;
|
|
8339
8403
|
}
|
|
8340
8404
|
constructor(e) {
|
|
8341
8405
|
this.parent = e;
|
|
@@ -8346,9 +8410,9 @@ var fa = class t extends e {
|
|
|
8346
8410
|
});
|
|
8347
8411
|
}
|
|
8348
8412
|
createSound() {
|
|
8349
|
-
return new
|
|
8413
|
+
return new _a();
|
|
8350
8414
|
}
|
|
8351
|
-
},
|
|
8415
|
+
}, ya = class extends e {
|
|
8352
8416
|
_input;
|
|
8353
8417
|
_output;
|
|
8354
8418
|
_processers = [];
|
|
@@ -8370,7 +8434,7 @@ var fa = class t extends e {
|
|
|
8370
8434
|
get destination() {
|
|
8371
8435
|
return this._input;
|
|
8372
8436
|
}
|
|
8373
|
-
},
|
|
8437
|
+
}, ba = class {
|
|
8374
8438
|
destination;
|
|
8375
8439
|
source;
|
|
8376
8440
|
constructor(e, t = null) {
|
|
@@ -8385,21 +8449,21 @@ var fa = class t extends e {
|
|
|
8385
8449
|
};
|
|
8386
8450
|
//#endregion
|
|
8387
8451
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
8388
|
-
function
|
|
8389
|
-
if (
|
|
8390
|
-
if (
|
|
8452
|
+
function xa() {
|
|
8453
|
+
if (He) return new AudioContext();
|
|
8454
|
+
if (Ue) {
|
|
8391
8455
|
let e = globalThis.webkitAudioContext;
|
|
8392
8456
|
return new e();
|
|
8393
8457
|
} else throw Error("Failed to createAudioContext");
|
|
8394
8458
|
}
|
|
8395
|
-
function
|
|
8396
|
-
if (
|
|
8397
|
-
if (
|
|
8459
|
+
function Sa(e, t, n) {
|
|
8460
|
+
if (We) return new OfflineAudioContext(e, t, n);
|
|
8461
|
+
if (Ge) {
|
|
8398
8462
|
let r = globalThis.webkitOfflineAudioContext;
|
|
8399
8463
|
return new r(e, t, n);
|
|
8400
8464
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
8401
8465
|
}
|
|
8402
|
-
var
|
|
8466
|
+
var Ca = class e extends ya {
|
|
8403
8467
|
static _instance;
|
|
8404
8468
|
static get instance() {
|
|
8405
8469
|
return this._instance ||= new e(), this._instance;
|
|
@@ -8440,8 +8504,8 @@ var ya = class e extends ha {
|
|
|
8440
8504
|
_compressor;
|
|
8441
8505
|
_analyser;
|
|
8442
8506
|
constructor() {
|
|
8443
|
-
let e =
|
|
8444
|
-
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (
|
|
8507
|
+
let e = xa(), t = Sa(1, 2, We ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
8508
|
+
r.connect(n), n.connect(e.destination), super(r, n), this._context = e, this._offlineContext = t, this._compressor = n, this._analyser = r, this._locked = e.state === "suspended" && (ze || Be), qe && (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));
|
|
8445
8509
|
}
|
|
8446
8510
|
_onFocus() {
|
|
8447
8511
|
if (!this.autoPause) return;
|
|
@@ -8481,7 +8545,7 @@ var ya = class e extends ha {
|
|
|
8481
8545
|
setParamValue(e, t) {
|
|
8482
8546
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
8483
8547
|
}
|
|
8484
|
-
},
|
|
8548
|
+
}, wa = class extends e {
|
|
8485
8549
|
_audio = null;
|
|
8486
8550
|
_sourceNode = null;
|
|
8487
8551
|
_gain = null;
|
|
@@ -8614,7 +8678,7 @@ var ya = class e extends ha {
|
|
|
8614
8678
|
destroy() {
|
|
8615
8679
|
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;
|
|
8616
8680
|
}
|
|
8617
|
-
},
|
|
8681
|
+
}, Ta = class extends ya {
|
|
8618
8682
|
parent;
|
|
8619
8683
|
_sourceBuffer;
|
|
8620
8684
|
_sourceNode;
|
|
@@ -8622,7 +8686,7 @@ var ya = class e extends ha {
|
|
|
8622
8686
|
gain;
|
|
8623
8687
|
analyser;
|
|
8624
8688
|
get context() {
|
|
8625
|
-
return
|
|
8689
|
+
return Ca.instance;
|
|
8626
8690
|
}
|
|
8627
8691
|
get isPlayable() {
|
|
8628
8692
|
return !!this._sourceNode.buffer;
|
|
@@ -8637,8 +8701,8 @@ var ya = class e extends ha {
|
|
|
8637
8701
|
this._sourceNode.buffer = e;
|
|
8638
8702
|
}
|
|
8639
8703
|
constructor(e) {
|
|
8640
|
-
let t =
|
|
8641
|
-
n.connect(i), i.connect(r), r.connect(
|
|
8704
|
+
let t = Ca.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
8705
|
+
n.connect(i), i.connect(r), r.connect(Ca.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
8642
8706
|
}
|
|
8643
8707
|
async load() {
|
|
8644
8708
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -8651,7 +8715,7 @@ var ya = class e extends ha {
|
|
|
8651
8715
|
});
|
|
8652
8716
|
}
|
|
8653
8717
|
_decode(e) {
|
|
8654
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
8718
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : Ca.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
8655
8719
|
}
|
|
8656
8720
|
cloneSource() {
|
|
8657
8721
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -8661,15 +8725,15 @@ var ya = class e extends ha {
|
|
|
8661
8725
|
};
|
|
8662
8726
|
}
|
|
8663
8727
|
createSound() {
|
|
8664
|
-
return new
|
|
8728
|
+
return new wa();
|
|
8665
8729
|
}
|
|
8666
|
-
},
|
|
8730
|
+
}, Ea, Da = class extends V {
|
|
8667
8731
|
static {
|
|
8668
|
-
|
|
8732
|
+
Ea = this;
|
|
8669
8733
|
}
|
|
8670
8734
|
static _soundPool = [];
|
|
8671
8735
|
_sounds = [];
|
|
8672
|
-
_platformAudio =
|
|
8736
|
+
_platformAudio = Ke ? new Ta(this) : new va(this);
|
|
8673
8737
|
get platformAudio() {
|
|
8674
8738
|
return this._platformAudio;
|
|
8675
8739
|
}
|
|
@@ -8762,7 +8826,7 @@ var ya = class e extends ha {
|
|
|
8762
8826
|
this._sounds.length = 0;
|
|
8763
8827
|
}
|
|
8764
8828
|
_createSound() {
|
|
8765
|
-
return
|
|
8829
|
+
return Ea._soundPool.length > 0 ? Ea._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
8766
8830
|
}
|
|
8767
8831
|
refresh() {
|
|
8768
8832
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -8778,7 +8842,7 @@ var ya = class e extends ha {
|
|
|
8778
8842
|
this._recycleSound(e);
|
|
8779
8843
|
};
|
|
8780
8844
|
_recycleSound(e) {
|
|
8781
|
-
e.destroy(),
|
|
8845
|
+
e.destroy(), Ea._soundPool.includes(e) || Ea._soundPool.push(e);
|
|
8782
8846
|
}
|
|
8783
8847
|
_prevTime = 0;
|
|
8784
8848
|
_timer = 0;
|
|
@@ -8794,14 +8858,14 @@ var ya = class e extends ha {
|
|
|
8794
8858
|
}, 100);
|
|
8795
8859
|
}
|
|
8796
8860
|
};
|
|
8797
|
-
|
|
8861
|
+
Da = Ea = k([b("Audio"), O("design:paramtypes", [Object])], Da);
|
|
8798
8862
|
//#endregion
|
|
8799
8863
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
8800
|
-
var
|
|
8864
|
+
var Oa = class extends wr {}, ka = class extends ea {
|
|
8801
8865
|
_audioBuffer;
|
|
8802
8866
|
_src = (() => {
|
|
8803
8867
|
let e = S();
|
|
8804
|
-
return e ? new
|
|
8868
|
+
return e ? new z({ source: e }) : void 0;
|
|
8805
8869
|
})();
|
|
8806
8870
|
_needsUpdateTexture = !1;
|
|
8807
8871
|
constructor(e = {}) {
|
|
@@ -8821,7 +8885,7 @@ var wa = class extends wr {}, Ta = class extends $i {
|
|
|
8821
8885
|
}
|
|
8822
8886
|
}
|
|
8823
8887
|
async _loadSrc(e) {
|
|
8824
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
8888
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ca.decode(e)).then((e) => {
|
|
8825
8889
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
8826
8890
|
});
|
|
8827
8891
|
}
|
|
@@ -8856,16 +8920,16 @@ var wa = class extends wr {}, Ta = class extends $i {
|
|
|
8856
8920
|
this.syncTexture(), super._process(e);
|
|
8857
8921
|
}
|
|
8858
8922
|
};
|
|
8859
|
-
|
|
8923
|
+
k([_(), O("design:type", Object)], ka.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], ka.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], ka.prototype, "color", void 0), ka = k([b("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], ka);
|
|
8860
8924
|
//#endregion
|
|
8861
8925
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
8862
|
-
var
|
|
8926
|
+
var Aa, ja = class extends Cr {
|
|
8863
8927
|
static {
|
|
8864
|
-
|
|
8928
|
+
Aa = this;
|
|
8865
8929
|
}
|
|
8866
8930
|
blur = 10;
|
|
8867
8931
|
quality = 10;
|
|
8868
|
-
static material = new
|
|
8932
|
+
static material = new I({ gl: {
|
|
8869
8933
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nout vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8870
8934
|
fragment: "precision highp float;\nin vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 offset;\nuniform float progress;\n\nvoid main(void) {\n vec2 offset1 = vec2(offset.x - progress * offset.x, offset.y - progress * offset.y);\n vec4 color = vec4(0.0);\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y + offset1.y));\n color += texture(sampler, vec2(vUv.x + offset1.x, vUv.y - offset1.y));\n color += texture(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));\n color *= 0.25;\n gl_FragColor = color;\n}"
|
|
8871
8935
|
} });
|
|
@@ -8880,7 +8944,7 @@ var Ea, Da = class extends Cr {
|
|
|
8880
8944
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
8881
8945
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
8882
8946
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
8883
|
-
|
|
8947
|
+
L.draw(e, Aa.material, {
|
|
8884
8948
|
sampler: r,
|
|
8885
8949
|
progress: i,
|
|
8886
8950
|
...t
|
|
@@ -8888,35 +8952,35 @@ var Ea, Da = class extends Cr {
|
|
|
8888
8952
|
});
|
|
8889
8953
|
}
|
|
8890
8954
|
};
|
|
8891
|
-
|
|
8955
|
+
ja = Aa = k([b("KawaseTransition")], ja);
|
|
8892
8956
|
//#endregion
|
|
8893
8957
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
8894
|
-
var
|
|
8958
|
+
var Ma, Na = class extends Cr {
|
|
8895
8959
|
static {
|
|
8896
|
-
|
|
8960
|
+
Ma = this;
|
|
8897
8961
|
}
|
|
8898
|
-
static material = new
|
|
8962
|
+
static material = new I({ gl: {
|
|
8899
8963
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8900
8964
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform float progress;\nuniform sampler2D previous;\nuniform sampler2D next;\n\nfloat easeInOutQuint(float t) {\n return t < 0.5 ? 16.0*t*t*t*t*t : 1.0+16.0*(--t)*t*t*t*t;\n}\n\nvoid main() {\n vec4 src1Color = texture2D(previous, vUv);\n vec4 src2Color = texture2D(next, vUv);\n float mProgress = 1.0 - progress;\n float mixPercent = 0.0;\n if (vUv.x <= mProgress) {\n mixPercent = 1.0;\n }\n gl_FragColor = mix(src2Color, src1Color, mixPercent);\n}"
|
|
8901
8965
|
} });
|
|
8902
8966
|
apply(e) {
|
|
8903
|
-
|
|
8967
|
+
L.draw(e, Ma.material, {
|
|
8904
8968
|
previous: 0,
|
|
8905
8969
|
next: 1,
|
|
8906
8970
|
progress: this.currentTimeProgress
|
|
8907
8971
|
});
|
|
8908
8972
|
}
|
|
8909
8973
|
};
|
|
8910
|
-
|
|
8974
|
+
Na = Ma = k([b("LeftEraseTransition")], Na);
|
|
8911
8975
|
//#endregion
|
|
8912
8976
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
8913
|
-
var
|
|
8977
|
+
var Pa, Fa = class extends Cr {
|
|
8914
8978
|
static {
|
|
8915
|
-
|
|
8979
|
+
Pa = this;
|
|
8916
8980
|
}
|
|
8917
8981
|
blur = 100;
|
|
8918
8982
|
gradientBlur = 600;
|
|
8919
|
-
static material = new
|
|
8983
|
+
static material = new I({ gl: {
|
|
8920
8984
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8921
8985
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\nuniform float progress;\n\nfloat random(vec3 scale, float seed) {\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void) {\n float blur1 = blur - progress * blur;\n float gradientBlur1 = progress * gradientBlur;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientBlur1) * blur1;\n\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample1 = texture2D(sampler, vUv + delta / texSize * percent * radius);\n sample1.rgb *= sample1.a;\n color += sample1 * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}"
|
|
8922
8986
|
} });
|
|
@@ -8924,7 +8988,7 @@ var Aa, ja = class extends Cr {
|
|
|
8924
8988
|
let n = this.currentTimeProgress, r, i;
|
|
8925
8989
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8926
8990
|
let a = t.width, o = t.height, s = [0, o / 2], c = [600, o / 2], l = [a, o], u = c[0] - s[0], d = c[1] - s[1], f = Math.sqrt(u * u + d * d);
|
|
8927
|
-
|
|
8991
|
+
L.draw(e, Pa.material, {
|
|
8928
8992
|
sampler: r,
|
|
8929
8993
|
progress: i,
|
|
8930
8994
|
blur: this.blur,
|
|
@@ -8933,7 +8997,7 @@ var Aa, ja = class extends Cr {
|
|
|
8933
8997
|
end: c,
|
|
8934
8998
|
delta: [u / f, d / f],
|
|
8935
8999
|
texSize: l
|
|
8936
|
-
}),
|
|
9000
|
+
}), L.draw(e, Pa.material, {
|
|
8937
9001
|
sampler: r,
|
|
8938
9002
|
progress: i,
|
|
8939
9003
|
blur: this.blur,
|
|
@@ -8945,18 +9009,18 @@ var Aa, ja = class extends Cr {
|
|
|
8945
9009
|
});
|
|
8946
9010
|
}
|
|
8947
9011
|
};
|
|
8948
|
-
|
|
9012
|
+
Fa = Pa = k([b("TiltShiftTransition")], Fa);
|
|
8949
9013
|
//#endregion
|
|
8950
9014
|
//#region src/scene/transitions/TwistTransition.ts
|
|
8951
|
-
var
|
|
9015
|
+
var Ia, La = class extends Cr {
|
|
8952
9016
|
static {
|
|
8953
|
-
|
|
9017
|
+
Ia = this;
|
|
8954
9018
|
}
|
|
8955
9019
|
radius;
|
|
8956
9020
|
angle = 4;
|
|
8957
9021
|
padding = 20;
|
|
8958
9022
|
offset;
|
|
8959
|
-
static material = new
|
|
9023
|
+
static material = new I({ gl: {
|
|
8960
9024
|
vertex: "attribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n vUv = uv;\n}",
|
|
8961
9025
|
fragment: "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\nuniform float progress;\n\nvec2 mapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord *= filterArea.xy;\n return coord;\n}\n\nvec2 unmapCoord(vec2 coord) {\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n return coord;\n}\n\nvec2 twist(vec2 coord, float radius) {\n coord -= offset;\n float dist = length(coord);\n if (dist < radius) {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n coord += offset;\n return coord;\n}\n\nvoid main(void) {\n vec2 coord = mapCoord(vUv);\n coord = twist(coord, radius - (progress * radius));\n coord = unmapCoord(coord);\n gl_FragColor = texture2D(sampler, coord);\n}"
|
|
8962
9026
|
} });
|
|
@@ -8964,7 +9028,7 @@ var Ma, Na = class extends Cr {
|
|
|
8964
9028
|
let n = this.currentTimeProgress, r, i;
|
|
8965
9029
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
8966
9030
|
let a = t.width, o = t.height;
|
|
8967
|
-
|
|
9031
|
+
L.draw(e, Ia.material, {
|
|
8968
9032
|
sampler: r,
|
|
8969
9033
|
progress: i,
|
|
8970
9034
|
filterArea: [
|
|
@@ -8980,10 +9044,10 @@ var Ma, Na = class extends Cr {
|
|
|
8980
9044
|
});
|
|
8981
9045
|
}
|
|
8982
9046
|
};
|
|
8983
|
-
|
|
9047
|
+
La = Ia = k([b("TwistTransition")], La);
|
|
8984
9048
|
//#endregion
|
|
8985
9049
|
//#region src/asset/loaders/GifLoader.ts
|
|
8986
|
-
var
|
|
9050
|
+
var Ra = class extends Vn {
|
|
8987
9051
|
install(e) {
|
|
8988
9052
|
let t = async (t) => {
|
|
8989
9053
|
let { decodeFrames: n } = await import("modern-gif");
|
|
@@ -9000,14 +9064,14 @@ var Pa = class extends Vn {
|
|
|
9000
9064
|
e.register(n, t);
|
|
9001
9065
|
}), e.gif = this, this;
|
|
9002
9066
|
}
|
|
9003
|
-
},
|
|
9067
|
+
}, za = class extends Vn {
|
|
9004
9068
|
install(e) {
|
|
9005
9069
|
let t = async (e) => JSON.parse(await e.text());
|
|
9006
9070
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
9007
9071
|
e.register(n, t);
|
|
9008
9072
|
}), e.json = this, this;
|
|
9009
9073
|
}
|
|
9010
|
-
},
|
|
9074
|
+
}, Ba = class extends Vn {
|
|
9011
9075
|
install(e) {
|
|
9012
9076
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
9013
9077
|
container: null,
|
|
@@ -9018,14 +9082,14 @@ var Pa = class extends Vn {
|
|
|
9018
9082
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
9019
9083
|
}), e.lottie = this, this;
|
|
9020
9084
|
}
|
|
9021
|
-
},
|
|
9085
|
+
}, Va = class extends Vn {
|
|
9022
9086
|
install(e) {
|
|
9023
9087
|
let t = async (e) => e.text();
|
|
9024
9088
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
9025
9089
|
}
|
|
9026
|
-
},
|
|
9090
|
+
}, Ha = class extends Vn {
|
|
9027
9091
|
install(e) {
|
|
9028
|
-
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new
|
|
9092
|
+
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
|
|
9029
9093
|
source: e,
|
|
9030
9094
|
uploadMethodId: "image",
|
|
9031
9095
|
mipmap: !0,
|
|
@@ -9047,11 +9111,11 @@ var Pa = class extends Vn {
|
|
|
9047
9111
|
e.register(n, t);
|
|
9048
9112
|
}), e.texture = this, this;
|
|
9049
9113
|
}
|
|
9050
|
-
},
|
|
9114
|
+
}, Ua = class extends Vn {
|
|
9051
9115
|
install(e) {
|
|
9052
9116
|
return this.load = (t) => e.awaitBy(() => new ar(t).load()), e.video = this, this;
|
|
9053
9117
|
}
|
|
9054
|
-
},
|
|
9118
|
+
}, Wa = Object.entries({
|
|
9055
9119
|
"font/woff": ["woff"],
|
|
9056
9120
|
"font/ttf": ["ttf"],
|
|
9057
9121
|
"font/otf": ["otf"],
|
|
@@ -9067,31 +9131,31 @@ var Pa = class extends Vn {
|
|
|
9067
9131
|
"image/webp": ["webp"],
|
|
9068
9132
|
"application/json": ["json"]
|
|
9069
9133
|
});
|
|
9070
|
-
function
|
|
9071
|
-
for (let [t, n] of
|
|
9134
|
+
function Ga(e) {
|
|
9135
|
+
for (let [t, n] of Wa) if (n.includes(e)) return t;
|
|
9072
9136
|
}
|
|
9073
|
-
function
|
|
9137
|
+
function Ka(e) {
|
|
9074
9138
|
let t;
|
|
9075
9139
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
9076
9140
|
else if (e.startsWith("http")) {
|
|
9077
9141
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
9078
|
-
n && (t =
|
|
9142
|
+
n && (t = Ga(n));
|
|
9079
9143
|
}
|
|
9080
9144
|
return t;
|
|
9081
9145
|
}
|
|
9082
9146
|
//#endregion
|
|
9083
9147
|
//#region src/asset/Assets.ts
|
|
9084
|
-
var
|
|
9148
|
+
var qa = "WeakRef" in globalThis, Ja = class extends e {
|
|
9085
9149
|
defaultHandler = (e) => e;
|
|
9086
9150
|
_handlers = /* @__PURE__ */ new Map();
|
|
9087
9151
|
_handleing = /* @__PURE__ */ new Map();
|
|
9088
9152
|
_handled = /* @__PURE__ */ new Map();
|
|
9089
|
-
_gc =
|
|
9153
|
+
_gc = qa ? new FinalizationRegistry((e) => {
|
|
9090
9154
|
let t = this.get(e);
|
|
9091
9155
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
9092
9156
|
}) : void 0;
|
|
9093
9157
|
constructor() {
|
|
9094
|
-
super(),
|
|
9158
|
+
super(), qa || x.on(this.gc.bind(this), { sort: 2 });
|
|
9095
9159
|
}
|
|
9096
9160
|
use(e) {
|
|
9097
9161
|
return e.install(this), this;
|
|
@@ -9140,11 +9204,11 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9140
9204
|
}
|
|
9141
9205
|
get(e) {
|
|
9142
9206
|
let t = this._handled.get(e);
|
|
9143
|
-
return
|
|
9207
|
+
return qa && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
9144
9208
|
}
|
|
9145
9209
|
set(e, t) {
|
|
9146
9210
|
let n = t;
|
|
9147
|
-
|
|
9211
|
+
qa && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n);
|
|
9148
9212
|
}
|
|
9149
9213
|
async awaitBy(e) {
|
|
9150
9214
|
let t = e(), n = c();
|
|
@@ -9159,7 +9223,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9159
9223
|
return this._handleing.set(e, r), r;
|
|
9160
9224
|
}
|
|
9161
9225
|
async load(e, t) {
|
|
9162
|
-
let n = await this.loadBy(e), r =
|
|
9226
|
+
let n = await this.loadBy(e), r = Ka(e);
|
|
9163
9227
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
9164
9228
|
}
|
|
9165
9229
|
async waitUntilLoad() {
|
|
@@ -9173,14 +9237,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9173
9237
|
n && "destroy" in n && n.destroy();
|
|
9174
9238
|
}), this._handled.clear();
|
|
9175
9239
|
}
|
|
9176
|
-
}, $ = new
|
|
9240
|
+
}, $ = new Ja().use(new Hn()).use(new Ra()).use(new za()).use(new Ba()).use(new Va()).use(new Ha()).use(new Ua()), Ya = {
|
|
9177
9241
|
alpha: !0,
|
|
9178
9242
|
stencil: !0,
|
|
9179
9243
|
antialias: !1,
|
|
9180
9244
|
premultipliedAlpha: !0,
|
|
9181
9245
|
preserveDrawingBuffer: !1,
|
|
9182
9246
|
powerPreference: "default"
|
|
9183
|
-
},
|
|
9247
|
+
}, Xa = class extends Sr {
|
|
9184
9248
|
renderer;
|
|
9185
9249
|
get view() {
|
|
9186
9250
|
return this.renderer.view;
|
|
@@ -9203,7 +9267,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9203
9267
|
set pixelRatio(e) {
|
|
9204
9268
|
this.renderer.pixelRatio = e, this.resize(this.width, this.height);
|
|
9205
9269
|
}
|
|
9206
|
-
_resizeObserver =
|
|
9270
|
+
_resizeObserver = Fe ? new ResizeObserver((e) => {
|
|
9207
9271
|
let t = e[0];
|
|
9208
9272
|
if (t.target === this.view) {
|
|
9209
9273
|
let { inlineSize: e, blockSize: n } = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize;
|
|
@@ -9211,14 +9275,14 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9211
9275
|
}
|
|
9212
9276
|
}) : void 0;
|
|
9213
9277
|
constructor(e = {}) {
|
|
9214
|
-
let { view: t, width: n, height: r, pixelRatio: i =
|
|
9278
|
+
let { view: t, width: n, height: r, pixelRatio: i = Ye, autoResize: a, data: o } = e;
|
|
9215
9279
|
super(), this.renderer = new Bn(t, {
|
|
9216
|
-
alpha:
|
|
9217
|
-
stencil:
|
|
9218
|
-
antialias:
|
|
9219
|
-
premultipliedAlpha:
|
|
9220
|
-
preserveDrawingBuffer:
|
|
9221
|
-
powerPreference:
|
|
9280
|
+
alpha: Ya.alpha ?? e.alpha,
|
|
9281
|
+
stencil: Ya.stencil ?? e.stencil,
|
|
9282
|
+
antialias: Ya.antialias ?? e.antialias,
|
|
9283
|
+
premultipliedAlpha: Ya.premultipliedAlpha ?? e.premultipliedAlpha,
|
|
9284
|
+
preserveDrawingBuffer: Ya.preserveDrawingBuffer ?? e.preserveDrawingBuffer,
|
|
9285
|
+
powerPreference: Ya.powerPreference ?? e.powerPreference
|
|
9222
9286
|
}), this._setupInput(), this.pixelRatio = i, a ? !t && this.renderer.view && (this.renderer.view.style.width = "100%", this.renderer.view.style.height = "100%") : this.resize(n || this.gl.drawingBufferWidth || this.view?.clientWidth || 200, r || this.gl.drawingBufferHeight || this.view?.clientHeight || 200, !t), this.setProperties(e), o && this.root.append(o);
|
|
9223
9287
|
}
|
|
9224
9288
|
_updateProperty(e, t, n) {
|
|
@@ -9251,7 +9315,7 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9251
9315
|
return this.renderer.resize(e, t, n), this.root.width = e, this.root.height = t, this.render(), this;
|
|
9252
9316
|
}
|
|
9253
9317
|
nextTick() {
|
|
9254
|
-
return
|
|
9318
|
+
return xe();
|
|
9255
9319
|
}
|
|
9256
9320
|
async waitUntilLoad() {
|
|
9257
9321
|
await $.waitUntilLoad(), await this.nextTick();
|
|
@@ -9301,22 +9365,22 @@ var Ua = "WeakRef" in globalThis, Wa = class extends e {
|
|
|
9301
9365
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
9302
9366
|
}
|
|
9303
9367
|
};
|
|
9304
|
-
|
|
9368
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], Xa.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Xa.prototype, "autoStart", void 0);
|
|
9305
9369
|
//#endregion
|
|
9306
9370
|
//#region src/render.ts
|
|
9307
|
-
var
|
|
9308
|
-
function
|
|
9309
|
-
return
|
|
9371
|
+
var Za, Qa = [], $a = !1;
|
|
9372
|
+
function eo() {
|
|
9373
|
+
return Za ??= new Xa({
|
|
9310
9374
|
pixelRatio: 1,
|
|
9311
9375
|
width: 1,
|
|
9312
9376
|
height: 1,
|
|
9313
9377
|
preserveDrawingBuffer: !0
|
|
9314
9378
|
});
|
|
9315
9379
|
}
|
|
9316
|
-
async function
|
|
9317
|
-
if (
|
|
9318
|
-
for (
|
|
9319
|
-
let t =
|
|
9380
|
+
async function to(e = 100) {
|
|
9381
|
+
if (!$a) {
|
|
9382
|
+
for ($a = !0; Qa.length;) {
|
|
9383
|
+
let t = Qa.shift();
|
|
9320
9384
|
if (t) try {
|
|
9321
9385
|
await t();
|
|
9322
9386
|
} catch (e) {
|
|
@@ -9324,11 +9388,11 @@ async function Za(e = 100) {
|
|
|
9324
9388
|
}
|
|
9325
9389
|
else await new Promise((t) => setTimeout(t, e));
|
|
9326
9390
|
}
|
|
9327
|
-
|
|
9391
|
+
$a = !1;
|
|
9328
9392
|
}
|
|
9329
9393
|
}
|
|
9330
|
-
async function
|
|
9331
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f =
|
|
9394
|
+
async function no(e) {
|
|
9395
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], onBefore: s, onKeyframe: c, ...l } = e, u = Math.floor(r), d = Math.floor(i), f = eo();
|
|
9332
9396
|
if (f.resetProperties(), f.setProperties(l), f.debug = t, f.fonts = n, f.timeline.currentTime = 0, f.resize(u, d, !0), f.root.removeChildren(!0), f.root.append(a), await s?.(f), await f.waitAndRender(), o.length) {
|
|
9333
9397
|
let e = o.length, t = o[e - 1];
|
|
9334
9398
|
for (let n = 0; n < e; n++) {
|
|
@@ -9346,15 +9410,15 @@ async function Qa(e) {
|
|
|
9346
9410
|
toCanvas2D: () => f.toCanvas2D(new ImageData(p, u, d))
|
|
9347
9411
|
};
|
|
9348
9412
|
}
|
|
9349
|
-
async function
|
|
9413
|
+
async function ro(e) {
|
|
9350
9414
|
return new Promise((t) => {
|
|
9351
|
-
|
|
9415
|
+
Qa.push(async () => t(await no(e).then((e) => e.toCanvas2D()))), to();
|
|
9352
9416
|
});
|
|
9353
9417
|
}
|
|
9354
|
-
async function
|
|
9418
|
+
async function io(e) {
|
|
9355
9419
|
return new Promise((t) => {
|
|
9356
|
-
|
|
9420
|
+
Qa.push(async () => t(await no(e).then((e) => e.pixels))), to();
|
|
9357
9421
|
});
|
|
9358
9422
|
}
|
|
9359
9423
|
//#endregion
|
|
9360
|
-
export {
|
|
9424
|
+
export { yt as Aabb2D, $n as AnimatedTexture, ha as Animation, Ja as Assets, Da as Audio, ya as AudioPipeline, ba as AudioProcessor, Oa as AudioSpectrum, ka as AudioWaveform, A as BufferUsage, Tr as Camera2D, sr as CanvasContext, _r as CanvasItem, er as CanvasTexture, T as Color, W as ColorAdjustEffect, Rr as ColorFilterEffect, St as ColorMatrix, Vr as ColorOverlayEffect, Ur as ColorRemoveEffect, Kr as ColorReplaceEffect, tr as ColorTexture, C as CoreObject, bt as DEG_TO_RAD, Ye as DEVICE_PIXEL_RATIO, G as DrawboardEffect, $r as DropShadowEffect, U as Effect, Xn as EffectMaterial, ea as Element2D, _i as Element2DBackground, X as Element2DChart, xi as Element2DConnection, Y as Element2DFill, ki as Element2DForeground, ji as Element2DOutline, Mi as Element2DShadow, Ni as Element2DShape, Pi as Element2DStyle, Ri as Element2DTable, Z as Element2DText, ti as EmbossEffect, Xa as Engine, Yi as Flexbox, Hn as FontLoader, Zr as GaussianBlurEffect, Wn as Geometry, Ra as GifLoader, ln as GlBatch2DSystem, an as GlBlendMode, Dt as GlBuffer, Pt as GlBufferSystem, Et as GlBufferTarget, pn as GlMaskSystem, Kt as GlProgram, _n as GlRenderTarget, vn as GlRenderTargetSystem, tn as GlShaderSystem, sn as GlState, cn as GlStateSystem, hn as GlStencilSystem, j as GlSystem, gn as GlViewportSystem, K as GlitchEffect, q as GodrayEffect, nr as GradientTexture, va as HTMLAudio, ga as HTMLAudioContext, _a as HTMLSound, qe as IN_BROWSER, Je as IN_MAC_OS, Un as IndexBuffer, _t as Input, dt as InputEvent, za as JsonLoader, si as KawaseBlurEffect, ja as KawaseTransition, ft as KeyboardInputEvent, Na as LeftEraseTransition, Vn as Loader, na as Lottie2D, Ba as LottieLoader, Tt as MainLoop, li as MaskEffect, I as Material, lr as Meta, pt as MouseInputEvent, B as Node, wr as Node2D, Ct as Obb2D, J as OutlineEffect, Se as PI, Ce as PI_2, pi as PixelateEffect, rr as PixelsTexture, mt as PointerInputEvent, wt as Projection2D, Gn as QuadGeometry, L as QuadUvGeometry, xt as RAD_TO_DEG, vt as RefCounted, R as RenderTarget, Ot as Renderer, w as Resource, He as SUPPORTS_AUDIO_CONTEXT, Be as SUPPORTS_CLICK_EVENTS, Ve as SUPPORTS_CREATE_IMAGE_BITMAP, Pe as SUPPORTS_IMAGE_BITMAP, Re as SUPPORTS_MOUSE_EVENTS, We as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Ie as SUPPORTS_POINTER_EVENTS, Fe as SUPPORTS_RESIZE_OBSERVER, ze as SUPPORTS_TOUCH_EVENTS, Ne as SUPPORTS_WEBGL2, Ue as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Ge as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, Ke as SUPPORTS_WEB_AUDIO, Le as SUPPORTS_WHEEL_EVENTS, Sr as SceneTree, Va as TextLoader, z as Texture2D, Ha as TextureLoader, ta as TextureRect2D, x as Ticker, Fa as TiltShiftTransition, br as Timeline, V as TimelineNode, ra as TransformRect2D, Cr as Transition, La as TwistTransition, At as UniformGroup, Qn as UvGeometry, Zn as UvMaterial, F as VertexAttribute, P as VertexBuffer, ia as Video2D, Ua as VideoLoader, ar as VideoTexture, H as Viewport, or as ViewportTexture, Ta as WebAudio, Ca as WebAudioContext, Bn as WebGLRenderer, wa as WebSound, ht as WheelInputEvent, xr as Window, hi as ZoomBlurEffect, Bi as alignMap, $ as assets, Er as axisDir, Ji as boxSizingMap, E as clamp, oi as clampFrag, S as createHTMLCanvas, Nt as createIdFromString, be as createNode, ct as crossOrigin, pa as cubicBezier, b as customNode, ye as customNodes, Ya as defaultOptions, st as determineCrossOrigin, Hi as directionMap, Vi as displayMap, la as ease, ua as easeIn, fa as easeInOut, da as easeOut, Q as edgeMap, Ui as flexDirectionMap, Wi as flexWrapMap, ai as frag, rt as getCanvasFactory, Oe as getDefaultCssPropertyValue, ot as getGlContextProvider, eo as getRenderEngine, zi as gutterMap, ut as instanceId, $e as isCanvasElement, Xe as isElementNode, Qe as isImageElement, we as isPow2, Ze as isVideoElement, et as isWebgl2, Gi as justifyMap, D as lerp, ca as linear, dn as log2, on as mapGlBlendModes, un as nextPow2, xe as nextTick, Ki as overflowMap, Pr as parseCssFilter, Ae as parseCssFunctions, ke as parseCssProperty, Fr as parseCssTransformOrigin, qi as positionTypeMap, ro as render, io as renderPixels, hr as resetBatchPool, Dr as routeConnection, nt as setCanvasFactory, at as setGlContextProvider, mn as stencilModeMap, ma as timingFunctions };
|