modern-canvas 0.27.12 → 0.27.13
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/core/math/Aabb2D.d.ts +8 -0
- package/dist/index.js +620 -614
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -555,7 +555,13 @@ var ht = class e {
|
|
|
555
555
|
destroy() {
|
|
556
556
|
this.destroyed || (this.destroyed = !0, this._destroy(), this.emit("destroy"), this.removeAllListeners());
|
|
557
557
|
}
|
|
558
|
-
}, St = class extends w {}, Ct = class extends St {}
|
|
558
|
+
}, St = class extends w {}, Ct = class extends St {};
|
|
559
|
+
//#endregion
|
|
560
|
+
//#region src/core/math/Aabb2D.ts
|
|
561
|
+
function wt(e) {
|
|
562
|
+
return Number.isFinite(e) ? e : 0;
|
|
563
|
+
}
|
|
564
|
+
var Tt = class e {
|
|
559
565
|
get x() {
|
|
560
566
|
return this.min.x;
|
|
561
567
|
}
|
|
@@ -629,10 +635,10 @@ var ht = class e {
|
|
|
629
635
|
this._updateMax = this._updateMax.bind(this), this._updateSize = this._updateSize.bind(this), this.min = new y(t.x, t.y, this._updateMax), this.size = new y(n.x, n.y, this._updateMax), this.max = new y(t.x + n.x, t.y + n.y, this._updateSize);
|
|
630
636
|
}
|
|
631
637
|
_updateSize() {
|
|
632
|
-
return this.size.set(this.max.x - this.min.x, this.max.y - this.min.y), this;
|
|
638
|
+
return this.size.set(wt(this.max.x - this.min.x), wt(this.max.y - this.min.y)), this;
|
|
633
639
|
}
|
|
634
640
|
_updateMax() {
|
|
635
|
-
return this.max.set(this.min.x + this.size.x, this.min.y + this.size.y), this;
|
|
641
|
+
return this.max.set(wt(this.min.x + this.size.x), wt(this.min.y + this.size.y)), this;
|
|
636
642
|
}
|
|
637
643
|
overlap(e, t) {
|
|
638
644
|
switch (t) {
|
|
@@ -772,7 +778,7 @@ var T = class {
|
|
|
772
778
|
this.a
|
|
773
779
|
];
|
|
774
780
|
}
|
|
775
|
-
},
|
|
781
|
+
}, Et = Se / 180, Dt = 180 / Se;
|
|
776
782
|
function E(e, t, n) {
|
|
777
783
|
return Math.max(t, Math.min(e, n));
|
|
778
784
|
}
|
|
@@ -781,7 +787,7 @@ function D(e, t, n) {
|
|
|
781
787
|
}
|
|
782
788
|
//#endregion
|
|
783
789
|
//#region src/core/math/ColorMatrix.ts
|
|
784
|
-
var
|
|
790
|
+
var Ot = class {
|
|
785
791
|
_array = /* @__PURE__ */ new Float32Array(20);
|
|
786
792
|
constructor() {
|
|
787
793
|
this.identity();
|
|
@@ -1037,10 +1043,10 @@ var Dt = class {
|
|
|
1037
1043
|
toArray() {
|
|
1038
1044
|
return this._array;
|
|
1039
1045
|
}
|
|
1040
|
-
},
|
|
1046
|
+
}, kt = class e extends Tt {
|
|
1041
1047
|
rotation;
|
|
1042
1048
|
get rotationDegrees() {
|
|
1043
|
-
return this.rotation /
|
|
1049
|
+
return this.rotation / Et;
|
|
1044
1050
|
}
|
|
1045
1051
|
constructor(...e) {
|
|
1046
1052
|
let t, n;
|
|
@@ -1050,7 +1056,7 @@ var Dt = class {
|
|
|
1050
1056
|
if (!this.rotation && (!("rotation" in e) || !e.rotation)) return super.overlap(e, t);
|
|
1051
1057
|
{
|
|
1052
1058
|
let t = (e, t) => Math.abs(e.x * t.x + e.y * t.y), n = (e) => {
|
|
1053
|
-
let { width: n, height: r, rotation: i = 0 } = e, a = i /
|
|
1059
|
+
let { width: n, height: r, rotation: i = 0 } = e, a = i / Et;
|
|
1054
1060
|
a = -a % 180;
|
|
1055
1061
|
let o = a / 180 * Math.PI, s = {
|
|
1056
1062
|
x: Math.cos(o),
|
|
@@ -1092,7 +1098,7 @@ var Dt = class {
|
|
|
1092
1098
|
clone() {
|
|
1093
1099
|
return new e(this.toJSON());
|
|
1094
1100
|
}
|
|
1095
|
-
},
|
|
1101
|
+
}, At = class {
|
|
1096
1102
|
_array;
|
|
1097
1103
|
x = 0;
|
|
1098
1104
|
y = 0;
|
|
@@ -1129,7 +1135,7 @@ function k(e, t, n, r) {
|
|
|
1129
1135
|
}
|
|
1130
1136
|
//#endregion
|
|
1131
1137
|
//#region src/core/os/MainLoop.ts
|
|
1132
|
-
var
|
|
1138
|
+
var jt = class extends w {
|
|
1133
1139
|
_starting = !1;
|
|
1134
1140
|
_nextDeltaTime = 0;
|
|
1135
1141
|
_startedProcess;
|
|
@@ -1159,12 +1165,12 @@ var At = class extends w {
|
|
|
1159
1165
|
super._destroy(), this.stop();
|
|
1160
1166
|
}
|
|
1161
1167
|
};
|
|
1162
|
-
k([_({ fallback: 60 }), O("design:type", Number)],
|
|
1168
|
+
k([_({ fallback: 60 }), O("design:type", Number)], jt.prototype, "fps", void 0), k([_({ fallback: 1 }), O("design:type", Number)], jt.prototype, "speed", void 0);
|
|
1163
1169
|
//#endregion
|
|
1164
1170
|
//#region src/core/reactivity.ts
|
|
1165
|
-
var
|
|
1166
|
-
function
|
|
1167
|
-
return !Object.prototype.hasOwnProperty.call(e,
|
|
1171
|
+
var Mt = "__v_skip";
|
|
1172
|
+
function Nt(e) {
|
|
1173
|
+
return !Object.prototype.hasOwnProperty.call(e, Mt) && Object.isExtensible(e) && Object.defineProperty(e, Mt, {
|
|
1168
1174
|
configurable: !0,
|
|
1169
1175
|
enumerable: !1,
|
|
1170
1176
|
value: !0
|
|
@@ -1172,14 +1178,14 @@ function Mt(e) {
|
|
|
1172
1178
|
}
|
|
1173
1179
|
//#endregion
|
|
1174
1180
|
//#region src/core/renderers/gl/Batch2DEffect.ts
|
|
1175
|
-
var
|
|
1176
|
-
function
|
|
1181
|
+
var Pt = 1, Ft = 2;
|
|
1182
|
+
function It(e) {
|
|
1177
1183
|
return Math.min(255, Math.max(1, Math.round(e * 32) + 128));
|
|
1178
1184
|
}
|
|
1179
|
-
var
|
|
1185
|
+
var Lt = {
|
|
1180
1186
|
name: "strokeFeather",
|
|
1181
1187
|
fragment: "if (mod(floor(vFlags * 0.5), 2.0) > 0.5) {\n float w = 1.0 / max(fwidth(vUv.y), 1e-6);\n float d = min(vUv.y, 1.0 - vUv.y) * w;\n color *= clamp(d + 0.5, 0.0, 1.0) * clamp(w, 0.0, 1.0);\n }"
|
|
1182
|
-
},
|
|
1188
|
+
}, Rt = {
|
|
1183
1189
|
name: "flowStreak",
|
|
1184
1190
|
uniformDecls: "uniform vec3 uFlowColor;\nuniform float uFlowPeriod;",
|
|
1185
1191
|
uniformDefaults: {
|
|
@@ -1192,11 +1198,11 @@ var It = {
|
|
|
1192
1198
|
},
|
|
1193
1199
|
fragment: "if (vParam > 0.5) {\n float speed = (vParam - 128.0) / 32.0;\n float b = fract((uTime * speed - vUv.x / uFlowPeriod) * (speed < 0.0 ? -1.0 : 1.0));\n float s = b > 0.5 ? b - 1.0 : b;\n float streak = smoothstep(-0.045, -0.01, s) * (1.0 - smoothstep(0.02, 0.18, s));\n\n float w = 1.0 / max(fwidth(vUv.y), 1e-6);\n float px = abs(vUv.y - 0.5) * w;\n float corePx = w * 0.25;\n float core = clamp(corePx - px + 0.5, 0.0, 1.0);\n float halo = 1.0 - smoothstep(corePx, w * 0.5, px);\n\n vec4 line = color * core;\n line.rgb = mix(line.rgb, uFlowColor * line.a, streak);\n float glowA = streak * halo * (1.0 - core) * 0.55 * color.a;\n color = line + vec4(uFlowColor * glowA, glowA);\n }",
|
|
1194
1200
|
fragmentGl1: "if (vParam > 0.5) {\n float speed = (vParam - 128.0) / 32.0;\n float b = fract((uTime * speed - vUv.x / uFlowPeriod) * (speed < 0.0 ? -1.0 : 1.0));\n float s = b > 0.5 ? b - 1.0 : b;\n float streak = smoothstep(-0.045, -0.01, s) * (1.0 - smoothstep(0.02, 0.18, s));\n color.rgb = mix(color.rgb, uFlowColor * color.a, streak);\n }"
|
|
1195
|
-
},
|
|
1201
|
+
}, zt = /* @__PURE__ */ function(e) {
|
|
1196
1202
|
return e[e.elementArrayBuffer = 34963] = "elementArrayBuffer", e[e.arrayBuffer = 34962] = "arrayBuffer", e[e.uniformBuffer = 35345] = "uniformBuffer", e;
|
|
1197
|
-
}({}),
|
|
1203
|
+
}({}), Bt = class {
|
|
1198
1204
|
native;
|
|
1199
|
-
target =
|
|
1205
|
+
target = zt.arrayBuffer;
|
|
1200
1206
|
byteLength = 0;
|
|
1201
1207
|
dirty = !0;
|
|
1202
1208
|
constructor(e) {
|
|
@@ -1204,7 +1210,7 @@ var It = {
|
|
|
1204
1210
|
}
|
|
1205
1211
|
}, A = /* @__PURE__ */ function(e) {
|
|
1206
1212
|
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;
|
|
1207
|
-
}({}),
|
|
1213
|
+
}({}), Vt = class extends n {
|
|
1208
1214
|
screen = {
|
|
1209
1215
|
x: 0,
|
|
1210
1216
|
y: 0,
|
|
@@ -1223,12 +1229,12 @@ var It = {
|
|
|
1223
1229
|
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`);
|
|
1224
1230
|
}
|
|
1225
1231
|
};
|
|
1226
|
-
k([_({ fallback: Xe }), O("design:type", Number)],
|
|
1232
|
+
k([_({ fallback: Xe }), O("design:type", Number)], Vt.prototype, "pixelRatio", void 0), k([_({ internal: !0 }), O("design:type", typeof HTMLCanvasElement > "u" ? Object : HTMLCanvasElement)], Vt.prototype, "view", void 0);
|
|
1227
1233
|
//#endregion
|
|
1228
1234
|
//#region src/core/renderers/shared/shader/UniformGroup.ts
|
|
1229
|
-
var
|
|
1235
|
+
var Ht = 0, Ut = class {
|
|
1230
1236
|
isUniformGroup = !0;
|
|
1231
|
-
uid = ++
|
|
1237
|
+
uid = ++Ht;
|
|
1232
1238
|
uniforms;
|
|
1233
1239
|
ubo;
|
|
1234
1240
|
isStatic;
|
|
@@ -1239,10 +1245,10 @@ var Vt = 0, Ht = class {
|
|
|
1239
1245
|
update() {
|
|
1240
1246
|
this._dirtyId++;
|
|
1241
1247
|
}
|
|
1242
|
-
},
|
|
1243
|
-
function
|
|
1244
|
-
let n =
|
|
1245
|
-
return n === void 0 && (
|
|
1248
|
+
}, Wt = Object.create(null), Gt = Object.create(null);
|
|
1249
|
+
function Kt(e, t) {
|
|
1250
|
+
let n = Gt[e];
|
|
1251
|
+
return n === void 0 && (Wt[t] === void 0 && (Wt[t] = 1), Gt[e] = n = Wt[t]++), n;
|
|
1246
1252
|
}
|
|
1247
1253
|
//#endregion
|
|
1248
1254
|
//#region src/core/renderers/gl/system/GlSystem.ts
|
|
@@ -1260,7 +1266,7 @@ var j = class extends e {
|
|
|
1260
1266
|
_setup() {}
|
|
1261
1267
|
flush() {}
|
|
1262
1268
|
reset() {}
|
|
1263
|
-
},
|
|
1269
|
+
}, qt = class extends j {
|
|
1264
1270
|
install(e) {
|
|
1265
1271
|
super.install(e), e.buffer = this;
|
|
1266
1272
|
}
|
|
@@ -1270,8 +1276,8 @@ var j = class extends e {
|
|
|
1270
1276
|
return this.glBuffers.get(e.instanceId) || this._createGlBuffer(e);
|
|
1271
1277
|
}
|
|
1272
1278
|
_createGlBuffer(e) {
|
|
1273
|
-
let t = this._gl, n = new
|
|
1274
|
-
return e.usage & A.index ? r =
|
|
1279
|
+
let t = this._gl, n = new Bt(t.createBuffer()), r = zt.arrayBuffer;
|
|
1280
|
+
return e.usage & A.index ? r = zt.elementArrayBuffer : e.usage & A.uniform && (r = zt.uniformBuffer), n.target = r, this.glBuffers.set(e.instanceId, n), this.buffers.get(e.instanceId) || ("on" in e && (e.on("updateProperty", (e) => {
|
|
1275
1281
|
switch (e) {
|
|
1276
1282
|
case "usage":
|
|
1277
1283
|
case "data":
|
|
@@ -1309,13 +1315,13 @@ var j = class extends e {
|
|
|
1309
1315
|
}
|
|
1310
1316
|
this.buffers.clear(), this.glBuffers.clear();
|
|
1311
1317
|
}
|
|
1312
|
-
},
|
|
1313
|
-
function
|
|
1314
|
-
return
|
|
1318
|
+
}, Jt;
|
|
1319
|
+
function Yt() {
|
|
1320
|
+
return Jt ||= "mediump", Jt;
|
|
1315
1321
|
}
|
|
1316
1322
|
//#endregion
|
|
1317
1323
|
//#region src/core/renderers/gl/shader/preprocessors/addProgramDefines.ts
|
|
1318
|
-
function
|
|
1324
|
+
function Xt(e, t, n) {
|
|
1319
1325
|
return t ? e : n ? (e = e.replace("out vec4 finalColor;", ""), `#ifdef GL_ES
|
|
1320
1326
|
#define in varying
|
|
1321
1327
|
#define finalColor gl_FragColor
|
|
@@ -1329,7 +1335,7 @@ ${e}`;
|
|
|
1329
1335
|
}
|
|
1330
1336
|
//#endregion
|
|
1331
1337
|
//#region src/core/renderers/gl/shader/preprocessors/ensurePrecision.ts
|
|
1332
|
-
function
|
|
1338
|
+
function Zt(e, t, n) {
|
|
1333
1339
|
let r = n ? t.maxSupportedFragmentPrecision : t.maxSupportedVertexPrecision;
|
|
1334
1340
|
if (e.substring(0, 9) !== "precision") {
|
|
1335
1341
|
let i = n ? t.requestedFragmentPrecision : t.requestedVertexPrecision;
|
|
@@ -1339,31 +1345,31 @@ function Xt(e, t, n) {
|
|
|
1339
1345
|
}
|
|
1340
1346
|
//#endregion
|
|
1341
1347
|
//#region src/core/renderers/gl/shader/preprocessors/insertVersion.ts
|
|
1342
|
-
function
|
|
1348
|
+
function Qt(e, t) {
|
|
1343
1349
|
return t ? `#version 300 es\n${e}` : e;
|
|
1344
1350
|
}
|
|
1345
1351
|
//#endregion
|
|
1346
1352
|
//#region src/core/renderers/gl/shader/preprocessors/setProgramName.ts
|
|
1347
|
-
var
|
|
1348
|
-
function
|
|
1353
|
+
var $t = {}, en = {};
|
|
1354
|
+
function tn(e, { name: t = "program" }, n = !0) {
|
|
1349
1355
|
t = t.replace(/\s+/g, "-"), t += n ? "-fragment" : "-vertex";
|
|
1350
|
-
let r = n ?
|
|
1356
|
+
let r = n ? $t : en;
|
|
1351
1357
|
return r[t] ? (r[t]++, t += `-${r[t]}`) : r[t] = 1, e.includes("#define SHADER_NAME") ? e : `${`#define SHADER_NAME ${t}`}\n${e}`;
|
|
1352
1358
|
}
|
|
1353
1359
|
//#endregion
|
|
1354
1360
|
//#region src/core/renderers/gl/shader/preprocessors/stripVersion.ts
|
|
1355
|
-
function
|
|
1361
|
+
function nn(e, t) {
|
|
1356
1362
|
return t ? e.replace("#version 300 es", "") : e;
|
|
1357
1363
|
}
|
|
1358
1364
|
//#endregion
|
|
1359
1365
|
//#region src/core/renderers/gl/shader/GlProgram.ts
|
|
1360
|
-
var
|
|
1361
|
-
stripVersion:
|
|
1362
|
-
ensurePrecision:
|
|
1363
|
-
addProgramDefines:
|
|
1364
|
-
setProgramName:
|
|
1365
|
-
insertVersion:
|
|
1366
|
-
},
|
|
1366
|
+
var rn = Object.create(null), an = {
|
|
1367
|
+
stripVersion: nn,
|
|
1368
|
+
ensurePrecision: Zt,
|
|
1369
|
+
addProgramDefines: Xt,
|
|
1370
|
+
setProgramName: tn,
|
|
1371
|
+
insertVersion: Qt
|
|
1372
|
+
}, on = class e {
|
|
1367
1373
|
static defaultOptions = {
|
|
1368
1374
|
preferredVertexPrecision: "highp",
|
|
1369
1375
|
preferredFragmentPrecision: "mediump"
|
|
@@ -1386,25 +1392,25 @@ var nn = Object.create(null), rn = {
|
|
|
1386
1392
|
requestedFragmentPrecision: t.preferredFragmentPrecision,
|
|
1387
1393
|
requestedVertexPrecision: t.preferredVertexPrecision,
|
|
1388
1394
|
maxSupportedVertexPrecision: "highp",
|
|
1389
|
-
maxSupportedFragmentPrecision:
|
|
1395
|
+
maxSupportedFragmentPrecision: Yt()
|
|
1390
1396
|
},
|
|
1391
1397
|
setProgramName: { name: t.name },
|
|
1392
1398
|
addProgramDefines: i,
|
|
1393
1399
|
insertVersion: i
|
|
1394
1400
|
};
|
|
1395
|
-
Object.keys(
|
|
1401
|
+
Object.keys(an).forEach((e) => {
|
|
1396
1402
|
let t = a[e];
|
|
1397
|
-
n =
|
|
1398
|
-
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id =
|
|
1403
|
+
n = an[e](n, t, !0), r = an[e](r, t, !1);
|
|
1404
|
+
}), this.fragment = n, this.vertex = r, this.transformFeedbackVaryings = t.transformFeedbackVaryings, this.id = Kt(`${r}:${n}`, "GlProgram");
|
|
1399
1405
|
}
|
|
1400
1406
|
destroy() {
|
|
1401
|
-
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete
|
|
1407
|
+
this.fragment = "", this.vertex = "", this.attributes = Object.create(null), this.uniforms = Object.create(null), this.transformFeedbackVaryings = void 0, this._cacheKey && delete rn[this._cacheKey];
|
|
1402
1408
|
}
|
|
1403
1409
|
static from(t) {
|
|
1404
1410
|
let n = `${t.vertex}:${t.fragment}`;
|
|
1405
|
-
return
|
|
1411
|
+
return rn[n] || (rn[n] = new e(t), rn[n]._cacheKey = n), rn[n];
|
|
1406
1412
|
}
|
|
1407
|
-
},
|
|
1413
|
+
}, sn = {
|
|
1408
1414
|
uint8x2: {
|
|
1409
1415
|
size: 2,
|
|
1410
1416
|
stride: 2,
|
|
@@ -1556,19 +1562,19 @@ var nn = Object.create(null), rn = {
|
|
|
1556
1562
|
normalized: !1
|
|
1557
1563
|
}
|
|
1558
1564
|
};
|
|
1559
|
-
function
|
|
1560
|
-
return
|
|
1565
|
+
function cn(e) {
|
|
1566
|
+
return sn[e] ?? sn.float32;
|
|
1561
1567
|
}
|
|
1562
1568
|
//#endregion
|
|
1563
1569
|
//#region src/core/renderers/gl/shader/GlProgramData.ts
|
|
1564
|
-
var
|
|
1570
|
+
var ln = class {
|
|
1565
1571
|
native;
|
|
1566
1572
|
uniformDirtyGroups = Object.create(null);
|
|
1567
1573
|
uniforms = Object.create(null);
|
|
1568
1574
|
constructor(e) {
|
|
1569
1575
|
this.native = e;
|
|
1570
1576
|
}
|
|
1571
|
-
},
|
|
1577
|
+
}, un, dn = {
|
|
1572
1578
|
FLOAT: "float",
|
|
1573
1579
|
FLOAT_VEC2: "vec2",
|
|
1574
1580
|
FLOAT_VEC3: "vec3",
|
|
@@ -1597,7 +1603,7 @@ var cn = class {
|
|
|
1597
1603
|
SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1598
1604
|
INT_SAMPLER_2D_ARRAY: "sampler2DArray",
|
|
1599
1605
|
UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
|
|
1600
|
-
},
|
|
1606
|
+
}, fn = {
|
|
1601
1607
|
float: "float32",
|
|
1602
1608
|
vec2: "float32x2",
|
|
1603
1609
|
vec3: "float32x3",
|
|
@@ -1615,29 +1621,29 @@ var cn = class {
|
|
|
1615
1621
|
bvec3: "uint32x3",
|
|
1616
1622
|
bvec4: "uint32x4"
|
|
1617
1623
|
};
|
|
1618
|
-
function
|
|
1619
|
-
if (!
|
|
1620
|
-
let t = Object.keys(
|
|
1621
|
-
|
|
1624
|
+
function pn(e, t) {
|
|
1625
|
+
if (!un) {
|
|
1626
|
+
let t = Object.keys(dn);
|
|
1627
|
+
un = {};
|
|
1622
1628
|
for (let n = 0; n < t.length; ++n) {
|
|
1623
1629
|
let r = t[n];
|
|
1624
|
-
|
|
1630
|
+
un[e[r]] = dn[r];
|
|
1625
1631
|
}
|
|
1626
1632
|
}
|
|
1627
|
-
return
|
|
1633
|
+
return un[t];
|
|
1628
1634
|
}
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
1635
|
+
function mn(e, t) {
|
|
1636
|
+
return fn[pn(e, t)] || "float32";
|
|
1631
1637
|
}
|
|
1632
1638
|
//#endregion
|
|
1633
1639
|
//#region src/core/renderers/gl/shader/GlShaderSystem.ts
|
|
1634
|
-
var
|
|
1640
|
+
var hn = class extends j {
|
|
1635
1641
|
install(e) {
|
|
1636
1642
|
super.install(e), e.shader = this;
|
|
1637
1643
|
}
|
|
1638
1644
|
glProgramDatas = /* @__PURE__ */ new Map();
|
|
1639
1645
|
currentProgram = null;
|
|
1640
|
-
globalUniforms = new
|
|
1646
|
+
globalUniforms = new Ut({
|
|
1641
1647
|
projectionMatrix: new Float32Array([
|
|
1642
1648
|
1,
|
|
1643
1649
|
0,
|
|
@@ -1678,7 +1684,7 @@ var mn = class extends j {
|
|
|
1678
1684
|
return this.glProgramDatas.get(e.id) || this._createGlProgramData(e);
|
|
1679
1685
|
}
|
|
1680
1686
|
_createGlProgramData(e) {
|
|
1681
|
-
let t = this._gl, n = new
|
|
1687
|
+
let t = this._gl, n = new ln(t.createProgram());
|
|
1682
1688
|
this.glProgramDatas.set(e.id, n), this.useProgram(e);
|
|
1683
1689
|
let r = this._createGlShader(e.vertex, t.VERTEX_SHADER), i = this._createGlShader(e.fragment, t.FRAGMENT_SHADER);
|
|
1684
1690
|
if (t.attachShader(n.native, r), t.attachShader(n.native, i), t.linkProgram(n.native), !t.getProgramParameter(n.native, t.LINK_STATUS)) throw Error(`Failed to link program: ${t.getProgramInfoLog(n.native)}`);
|
|
@@ -1686,11 +1692,11 @@ var mn = class extends j {
|
|
|
1686
1692
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_ATTRIBUTES), r = 0; r < e; r++) {
|
|
1687
1693
|
let e = t.getActiveAttrib(n.native, r);
|
|
1688
1694
|
if (!e || e.name.startsWith("gl_")) continue;
|
|
1689
|
-
let i =
|
|
1695
|
+
let i = mn(t, e.type);
|
|
1690
1696
|
a[e.name] = {
|
|
1691
1697
|
location: 0,
|
|
1692
1698
|
format: i,
|
|
1693
|
-
stride:
|
|
1699
|
+
stride: cn(i).stride,
|
|
1694
1700
|
offset: 0,
|
|
1695
1701
|
instance: !1,
|
|
1696
1702
|
start: 0
|
|
@@ -1707,7 +1713,7 @@ var mn = class extends j {
|
|
|
1707
1713
|
for (let e = t.getProgramParameter(n.native, t.ACTIVE_UNIFORMS), r = 0; r < e; r++) {
|
|
1708
1714
|
let e = t.getActiveUniform(n.native, r);
|
|
1709
1715
|
if (!e) continue;
|
|
1710
|
-
let i = e.name.replace(/\[.*?\]$/, ""), a =
|
|
1716
|
+
let i = e.name.replace(/\[.*?\]$/, ""), a = pn(t, e.type), o = e.size;
|
|
1711
1717
|
c[i] = {
|
|
1712
1718
|
name: i,
|
|
1713
1719
|
index: r,
|
|
@@ -1742,7 +1748,7 @@ var mn = class extends j {
|
|
|
1742
1748
|
let { type: s, isArray: c, name: l } = o;
|
|
1743
1749
|
o.location === void 0 && (o.location = n.getUniformLocation(e.native, l));
|
|
1744
1750
|
let u = o.location;
|
|
1745
|
-
if (
|
|
1751
|
+
if (gn(o.value, a)) switch (o.value = _n(o.value, a), s) {
|
|
1746
1752
|
case "float":
|
|
1747
1753
|
c ? n.uniform1fv(u, a) : n.uniform1f(u, a);
|
|
1748
1754
|
break;
|
|
@@ -1829,7 +1835,7 @@ var mn = class extends j {
|
|
|
1829
1835
|
super.destroy(), this.bind(null);
|
|
1830
1836
|
}
|
|
1831
1837
|
};
|
|
1832
|
-
function
|
|
1838
|
+
function gn(e, t) {
|
|
1833
1839
|
if (typeof t == "object" && t) {
|
|
1834
1840
|
let n = t.length;
|
|
1835
1841
|
if (typeof e != "object" || !e || e.length !== n) return !0;
|
|
@@ -1838,7 +1844,7 @@ function hn(e, t) {
|
|
|
1838
1844
|
}
|
|
1839
1845
|
return e !== t;
|
|
1840
1846
|
}
|
|
1841
|
-
function
|
|
1847
|
+
function _n(e, t) {
|
|
1842
1848
|
if (typeof t == "object" && t) {
|
|
1843
1849
|
let n = t.length;
|
|
1844
1850
|
if (typeof e == "object" && e && e.length === n) {
|
|
@@ -1851,10 +1857,10 @@ function gn(e, t) {
|
|
|
1851
1857
|
}
|
|
1852
1858
|
//#endregion
|
|
1853
1859
|
//#region src/core/renderers/gl/state/GlBlendMode.ts
|
|
1854
|
-
var
|
|
1860
|
+
var vn = /* @__PURE__ */ function(e) {
|
|
1855
1861
|
return e.normal = "normal", e.add = "add", e.multiply = "multiply", e.screen = "screen", e.none = "none", e.normalNpm = "normalNpm", e.addNpm = "add_npm", e.screenNpm = "screenNpm", e.srcIn = "srcIn", e.srcOut = "srcOut", e.srcAtop = "srcAtop", e.dstOver = "dstOver", e.dstIn = "dstIn", e.dstOut = "dstOut", e.dstAtop = "dstAtop", e.xor = "xor", e.subtract = "subtract", e;
|
|
1856
1862
|
}({});
|
|
1857
|
-
function
|
|
1863
|
+
function yn(e) {
|
|
1858
1864
|
return {
|
|
1859
1865
|
normal: [e.ONE, e.ONE_MINUS_SRC_ALPHA],
|
|
1860
1866
|
add: [e.ONE, e.ONE],
|
|
@@ -1909,7 +1915,7 @@ function vn(e) {
|
|
|
1909
1915
|
}
|
|
1910
1916
|
//#endregion
|
|
1911
1917
|
//#region src/core/renderers/gl/state/GlStateSystem.ts
|
|
1912
|
-
var
|
|
1918
|
+
var bn = class e {
|
|
1913
1919
|
static _properties = [
|
|
1914
1920
|
"blend",
|
|
1915
1921
|
"offsets",
|
|
@@ -1936,14 +1942,14 @@ var yn = class e {
|
|
|
1936
1942
|
let t = new e();
|
|
1937
1943
|
return t.depthTest = !1, t.blend = !0, t;
|
|
1938
1944
|
}
|
|
1939
|
-
_blendMode =
|
|
1945
|
+
_blendMode = vn.normal;
|
|
1940
1946
|
_polygonOffset = 0;
|
|
1941
1947
|
bitmap = 0;
|
|
1942
1948
|
get blendMode() {
|
|
1943
1949
|
return this._blendMode;
|
|
1944
1950
|
}
|
|
1945
1951
|
set blendMode(e) {
|
|
1946
|
-
this.blend = e !==
|
|
1952
|
+
this.blend = e !== vn.none, this._blendMode = e;
|
|
1947
1953
|
}
|
|
1948
1954
|
get polygonOffset() {
|
|
1949
1955
|
return this._polygonOffset;
|
|
@@ -1955,19 +1961,19 @@ var yn = class e {
|
|
|
1955
1961
|
if (e) for (let t in e) this[t] = e[t];
|
|
1956
1962
|
}
|
|
1957
1963
|
};
|
|
1958
|
-
|
|
1959
|
-
var
|
|
1964
|
+
bn._init();
|
|
1965
|
+
var xn = class extends j {
|
|
1960
1966
|
install(e) {
|
|
1961
1967
|
super.install(e), e.state = this;
|
|
1962
1968
|
}
|
|
1963
1969
|
_blendEq = !1;
|
|
1964
|
-
_setters =
|
|
1970
|
+
_setters = bn._properties.map((e) => this[`set${e.replace(/^\S/, (e) => e.toUpperCase())}`]);
|
|
1965
1971
|
boundStateBitmap = 0;
|
|
1966
1972
|
boundBlendMode;
|
|
1967
1973
|
blendModes;
|
|
1968
|
-
defaultState = new
|
|
1974
|
+
defaultState = new bn({ blend: !0 });
|
|
1969
1975
|
_updateContext(e) {
|
|
1970
|
-
super._updateContext(e), this.blendModes =
|
|
1976
|
+
super._updateContext(e), this.blendModes = yn(e);
|
|
1971
1977
|
}
|
|
1972
1978
|
toggle(e, t) {
|
|
1973
1979
|
this._renderer.gl[t ? "enable" : "disable"](e);
|
|
@@ -2010,20 +2016,20 @@ var bn = class extends j {
|
|
|
2010
2016
|
}
|
|
2011
2017
|
reset() {
|
|
2012
2018
|
super.reset();
|
|
2013
|
-
let e = (1 <<
|
|
2019
|
+
let e = (1 << bn._properties.length) - 1;
|
|
2014
2020
|
this.boundStateBitmap = ~this.defaultState.bitmap & e, this.boundBlendMode = void 0, this._blendEq = !0, this.bind(this.defaultState);
|
|
2015
2021
|
}
|
|
2016
|
-
},
|
|
2022
|
+
}, Sn = 5, Cn = 64, wn = class extends j {
|
|
2017
2023
|
install(e) {
|
|
2018
2024
|
super.install(e), e.batch2D = this;
|
|
2019
2025
|
}
|
|
2020
|
-
_state =
|
|
2026
|
+
_state = bn.for2D();
|
|
2021
2027
|
_batchSize = 4096 * 4;
|
|
2022
2028
|
_batchables = [];
|
|
2023
2029
|
_vertexCount = 0;
|
|
2024
2030
|
_indexCount = 0;
|
|
2025
2031
|
_programs = /* @__PURE__ */ new Map();
|
|
2026
|
-
_effects = [
|
|
2032
|
+
_effects = [Lt, Rt];
|
|
2027
2033
|
_effectsRevision = 0;
|
|
2028
2034
|
effectUniforms = {};
|
|
2029
2035
|
registerEffect(e) {
|
|
@@ -2052,7 +2058,7 @@ var bn = class extends j {
|
|
|
2052
2058
|
return {
|
|
2053
2059
|
shader: {
|
|
2054
2060
|
instanceId: mt(),
|
|
2055
|
-
glProgram: new
|
|
2061
|
+
glProgram: new on({
|
|
2056
2062
|
vertex: `${n}precision highp float;
|
|
2057
2063
|
in vec2 aPosition;
|
|
2058
2064
|
in vec2 aUv;
|
|
@@ -2135,7 +2141,7 @@ void main(void) {
|
|
|
2135
2141
|
};
|
|
2136
2142
|
}
|
|
2137
2143
|
_getSlot() {
|
|
2138
|
-
let e = Math.min(this._slotIndex++,
|
|
2144
|
+
let e = Math.min(this._slotIndex++, Cn - 1), t = this._slots[e];
|
|
2139
2145
|
if (!t) {
|
|
2140
2146
|
let n = {
|
|
2141
2147
|
instanceId: mt(),
|
|
@@ -2196,8 +2202,8 @@ void main(void) {
|
|
|
2196
2202
|
if (super.flush(), this._vertexCount === 0) return;
|
|
2197
2203
|
let e = this._vertexCount, t = this._indexCount, n = this._batchables;
|
|
2198
2204
|
this._batchables = [], this._vertexCount = 0, this._indexCount = 0;
|
|
2199
|
-
let r = this._renderer.texture.maxTextureImageUnits, i = this._getProgram(r), a = this._slotIndex >=
|
|
2200
|
-
if (l) for (let e = 0, t = 0, r = n.length; t < r; t++, e +=
|
|
2205
|
+
let r = this._renderer.texture.maxTextureImageUnits, i = this._getProgram(r), a = this._slotIndex >= Cn, o = this._getSlot(), s = this._effects.some((e) => e.name === "flowStreak" && e.uvNormalized), c = o.refs, l = !a && o.drawCalls.length > 0 && o.effectsRevision === this._effectsRevision && c.length === n.length * Sn;
|
|
2206
|
+
if (l) for (let e = 0, t = 0, r = n.length; t < r; t++, e += Sn) {
|
|
2201
2207
|
let r = n[t];
|
|
2202
2208
|
if (c[e] !== (r.__source ?? r) || c[e + 1] !== r.texture || c[e + 2] !== r.uvs || c[e + 3] !== r.size || c[e + 4] !== r.roundPixels) {
|
|
2203
2209
|
l = !1;
|
|
@@ -2213,7 +2219,7 @@ void main(void) {
|
|
|
2213
2219
|
c.push(e.__source ?? e, e.texture, e.uvs, e.size, e.roundPixels);
|
|
2214
2220
|
}
|
|
2215
2221
|
let u = e * this._vertexSize * 4;
|
|
2216
|
-
(!o.attrData || o.attrData.byteLength < u) && (o.attrData = new ArrayBuffer(
|
|
2222
|
+
(!o.attrData || o.attrData.byteLength < u) && (o.attrData = new ArrayBuffer(Tn(u)), o.f32 = new Float32Array(o.attrData), o.u8 = new Uint8Array(o.attrData)), (!o.indexData || o.indexData.length < t) && (o.indexData = new Uint32Array(Tn(t)));
|
|
2217
2223
|
let d = o.f32, f = o.u8, p = o.indexData, m = 0, h = 0, g = [], ee = 0;
|
|
2218
2224
|
for (let e = n.length, t = { id: ++ee }, i = [], a = /* @__PURE__ */ new Map(), o = 0, c = 0, l = 0; l < e; l++) {
|
|
2219
2225
|
let u = n[l].texture, te = l === e - 1;
|
|
@@ -2226,7 +2232,7 @@ void main(void) {
|
|
|
2226
2232
|
let { indices: r, vertices: o, uvs: l = /* @__PURE__ */ new Float32Array(), size: u = {
|
|
2227
2233
|
width: 0,
|
|
2228
2234
|
height: 0
|
|
2229
|
-
}, texture: te, blendMode: ne =
|
|
2235
|
+
}, texture: te, blendMode: ne = vn.normal, clipOutsideUv: re, roundPixels: ie, modulate: ae = [
|
|
2230
2236
|
255,
|
|
2231
2237
|
255,
|
|
2232
2238
|
255,
|
|
@@ -2257,10 +2263,10 @@ void main(void) {
|
|
|
2257
2263
|
super.reset(), this._slots = [], this._slotIndex = 0, this._batchables = [], this._vertexCount = 0, this._indexCount = 0;
|
|
2258
2264
|
}
|
|
2259
2265
|
};
|
|
2260
|
-
function
|
|
2266
|
+
function Tn(e) {
|
|
2261
2267
|
return e += +(e === 0), --e, e |= e >>> 1, e |= e >>> 2, e |= e >>> 4, e |= e >>> 8, e |= e >>> 16, e + 1;
|
|
2262
2268
|
}
|
|
2263
|
-
function
|
|
2269
|
+
function En(e) {
|
|
2264
2270
|
let t = (e > 65535) << 4;
|
|
2265
2271
|
e >>>= t;
|
|
2266
2272
|
let n = (e > 255) << 3;
|
|
@@ -2270,9 +2276,9 @@ function Tn(e) {
|
|
|
2270
2276
|
//#region src/core/renderers/gl/const.ts
|
|
2271
2277
|
var M = /* @__PURE__ */ function(e) {
|
|
2272
2278
|
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;
|
|
2273
|
-
}({}),
|
|
2279
|
+
}({}), Dn = /* @__PURE__ */ function(e) {
|
|
2274
2280
|
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;
|
|
2275
|
-
}({}),
|
|
2281
|
+
}({}), On = class extends j {
|
|
2276
2282
|
install(e) {
|
|
2277
2283
|
super.install(e), e.mask = this;
|
|
2278
2284
|
}
|
|
@@ -2297,10 +2303,10 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
2297
2303
|
let t = this.stack.pop();
|
|
2298
2304
|
if (!t || t.source !== e) return;
|
|
2299
2305
|
let { mask: n } = t, r = this._renderer.renderTarget.current?.instanceId ?? -1, i = this._maskStackHash[r] ?? 0;
|
|
2300
|
-
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(
|
|
2306
|
+
"x" in n ? this._renderer.scissor.pop() : "render" in n && (this._renderer.flush(), i === 0 ? (this._renderer.clear(Dn.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;
|
|
2301
2307
|
}
|
|
2302
|
-
},
|
|
2303
|
-
|
|
2308
|
+
}, kn = [];
|
|
2309
|
+
kn[M.none] = {}, kn[M.disabled] = {}, kn[M.renderingMaskAdd] = {
|
|
2304
2310
|
stencilFront: {
|
|
2305
2311
|
compare: "equal",
|
|
2306
2312
|
passOp: "increment-clamp"
|
|
@@ -2309,7 +2315,7 @@ On[M.none] = {}, On[M.disabled] = {}, On[M.renderingMaskAdd] = {
|
|
|
2309
2315
|
compare: "equal",
|
|
2310
2316
|
passOp: "increment-clamp"
|
|
2311
2317
|
}
|
|
2312
|
-
},
|
|
2318
|
+
}, kn[M.renderingMaskRemove] = {
|
|
2313
2319
|
stencilFront: {
|
|
2314
2320
|
compare: "equal",
|
|
2315
2321
|
passOp: "decrement-clamp"
|
|
@@ -2318,7 +2324,7 @@ On[M.none] = {}, On[M.disabled] = {}, On[M.renderingMaskAdd] = {
|
|
|
2318
2324
|
compare: "equal",
|
|
2319
2325
|
passOp: "decrement-clamp"
|
|
2320
2326
|
}
|
|
2321
|
-
},
|
|
2327
|
+
}, kn[M.maskActive] = {
|
|
2322
2328
|
stencilFront: {
|
|
2323
2329
|
compare: "equal",
|
|
2324
2330
|
passOp: "keep"
|
|
@@ -2327,7 +2333,7 @@ On[M.none] = {}, On[M.disabled] = {}, On[M.renderingMaskAdd] = {
|
|
|
2327
2333
|
compare: "equal",
|
|
2328
2334
|
passOp: "keep"
|
|
2329
2335
|
}
|
|
2330
|
-
},
|
|
2336
|
+
}, kn[M.inverseMaskActive] = {
|
|
2331
2337
|
stencilFront: {
|
|
2332
2338
|
compare: "not-equal",
|
|
2333
2339
|
passOp: "keep"
|
|
@@ -2337,7 +2343,7 @@ On[M.none] = {}, On[M.disabled] = {}, On[M.renderingMaskAdd] = {
|
|
|
2337
2343
|
passOp: "keep"
|
|
2338
2344
|
}
|
|
2339
2345
|
};
|
|
2340
|
-
var
|
|
2346
|
+
var An = class extends j {
|
|
2341
2347
|
install(e) {
|
|
2342
2348
|
super.install(e), e.stencil = this;
|
|
2343
2349
|
}
|
|
@@ -2389,7 +2395,7 @@ var kn = class extends j {
|
|
|
2389
2395
|
}
|
|
2390
2396
|
};
|
|
2391
2397
|
bind(e, t) {
|
|
2392
|
-
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i =
|
|
2398
|
+
let n = this.current[this._renderer.renderTarget.current?.instanceId ?? -1], r = this._gl, i = kn[e], a = this._cache;
|
|
2393
2399
|
if (n.stencilMode = e, n.refCount = t, e === M.disabled) {
|
|
2394
2400
|
this._cache.enabled && (this._cache.enabled = !1, r.disable(r.STENCIL_TEST));
|
|
2395
2401
|
return;
|
|
@@ -2399,8 +2405,8 @@ var kn = class extends j {
|
|
|
2399
2405
|
destroy() {
|
|
2400
2406
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
2401
2407
|
}
|
|
2402
|
-
},
|
|
2403
|
-
current = new
|
|
2408
|
+
}, jn = class extends j {
|
|
2409
|
+
current = new Tt(0, 0, 0, 0);
|
|
2404
2410
|
install(e) {
|
|
2405
2411
|
super.install(e), e.viewport = this;
|
|
2406
2412
|
}
|
|
@@ -2408,7 +2414,7 @@ var kn = class extends j {
|
|
|
2408
2414
|
let t = this.current, n = Math.floor(e.x), r = Math.floor(e.y), i = Math.floor(e.width), a = Math.floor(e.height);
|
|
2409
2415
|
t.x === n && t.y === r && t.width === i && t.height === a || (this._gl.viewport(n, r, i, a), t.x = n, t.y = r, t.width = i, t.height = a);
|
|
2410
2416
|
}
|
|
2411
|
-
},
|
|
2417
|
+
}, Mn = class {
|
|
2412
2418
|
framebuffer;
|
|
2413
2419
|
width = -1;
|
|
2414
2420
|
height = -1;
|
|
@@ -2419,7 +2425,7 @@ var kn = class extends j {
|
|
|
2419
2425
|
constructor(e) {
|
|
2420
2426
|
this.framebuffer = e;
|
|
2421
2427
|
}
|
|
2422
|
-
},
|
|
2428
|
+
}, Nn = class extends j {
|
|
2423
2429
|
install(e) {
|
|
2424
2430
|
super.install(e), e.renderTarget = this;
|
|
2425
2431
|
}
|
|
@@ -2429,7 +2435,7 @@ var kn = class extends j {
|
|
|
2429
2435
|
_msaaSamples = [];
|
|
2430
2436
|
_hasMRT = !0;
|
|
2431
2437
|
_writeDepthTexture = !0;
|
|
2432
|
-
projection = new
|
|
2438
|
+
projection = new At();
|
|
2433
2439
|
get _sampleCount() {
|
|
2434
2440
|
return Math.min(4, this._msaaSamples[0] || 4);
|
|
2435
2441
|
}
|
|
@@ -2468,7 +2474,7 @@ var kn = class extends j {
|
|
|
2468
2474
|
return this.glRenderTargets.get(e.instanceId) || this._createGlRenderTarget(e);
|
|
2469
2475
|
}
|
|
2470
2476
|
_createGlRenderTarget(e) {
|
|
2471
|
-
let t = this._gl, n = new
|
|
2477
|
+
let t = this._gl, n = new Mn(t.createFramebuffer());
|
|
2472
2478
|
return this.glRenderTargets.set(e.instanceId, n), this.renderTargets.get(e.instanceId) || (this.renderTargets.set(e.instanceId, e), this._update(e, n), "on" in e && (e.on("updateProperty", (t) => {
|
|
2473
2479
|
switch (t) {
|
|
2474
2480
|
case "width":
|
|
@@ -2545,28 +2551,28 @@ var kn = class extends j {
|
|
|
2545
2551
|
reset() {
|
|
2546
2552
|
super.reset(), this._renderer.contextLost || this.glRenderTargets.forEach((e) => this.destroyGpuRenderTarget(e)), this.renderTargets.clear(), this.glRenderTargets.clear(), this.current = null, this._msaaSamples.length = 0;
|
|
2547
2553
|
}
|
|
2548
|
-
},
|
|
2554
|
+
}, Pn = /* @__PURE__ */ function(e) {
|
|
2549
2555
|
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;
|
|
2550
|
-
}({}),
|
|
2556
|
+
}({}), Fn = /* @__PURE__ */ function(e) {
|
|
2551
2557
|
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;
|
|
2552
2558
|
}({}), N = /* @__PURE__ */ function(e) {
|
|
2553
2559
|
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;
|
|
2554
|
-
}({}),
|
|
2560
|
+
}({}), In = class {
|
|
2555
2561
|
native;
|
|
2556
|
-
target =
|
|
2562
|
+
target = Fn.TEXTURE_2D;
|
|
2557
2563
|
width = -1;
|
|
2558
2564
|
height = -1;
|
|
2559
2565
|
mipmap = !1;
|
|
2560
2566
|
type = N.UNSIGNED_BYTE;
|
|
2561
|
-
internalFormat =
|
|
2562
|
-
format =
|
|
2567
|
+
internalFormat = Pn.RGBA;
|
|
2568
|
+
format = Pn.RGBA;
|
|
2563
2569
|
constructor(e) {
|
|
2564
2570
|
this.native = e;
|
|
2565
2571
|
}
|
|
2566
2572
|
};
|
|
2567
2573
|
//#endregion
|
|
2568
2574
|
//#region src/core/renderers/gl/texture/mapFormatToGlFormat.ts
|
|
2569
|
-
function
|
|
2575
|
+
function Ln(e) {
|
|
2570
2576
|
return {
|
|
2571
2577
|
r8unorm: e.RED,
|
|
2572
2578
|
r8snorm: e.RED,
|
|
@@ -2614,7 +2620,7 @@ function In(e) {
|
|
|
2614
2620
|
}
|
|
2615
2621
|
//#endregion
|
|
2616
2622
|
//#region src/core/renderers/gl/texture/mapFormatToGlInternalFormat.ts
|
|
2617
|
-
function
|
|
2623
|
+
function Rn(e, t) {
|
|
2618
2624
|
let n = {}, r = e.RGBA;
|
|
2619
2625
|
return e instanceof WebGLRenderingContext ? t.srgb && (n = {
|
|
2620
2626
|
"rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
|
|
@@ -2730,7 +2736,7 @@ function Ln(e, t) {
|
|
|
2730
2736
|
}
|
|
2731
2737
|
//#endregion
|
|
2732
2738
|
//#region src/core/renderers/gl/texture/mapFormatToGlType.ts
|
|
2733
|
-
function
|
|
2739
|
+
function zn(e) {
|
|
2734
2740
|
return {
|
|
2735
2741
|
r8unorm: e.UNSIGNED_BYTE,
|
|
2736
2742
|
r8snorm: e.BYTE,
|
|
@@ -2778,7 +2784,7 @@ function Rn(e) {
|
|
|
2778
2784
|
}
|
|
2779
2785
|
//#endregion
|
|
2780
2786
|
//#region src/core/renderers/gl/texture/updateTextureStyle.ts
|
|
2781
|
-
var
|
|
2787
|
+
var Bn = {
|
|
2782
2788
|
linear: {
|
|
2783
2789
|
linear: 9987,
|
|
2784
2790
|
nearest: 9985
|
|
@@ -2787,10 +2793,10 @@ var zn = {
|
|
|
2787
2793
|
linear: 9986,
|
|
2788
2794
|
nearest: 9984
|
|
2789
2795
|
}
|
|
2790
|
-
},
|
|
2796
|
+
}, Vn = {
|
|
2791
2797
|
linear: 9729,
|
|
2792
2798
|
nearest: 9728
|
|
2793
|
-
},
|
|
2799
|
+
}, Hn = {
|
|
2794
2800
|
never: 512,
|
|
2795
2801
|
less: 513,
|
|
2796
2802
|
equal: 514,
|
|
@@ -2799,32 +2805,32 @@ var zn = {
|
|
|
2799
2805
|
"not-equal": 517,
|
|
2800
2806
|
"greater-equal": 518,
|
|
2801
2807
|
always: 519
|
|
2802
|
-
},
|
|
2808
|
+
}, Un = {
|
|
2803
2809
|
"clamp-to-edge": 33071,
|
|
2804
2810
|
repeat: 10497,
|
|
2805
2811
|
"mirror-repeat": 33648
|
|
2806
2812
|
};
|
|
2807
|
-
function
|
|
2813
|
+
function Wn(e, t, n, r, i, a, o, s) {
|
|
2808
2814
|
let { addressModeU: c = "repeat", addressModeV: l = "repeat", addressModeW: u = "repeat", magFilter: d = "linear", minFilter: f = "linear", mipmapFilter: p = "linear", maxAnisotropy: m = 0, compare: h } = e, g = a;
|
|
2809
2815
|
if (!s || c !== "repeat" || l !== "repeat" || u !== "repeat") {
|
|
2810
|
-
let e =
|
|
2816
|
+
let e = Un[o ? "clamp-to-edge" : c], n = Un[o ? "clamp-to-edge" : l], r = Un[o ? "clamp-to-edge" : u];
|
|
2811
2817
|
t[i](g, t.TEXTURE_WRAP_S, e), t[i](g, t.TEXTURE_WRAP_T, n), t.TEXTURE_WRAP_R && t[i](g, t.TEXTURE_WRAP_R, r);
|
|
2812
2818
|
}
|
|
2813
|
-
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER,
|
|
2819
|
+
if ((!s || d !== "linear") && t[i](g, t.TEXTURE_MAG_FILTER, Vn[d]), n) {
|
|
2814
2820
|
if (!s || p !== "linear") {
|
|
2815
|
-
let e =
|
|
2821
|
+
let e = Bn[f][p];
|
|
2816
2822
|
t[i](g, t.TEXTURE_MIN_FILTER, e);
|
|
2817
2823
|
}
|
|
2818
|
-
} else t[i](g, t.TEXTURE_MIN_FILTER,
|
|
2824
|
+
} else t[i](g, t.TEXTURE_MIN_FILTER, Vn[f]);
|
|
2819
2825
|
if (r && m > 1) {
|
|
2820
2826
|
let e = Math.min(m, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
|
|
2821
2827
|
t[i](g, r.TEXTURE_MAX_ANISOTROPY_EXT, e);
|
|
2822
2828
|
}
|
|
2823
|
-
h && t[i](g, t.TEXTURE_COMPARE_FUNC,
|
|
2829
|
+
h && t[i](g, t.TEXTURE_COMPARE_FUNC, Hn[h]);
|
|
2824
2830
|
}
|
|
2825
2831
|
//#endregion
|
|
2826
2832
|
//#region src/core/renderers/gl/texture/uploaders/index.ts
|
|
2827
|
-
var
|
|
2833
|
+
var Gn = {
|
|
2828
2834
|
buffer: {
|
|
2829
2835
|
id: "buffer",
|
|
2830
2836
|
upload: (e, t, n) => {
|
|
@@ -2838,8 +2844,8 @@ var Wn = {
|
|
|
2838
2844
|
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;
|
|
2839
2845
|
}
|
|
2840
2846
|
}
|
|
2841
|
-
},
|
|
2842
|
-
uploaders = { ...
|
|
2847
|
+
}, Kn = class extends j {
|
|
2848
|
+
uploaders = { ...Gn };
|
|
2843
2849
|
textures = /* @__PURE__ */ new Map();
|
|
2844
2850
|
glTextures = /* @__PURE__ */ new Map();
|
|
2845
2851
|
_mapFormatToInternalFormat = Object.create(null);
|
|
@@ -2854,14 +2860,14 @@ var Wn = {
|
|
|
2854
2860
|
super.install(e), e.texture = this;
|
|
2855
2861
|
}
|
|
2856
2862
|
_updateContext(e) {
|
|
2857
|
-
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat =
|
|
2863
|
+
super._updateContext(e), Object.keys(this._mapFormatToInternalFormat).length || (this._mapFormatToInternalFormat = Rn(e, this._renderer.extensions), this._mapFormatToType = zn(e), this._mapFormatToFormat = Ln(e)), this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
|
|
2858
2864
|
for (let e = 0; e < this.maxTextureImageUnits; e++) this.unbind(e);
|
|
2859
2865
|
}
|
|
2860
2866
|
getGlTexture(e) {
|
|
2861
2867
|
return this.glTextures.get(e.instanceId) || this._createGlTexture(e);
|
|
2862
2868
|
}
|
|
2863
2869
|
_createGlTexture(e) {
|
|
2864
|
-
let t = this._gl, n = new
|
|
2870
|
+
let t = this._gl, n = new In(t.createTexture());
|
|
2865
2871
|
if (t.bindTexture(n.target, n.native), n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], this.glTextures.set(e.instanceId, n), e.mipmap && (this._renderer.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
|
|
2866
2872
|
let t = Math.max(e.pixelWidth ?? e.width, e.pixelHeight ?? e.height);
|
|
2867
2873
|
e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
|
|
@@ -2921,7 +2927,7 @@ var Wn = {
|
|
|
2921
2927
|
}
|
|
2922
2928
|
updateStyle(e, t = !1) {
|
|
2923
2929
|
let n = this._gl;
|
|
2924
|
-
|
|
2930
|
+
Wn(e, n, e.mipLevelCount > 1, this._renderer.extensions.anisotropicFiltering, "texParameteri", n.TEXTURE_2D, !this._renderer.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
|
|
2925
2931
|
}
|
|
2926
2932
|
updateGpuTexture(e) {
|
|
2927
2933
|
this.bind(e);
|
|
@@ -2936,7 +2942,7 @@ var Wn = {
|
|
|
2936
2942
|
let e = this._gl;
|
|
2937
2943
|
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);
|
|
2938
2944
|
}
|
|
2939
|
-
},
|
|
2945
|
+
}, qn = {
|
|
2940
2946
|
uint8x2: N.UNSIGNED_BYTE,
|
|
2941
2947
|
uint8x4: N.UNSIGNED_BYTE,
|
|
2942
2948
|
sint8x2: N.BYTE,
|
|
@@ -2968,18 +2974,18 @@ var Wn = {
|
|
|
2968
2974
|
sint32x3: N.INT,
|
|
2969
2975
|
sint32x4: N.INT
|
|
2970
2976
|
};
|
|
2971
|
-
function
|
|
2972
|
-
return
|
|
2977
|
+
function Jn(e) {
|
|
2978
|
+
return qn[e] ?? qn.float32;
|
|
2973
2979
|
}
|
|
2974
2980
|
//#endregion
|
|
2975
2981
|
//#region src/core/renderers/gl/geometry/GlGeometrySystem.ts
|
|
2976
|
-
var
|
|
2982
|
+
var Yn = {
|
|
2977
2983
|
"point-list": 0,
|
|
2978
2984
|
"line-list": 1,
|
|
2979
2985
|
"line-strip": 3,
|
|
2980
2986
|
"triangle-list": 4,
|
|
2981
2987
|
"triangle-strip": 5
|
|
2982
|
-
},
|
|
2988
|
+
}, Xn = class extends j {
|
|
2983
2989
|
_geometryVaoHash = {};
|
|
2984
2990
|
hasInstance = !1;
|
|
2985
2991
|
current = null;
|
|
@@ -3018,11 +3024,11 @@ var Jn = {
|
|
|
3018
3024
|
}
|
|
3019
3025
|
for (let e in r) {
|
|
3020
3026
|
let t = r[e];
|
|
3021
|
-
i[t.buffer.instanceId] +=
|
|
3027
|
+
i[t.buffer.instanceId] += cn(t.format).stride;
|
|
3022
3028
|
}
|
|
3023
3029
|
for (let e in r) {
|
|
3024
3030
|
let t = r[e];
|
|
3025
|
-
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] +=
|
|
3031
|
+
t.stride ??= i[t.buffer.instanceId], t.start ??= a[t.buffer.instanceId], a[t.buffer.instanceId] += cn(t.format).stride;
|
|
3026
3032
|
}
|
|
3027
3033
|
}
|
|
3028
3034
|
_createVao(e, t) {
|
|
@@ -3057,7 +3063,7 @@ var Jn = {
|
|
|
3057
3063
|
a !== c && (r.bind(s), a = c);
|
|
3058
3064
|
let e = l.location;
|
|
3059
3065
|
n.enableVertexAttribArray(e);
|
|
3060
|
-
let t =
|
|
3066
|
+
let t = cn(o.format), i = Jn(o.format);
|
|
3061
3067
|
if (l.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride ?? 0, o.start ?? 0) : n.vertexAttribPointer(e, t.size, i, t.normalized, o.stride ?? 0, o.start ?? 0), o.instance) if (this.hasInstance) {
|
|
3062
3068
|
let t = o.divisor ?? 1;
|
|
3063
3069
|
n.vertexAttribDivisor(e, t);
|
|
@@ -3090,7 +3096,7 @@ var Jn = {
|
|
|
3090
3096
|
let { topology: t, size: n, start: r = 0, instanceCount: i } = e, { gl: a } = this._renderer, o = this.current;
|
|
3091
3097
|
if (!o) return this;
|
|
3092
3098
|
t = t || o.topology || "triangle-list";
|
|
3093
|
-
let s =
|
|
3099
|
+
let s = Yn[t];
|
|
3094
3100
|
if (i = i || o.instanceCount || 1, o.indexBuffer) {
|
|
3095
3101
|
n ||= o.indexBuffer.data.length;
|
|
3096
3102
|
let e = o.indexBuffer.data.BYTES_PER_ELEMENT, t = e === 2 ? a.UNSIGNED_SHORT : a.UNSIGNED_INT;
|
|
@@ -3111,7 +3117,7 @@ var Jn = {
|
|
|
3111
3117
|
}
|
|
3112
3118
|
this._geometryVaoHash = {}, this.current = null, this.currentVao = null;
|
|
3113
3119
|
}
|
|
3114
|
-
},
|
|
3120
|
+
}, Zn = class extends j {
|
|
3115
3121
|
install(e) {
|
|
3116
3122
|
super.install(e), e.colorMask = this;
|
|
3117
3123
|
}
|
|
@@ -3122,19 +3128,19 @@ var Jn = {
|
|
|
3122
3128
|
};
|
|
3123
3129
|
//#endregion
|
|
3124
3130
|
//#region src/core/renderers/gl/GlScissorSystem.ts
|
|
3125
|
-
function
|
|
3131
|
+
function Qn(e, t, n) {
|
|
3126
3132
|
let [r, i, a, o, s, c, l, u, d] = e, f = r * t + o * n + l, p = i * t + s * n + u, m = a * t + c * n + d;
|
|
3127
3133
|
return {
|
|
3128
3134
|
x: f / m,
|
|
3129
3135
|
y: p / m
|
|
3130
3136
|
};
|
|
3131
3137
|
}
|
|
3132
|
-
function
|
|
3138
|
+
function $n(e, t) {
|
|
3133
3139
|
let { x: n, y: r, width: i, height: a } = t, o = [
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3140
|
+
Qn(e, n, r),
|
|
3141
|
+
Qn(e, n + i, r),
|
|
3142
|
+
Qn(e, n + i, r + a),
|
|
3143
|
+
Qn(e, n, r + a)
|
|
3138
3144
|
], s = o.map((e) => e.x), c = o.map((e) => e.y), l = Math.min(...s), u = Math.max(...s), d = Math.min(...c), f = Math.max(...c);
|
|
3139
3145
|
return {
|
|
3140
3146
|
x: l,
|
|
@@ -3143,7 +3149,7 @@ function Qn(e, t) {
|
|
|
3143
3149
|
height: f - d
|
|
3144
3150
|
};
|
|
3145
3151
|
}
|
|
3146
|
-
function
|
|
3152
|
+
function er(e, t) {
|
|
3147
3153
|
let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
|
|
3148
3154
|
return {
|
|
3149
3155
|
x: n,
|
|
@@ -3152,7 +3158,7 @@ function $n(e, t) {
|
|
|
3152
3158
|
height: Math.max(0, a - r)
|
|
3153
3159
|
};
|
|
3154
3160
|
}
|
|
3155
|
-
var
|
|
3161
|
+
var tr = class extends j {
|
|
3156
3162
|
install(e) {
|
|
3157
3163
|
super.install(e), e.scissor = this;
|
|
3158
3164
|
}
|
|
@@ -3176,7 +3182,7 @@ var er = class extends j {
|
|
|
3176
3182
|
y: e.y,
|
|
3177
3183
|
width: e.width,
|
|
3178
3184
|
height: e.height
|
|
3179
|
-
}, i = n ?
|
|
3185
|
+
}, i = n ? er(n, r) : r;
|
|
3180
3186
|
t.stack.push(i), this.bind(i);
|
|
3181
3187
|
}
|
|
3182
3188
|
pop() {
|
|
@@ -3187,28 +3193,28 @@ var er = class extends j {
|
|
|
3187
3193
|
let t = this._gl;
|
|
3188
3194
|
if (e) {
|
|
3189
3195
|
t.enable(t.SCISSOR_TEST);
|
|
3190
|
-
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } =
|
|
3196
|
+
let { pixelRatio: n, viewport: r } = this._renderer, { viewMatrix: i } = this._renderer.shader.uniforms, { x: a, y: o, width: s, height: c } = $n(i, e), l = r.current.height / n - (o + c);
|
|
3191
3197
|
t.scissor(a * n, l * n, s * n, c * n);
|
|
3192
3198
|
} else t.disable(t.SCISSOR_TEST);
|
|
3193
3199
|
}
|
|
3194
3200
|
destroy() {
|
|
3195
3201
|
super.destroy(), this._renderer.renderTarget.off("updateRenderTarget", this._updateRenderTarget);
|
|
3196
3202
|
}
|
|
3197
|
-
},
|
|
3203
|
+
}, nr = class extends Vt {
|
|
3198
3204
|
contextLost = !1;
|
|
3199
3205
|
_systems = [
|
|
3200
|
-
new
|
|
3201
|
-
new
|
|
3202
|
-
new
|
|
3203
|
-
new Yn(),
|
|
3204
|
-
new Mn(),
|
|
3205
|
-
new bn(),
|
|
3206
|
-
new Dn(),
|
|
3206
|
+
new Kn(),
|
|
3207
|
+
new qt(),
|
|
3208
|
+
new hn(),
|
|
3207
3209
|
new Xn(),
|
|
3208
|
-
new
|
|
3209
|
-
new
|
|
3210
|
-
new
|
|
3211
|
-
new
|
|
3210
|
+
new Nn(),
|
|
3211
|
+
new xn(),
|
|
3212
|
+
new On(),
|
|
3213
|
+
new Zn(),
|
|
3214
|
+
new An(),
|
|
3215
|
+
new tr(),
|
|
3216
|
+
new wn(),
|
|
3217
|
+
new jn()
|
|
3212
3218
|
];
|
|
3213
3219
|
bindPoints = /* @__PURE__ */ new Map();
|
|
3214
3220
|
supports = {
|
|
@@ -3302,8 +3308,8 @@ var er = class extends j {
|
|
|
3302
3308
|
height: this.screen.height * this.pixelRatio
|
|
3303
3309
|
});
|
|
3304
3310
|
}
|
|
3305
|
-
clear(e =
|
|
3306
|
-
typeof e == "boolean" && (e = e ?
|
|
3311
|
+
clear(e = Dn.all) {
|
|
3312
|
+
typeof e == "boolean" && (e = e ? Dn.all : Dn.none), e && this.gl.clear(e);
|
|
3307
3313
|
}
|
|
3308
3314
|
reset() {
|
|
3309
3315
|
this._systems.forEach((e) => e.reset());
|
|
@@ -3320,7 +3326,7 @@ var er = class extends j {
|
|
|
3320
3326
|
for (let e = 0; e < i; e += a) c.set(s.subarray(e, e + a), o - e);
|
|
3321
3327
|
return c;
|
|
3322
3328
|
}
|
|
3323
|
-
},
|
|
3329
|
+
}, rr = class {}, ir = class extends rr {
|
|
3324
3330
|
install(e) {
|
|
3325
3331
|
let t = async (e) => {
|
|
3326
3332
|
let { parseFont: t } = await import("modern-font");
|
|
@@ -3334,15 +3340,15 @@ var er = class extends j {
|
|
|
3334
3340
|
e.register(n, t);
|
|
3335
3341
|
}), e.font = this, this;
|
|
3336
3342
|
}
|
|
3337
|
-
},
|
|
3343
|
+
}, ar = class extends Ct {
|
|
3338
3344
|
constructor(e) {
|
|
3339
3345
|
super(), this.setProperties(e);
|
|
3340
3346
|
}
|
|
3341
3347
|
};
|
|
3342
|
-
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)],
|
|
3348
|
+
k([_({ fallback: A.index }), O("design:type", A === void 0 ? Object : A)], ar.prototype, "usage", void 0), k([_({ default: () => /* @__PURE__ */ new Uint32Array() }), O("design:type", Object)], ar.prototype, "data", void 0);
|
|
3343
3349
|
//#endregion
|
|
3344
3350
|
//#region src/scene/resources/geometries/Geometry.ts
|
|
3345
|
-
var
|
|
3351
|
+
var or = class extends Ct {
|
|
3346
3352
|
constructor(e = {}) {
|
|
3347
3353
|
super(), this.setProperties(e);
|
|
3348
3354
|
}
|
|
@@ -3350,7 +3356,7 @@ var ar = class extends Ct {
|
|
|
3350
3356
|
e.flush(), t.activate(e, n), e.geometry.bind(this, t.glProgram), e.geometry.draw(), e.geometry.unbind();
|
|
3351
3357
|
}
|
|
3352
3358
|
};
|
|
3353
|
-
k([_({ fallback: "triangle-list" }), O("design:type", Object)],
|
|
3359
|
+
k([_({ fallback: "triangle-list" }), O("design:type", Object)], or.prototype, "topology", void 0), k([_({ default: () => ({}) }), O("design:type", typeof Record > "u" ? Object : Record)], or.prototype, "attributes", void 0), k([_({ default: () => new ar() }), O("design:type", ar === void 0 ? Object : ar)], or.prototype, "indexBuffer", void 0), k([_({ fallback: 1 }), O("design:type", Number)], or.prototype, "instanceCount", void 0);
|
|
3354
3360
|
//#endregion
|
|
3355
3361
|
//#region src/scene/resources/geometries/VertexBuffer.ts
|
|
3356
3362
|
var P = class extends Ct {
|
|
@@ -3369,7 +3375,7 @@ var F = class extends Ct {
|
|
|
3369
3375
|
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);
|
|
3370
3376
|
//#endregion
|
|
3371
3377
|
//#region src/scene/resources/geometries/QuadGeometry.ts
|
|
3372
|
-
var
|
|
3378
|
+
var sr = class extends or {
|
|
3373
3379
|
constructor() {
|
|
3374
3380
|
super({
|
|
3375
3381
|
topology: "triangle-strip",
|
|
@@ -3386,7 +3392,7 @@ var or = class extends ar {
|
|
|
3386
3392
|
1
|
|
3387
3393
|
]) })
|
|
3388
3394
|
}) },
|
|
3389
|
-
indexBuffer: new
|
|
3395
|
+
indexBuffer: new ar({ data: new Uint32Array([
|
|
3390
3396
|
0,
|
|
3391
3397
|
1,
|
|
3392
3398
|
3,
|
|
@@ -3397,7 +3403,7 @@ var or = class extends ar {
|
|
|
3397
3403
|
};
|
|
3398
3404
|
//#endregion
|
|
3399
3405
|
//#region src/scene/resources/materials/Material.ts
|
|
3400
|
-
function
|
|
3406
|
+
function cr() {
|
|
3401
3407
|
return {
|
|
3402
3408
|
projectionMatrix: new Float32Array([
|
|
3403
3409
|
1,
|
|
@@ -3435,7 +3441,7 @@ var I = class extends Ct {
|
|
|
3435
3441
|
constructor(e = {}) {
|
|
3436
3442
|
super();
|
|
3437
3443
|
let { uniforms: t, gl: n } = e;
|
|
3438
|
-
t && (this.uniforms = t), this.glProgram = new
|
|
3444
|
+
t && (this.uniforms = t), this.glProgram = new on({
|
|
3439
3445
|
vertex: "in vec2 position;\nuniform mat3 projectionMatrix;\nuniform mat3 modelViewMatrix;\nvoid main(void) {\n gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}",
|
|
3440
3446
|
fragment: "uniform vec4 tint;\nvoid main(void) {\n gl_FragColor = tint;\n}",
|
|
3441
3447
|
...n
|
|
@@ -3448,13 +3454,13 @@ var I = class extends Ct {
|
|
|
3448
3454
|
}, e.shader.updateUniforms(this);
|
|
3449
3455
|
}
|
|
3450
3456
|
};
|
|
3451
|
-
k([_({ default:
|
|
3457
|
+
k([_({ default: cr }), O("design:type", typeof Record > "u" ? Object : Record)], I.prototype, "uniforms", void 0);
|
|
3452
3458
|
//#endregion
|
|
3453
3459
|
//#region src/scene/resources/materials/EffectMaterial.ts
|
|
3454
|
-
var
|
|
3455
|
-
function
|
|
3460
|
+
var lr = /^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm, ur = /vec(\d)\((.*)\)/;
|
|
3461
|
+
function dr(e) {
|
|
3456
3462
|
e = e.trim();
|
|
3457
|
-
let t = e.match(
|
|
3463
|
+
let t = e.match(ur);
|
|
3458
3464
|
if (t) {
|
|
3459
3465
|
let e = Array.from({ length: Number(t[1]) }, () => 0);
|
|
3460
3466
|
return t[2].split(",").forEach((t, n) => {
|
|
@@ -3463,7 +3469,7 @@ function ur(e) {
|
|
|
3463
3469
|
}
|
|
3464
3470
|
return Number(e);
|
|
3465
3471
|
}
|
|
3466
|
-
var
|
|
3472
|
+
var fr = class e extends I {
|
|
3467
3473
|
static RE = {
|
|
3468
3474
|
getColor: /\sgetColor\s*\(/,
|
|
3469
3475
|
getFromColor: /\sgetFromColor\s*\(/,
|
|
@@ -3499,12 +3505,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3499
3505
|
progress: 0
|
|
3500
3506
|
}
|
|
3501
3507
|
}), this.has = n;
|
|
3502
|
-
let r = t.matchAll(
|
|
3508
|
+
let r = t.matchAll(lr);
|
|
3503
3509
|
for (let e of r) e[1] && e[2] && e[1].split(",").forEach((t) => {
|
|
3504
|
-
this.uniforms[t.trim()] =
|
|
3510
|
+
this.uniforms[t.trim()] = dr(e[2]);
|
|
3505
3511
|
});
|
|
3506
3512
|
}
|
|
3507
|
-
},
|
|
3513
|
+
}, pr = class extends I {
|
|
3508
3514
|
static _instance;
|
|
3509
3515
|
static get instance() {
|
|
3510
3516
|
return this._instance ??= new this();
|
|
@@ -3543,7 +3549,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3543
3549
|
}
|
|
3544
3550
|
});
|
|
3545
3551
|
}
|
|
3546
|
-
},
|
|
3552
|
+
}, mr = class extends I {
|
|
3547
3553
|
static _instance;
|
|
3548
3554
|
static get instance() {
|
|
3549
3555
|
return this._instance ??= new this();
|
|
@@ -3587,12 +3593,12 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3587
3593
|
}
|
|
3588
3594
|
});
|
|
3589
3595
|
}
|
|
3590
|
-
}, L = class extends
|
|
3596
|
+
}, L = class extends or {
|
|
3591
3597
|
static _instance;
|
|
3592
3598
|
static get instance() {
|
|
3593
3599
|
return this._instance ??= new this();
|
|
3594
3600
|
}
|
|
3595
|
-
static draw(e, t =
|
|
3601
|
+
static draw(e, t = mr.instance, n) {
|
|
3596
3602
|
this.instance.draw(e, t, n);
|
|
3597
3603
|
}
|
|
3598
3604
|
constructor() {
|
|
@@ -3625,7 +3631,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3625
3631
|
]) })
|
|
3626
3632
|
})
|
|
3627
3633
|
},
|
|
3628
|
-
indexBuffer: new
|
|
3634
|
+
indexBuffer: new ar({ data: new Uint32Array([
|
|
3629
3635
|
0,
|
|
3630
3636
|
1,
|
|
3631
3637
|
2,
|
|
@@ -3635,7 +3641,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3635
3641
|
]) })
|
|
3636
3642
|
});
|
|
3637
3643
|
}
|
|
3638
|
-
},
|
|
3644
|
+
}, hr = class extends or {
|
|
3639
3645
|
positionBuffer;
|
|
3640
3646
|
uvBuffer;
|
|
3641
3647
|
constructor(e) {
|
|
@@ -3652,7 +3658,7 @@ ${t}${n.transform ? "\nvoid main(void) { gl_FragColor = transform(vUv); }" : n.t
|
|
|
3652
3658
|
buffer: n
|
|
3653
3659
|
})
|
|
3654
3660
|
},
|
|
3655
|
-
indexBuffer: new
|
|
3661
|
+
indexBuffer: new ar({ data: /* @__PURE__ */ new Uint32Array() })
|
|
3656
3662
|
}), this.positionBuffer = t, this.uvBuffer = n;
|
|
3657
3663
|
}
|
|
3658
3664
|
}, R = class extends Ct {
|
|
@@ -3786,7 +3792,7 @@ var z = class extends Ct {
|
|
|
3786
3792
|
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);
|
|
3787
3793
|
//#endregion
|
|
3788
3794
|
//#region src/scene/resources/textures/AnimatedTexture.ts
|
|
3789
|
-
var
|
|
3795
|
+
var gr = class extends Ct {
|
|
3790
3796
|
frames;
|
|
3791
3797
|
frameIndex = 0;
|
|
3792
3798
|
get currentFrame() {
|
|
@@ -3811,7 +3817,7 @@ var hr = class extends Ct {
|
|
|
3811
3817
|
e.texture.destroy();
|
|
3812
3818
|
});
|
|
3813
3819
|
}
|
|
3814
|
-
},
|
|
3820
|
+
}, _r = class extends z {
|
|
3815
3821
|
constructor(e = {}) {
|
|
3816
3822
|
super({
|
|
3817
3823
|
pixelRatio: 2,
|
|
@@ -3831,7 +3837,7 @@ var hr = class extends Ct {
|
|
|
3831
3837
|
}
|
|
3832
3838
|
super._updateProperty(e, t, n);
|
|
3833
3839
|
}
|
|
3834
|
-
},
|
|
3840
|
+
}, vr = class e extends z {
|
|
3835
3841
|
static _cached = /* @__PURE__ */ new Map();
|
|
3836
3842
|
static get(t) {
|
|
3837
3843
|
let n = new T(t), r = n.toHex(), i = this._cached.get(r);
|
|
@@ -3852,12 +3858,12 @@ var hr = class extends Ct {
|
|
|
3852
3858
|
mipmap: !0
|
|
3853
3859
|
});
|
|
3854
3860
|
}
|
|
3855
|
-
}, B = 2048,
|
|
3861
|
+
}, B = 2048, yr = 2, br = class {
|
|
3856
3862
|
superSample = 2;
|
|
3857
3863
|
_pages = [];
|
|
3858
3864
|
_slots = /* @__PURE__ */ new Map();
|
|
3859
3865
|
_newPage() {
|
|
3860
|
-
let e = new
|
|
3866
|
+
let e = new _r({
|
|
3861
3867
|
pixelRatio: 1,
|
|
3862
3868
|
mipmap: !0
|
|
3863
3869
|
});
|
|
@@ -3867,8 +3873,8 @@ var hr = class extends Ct {
|
|
|
3867
3873
|
let n = {
|
|
3868
3874
|
texture: e,
|
|
3869
3875
|
ctx: t.getContext("2d"),
|
|
3870
|
-
penX:
|
|
3871
|
-
penY:
|
|
3876
|
+
penX: yr,
|
|
3877
|
+
penY: yr,
|
|
3872
3878
|
rowH: 0
|
|
3873
3879
|
};
|
|
3874
3880
|
return this._pages.push(n), n;
|
|
@@ -3876,11 +3882,11 @@ var hr = class extends Ct {
|
|
|
3876
3882
|
acquire(e, t, n, r) {
|
|
3877
3883
|
let i = this._slots.get(e);
|
|
3878
3884
|
if (i !== void 0) return i;
|
|
3879
|
-
let a = this.superSample, o = Math.ceil(t * a), s = Math.ceil(n * a), c = o +
|
|
3885
|
+
let a = this.superSample, o = Math.ceil(t * a), s = Math.ceil(n * a), c = o + yr * 2, l = s + yr * 2;
|
|
3880
3886
|
if (c > B || l > B) return this._slots.set(e, null), null;
|
|
3881
3887
|
let u = this._pages[this._pages.length - 1] ?? this._newPage();
|
|
3882
|
-
u.penX + c > B && (u.penX =
|
|
3883
|
-
let d = u.penX +
|
|
3888
|
+
u.penX + c > B && (u.penX = yr, u.penY += u.rowH + yr, u.rowH = 0), u.penY + l > B && (u = this._newPage());
|
|
3889
|
+
let d = u.penX + yr, f = u.penY + yr, p = u.ctx;
|
|
3884
3890
|
p.save(), p.setTransform(a, 0, 0, a, d, f), p.beginPath(), r(p), p.restore(), u.texture.requestUpdate("source"), u.penX += c, u.rowH = Math.max(u.rowH, l);
|
|
3885
3891
|
let m = {
|
|
3886
3892
|
texture: u.texture,
|
|
@@ -3895,7 +3901,7 @@ var hr = class extends Ct {
|
|
|
3895
3901
|
for (let e of this._pages) e.texture.destroy();
|
|
3896
3902
|
this._pages.length = 0, this._slots.clear();
|
|
3897
3903
|
}
|
|
3898
|
-
},
|
|
3904
|
+
}, xr = new br(), Sr = class e extends z {
|
|
3899
3905
|
static test(e) {
|
|
3900
3906
|
return u(e);
|
|
3901
3907
|
}
|
|
@@ -3929,7 +3935,7 @@ var hr = class extends Ct {
|
|
|
3929
3935
|
constructor(t, n, r) {
|
|
3930
3936
|
super(e.linearGradient(t, n, r));
|
|
3931
3937
|
}
|
|
3932
|
-
},
|
|
3938
|
+
}, Cr = class extends z {
|
|
3933
3939
|
constructor(e = {}) {
|
|
3934
3940
|
super({
|
|
3935
3941
|
...e,
|
|
@@ -3939,7 +3945,7 @@ var hr = class extends Ct {
|
|
|
3939
3945
|
};
|
|
3940
3946
|
//#endregion
|
|
3941
3947
|
//#region src/scene/resources/textures/VideoTexture.ts
|
|
3942
|
-
function
|
|
3948
|
+
function wr(e) {
|
|
3943
3949
|
return {
|
|
3944
3950
|
autoLoad: !!(e?.autoLoad ?? !0),
|
|
3945
3951
|
autoPlay: !!(e?.autoPlay ?? !1),
|
|
@@ -3950,7 +3956,7 @@ function Cr(e) {
|
|
|
3950
3956
|
playsinline: !!(e?.playsinline ?? !0)
|
|
3951
3957
|
};
|
|
3952
3958
|
}
|
|
3953
|
-
var
|
|
3959
|
+
var Tr = class e extends z {
|
|
3954
3960
|
static mimeTypes = new Map(Object.entries({
|
|
3955
3961
|
ogv: "video/ogg",
|
|
3956
3962
|
mov: "video/quicktime",
|
|
@@ -4012,7 +4018,7 @@ var wr = class e extends z {
|
|
|
4012
4018
|
_reject;
|
|
4013
4019
|
_seekResolves = [];
|
|
4014
4020
|
constructor(t, n) {
|
|
4015
|
-
let r =
|
|
4021
|
+
let r = wr(n);
|
|
4016
4022
|
if (!Qe(t)) {
|
|
4017
4023
|
typeof t == "string" && (t = [t]);
|
|
4018
4024
|
let n = t[0].src || t[0];
|
|
@@ -4109,13 +4115,13 @@ var wr = class e extends z {
|
|
|
4109
4115
|
k([_({
|
|
4110
4116
|
internal: !0,
|
|
4111
4117
|
fallback: !0
|
|
4112
|
-
}), O("design:type", Boolean)],
|
|
4118
|
+
}), O("design:type", Boolean)], Tr.prototype, "autoUpdate", void 0), k([_({
|
|
4113
4119
|
internal: !0,
|
|
4114
4120
|
fallback: 0
|
|
4115
|
-
}), O("design:type", Number)],
|
|
4121
|
+
}), O("design:type", Number)], Tr.prototype, "fps", void 0);
|
|
4116
4122
|
//#endregion
|
|
4117
4123
|
//#region src/scene/resources/textures/ViewportTexture.ts
|
|
4118
|
-
var
|
|
4124
|
+
var Er = class extends z {}, Dr = class extends ue {
|
|
4119
4125
|
fillStyle;
|
|
4120
4126
|
fillRule;
|
|
4121
4127
|
strokeStyle;
|
|
@@ -4130,7 +4136,7 @@ var Tr = class extends z {}, Er = class extends ue {
|
|
|
4130
4136
|
_draws = [];
|
|
4131
4137
|
_triCache = [];
|
|
4132
4138
|
_parseDrawStyle(e) {
|
|
4133
|
-
return e ? e instanceof z ? { texture: e } : { texture:
|
|
4139
|
+
return e ? e instanceof z ? { texture: e } : { texture: vr.get(e) } : {};
|
|
4134
4140
|
}
|
|
4135
4141
|
stroke(e) {
|
|
4136
4142
|
if (!this.curves.length) return;
|
|
@@ -4219,7 +4225,7 @@ var Tr = class extends z {}, Er = class extends ue {
|
|
|
4219
4225
|
});
|
|
4220
4226
|
continue;
|
|
4221
4227
|
}
|
|
4222
|
-
let { path: r, ...i } = t, a = i.type === "stroke" ? i.lineStyle : void 0, o = i.type === "stroke", s = o ? i.flow : void 0, c = o && (!i.texture || i.texture instanceof
|
|
4228
|
+
let { path: r, ...i } = t, a = i.type === "stroke" ? i.lineStyle : void 0, o = i.type === "stroke", s = o ? i.flow : void 0, c = o && (!i.texture || i.texture instanceof vr), l = o && (!!s || c), u = `${i.type}|${r.toData()}|${a ? `${a.width},${a.cap},${a.join},${a.alignment},${a.miterLimit}` : ""}${l ? "|uv" : ""}`, d = this._triCache[n];
|
|
4223
4229
|
if (!d || d.sig !== u) {
|
|
4224
4230
|
let e = [], t = [], a = l ? [] : void 0;
|
|
4225
4231
|
i.type === "fill" ? r.fillTriangulate({
|
|
@@ -4245,7 +4251,7 @@ var Tr = class extends z {}, Er = class extends ue {
|
|
|
4245
4251
|
indices: d.indices,
|
|
4246
4252
|
meshUvs: d.uvs ?? i.meshUvs,
|
|
4247
4253
|
effectFlags: c && d.uvs && !s ? 2 : 0,
|
|
4248
|
-
effectParam: s && d.uvs ?
|
|
4254
|
+
effectParam: s && d.uvs ? It(s) : 0
|
|
4249
4255
|
});
|
|
4250
4256
|
}
|
|
4251
4257
|
return this._triCache.length = this._draws.length, e;
|
|
@@ -4253,7 +4259,7 @@ var Tr = class extends z {}, Er = class extends ue {
|
|
|
4253
4259
|
destroy() {
|
|
4254
4260
|
this.reset(), this._triCache.length = 0;
|
|
4255
4261
|
}
|
|
4256
|
-
},
|
|
4262
|
+
}, Or = class {
|
|
4257
4263
|
front = [];
|
|
4258
4264
|
default = [];
|
|
4259
4265
|
back = [];
|
|
@@ -4296,7 +4302,7 @@ var Tr = class extends z {}, Er = class extends ue {
|
|
|
4296
4302
|
toJSON() {
|
|
4297
4303
|
return [...this.default];
|
|
4298
4304
|
}
|
|
4299
|
-
},
|
|
4305
|
+
}, kr = class extends w {
|
|
4300
4306
|
parent;
|
|
4301
4307
|
getPropertyDeclarations() {
|
|
4302
4308
|
super.getPropertyDeclarations();
|
|
@@ -4315,22 +4321,22 @@ var Tr = class extends z {}, Er = class extends ue {
|
|
|
4315
4321
|
deleteProperty: (e, t) => Reflect.has(e, t) || String(t).startsWith("_") ? Reflect.deleteProperty(e, t) : (e.setProperty(String(t), void 0), !0)
|
|
4316
4322
|
});
|
|
4317
4323
|
}
|
|
4318
|
-
},
|
|
4319
|
-
function
|
|
4320
|
-
let t =
|
|
4321
|
-
return t++,
|
|
4324
|
+
}, Ar, jr = {};
|
|
4325
|
+
function Mr(e) {
|
|
4326
|
+
let t = jr[e] ?? 0;
|
|
4327
|
+
return t++, jr[e] = t, t;
|
|
4322
4328
|
}
|
|
4323
|
-
var V =
|
|
4329
|
+
var V = Ar = class extends w {
|
|
4324
4330
|
static parse(e, t = "Node") {
|
|
4325
4331
|
if (Array.isArray(e)) return e.map((e) => this.parse(e));
|
|
4326
|
-
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ye.get(n ?? r.inCanvasIs ?? t)) ??
|
|
4332
|
+
let { is: n, meta: r = {}, children: i, ...a } = e, o = new ((ye.get(n ?? r.inCanvasIs ?? t)) ?? Ar)({
|
|
4327
4333
|
...a,
|
|
4328
4334
|
meta: r
|
|
4329
4335
|
});
|
|
4330
4336
|
return i?.forEach((e) => o.appendChild(this.parse(e))), o;
|
|
4331
4337
|
}
|
|
4332
4338
|
_mask;
|
|
4333
|
-
_meta = new
|
|
4339
|
+
_meta = new kr(this);
|
|
4334
4340
|
get meta() {
|
|
4335
4341
|
return this._meta;
|
|
4336
4342
|
}
|
|
@@ -4353,7 +4359,7 @@ var V = kr = class extends w {
|
|
|
4353
4359
|
}).append(t), this.on("treeEnter", this._onTreeEnter).on("treeExit", this._onTreeExit).on("parented", this._onParented).on("unparented", this._onUnparented).on("ready", this._onReady).on("process", this._onProcess), this.updateProcessable(), this.updateRenderable();
|
|
4354
4360
|
}
|
|
4355
4361
|
_defaultName() {
|
|
4356
|
-
return `@${this.is}@${
|
|
4362
|
+
return `@${this.is}@${Mr(this.is)}`;
|
|
4357
4363
|
}
|
|
4358
4364
|
setProperties(e) {
|
|
4359
4365
|
if (e) {
|
|
@@ -4420,7 +4426,7 @@ var V = kr = class extends w {
|
|
|
4420
4426
|
}
|
|
4421
4427
|
return this;
|
|
4422
4428
|
}
|
|
4423
|
-
_children = new
|
|
4429
|
+
_children = new Or();
|
|
4424
4430
|
get children() {
|
|
4425
4431
|
return this._children.default;
|
|
4426
4432
|
}
|
|
@@ -4580,7 +4586,7 @@ var V = kr = class extends w {
|
|
|
4580
4586
|
append(...e) {
|
|
4581
4587
|
let t;
|
|
4582
4588
|
t = Array.isArray(e[0]) ? e[0] : e, t.forEach((e) => {
|
|
4583
|
-
e instanceof
|
|
4589
|
+
e instanceof Ar ? this.appendChild(e) : this.appendChild(Ar.parse(e));
|
|
4584
4590
|
});
|
|
4585
4591
|
}
|
|
4586
4592
|
before(...e) {
|
|
@@ -4686,7 +4692,7 @@ var V = kr = class extends w {
|
|
|
4686
4692
|
k([_({ default: () => c() }), O("design:type", String)], V.prototype, "id", void 0), k([_({ default: () => c() }), O("design:type", String)], V.prototype, "name", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], V.prototype, "processMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], V.prototype, "processSortMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], V.prototype, "renderMode", void 0), k([_({ fallback: "inherit" }), O("design:type", Object)], V.prototype, "inputMode", void 0), k([_({ fallback: "default" }), O("design:type", Object)], V.prototype, "internalMode", void 0), k([_({
|
|
4687
4693
|
internal: !0,
|
|
4688
4694
|
default: !0
|
|
4689
|
-
}), O("design:type", Boolean)], V.prototype, "needsRender", void 0), V =
|
|
4695
|
+
}), O("design:type", Boolean)], V.prototype, "needsRender", void 0), V = Ar = k([x("Node"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], V);
|
|
4690
4696
|
//#endregion
|
|
4691
4697
|
//#region src/scene/main/TimelineNode.ts
|
|
4692
4698
|
var H = class extends V {
|
|
@@ -4774,15 +4780,15 @@ var H = class extends V {
|
|
|
4774
4780
|
k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "loop", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "delay", void 0), k([_({ fallback: 0 }), O("design:type", Number)], H.prototype, "duration", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], H.prototype, "paused", void 0), H = k([x("TimelineNode"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], H);
|
|
4775
4781
|
//#endregion
|
|
4776
4782
|
//#region src/scene/main/CanvasItem.ts
|
|
4777
|
-
var
|
|
4778
|
-
function
|
|
4779
|
-
|
|
4783
|
+
var Nr = [], Pr = 0;
|
|
4784
|
+
function Fr() {
|
|
4785
|
+
Pr = 0;
|
|
4780
4786
|
}
|
|
4781
|
-
function
|
|
4782
|
-
let i =
|
|
4783
|
-
return i || (i = {},
|
|
4787
|
+
function Ir(e, t, n, r) {
|
|
4788
|
+
let i = Nr[Pr];
|
|
4789
|
+
return i || (i = {}, Nr[Pr] = i), Pr++, Object.assign(i, e), i.roundPixels = t, i.size = n, i.texture = r, i.__source = e, i;
|
|
4784
4790
|
}
|
|
4785
|
-
var
|
|
4791
|
+
var Lr = class extends H {
|
|
4786
4792
|
_blendMode;
|
|
4787
4793
|
_parentGlobalVisible;
|
|
4788
4794
|
_globalVisible;
|
|
@@ -4800,7 +4806,7 @@ var Ir = class extends H {
|
|
|
4800
4806
|
255,
|
|
4801
4807
|
255
|
|
4802
4808
|
];
|
|
4803
|
-
context = new
|
|
4809
|
+
context = new Dr();
|
|
4804
4810
|
_resetContext = !0;
|
|
4805
4811
|
needsDraw = !0;
|
|
4806
4812
|
needsLayout = !1;
|
|
@@ -4931,7 +4937,7 @@ var Ir = class extends H {
|
|
|
4931
4937
|
return;
|
|
4932
4938
|
}
|
|
4933
4939
|
let t = this._tree?.pixelate, n = this._tree?.roundPixels, r = this._batchables;
|
|
4934
|
-
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof
|
|
4940
|
+
for (let i, a, o = r.length, s = 0; s < o; s++) i = r[s], a = i.texture, a instanceof Er && (a = this._handleViewportTexture(i)), e.batch2D.render(Ir(i, n, t ? i.size : void 0, a));
|
|
4935
4941
|
super._render(e);
|
|
4936
4942
|
}
|
|
4937
4943
|
_cullsRender() {
|
|
@@ -4941,13 +4947,13 @@ var Ir = class extends H {
|
|
|
4941
4947
|
super._destroy(), this.context.destroy(), this._drawBatchables = [], this._layoutBatchables = [], this._batchables = [];
|
|
4942
4948
|
}
|
|
4943
4949
|
};
|
|
4944
|
-
k([_(), O("design:type", Object)],
|
|
4950
|
+
k([_(), O("design:type", Object)], Lr.prototype, "blendMode", void 0), k([_({
|
|
4945
4951
|
internal: !0,
|
|
4946
4952
|
fallback: !0
|
|
4947
|
-
}), O("design:type", Boolean)],
|
|
4953
|
+
}), O("design:type", Boolean)], Lr.prototype, "visible", void 0), k([_({
|
|
4948
4954
|
internal: !0,
|
|
4949
4955
|
fallback: 1
|
|
4950
|
-
}), O("design:type", Number)],
|
|
4956
|
+
}), O("design:type", Number)], Lr.prototype, "opacity", void 0), Lr = k([x("CanvasItem"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Lr);
|
|
4951
4957
|
//#endregion
|
|
4952
4958
|
//#region src/scene/main/Viewport.ts
|
|
4953
4959
|
var U = class extends V {
|
|
@@ -5000,7 +5006,7 @@ var U = class extends V {
|
|
|
5000
5006
|
return !1;
|
|
5001
5007
|
}
|
|
5002
5008
|
activateWithCopy(e, t) {
|
|
5003
|
-
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e,
|
|
5009
|
+
this.resize(t.width, t.height), this.activate(e) && (e.clear(), t.texture.activate(e, 0), L.draw(e, mr.instance, { sampler: 0 }));
|
|
5004
5010
|
}
|
|
5005
5011
|
renderStart(e, t) {
|
|
5006
5012
|
this.activate(e, t) && e.clear();
|
|
@@ -5013,7 +5019,7 @@ var U = class extends V {
|
|
|
5013
5019
|
this.renderStart(e), super.render(e, t), this.renderEnd(e, n);
|
|
5014
5020
|
}
|
|
5015
5021
|
getRect() {
|
|
5016
|
-
return new
|
|
5022
|
+
return new Tt(this.x, this.y, this.width, this.height);
|
|
5017
5023
|
}
|
|
5018
5024
|
toCanvasGlobal(e, t) {
|
|
5019
5025
|
return this.canvasTransform.applyAffineInverse(e, t);
|
|
@@ -5051,7 +5057,7 @@ var W = class extends H {
|
|
|
5051
5057
|
_updateProperty(e, t, n) {
|
|
5052
5058
|
switch (super._updateProperty(e, t, n), e) {
|
|
5053
5059
|
case "glsl": {
|
|
5054
|
-
let e = new
|
|
5060
|
+
let e = new fr(t);
|
|
5055
5061
|
!this.effectMode && e.has.transition && (this.effectMode = "transition"), this.material = e;
|
|
5056
5062
|
break;
|
|
5057
5063
|
}
|
|
@@ -5086,7 +5092,7 @@ var W = class extends H {
|
|
|
5086
5092
|
}
|
|
5087
5093
|
}
|
|
5088
5094
|
getRect() {
|
|
5089
|
-
return new
|
|
5095
|
+
return new Tt(this._rect);
|
|
5090
5096
|
}
|
|
5091
5097
|
_processParent() {
|
|
5092
5098
|
let e = this._tree?.renderStack;
|
|
@@ -5259,7 +5265,7 @@ var W = class extends H {
|
|
|
5259
5265
|
k([_({ internal: !0 }), O("design:type", Object)], W.prototype, "material", void 0), k([_(), O("design:type", Object)], W.prototype, "effectMode", void 0), k([_(), O("design:type", String)], W.prototype, "glsl", void 0), k([_(), O("design:type", String)], W.prototype, "glslSrc", void 0), W = k([x("Effect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], W);
|
|
5260
5266
|
//#endregion
|
|
5261
5267
|
//#region src/scene/main/RenderStack.ts
|
|
5262
|
-
var
|
|
5268
|
+
var Rr = class {
|
|
5263
5269
|
currentCall;
|
|
5264
5270
|
calls = [];
|
|
5265
5271
|
createCall(e) {
|
|
@@ -5284,7 +5290,7 @@ var Lr = class {
|
|
|
5284
5290
|
});
|
|
5285
5291
|
}), this.reset();
|
|
5286
5292
|
}
|
|
5287
|
-
},
|
|
5293
|
+
}, zr, Br = zr = class extends V {
|
|
5288
5294
|
currentTime = 0;
|
|
5289
5295
|
playing = !1;
|
|
5290
5296
|
playbackRate = 1;
|
|
@@ -5305,7 +5311,7 @@ var Lr = class {
|
|
|
5305
5311
|
}
|
|
5306
5312
|
static from(e, t = !1) {
|
|
5307
5313
|
let [n, r] = e ? Array.isArray(e) ? e : [0, e] : [];
|
|
5308
|
-
return new
|
|
5314
|
+
return new zr({
|
|
5309
5315
|
startTime: n,
|
|
5310
5316
|
endTime: r,
|
|
5311
5317
|
loop: t
|
|
@@ -5351,10 +5357,10 @@ var Lr = class {
|
|
|
5351
5357
|
super._process(e), this.paused || this.addTime(e);
|
|
5352
5358
|
}
|
|
5353
5359
|
};
|
|
5354
|
-
k([_({ fallback: 0 }), O("design:type", Number)],
|
|
5360
|
+
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 = zr = k([x("Timeline"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], Br);
|
|
5355
5361
|
//#endregion
|
|
5356
5362
|
//#region src/scene/main/Window.ts
|
|
5357
|
-
var
|
|
5363
|
+
var Vr = class extends U {
|
|
5358
5364
|
constructor() {
|
|
5359
5365
|
super(), this.renderTargets.forEach((e) => e.isRoot = !0);
|
|
5360
5366
|
}
|
|
@@ -5365,17 +5371,17 @@ var Br = class extends U {
|
|
|
5365
5371
|
super.flush(e), this.finish(e);
|
|
5366
5372
|
}
|
|
5367
5373
|
};
|
|
5368
|
-
|
|
5374
|
+
Vr = k([x("Window", {
|
|
5369
5375
|
processMode: "always",
|
|
5370
5376
|
renderMode: "always"
|
|
5371
|
-
}), O("design:paramtypes", [])],
|
|
5377
|
+
}), O("design:paramtypes", [])], Vr);
|
|
5372
5378
|
//#endregion
|
|
5373
5379
|
//#region src/scene/main/SceneTree.ts
|
|
5374
|
-
var G = class extends
|
|
5380
|
+
var G = class extends jt {
|
|
5375
5381
|
input = new xt();
|
|
5376
|
-
renderStack = new
|
|
5377
|
-
root = new
|
|
5378
|
-
timeline = new
|
|
5382
|
+
renderStack = new Rr();
|
|
5383
|
+
root = new Vr().setTree(this);
|
|
5384
|
+
timeline = new Br().setTree(this);
|
|
5379
5385
|
imagePipelineResolver;
|
|
5380
5386
|
nodeMap = /* @__PURE__ */ new Map();
|
|
5381
5387
|
_boundFonts;
|
|
@@ -5457,12 +5463,12 @@ var G = class extends At {
|
|
|
5457
5463
|
this.renderStack.reset(), this.timeline.emit("process", e), this.emit("processing"), this.root.emit("process", e), this.emit("processed");
|
|
5458
5464
|
}
|
|
5459
5465
|
_render(e) {
|
|
5460
|
-
this.emit("rendering"),
|
|
5466
|
+
this.emit("rendering"), Fr(), e.batch2D.beginFrame(), this._flowColorArray && (e.batch2D.effectUniforms.uFlowColor = this._flowColorArray), this.flowPeriod && (e.batch2D.effectUniforms.uFlowPeriod = this.flowPeriod), this.renderStack.render(e), this._renderScreen(e), this.emit("rendered");
|
|
5461
5467
|
}
|
|
5462
5468
|
_renderScreen(e) {
|
|
5463
5469
|
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);
|
|
5464
5470
|
let t = this.root.texture;
|
|
5465
|
-
t.activate(e, 0), this.fxaa ? L.draw(e,
|
|
5471
|
+
t.activate(e, 0), this.fxaa ? L.draw(e, pr.instance, {
|
|
5466
5472
|
sampler: 0,
|
|
5467
5473
|
texelSize: [1 / (t.pixelWidth || t.width || 1), 1 / (t.pixelHeight || t.height || 1)]
|
|
5468
5474
|
}) : L.draw(e), t.inactivate(e);
|
|
@@ -5483,18 +5489,18 @@ k([_({ alias: "root.msaa" }), O("design:type", Boolean)], G.prototype, "msaa", v
|
|
|
5483
5489
|
}), O("design:type", Object)], G.prototype, "fonts", void 0);
|
|
5484
5490
|
//#endregion
|
|
5485
5491
|
//#region src/scene/main/Transition.ts
|
|
5486
|
-
var
|
|
5492
|
+
var Hr = class extends W {
|
|
5487
5493
|
constructor(e, t = []) {
|
|
5488
5494
|
super(), this.setProperties(e).append(t);
|
|
5489
5495
|
}
|
|
5490
5496
|
};
|
|
5491
|
-
|
|
5497
|
+
Hr = k([x("Transition", {
|
|
5492
5498
|
effectMode: "transition",
|
|
5493
5499
|
duration: 2e3
|
|
5494
|
-
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])],
|
|
5500
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Hr);
|
|
5495
5501
|
//#endregion
|
|
5496
5502
|
//#region src/scene/2d/Node2D.ts
|
|
5497
|
-
var
|
|
5503
|
+
var Ur = new v(), Wr = class extends Lr {
|
|
5498
5504
|
rotation = 0;
|
|
5499
5505
|
position = new y(0, 0, () => this.updateGlobalTransform());
|
|
5500
5506
|
contentOffset = new y(0, 0, () => this.updateGlobalTransform());
|
|
@@ -5525,7 +5531,7 @@ var Hr = new v(), Ur = class extends Ir {
|
|
|
5525
5531
|
let s = o.x, c = o.y;
|
|
5526
5532
|
if (this.globalPosition.set(t.x + this.position.x - s, t.y + this.position.y - c), this.globalScale.set(n.x * this.scale.x, n.y * this.scale.y), this.globalSkew.set(r.x * this.skew.x, r.y * this.skew.y), this.globalRotation = i + this.rotation, s !== 0 || c !== 0) {
|
|
5527
5533
|
let t = e.globalTransform;
|
|
5528
|
-
|
|
5534
|
+
Ur.copyFrom(t), Ur.tx = t.tx - s * t.a - c * t.c, Ur.ty = t.ty - s * t.b - c * t.d, this.globalTransform.appendFrom(this.transform, Ur);
|
|
5529
5535
|
} else this.globalTransform.appendFrom(this.transform, e.globalTransform);
|
|
5530
5536
|
} else this.globalPosition.copyFrom(this.position), this.globalScale.copyFrom(this.scale), this.globalSkew.copyFrom(this.skew), this.globalRotation = this.rotation, this.globalTransform.copyFrom(this.transform);
|
|
5531
5537
|
this.requestLayout(), this.emit("updateGlobalTransform");
|
|
@@ -5552,10 +5558,10 @@ var Hr = new v(), Ur = class extends Ir {
|
|
|
5552
5558
|
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();
|
|
5553
5559
|
}
|
|
5554
5560
|
};
|
|
5555
|
-
|
|
5561
|
+
Wr = k([x("Node2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Wr);
|
|
5556
5562
|
//#endregion
|
|
5557
5563
|
//#region src/scene/2d/Camera2D.ts
|
|
5558
|
-
var
|
|
5564
|
+
var Gr = class extends Wr {
|
|
5559
5565
|
canvasTransform = new v();
|
|
5560
5566
|
_screenOffset = {
|
|
5561
5567
|
x: 0,
|
|
@@ -5702,16 +5708,16 @@ var Wr = class extends Ur {
|
|
|
5702
5708
|
k([_({
|
|
5703
5709
|
internal: !0,
|
|
5704
5710
|
fallback: !1
|
|
5705
|
-
}), O("design:type", Boolean)],
|
|
5711
|
+
}), O("design:type", Boolean)], Gr.prototype, "spaceKey", void 0), k([_({
|
|
5706
5712
|
internal: !0,
|
|
5707
5713
|
fallback: !1
|
|
5708
|
-
}), O("design:type", Boolean)],
|
|
5714
|
+
}), O("design:type", Boolean)], Gr.prototype, "grabbing", void 0), Gr = k([x("Camera2D", {
|
|
5709
5715
|
processMode: "disabled",
|
|
5710
5716
|
renderMode: "disabled"
|
|
5711
|
-
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])],
|
|
5717
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Gr);
|
|
5712
5718
|
//#endregion
|
|
5713
5719
|
//#region src/scene/2d/element/connectionRouter.ts
|
|
5714
|
-
function
|
|
5720
|
+
function Kr(e, t) {
|
|
5715
5721
|
return Math.abs(e) >= Math.abs(t) ? {
|
|
5716
5722
|
x: Math.sign(e) || 1,
|
|
5717
5723
|
y: 0
|
|
@@ -5720,11 +5726,11 @@ function Gr(e, t) {
|
|
|
5720
5726
|
y: Math.sign(t) || 1
|
|
5721
5727
|
};
|
|
5722
5728
|
}
|
|
5723
|
-
function
|
|
5729
|
+
function qr(e, t, n, r = {}) {
|
|
5724
5730
|
let i = t.point, a = n.point, o = new ue();
|
|
5725
5731
|
switch (e) {
|
|
5726
5732
|
case "curved": {
|
|
5727
|
-
let e = t.dir ??
|
|
5733
|
+
let e = t.dir ?? Kr(a.x - i.x, a.y - i.y), s = n.dir ?? Kr(i.x - a.x, i.y - a.y), c = a.x - i.x, l = a.y - i.y, u = Math.hypot(c, l) || 1, d = c / u, f = l / u, p = Math.max((r.stub ?? 16) * 2, u * .4), m = (e, t, n, r) => Math.max(.1, (1 + e * n + t * r) / 2), h = p * m(e.x, e.y, d, f), g = p * m(s.x, s.y, -d, -f), ee = i.x + e.x * h, te = i.y + e.y * h, ne = a.x + s.x * g, re = a.y + s.y * g;
|
|
5728
5734
|
for (let e = 0; e <= 32; e++) {
|
|
5729
5735
|
let t = e / 32, n = 1 - t, r = n * n * n, s = 3 * n * n * t, c = 3 * n * t * t, l = t * t * t, u = r * i.x + s * ee + c * ne + l * a.x, d = r * i.y + s * te + c * re + l * a.y;
|
|
5730
5736
|
e === 0 ? o.moveTo(u, d) : o.lineTo(u, d);
|
|
@@ -5732,7 +5738,7 @@ function Kr(e, t, n, r = {}) {
|
|
|
5732
5738
|
break;
|
|
5733
5739
|
}
|
|
5734
5740
|
case "orthogonal": {
|
|
5735
|
-
let e =
|
|
5741
|
+
let e = Yr(t, n, r);
|
|
5736
5742
|
for (let t = 0; t < e.length; t++) t === 0 ? o.moveTo(e[t].x, e[t].y) : o.lineTo(e[t].x, e[t].y);
|
|
5737
5743
|
break;
|
|
5738
5744
|
}
|
|
@@ -5742,11 +5748,11 @@ function Kr(e, t, n, r = {}) {
|
|
|
5742
5748
|
}
|
|
5743
5749
|
return o;
|
|
5744
5750
|
}
|
|
5745
|
-
function
|
|
5746
|
-
return
|
|
5751
|
+
function Jr(e) {
|
|
5752
|
+
return Kr(e.x, e.y);
|
|
5747
5753
|
}
|
|
5748
|
-
function
|
|
5749
|
-
let r = e.point, i = t.point, a = n.stub ?? 16, o =
|
|
5754
|
+
function Yr(e, t, n) {
|
|
5755
|
+
let r = e.point, i = t.point, a = n.stub ?? 16, o = Jr(e.dir ?? Kr(i.x - r.x, i.y - r.y)), s = Jr(t.dir ?? Kr(r.x - i.x, r.y - i.y)), c = {
|
|
5750
5756
|
x: r.x + o.x * a,
|
|
5751
5757
|
y: r.y + o.y * a
|
|
5752
5758
|
}, l = {
|
|
@@ -5758,12 +5764,12 @@ function Jr(e, t, n) {
|
|
|
5758
5764
|
x: r.x,
|
|
5759
5765
|
y: r.y
|
|
5760
5766
|
}, c];
|
|
5761
|
-
return d.push(...
|
|
5767
|
+
return d.push(...Zr(c, o, l, s, a, u)), d.push(l, {
|
|
5762
5768
|
x: i.x,
|
|
5763
5769
|
y: i.y
|
|
5764
|
-
}),
|
|
5770
|
+
}), Qr(d);
|
|
5765
5771
|
}
|
|
5766
|
-
function
|
|
5772
|
+
function Xr(e, t, n, r, i) {
|
|
5767
5773
|
let a = Infinity, o = -Infinity, s = t === "y" ? "x" : "y";
|
|
5768
5774
|
for (let e of r) {
|
|
5769
5775
|
let r = e.min[s], i = r + e.size[s];
|
|
@@ -5774,7 +5780,7 @@ function Yr(e, t, n, r, i) {
|
|
|
5774
5780
|
}
|
|
5775
5781
|
return e > a && e < o ? a - i : e;
|
|
5776
5782
|
}
|
|
5777
|
-
function
|
|
5783
|
+
function Zr(e, t, n, r, i, a = []) {
|
|
5778
5784
|
let o = t.y === 0;
|
|
5779
5785
|
if (o === (r.y === 0)) {
|
|
5780
5786
|
if (o) {
|
|
@@ -5789,7 +5795,7 @@ function Xr(e, t, n, r, i, a = []) {
|
|
|
5789
5795
|
}];
|
|
5790
5796
|
}
|
|
5791
5797
|
let o = Math.abs(e.y - n.y) < .001 ? e.y + i : (e.y + n.y) / 2;
|
|
5792
|
-
return o =
|
|
5798
|
+
return o = Xr(o, "y", [Math.min(e.x, n.x), Math.max(e.x, n.x)], a, i), [{
|
|
5793
5799
|
x: e.x,
|
|
5794
5800
|
y: o
|
|
5795
5801
|
}, {
|
|
@@ -5808,7 +5814,7 @@ function Xr(e, t, n, r, i, a = []) {
|
|
|
5808
5814
|
}];
|
|
5809
5815
|
}
|
|
5810
5816
|
let s = Math.abs(e.x - n.x) < .001 ? e.x + i : (e.x + n.x) / 2;
|
|
5811
|
-
return s =
|
|
5817
|
+
return s = Xr(s, "x", [Math.min(e.y, n.y), Math.max(e.y, n.y)], a, i), [{
|
|
5812
5818
|
x: s,
|
|
5813
5819
|
y: e.y
|
|
5814
5820
|
}, {
|
|
@@ -5835,7 +5841,7 @@ function Xr(e, t, n, r, i, a = []) {
|
|
|
5835
5841
|
y: l.y
|
|
5836
5842
|
}];
|
|
5837
5843
|
}
|
|
5838
|
-
function
|
|
5844
|
+
function Qr(e) {
|
|
5839
5845
|
let t = [];
|
|
5840
5846
|
for (let n = 0; n < e.length; n++) {
|
|
5841
5847
|
let r = e[n], i = t[t.length - 1];
|
|
@@ -5845,7 +5851,7 @@ function Zr(e) {
|
|
|
5845
5851
|
}
|
|
5846
5852
|
//#endregion
|
|
5847
5853
|
//#region src/css/parseCssFilter.ts
|
|
5848
|
-
var
|
|
5854
|
+
var $r = {
|
|
5849
5855
|
brightness: 1,
|
|
5850
5856
|
contrast: 1,
|
|
5851
5857
|
grayscale: 0,
|
|
@@ -5855,12 +5861,12 @@ var Qr = {
|
|
|
5855
5861
|
saturate: 1,
|
|
5856
5862
|
sepia: 0
|
|
5857
5863
|
};
|
|
5858
|
-
function
|
|
5859
|
-
let t = new
|
|
5864
|
+
function ei(e) {
|
|
5865
|
+
let t = new Ot();
|
|
5860
5866
|
if (e === "none") return t;
|
|
5861
5867
|
let n = je(e).reduce((e, { name: t, args: n }) => (e[t] = n[0].normalizedIntValue, e), {});
|
|
5862
|
-
Object.keys(
|
|
5863
|
-
n[e] = n[e] ??
|
|
5868
|
+
Object.keys($r).forEach((e) => {
|
|
5869
|
+
n[e] = n[e] ?? $r[e];
|
|
5864
5870
|
});
|
|
5865
5871
|
for (let e in n) {
|
|
5866
5872
|
let r = n[e];
|
|
@@ -5895,7 +5901,7 @@ function $r(e) {
|
|
|
5895
5901
|
}
|
|
5896
5902
|
//#endregion
|
|
5897
5903
|
//#region src/css/parseCssTransformOrigin.ts
|
|
5898
|
-
function
|
|
5904
|
+
function ti(e) {
|
|
5899
5905
|
let [t, n = t] = e.split(" ");
|
|
5900
5906
|
return [t, n].map((e) => {
|
|
5901
5907
|
switch (e = e.trim(), e) {
|
|
@@ -5910,9 +5916,9 @@ function ei(e) {
|
|
|
5910
5916
|
}
|
|
5911
5917
|
//#endregion
|
|
5912
5918
|
//#region src/scene/effects/ColorAdjustEffect.ts
|
|
5913
|
-
var
|
|
5919
|
+
var ni, K = class extends W {
|
|
5914
5920
|
static {
|
|
5915
|
-
|
|
5921
|
+
ni = this;
|
|
5916
5922
|
}
|
|
5917
5923
|
static material = new I({ gl: {
|
|
5918
5924
|
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}",
|
|
@@ -5923,7 +5929,7 @@ var ti, K = class extends W {
|
|
|
5923
5929
|
}
|
|
5924
5930
|
apply(e, t) {
|
|
5925
5931
|
t.redraw(e, () => {
|
|
5926
|
-
L.draw(e,
|
|
5932
|
+
L.draw(e, ni.material, {
|
|
5927
5933
|
sampler: 0,
|
|
5928
5934
|
saturation: this.saturation,
|
|
5929
5935
|
contrast: this.contrast,
|
|
@@ -5937,18 +5943,18 @@ var ti, K = class extends W {
|
|
|
5937
5943
|
});
|
|
5938
5944
|
}
|
|
5939
5945
|
};
|
|
5940
|
-
k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "gamma", void 0), K =
|
|
5946
|
+
k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "saturation", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "contrast", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "brightness", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "red", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "green", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "blue", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "alpha", void 0), k([_({ fallback: 1 }), O("design:type", Number)], K.prototype, "gamma", void 0), K = ni = k([x("ColorAdjustEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], K);
|
|
5941
5947
|
//#endregion
|
|
5942
5948
|
//#region src/scene/effects/ColorFilterEffect.ts
|
|
5943
|
-
var
|
|
5949
|
+
var ri, ii = class extends W {
|
|
5944
5950
|
static {
|
|
5945
|
-
|
|
5951
|
+
ri = this;
|
|
5946
5952
|
}
|
|
5947
5953
|
static material = new I({ gl: {
|
|
5948
5954
|
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}",
|
|
5949
5955
|
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}"
|
|
5950
5956
|
} });
|
|
5951
|
-
_colorMatrix = new
|
|
5957
|
+
_colorMatrix = new Ot();
|
|
5952
5958
|
constructor(e, t = []) {
|
|
5953
5959
|
super(), this.setProperties(e).append(t);
|
|
5954
5960
|
}
|
|
@@ -5992,25 +5998,25 @@ var ni, ri = class extends W {
|
|
|
5992
5998
|
break;
|
|
5993
5999
|
}
|
|
5994
6000
|
}), t.redraw(e, () => {
|
|
5995
|
-
L.draw(e,
|
|
6001
|
+
L.draw(e, ri.material, {
|
|
5996
6002
|
sampler: 0,
|
|
5997
6003
|
m: r.toArray()
|
|
5998
6004
|
});
|
|
5999
6005
|
});
|
|
6000
6006
|
}
|
|
6001
6007
|
};
|
|
6002
|
-
k([_(), O("design:type", String)],
|
|
6008
|
+
k([_(), O("design:type", String)], ii.prototype, "filter", void 0), ii = ri = k([x("ColorFilterEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], ii);
|
|
6003
6009
|
//#endregion
|
|
6004
6010
|
//#region src/scene/effects/ColorOverlayEffect.ts
|
|
6005
|
-
var
|
|
6011
|
+
var ai, oi = 50, si = class extends W {
|
|
6006
6012
|
static {
|
|
6007
|
-
|
|
6013
|
+
ai = this;
|
|
6008
6014
|
}
|
|
6009
6015
|
static material = new I({ gl: {
|
|
6010
6016
|
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}",
|
|
6011
6017
|
fragment: `precision mediump float;
|
|
6012
6018
|
uniform sampler2D sampler;
|
|
6013
|
-
uniform vec4 colors[${
|
|
6019
|
+
uniform vec4 colors[${oi}];
|
|
6014
6020
|
varying vec2 vUv;
|
|
6015
6021
|
|
|
6016
6022
|
float calcWidth() {
|
|
@@ -6019,7 +6025,7 @@ float calcWidth() {
|
|
|
6019
6025
|
|
|
6020
6026
|
int calcCount() {
|
|
6021
6027
|
int count = 0;
|
|
6022
|
-
for (int i = 0; i < ${
|
|
6028
|
+
for (int i = 0; i < ${oi}; i++) {
|
|
6023
6029
|
if (colors[i] != vec4(0,0,0,0)){
|
|
6024
6030
|
count++;
|
|
6025
6031
|
}
|
|
@@ -6031,7 +6037,7 @@ vec4 calcColor(float x) {
|
|
|
6031
6037
|
float perUnit = calcWidth() / float(calcCount());
|
|
6032
6038
|
int index = int(x / perUnit);
|
|
6033
6039
|
|
|
6034
|
-
for(int i=0; i<${
|
|
6040
|
+
for(int i=0; i<${oi}; i++){
|
|
6035
6041
|
if(i==index){
|
|
6036
6042
|
return colors[i];
|
|
6037
6043
|
}
|
|
@@ -6057,25 +6063,25 @@ void main(void) {
|
|
|
6057
6063
|
let t = this._color.toArray();
|
|
6058
6064
|
return t[3] = this.alpha, t;
|
|
6059
6065
|
});
|
|
6060
|
-
for (; t.length <
|
|
6066
|
+
for (; t.length < oi;) t.push([
|
|
6061
6067
|
0,
|
|
6062
6068
|
0,
|
|
6063
6069
|
0,
|
|
6064
6070
|
0
|
|
6065
6071
|
]);
|
|
6066
|
-
L.draw(e,
|
|
6072
|
+
L.draw(e, ai.material, {
|
|
6067
6073
|
sampler: 0,
|
|
6068
|
-
colors: t.slice(0,
|
|
6074
|
+
colors: t.slice(0, oi).flatMap((e) => e)
|
|
6069
6075
|
});
|
|
6070
6076
|
});
|
|
6071
6077
|
}
|
|
6072
6078
|
};
|
|
6073
|
-
k([_({ default: () => [] }), O("design:type", Array)],
|
|
6079
|
+
k([_({ default: () => [] }), O("design:type", Array)], si.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], si.prototype, "alpha", void 0), si = ai = k([x("ColorOverlayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], si);
|
|
6074
6080
|
//#endregion
|
|
6075
6081
|
//#region src/scene/effects/ColorRemoveEffect.ts
|
|
6076
|
-
var
|
|
6082
|
+
var ci, li = class extends W {
|
|
6077
6083
|
static {
|
|
6078
|
-
|
|
6084
|
+
ci = this;
|
|
6079
6085
|
}
|
|
6080
6086
|
static material = new I({ gl: {
|
|
6081
6087
|
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}",
|
|
@@ -6095,7 +6101,7 @@ var si, ci = class extends W {
|
|
|
6095
6101
|
r.slice(0, 50).forEach((e, t) => {
|
|
6096
6102
|
n[t * 3] = e[0], n[t * 3 + 1] = e[1], n[t * 3 + 2] = e[2];
|
|
6097
6103
|
}), t.redraw(e, () => {
|
|
6098
|
-
L.draw(e,
|
|
6104
|
+
L.draw(e, ci.material, {
|
|
6099
6105
|
sampler: 0,
|
|
6100
6106
|
epsilon: this.epsilon,
|
|
6101
6107
|
originalColors: n
|
|
@@ -6103,19 +6109,19 @@ var si, ci = class extends W {
|
|
|
6103
6109
|
});
|
|
6104
6110
|
}
|
|
6105
6111
|
};
|
|
6106
|
-
k([_({ default: () => [] }), O("design:type", Array)],
|
|
6112
|
+
k([_({ default: () => [] }), O("design:type", Array)], li.prototype, "colors", void 0), k([_({ fallback: .5 }), O("design:type", Number)], li.prototype, "epsilon", void 0), li = ci = k([x("ColorRemoveEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], li);
|
|
6107
6113
|
//#endregion
|
|
6108
6114
|
//#region src/scene/effects/ColorReplaceEffect.ts
|
|
6109
|
-
var
|
|
6115
|
+
var ui, di = 50, fi = class extends W {
|
|
6110
6116
|
static {
|
|
6111
|
-
|
|
6117
|
+
ui = this;
|
|
6112
6118
|
}
|
|
6113
6119
|
static material = new I({ gl: {
|
|
6114
6120
|
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}",
|
|
6115
6121
|
fragment: `varying vec2 vUv;
|
|
6116
6122
|
uniform sampler2D sampler;
|
|
6117
6123
|
uniform float epsilon;
|
|
6118
|
-
const int MAX_COLORS = ${
|
|
6124
|
+
const int MAX_COLORS = ${di};
|
|
6119
6125
|
uniform vec3 originalColors[MAX_COLORS];
|
|
6120
6126
|
uniform vec3 targetColors[MAX_COLORS];
|
|
6121
6127
|
|
|
@@ -6152,8 +6158,8 @@ void main(void) {
|
|
|
6152
6158
|
this._color.value = e[0];
|
|
6153
6159
|
let t = this._color.toArray().slice(0, 3);
|
|
6154
6160
|
return this._color.value = e[1], [t, this._color.toArray().slice(0, 3)];
|
|
6155
|
-
}), r = this.epsilon, i = new Float32Array(
|
|
6156
|
-
for (; n.length <
|
|
6161
|
+
}), r = this.epsilon, i = new Float32Array(di * 3), a = new Float32Array(di * 3);
|
|
6162
|
+
for (; n.length < di;) n.push([[
|
|
6157
6163
|
-1,
|
|
6158
6164
|
0,
|
|
6159
6165
|
0
|
|
@@ -6163,10 +6169,10 @@ void main(void) {
|
|
|
6163
6169
|
0,
|
|
6164
6170
|
1
|
|
6165
6171
|
]]);
|
|
6166
|
-
n.slice(0,
|
|
6172
|
+
n.slice(0, di).forEach(([e, t], n) => {
|
|
6167
6173
|
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];
|
|
6168
6174
|
}), t.redraw(e, () => {
|
|
6169
|
-
L.draw(e,
|
|
6175
|
+
L.draw(e, ui.material, {
|
|
6170
6176
|
sampler: 0,
|
|
6171
6177
|
epsilon: r,
|
|
6172
6178
|
originalColors: i,
|
|
@@ -6175,19 +6181,19 @@ void main(void) {
|
|
|
6175
6181
|
});
|
|
6176
6182
|
}
|
|
6177
6183
|
};
|
|
6178
|
-
k([_({ default: () => [] }), O("design:type", Array)],
|
|
6184
|
+
k([_({ default: () => [] }), O("design:type", Array)], fi.prototype, "colors", void 0), k([_({ fallback: .05 }), O("design:type", Number)], fi.prototype, "epsilon", void 0), fi = ui = k([x("ColorReplaceEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], fi);
|
|
6179
6185
|
//#endregion
|
|
6180
6186
|
//#region src/scene/effects/DrawboardEffect.frag?raw
|
|
6181
|
-
var
|
|
6187
|
+
var pi = "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;\n// 背景底纹颜色(明暗由主题解析后传入,引擎不再区分 dark 变体):\n// checkerboardColor —— 底色(网格底格 / 点阵底)\n// checkerboardDotColor —— 点色(点阵的圆点)\nuniform vec3 checkerboardColor;\nuniform vec3 checkerboardDotColor;\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\n// 远距淡出:缩放低于 DOT_FADE_END 起点阵开始渐隐,到 DOT_FADE_START 完全隐藏\n// (避免缩得很远时点糊成一片,Figma/FigJam/Miro 同法:点的可见度随 zoom 衰减)。\nconst float DOT_FADE_START = 0.04;\nconst float DOT_FADE_END = 0.10;\n\nconst int CHECKERBOARD_STYLE_NONE = 0;\nconst int CHECKERBOARD_STYLE_GRID = 1;\nconst int CHECKERBOARD_STYLE_DOTS = 2;\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 vec3 bg;\n if (checkerboardStyle == CHECKERBOARD_STYLE_GRID) {\n // 棋盘:两格用底色与其轻微压暗,保持细腻网格感(明暗全由 checkerboardColor 决定)。\n vec2 fractValue = fract(coord * vec2(gridScale) * zoom) - 0.5;\n bg = fractValue.x * fractValue.y < 0.0 ? checkerboardColor : checkerboardColor * 0.96;\n }\n else if (checkerboardStyle == CHECKERBOARD_STYLE_DOTS) {\n // 点阵:底色 checkerboardColor + 圆点 checkerboardDotColor(放大时按 dotColorDiff 提亮)。\n float zoomScale = zoom.x;\n float gridPixelSize = scaledGridSize(zoomScale);\n float zoomInterpolationFactor = smoothstep(0.5, 1.0, zoomScale);\n vec3 dotColor = checkerboardDotColor + vec3(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 // 远距淡出:zoomScale 越低点越淡,低于 DOT_FADE_START 完全隐去(回落到纯底色)。\n dist *= smoothstep(DOT_FADE_START, DOT_FADE_END, zoomScale);\n bg = mix(checkerboardColor, dotColor, dist);\n }\n else {\n bg = checkerboardColor;\n }\n return vec4(bg * (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", mi, q = class extends W {
|
|
6182
6188
|
static {
|
|
6183
|
-
|
|
6189
|
+
mi = this;
|
|
6184
6190
|
}
|
|
6185
6191
|
_watermark;
|
|
6186
6192
|
_color = new T("#f2f3f5");
|
|
6187
6193
|
_dotColor = new T("#c8ccd4");
|
|
6188
6194
|
static material = new I({ gl: {
|
|
6189
6195
|
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}",
|
|
6190
|
-
fragment:
|
|
6196
|
+
fragment: pi
|
|
6191
6197
|
} });
|
|
6192
6198
|
constructor(e, t = []) {
|
|
6193
6199
|
super(), this.setProperties(e).append(t);
|
|
@@ -6222,7 +6228,7 @@ var fi = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
6222
6228
|
t.redraw(e, () => {
|
|
6223
6229
|
this._watermark ? this._watermark.activate(e, 1) : e.texture.unbind(1);
|
|
6224
6230
|
let n = e.shader.uniforms.viewMatrix, r = this._watermark ? [this.watermarkWidth, this.watermarkWidth * this._watermark.height / this._watermark.width] : [0, 0], i = Math.max(r[0], r[1]), [a, o, s] = this._color.toArray(), [c, l, u] = this._dotColor.toArray();
|
|
6225
|
-
L.draw(e,
|
|
6231
|
+
L.draw(e, mi.material, {
|
|
6226
6232
|
uTexture: 0,
|
|
6227
6233
|
inputSize: [t.width, t.height],
|
|
6228
6234
|
zoom: [n[0], n[4]],
|
|
@@ -6254,20 +6260,20 @@ var fi = "precision highp float;\n\nin vec2 vUv;\nuniform sampler2D uTexture;\nu
|
|
|
6254
6260
|
});
|
|
6255
6261
|
}
|
|
6256
6262
|
};
|
|
6257
|
-
k([_({ fallback: !1 }), O("design:type", Boolean)], q.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], q.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], q.prototype, "pixelGrid", void 0), k([_({ fallback: "#f2f3f5" }), O("design:type", String)], q.prototype, "checkerboardColor", void 0), k([_({ fallback: "#c8ccd4" }), O("design:type", String)], q.prototype, "checkerboardDotColor", void 0), k([_({ fallback: .06 }), O("design:type", Number)], q.prototype, "dotColorDiff", void 0), k([_(), O("design:type", String)], q.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], q.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], q.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], q.prototype, "watermarkRotation", void 0), q =
|
|
6263
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], q.prototype, "checkerboard", void 0), k([_({ fallback: "grid" }), O("design:type", Object)], q.prototype, "checkerboardStyle", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], q.prototype, "pixelGrid", void 0), k([_({ fallback: "#f2f3f5" }), O("design:type", String)], q.prototype, "checkerboardColor", void 0), k([_({ fallback: "#c8ccd4" }), O("design:type", String)], q.prototype, "checkerboardDotColor", void 0), k([_({ fallback: .06 }), O("design:type", Number)], q.prototype, "dotColorDiff", void 0), k([_(), O("design:type", String)], q.prototype, "watermark", void 0), k([_({ fallback: 100 }), O("design:type", Number)], q.prototype, "watermarkWidth", void 0), k([_({ fallback: .05 }), O("design:type", Number)], q.prototype, "watermarkAlpha", void 0), k([_({ fallback: .5236 }), O("design:type", Number)], q.prototype, "watermarkRotation", void 0), q = mi = k([x("DrawboardEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], q);
|
|
6258
6264
|
//#endregion
|
|
6259
6265
|
//#region src/scene/effects/GaussianBlurEffect.ts
|
|
6260
|
-
var
|
|
6266
|
+
var hi, gi = "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}", _i = class extends W {
|
|
6261
6267
|
static {
|
|
6262
|
-
|
|
6268
|
+
hi = this;
|
|
6263
6269
|
}
|
|
6264
6270
|
static materialX = new I({ gl: {
|
|
6265
6271
|
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}",
|
|
6266
|
-
fragment:
|
|
6272
|
+
fragment: gi
|
|
6267
6273
|
} });
|
|
6268
6274
|
static materialY = new I({ gl: {
|
|
6269
6275
|
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}",
|
|
6270
|
-
fragment:
|
|
6276
|
+
fragment: gi
|
|
6271
6277
|
} });
|
|
6272
6278
|
constructor(e, t = []) {
|
|
6273
6279
|
super(), this.setProperties(e).append(t);
|
|
@@ -6275,31 +6281,31 @@ var mi, hi = "varying vec2 vUv[9];\nuniform sampler2D sampler;\n\nvoid main(void
|
|
|
6275
6281
|
apply(e, t) {
|
|
6276
6282
|
let n = 1 / t.width, r = 1 / t.height, i = Math.max(this.quality, 1);
|
|
6277
6283
|
for (let r = 0; r < i; r++) t.redraw(e, () => {
|
|
6278
|
-
L.draw(e,
|
|
6284
|
+
L.draw(e, hi.materialX, {
|
|
6279
6285
|
sampler: 0,
|
|
6280
6286
|
uStrength: n * (this.strength / i)
|
|
6281
6287
|
});
|
|
6282
6288
|
});
|
|
6283
6289
|
for (let n = 0; n < i; n++) t.redraw(e, () => {
|
|
6284
|
-
L.draw(e,
|
|
6290
|
+
L.draw(e, hi.materialY, {
|
|
6285
6291
|
sampler: 0,
|
|
6286
6292
|
uStrength: r * (this.strength / i)
|
|
6287
6293
|
});
|
|
6288
6294
|
});
|
|
6289
6295
|
}
|
|
6290
6296
|
};
|
|
6291
|
-
k([_({ fallback: 4 }), O("design:type", Number)],
|
|
6297
|
+
k([_({ fallback: 4 }), O("design:type", Number)], _i.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], _i.prototype, "quality", void 0), _i = hi = k([x("GaussianBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], _i);
|
|
6292
6298
|
//#endregion
|
|
6293
6299
|
//#region src/scene/effects/DropShadowEffect.ts
|
|
6294
|
-
var
|
|
6300
|
+
var vi, yi = class extends W {
|
|
6295
6301
|
static {
|
|
6296
|
-
|
|
6302
|
+
vi = this;
|
|
6297
6303
|
}
|
|
6298
6304
|
static material = new I({ gl: {
|
|
6299
6305
|
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}",
|
|
6300
6306
|
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}"
|
|
6301
6307
|
} });
|
|
6302
|
-
blurEffect = new
|
|
6308
|
+
blurEffect = new _i();
|
|
6303
6309
|
viewport3 = new U();
|
|
6304
6310
|
_color = new T();
|
|
6305
6311
|
constructor(e, t = []) {
|
|
@@ -6307,7 +6313,7 @@ var _i, vi = class extends W {
|
|
|
6307
6313
|
}
|
|
6308
6314
|
apply(e, t) {
|
|
6309
6315
|
this.viewport3.activateWithCopy(e, t), this.viewport3.redraw(e, () => {
|
|
6310
|
-
this._color.value = this.color, L.draw(e,
|
|
6316
|
+
this._color.value = this.color, L.draw(e, vi.material, {
|
|
6311
6317
|
sampler: 0,
|
|
6312
6318
|
uAlpha: this._color.a,
|
|
6313
6319
|
uColor: this._color.toArray().slice(0, 3),
|
|
@@ -6320,16 +6326,16 @@ var _i, vi = class extends W {
|
|
|
6320
6326
|
]
|
|
6321
6327
|
});
|
|
6322
6328
|
}), this.blurEffect.strength = this.blur, this.blurEffect.apply(e, this.viewport3), t.redraw(e, () => {
|
|
6323
|
-
this.viewport3.texture.activate(e, 1), L.draw(e,
|
|
6329
|
+
this.viewport3.texture.activate(e, 1), L.draw(e, mr.instance, { sampler: 1 }), this.shadowOnly || L.draw(e, mr.instance, { sampler: 0 }), e.texture.unbind(1);
|
|
6324
6330
|
});
|
|
6325
6331
|
}
|
|
6326
6332
|
};
|
|
6327
|
-
k([_({ fallback: "#000000FF" }), O("design:type", Object)],
|
|
6333
|
+
k([_({ fallback: "#000000FF" }), O("design:type", Object)], yi.prototype, "color", void 0), k([_({ fallback: 4 }), O("design:type", Number)], yi.prototype, "blur", void 0), k([_({ fallback: 4 }), O("design:type", Number)], yi.prototype, "offsetX", void 0), k([_({ fallback: 4 }), O("design:type", Number)], yi.prototype, "offsetY", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], yi.prototype, "shadowOnly", void 0), yi = vi = k([x("DropShadowEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], yi);
|
|
6328
6334
|
//#endregion
|
|
6329
6335
|
//#region src/scene/effects/EmbossEffect.ts
|
|
6330
|
-
var
|
|
6336
|
+
var bi, xi = class extends W {
|
|
6331
6337
|
static {
|
|
6332
|
-
|
|
6338
|
+
bi = this;
|
|
6333
6339
|
}
|
|
6334
6340
|
static material = new I({ gl: {
|
|
6335
6341
|
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}",
|
|
@@ -6340,7 +6346,7 @@ var yi, bi = class extends W {
|
|
|
6340
6346
|
}
|
|
6341
6347
|
apply(e, t) {
|
|
6342
6348
|
t.redraw(e, () => {
|
|
6343
|
-
L.draw(e,
|
|
6349
|
+
L.draw(e, bi.material, {
|
|
6344
6350
|
sampler: 0,
|
|
6345
6351
|
strength: this.strength,
|
|
6346
6352
|
inputSize: [
|
|
@@ -6353,12 +6359,12 @@ var yi, bi = class extends W {
|
|
|
6353
6359
|
});
|
|
6354
6360
|
}
|
|
6355
6361
|
};
|
|
6356
|
-
k([_({ fallback: 5 }), O("design:type", Number)],
|
|
6362
|
+
k([_({ fallback: 5 }), O("design:type", Number)], xi.prototype, "strength", void 0), xi = bi = k([x("EmbossEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], xi);
|
|
6357
6363
|
//#endregion
|
|
6358
6364
|
//#region src/scene/effects/GlitchEffect.ts
|
|
6359
|
-
var
|
|
6365
|
+
var Si, J = class extends W {
|
|
6360
6366
|
static {
|
|
6361
|
-
|
|
6367
|
+
Si = this;
|
|
6362
6368
|
}
|
|
6363
6369
|
static material = new I({ gl: {
|
|
6364
6370
|
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}",
|
|
@@ -6390,7 +6396,7 @@ var xi, J = class extends W {
|
|
|
6390
6396
|
this._needsRedraw || (this._needsRedraw = !0, this.redraw());
|
|
6391
6397
|
let n = t.width, r = t.height, i = this.direction * (Math.PI / 180), a = Math.sin(i), o = Math.cos(i);
|
|
6392
6398
|
t.redraw(e, () => {
|
|
6393
|
-
this._texture.activate(e, 1), L.draw(e,
|
|
6399
|
+
this._texture.activate(e, 1), L.draw(e, Si.material, {
|
|
6394
6400
|
sampler: 0,
|
|
6395
6401
|
filterClamp: [
|
|
6396
6402
|
0,
|
|
@@ -6419,12 +6425,12 @@ var xi, J = class extends W {
|
|
|
6419
6425
|
});
|
|
6420
6426
|
}
|
|
6421
6427
|
};
|
|
6422
|
-
k([_({ fallback: 10 }), O("design:type", Number)], J.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], J.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], J.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], J.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], J.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], J.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], J.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], J.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], J.prototype, "blue", void 0), J =
|
|
6428
|
+
k([_({ fallback: 10 }), O("design:type", Number)], J.prototype, "slices", void 0), k([_({ fallback: 512 }), O("design:type", Number)], J.prototype, "sampleSize", void 0), k([_({ fallback: 100 }), O("design:type", Number)], J.prototype, "offset", void 0), k([_({ fallback: 0 }), O("design:type", Number)], J.prototype, "direction", void 0), k([_({ fallback: 2 }), O("design:type", Number)], J.prototype, "fillMode", void 0), k([_({ fallback: 0 }), O("design:type", Number)], J.prototype, "seed", void 0), k([_({ default: () => [2, 2] }), O("design:type", Array)], J.prototype, "red", void 0), k([_({ default: () => [-10, 4] }), O("design:type", Array)], J.prototype, "green", void 0), k([_({ default: () => [10, -4] }), O("design:type", Array)], J.prototype, "blue", void 0), J = Si = k([x("GlitchEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], J);
|
|
6423
6429
|
//#endregion
|
|
6424
6430
|
//#region src/scene/effects/GodrayEffect.ts
|
|
6425
|
-
var
|
|
6431
|
+
var Ci, wi = "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}", Ti = class extends W {
|
|
6426
6432
|
static {
|
|
6427
|
-
|
|
6433
|
+
Ci = this;
|
|
6428
6434
|
}
|
|
6429
6435
|
static material = new I({ gl: {
|
|
6430
6436
|
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}",
|
|
@@ -6439,7 +6445,7 @@ uniform float uTime;
|
|
|
6439
6445
|
uniform vec3 uRay;
|
|
6440
6446
|
uniform vec4 uInputSize;
|
|
6441
6447
|
|
|
6442
|
-
${
|
|
6448
|
+
${wi}
|
|
6443
6449
|
|
|
6444
6450
|
void main(void) {
|
|
6445
6451
|
bool uParallel = uParallel > 0.5;
|
|
@@ -6478,7 +6484,7 @@ void main(void) {
|
|
|
6478
6484
|
apply(e, t) {
|
|
6479
6485
|
let n = this.angle * (Math.PI / 180), r = this.parallel ? [Math.cos(n), Math.sin(n)] : this.center;
|
|
6480
6486
|
t.redraw(e, () => {
|
|
6481
|
-
L.draw(e,
|
|
6487
|
+
L.draw(e, Ci.material, {
|
|
6482
6488
|
sampler: 0,
|
|
6483
6489
|
uDimensions: [t.width, t.height],
|
|
6484
6490
|
uParallel: +!!this.parallel,
|
|
@@ -6500,15 +6506,15 @@ void main(void) {
|
|
|
6500
6506
|
});
|
|
6501
6507
|
}
|
|
6502
6508
|
};
|
|
6503
|
-
k([_({ fallback: 0 }), O("design:type", Number)],
|
|
6509
|
+
k([_({ fallback: 0 }), O("design:type", Number)], Ti.prototype, "time", void 0), k([_({ fallback: 30 }), O("design:type", Number)], Ti.prototype, "angle", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ti.prototype, "gain", void 0), k([_({ fallback: 2.5 }), O("design:type", Number)], Ti.prototype, "lacunarity", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], Ti.prototype, "parallel", void 0), k([_({ default: () => [0, 0] }), O("design:type", Array)], Ti.prototype, "center", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Ti.prototype, "alpha", void 0), Ti = Ci = k([x("GodrayEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ti);
|
|
6504
6510
|
//#endregion
|
|
6505
6511
|
//#region src/scene/effects/KawaseBlurEffect.ts
|
|
6506
|
-
var
|
|
6512
|
+
var Ei = "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}", Di = "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}", Oi = class extends W {
|
|
6507
6513
|
_kernels = [0];
|
|
6508
6514
|
constructor(e, t = []) {
|
|
6509
6515
|
super(), this.material = new I({ gl: {
|
|
6510
6516
|
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}",
|
|
6511
|
-
fragment: e?.clamp ?
|
|
6517
|
+
fragment: e?.clamp ? Di : Ei
|
|
6512
6518
|
} }), this.setProperties(e).append(t), this._generateKernels();
|
|
6513
6519
|
}
|
|
6514
6520
|
_updateProperty(e, t, n) {
|
|
@@ -6546,12 +6552,12 @@ var Ti = "varying vec2 vUv;\nuniform sampler2D sampler;\nuniform vec2 uOffset;\n
|
|
|
6546
6552
|
});
|
|
6547
6553
|
}
|
|
6548
6554
|
};
|
|
6549
|
-
k([_({ fallback: 4 }), O("design:type", Number)],
|
|
6555
|
+
k([_({ fallback: 4 }), O("design:type", Number)], Oi.prototype, "strength", void 0), k([_({ fallback: 3 }), O("design:type", Number)], Oi.prototype, "quality", void 0), k([_({ default: () => [1, 1] }), O("design:type", Array)], Oi.prototype, "pixelSize", void 0), Oi = k([x("KawaseBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Oi);
|
|
6550
6556
|
//#endregion
|
|
6551
6557
|
//#region src/scene/effects/MaskEffect.ts
|
|
6552
|
-
var
|
|
6558
|
+
var ki, Ai = class extends W {
|
|
6553
6559
|
static {
|
|
6554
|
-
|
|
6560
|
+
ki = this;
|
|
6555
6561
|
}
|
|
6556
6562
|
static material = new I({ gl: {
|
|
6557
6563
|
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}",
|
|
@@ -6573,7 +6579,7 @@ var Oi, ki = class extends W {
|
|
|
6573
6579
|
}
|
|
6574
6580
|
apply(e, t, n) {
|
|
6575
6581
|
this.texture && t.redraw(e, () => {
|
|
6576
|
-
this.texture.activate(e, 1), L.draw(e,
|
|
6582
|
+
this.texture.activate(e, 1), L.draw(e, ki.material, {
|
|
6577
6583
|
sampler: 0,
|
|
6578
6584
|
mask: 1,
|
|
6579
6585
|
rotation: n.target?.globalRotation ?? 0
|
|
@@ -6581,23 +6587,23 @@ var Oi, ki = class extends W {
|
|
|
6581
6587
|
});
|
|
6582
6588
|
}
|
|
6583
6589
|
};
|
|
6584
|
-
k([_({ fallback: "" }), O("design:type", String)],
|
|
6590
|
+
k([_({ fallback: "" }), O("design:type", String)], Ai.prototype, "image", void 0), Ai = ki = k([x("MaskEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ai);
|
|
6585
6591
|
//#endregion
|
|
6586
6592
|
//#region src/scene/effects/OutlineEffect.ts
|
|
6587
|
-
var
|
|
6593
|
+
var ji, Mi = "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}", Ni = class extends W {
|
|
6588
6594
|
static {
|
|
6589
|
-
|
|
6595
|
+
ji = this;
|
|
6590
6596
|
}
|
|
6591
6597
|
static MIN_SAMPLES = 1;
|
|
6592
6598
|
static MAX_SAMPLES = 100;
|
|
6593
6599
|
static getAngleStep(e) {
|
|
6594
|
-
return Number.parseFloat((Math.PI * 2 / Math.max(e *
|
|
6600
|
+
return Number.parseFloat((Math.PI * 2 / Math.max(e * ji.MAX_SAMPLES, ji.MIN_SAMPLES)).toFixed(7));
|
|
6595
6601
|
}
|
|
6596
6602
|
_color = new T();
|
|
6597
6603
|
constructor(e, t = []) {
|
|
6598
6604
|
super(), this.setProperties(e).append(t), this.material = new I({ gl: {
|
|
6599
6605
|
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}",
|
|
6600
|
-
fragment:
|
|
6606
|
+
fragment: Mi.replace(/\{ANGLE_STEP\}/, ji.getAngleStep(this.quality).toFixed(7))
|
|
6601
6607
|
} });
|
|
6602
6608
|
}
|
|
6603
6609
|
apply(e, t) {
|
|
@@ -6607,7 +6613,7 @@ var Ai, ji = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6607
6613
|
uThickness: [this.width / t.width, this.width / t.height],
|
|
6608
6614
|
uColor: this._color.toArray().slice(0, 3),
|
|
6609
6615
|
uAlpha: this.opacity === 1 ? this._color.a : this.opacity,
|
|
6610
|
-
uAngleStep:
|
|
6616
|
+
uAngleStep: ji.getAngleStep(this.quality),
|
|
6611
6617
|
uKnockout: +!!this.knockout,
|
|
6612
6618
|
uInputClamp: [
|
|
6613
6619
|
0,
|
|
@@ -6619,12 +6625,12 @@ var Ai, ji = "precision highp float;\nvarying vec2 vUv;\nuniform sampler2D sampl
|
|
|
6619
6625
|
});
|
|
6620
6626
|
}
|
|
6621
6627
|
};
|
|
6622
|
-
k([_({ fallback: "#000000ff" }), O("design:type", Object)],
|
|
6628
|
+
k([_({ fallback: "#000000ff" }), O("design:type", Object)], Ni.prototype, "color", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Ni.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", String)], Ni.prototype, "style", void 0), k([_(), O("design:type", Object)], Ni.prototype, "image", void 0), k([_({ fallback: 1 }), O("design:type", Number)], Ni.prototype, "opacity", void 0), k([_({ fallback: .1 }), O("design:type", Number)], Ni.prototype, "quality", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], Ni.prototype, "knockout", void 0), Ni = ji = k([x("OutlineEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ni);
|
|
6623
6629
|
//#endregion
|
|
6624
6630
|
//#region src/scene/effects/PixelateEffect.ts
|
|
6625
|
-
var
|
|
6631
|
+
var Pi, Fi = class extends W {
|
|
6626
6632
|
static {
|
|
6627
|
-
|
|
6633
|
+
Pi = this;
|
|
6628
6634
|
}
|
|
6629
6635
|
static material = new I({ gl: {
|
|
6630
6636
|
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}",
|
|
@@ -6640,16 +6646,16 @@ var Ni, Pi = class extends W {
|
|
|
6640
6646
|
offset: [(r[0] + i[0]) / t.width, 1 - (r[1] + i[1]) / t.height],
|
|
6641
6647
|
step: [this.strength * r[0] / t.width, this.strength * r[1] / t.height]
|
|
6642
6648
|
};
|
|
6643
|
-
L.draw(e,
|
|
6649
|
+
L.draw(e, Pi.material, a);
|
|
6644
6650
|
});
|
|
6645
6651
|
}
|
|
6646
6652
|
};
|
|
6647
|
-
k([_({ fallback: 10 }), O("design:type", Number)],
|
|
6653
|
+
k([_({ fallback: 10 }), O("design:type", Number)], Fi.prototype, "strength", void 0), Fi = Pi = k([x("PixelateEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Fi);
|
|
6648
6654
|
//#endregion
|
|
6649
6655
|
//#region src/scene/effects/ZoomBlurEffect.ts
|
|
6650
|
-
var
|
|
6656
|
+
var Ii, Li = class extends W {
|
|
6651
6657
|
static {
|
|
6652
|
-
|
|
6658
|
+
Ii = this;
|
|
6653
6659
|
}
|
|
6654
6660
|
static material = new I({ gl: {
|
|
6655
6661
|
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}",
|
|
@@ -6660,7 +6666,7 @@ var Fi, Ii = class extends W {
|
|
|
6660
6666
|
}
|
|
6661
6667
|
apply(e, t) {
|
|
6662
6668
|
t.redraw(e, () => {
|
|
6663
|
-
L.draw(e,
|
|
6669
|
+
L.draw(e, Ii.material, {
|
|
6664
6670
|
sampler: 0,
|
|
6665
6671
|
uCenter: [t.width / 2, t.height / 2],
|
|
6666
6672
|
uInnerRadius: this.innerRadius,
|
|
@@ -6676,10 +6682,10 @@ var Fi, Ii = class extends W {
|
|
|
6676
6682
|
});
|
|
6677
6683
|
}
|
|
6678
6684
|
};
|
|
6679
|
-
k([_(), O("design:type", Array)],
|
|
6685
|
+
k([_(), O("design:type", Array)], Li.prototype, "center", void 0), k([_({ fallback: 20 }), O("design:type", Number)], Li.prototype, "innerRadius", void 0), k([_({ fallback: -1 }), O("design:type", Number)], Li.prototype, "radius", void 0), k([_({ fallback: .1 }), O("design:type", Number)], Li.prototype, "strength", void 0), Li = Ii = k([x("ZoomBlurEffect"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Li);
|
|
6680
6686
|
//#endregion
|
|
6681
6687
|
//#region src/scene/2d/element/utils.ts
|
|
6682
|
-
function
|
|
6688
|
+
function Ri(e, t) {
|
|
6683
6689
|
let { x: n, y: r, width: i, height: a } = t, o = !1, s = new v().translate(-n, -r).scale(1 / i, 1 / a);
|
|
6684
6690
|
if (e.cropRect) {
|
|
6685
6691
|
let { left: t = 0, top: n = 0, right: r = 0, bottom: i = 0 } = e.cropRect;
|
|
@@ -6735,7 +6741,7 @@ var Y = class extends w {
|
|
|
6735
6741
|
}
|
|
6736
6742
|
}
|
|
6737
6743
|
async loadTexture() {
|
|
6738
|
-
if (this.linearGradient || this.radialGradient) this.texture = new
|
|
6744
|
+
if (this.linearGradient || this.radialGradient) this.texture = new Sr(this.linearGradient ?? this.radialGradient, Math.floor(this._parent.size.width), Math.floor(this._parent.size.height));
|
|
6739
6745
|
else if (d(this.image)) this.animatedTexture = void 0, this.texture = void 0;
|
|
6740
6746
|
else if (this._parent.tree?.log(`load image ${this.image}`), this.image !== "viewport") {
|
|
6741
6747
|
let e = this.image.split("?")[0].endsWith(".gif"), t = this.image, n = await $.loadBy(t, async () => {
|
|
@@ -6792,12 +6798,12 @@ var Y = class extends w {
|
|
|
6792
6798
|
width: e,
|
|
6793
6799
|
height: t
|
|
6794
6800
|
} };
|
|
6795
|
-
if (this.image === "viewport") n.fillStyle = new
|
|
6801
|
+
if (this.image === "viewport") n.fillStyle = new Er();
|
|
6796
6802
|
else {
|
|
6797
6803
|
let i = this.animatedTexture?.currentFrame.texture ?? this.texture;
|
|
6798
6804
|
r = {
|
|
6799
6805
|
...r,
|
|
6800
|
-
...
|
|
6806
|
+
...Ri(this, this.tile && i ? {
|
|
6801
6807
|
x: 0,
|
|
6802
6808
|
y: 0,
|
|
6803
6809
|
width: i.sourceWidth,
|
|
@@ -6836,7 +6842,7 @@ var Y = class extends w {
|
|
|
6836
6842
|
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), k([_(), O("design:type", Object)], Y.prototype, "imagePipelines", void 0);
|
|
6837
6843
|
//#endregion
|
|
6838
6844
|
//#region src/scene/2d/element/Element2DBackground.ts
|
|
6839
|
-
var
|
|
6845
|
+
var zi = class extends Y {
|
|
6840
6846
|
setProperties(e) {
|
|
6841
6847
|
return super._setProperties(d(e) ? void 0 : f(e));
|
|
6842
6848
|
}
|
|
@@ -6848,14 +6854,14 @@ var Ri = class extends Y {
|
|
|
6848
6854
|
}
|
|
6849
6855
|
}
|
|
6850
6856
|
};
|
|
6851
|
-
k([_(), O("design:type", Object)],
|
|
6857
|
+
k([_(), O("design:type", Object)], zi.prototype, "fillWithShape", void 0);
|
|
6852
6858
|
//#endregion
|
|
6853
6859
|
//#region src/scene/2d/element/Element2DChart.ts
|
|
6854
|
-
var
|
|
6855
|
-
function
|
|
6856
|
-
return
|
|
6860
|
+
var Bi;
|
|
6861
|
+
function Vi() {
|
|
6862
|
+
return Bi ||= import("echarts").then((e) => e?.init ? e : e?.default).catch(() => void 0), Bi;
|
|
6857
6863
|
}
|
|
6858
|
-
function
|
|
6864
|
+
function Hi(e) {
|
|
6859
6865
|
if (!e) return { show: !1 };
|
|
6860
6866
|
switch (e) {
|
|
6861
6867
|
case "bottom": return {
|
|
@@ -6878,7 +6884,7 @@ function Vi(e) {
|
|
|
6878
6884
|
};
|
|
6879
6885
|
}
|
|
6880
6886
|
}
|
|
6881
|
-
var
|
|
6887
|
+
var Ui = class extends w {
|
|
6882
6888
|
_parent;
|
|
6883
6889
|
_instance;
|
|
6884
6890
|
_container;
|
|
@@ -6921,7 +6927,7 @@ var Hi = class extends w {
|
|
|
6921
6927
|
this._teardown(), this._parent.requestDraw();
|
|
6922
6928
|
return;
|
|
6923
6929
|
}
|
|
6924
|
-
let n = await
|
|
6930
|
+
let n = await Vi();
|
|
6925
6931
|
if (!n) {
|
|
6926
6932
|
console.warn("[modern-canvas] chart rendering requires the optional \"echarts\" dependency (e.g. `pnpm add echarts`)"), this._renderPlaceholder(e, t);
|
|
6927
6933
|
return;
|
|
@@ -6946,7 +6952,7 @@ var Hi = class extends w {
|
|
|
6946
6952
|
}), this._instance.setOption(this._toOption(), !0), !this._texture) {
|
|
6947
6953
|
let e = this._container.querySelector("canvas");
|
|
6948
6954
|
if (!e) return;
|
|
6949
|
-
this._texture = new
|
|
6955
|
+
this._texture = new _r({
|
|
6950
6956
|
source: e,
|
|
6951
6957
|
pixelRatio: 1
|
|
6952
6958
|
});
|
|
@@ -6959,7 +6965,7 @@ var Hi = class extends w {
|
|
|
6959
6965
|
let n = document.createElement("canvas");
|
|
6960
6966
|
n.width = Math.ceil(e), n.height = Math.ceil(t);
|
|
6961
6967
|
let r = n.getContext("2d");
|
|
6962
|
-
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
|
|
6968
|
+
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 _r({
|
|
6963
6969
|
source: n,
|
|
6964
6970
|
pixelRatio: 1
|
|
6965
6971
|
}), this._texture.requestUpdate("source"), this._parent.requestDraw());
|
|
@@ -6980,7 +6986,7 @@ var Hi = class extends w {
|
|
|
6980
6986
|
text: this.title,
|
|
6981
6987
|
left: "center"
|
|
6982
6988
|
} : void 0,
|
|
6983
|
-
legend:
|
|
6989
|
+
legend: Hi(this.legend),
|
|
6984
6990
|
tooltip: {}
|
|
6985
6991
|
};
|
|
6986
6992
|
if (n) {
|
|
@@ -7024,10 +7030,10 @@ var Hi = class extends w {
|
|
|
7024
7030
|
this._teardown();
|
|
7025
7031
|
}
|
|
7026
7032
|
};
|
|
7027
|
-
k([_({ fallback: !0 }), O("design:type", Boolean)],
|
|
7033
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Ui.prototype, "enabled", void 0), k([_({ fallback: "column" }), O("design:type", Object)], Ui.prototype, "type", void 0), k([_(), O("design:type", Object)], Ui.prototype, "grouping", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ui.prototype, "categories", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], Ui.prototype, "series", void 0), k([_(), O("design:type", Object)], Ui.prototype, "title", void 0), k([_(), O("design:type", Object)], Ui.prototype, "legend", void 0), k([_(), O("design:type", Object)], Ui.prototype, "categoryAxis", void 0), k([_(), O("design:type", Object)], Ui.prototype, "valueAxis", void 0);
|
|
7028
7034
|
//#endregion
|
|
7029
7035
|
//#region src/scene/2d/element/Element2DComments.ts
|
|
7030
|
-
var
|
|
7036
|
+
var Wi = class extends w {
|
|
7031
7037
|
parent;
|
|
7032
7038
|
constructor(e) {
|
|
7033
7039
|
super(), this.parent = e;
|
|
@@ -7061,12 +7067,12 @@ var Ui = class extends w {
|
|
|
7061
7067
|
isValid() {
|
|
7062
7068
|
return Object.values(this._properties).some(Boolean);
|
|
7063
7069
|
}
|
|
7064
|
-
},
|
|
7070
|
+
}, Gi = 8, Ki = class extends w {
|
|
7065
7071
|
_parent;
|
|
7066
7072
|
_routeSig;
|
|
7067
7073
|
_routePath;
|
|
7068
7074
|
_keyTargets = [void 0, void 0];
|
|
7069
|
-
_routeKey = Array.from({ length:
|
|
7075
|
+
_routeKey = Array.from({ length: Gi * 2 }, () => NaN);
|
|
7070
7076
|
_keyMode;
|
|
7071
7077
|
_keyAnchors = [
|
|
7072
7078
|
void 0,
|
|
@@ -7122,14 +7128,14 @@ var Ui = class extends w {
|
|
|
7122
7128
|
_writeKey(e, t) {
|
|
7123
7129
|
let n = this._routeKey;
|
|
7124
7130
|
if (!e) {
|
|
7125
|
-
n.fill(-1, t, t +
|
|
7131
|
+
n.fill(-1, t, t + Gi);
|
|
7126
7132
|
return;
|
|
7127
7133
|
}
|
|
7128
7134
|
let r = e.globalAabb;
|
|
7129
7135
|
n[t] = e.transformDirtyId ?? -1, n[t + 1] = e.size?.x ?? -1, n[t + 2] = e.size?.y ?? -1, n[t + 3] = e.shape?.connectionPointsDirtyId ?? -1, n[t + 4] = r?.min.x ?? -1, n[t + 5] = r?.min.y ?? -1, n[t + 6] = r?.size.x ?? -1, n[t + 7] = r?.size.y ?? -1;
|
|
7130
7136
|
}
|
|
7131
7137
|
_storeKey(e, t) {
|
|
7132
|
-
this._writeKey(e, 0), this._writeKey(t,
|
|
7138
|
+
this._writeKey(e, 0), this._writeKey(t, Gi), this._keyTargets[0] = e, this._keyTargets[1] = t, this._keyMode = this.mode, this._keyAnchors[0] = this.start?.id, this._keyAnchors[1] = this.start?.idx, this._keyAnchors[2] = this.end?.id, this._keyAnchors[3] = this.end?.idx, this._keyRevision = dt(), this._keyValid = !0;
|
|
7133
7139
|
}
|
|
7134
7140
|
resolveAnchor(e) {
|
|
7135
7141
|
return this.resolveEndpoint(e)?.point;
|
|
@@ -7150,12 +7156,12 @@ var Ui = class extends w {
|
|
|
7150
7156
|
let n = t.shape.connectionPoints?.find((t) => t.idx === e.idx);
|
|
7151
7157
|
if (n) {
|
|
7152
7158
|
let e = t.globalTransform.apply(new y(n.x * t.size.x, n.y * t.size.y)), i;
|
|
7153
|
-
return i = n.ang === void 0 ?
|
|
7159
|
+
return i = n.ang === void 0 ? Kr(n.x - .5, n.y - .5) : {
|
|
7154
7160
|
x: Math.cos(n.ang),
|
|
7155
7161
|
y: Math.sin(n.ang)
|
|
7156
7162
|
}, {
|
|
7157
7163
|
point: e,
|
|
7158
|
-
dir:
|
|
7164
|
+
dir: qi(i, t.globalRotation),
|
|
7159
7165
|
bbox: r
|
|
7160
7166
|
};
|
|
7161
7167
|
}
|
|
@@ -7175,18 +7181,18 @@ var Ui = class extends w {
|
|
|
7175
7181
|
if (this._keyValid && this._keyRevision === dt() && this._anchorsMatch()) return this._routePath;
|
|
7176
7182
|
this._refreshTargets();
|
|
7177
7183
|
let e = this._startTarget, t = this._endTarget;
|
|
7178
|
-
if (this._keyValid && this._anchorsMatch() && e === this._keyTargets[0] && t === this._keyTargets[1] && this._keyMatches(e, 0) && this._keyMatches(t,
|
|
7184
|
+
if (this._keyValid && this._anchorsMatch() && e === this._keyTargets[0] && t === this._keyTargets[1] && this._keyMatches(e, 0) && this._keyMatches(t, Gi)) return this._keyRevision = dt(), this._routePath;
|
|
7179
7185
|
let n = this.resolveEndpoint(this.start, e), r = this.resolveEndpoint(this.end, t);
|
|
7180
7186
|
if (this._storeKey(e, t), !n && !r) {
|
|
7181
7187
|
this._routeSig = void 0, this._routePath = void 0;
|
|
7182
7188
|
return;
|
|
7183
7189
|
}
|
|
7184
7190
|
let i = (e) => e ? `${e.point.x},${e.point.y},${e.dir?.x ?? ""},${e.dir?.y ?? ""}` : "-", a = `${this.mode}|${i(n)}|${i(r)}`;
|
|
7185
|
-
return (a !== this._routeSig || !this._routePath) && (this._routeSig = a, this._routePath =
|
|
7191
|
+
return (a !== this._routeSig || !this._routePath) && (this._routeSig = a, this._routePath = qr(this.mode, n ?? r, r ?? n)), this._routePath;
|
|
7186
7192
|
}
|
|
7187
7193
|
};
|
|
7188
|
-
k([_(), O("design:type", Object)],
|
|
7189
|
-
function
|
|
7194
|
+
k([_(), O("design:type", Object)], Ki.prototype, "start", void 0), k([_(), O("design:type", Object)], Ki.prototype, "end", void 0), k([_({ fallback: "straight" }), O("design:type", Object)], Ki.prototype, "mode", void 0), k([_({ fallback: .5 }), O("design:type", Number)], Ki.prototype, "labelPosition", void 0);
|
|
7195
|
+
function qi(e, t) {
|
|
7190
7196
|
if (!t) return e;
|
|
7191
7197
|
let n = Math.cos(t), r = Math.sin(t);
|
|
7192
7198
|
return {
|
|
@@ -7196,7 +7202,7 @@ function Ki(e, t) {
|
|
|
7196
7202
|
}
|
|
7197
7203
|
//#endregion
|
|
7198
7204
|
//#region src/scene/2d/element/Element2DForeground.ts
|
|
7199
|
-
var
|
|
7205
|
+
var Ji = class extends Y {
|
|
7200
7206
|
setProperties(e) {
|
|
7201
7207
|
return super._setProperties(d(e) ? void 0 : ee(e));
|
|
7202
7208
|
}
|
|
@@ -7204,14 +7210,14 @@ var qi = class extends Y {
|
|
|
7204
7210
|
super._updateProperty(e, t, n), e === "fillWithShape" && this._parent.requestDraw();
|
|
7205
7211
|
}
|
|
7206
7212
|
};
|
|
7207
|
-
k([_(), O("design:type", Object)],
|
|
7213
|
+
k([_(), O("design:type", Object)], Ji.prototype, "fillWithShape", void 0);
|
|
7208
7214
|
//#endregion
|
|
7209
7215
|
//#region src/scene/2d/element/Element2DOutline.ts
|
|
7210
|
-
var
|
|
7216
|
+
var Yi = {
|
|
7211
7217
|
sm: 4,
|
|
7212
7218
|
md: 6,
|
|
7213
7219
|
lg: 8
|
|
7214
|
-
},
|
|
7220
|
+
}, Xi = class extends Y {
|
|
7215
7221
|
setProperties(e) {
|
|
7216
7222
|
return super._setProperties(d(e) ? void 0 : te(e));
|
|
7217
7223
|
}
|
|
@@ -7238,7 +7244,7 @@ var Ji = {
|
|
|
7238
7244
|
}
|
|
7239
7245
|
draw() {
|
|
7240
7246
|
let { width: e, height: t } = this._parent.size, n = this._parent.context;
|
|
7241
|
-
this.image === "viewport" ? n.strokeStyle = new
|
|
7247
|
+
this.image === "viewport" ? n.strokeStyle = new Er() : n.strokeStyle = this.texture ?? this._resolveThemeColor(this.color) ?? "#000000FF", n.lineWidth = (this.width || 1) * (this.widthBoost || 1), n.lineCap = this.lineCap, n.lineJoin = this.lineJoin, n.lineFlow = this.flow, n.stroke({ ...Ri(this, {
|
|
7242
7248
|
x: 0,
|
|
7243
7249
|
y: 0,
|
|
7244
7250
|
width: e,
|
|
@@ -7261,7 +7267,7 @@ var Ji = {
|
|
|
7261
7267
|
_fillEnd(e, t, n, r, i) {
|
|
7262
7268
|
let a = e.x - t.x, o = e.y - t.y, s = Math.hypot(a, o);
|
|
7263
7269
|
if (s < .001) return;
|
|
7264
|
-
let c = a / s, l = o / s, u =
|
|
7270
|
+
let c = a / s, l = o / s, u = Yi[String(n.width ?? n.height ?? "md")] ?? 6, d = this._parent.context, f = this._resolveThemeColor(n.color) ?? i;
|
|
7265
7271
|
if (n.type === "bar") {
|
|
7266
7272
|
let t = r * u * .6, n = Math.max(r * .9, 1.5), i = 0, a = 0;
|
|
7267
7273
|
Math.abs(c) >= Math.abs(l) ? i = Math.sign(c) || 1 : a = Math.sign(l) || 1;
|
|
@@ -7273,10 +7279,10 @@ var Ji = {
|
|
|
7273
7279
|
d.fillStyle = f, d.moveTo(e.x, e.y).lineTo(h + ee, g + te).lineTo(h - ee, g - te).closePath().fill();
|
|
7274
7280
|
}
|
|
7275
7281
|
};
|
|
7276
|
-
k([_(), O("design:type", Object)],
|
|
7282
|
+
k([_(), O("design:type", Object)], Xi.prototype, "color", void 0), k([_(), O("design:type", Object)], Xi.prototype, "width", void 0), k([_({ fallback: "solid" }), O("design:type", Object)], Xi.prototype, "style", void 0), k([_({ fallback: "butt" }), O("design:type", Object)], Xi.prototype, "lineCap", void 0), k([_({ fallback: "miter" }), O("design:type", Object)], Xi.prototype, "lineJoin", void 0), k([_(), O("design:type", Object)], Xi.prototype, "headEnd", void 0), k([_(), O("design:type", Object)], Xi.prototype, "tailEnd", void 0), k([_({ internal: !0 }), O("design:type", Number)], Xi.prototype, "flow", void 0), k([_({ internal: !0 }), O("design:type", Number)], Xi.prototype, "widthBoost", void 0);
|
|
7277
7283
|
//#endregion
|
|
7278
7284
|
//#region src/scene/2d/element/Element2DShadow.ts
|
|
7279
|
-
var
|
|
7285
|
+
var Zi = class extends w {
|
|
7280
7286
|
_parent;
|
|
7281
7287
|
constructor(e) {
|
|
7282
7288
|
super(), this._parent = e;
|
|
@@ -7297,13 +7303,13 @@ var Xi = class extends w {
|
|
|
7297
7303
|
}
|
|
7298
7304
|
updateEffect() {
|
|
7299
7305
|
let e = "__$shadow", t = this._parent.getNode(e);
|
|
7300
|
-
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new
|
|
7306
|
+
this.enabled && (this.blur || this.offsetX || this.offsetY) ? (t || (t = new yi({ name: e }), this._parent.appendChild(t, "back")), t.setProperties(this.getProperties())) : t && this._parent.removeChild(t);
|
|
7301
7307
|
}
|
|
7302
7308
|
};
|
|
7303
|
-
k([_({ fallback: !0 }), O("design:type", Boolean)],
|
|
7309
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Zi.prototype, "enabled", void 0), k([_({ fallback: "#000000FF" }), O("design:type", Object)], Zi.prototype, "color", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Zi.prototype, "blur", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Zi.prototype, "offsetY", void 0), k([_({ fallback: 0 }), O("design:type", Object)], Zi.prototype, "offsetX", void 0);
|
|
7304
7310
|
//#endregion
|
|
7305
7311
|
//#region src/scene/2d/element/Element2DShape.ts
|
|
7306
|
-
var
|
|
7312
|
+
var Qi = class extends w {
|
|
7307
7313
|
_parent;
|
|
7308
7314
|
connectionPointsDirtyId = 0;
|
|
7309
7315
|
_path2DSet = new de();
|
|
@@ -7406,24 +7412,24 @@ var Zi = class extends w {
|
|
|
7406
7412
|
t && n && (r ? e.roundRect(0, 0, t, n, r) : e.rect(0, 0, t, n));
|
|
7407
7413
|
}
|
|
7408
7414
|
};
|
|
7409
|
-
k([_({ fallback: !0 }), O("design:type", Boolean)],
|
|
7415
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], Qi.prototype, "enabled", void 0), k([_(), O("design:type", Object)], Qi.prototype, "preset", void 0), k([_(), O("design:type", Object)], Qi.prototype, "svg", void 0), k([_(), O("design:type", Object)], Qi.prototype, "viewBox", void 0), k([_(), O("design:type", Object)], Qi.prototype, "paths", void 0), k([_(), O("design:type", Object)], Qi.prototype, "connectionPoints", void 0);
|
|
7410
7416
|
//#endregion
|
|
7411
7417
|
//#region src/scene/2d/element/Element2DStyle.ts
|
|
7412
|
-
var
|
|
7418
|
+
var $i = class extends Ct {
|
|
7413
7419
|
constructor(e) {
|
|
7414
7420
|
super(), this.setProperties(e);
|
|
7415
7421
|
}
|
|
7416
|
-
},
|
|
7422
|
+
}, ea = {
|
|
7417
7423
|
...o(),
|
|
7418
7424
|
left: 0,
|
|
7419
7425
|
top: 0,
|
|
7420
7426
|
width: 0,
|
|
7421
7427
|
height: 0
|
|
7422
7428
|
};
|
|
7423
|
-
for (let e in
|
|
7429
|
+
for (let e in ea) i($i, e, { fallback: ea[e] });
|
|
7424
7430
|
//#endregion
|
|
7425
7431
|
//#region src/scene/2d/element/Element2DTable.ts
|
|
7426
|
-
var
|
|
7432
|
+
var ta = 100, na = 40, ra = class extends w {
|
|
7427
7433
|
_parent;
|
|
7428
7434
|
_cellNodes = /* @__PURE__ */ new Map();
|
|
7429
7435
|
_cellSnapshots = /* @__PURE__ */ new Map();
|
|
@@ -7454,10 +7460,10 @@ var ea = 100, ta = 40, na = class extends w {
|
|
|
7454
7460
|
return !!(this.enabled && this.cells.length);
|
|
7455
7461
|
}
|
|
7456
7462
|
get gridWidth() {
|
|
7457
|
-
return this.columns.reduce((e, t) => e + (t.width ||
|
|
7463
|
+
return this.columns.reduce((e, t) => e + (t.width || ta), 0);
|
|
7458
7464
|
}
|
|
7459
7465
|
get gridHeight() {
|
|
7460
|
-
return this.rows.reduce((e, t) => e + (t.height ||
|
|
7466
|
+
return this.rows.reduce((e, t) => e + (t.height || na), 0);
|
|
7461
7467
|
}
|
|
7462
7468
|
update() {
|
|
7463
7469
|
if (this._dirty = !1, !this.isValid()) {
|
|
@@ -7467,9 +7473,9 @@ var ea = 100, ta = 40, na = class extends w {
|
|
|
7467
7473
|
let { columns: e, rows: t, cells: n } = this, r = e.length, i = t.length;
|
|
7468
7474
|
for (let e of n) r = Math.max(r, e.col + (e.colSpan || 1)), i = Math.max(i, e.row + (e.rowSpan || 1));
|
|
7469
7475
|
let a = [0];
|
|
7470
|
-
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width ||
|
|
7476
|
+
for (let t = 0; t < r; t++) a.push(a[t] + (e[t]?.width || ta));
|
|
7471
7477
|
let o = [0];
|
|
7472
|
-
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height ||
|
|
7478
|
+
for (let e = 0; e < i; e++) o.push(o[e] + (t[e]?.height || na));
|
|
7473
7479
|
this._parent.size.set(a[e.length] ?? 0, o[t.length] ?? 0);
|
|
7474
7480
|
let s = /* @__PURE__ */ new Set();
|
|
7475
7481
|
for (let e of n) {
|
|
@@ -7506,19 +7512,19 @@ var ea = 100, ta = 40, na = class extends w {
|
|
|
7506
7512
|
this._clearCells();
|
|
7507
7513
|
}
|
|
7508
7514
|
};
|
|
7509
|
-
k([_({ fallback: !0 }), O("design:type", Boolean)],
|
|
7515
|
+
k([_({ fallback: !0 }), O("design:type", Boolean)], ra.prototype, "enabled", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], ra.prototype, "columns", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], ra.prototype, "rows", void 0), k([_({ fallback: () => [] }), O("design:type", Object)], ra.prototype, "cells", void 0);
|
|
7510
7516
|
//#endregion
|
|
7511
7517
|
//#region src/scene/2d/element/Element2DText.ts
|
|
7512
|
-
var
|
|
7513
|
-
function
|
|
7514
|
-
if (
|
|
7518
|
+
var ia = 2, aa = 64, oa = 0;
|
|
7519
|
+
function sa() {
|
|
7520
|
+
if (oa) return oa;
|
|
7515
7521
|
try {
|
|
7516
7522
|
let e = C(), t = e.getContext("webgl2") || e.getContext("webgl");
|
|
7517
|
-
|
|
7523
|
+
oa = t && t.getParameter(t.MAX_TEXTURE_SIZE) || 4096;
|
|
7518
7524
|
} catch {
|
|
7519
|
-
|
|
7525
|
+
oa = 4096;
|
|
7520
7526
|
}
|
|
7521
|
-
return
|
|
7527
|
+
return oa;
|
|
7522
7528
|
}
|
|
7523
7529
|
var X = class extends w {
|
|
7524
7530
|
_parent;
|
|
@@ -7533,11 +7539,11 @@ var X = class extends w {
|
|
|
7533
7539
|
_autoDrawMode;
|
|
7534
7540
|
_atlasEligible = !1;
|
|
7535
7541
|
_textureStale = !0;
|
|
7536
|
-
_texture = new
|
|
7542
|
+
_texture = new _r({ mipmap: !0 });
|
|
7537
7543
|
_tiles = [];
|
|
7538
7544
|
_textureMap = /* @__PURE__ */ new Map();
|
|
7539
7545
|
constructor(e) {
|
|
7540
|
-
super(), this._parent = e, this.base =
|
|
7546
|
+
super(), this._parent = e, this.base = Nt(new ve()), this.base.setPropertyAccessor(this);
|
|
7541
7547
|
}
|
|
7542
7548
|
setProperties(e) {
|
|
7543
7549
|
return super.setProperties(d(e) ? void 0 : ae(e));
|
|
@@ -7607,7 +7613,7 @@ var X = class extends w {
|
|
|
7607
7613
|
}
|
|
7608
7614
|
_rasterTexture() {
|
|
7609
7615
|
this._resolveBaseThemeColors();
|
|
7610
|
-
let e = Math.ceil(this.base.boundingBox.width), t = Math.ceil(this.base.boundingBox.height), n =
|
|
7616
|
+
let e = Math.ceil(this.base.boundingBox.width), t = Math.ceil(this.base.boundingBox.height), n = ia, r = Math.floor((sa() - aa) / n);
|
|
7611
7617
|
if (e <= r && t <= r) {
|
|
7612
7618
|
this._releaseTiles();
|
|
7613
7619
|
let r = this._texture;
|
|
@@ -7625,7 +7631,7 @@ var X = class extends w {
|
|
|
7625
7631
|
for (let o = 0; o < a; o++) for (let a = 0; a < i; a++) {
|
|
7626
7632
|
let i = a * r, c = o * r, l = Math.min(r, e - i), u = Math.min(r, t - c), d = this._tiles[s];
|
|
7627
7633
|
d || (d = {
|
|
7628
|
-
texture: new
|
|
7634
|
+
texture: new _r({ mipmap: !0 }),
|
|
7629
7635
|
x: i,
|
|
7630
7636
|
y: c,
|
|
7631
7637
|
w: l,
|
|
@@ -7673,7 +7679,7 @@ var X = class extends w {
|
|
|
7673
7679
|
}), this._parent.requestDraw());
|
|
7674
7680
|
}
|
|
7675
7681
|
async _loadTexture(e, t) {
|
|
7676
|
-
return e.linearGradient || e.radialGradient ? new
|
|
7682
|
+
return e.linearGradient || e.radialGradient ? new Sr(e.linearGradient ?? e.radialGradient, t.width, t.height) : d(e.image) ? void 0 : (this._parent.tree?.log(`load image ${e.image}`), await $.texture.load(e.image));
|
|
7677
7683
|
}
|
|
7678
7684
|
setContent(e) {
|
|
7679
7685
|
this.content = oe(e);
|
|
@@ -7702,7 +7708,7 @@ var X = class extends w {
|
|
|
7702
7708
|
if (n.style.fill && !d(n.style.fill)) if (typeof n.style.fill == "object") {
|
|
7703
7709
|
let r = n.style.fill, o = this._textureMap.get(`${a}.${i}.fill`) ?? this._textureMap.get(`${a}.fill`) ?? this._textureMap.get("fill");
|
|
7704
7710
|
r.enabled !== !1 && (o || r.color) && (e.addPath(n), e.style = { ...n.style }, e.fillStyle = o?.texture ?? this._resolveThemeColor(r.color), e.fill({
|
|
7705
|
-
...
|
|
7711
|
+
...Ri(r, o?.box ?? {
|
|
7706
7712
|
x: 0,
|
|
7707
7713
|
y: 0,
|
|
7708
7714
|
width: this._parent.size.width,
|
|
@@ -7714,7 +7720,7 @@ var X = class extends w {
|
|
|
7714
7720
|
if (n.style.stroke && !d(n.style.stroke)) if (typeof n.style.stroke == "object") {
|
|
7715
7721
|
let r = n.style.stroke, o = this._textureMap.get(`${a}.${i}.outline`) ?? this._textureMap.get(`${a}.outline`) ?? this._textureMap.get("outline");
|
|
7716
7722
|
r.enabled !== !1 && (o || r.color) && (r.width === void 0 || r.width) && (e.addPath(n), e.style = { ...n.style }, e.lineWidth = r.width || 1, e.strokeStyle = o?.texture ?? this._resolveThemeColor(r.color), e.lineCap = r.lineCap, e.lineJoin = r.lineJoin, e.stroke({
|
|
7717
|
-
...
|
|
7723
|
+
...Ri(r, o?.box ?? {
|
|
7718
7724
|
x: 0,
|
|
7719
7725
|
y: 0,
|
|
7720
7726
|
width: this._parent.size.width,
|
|
@@ -7750,7 +7756,7 @@ var X = class extends w {
|
|
|
7750
7756
|
"listStyle",
|
|
7751
7757
|
"highlight"
|
|
7752
7758
|
]) if (this.base.plugins.get(e)?.pathSet?.paths?.length) return !1;
|
|
7753
|
-
let e = 2048 /
|
|
7759
|
+
let e = 2048 / xr.superSample / 1.5, t = this.base.characters;
|
|
7754
7760
|
for (let n = 0; n < t.length; n++) {
|
|
7755
7761
|
let r = t[n].computedStyle;
|
|
7756
7762
|
if (typeof r.color != "string" || r.fontSize > e) return !1;
|
|
@@ -7758,7 +7764,7 @@ var X = class extends w {
|
|
|
7758
7764
|
return !0;
|
|
7759
7765
|
}
|
|
7760
7766
|
_atlasDraw(e) {
|
|
7761
|
-
let t =
|
|
7767
|
+
let t = xr, n = this.base.characters, r = /* @__PURE__ */ new Map();
|
|
7762
7768
|
for (let e = 0; e < n.length; e++) {
|
|
7763
7769
|
let i = n[e], a = i.glyphBox;
|
|
7764
7770
|
if (!a || a.width <= 0 || a.height <= 0) continue;
|
|
@@ -7804,11 +7810,11 @@ var Z = {
|
|
|
7804
7810
|
horizontal: 6,
|
|
7805
7811
|
vertical: 7,
|
|
7806
7812
|
all: 8
|
|
7807
|
-
},
|
|
7813
|
+
}, ca = {
|
|
7808
7814
|
column: 0,
|
|
7809
7815
|
row: 1,
|
|
7810
7816
|
all: 2
|
|
7811
|
-
},
|
|
7817
|
+
}, la = {
|
|
7812
7818
|
auto: 0,
|
|
7813
7819
|
"flex-start": 1,
|
|
7814
7820
|
center: 2,
|
|
@@ -7818,74 +7824,74 @@ var Z = {
|
|
|
7818
7824
|
"space-between": 6,
|
|
7819
7825
|
"space-around": 7,
|
|
7820
7826
|
"space-evenly": 8
|
|
7821
|
-
},
|
|
7827
|
+
}, ua = {
|
|
7822
7828
|
flex: 0,
|
|
7823
7829
|
none: 1,
|
|
7824
7830
|
contents: 2
|
|
7825
|
-
},
|
|
7831
|
+
}, da = {
|
|
7826
7832
|
inherit: 0,
|
|
7827
7833
|
ltr: 1,
|
|
7828
7834
|
rtl: 2
|
|
7829
|
-
},
|
|
7835
|
+
}, fa = {
|
|
7830
7836
|
column: 0,
|
|
7831
7837
|
"column-reverse": 1,
|
|
7832
7838
|
row: 2,
|
|
7833
7839
|
"row-reverse": 3
|
|
7834
|
-
},
|
|
7840
|
+
}, pa = {
|
|
7835
7841
|
"no-wrap": 0,
|
|
7836
7842
|
wrap: 1,
|
|
7837
7843
|
"Wrap-reverse": 2
|
|
7838
|
-
},
|
|
7844
|
+
}, ma = {
|
|
7839
7845
|
"flex-start": 0,
|
|
7840
7846
|
center: 1,
|
|
7841
7847
|
"flex-end": 2,
|
|
7842
7848
|
"space-between": 3,
|
|
7843
7849
|
"space-around": 4,
|
|
7844
7850
|
"space-evenly": 5
|
|
7845
|
-
},
|
|
7851
|
+
}, ha = {
|
|
7846
7852
|
visible: 0,
|
|
7847
7853
|
hidden: 1,
|
|
7848
7854
|
scroll: 2
|
|
7849
|
-
},
|
|
7855
|
+
}, ga = {
|
|
7850
7856
|
static: 0,
|
|
7851
7857
|
relative: 1,
|
|
7852
7858
|
absolute: 2
|
|
7853
|
-
},
|
|
7859
|
+
}, _a = {
|
|
7854
7860
|
"border-box": 0,
|
|
7855
7861
|
"content-box": 1
|
|
7856
|
-
},
|
|
7862
|
+
}, va = class e {
|
|
7857
7863
|
_parent;
|
|
7858
7864
|
static _yoga;
|
|
7859
7865
|
static async load() {
|
|
7860
7866
|
let { loadYoga: e } = await import("yoga-layout/load");
|
|
7861
7867
|
this._yoga = await e();
|
|
7862
7868
|
}
|
|
7863
|
-
node = e._yoga ?
|
|
7869
|
+
node = e._yoga ? Nt(e._yoga.Node.create()) : void 0;
|
|
7864
7870
|
constructor(e) {
|
|
7865
7871
|
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);
|
|
7866
7872
|
}
|
|
7867
7873
|
_addChild(e, t) {
|
|
7868
|
-
if (e instanceof
|
|
7874
|
+
if (e instanceof Oa && e.flexbox.node && this.node) {
|
|
7869
7875
|
this.node.insertChild(e.flexbox.node, t);
|
|
7870
7876
|
let n = e.style.getProperties();
|
|
7871
7877
|
for (let t in n) e.flexbox.updateStyleProperty(t, n[t]);
|
|
7872
7878
|
}
|
|
7873
7879
|
}
|
|
7874
7880
|
_removeChild(e, t) {
|
|
7875
|
-
e instanceof
|
|
7881
|
+
e instanceof Oa && e.flexbox.node && this.node && this.node.removeChild(e.flexbox.node);
|
|
7876
7882
|
}
|
|
7877
7883
|
updateStyleProperty(e, t) {
|
|
7878
7884
|
let n = this.node;
|
|
7879
7885
|
if (n) {
|
|
7880
7886
|
switch (e) {
|
|
7881
7887
|
case "alignContent":
|
|
7882
|
-
n.setAlignContent(t ?
|
|
7888
|
+
n.setAlignContent(t ? la[t] ?? la["flex-start"] : la["flex-start"]);
|
|
7883
7889
|
break;
|
|
7884
7890
|
case "alignItems":
|
|
7885
|
-
n.setAlignItems(t ?
|
|
7891
|
+
n.setAlignItems(t ? la[t] ?? la["flex-start"] : la["flex-start"]);
|
|
7886
7892
|
break;
|
|
7887
7893
|
case "alignSelf":
|
|
7888
|
-
n.setAlignSelf(t ?
|
|
7894
|
+
n.setAlignSelf(t ? la[t] ?? la["flex-start"] : la["flex-start"]);
|
|
7889
7895
|
break;
|
|
7890
7896
|
case "aspectRatio":
|
|
7891
7897
|
n.setAspectRatio(t);
|
|
@@ -7906,10 +7912,10 @@ var Z = {
|
|
|
7906
7912
|
n.setBorder(Z.all, this._parent.style.borderWidth);
|
|
7907
7913
|
break;
|
|
7908
7914
|
case "direction":
|
|
7909
|
-
n.setDirection(t ?
|
|
7915
|
+
n.setDirection(t ? da[t] ?? da.inherit : da.inherit);
|
|
7910
7916
|
break;
|
|
7911
7917
|
case "display":
|
|
7912
|
-
n.setDisplay(t ?
|
|
7918
|
+
n.setDisplay(t ? ua[t] ?? ua.flex : ua.flex);
|
|
7913
7919
|
break;
|
|
7914
7920
|
case "flex":
|
|
7915
7921
|
n.setFlex(t);
|
|
@@ -7918,7 +7924,7 @@ var Z = {
|
|
|
7918
7924
|
n.setFlexBasis(t);
|
|
7919
7925
|
break;
|
|
7920
7926
|
case "flexDirection":
|
|
7921
|
-
n.setFlexDirection(t ?
|
|
7927
|
+
n.setFlexDirection(t ? fa[t] ?? fa.row : fa.row);
|
|
7922
7928
|
break;
|
|
7923
7929
|
case "flexGrow":
|
|
7924
7930
|
n.setFlexGrow(t);
|
|
@@ -7927,16 +7933,16 @@ var Z = {
|
|
|
7927
7933
|
n.setFlexShrink(t);
|
|
7928
7934
|
break;
|
|
7929
7935
|
case "flexWrap":
|
|
7930
|
-
n.setFlexWrap(t ?
|
|
7936
|
+
n.setFlexWrap(t ? pa[t] ?? pa.wrap : pa.wrap);
|
|
7931
7937
|
break;
|
|
7932
7938
|
case "height":
|
|
7933
7939
|
n.setHeight(t);
|
|
7934
7940
|
break;
|
|
7935
7941
|
case "justifyContent":
|
|
7936
|
-
n.setJustifyContent(t ?
|
|
7942
|
+
n.setJustifyContent(t ? ma[t] ?? ma["flex-start"] : ma["flex-start"]);
|
|
7937
7943
|
break;
|
|
7938
7944
|
case "gap":
|
|
7939
|
-
t !== void 0 && n.setGap(
|
|
7945
|
+
t !== void 0 && n.setGap(ca.all, t);
|
|
7940
7946
|
break;
|
|
7941
7947
|
case "marginTop":
|
|
7942
7948
|
n.setMargin(Z.top, t);
|
|
@@ -7966,7 +7972,7 @@ var Z = {
|
|
|
7966
7972
|
n.setMinWidth(t);
|
|
7967
7973
|
break;
|
|
7968
7974
|
case "overflow":
|
|
7969
|
-
n.setOverflow(t ?
|
|
7975
|
+
n.setOverflow(t ? ha[t] ?? ha.visible : ha.visible);
|
|
7970
7976
|
break;
|
|
7971
7977
|
case "paddingTop":
|
|
7972
7978
|
n.setPadding(Z.top, t);
|
|
@@ -7996,10 +8002,10 @@ var Z = {
|
|
|
7996
8002
|
n.setPosition(Z.right, t);
|
|
7997
8003
|
break;
|
|
7998
8004
|
case "position":
|
|
7999
|
-
n.setPositionType(t ?
|
|
8005
|
+
n.setPositionType(t ? ga[t] ?? ga.relative : ga.relative);
|
|
8000
8006
|
break;
|
|
8001
8007
|
case "boxSizing":
|
|
8002
|
-
n.setBoxSizing(t ?
|
|
8008
|
+
n.setBoxSizing(t ? _a[t] ?? _a["content-box"] : _a["content-box"]);
|
|
8003
8009
|
break;
|
|
8004
8010
|
case "width":
|
|
8005
8011
|
n.setWidth(t);
|
|
@@ -8010,7 +8016,7 @@ var Z = {
|
|
|
8010
8016
|
}
|
|
8011
8017
|
update() {
|
|
8012
8018
|
let e = this._parent, t = this.node;
|
|
8013
|
-
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0,
|
|
8019
|
+
if (e.getParent()?.flexbox?.update(), e.globalDisplay === "flex" && t && (t.isDirty() && t.calculateLayout(void 0, void 0, da.ltr), t.hasNewLayout())) {
|
|
8014
8020
|
let { left: n, top: r, width: i, height: a } = t.getComputedLayout(), o = e.getParent()?.globalDisplay === "flex", s = o ? n : Number(e.style.left) || 0, c = o ? r : Number(e.style.top) || 0, l = o || typeof e.style.width != "number" ? i : e.style.width, u = o || typeof e.style.height != "number" ? a : e.style.height;
|
|
8015
8021
|
(!Number.isNaN(s) && s !== e.position.x || !Number.isNaN(c) && c !== e.position.y) && e.position.set(s, c), !Number.isNaN(l) && !Number.isNaN(u) && (l !== e.size.x || u !== e.size.y) && e.size.set(l, u), t.markLayoutSeen();
|
|
8016
8022
|
}
|
|
@@ -8018,22 +8024,22 @@ var Z = {
|
|
|
8018
8024
|
destroy() {
|
|
8019
8025
|
this.node?.free(), this.node = void 0;
|
|
8020
8026
|
}
|
|
8021
|
-
},
|
|
8027
|
+
}, ya = new Set(Object.keys(a())), ba = new Set(Object.keys(s())), xa = /* @__PURE__ */ new Set(["left", "top"]), Sa = new y(), Ca = [
|
|
8022
8028
|
[0, 0],
|
|
8023
8029
|
[1, 0],
|
|
8024
8030
|
[1, 1],
|
|
8025
8031
|
[0, 1]
|
|
8026
|
-
],
|
|
8032
|
+
], wa = 6, Ta = 2, Ea = 24, Q = {
|
|
8027
8033
|
x: 0,
|
|
8028
8034
|
y: 0
|
|
8029
8035
|
};
|
|
8030
|
-
function
|
|
8036
|
+
function Da(e, t, n) {
|
|
8031
8037
|
return e < t ? t : e > n ? n : e;
|
|
8032
8038
|
}
|
|
8033
|
-
var
|
|
8034
|
-
flexbox = new
|
|
8035
|
-
aabb = new
|
|
8036
|
-
globalAabb = new
|
|
8039
|
+
var Oa = class extends Wr {
|
|
8040
|
+
flexbox = new va(this);
|
|
8041
|
+
aabb = new Tt();
|
|
8042
|
+
globalAabb = new Tt();
|
|
8037
8043
|
_parentGlobalDisplay;
|
|
8038
8044
|
_globalDisplay;
|
|
8039
8045
|
get globalDisplay() {
|
|
@@ -8052,7 +8058,7 @@ var Da = class extends Ur {
|
|
|
8052
8058
|
v: void 0,
|
|
8053
8059
|
h: void 0
|
|
8054
8060
|
};
|
|
8055
|
-
_style = new
|
|
8061
|
+
_style = new $i().on("updateProperty", (...e) => {
|
|
8056
8062
|
this.onUpdateStyleProperty(e[0], e[1], e[2]);
|
|
8057
8063
|
});
|
|
8058
8064
|
get style() {
|
|
@@ -8066,14 +8072,14 @@ var Da = class extends Ur {
|
|
|
8066
8072
|
this._endBatch();
|
|
8067
8073
|
}
|
|
8068
8074
|
}
|
|
8069
|
-
_background = new
|
|
8075
|
+
_background = new zi(this);
|
|
8070
8076
|
get background() {
|
|
8071
8077
|
return this._background;
|
|
8072
8078
|
}
|
|
8073
8079
|
set background(e) {
|
|
8074
8080
|
this._background.resetProperties().setProperties(e);
|
|
8075
8081
|
}
|
|
8076
|
-
_shape = new
|
|
8082
|
+
_shape = new Qi(this);
|
|
8077
8083
|
get shape() {
|
|
8078
8084
|
return this._shape;
|
|
8079
8085
|
}
|
|
@@ -8087,14 +8093,14 @@ var Da = class extends Ur {
|
|
|
8087
8093
|
set fill(e) {
|
|
8088
8094
|
this._fill.resetProperties().setProperties(e);
|
|
8089
8095
|
}
|
|
8090
|
-
_outline = new
|
|
8096
|
+
_outline = new Xi(this);
|
|
8091
8097
|
get outline() {
|
|
8092
8098
|
return this._outline;
|
|
8093
8099
|
}
|
|
8094
8100
|
set outline(e) {
|
|
8095
8101
|
this._outline.resetProperties().setProperties(e);
|
|
8096
8102
|
}
|
|
8097
|
-
_foreground = new
|
|
8103
|
+
_foreground = new Ji(this);
|
|
8098
8104
|
get foreground() {
|
|
8099
8105
|
return this._foreground;
|
|
8100
8106
|
}
|
|
@@ -8108,35 +8114,35 @@ var Da = class extends Ur {
|
|
|
8108
8114
|
set text(e) {
|
|
8109
8115
|
this._text.resetProperties().setProperties(e);
|
|
8110
8116
|
}
|
|
8111
|
-
_shadow = new
|
|
8117
|
+
_shadow = new Zi(this);
|
|
8112
8118
|
get shadow() {
|
|
8113
8119
|
return this._shadow;
|
|
8114
8120
|
}
|
|
8115
8121
|
set shadow(e) {
|
|
8116
8122
|
this._shadow.resetProperties().setProperties(e);
|
|
8117
8123
|
}
|
|
8118
|
-
_connection = new
|
|
8124
|
+
_connection = new Ki(this);
|
|
8119
8125
|
get connection() {
|
|
8120
8126
|
return this._connection;
|
|
8121
8127
|
}
|
|
8122
8128
|
set connection(e) {
|
|
8123
8129
|
this._connection.resetProperties().setProperties(e);
|
|
8124
8130
|
}
|
|
8125
|
-
_table = new
|
|
8131
|
+
_table = new ra(this);
|
|
8126
8132
|
get table() {
|
|
8127
8133
|
return this._table;
|
|
8128
8134
|
}
|
|
8129
8135
|
set table(e) {
|
|
8130
8136
|
this._table.resetProperties().setProperties(e);
|
|
8131
8137
|
}
|
|
8132
|
-
_chart = new
|
|
8138
|
+
_chart = new Ui(this);
|
|
8133
8139
|
get chart() {
|
|
8134
8140
|
return this._chart;
|
|
8135
8141
|
}
|
|
8136
8142
|
set chart(e) {
|
|
8137
8143
|
this._chart.resetProperties().setProperties(e);
|
|
8138
8144
|
}
|
|
8139
|
-
_comments = new
|
|
8145
|
+
_comments = new Wi(this);
|
|
8140
8146
|
get comments() {
|
|
8141
8147
|
return this._comments;
|
|
8142
8148
|
}
|
|
@@ -8232,7 +8238,7 @@ var Da = class extends Ur {
|
|
|
8232
8238
|
this._updateGlobalDisplay();
|
|
8233
8239
|
break;
|
|
8234
8240
|
case "rotate":
|
|
8235
|
-
this.rotation = (t || 0) *
|
|
8241
|
+
this.rotation = (t || 0) * Et, this.updateGlobalTransform();
|
|
8236
8242
|
break;
|
|
8237
8243
|
case "scaleX":
|
|
8238
8244
|
this.scale.x = t, this.text.isValid() && (t ^ n) < 0 && this.requestDraw();
|
|
@@ -8253,7 +8259,7 @@ var Da = class extends Ur {
|
|
|
8253
8259
|
}), this.extraTransform.translate(this.pivot.x, this.pivot.y), this.updateGlobalTransform();
|
|
8254
8260
|
break;
|
|
8255
8261
|
case "transformOrigin": {
|
|
8256
|
-
let e =
|
|
8262
|
+
let e = ti(t ?? "");
|
|
8257
8263
|
this.pivot.set(e[0] * this.size.width, e[1] * this.size.height);
|
|
8258
8264
|
break;
|
|
8259
8265
|
}
|
|
@@ -8297,7 +8303,7 @@ var Da = class extends Ur {
|
|
|
8297
8303
|
this.requestDraw();
|
|
8298
8304
|
break;
|
|
8299
8305
|
}
|
|
8300
|
-
if ((
|
|
8306
|
+
if ((ba.has(e) || ya.has(e)) && !xa.has(e) && this.text.isValid() && (this._batchDepth > 0 ? this._pendingTextUpdate = !0 : this.text.update()), this.globalDisplay === "flex") this.flexbox.updateStyleProperty(e, t);
|
|
8301
8307
|
else switch (e) {
|
|
8302
8308
|
case "left":
|
|
8303
8309
|
this.position.x = Number(t);
|
|
@@ -8350,10 +8356,10 @@ var Da = class extends Ur {
|
|
|
8350
8356
|
}
|
|
8351
8357
|
_intersectsViewport(e) {
|
|
8352
8358
|
let t = e.canvasTransform, n = e.width, r = e.height, i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
8353
|
-
for (let [e, c] of
|
|
8359
|
+
for (let [e, c] of Ca) t.applyAffineInverse({
|
|
8354
8360
|
x: e * n,
|
|
8355
8361
|
y: c * r
|
|
8356
|
-
},
|
|
8362
|
+
}, Sa), i = Math.min(i, Sa.x), a = Math.max(a, Sa.x), o = Math.min(o, Sa.y), s = Math.max(s, Sa.y);
|
|
8357
8363
|
let c = a - i, l = s - o, { min: u, size: d } = this.globalAabb;
|
|
8358
8364
|
return !(u.x > a + c || u.x + d.x < i - c || u.y > s + l || u.y + d.y < o - l);
|
|
8359
8365
|
}
|
|
@@ -8368,13 +8374,13 @@ var Da = class extends Ur {
|
|
|
8368
8374
|
}
|
|
8369
8375
|
_applyColorFilter() {
|
|
8370
8376
|
let e = [this._styleFilter, this._elementFilter].filter(Boolean).join(" ").trim();
|
|
8371
|
-
e ? (this._colorFilterEffect || (this._colorFilterEffect = new
|
|
8377
|
+
e ? (this._colorFilterEffect || (this._colorFilterEffect = new ii({
|
|
8372
8378
|
name: "styleFilter",
|
|
8373
8379
|
internalMode: "front"
|
|
8374
8380
|
}), this.append(this._colorFilterEffect)), this._colorFilterEffect.filter = e) : (this._colorFilterEffect?.remove(), this._colorFilterEffect = void 0, this.requestRender());
|
|
8375
8381
|
}
|
|
8376
8382
|
_updateStyleMaskImage(e) {
|
|
8377
|
-
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new
|
|
8383
|
+
d(e) ? (this._maskEffect?.remove(), this._maskEffect = void 0, this.requestRender()) : (this._maskEffect || (this._maskEffect = new Ai({
|
|
8378
8384
|
name: "styleMaskImage",
|
|
8379
8385
|
internalMode: "back"
|
|
8380
8386
|
}), this.append(this._maskEffect)), this._maskEffect.image = e);
|
|
@@ -8429,11 +8435,11 @@ var Da = class extends Ur {
|
|
|
8429
8435
|
}
|
|
8430
8436
|
getObb() {
|
|
8431
8437
|
let e = this.pivot, t = this.transform.apply(e).sub(e);
|
|
8432
|
-
return new
|
|
8438
|
+
return new kt(this._getPointArray().map((e) => (e.x += t.x, e.y += t.y, e)), this.rotation);
|
|
8433
8439
|
}
|
|
8434
8440
|
getGlobalObb() {
|
|
8435
8441
|
let e = this.pivot, t = this.globalScale, n = this.globalTransform.apply(e).sub(e);
|
|
8436
|
-
return new
|
|
8442
|
+
return new kt(this._getPointArray().map((r) => ({
|
|
8437
8443
|
x: e.x + (r.x - e.x) * t.x + n.x,
|
|
8438
8444
|
y: e.y + (r.y - e.y) * t.y + n.y
|
|
8439
8445
|
})), this.globalRotation);
|
|
@@ -8481,9 +8487,9 @@ var Da = class extends Ur {
|
|
|
8481
8487
|
if (!n) return;
|
|
8482
8488
|
let r = n.x.max > n.x.min, i = n.y.max > n.y.min;
|
|
8483
8489
|
if (!r && !i) return;
|
|
8484
|
-
let a = this.globalAabb, o =
|
|
8490
|
+
let a = this.globalAabb, o = wa / e, s = wa / t, c = Ta / e, l = Ta / t, u = this.contentOffset, d = {};
|
|
8485
8491
|
if (i) {
|
|
8486
|
-
let e = a.size.y - l * 2 - (r ? s + l : 0), i = Math.max(
|
|
8492
|
+
let e = a.size.y - l * 2 - (r ? s + l : 0), i = Math.max(Ea / t, Math.min(e, e * this.size.height / n.content.h)), f = n.y.max - n.y.min, p = f > 0 ? (u.y - n.y.min) / f : 0;
|
|
8487
8493
|
d.v = {
|
|
8488
8494
|
x: a.min.x + a.size.x - c - o,
|
|
8489
8495
|
y: a.min.y + l + p * (e - i),
|
|
@@ -8495,7 +8501,7 @@ var Da = class extends Ur {
|
|
|
8495
8501
|
};
|
|
8496
8502
|
}
|
|
8497
8503
|
if (r) {
|
|
8498
|
-
let t = a.size.x - c * 2 - (i ? o + c : 0), r = Math.max(
|
|
8504
|
+
let t = a.size.x - c * 2 - (i ? o + c : 0), r = Math.max(Ea / e, Math.min(t, t * this.size.width / n.content.w)), f = n.x.max - n.x.min, p = f > 0 ? (u.x - n.x.min) / f : 0;
|
|
8499
8505
|
d.h = {
|
|
8500
8506
|
x: a.min.x + c + p * (t - r),
|
|
8501
8507
|
y: a.min.y + a.size.y - l - s,
|
|
@@ -8551,7 +8557,7 @@ var Da = class extends Ur {
|
|
|
8551
8557
|
2,
|
|
8552
8558
|
3
|
|
8553
8559
|
]),
|
|
8554
|
-
texture:
|
|
8560
|
+
texture: vr.get("#000000"),
|
|
8555
8561
|
modulate: [
|
|
8556
8562
|
255,
|
|
8557
8563
|
255,
|
|
@@ -8568,7 +8574,7 @@ var Da = class extends Ur {
|
|
|
8568
8574
|
let r = this._scrollbarDrag;
|
|
8569
8575
|
if (t === "pointermove") {
|
|
8570
8576
|
let t = r.axis === "y" ? n.screenY : n.screenX;
|
|
8571
|
-
return r.travel > 0 && (this.contentOffset[r.axis] =
|
|
8577
|
+
return r.travel > 0 && (this.contentOffset[r.axis] = Da(r.startOffset + (t - r.startScreen) / r.travel * r.span, r.min, r.min + r.span)), e.stopPropagation(), !0;
|
|
8572
8578
|
}
|
|
8573
8579
|
return t === "pointerup" ? (this._scrollbarDrag = void 0, e.stopPropagation(), !0) : !1;
|
|
8574
8580
|
}
|
|
@@ -8657,10 +8663,10 @@ var Da = class extends Ur {
|
|
|
8657
8663
|
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.comments.destroy(), this._colorFilterEffect = void 0, this._maskEffect = void 0;
|
|
8658
8664
|
}
|
|
8659
8665
|
};
|
|
8660
|
-
|
|
8666
|
+
Oa = k([x("Element2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Oa);
|
|
8661
8667
|
//#endregion
|
|
8662
8668
|
//#region src/scene/2d/TextureRect2D.ts
|
|
8663
|
-
var
|
|
8669
|
+
var ka = class extends Oa {
|
|
8664
8670
|
texture;
|
|
8665
8671
|
region;
|
|
8666
8672
|
constructor(e, t = []) {
|
|
@@ -8683,8 +8689,8 @@ var Oa = class extends Da {
|
|
|
8683
8689
|
} });
|
|
8684
8690
|
}
|
|
8685
8691
|
}
|
|
8686
|
-
},
|
|
8687
|
-
texture = new
|
|
8692
|
+
}, Aa = class extends ka {
|
|
8693
|
+
texture = new _r();
|
|
8688
8694
|
animation;
|
|
8689
8695
|
_lastTime = NaN;
|
|
8690
8696
|
constructor(e, t = []) {
|
|
@@ -8714,10 +8720,10 @@ var Oa = class extends Da {
|
|
|
8714
8720
|
this.currentTime !== this._lastTime && (this._lastTime = this.currentTime, this.animation?.goToAndStop(this.currentTime, !1), this.texture.requestUpdate("source"), this.requestDraw()), super._process(e);
|
|
8715
8721
|
}
|
|
8716
8722
|
};
|
|
8717
|
-
k([_({ fallback: "" }), O("design:type", String)],
|
|
8723
|
+
k([_({ fallback: "" }), O("design:type", String)], Aa.prototype, "src", void 0), Aa = k([x("Lottie2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Aa);
|
|
8718
8724
|
//#endregion
|
|
8719
8725
|
//#region src/scene/2d/Mesh2D.ts
|
|
8720
|
-
var
|
|
8726
|
+
var ja = class extends Oa {
|
|
8721
8727
|
texture;
|
|
8722
8728
|
_vertices = /* @__PURE__ */ new Float32Array();
|
|
8723
8729
|
_uvs = /* @__PURE__ */ new Float32Array();
|
|
@@ -8748,7 +8754,7 @@ var Aa = class extends Da {
|
|
|
8748
8754
|
_drawContent() {
|
|
8749
8755
|
this.texture?.isValid() && this._indices.length && this._vertices.length && (this.context.fillStyle = this.texture, this.context.drawMesh(this._vertices, this._uvs, this._indices));
|
|
8750
8756
|
}
|
|
8751
|
-
},
|
|
8757
|
+
}, Ma = class extends Oa {
|
|
8752
8758
|
constructor(e, t = []) {
|
|
8753
8759
|
super(), this.setProperties(e).append(t);
|
|
8754
8760
|
}
|
|
@@ -8771,10 +8777,10 @@ var Aa = class extends Da {
|
|
|
8771
8777
|
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);
|
|
8772
8778
|
}
|
|
8773
8779
|
};
|
|
8774
|
-
k([_({ fallback: 6 }), O("design:type", Number)],
|
|
8780
|
+
k([_({ fallback: 6 }), O("design:type", Number)], Ma.prototype, "handleSize", void 0);
|
|
8775
8781
|
//#endregion
|
|
8776
8782
|
//#region src/scene/2d/Video2D.ts
|
|
8777
|
-
var
|
|
8783
|
+
var Na = class extends ka {
|
|
8778
8784
|
get videoDuration() {
|
|
8779
8785
|
return (this.texture?.duration ?? 0) * 1e3;
|
|
8780
8786
|
}
|
|
@@ -8823,15 +8829,15 @@ var Ma = class extends Oa {
|
|
|
8823
8829
|
super._process(e), this._updateVideoCurrentTime();
|
|
8824
8830
|
}
|
|
8825
8831
|
};
|
|
8826
|
-
k([_({ fallback: "" }), O("design:type", String)],
|
|
8832
|
+
k([_({ fallback: "" }), O("design:type", String)], Na.prototype, "src", void 0), k([_({ fallback: !0 }), O("design:type", Boolean)], Na.prototype, "loop", void 0), Na = k([x("Video2D"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Na);
|
|
8827
8833
|
//#endregion
|
|
8828
8834
|
//#region src/scene/animation/Animation.ts
|
|
8829
|
-
function
|
|
8835
|
+
function Pa(e) {
|
|
8830
8836
|
if (e == null) return 0;
|
|
8831
8837
|
let t = String(e).trim(), n = Number.parseFloat(t);
|
|
8832
8838
|
return Number.isNaN(n) ? 0 : n / 100;
|
|
8833
8839
|
}
|
|
8834
|
-
function
|
|
8840
|
+
function Fa(e, t) {
|
|
8835
8841
|
let n = t * 180 / Math.PI;
|
|
8836
8842
|
if (e == null || e === "auto") return n;
|
|
8837
8843
|
let r = String(e).trim();
|
|
@@ -8840,11 +8846,11 @@ function Pa(e, t) {
|
|
|
8840
8846
|
let i = Number.parseFloat(r);
|
|
8841
8847
|
return Number.isNaN(i) ? n : i;
|
|
8842
8848
|
}
|
|
8843
|
-
function
|
|
8849
|
+
function Ia(e) {
|
|
8844
8850
|
let t = e.trim(), n = /^path\((.*)\)$/s.exec(t);
|
|
8845
8851
|
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();
|
|
8846
8852
|
}
|
|
8847
|
-
function
|
|
8853
|
+
function La(e, t, n, r) {
|
|
8848
8854
|
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;
|
|
8849
8855
|
function m(e) {
|
|
8850
8856
|
let t = e, n, r;
|
|
@@ -8864,7 +8870,7 @@ function Ia(e, t, n, r) {
|
|
|
8864
8870
|
}
|
|
8865
8871
|
return (e) => p(m(e));
|
|
8866
8872
|
}
|
|
8867
|
-
var
|
|
8873
|
+
var Ra = {
|
|
8868
8874
|
linear: [
|
|
8869
8875
|
0,
|
|
8870
8876
|
0,
|
|
@@ -8931,7 +8937,7 @@ var La = {
|
|
|
8931
8937
|
.355,
|
|
8932
8938
|
1
|
|
8933
8939
|
]
|
|
8934
|
-
},
|
|
8940
|
+
}, za = Object.fromEntries(Object.entries(Ra).map(([e, [t, n, r, i]]) => [e, La(t, n, r, i)])), Ba = class extends H {
|
|
8935
8941
|
_keyframes = [];
|
|
8936
8942
|
_isFirstUpdatePosition = !1;
|
|
8937
8943
|
_cachedProps = new t();
|
|
@@ -8967,7 +8973,7 @@ var La = {
|
|
|
8967
8973
|
e = [this.getParent()].filter(Boolean);
|
|
8968
8974
|
break;
|
|
8969
8975
|
}
|
|
8970
|
-
return e.filter((e) => e instanceof
|
|
8976
|
+
return e.filter((e) => e instanceof Oa);
|
|
8971
8977
|
}
|
|
8972
8978
|
_updateKeyframes() {
|
|
8973
8979
|
this._pathMeasures.clear();
|
|
@@ -9018,14 +9024,14 @@ var La = {
|
|
|
9018
9024
|
});
|
|
9019
9025
|
}
|
|
9020
9026
|
_parseEasing(e) {
|
|
9021
|
-
if (!e) return
|
|
9022
|
-
if (e in
|
|
9027
|
+
if (!e) return za.linear;
|
|
9028
|
+
if (e in za) return za[e];
|
|
9023
9029
|
let t = /cubic-bezier\((.+)\)/.exec(e);
|
|
9024
9030
|
if (t) {
|
|
9025
9031
|
let e = t[1].split(",").map((e) => Number(e));
|
|
9026
|
-
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return
|
|
9032
|
+
if (e.length === 4 && e.every((e) => !Number.isNaN(e))) return La(e[0], e[1], e[2], e[3]);
|
|
9027
9033
|
}
|
|
9028
|
-
return
|
|
9034
|
+
return za.linear;
|
|
9029
9035
|
}
|
|
9030
9036
|
_parseKeyframes(e, t) {
|
|
9031
9037
|
let n, r = this._keyframes;
|
|
@@ -9060,7 +9066,7 @@ var La = {
|
|
|
9060
9066
|
});
|
|
9061
9067
|
}
|
|
9062
9068
|
_commitOffsetPath(e, t, n, r, i, a) {
|
|
9063
|
-
let o =
|
|
9069
|
+
let o = Ia(t);
|
|
9064
9070
|
if (!o) return;
|
|
9065
9071
|
let s = this._pathMeasures.get(o);
|
|
9066
9072
|
if (!s) {
|
|
@@ -9071,7 +9077,7 @@ var La = {
|
|
|
9071
9077
|
startY: t.y
|
|
9072
9078
|
}, this._pathMeasures.set(o, s);
|
|
9073
9079
|
}
|
|
9074
|
-
let c = E(D(
|
|
9080
|
+
let c = E(D(Pa(r.offsetDistance ?? i.offsetDistance), Pa(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 = Fa(i.offsetRotate ?? r.offsetRotate, u), m = n.get("transform");
|
|
9075
9081
|
e.onUpdateStyleProperty("transform", `${m ? `${m} ` : ""}translate(${d}px, ${f}px) rotate(${p}deg)`, void 0);
|
|
9076
9082
|
}
|
|
9077
9083
|
_getDiffValue(e, t, n, r, i) {
|
|
@@ -9118,14 +9124,14 @@ var La = {
|
|
|
9118
9124
|
});
|
|
9119
9125
|
}
|
|
9120
9126
|
};
|
|
9121
|
-
k([_({ fallback: "parent" }), O("design:type", Object)],
|
|
9127
|
+
k([_({ fallback: "parent" }), O("design:type", Object)], Ba.prototype, "effectMode", void 0), k([_({ default: () => [] }), O("design:type", Array)], Ba.prototype, "keyframes", void 0), k([_(), O("design:type", Object)], Ba.prototype, "easing", void 0), Ba = k([x("Animation", {
|
|
9122
9128
|
renderMode: "disabled",
|
|
9123
9129
|
processSortMode: "parent-before",
|
|
9124
9130
|
duration: 2e3
|
|
9125
|
-
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])],
|
|
9131
|
+
}), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial, Array])], Ba);
|
|
9126
9132
|
//#endregion
|
|
9127
9133
|
//#region src/scene/audio/html/HTMLAudioContext.ts
|
|
9128
|
-
var
|
|
9134
|
+
var Va = class t extends e {
|
|
9129
9135
|
static _instance;
|
|
9130
9136
|
static get instance() {
|
|
9131
9137
|
return this._instance ||= new t(), this._instance;
|
|
@@ -9155,7 +9161,7 @@ var Ba = class t extends e {
|
|
|
9155
9161
|
togglePause() {
|
|
9156
9162
|
return this.paused = !this.paused, this.refreshPaused(), this.paused;
|
|
9157
9163
|
}
|
|
9158
|
-
},
|
|
9164
|
+
}, Ha = class t extends e {
|
|
9159
9165
|
static PADDING = .1;
|
|
9160
9166
|
_source = null;
|
|
9161
9167
|
_audio = null;
|
|
@@ -9282,7 +9288,7 @@ var Ba = class t extends e {
|
|
|
9282
9288
|
let e = this._source;
|
|
9283
9289
|
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);
|
|
9284
9290
|
}
|
|
9285
|
-
},
|
|
9291
|
+
}, Ua = class {
|
|
9286
9292
|
parent;
|
|
9287
9293
|
source = new globalThis.Audio();
|
|
9288
9294
|
_src = "";
|
|
@@ -9299,7 +9305,7 @@ var Ba = class t extends e {
|
|
|
9299
9305
|
return !!this.source && this.source.readyState === 4;
|
|
9300
9306
|
}
|
|
9301
9307
|
get context() {
|
|
9302
|
-
return
|
|
9308
|
+
return Va.instance;
|
|
9303
9309
|
}
|
|
9304
9310
|
constructor(e) {
|
|
9305
9311
|
this.parent = e;
|
|
@@ -9310,9 +9316,9 @@ var Ba = class t extends e {
|
|
|
9310
9316
|
});
|
|
9311
9317
|
}
|
|
9312
9318
|
createSound() {
|
|
9313
|
-
return new
|
|
9319
|
+
return new Ha();
|
|
9314
9320
|
}
|
|
9315
|
-
},
|
|
9321
|
+
}, Wa = class extends e {
|
|
9316
9322
|
_input;
|
|
9317
9323
|
_output;
|
|
9318
9324
|
_processers = [];
|
|
@@ -9334,7 +9340,7 @@ var Ba = class t extends e {
|
|
|
9334
9340
|
get destination() {
|
|
9335
9341
|
return this._input;
|
|
9336
9342
|
}
|
|
9337
|
-
},
|
|
9343
|
+
}, Ga = class {
|
|
9338
9344
|
destination;
|
|
9339
9345
|
source;
|
|
9340
9346
|
constructor(e, t = null) {
|
|
@@ -9349,21 +9355,21 @@ var Ba = class t extends e {
|
|
|
9349
9355
|
};
|
|
9350
9356
|
//#endregion
|
|
9351
9357
|
//#region src/scene/audio/web/WebAudioContext.ts
|
|
9352
|
-
function
|
|
9358
|
+
function Ka() {
|
|
9353
9359
|
if (Ue) return new AudioContext();
|
|
9354
9360
|
if (We) {
|
|
9355
9361
|
let e = globalThis.webkitAudioContext;
|
|
9356
9362
|
return new e();
|
|
9357
9363
|
} else throw Error("Failed to createAudioContext");
|
|
9358
9364
|
}
|
|
9359
|
-
function
|
|
9365
|
+
function qa(e, t, n) {
|
|
9360
9366
|
if (Ge) return new OfflineAudioContext(e, t, n);
|
|
9361
9367
|
if (Ke) {
|
|
9362
9368
|
let r = globalThis.webkitOfflineAudioContext;
|
|
9363
9369
|
return new r(e, t, n);
|
|
9364
9370
|
} else throw Error("Failed to createOfflineAudioContext");
|
|
9365
9371
|
}
|
|
9366
|
-
var
|
|
9372
|
+
var Ja = class e extends Wa {
|
|
9367
9373
|
static _instance;
|
|
9368
9374
|
static get instance() {
|
|
9369
9375
|
return this._instance ||= new e(), this._instance;
|
|
@@ -9404,7 +9410,7 @@ var qa = class e extends Ua {
|
|
|
9404
9410
|
_compressor;
|
|
9405
9411
|
_analyser;
|
|
9406
9412
|
constructor() {
|
|
9407
|
-
let e =
|
|
9413
|
+
let e = Ka(), t = qa(1, 2, Ge ? Math.max(8e3, Math.min(96e3, e.sampleRate)) : 44100), n = e.createDynamicsCompressor(), r = e.createAnalyser();
|
|
9408
9414
|
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" && (Be || Ve), Je && (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));
|
|
9409
9415
|
}
|
|
9410
9416
|
_onFocus() {
|
|
@@ -9445,7 +9451,7 @@ var qa = class e extends Ua {
|
|
|
9445
9451
|
setParamValue(e, t) {
|
|
9446
9452
|
e.setValueAtTime ? e.setValueAtTime(t, this._context.currentTime) : e.value = t;
|
|
9447
9453
|
}
|
|
9448
|
-
},
|
|
9454
|
+
}, Ya = class extends e {
|
|
9449
9455
|
_audio = null;
|
|
9450
9456
|
_sourceNode = null;
|
|
9451
9457
|
_gain = null;
|
|
@@ -9578,7 +9584,7 @@ var qa = class e extends Ua {
|
|
|
9578
9584
|
destroy() {
|
|
9579
9585
|
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;
|
|
9580
9586
|
}
|
|
9581
|
-
},
|
|
9587
|
+
}, Xa = class extends Wa {
|
|
9582
9588
|
parent;
|
|
9583
9589
|
_sourceBuffer;
|
|
9584
9590
|
_sourceNode;
|
|
@@ -9586,7 +9592,7 @@ var qa = class e extends Ua {
|
|
|
9586
9592
|
gain;
|
|
9587
9593
|
analyser;
|
|
9588
9594
|
get context() {
|
|
9589
|
-
return
|
|
9595
|
+
return Ja.instance;
|
|
9590
9596
|
}
|
|
9591
9597
|
get isPlayable() {
|
|
9592
9598
|
return !!this._sourceNode.buffer;
|
|
@@ -9601,8 +9607,8 @@ var qa = class e extends Ua {
|
|
|
9601
9607
|
this._sourceNode.buffer = e;
|
|
9602
9608
|
}
|
|
9603
9609
|
constructor(e) {
|
|
9604
|
-
let t =
|
|
9605
|
-
n.connect(i), i.connect(r), r.connect(
|
|
9610
|
+
let t = Ja.audioContext, n = t.createBufferSource(), r = t.createGain(), i = t.createAnalyser();
|
|
9611
|
+
n.connect(i), i.connect(r), r.connect(Ja.instance.destination), super(i, r), this.parent = e, this._sourceNode = n, this.gain = r, this.analyser = i;
|
|
9606
9612
|
}
|
|
9607
9613
|
async load() {
|
|
9608
9614
|
return this._sourceLoad ||= new Promise((e) => {
|
|
@@ -9615,7 +9621,7 @@ var qa = class e extends Ua {
|
|
|
9615
9621
|
});
|
|
9616
9622
|
}
|
|
9617
9623
|
_decode(e) {
|
|
9618
|
-
return Promise.resolve(e instanceof AudioBuffer ? e :
|
|
9624
|
+
return Promise.resolve(e instanceof AudioBuffer ? e : Ja.decode(e)).then((e) => (this.parent.isLoaded = !0, this.buffer = e, e));
|
|
9619
9625
|
}
|
|
9620
9626
|
cloneSource() {
|
|
9621
9627
|
let e = this.context, t = this._sourceNode, n = e.audioContext.createBufferSource(), r = e.audioContext.createGain();
|
|
@@ -9625,15 +9631,15 @@ var qa = class e extends Ua {
|
|
|
9625
9631
|
};
|
|
9626
9632
|
}
|
|
9627
9633
|
createSound() {
|
|
9628
|
-
return new
|
|
9634
|
+
return new Ya();
|
|
9629
9635
|
}
|
|
9630
|
-
},
|
|
9636
|
+
}, Za, Qa = class extends H {
|
|
9631
9637
|
static {
|
|
9632
|
-
|
|
9638
|
+
Za = this;
|
|
9633
9639
|
}
|
|
9634
9640
|
static _soundPool = [];
|
|
9635
9641
|
_sounds = [];
|
|
9636
|
-
_platformAudio = qe ? new
|
|
9642
|
+
_platformAudio = qe ? new Xa(this) : new Ua(this);
|
|
9637
9643
|
get platformAudio() {
|
|
9638
9644
|
return this._platformAudio;
|
|
9639
9645
|
}
|
|
@@ -9726,7 +9732,7 @@ var qa = class e extends Ua {
|
|
|
9726
9732
|
this._sounds.length = 0;
|
|
9727
9733
|
}
|
|
9728
9734
|
_createSound() {
|
|
9729
|
-
return
|
|
9735
|
+
return Za._soundPool.length > 0 ? Za._soundPool.pop().init(this._platformAudio) : this._platformAudio.createSound().init(this._platformAudio);
|
|
9730
9736
|
}
|
|
9731
9737
|
refresh() {
|
|
9732
9738
|
for (let e = this._sounds.length, t = 0; t < e; t++) this._sounds[t].refresh();
|
|
@@ -9742,7 +9748,7 @@ var qa = class e extends Ua {
|
|
|
9742
9748
|
this._recycleSound(e);
|
|
9743
9749
|
};
|
|
9744
9750
|
_recycleSound(e) {
|
|
9745
|
-
e.destroy(),
|
|
9751
|
+
e.destroy(), Za._soundPool.includes(e) || Za._soundPool.push(e);
|
|
9746
9752
|
}
|
|
9747
9753
|
_prevTime = 0;
|
|
9748
9754
|
_timer = 0;
|
|
@@ -9758,10 +9764,10 @@ var qa = class e extends Ua {
|
|
|
9758
9764
|
}, 100);
|
|
9759
9765
|
}
|
|
9760
9766
|
};
|
|
9761
|
-
|
|
9767
|
+
Qa = Za = k([x("Audio"), O("design:paramtypes", [Object])], Qa);
|
|
9762
9768
|
//#endregion
|
|
9763
9769
|
//#region src/scene/audio/AudioSpectrum.ts
|
|
9764
|
-
var
|
|
9770
|
+
var $a = class extends Wr {}, eo = class extends Oa {
|
|
9765
9771
|
_audioBuffer;
|
|
9766
9772
|
_src = (() => {
|
|
9767
9773
|
let e = C();
|
|
@@ -9785,7 +9791,7 @@ var Qa = class extends Ur {}, $a = class extends Da {
|
|
|
9785
9791
|
}
|
|
9786
9792
|
}
|
|
9787
9793
|
async _loadSrc(e) {
|
|
9788
|
-
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) =>
|
|
9794
|
+
await globalThis.fetch(e).then((e) => e.arrayBuffer()).then((e) => Ja.decode(e)).then((e) => {
|
|
9789
9795
|
this._audioBuffer = e, this.syncTexture(!0);
|
|
9790
9796
|
});
|
|
9791
9797
|
}
|
|
@@ -9820,12 +9826,12 @@ var Qa = class extends Ur {}, $a = class extends Da {
|
|
|
9820
9826
|
this.syncTexture(), super._process(e);
|
|
9821
9827
|
}
|
|
9822
9828
|
};
|
|
9823
|
-
k([_(), O("design:type", Object)],
|
|
9829
|
+
k([_(), O("design:type", Object)], eo.prototype, "src", void 0), k([_({ fallback: 0 }), O("design:type", Number)], eo.prototype, "gap", void 0), k([_({ fallback: "#000000" }), O("design:type", String)], eo.prototype, "color", void 0), eo = k([x("AudioWaveform"), O("design:paramtypes", [typeof Partial > "u" ? Object : Partial])], eo);
|
|
9824
9830
|
//#endregion
|
|
9825
9831
|
//#region src/scene/transitions/KawaseTransition.ts
|
|
9826
|
-
var
|
|
9832
|
+
var to, no = class extends Hr {
|
|
9827
9833
|
static {
|
|
9828
|
-
|
|
9834
|
+
to = this;
|
|
9829
9835
|
}
|
|
9830
9836
|
blur = 10;
|
|
9831
9837
|
quality = 10;
|
|
@@ -9844,7 +9850,7 @@ var eo, to = class extends Vr {
|
|
|
9844
9850
|
let d = 1 / s, f = 1 / c, p = [], m, h = o - 1;
|
|
9845
9851
|
for (let e = 0; e < h; e++) m = u[e] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p });
|
|
9846
9852
|
m = u[h] + .5, p[0] = m * d, p[1] = m * f, l.push({ offset: p }), l.forEach((t) => {
|
|
9847
|
-
L.draw(e,
|
|
9853
|
+
L.draw(e, to.material, {
|
|
9848
9854
|
sampler: r,
|
|
9849
9855
|
progress: i,
|
|
9850
9856
|
...t
|
|
@@ -9852,31 +9858,31 @@ var eo, to = class extends Vr {
|
|
|
9852
9858
|
});
|
|
9853
9859
|
}
|
|
9854
9860
|
};
|
|
9855
|
-
|
|
9861
|
+
no = to = k([x("KawaseTransition")], no);
|
|
9856
9862
|
//#endregion
|
|
9857
9863
|
//#region src/scene/transitions/LeftEraseTransition.ts
|
|
9858
|
-
var
|
|
9864
|
+
var ro, io = class extends Hr {
|
|
9859
9865
|
static {
|
|
9860
|
-
|
|
9866
|
+
ro = this;
|
|
9861
9867
|
}
|
|
9862
9868
|
static material = new I({ gl: {
|
|
9863
9869
|
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}",
|
|
9864
9870
|
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}"
|
|
9865
9871
|
} });
|
|
9866
9872
|
apply(e) {
|
|
9867
|
-
L.draw(e,
|
|
9873
|
+
L.draw(e, ro.material, {
|
|
9868
9874
|
previous: 0,
|
|
9869
9875
|
next: 1,
|
|
9870
9876
|
progress: this.currentTimeProgress
|
|
9871
9877
|
});
|
|
9872
9878
|
}
|
|
9873
9879
|
};
|
|
9874
|
-
|
|
9880
|
+
io = ro = k([x("LeftEraseTransition")], io);
|
|
9875
9881
|
//#endregion
|
|
9876
9882
|
//#region src/scene/transitions/TiltShiftTransition.ts
|
|
9877
|
-
var
|
|
9883
|
+
var ao, oo = class extends Hr {
|
|
9878
9884
|
static {
|
|
9879
|
-
|
|
9885
|
+
ao = this;
|
|
9880
9886
|
}
|
|
9881
9887
|
blur = 100;
|
|
9882
9888
|
gradientBlur = 600;
|
|
@@ -9888,7 +9894,7 @@ var io, ao = class extends Vr {
|
|
|
9888
9894
|
let n = this.currentTimeProgress, r, i;
|
|
9889
9895
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9890
9896
|
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);
|
|
9891
|
-
L.draw(e,
|
|
9897
|
+
L.draw(e, ao.material, {
|
|
9892
9898
|
sampler: r,
|
|
9893
9899
|
progress: i,
|
|
9894
9900
|
blur: this.blur,
|
|
@@ -9897,7 +9903,7 @@ var io, ao = class extends Vr {
|
|
|
9897
9903
|
end: c,
|
|
9898
9904
|
delta: [u / f, d / f],
|
|
9899
9905
|
texSize: l
|
|
9900
|
-
}), L.draw(e,
|
|
9906
|
+
}), L.draw(e, ao.material, {
|
|
9901
9907
|
sampler: r,
|
|
9902
9908
|
progress: i,
|
|
9903
9909
|
blur: this.blur,
|
|
@@ -9909,12 +9915,12 @@ var io, ao = class extends Vr {
|
|
|
9909
9915
|
});
|
|
9910
9916
|
}
|
|
9911
9917
|
};
|
|
9912
|
-
|
|
9918
|
+
oo = ao = k([x("TiltShiftTransition")], oo);
|
|
9913
9919
|
//#endregion
|
|
9914
9920
|
//#region src/scene/transitions/TwistTransition.ts
|
|
9915
|
-
var
|
|
9921
|
+
var so, co = class extends Hr {
|
|
9916
9922
|
static {
|
|
9917
|
-
|
|
9923
|
+
so = this;
|
|
9918
9924
|
}
|
|
9919
9925
|
radius;
|
|
9920
9926
|
angle = 4;
|
|
@@ -9928,7 +9934,7 @@ var oo, so = class extends Vr {
|
|
|
9928
9934
|
let n = this.currentTimeProgress, r, i;
|
|
9929
9935
|
n < .5 ? (r = 0, i = (.5 - n) / .5) : (r = 1, i = (n - .5) / .5);
|
|
9930
9936
|
let a = t.width, o = t.height;
|
|
9931
|
-
L.draw(e,
|
|
9937
|
+
L.draw(e, so.material, {
|
|
9932
9938
|
sampler: r,
|
|
9933
9939
|
progress: i,
|
|
9934
9940
|
filterArea: [
|
|
@@ -9944,16 +9950,16 @@ var oo, so = class extends Vr {
|
|
|
9944
9950
|
});
|
|
9945
9951
|
}
|
|
9946
9952
|
};
|
|
9947
|
-
|
|
9953
|
+
co = so = k([x("TwistTransition")], co);
|
|
9948
9954
|
//#endregion
|
|
9949
9955
|
//#region src/asset/loaders/GifLoader.ts
|
|
9950
|
-
var
|
|
9956
|
+
var lo = class extends rr {
|
|
9951
9957
|
install(e) {
|
|
9952
9958
|
let t = async (t) => {
|
|
9953
9959
|
let { decodeFrames: n } = await import("modern-gif");
|
|
9954
|
-
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new
|
|
9960
|
+
return await t.arrayBuffer().then((t) => n(t, e.gifWorkerUrl ? { workerUrl: e.gifWorkerUrl } : void 0)).then((e) => new gr(e.map((e) => ({
|
|
9955
9961
|
duration: e.delay,
|
|
9956
|
-
texture: new
|
|
9962
|
+
texture: new Cr({
|
|
9957
9963
|
source: e.data,
|
|
9958
9964
|
width: e.width,
|
|
9959
9965
|
height: e.height
|
|
@@ -9964,14 +9970,14 @@ var co = class extends nr {
|
|
|
9964
9970
|
e.register(n, t);
|
|
9965
9971
|
}), e.gif = this, this;
|
|
9966
9972
|
}
|
|
9967
|
-
},
|
|
9973
|
+
}, uo = class extends rr {
|
|
9968
9974
|
install(e) {
|
|
9969
9975
|
let t = async (e) => JSON.parse(await e.text());
|
|
9970
9976
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), ["application/json"].forEach((n) => {
|
|
9971
9977
|
e.register(n, t);
|
|
9972
9978
|
}), e.json = this, this;
|
|
9973
9979
|
}
|
|
9974
|
-
},
|
|
9980
|
+
}, fo = class extends rr {
|
|
9975
9981
|
install(e) {
|
|
9976
9982
|
return this.load = async (t, n) => (await import("lottie-web").then((e) => e.default)).loadAnimation({
|
|
9977
9983
|
container: null,
|
|
@@ -9982,12 +9988,12 @@ var co = class extends nr {
|
|
|
9982
9988
|
animationData: await e.loadBy(t, () => e.fetch(t).then((e) => e.json()))
|
|
9983
9989
|
}), e.lottie = this, this;
|
|
9984
9990
|
}
|
|
9985
|
-
},
|
|
9991
|
+
}, po = class extends rr {
|
|
9986
9992
|
install(e) {
|
|
9987
9993
|
let t = async (e) => e.text();
|
|
9988
9994
|
return this.load = (n) => typeof n == "string" ? e.loadBy(n).then(t) : t(n), e.text = this, this;
|
|
9989
9995
|
}
|
|
9990
|
-
},
|
|
9996
|
+
}, mo = class extends rr {
|
|
9991
9997
|
install(e) {
|
|
9992
9998
|
let t = (t) => e.fetchImageBitmap(t, { premultiplyAlpha: "premultiply" }).then((e) => new z({
|
|
9993
9999
|
source: e,
|
|
@@ -10011,14 +10017,14 @@ var co = class extends nr {
|
|
|
10011
10017
|
e.register(n, t);
|
|
10012
10018
|
}), e.texture = this, this;
|
|
10013
10019
|
}
|
|
10014
|
-
},
|
|
10020
|
+
}, ho = class extends rr {
|
|
10015
10021
|
install(e) {
|
|
10016
10022
|
return this.load = (t) => e.awaitBy(async () => {
|
|
10017
|
-
let n = await new
|
|
10023
|
+
let n = await new Tr(t).load();
|
|
10018
10024
|
return e.emit("loaded", t, n), n;
|
|
10019
10025
|
}), e.video = this, this;
|
|
10020
10026
|
}
|
|
10021
|
-
},
|
|
10027
|
+
}, go = Object.entries({
|
|
10022
10028
|
"font/woff": ["woff"],
|
|
10023
10029
|
"font/ttf": ["ttf"],
|
|
10024
10030
|
"font/otf": ["otf"],
|
|
@@ -10034,31 +10040,31 @@ var co = class extends nr {
|
|
|
10034
10040
|
"image/webp": ["webp"],
|
|
10035
10041
|
"application/json": ["json"]
|
|
10036
10042
|
});
|
|
10037
|
-
function go(e) {
|
|
10038
|
-
for (let [t, n] of ho) if (n.includes(e)) return t;
|
|
10039
|
-
}
|
|
10040
10043
|
function _o(e) {
|
|
10044
|
+
for (let [t, n] of go) if (n.includes(e)) return t;
|
|
10045
|
+
}
|
|
10046
|
+
function vo(e) {
|
|
10041
10047
|
let t;
|
|
10042
10048
|
if (e.startsWith("data:")) t = e.match(/^data:(.+?);/)?.[1];
|
|
10043
10049
|
else if (e.startsWith("http")) {
|
|
10044
10050
|
let n = e.split(/[#?]/)[0].split(".").pop()?.trim();
|
|
10045
|
-
n && (t =
|
|
10051
|
+
n && (t = _o(n));
|
|
10046
10052
|
}
|
|
10047
10053
|
return t;
|
|
10048
10054
|
}
|
|
10049
10055
|
//#endregion
|
|
10050
10056
|
//#region src/asset/Assets.ts
|
|
10051
|
-
var
|
|
10057
|
+
var yo = "WeakRef" in globalThis, bo = class extends e {
|
|
10052
10058
|
defaultHandler = (e) => e;
|
|
10053
10059
|
_handlers = /* @__PURE__ */ new Map();
|
|
10054
10060
|
_handleing = /* @__PURE__ */ new Map();
|
|
10055
10061
|
_handled = /* @__PURE__ */ new Map();
|
|
10056
|
-
_gc =
|
|
10062
|
+
_gc = yo ? new FinalizationRegistry((e) => {
|
|
10057
10063
|
let t = this.get(e);
|
|
10058
10064
|
t && "destroy" in t && t.destroy(), this._handled.delete(e);
|
|
10059
10065
|
}) : void 0;
|
|
10060
10066
|
constructor() {
|
|
10061
|
-
super(),
|
|
10067
|
+
super(), yo || S.on(this.gc.bind(this), { sort: 2 });
|
|
10062
10068
|
}
|
|
10063
10069
|
use(e) {
|
|
10064
10070
|
return e.install(this), this;
|
|
@@ -10107,11 +10113,11 @@ var vo = "WeakRef" in globalThis, yo = class extends e {
|
|
|
10107
10113
|
}
|
|
10108
10114
|
get(e) {
|
|
10109
10115
|
let t = this._handled.get(e);
|
|
10110
|
-
return
|
|
10116
|
+
return yo && t instanceof WeakRef && (t = t.deref(), t || this._handleing.delete(e)), t;
|
|
10111
10117
|
}
|
|
10112
10118
|
set(e, t) {
|
|
10113
10119
|
let n = t;
|
|
10114
|
-
|
|
10120
|
+
yo && typeof t == "object" && (this._gc.register(t, e), n = new WeakRef(t)), this._handled.set(e, n), t && typeof t.on == "function" && t.on("destroy", () => {
|
|
10115
10121
|
this.get(e) === t && this._handled.delete(e);
|
|
10116
10122
|
});
|
|
10117
10123
|
}
|
|
@@ -10131,7 +10137,7 @@ var vo = "WeakRef" in globalThis, yo = class extends e {
|
|
|
10131
10137
|
return this._handleing.set(e, i), i;
|
|
10132
10138
|
}
|
|
10133
10139
|
async load(e, t) {
|
|
10134
|
-
let n = await this.loadBy(e), r =
|
|
10140
|
+
let n = await this.loadBy(e), r = vo(e);
|
|
10135
10141
|
return r === void 0 && (r = n.type?.split(";")[0] ?? void 0), ((r ? this._handlers.get(r) : void 0) ?? this.defaultHandler)(n, t);
|
|
10136
10142
|
}
|
|
10137
10143
|
async waitUntilLoad() {
|
|
@@ -10145,14 +10151,14 @@ var vo = "WeakRef" in globalThis, yo = class extends e {
|
|
|
10145
10151
|
n && "destroy" in n && n.destroy();
|
|
10146
10152
|
}), this._handled.clear();
|
|
10147
10153
|
}
|
|
10148
|
-
}, $ = new
|
|
10154
|
+
}, $ = new bo().use(new ir()).use(new lo()).use(new uo()).use(new fo()).use(new po()).use(new mo()).use(new ho()), xo = {
|
|
10149
10155
|
alpha: !0,
|
|
10150
10156
|
stencil: !0,
|
|
10151
10157
|
antialias: !1,
|
|
10152
10158
|
premultipliedAlpha: !0,
|
|
10153
10159
|
preserveDrawingBuffer: !1,
|
|
10154
10160
|
powerPreference: "default"
|
|
10155
|
-
},
|
|
10161
|
+
}, So = class extends G {
|
|
10156
10162
|
renderer;
|
|
10157
10163
|
get view() {
|
|
10158
10164
|
return this.renderer.view;
|
|
@@ -10183,7 +10189,7 @@ var vo = "WeakRef" in globalThis, yo = class extends e {
|
|
|
10183
10189
|
this._flowEffect = e, this.renderer.batch2D.registerEffect(e ? {
|
|
10184
10190
|
...e,
|
|
10185
10191
|
name: "flowStreak"
|
|
10186
|
-
} :
|
|
10192
|
+
} : Rt);
|
|
10187
10193
|
}
|
|
10188
10194
|
_resizeObserver = Ie ? new ResizeObserver((e) => {
|
|
10189
10195
|
let t = e[0];
|
|
@@ -10194,13 +10200,13 @@ var vo = "WeakRef" in globalThis, yo = class extends e {
|
|
|
10194
10200
|
}) : void 0;
|
|
10195
10201
|
constructor(e = {}) {
|
|
10196
10202
|
let { view: t, width: n, height: r, pixelRatio: i = Xe, autoResize: a, data: o } = e;
|
|
10197
|
-
super(), this.renderer = new
|
|
10198
|
-
alpha: e.alpha ??
|
|
10199
|
-
stencil: e.stencil ??
|
|
10200
|
-
antialias: e.antialias ??
|
|
10201
|
-
premultipliedAlpha: e.premultipliedAlpha ??
|
|
10202
|
-
preserveDrawingBuffer: e.preserveDrawingBuffer ??
|
|
10203
|
-
powerPreference: e.powerPreference ??
|
|
10203
|
+
super(), this.renderer = new nr(t, {
|
|
10204
|
+
alpha: e.alpha ?? xo.alpha,
|
|
10205
|
+
stencil: e.stencil ?? xo.stencil,
|
|
10206
|
+
antialias: e.antialias ?? xo.antialias,
|
|
10207
|
+
premultipliedAlpha: e.premultipliedAlpha ?? xo.premultipliedAlpha,
|
|
10208
|
+
preserveDrawingBuffer: e.preserveDrawingBuffer ?? xo.preserveDrawingBuffer,
|
|
10209
|
+
powerPreference: e.powerPreference ?? xo.powerPreference
|
|
10204
10210
|
}), 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);
|
|
10205
10211
|
}
|
|
10206
10212
|
_updateProperty(e, t, n) {
|
|
@@ -10319,22 +10325,22 @@ var vo = "WeakRef" in globalThis, yo = class extends e {
|
|
|
10319
10325
|
super._destroy(), this._resizeObserver?.disconnect(), this.renderer.destroy();
|
|
10320
10326
|
}
|
|
10321
10327
|
};
|
|
10322
|
-
k([_({ fallback: !1 }), O("design:type", Boolean)],
|
|
10328
|
+
k([_({ fallback: !1 }), O("design:type", Boolean)], So.prototype, "autoResize", void 0), k([_({ fallback: !1 }), O("design:type", Boolean)], So.prototype, "autoStart", void 0);
|
|
10323
10329
|
//#endregion
|
|
10324
10330
|
//#region src/render.ts
|
|
10325
|
-
var
|
|
10326
|
-
function
|
|
10327
|
-
return
|
|
10331
|
+
var Co, wo = [], To = !1;
|
|
10332
|
+
function Eo() {
|
|
10333
|
+
return Co ??= new So({
|
|
10328
10334
|
pixelRatio: 1,
|
|
10329
10335
|
width: 1,
|
|
10330
10336
|
height: 1,
|
|
10331
10337
|
preserveDrawingBuffer: !0
|
|
10332
10338
|
});
|
|
10333
10339
|
}
|
|
10334
|
-
async function
|
|
10335
|
-
if (!
|
|
10336
|
-
for (
|
|
10337
|
-
let t =
|
|
10340
|
+
async function Do(e = 100) {
|
|
10341
|
+
if (!To) {
|
|
10342
|
+
for (To = !0; wo.length;) {
|
|
10343
|
+
let t = wo.shift();
|
|
10338
10344
|
if (t) try {
|
|
10339
10345
|
await t();
|
|
10340
10346
|
} catch (e) {
|
|
@@ -10342,11 +10348,11 @@ async function Eo(e = 100) {
|
|
|
10342
10348
|
}
|
|
10343
10349
|
else await new Promise((t) => setTimeout(t, e));
|
|
10344
10350
|
}
|
|
10345
|
-
|
|
10351
|
+
To = !1;
|
|
10346
10352
|
}
|
|
10347
10353
|
}
|
|
10348
|
-
async function
|
|
10349
|
-
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], imagePipelineResolver: s, onBefore: c, onKeyframe: l, ...u } = e, d = Math.max(1, Math.floor(r)), f = Math.max(1, Math.floor(i)), p =
|
|
10354
|
+
async function Oo(e) {
|
|
10355
|
+
let { debug: t = !1, fonts: n, width: r, height: i, data: a, keyframes: o = [], imagePipelineResolver: s, onBefore: c, onKeyframe: l, ...u } = e, d = Math.max(1, Math.floor(r)), f = Math.max(1, Math.floor(i)), p = Eo();
|
|
10350
10356
|
if (p.resetProperties(), p.setProperties(u), p.debug = t, p.fonts = n, p.timeline.currentTime = 0, p.resizeForExport(d, f), p.imagePipelineResolver = s, p.root.removeChildren(!0), p.root.append(a), await c?.(p), await p.waitUntilProcessed(), o.length) {
|
|
10351
10357
|
let e = o.length, t = o[e - 1];
|
|
10352
10358
|
for (let n = 0; n < e; n++) {
|
|
@@ -10364,27 +10370,27 @@ async function Do(e) {
|
|
|
10364
10370
|
toCanvas2D: () => p.toCanvas2D(new ImageData(m, d, f))
|
|
10365
10371
|
};
|
|
10366
10372
|
}
|
|
10367
|
-
async function
|
|
10373
|
+
async function ko(e) {
|
|
10368
10374
|
return new Promise((t, n) => {
|
|
10369
|
-
|
|
10375
|
+
wo.push(async () => {
|
|
10370
10376
|
try {
|
|
10371
|
-
t(await
|
|
10377
|
+
t(await Oo(e).then((e) => e.toCanvas2D()));
|
|
10372
10378
|
} catch (e) {
|
|
10373
10379
|
n(e);
|
|
10374
10380
|
}
|
|
10375
|
-
}),
|
|
10381
|
+
}), Do();
|
|
10376
10382
|
});
|
|
10377
10383
|
}
|
|
10378
|
-
async function
|
|
10384
|
+
async function Ao(e) {
|
|
10379
10385
|
return new Promise((t, n) => {
|
|
10380
|
-
|
|
10386
|
+
wo.push(async () => {
|
|
10381
10387
|
try {
|
|
10382
|
-
t(await
|
|
10388
|
+
t(await Oo(e).then((e) => e.pixels));
|
|
10383
10389
|
} catch (e) {
|
|
10384
10390
|
n(e);
|
|
10385
10391
|
}
|
|
10386
|
-
}),
|
|
10392
|
+
}), Do();
|
|
10387
10393
|
});
|
|
10388
10394
|
}
|
|
10389
10395
|
//#endregion
|
|
10390
|
-
export {
|
|
10396
|
+
export { Tt as Aabb2D, gr as AnimatedTexture, Ba as Animation, bo as Assets, Qa as Audio, Wa as AudioPipeline, Ga as AudioProcessor, $a as AudioSpectrum, eo as AudioWaveform, A as BufferUsage, Gr as Camera2D, Dr as CanvasContext, Lr as CanvasItem, _r as CanvasTexture, T as Color, K as ColorAdjustEffect, ii as ColorFilterEffect, Ot as ColorMatrix, si as ColorOverlayEffect, li as ColorRemoveEffect, fi as ColorReplaceEffect, vr as ColorTexture, w as CoreObject, Et as DEG_TO_RAD, Xe as DEVICE_PIXEL_RATIO, q as DrawboardEffect, yi as DropShadowEffect, W as Effect, fr as EffectMaterial, Oa as Element2D, zi as Element2DBackground, Ui as Element2DChart, Wi as Element2DComments, Ki as Element2DConnection, Y as Element2DFill, Ji as Element2DForeground, Xi as Element2DOutline, Zi as Element2DShadow, Qi as Element2DShape, $i as Element2DStyle, ra as Element2DTable, X as Element2DText, xi as EmbossEffect, So as Engine, Pt as FLAG_CLIP_OUTSIDE_UV, Ft as FLAG_STROKE_AA, va as Flexbox, ir as FontLoader, pr as FxaaMaterial, _i as GaussianBlurEffect, or as Geometry, lo as GifLoader, wn as GlBatch2DSystem, vn as GlBlendMode, Bt as GlBuffer, qt as GlBufferSystem, zt as GlBufferTarget, On as GlMaskSystem, on as GlProgram, Mn as GlRenderTarget, Nn as GlRenderTargetSystem, hn as GlShaderSystem, bn as GlState, xn as GlStateSystem, An as GlStencilSystem, j as GlSystem, jn as GlViewportSystem, J as GlitchEffect, br as GlyphAtlas, Ti as GodrayEffect, Sr as GradientTexture, Ua as HTMLAudio, Va as HTMLAudioContext, Ha as HTMLSound, Je as IN_BROWSER, Ye as IN_MAC_OS, ar as IndexBuffer, xt as Input, ht as InputEvent, uo as JsonLoader, Oi as KawaseBlurEffect, no as KawaseTransition, gt as KeyboardInputEvent, io as LeftEraseTransition, rr as Loader, Aa as Lottie2D, fo as LottieLoader, jt as MainLoop, Ai as MaskEffect, I as Material, ja as Mesh2D, kr as Meta, _t as MouseInputEvent, V as Node, Wr as Node2D, kt as Obb2D, Ni as OutlineEffect, Se as PI, Ce as PI_2, Fi as PixelateEffect, Cr as PixelsTexture, vt as PointerInputEvent, At as Projection2D, sr as QuadGeometry, L as QuadUvGeometry, Dt as RAD_TO_DEG, St as RefCounted, R as RenderTarget, Vt as Renderer, Ct as Resource, Ue as SUPPORTS_AUDIO_CONTEXT, Ve as SUPPORTS_CLICK_EVENTS, He as SUPPORTS_CREATE_IMAGE_BITMAP, Fe as SUPPORTS_IMAGE_BITMAP, ze as SUPPORTS_MOUSE_EVENTS, Ge as SUPPORTS_OFFLINE_AUDIO_CONTEXT, Le as SUPPORTS_POINTER_EVENTS, Ie as SUPPORTS_RESIZE_OBSERVER, Be as SUPPORTS_TOUCH_EVENTS, Pe as SUPPORTS_WEBGL2, We as SUPPORTS_WEBKIT_AUDIO_CONTEXT, Ke as SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, qe as SUPPORTS_WEB_AUDIO, Re as SUPPORTS_WHEEL_EVENTS, G as SceneTree, po as TextLoader, z as Texture2D, mo as TextureLoader, ka as TextureRect2D, S as Ticker, oo as TiltShiftTransition, Br as Timeline, H as TimelineNode, Ma as TransformRect2D, Hr as Transition, co as TwistTransition, Ut as UniformGroup, hr as UvGeometry, mr as UvMaterial, F as VertexAttribute, P as VertexBuffer, Na as Video2D, ho as VideoLoader, Tr as VideoTexture, U as Viewport, Er as ViewportTexture, Xa as WebAudio, Ja as WebAudioContext, nr as WebGLRenderer, Ya as WebSound, yt as WheelInputEvent, Vr as Window, Li as ZoomBlurEffect, la as alignMap, $ as assets, Kr as axisDir, _a as boxSizingMap, ft as bumpGeometryRevision, E as clamp, Di as clampFrag, C as createHTMLCanvas, Kt as createIdFromString, be as createNode, lt as crossOrigin, Ra as cssEasingPresets, La as cubicBezier, x as customNode, ye as customNodes, xo as defaultOptions, ct as determineCrossOrigin, da as directionMap, ua as displayMap, Z as edgeMap, It as encodeFlowSpeed, fa as flexDirectionMap, pa as flexWrapMap, Rt as flowStreakEffect, Ei as frag, dt as geometryRevision, it as getCanvasFactory, ke as getDefaultCssPropertyValue, st as getGlContextProvider, Eo as getRenderEngine, ca as gutterMap, mt as instanceId, et as isCanvasElement, Ze as isElementNode, $e as isImageElement, we as isPow2, Qe as isVideoElement, tt as isWebgl2, ma as justifyMap, D as lerp, En as log2, yn as mapGlBlendModes, Nt as markRaw, Tn as nextPow2, xe as nextTick, ha as overflowMap, ei as parseCssFilter, je as parseCssFunctions, Ae as parseCssProperty, ti as parseCssTransformOrigin, Te as planExportTiles, ga as positionTypeMap, ko as render, Ao as renderPixels, Fr as resetBatchPool, qr as routeConnection, rt as setCanvasFactory, ot as setGlContextProvider, xr as sharedGlyphAtlas, kn as stencilModeMap, Lt as strokeFeatherEffect };
|