@mirage-engine/core 0.3.21 → 0.3.22
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/CHANGELOG.md +12 -0
- package/dist/mirage-engine.js +1405 -1196
- package/dist/mirage-engine.umd.js +18 -18
- package/dist/src/animation/Animator.d.ts +1 -1
- package/dist/src/core/Engine.d.ts +1 -1
- package/dist/src/core/Syncer.d.ts +3 -1
- package/dist/src/dom/Extractor.d.ts +6 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/renderer/Renderer.d.ts +16 -1
- package/dist/src/types/common.d.ts +7 -0
- package/dist/src/wasm/WasmSynchronizer.d.ts +12 -0
- package/package.json +4 -3
- package/src/animation/Animator.ts +96 -3
- package/src/core/Engine.ts +2 -2
- package/src/core/Syncer.ts +33 -5
- package/src/dom/Extractor.ts +59 -12
- package/src/index.ts +1 -0
- package/src/renderer/Renderer.ts +109 -163
- package/src/types/common.ts +9 -0
- package/src/wasm/WasmSynchronizer.ts +44 -0
package/dist/mirage-engine.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
1
|
+
var le = Object.defineProperty, he = Object.defineProperties;
|
|
2
|
+
var Ce = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var qA = Object.getOwnPropertySymbols;
|
|
4
|
+
var Be = Object.prototype.hasOwnProperty, Ee = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var RA = (t, A, e) => A in t ? le(t, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[A] = e, oA = (t, A) => {
|
|
6
|
+
for (var e in A || (A = {}))
|
|
7
|
+
Be.call(A, e) && RA(t, e, A[e]);
|
|
8
|
+
if (qA)
|
|
9
|
+
for (var e of qA(A))
|
|
10
|
+
Ee.call(A, e) && RA(t, e, A[e]);
|
|
11
|
+
return t;
|
|
12
|
+
}, jA = (t, A) => he(t, Ce(A));
|
|
13
|
+
var h = (t, A, e) => (RA(t, typeof A != "symbol" ? A + "" : A, e), e);
|
|
14
|
+
var aA = (t, A, e) => new Promise((s, r) => {
|
|
15
|
+
var o = (n) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
g(e.next(n));
|
|
18
18
|
} catch (a) {
|
|
19
|
-
|
|
19
|
+
r(a);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, i = (n) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
g(e.throw(n));
|
|
24
24
|
} catch (a) {
|
|
25
|
-
|
|
25
|
+
r(a);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, g = (n) => n.done ? s(n.value) : Promise.resolve(n.value).then(o, i);
|
|
28
|
+
g((e = e.apply(t, A)).next());
|
|
29
29
|
});
|
|
30
|
-
import * as
|
|
31
|
-
const
|
|
30
|
+
import * as d from "three";
|
|
31
|
+
const tA = 5, LA = 0, pA = 1, mA = 2, te = 3, ie = 4, re = {
|
|
32
32
|
INCLUDE_TREE: "include-tree",
|
|
33
33
|
EXCLUDE_TREE: "exclude-tree",
|
|
34
34
|
INCLUDE_SELF: "include-self",
|
|
35
35
|
EXCLUDE_SELF: "exclude-self",
|
|
36
36
|
END: "end"
|
|
37
|
-
},
|
|
37
|
+
}, eA = {
|
|
38
38
|
NAME: "data-mirage-dom",
|
|
39
39
|
KEY: "mirageDom",
|
|
40
40
|
VALUES: {
|
|
41
41
|
HIDE: "hide",
|
|
42
42
|
SHOW: "show"
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, VA = {
|
|
45
45
|
TRAVELER: "traveler",
|
|
46
46
|
NATIVE: "native",
|
|
47
47
|
CAPTURE_1: "1",
|
|
@@ -54,78 +54,78 @@ const Be = {
|
|
|
54
54
|
CAPTURE_8: "8",
|
|
55
55
|
CAPTURE_9: "9",
|
|
56
56
|
CAPTURE_10: "10"
|
|
57
|
-
},
|
|
57
|
+
}, X = {
|
|
58
58
|
NAME: "data-mirage-travel",
|
|
59
59
|
KEY: "mirageTravel",
|
|
60
|
-
VALUES:
|
|
61
|
-
MAX_LAYERS: Object.keys(
|
|
60
|
+
VALUES: VA,
|
|
61
|
+
MAX_LAYERS: Object.keys(VA).length - 1
|
|
62
62
|
}, q = {
|
|
63
63
|
NAME: "data-mirage-filter",
|
|
64
64
|
KEY: "mirageFilter",
|
|
65
|
-
VALUES:
|
|
66
|
-
},
|
|
65
|
+
VALUES: re
|
|
66
|
+
}, Z = {
|
|
67
67
|
NAME: "data-mirage-select",
|
|
68
68
|
KEY: "mirageSelect",
|
|
69
|
-
VALUES:
|
|
70
|
-
},
|
|
69
|
+
VALUES: re
|
|
70
|
+
}, de = {
|
|
71
71
|
NAME: "data-mirage-shader",
|
|
72
72
|
KEY: "mirageShader"
|
|
73
|
-
},
|
|
73
|
+
}, qe = {
|
|
74
74
|
NAME: "data-mirage-sandwich",
|
|
75
75
|
KEY: "mirageSandwich",
|
|
76
76
|
VALUES: {
|
|
77
77
|
FRONT: "front"
|
|
78
78
|
}
|
|
79
|
-
},
|
|
80
|
-
function
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
r: parseInt(
|
|
84
|
-
g: parseInt(
|
|
85
|
-
b: parseInt(
|
|
86
|
-
a:
|
|
79
|
+
}, DA = 0, nA = 1, fA = 2, Qe = 4, SA = 8, TA = 16;
|
|
80
|
+
function ue(t) {
|
|
81
|
+
const A = t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
|
|
82
|
+
return A ? {
|
|
83
|
+
r: parseInt(A[1]) / 255,
|
|
84
|
+
g: parseInt(A[2]) / 255,
|
|
85
|
+
b: parseInt(A[3]) / 255,
|
|
86
|
+
a: A[4] !== void 0 ? parseFloat(A[4]) : 1
|
|
87
87
|
} : { r: 1, g: 1, b: 1, a: 1 };
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
89
|
+
function fe(t) {
|
|
90
|
+
const A = {};
|
|
91
|
+
if (t.opacity && (A.opacity = parseFloat(t.opacity)), t.backgroundColor) {
|
|
92
|
+
const e = ue(t.backgroundColor);
|
|
93
|
+
A.backgroundColor = [e.r, e.g, e.b, e.a];
|
|
94
94
|
}
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
|
|
95
|
+
if (t.backgroundImage ? A.backgroundImage = t.backgroundImage : t.background && (A.backgroundImage = t.background), t.boxShadow && (A.boxShadow = t.boxShadow), t.borderRadius && (A.borderRadius = parseFloat(t.borderRadius)), t.width && (A.width = parseFloat(t.width)), t.height && (A.height = parseFloat(t.height)), t.transform && t.transform !== "none") {
|
|
96
|
+
const e = new DOMMatrix(t.transform);
|
|
97
|
+
A.x = e.m41, A.y = e.m42, A.z = e.m43, A.scaleX = Math.sqrt(e.m11 * e.m11 + e.m12 * e.m12 + e.m13 * e.m13), A.scaleY = Math.sqrt(e.m21 * e.m21 + e.m22 * e.m22 + e.m23 * e.m23), A.scaleZ = Math.sqrt(e.m31 * e.m31 + e.m32 * e.m32 + e.m33 * e.m33);
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return (t.left || t.right || t.top || t.bottom || t.margin || t.marginLeft || t.marginTop || t.marginRight || t.marginBottom || t.padding || t.paddingLeft || t.paddingTop || t.paddingRight || t.paddingBottom) && (A.layoutChanged = !0), A;
|
|
100
100
|
}
|
|
101
|
-
class
|
|
102
|
-
constructor(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
this.target.contains(
|
|
101
|
+
class we {
|
|
102
|
+
constructor(A, e) {
|
|
103
|
+
h(this, "target");
|
|
104
|
+
h(this, "observer");
|
|
105
|
+
h(this, "pendingDeletions", /* @__PURE__ */ new Set());
|
|
106
|
+
h(this, "pendingStyles", /* @__PURE__ */ new Map());
|
|
107
|
+
h(this, "isDomDirty", !1);
|
|
108
|
+
h(this, "isRunning", !1);
|
|
109
|
+
h(this, "pendingMask", DA);
|
|
110
|
+
h(this, "mutationTimer", null);
|
|
111
|
+
h(this, "cssTimer", null);
|
|
112
|
+
h(this, "resizeConfig");
|
|
113
|
+
h(this, "resizeTimer", null);
|
|
114
|
+
h(this, "isResizing", !1);
|
|
115
|
+
h(this, "lastScrollX", 0);
|
|
116
|
+
h(this, "lastScrollY", 0);
|
|
117
|
+
h(this, "scrollTimer", null);
|
|
118
|
+
h(this, "onBeforeRender", /* @__PURE__ */ new Set());
|
|
119
|
+
h(this, "onLayoutChange", /* @__PURE__ */ new Set());
|
|
120
|
+
h(this, "onStyleChange", /* @__PURE__ */ new Set());
|
|
121
|
+
h(this, "onScrollChange", /* @__PURE__ */ new Set());
|
|
122
|
+
h(this, "onRender", /* @__PURE__ */ new Set());
|
|
123
|
+
h(this, "onTransitionFinished", (A) => {
|
|
124
|
+
this.target.contains(A.target) && this.mutationTimer === null && (this.cssTimer && clearTimeout(this.cssTimer), this.pendingStyles.size == 0 && (this.pendingMask |= nA | fA, this.cssTimer = window.setTimeout(() => {
|
|
125
125
|
this.isDomDirty = !0, this.cssTimer = null;
|
|
126
126
|
}, 50)));
|
|
127
127
|
});
|
|
128
|
-
|
|
128
|
+
h(this, "onWindowResize", () => {
|
|
129
129
|
if (!this.resizeConfig.enabled) {
|
|
130
130
|
this.isDomDirty = !0;
|
|
131
131
|
return;
|
|
@@ -134,41 +134,41 @@ class Ke {
|
|
|
134
134
|
this.isDomDirty = !0, this.resizeConfig.onEnd && this.resizeConfig.onEnd(), this.isResizing = !1, this.resizeTimer = null;
|
|
135
135
|
}, this.resizeConfig.delay);
|
|
136
136
|
});
|
|
137
|
-
|
|
137
|
+
h(this, "renderLoop", () => {
|
|
138
138
|
if (!this.isRunning)
|
|
139
139
|
return;
|
|
140
|
-
this.onBeforeRender.forEach((
|
|
141
|
-
const
|
|
142
|
-
(
|
|
143
|
-
this.pendingMask |=
|
|
144
|
-
}, 150)), this.pendingStyles.size > 0 && (this.onStyleChange.forEach((
|
|
140
|
+
this.onBeforeRender.forEach((s) => s()), this.isDomDirty && (this.isDomDirty = !1, this.onLayoutChange.forEach((s) => s(this.pendingMask, this.pendingDeletions)), this.pendingDeletions.clear(), this.pendingMask = DA);
|
|
141
|
+
const A = window.scrollX, e = window.scrollY;
|
|
142
|
+
(A !== this.lastScrollX || e !== this.lastScrollY) && (this.onScrollChange.forEach((s) => s(A, e)), this.lastScrollX = A, this.lastScrollY = e, this.scrollTimer && clearTimeout(this.scrollTimer), this.scrollTimer = window.setTimeout(() => {
|
|
143
|
+
this.pendingMask |= nA, this.isDomDirty = !0, this.scrollTimer = null;
|
|
144
|
+
}, 150)), this.pendingStyles.size > 0 && (this.onStyleChange.forEach((s) => s(this.pendingStyles)), this.pendingStyles.clear()), this.onRender.forEach((s) => s()), requestAnimationFrame(this.renderLoop);
|
|
145
145
|
});
|
|
146
|
-
var
|
|
147
|
-
this.target =
|
|
148
|
-
const
|
|
149
|
-
|
|
146
|
+
var r, o;
|
|
147
|
+
this.target = A;
|
|
148
|
+
const s = (r = e.resizeDebounce) != null ? r : !0;
|
|
149
|
+
s === !1 ? this.resizeConfig = { enabled: !1, delay: 0 } : s === !0 ? this.resizeConfig = { enabled: !0, delay: 150 } : this.resizeConfig = {
|
|
150
150
|
enabled: !0,
|
|
151
|
-
delay: (
|
|
152
|
-
onStart:
|
|
153
|
-
onEnd:
|
|
154
|
-
}, this.observer = new MutationObserver((
|
|
155
|
-
let
|
|
156
|
-
for (const
|
|
157
|
-
if (
|
|
158
|
-
|
|
151
|
+
delay: (o = s.delay) != null ? o : 150,
|
|
152
|
+
onStart: s.onStart,
|
|
153
|
+
onEnd: s.onEnd
|
|
154
|
+
}, this.observer = new MutationObserver((i) => {
|
|
155
|
+
let g = DA;
|
|
156
|
+
for (const n of i)
|
|
157
|
+
if (n.type === "childList")
|
|
158
|
+
g |= SA, n.removedNodes.length > 0 && n.removedNodes.forEach((a) => {
|
|
159
159
|
a instanceof HTMLElement && this.pendingDeletions.add(a);
|
|
160
160
|
});
|
|
161
|
-
else if (
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
const a =
|
|
165
|
-
this.pendingStyles.set(a,
|
|
161
|
+
else if (n.type === "attributes")
|
|
162
|
+
if (n.attributeName === "style") {
|
|
163
|
+
g |= nA | fA;
|
|
164
|
+
const a = n.target, I = fe(a.style);
|
|
165
|
+
this.pendingStyles.set(a, I);
|
|
166
166
|
} else
|
|
167
|
-
|
|
167
|
+
n.attributeName === "class" ? g |= nA | fA : n.attributeName && n.attributeName.startsWith("data-") && (g |= nA | fA, n.attributeName.startsWith("data-mirage") && (g |= SA));
|
|
168
168
|
else
|
|
169
|
-
|
|
170
|
-
if (
|
|
171
|
-
if (this.pendingMask |=
|
|
169
|
+
n.type === "characterData" && (g |= TA | nA);
|
|
170
|
+
if (g !== DA) {
|
|
171
|
+
if (this.pendingMask |= g, g & SA) {
|
|
172
172
|
this.clearTimers(), this.isDomDirty = !0;
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
@@ -193,187 +193,187 @@ class Ke {
|
|
|
193
193
|
this.mutationTimer && (clearTimeout(this.mutationTimer), this.mutationTimer = null), this.cssTimer && (clearTimeout(this.cssTimer), this.cssTimer = null), this.scrollTimer && (clearTimeout(this.scrollTimer), this.scrollTimer = null);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
const
|
|
196
|
+
const j = 1, lA = 2, je = 0, L = {
|
|
197
197
|
BASE: 0,
|
|
198
198
|
SELECTED: 1,
|
|
199
|
-
getCaptureLayer: (
|
|
199
|
+
getCaptureLayer: (t) => 31 - t,
|
|
200
200
|
HIDDEN: 31
|
|
201
|
-
},
|
|
202
|
-
class
|
|
201
|
+
}, ZA = Object.values(q.VALUES);
|
|
202
|
+
class se {
|
|
203
203
|
/**
|
|
204
204
|
* Calculates or retrieves the exact alphabetic baseline (in pixels) for the given font.
|
|
205
205
|
* @param font CSS font shorthand string (e.g., "400 16px Inter")
|
|
206
206
|
* @returns Baseline Y offset in pixels
|
|
207
207
|
*/
|
|
208
|
-
static getBaseline(
|
|
209
|
-
if (this.cache.has(
|
|
210
|
-
return this.cache.get(
|
|
211
|
-
const
|
|
212
|
-
return this.cache.set(
|
|
208
|
+
static getBaseline(A) {
|
|
209
|
+
if (this.cache.has(A))
|
|
210
|
+
return this.cache.get(A);
|
|
211
|
+
const e = this.calculateBaselineFromDOM(A);
|
|
212
|
+
return this.cache.set(A, e), e;
|
|
213
213
|
}
|
|
214
|
-
static calculateBaselineFromDOM(
|
|
214
|
+
static calculateBaselineFromDOM(A) {
|
|
215
215
|
if (typeof document == "undefined")
|
|
216
216
|
return 0;
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
return document.body.removeChild(
|
|
217
|
+
const e = document.createElement("div"), s = document.createElement("span"), r = document.createElement("img");
|
|
218
|
+
e.style.visibility = "hidden", e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.font = A, e.style.margin = "0", e.style.padding = "0", e.style.border = "none", s.style.margin = "0", s.style.padding = "0", s.style.border = "none", s.style.lineHeight = "normal", r.width = 1, r.height = 1, r.style.verticalAlign = "baseline", s.appendChild(document.createTextNode("Hidden Text")), e.appendChild(s), e.appendChild(r), document.body.appendChild(e);
|
|
219
|
+
const o = r.offsetTop - s.offsetTop;
|
|
220
|
+
return document.body.removeChild(e), o;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
|
|
224
|
-
class
|
|
225
|
-
constructor(
|
|
223
|
+
h(se, "cache", /* @__PURE__ */ new Map());
|
|
224
|
+
class pe extends d.MeshBasicMaterial {
|
|
225
|
+
constructor(e, s, r, o, i = 2) {
|
|
226
226
|
super({
|
|
227
227
|
transparent: !0,
|
|
228
|
-
side:
|
|
228
|
+
side: d.FrontSide,
|
|
229
229
|
color: 16777215
|
|
230
230
|
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
h(this, "canvas");
|
|
232
|
+
h(this, "ctx");
|
|
233
|
+
h(this, "qualityFactor");
|
|
234
234
|
if (this.canvas = document.createElement("canvas"), this.ctx = this.canvas.getContext("2d"), !this.ctx)
|
|
235
235
|
throw new Error("[Mirage] Failed to create canvas context");
|
|
236
|
-
this.qualityFactor =
|
|
237
|
-
}
|
|
238
|
-
wrapText(
|
|
239
|
-
const
|
|
240
|
-
`),
|
|
241
|
-
return
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
|
|
236
|
+
this.qualityFactor = i, this.map = new d.CanvasTexture(this.canvas), this.map.colorSpace = d.LinearSRGBColorSpace, this.map.minFilter = d.LinearFilter, this.map.magFilter = d.LinearFilter, this.updateText(e, s, r, o);
|
|
237
|
+
}
|
|
238
|
+
wrapText(e, s) {
|
|
239
|
+
const r = e.split(`
|
|
240
|
+
`), o = [];
|
|
241
|
+
return r.forEach((i) => {
|
|
242
|
+
const g = i.match(/[^\s\-]+\-?|\-|\s+/g) || [];
|
|
243
|
+
if (g.length === 0) {
|
|
244
|
+
o.push("");
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
let
|
|
248
|
-
for (let a = 1; a <
|
|
249
|
-
const
|
|
250
|
-
this.ctx.measureText(
|
|
247
|
+
let n = g[0];
|
|
248
|
+
for (let a = 1; a < g.length; a++) {
|
|
249
|
+
const I = g[a];
|
|
250
|
+
this.ctx.measureText(n + I).width <= s + 2 ? n += I : (n && o.push(n), n = I.trimStart());
|
|
251
251
|
}
|
|
252
|
-
|
|
253
|
-
}),
|
|
254
|
-
}
|
|
255
|
-
updateText(
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
this.canvas.width !== a || this.canvas.height !==
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
let
|
|
263
|
-
|
|
252
|
+
n && o.push(n);
|
|
253
|
+
}), o;
|
|
254
|
+
}
|
|
255
|
+
updateText(e, s, r, o, i) {
|
|
256
|
+
i !== void 0 && (this.qualityFactor = i);
|
|
257
|
+
const n = (window.devicePixelRatio || 1) * this.qualityFactor, a = r * n, I = o * n;
|
|
258
|
+
this.canvas.width !== a || this.canvas.height !== I ? (this.canvas.width = a, this.canvas.height = I) : this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.ctx.setTransform(n, 0, 0, n, 0, 0), this.ctx.font = s.font, this.ctx.fillStyle = s.color, this.ctx.textBaseline = "alphabetic", this.ctx.globalAlpha = 1;
|
|
259
|
+
const c = this.wrapText(e, r), l = s.lineHeight, B = se.getBaseline(s.font);
|
|
260
|
+
c.forEach((C, w) => {
|
|
261
|
+
const Q = w * l + B;
|
|
262
|
+
let b = 0;
|
|
263
|
+
s.textAlign === "center" ? b = r / 2 : s.textAlign === "right" && (b = r), this.ctx.textAlign = s.textAlign, this.ctx.fillText(C, b, Q);
|
|
264
264
|
}), this.map && (this.map.needsUpdate = !0);
|
|
265
265
|
}
|
|
266
266
|
dispose() {
|
|
267
267
|
this.map && this.map.dispose(), super.dispose();
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
if (typeof
|
|
272
|
-
return
|
|
273
|
-
const
|
|
274
|
-
return typeof
|
|
270
|
+
function hA(t, A = 0) {
|
|
271
|
+
if (typeof t == "number")
|
|
272
|
+
return t;
|
|
273
|
+
const e = parseFloat(t) || 0;
|
|
274
|
+
return typeof t == "string" && t.includes("%") ? e / 100 * A : e;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
if (!
|
|
278
|
-
return { color: new
|
|
279
|
-
const
|
|
276
|
+
function CA(t) {
|
|
277
|
+
if (!t || t === "transparent")
|
|
278
|
+
return { color: new d.Color(16777215), alpha: 0 };
|
|
279
|
+
const A = t.match(
|
|
280
280
|
/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/
|
|
281
281
|
);
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
return { color: new
|
|
282
|
+
if (A) {
|
|
283
|
+
const e = parseInt(A[1], 10), s = parseInt(A[2], 10), r = parseInt(A[3], 10), o = A[4] !== void 0 ? parseFloat(A[4]) : 1;
|
|
284
|
+
return { color: new d.Color(`rgb(${e}, ${s}, ${r})`), alpha: o };
|
|
285
285
|
}
|
|
286
|
-
return { color: new
|
|
286
|
+
return { color: new d.Color(t), alpha: 1 };
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
const
|
|
290
|
-
let
|
|
291
|
-
for (let
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
else if (
|
|
296
|
-
|
|
297
|
-
else if (
|
|
298
|
-
|
|
288
|
+
function oe(t) {
|
|
289
|
+
const A = [];
|
|
290
|
+
let e = "", s = 0;
|
|
291
|
+
for (let r = 0; r < t.length; r++) {
|
|
292
|
+
const o = t[r];
|
|
293
|
+
if (o === "(")
|
|
294
|
+
s++;
|
|
295
|
+
else if (o === ")")
|
|
296
|
+
s--;
|
|
297
|
+
else if (o === "," && s === 0) {
|
|
298
|
+
A.push(e.trim()), e = "";
|
|
299
299
|
continue;
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
e += o;
|
|
302
302
|
}
|
|
303
|
-
return
|
|
303
|
+
return e && A.push(e.trim()), A;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
if (!
|
|
305
|
+
function me(t) {
|
|
306
|
+
if (!t || typeof t != "string" || !t.includes("linear-gradient"))
|
|
307
307
|
return null;
|
|
308
|
-
const
|
|
309
|
-
if (!
|
|
308
|
+
const A = t.match(/linear-gradient\((.*)\)/);
|
|
309
|
+
if (!A)
|
|
310
310
|
return null;
|
|
311
|
-
const
|
|
312
|
-
let
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
|
|
316
|
-
else if (
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
const
|
|
321
|
-
for (let
|
|
322
|
-
const a =
|
|
323
|
-
let
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
(
|
|
311
|
+
const e = A[1], s = oe(e);
|
|
312
|
+
let r = Math.PI, o = 0;
|
|
313
|
+
const i = s[0].trim();
|
|
314
|
+
if (i.startsWith("to "))
|
|
315
|
+
i === "to top" ? r = 0 : i === "to right" ? r = Math.PI / 2 : i === "to bottom" ? r = Math.PI : i === "to left" ? r = Math.PI * 1.5 : i === "to top right" || i === "to right top" ? r = Math.PI / 4 : i === "to bottom right" || i === "to right bottom" ? r = Math.PI * 0.75 : i === "to bottom left" || i === "to left bottom" ? r = Math.PI * 1.25 : (i === "to top left" || i === "to left top") && (r = Math.PI * 1.75), o = 1;
|
|
316
|
+
else if (i.endsWith("deg") || i.endsWith("rad") || i.endsWith("turn")) {
|
|
317
|
+
const n = parseFloat(i);
|
|
318
|
+
i.endsWith("deg") ? r = n * (Math.PI / 180) : i.endsWith("rad") ? r = n : i.endsWith("turn") && (r = n * Math.PI * 2), o = 1;
|
|
319
|
+
}
|
|
320
|
+
const g = [];
|
|
321
|
+
for (let n = o; n < s.length && !(g.length >= 8); n++) {
|
|
322
|
+
const a = s[n].trim(), I = a.lastIndexOf(" ");
|
|
323
|
+
let c = a, l = null;
|
|
324
|
+
if (I !== -1 && !a.endsWith(")")) {
|
|
325
|
+
const C = a.substring(I + 1);
|
|
326
|
+
(C.endsWith("%") || C.endsWith("px") || !isNaN(parseFloat(C))) && (c = a.substring(0, I).trim(), l = C);
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
color:
|
|
331
|
-
alpha:
|
|
332
|
-
rawStop:
|
|
328
|
+
const B = CA(c);
|
|
329
|
+
g.push({
|
|
330
|
+
color: B.color,
|
|
331
|
+
alpha: B.alpha,
|
|
332
|
+
rawStop: l,
|
|
333
333
|
stop: 0
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
if (
|
|
337
|
-
for (let a = 0; a <
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
let
|
|
341
|
-
for (let a = 1; a <
|
|
342
|
-
if (
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
const
|
|
346
|
-
for (let
|
|
347
|
-
n
|
|
336
|
+
if (g.length > 0) {
|
|
337
|
+
for (let a = 0; a < g.length; a++)
|
|
338
|
+
g[a].rawStop !== null && (g[a].stop = parseFloat(g[a].rawStop) / 100);
|
|
339
|
+
g[0].rawStop === null && (g[0].stop = 0), g.length > 1 && g[g.length - 1].rawStop === null && (g[g.length - 1].stop = 1);
|
|
340
|
+
let n = 0;
|
|
341
|
+
for (let a = 1; a < g.length; a++)
|
|
342
|
+
if (g[a].rawStop !== null || a === g.length - 1) {
|
|
343
|
+
const I = a - n;
|
|
344
|
+
if (I > 1) {
|
|
345
|
+
const c = g[n].stop, B = (g[a].stop - c) / I;
|
|
346
|
+
for (let C = 1; C < I; C++)
|
|
347
|
+
g[n + C].stop = c + B * C;
|
|
348
348
|
}
|
|
349
|
-
|
|
349
|
+
n = a;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
return { angle:
|
|
352
|
+
return { angle: r, stops: g };
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
if (!
|
|
354
|
+
function ye(t) {
|
|
355
|
+
if (!t || t === "none")
|
|
356
356
|
return null;
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
357
|
+
const A = oe(t);
|
|
358
|
+
if (A.length === 0)
|
|
359
359
|
return null;
|
|
360
|
-
const
|
|
361
|
-
let
|
|
362
|
-
if (
|
|
363
|
-
const
|
|
364
|
-
(
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
return { offsetX:
|
|
360
|
+
const e = A[0].trim(), s = /(rgba?\([^)]+\)|#[0-9a-fA-F]+|[a-zA-Z]+)/, r = e.match(s);
|
|
361
|
+
let o = "transparent", i = e;
|
|
362
|
+
if (r && r[1] !== "inset") {
|
|
363
|
+
const B = r[1];
|
|
364
|
+
(B.startsWith("rgb") || B.startsWith("#") || B === "black" || B === "white" || B === "transparent") && (o = B, i = e.replace(B, "").trim());
|
|
365
|
+
}
|
|
366
|
+
i = i.replace("inset", "").trim();
|
|
367
|
+
const g = i.split(/\s+/).map((B) => parseFloat(B) || 0), n = g[0] || 0, a = g[1] || 0, I = g[2] || 0, c = g[3] || 0, l = CA(o);
|
|
368
|
+
return { offsetX: n, offsetY: a, blurRadius: I, spreadRadius: c, color: l.color, alpha: l.alpha };
|
|
369
369
|
}
|
|
370
|
-
const
|
|
370
|
+
const De = `varying vec2 vUv;
|
|
371
371
|
varying vec4 vScreenPos;
|
|
372
372
|
void main() {
|
|
373
373
|
vUv = uv;
|
|
374
374
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
375
375
|
vScreenPos = gl_Position;
|
|
376
|
-
}`,
|
|
376
|
+
}`, Se = `varying vec2 vUv;
|
|
377
377
|
uniform vec2 uSize;
|
|
378
378
|
uniform vec2 uMeshSize;
|
|
379
379
|
uniform vec4 uShadowColor;
|
|
@@ -532,388 +532,395 @@ void main() {
|
|
|
532
532
|
|
|
533
533
|
// #include <colorspace_fragment>
|
|
534
534
|
}
|
|
535
|
-
`,
|
|
535
|
+
`, ve = `uniform sampler2D uTexture;
|
|
536
536
|
varying vec4 vScreenPos;
|
|
537
537
|
uniform vec2 uTextureRepeat;
|
|
538
|
-
uniform vec2 uTextureOffset;`,
|
|
538
|
+
uniform vec2 uTextureOffset;`, be = `vec2 screenUv = (vScreenPos.xy / vScreenPos.w) * 0.5 + 0.5;
|
|
539
539
|
vec2 resultUv = screenUv;
|
|
540
540
|
|
|
541
|
-
`,
|
|
542
|
-
baseColor = blendSrcOver(baseColor, texColor);`,
|
|
543
|
-
vertexShader:
|
|
544
|
-
fragmentShader:
|
|
545
|
-
},
|
|
546
|
-
declChunk:
|
|
547
|
-
uvChunk:
|
|
548
|
-
baseColorChunk:
|
|
541
|
+
`, Ne = `vec4 texColor = texture2D(uTexture, resultUv);
|
|
542
|
+
baseColor = blendSrcOver(baseColor, texColor);`, PA = {
|
|
543
|
+
vertexShader: De,
|
|
544
|
+
fragmentShader: Se
|
|
545
|
+
}, $A = {
|
|
546
|
+
declChunk: ve,
|
|
547
|
+
uvChunk: be,
|
|
548
|
+
baseColorChunk: Ne
|
|
549
549
|
};
|
|
550
|
-
function
|
|
551
|
-
var
|
|
552
|
-
const
|
|
553
|
-
let
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
for (const [
|
|
557
|
-
typeof
|
|
558
|
-
`,
|
|
559
|
-
`,
|
|
560
|
-
`,
|
|
561
|
-
`,
|
|
562
|
-
`,
|
|
563
|
-
`,
|
|
564
|
-
const
|
|
565
|
-
` +
|
|
566
|
-
`,
|
|
550
|
+
function Me(t, A, e, s = null, r) {
|
|
551
|
+
var U;
|
|
552
|
+
const o = s !== null || !!t.imageSrc;
|
|
553
|
+
let i = "";
|
|
554
|
+
const g = {};
|
|
555
|
+
if (r != null && r.uniforms)
|
|
556
|
+
for (const [S, D] of Object.entries(r.uniforms))
|
|
557
|
+
typeof D == "number" ? (i += `uniform float ${S};
|
|
558
|
+
`, g[S] = { value: D }) : Array.isArray(D) ? D.length === 2 ? (i += `uniform vec2 ${S};
|
|
559
|
+
`, g[S] = { value: new d.Vector2(...D) }) : D.length === 3 ? (i += `uniform vec3 ${S};
|
|
560
|
+
`, g[S] = { value: new d.Vector3(...D) }) : D.length === 4 && (i += `uniform vec4 ${S};
|
|
561
|
+
`, g[S] = { value: new d.Vector4(...D) }) : D && typeof D == "object" && D.type ? (i += `uniform ${D.type} ${S};
|
|
562
|
+
`, g[S] = D) : (i += `uniform float ${S};
|
|
563
|
+
`, g[S] = { value: D });
|
|
564
|
+
const n = r !== void 0, a = (o || n ? $A.declChunk : "") + `
|
|
565
|
+
` + i, I = `vec2 screenUv = (vScreenPos.xy / vScreenPos.w) * 0.5 + 0.5;
|
|
566
|
+
`, c = t.isTraveler ? `vec2 resultUv = screenUv;
|
|
567
567
|
` : `vec2 localUv = (p / uSize) + 0.5;
|
|
568
568
|
vec2 resultUv = localUv * uTextureRepeat + uTextureOffset;
|
|
569
|
-
`,
|
|
570
|
-
uSize: { value: new
|
|
571
|
-
uMeshSize: { value: new
|
|
572
|
-
uShadowColor: { value: new
|
|
573
|
-
uShadowOffset: { value: new
|
|
569
|
+
`, l = o || n ? I + c + ((r == null ? void 0 : r.uvModifier) || "") : "", B = o || n ? $A.baseColorChunk : "", C = (r == null ? void 0 : r.colorModifier) || "", w = PA.fragmentShader.replace("#INJECT_DECLARATIONS", a).replace("#INJECT_UV_MODIFIER", l).replace("#INJECT_BASE_COLOR", B).replace("#INJECT_COLOR_MODIFIER", C), Q = CA(t.backgroundColor), b = CA(t.borderColor), f = {
|
|
570
|
+
uSize: { value: new d.Vector2(A, e) },
|
|
571
|
+
uMeshSize: { value: new d.Vector2(A, e) },
|
|
572
|
+
uShadowColor: { value: new d.Vector4(0, 0, 0, 0) },
|
|
573
|
+
uShadowOffset: { value: new d.Vector2(0, 0) },
|
|
574
574
|
uShadowBlur: { value: 0 },
|
|
575
575
|
uShadowSpread: { value: 0 },
|
|
576
576
|
uBgColor: {
|
|
577
|
-
value: new
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
577
|
+
value: new d.Vector4(
|
|
578
|
+
Q.color.r,
|
|
579
|
+
Q.color.g,
|
|
580
|
+
Q.color.b,
|
|
581
|
+
Q.alpha
|
|
582
582
|
)
|
|
583
583
|
},
|
|
584
584
|
uBorderColor: {
|
|
585
|
-
value: new
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
585
|
+
value: new d.Vector4(
|
|
586
|
+
b.color.r,
|
|
587
|
+
b.color.g,
|
|
588
|
+
b.color.b,
|
|
589
|
+
b.alpha
|
|
590
590
|
)
|
|
591
591
|
},
|
|
592
|
-
uBorderRadius: { value: new
|
|
593
|
-
uBorderWidth: { value:
|
|
594
|
-
uOpacity: { value: (
|
|
592
|
+
uBorderRadius: { value: new d.Vector4(0, 0, 0, 0) },
|
|
593
|
+
uBorderWidth: { value: hA(t.borderWidth) },
|
|
594
|
+
uOpacity: { value: (U = t.opacity) != null ? U : 1 },
|
|
595
595
|
uTexture: { value: null },
|
|
596
|
-
uTextureRepeat: { value: new
|
|
597
|
-
uTextureOffset: { value: new
|
|
596
|
+
uTextureRepeat: { value: new d.Vector2(1, 1) },
|
|
597
|
+
uTextureOffset: { value: new d.Vector2(0, 0) },
|
|
598
598
|
uGradientCount: { value: 0 },
|
|
599
599
|
uGradientAngle: { value: 0 },
|
|
600
600
|
uGradientColors: {
|
|
601
|
-
value: Array.from({ length: 8 }, () => new
|
|
601
|
+
value: Array.from({ length: 8 }, () => new d.Vector4(0, 0, 0, 0))
|
|
602
602
|
},
|
|
603
603
|
uGradientStops: { value: new Float32Array(8) }
|
|
604
604
|
};
|
|
605
|
-
|
|
606
|
-
const
|
|
607
|
-
uniforms:
|
|
608
|
-
vertexShader:
|
|
609
|
-
fragmentShader:
|
|
605
|
+
ae(f.uBorderRadius.value, t.borderRadius, Math.min(A, e)), o && (f.uTexture.value = s);
|
|
606
|
+
const y = new d.ShaderMaterial({
|
|
607
|
+
uniforms: oA(oA({}, f), g),
|
|
608
|
+
vertexShader: PA.vertexShader,
|
|
609
|
+
fragmentShader: w,
|
|
610
610
|
transparent: !0,
|
|
611
|
-
side:
|
|
611
|
+
side: d.FrontSide
|
|
612
612
|
// for better performance
|
|
613
613
|
});
|
|
614
|
-
return
|
|
614
|
+
return t.backgroundImage && YA(y, { backgroundImage: t.backgroundImage }), y;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
width:
|
|
620
|
-
height:
|
|
621
|
-
borderRadius:
|
|
622
|
-
borderWidth:
|
|
623
|
-
backgroundColor:
|
|
624
|
-
borderColor:
|
|
625
|
-
opacity:
|
|
626
|
-
texture:
|
|
627
|
-
backgroundImage:
|
|
628
|
-
boxShadow:
|
|
616
|
+
function Re(t, A, e, s, r) {
|
|
617
|
+
const o = hA(A.borderWidth);
|
|
618
|
+
YA(t, {
|
|
619
|
+
width: e,
|
|
620
|
+
height: s,
|
|
621
|
+
borderRadius: A.borderRadius,
|
|
622
|
+
borderWidth: o,
|
|
623
|
+
backgroundColor: A.backgroundColor,
|
|
624
|
+
borderColor: A.borderColor,
|
|
625
|
+
opacity: A.opacity,
|
|
626
|
+
texture: r,
|
|
627
|
+
backgroundImage: A.backgroundImage,
|
|
628
|
+
boxShadow: A.boxShadow
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
|
-
function
|
|
632
|
-
var
|
|
633
|
-
if (
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
if (
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
if (
|
|
646
|
-
if (Array.isArray(
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
631
|
+
function YA(t, A) {
|
|
632
|
+
var s, r, o;
|
|
633
|
+
if (A.boxShadow !== void 0) {
|
|
634
|
+
const i = ye(A.boxShadow);
|
|
635
|
+
i ? (t.uniforms.uShadowColor.value.set(i.color.r, i.color.g, i.color.b, i.alpha), t.uniforms.uShadowOffset.value.set(i.offsetX, i.offsetY), t.uniforms.uShadowBlur.value = i.blurRadius, t.uniforms.uShadowSpread.value = i.spreadRadius, t.userData.shadowPadding = i.blurRadius + i.spreadRadius + Math.max(Math.abs(i.offsetX), Math.abs(i.offsetY))) : (t.uniforms.uShadowColor.value.w = 0, t.userData.shadowPadding = 0);
|
|
636
|
+
}
|
|
637
|
+
if (A.width !== void 0 && A.height !== void 0 && t.uniforms.uSize.value.set(A.width, A.height), t.uniforms.uMeshSize) {
|
|
638
|
+
const i = t.userData.shadowPadding || 0, g = A.width !== void 0 ? A.width : t.uniforms.uSize.value.x, n = A.height !== void 0 ? A.height : t.uniforms.uSize.value.y;
|
|
639
|
+
t.uniforms.uMeshSize.value.set(g + i * 2, n + i * 2);
|
|
640
|
+
}
|
|
641
|
+
if (A.borderRadius !== void 0) {
|
|
642
|
+
const i = A.width !== void 0 && A.height !== void 0 ? Math.min(A.width, A.height) : Math.min(t.uniforms.uSize.value.x, t.uniforms.uSize.value.y);
|
|
643
|
+
ae(t.uniforms.uBorderRadius.value, A.borderRadius, i);
|
|
644
|
+
}
|
|
645
|
+
if (A.borderWidth !== void 0 && (t.uniforms.uBorderWidth.value = A.borderWidth), A.backgroundColor !== void 0)
|
|
646
|
+
if (Array.isArray(A.backgroundColor)) {
|
|
647
|
+
const i = A.backgroundColor[3] !== void 0 ? A.backgroundColor[3] : t.uniforms.uBgColor.value.w;
|
|
648
|
+
t.uniforms.uBgColor.value.set(
|
|
649
|
+
A.backgroundColor[0],
|
|
650
|
+
A.backgroundColor[1],
|
|
651
|
+
A.backgroundColor[2],
|
|
652
|
+
i
|
|
653
653
|
);
|
|
654
|
-
} else if (typeof
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
654
|
+
} else if (typeof A.backgroundColor == "string") {
|
|
655
|
+
const i = CA(A.backgroundColor);
|
|
656
|
+
t.uniforms.uBgColor.value.set(
|
|
657
|
+
i.color.r,
|
|
658
|
+
i.color.g,
|
|
659
|
+
i.color.b,
|
|
660
|
+
i.alpha
|
|
661
661
|
);
|
|
662
662
|
} else {
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
663
|
+
const i = t.uniforms.uBgColor.value.w;
|
|
664
|
+
t.uniforms.uBgColor.value.set(
|
|
665
|
+
A.backgroundColor.r,
|
|
666
|
+
A.backgroundColor.g,
|
|
667
|
+
A.backgroundColor.b,
|
|
668
|
+
i
|
|
669
669
|
);
|
|
670
670
|
}
|
|
671
|
-
if (
|
|
672
|
-
if (Array.isArray(
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
671
|
+
if (A.borderColor !== void 0)
|
|
672
|
+
if (Array.isArray(A.borderColor)) {
|
|
673
|
+
const i = t.uniforms.uBorderColor.value.w;
|
|
674
|
+
t.uniforms.uBorderColor.value.set(
|
|
675
|
+
A.borderColor[0],
|
|
676
|
+
A.borderColor[1],
|
|
677
|
+
A.borderColor[2],
|
|
678
|
+
i
|
|
679
679
|
);
|
|
680
|
-
} else if (typeof
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
680
|
+
} else if (typeof A.borderColor == "string") {
|
|
681
|
+
const i = CA(A.borderColor);
|
|
682
|
+
t.uniforms.uBorderColor.value.set(
|
|
683
|
+
i.color.r,
|
|
684
|
+
i.color.g,
|
|
685
|
+
i.color.b,
|
|
686
|
+
i.alpha
|
|
687
687
|
);
|
|
688
688
|
} else {
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
689
|
+
const i = t.uniforms.uBorderColor.value.w;
|
|
690
|
+
t.uniforms.uBorderColor.value.set(
|
|
691
|
+
A.borderColor.r,
|
|
692
|
+
A.borderColor.g,
|
|
693
|
+
A.borderColor.b,
|
|
694
|
+
i
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
if (
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
704
|
-
const
|
|
705
|
-
|
|
697
|
+
A.opacity !== void 0 && (t.uniforms.uOpacity.value = A.opacity), A.bgOpacity !== void 0 && (t.uniforms.uBgColor.value.w = A.bgOpacity), A.borderOpacity !== void 0 && (t.uniforms.uBorderColor.value.w = A.borderOpacity), t.uniforms.uTexture && A.texture !== void 0 && (t.uniforms.uTexture.value = A.texture);
|
|
698
|
+
const e = A.texture !== void 0 ? A.texture : (s = t.uniforms.uTexture) == null ? void 0 : s.value;
|
|
699
|
+
if (e && (e.image instanceof ImageBitmap || e.image instanceof HTMLImageElement || e.image instanceof HTMLCanvasElement)) {
|
|
700
|
+
const i = e.image.naturalWidth || e.image.videoWidth || e.image.width, g = e.image.naturalHeight || e.image.videoHeight || e.image.height, n = (r = A.width) != null ? r : t.uniforms.uSize.value.x, a = (o = A.height) != null ? o : t.uniforms.uSize.value.y;
|
|
701
|
+
if (i && g && n && a) {
|
|
702
|
+
const I = i / g, c = n / a;
|
|
703
|
+
if (I > c) {
|
|
704
|
+
const l = c / I;
|
|
705
|
+
t.uniforms.uTextureRepeat.value.set(l, 1), t.uniforms.uTextureOffset.value.set((1 - l) / 2, 0);
|
|
706
706
|
} else {
|
|
707
|
-
const
|
|
708
|
-
|
|
707
|
+
const l = I / c;
|
|
708
|
+
t.uniforms.uTextureRepeat.value.set(1, l), t.uniforms.uTextureOffset.value.set(0, (1 - l) / 2);
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
} else
|
|
712
|
-
|
|
713
|
-
if (
|
|
714
|
-
const
|
|
715
|
-
if (
|
|
716
|
-
|
|
717
|
-
for (let
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
),
|
|
712
|
+
t.uniforms.uTextureRepeat && (t.uniforms.uTextureRepeat.value.set(1, 1), t.uniforms.uTextureOffset.value.set(0, 0));
|
|
713
|
+
if (A.backgroundImage !== void 0) {
|
|
714
|
+
const i = me(A.backgroundImage);
|
|
715
|
+
if (i) {
|
|
716
|
+
t.uniforms.uGradientCount.value = i.stops.length, t.uniforms.uGradientAngle.value = i.angle;
|
|
717
|
+
for (let g = 0; g < 8; g++)
|
|
718
|
+
if (g < i.stops.length) {
|
|
719
|
+
const n = i.stops[g];
|
|
720
|
+
t.uniforms.uGradientColors.value[g].set(
|
|
721
|
+
n.color.r,
|
|
722
|
+
n.color.g,
|
|
723
|
+
n.color.b,
|
|
724
|
+
n.alpha
|
|
725
|
+
), t.uniforms.uGradientStops.value[g] = n.stop;
|
|
726
726
|
} else
|
|
727
|
-
|
|
727
|
+
t.uniforms.uGradientColors.value[g].set(0, 0, 0, 0), t.uniforms.uGradientStops.value[g] = 1;
|
|
728
728
|
} else
|
|
729
|
-
|
|
729
|
+
t.uniforms.uGradientCount.value = 0;
|
|
730
730
|
}
|
|
731
|
-
for (const
|
|
732
|
-
|
|
731
|
+
for (const i of Object.keys(A))
|
|
732
|
+
i !== "width" && i !== "height" && i !== "borderRadius" && i !== "borderWidth" && i !== "backgroundColor" && i !== "borderColor" && i !== "opacity" && i !== "bgOpacity" && i !== "borderOpacity" && i !== "texture" && i !== "backgroundImage" && i !== "boxShadow" && t.uniforms[i] !== void 0 && (t.uniforms[i].value !== void 0 && t.uniforms[i].value !== null && typeof t.uniforms[i].value.set == "function" ? Array.isArray(A[i]) ? t.uniforms[i].value.set(...A[i]) : A[i] !== void 0 && (A[i].copy ? t.uniforms[i].value.copy(A[i]) : t.uniforms[i].value = A[i]) : t.uniforms[i].value = A[i]);
|
|
733
733
|
}
|
|
734
|
-
function
|
|
735
|
-
var
|
|
736
|
-
if (
|
|
737
|
-
|
|
734
|
+
function ae(t, A, e = 0) {
|
|
735
|
+
var n, a, I, c;
|
|
736
|
+
if (A == null) {
|
|
737
|
+
t.set(0, 0, 0, 0);
|
|
738
738
|
return;
|
|
739
739
|
}
|
|
740
|
-
if (typeof
|
|
741
|
-
|
|
740
|
+
if (typeof A == "number") {
|
|
741
|
+
t.set(A, A, A, A);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
if (Array.isArray(
|
|
745
|
-
|
|
744
|
+
if (Array.isArray(A)) {
|
|
745
|
+
t.set(A[0], A[1], A[2], A[3]);
|
|
746
746
|
return;
|
|
747
747
|
}
|
|
748
|
-
const
|
|
749
|
-
|
|
748
|
+
const s = A.split("/")[0].trim().split(/\s+/), r = hA(s[0], e), o = hA((n = s[1]) != null ? n : s[0], e), i = hA((a = s[2]) != null ? a : s[0], e), g = hA((c = (I = s[3]) != null ? I : s[1]) != null ? c : s[0], e);
|
|
749
|
+
t.set(r, o, i, g);
|
|
750
750
|
}
|
|
751
|
-
const
|
|
752
|
-
create(
|
|
753
|
-
return
|
|
754
|
-
|
|
755
|
-
r,
|
|
751
|
+
const K = {
|
|
752
|
+
create(t, A, e, s, r, o = 2, i = null, g) {
|
|
753
|
+
return t === "BOX" ? Me(
|
|
754
|
+
A,
|
|
756
755
|
s,
|
|
757
|
-
o,
|
|
758
|
-
n
|
|
759
|
-
) : i === "TEXT" ? new Je(
|
|
760
|
-
t || "",
|
|
761
|
-
e,
|
|
762
756
|
r,
|
|
763
|
-
s,
|
|
764
|
-
c
|
|
765
|
-
) : new w.MeshBasicMaterial({ visible: !1 });
|
|
766
|
-
},
|
|
767
|
-
update(i, e, t, r, s, c, o = 2, n) {
|
|
768
|
-
e === "BOX" ? at(
|
|
769
757
|
i,
|
|
770
|
-
|
|
758
|
+
g
|
|
759
|
+
) : t === "TEXT" ? new pe(
|
|
760
|
+
e || "",
|
|
761
|
+
A,
|
|
771
762
|
s,
|
|
772
|
-
|
|
773
|
-
n
|
|
774
|
-
) : e === "TEXT" && i.updateText(
|
|
775
|
-
r || "",
|
|
776
|
-
t,
|
|
777
|
-
s,
|
|
778
|
-
c,
|
|
763
|
+
r,
|
|
779
764
|
o
|
|
765
|
+
) : new d.MeshBasicMaterial({ visible: !1 });
|
|
766
|
+
},
|
|
767
|
+
update(t, A, e, s, r, o, i = 2, g) {
|
|
768
|
+
A === "BOX" ? Re(
|
|
769
|
+
t,
|
|
770
|
+
e,
|
|
771
|
+
r,
|
|
772
|
+
o,
|
|
773
|
+
g
|
|
774
|
+
) : A === "TEXT" && t.updateText(
|
|
775
|
+
s || "",
|
|
776
|
+
e,
|
|
777
|
+
r,
|
|
778
|
+
o,
|
|
779
|
+
i
|
|
780
780
|
);
|
|
781
781
|
},
|
|
782
|
-
forceUpdateUniforms(
|
|
783
|
-
|
|
782
|
+
forceUpdateUniforms(t, A) {
|
|
783
|
+
YA(t, A);
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
|
-
class
|
|
787
|
-
constructor(
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
this.onUpdate =
|
|
794
|
-
(
|
|
795
|
-
for (const
|
|
796
|
-
const
|
|
797
|
-
|
|
786
|
+
class xe {
|
|
787
|
+
constructor(A, e = !0) {
|
|
788
|
+
h(this, "observer");
|
|
789
|
+
h(this, "textures", /* @__PURE__ */ new WeakMap());
|
|
790
|
+
h(this, "loadStatus", /* @__PURE__ */ new WeakMap());
|
|
791
|
+
h(this, "elementUrls", /* @__PURE__ */ new WeakMap());
|
|
792
|
+
h(this, "onUpdate");
|
|
793
|
+
this.onUpdate = A, e && (this.observer = new IntersectionObserver(
|
|
794
|
+
(s) => {
|
|
795
|
+
for (const r of s) {
|
|
796
|
+
const o = r.target;
|
|
797
|
+
r.isIntersecting ? this.loadTexture(o) : this.disposeTexture(o);
|
|
798
798
|
}
|
|
799
799
|
},
|
|
800
800
|
{ rootMargin: "300px" }
|
|
801
801
|
));
|
|
802
802
|
}
|
|
803
|
-
register(
|
|
804
|
-
if (
|
|
803
|
+
register(A, e) {
|
|
804
|
+
if (A.nodeType !== Node.ELEMENT_NODE)
|
|
805
805
|
return;
|
|
806
|
-
this.elementUrls.get(
|
|
806
|
+
this.elementUrls.get(A) !== e && (this.elementUrls.set(A, e), this.observer ? (this.observer.unobserve(A), this.observer.observe(A)) : this.loadTexture(A));
|
|
807
807
|
}
|
|
808
|
-
unregister(
|
|
809
|
-
|
|
808
|
+
unregister(A) {
|
|
809
|
+
A.nodeType === Node.ELEMENT_NODE && this.observer && this.observer.unobserve(A), this.disposeTexture(A), this.elementUrls.delete(A), this.loadStatus.delete(A);
|
|
810
810
|
}
|
|
811
|
-
loadTexture(
|
|
812
|
-
return
|
|
813
|
-
if (this.loadStatus.get(
|
|
811
|
+
loadTexture(A) {
|
|
812
|
+
return aA(this, null, function* () {
|
|
813
|
+
if (this.loadStatus.get(A) || this.textures.has(A))
|
|
814
814
|
return;
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
817
|
-
this.loadStatus.set(
|
|
815
|
+
const e = this.elementUrls.get(A);
|
|
816
|
+
if (e) {
|
|
817
|
+
this.loadStatus.set(A, !0);
|
|
818
818
|
try {
|
|
819
|
-
let
|
|
820
|
-
if (
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
|
|
819
|
+
let s;
|
|
820
|
+
if (e.startsWith("data:image/svg+xml"))
|
|
821
|
+
s = yield new Promise((o, i) => {
|
|
822
|
+
const g = new Image();
|
|
823
|
+
g.onload = () => o(g), g.onerror = i, g.src = e;
|
|
824
824
|
});
|
|
825
825
|
else {
|
|
826
|
-
const
|
|
827
|
-
|
|
826
|
+
const i = yield (yield fetch(e)).blob();
|
|
827
|
+
s = yield createImageBitmap(i, { imageOrientation: "flipY" });
|
|
828
828
|
}
|
|
829
|
-
if (this.elementUrls.get(
|
|
830
|
-
"close" in
|
|
829
|
+
if (this.elementUrls.get(A) !== e) {
|
|
830
|
+
"close" in s && s.close();
|
|
831
831
|
return;
|
|
832
832
|
}
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
} catch (
|
|
836
|
-
console.warn("[MirageEngine] Failed to load texture:",
|
|
833
|
+
const r = new d.Texture(s);
|
|
834
|
+
s instanceof HTMLImageElement || (r.flipY = !1), r.colorSpace = d.LinearSRGBColorSpace, r.needsUpdate = !0, this.textures.set(A, r), this.onUpdate(A, r);
|
|
835
|
+
} catch (s) {
|
|
836
|
+
console.warn("[MirageEngine] Failed to load texture:", e, s);
|
|
837
837
|
} finally {
|
|
838
|
-
this.elementUrls.has(
|
|
838
|
+
this.elementUrls.has(A) && this.loadStatus.set(A, !1);
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
});
|
|
842
842
|
}
|
|
843
|
-
disposeTexture(
|
|
844
|
-
const
|
|
845
|
-
|
|
843
|
+
disposeTexture(A) {
|
|
844
|
+
const e = this.textures.get(A);
|
|
845
|
+
e && (e.dispose(), this.textures.delete(A), this.onUpdate(A, null)), this.loadStatus.set(A, !1);
|
|
846
846
|
}
|
|
847
|
-
get(
|
|
848
|
-
return this.textures.get(
|
|
847
|
+
get(A) {
|
|
848
|
+
return this.textures.get(A);
|
|
849
849
|
}
|
|
850
850
|
disposeAll() {
|
|
851
851
|
this.observer && this.observer.disconnect();
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
class
|
|
855
|
-
constructor(e,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
854
|
+
class Le {
|
|
855
|
+
constructor(A, e, s, r) {
|
|
856
|
+
h(this, "canvas");
|
|
857
|
+
h(this, "scene");
|
|
858
|
+
h(this, "camera");
|
|
859
|
+
h(this, "renderer");
|
|
860
|
+
h(this, "renderTargets", []);
|
|
861
|
+
h(this, "renderOrder", 0);
|
|
862
|
+
h(this, "qualityFactor", 2);
|
|
863
|
+
h(this, "mode", "overlay");
|
|
864
|
+
h(this, "canvasSize", "viewport");
|
|
865
|
+
h(this, "clipArea", 1);
|
|
866
|
+
h(this, "targetLayer", "base");
|
|
867
|
+
h(this, "overscan", 200);
|
|
868
|
+
h(this, "target");
|
|
869
|
+
h(this, "mountContainer");
|
|
870
|
+
h(this, "registry");
|
|
871
|
+
h(this, "targetRect");
|
|
872
|
+
h(this, "targetPageX", 0);
|
|
873
|
+
h(this, "targetPageY", 0);
|
|
874
|
+
h(this, "size", { width: 0, height: 0 });
|
|
875
|
+
h(this, "currentScrollX", 0);
|
|
876
|
+
h(this, "currentScrollY", 0);
|
|
877
|
+
h(this, "lastTargetLeft", 0);
|
|
878
|
+
h(this, "lastTargetTop", 0);
|
|
879
|
+
h(this, "travelersByLayer", Array.from(
|
|
880
|
+
{ length: X.MAX_LAYERS },
|
|
874
881
|
() => /* @__PURE__ */ new Set()
|
|
875
882
|
));
|
|
876
|
-
|
|
883
|
+
h(this, "textureManager");
|
|
877
884
|
// private meshMap: Map<HTMLElement, THREE.Mesh> = new Map();
|
|
878
|
-
|
|
879
|
-
var
|
|
880
|
-
this.target =
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
}, this.isViewport), this.canvas = document.createElement("canvas"), this.scene = new
|
|
884
|
-
const
|
|
885
|
-
this.camera = new
|
|
886
|
-
c / -2,
|
|
887
|
-
c / 2,
|
|
888
|
-
o / 2,
|
|
885
|
+
h(this, "fixedMeshes", /* @__PURE__ */ new Set());
|
|
886
|
+
var g, n, a, I, c;
|
|
887
|
+
this.target = A, this.mountContainer = s, this.registry = r, this.mode = (g = e.mode) != null ? g : "overlay", this.canvasSize = (n = e.canvasSize) != null ? n : "viewport", this.clipArea = (a = e.travelerClipArea) != null ? a : 1, this.targetLayer = (I = e.layer) != null ? I : "base", this.textureManager = new xe((l, B) => {
|
|
888
|
+
const C = this.registry.get(l);
|
|
889
|
+
C && C.material instanceof d.ShaderMaterial && K.forceUpdateUniforms(C.material, { texture: B });
|
|
890
|
+
}, this.isViewport), this.qualityFactor = this.getQualityFactor(e.quality), this.canvas = document.createElement("canvas"), this.scene = new d.Scene(), this.targetRect = this.target.getBoundingClientRect(), this.lastTargetLeft = this.targetRect.left, this.lastTargetTop = this.targetRect.top, this.targetPageX = this.targetRect.left + this.getScrollX(), this.targetPageY = this.targetRect.top + this.getScrollY();
|
|
891
|
+
const o = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, i = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height;
|
|
892
|
+
this.camera = new d.OrthographicCamera(
|
|
889
893
|
o / -2,
|
|
894
|
+
o / 2,
|
|
895
|
+
i / 2,
|
|
896
|
+
i / -2,
|
|
890
897
|
1,
|
|
891
898
|
1e3
|
|
892
|
-
), this.camera.position.z = 100, this.camera.layers.set(this.getSceneLayer()), this.renderer = new
|
|
899
|
+
), this.camera.position.z = 100, this.camera.layers.set(this.getSceneLayer()), this.renderer = new d.WebGLRenderer({
|
|
893
900
|
canvas: this.canvas,
|
|
894
901
|
alpha: !0,
|
|
895
902
|
antialias: !0
|
|
896
903
|
// [new]
|
|
897
904
|
// premultipliedAlpha: true
|
|
898
|
-
}),
|
|
905
|
+
}), d.ColorManagement.enabled = !1, this.renderer.outputColorSpace = d.LinearSRGBColorSpace, this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(o, i), this.applyTextQuality((c = e.quality) != null ? c : "medium");
|
|
899
906
|
}
|
|
900
907
|
get isViewport() {
|
|
901
908
|
return this.mode === "overlay" && this.canvasSize === "viewport";
|
|
902
909
|
}
|
|
903
910
|
getSceneLayer() {
|
|
904
|
-
return typeof this.targetLayer == "number" ? this.targetLayer : this.targetLayer === "selected" ?
|
|
911
|
+
return typeof this.targetLayer == "number" ? this.targetLayer : this.targetLayer === "selected" ? L.SELECTED : L.BASE;
|
|
905
912
|
}
|
|
906
913
|
createRenderTarget() {
|
|
907
|
-
for (let
|
|
908
|
-
const
|
|
914
|
+
for (let A = 0; A < X.MAX_LAYERS; A++) {
|
|
915
|
+
const e = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, s = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height;
|
|
909
916
|
this.renderTargets.push(
|
|
910
|
-
new
|
|
911
|
-
|
|
912
|
-
|
|
917
|
+
new d.WebGLRenderTarget(
|
|
918
|
+
e * this.qualityFactor,
|
|
919
|
+
s * this.qualityFactor,
|
|
913
920
|
{
|
|
914
|
-
minFilter:
|
|
915
|
-
magFilter:
|
|
916
|
-
format:
|
|
921
|
+
minFilter: d.LinearFilter,
|
|
922
|
+
magFilter: d.LinearFilter,
|
|
923
|
+
format: d.RGBAFormat,
|
|
917
924
|
stencilBuffer: !1,
|
|
918
925
|
depthBuffer: !0
|
|
919
926
|
}
|
|
@@ -921,12 +928,12 @@ class lt {
|
|
|
921
928
|
);
|
|
922
929
|
}
|
|
923
930
|
}
|
|
924
|
-
applyTextQuality(
|
|
925
|
-
if (typeof
|
|
926
|
-
this.qualityFactor = Math.max(0.1,
|
|
931
|
+
applyTextQuality(A) {
|
|
932
|
+
if (typeof A == "number") {
|
|
933
|
+
this.qualityFactor = Math.max(0.1, A);
|
|
927
934
|
return;
|
|
928
935
|
}
|
|
929
|
-
switch (
|
|
936
|
+
switch (A) {
|
|
930
937
|
case "low":
|
|
931
938
|
this.qualityFactor = 1;
|
|
932
939
|
break;
|
|
@@ -941,49 +948,71 @@ class lt {
|
|
|
941
948
|
break;
|
|
942
949
|
}
|
|
943
950
|
}
|
|
951
|
+
getQualityFactor(A) {
|
|
952
|
+
if (typeof A == "number")
|
|
953
|
+
return Math.max(0.1, A);
|
|
954
|
+
switch (A) {
|
|
955
|
+
case "low":
|
|
956
|
+
return 1;
|
|
957
|
+
case "high":
|
|
958
|
+
return 4;
|
|
959
|
+
default:
|
|
960
|
+
return 2;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
updateScroll() {
|
|
964
|
+
const A = this.target.getBoundingClientRect();
|
|
965
|
+
this.currentScrollX += this.lastTargetLeft - A.left, this.currentScrollY += this.lastTargetTop - A.top, this.lastTargetLeft = A.left, this.lastTargetTop = A.top;
|
|
966
|
+
}
|
|
967
|
+
getScrollX() {
|
|
968
|
+
return this.currentScrollX;
|
|
969
|
+
}
|
|
970
|
+
getScrollY() {
|
|
971
|
+
return this.currentScrollY;
|
|
972
|
+
}
|
|
944
973
|
mount() {
|
|
945
974
|
this.mountContainer.prepend(this.canvas), this.canvas.style.pointerEvents = this.mode === "overlay" ? "none" : "auto", this.updateCanvasLayout();
|
|
946
975
|
}
|
|
947
976
|
updateCanvasLayout() {
|
|
948
|
-
const
|
|
949
|
-
this.canvas.style.width = `${
|
|
950
|
-
}
|
|
951
|
-
updateUniforms(
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
977
|
+
const A = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, e = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height;
|
|
978
|
+
this.canvas.style.width = `${A}px`, this.canvas.style.height = `${e}px`, this.mode === "duplicate" ? (this.canvas.style.position = "", this.canvas.style.top = "", this.canvas.style.left = "", this.canvas.style.display = "block") : (this.canvas.style.position = this.isViewport ? "fixed" : "absolute", this.canvas.style.top = this.isViewport ? `-${this.overscan}px` : `${this.target.offsetTop}px`, this.canvas.style.left = this.isViewport ? `-${this.overscan}px` : `${this.target.offsetLeft}px`, this.canvas.style.display = "block");
|
|
979
|
+
}
|
|
980
|
+
updateUniforms(A, e) {
|
|
981
|
+
const s = this.registry.get(A);
|
|
982
|
+
s && (s.traverse((r) => {
|
|
983
|
+
r.isMesh && r.material && K.forceUpdateUniforms(
|
|
984
|
+
r.material,
|
|
985
|
+
e
|
|
957
986
|
);
|
|
958
|
-
}),
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
987
|
+
}), s.userData.nativeMesh && s.userData.nativeMesh.traverse((r) => {
|
|
988
|
+
r.isMesh && r.material && K.forceUpdateUniforms(
|
|
989
|
+
r.material,
|
|
990
|
+
e
|
|
962
991
|
);
|
|
963
992
|
}));
|
|
964
993
|
}
|
|
965
994
|
dispose() {
|
|
966
995
|
this.renderer.dispose(), this.canvas.remove(), this.textureManager.disposeAll();
|
|
967
996
|
}
|
|
968
|
-
setSize(
|
|
969
|
-
this.renderer.setSize(
|
|
970
|
-
for (const
|
|
971
|
-
|
|
972
|
-
this.camera.left =
|
|
973
|
-
}
|
|
974
|
-
syncScene(
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
const
|
|
978
|
-
if (
|
|
979
|
-
this.scene.remove(
|
|
980
|
-
for (const
|
|
981
|
-
|
|
982
|
-
this.fixedMeshes.delete(
|
|
983
|
-
(
|
|
984
|
-
) :
|
|
985
|
-
|
|
986
|
-
}), this.registry.remove(
|
|
997
|
+
setSize(A, e) {
|
|
998
|
+
this.renderer.setSize(A, e);
|
|
999
|
+
for (const s of this.renderTargets)
|
|
1000
|
+
s.setSize(A * this.qualityFactor, e * this.qualityFactor);
|
|
1001
|
+
this.camera.left = A / -2, this.camera.right = A / 2, this.camera.top = e / 2, this.camera.bottom = e / -2, this.camera.updateProjectionMatrix();
|
|
1002
|
+
}
|
|
1003
|
+
syncScene(A, e) {
|
|
1004
|
+
const s = this.target.getBoundingClientRect(), r = this.isViewport ? window.innerWidth + this.overscan * 2 : s.width, o = this.isViewport ? window.innerHeight + this.overscan * 2 : s.height, i = this.isViewport ? this.canvas.clientWidth : this.targetRect.width, g = this.isViewport ? this.canvas.clientHeight : this.targetRect.height, n = Math.abs(r - i) > 0.1 || Math.abs(o - g) > 0.1, a = this.mode === "overlay" && (Math.abs(s.top - this.targetRect.top) > 0.1 || Math.abs(s.left - this.targetRect.left) > 0.1);
|
|
1005
|
+
n ? (this.targetRect = s, this.targetPageX = s.left + this.getScrollX(), this.targetPageY = s.top + this.getScrollY(), this.setSize(r, o), this.updateCanvasLayout()) : a ? (this.targetRect = s, this.targetPageX = s.left + this.getScrollX(), this.targetPageY = s.top + this.getScrollY(), this.updateCanvasLayout()) : (this.targetRect = s, this.targetPageX = s.left + this.getScrollX(), this.targetPageY = s.top + this.getScrollY()), this.renderOrder = 0, this.reconcileNode(A), e.size > 0 && e.forEach((I) => {
|
|
1006
|
+
const c = this.registry.get(I);
|
|
1007
|
+
if (c) {
|
|
1008
|
+
this.scene.remove(c);
|
|
1009
|
+
for (const l of this.travelersByLayer)
|
|
1010
|
+
l.delete(c);
|
|
1011
|
+
this.fixedMeshes.delete(c), c.geometry.dispose(), c.userData.nativeMesh && (this.scene.remove(c.userData.nativeMesh), Array.isArray(c.userData.nativeMesh.material) ? c.userData.nativeMesh.material.forEach(
|
|
1012
|
+
(l) => l.dispose()
|
|
1013
|
+
) : c.userData.nativeMesh.material.dispose(), c.userData.nativeMesh.geometry.dispose()), c.traverse((l) => {
|
|
1014
|
+
l instanceof d.Mesh && (l.geometry && l.geometry.dispose(), l.material && (Array.isArray(l.material) ? l.material.forEach((B) => B.dispose()) : l.material.dispose()));
|
|
1015
|
+
}), this.registry.remove(I), this.textureManager.unregister(I);
|
|
987
1016
|
}
|
|
988
1017
|
});
|
|
989
1018
|
}
|
|
@@ -991,804 +1020,975 @@ class lt {
|
|
|
991
1020
|
// => 이 과정에서 scene node에 있는 ele를 넣은 hash => activeElements
|
|
992
1021
|
// => 이후 activeElements를 이용하여 mesh를 정리!!!+ map에서도 삭제
|
|
993
1022
|
// private reconcileNode(node: SceneNode, activeElements: Set<HTMLElement>) {
|
|
994
|
-
reconcileNode(
|
|
995
|
-
var
|
|
996
|
-
let
|
|
997
|
-
const
|
|
998
|
-
if (
|
|
999
|
-
const
|
|
1023
|
+
reconcileNode(A) {
|
|
1024
|
+
var r, o;
|
|
1025
|
+
let e = this.registry.get(A.element);
|
|
1026
|
+
const s = JSON.stringify(A.shaderHooks || null);
|
|
1027
|
+
if (e && e.userData.shaderHash !== s && (this.scene.remove(e), e.geometry.dispose(), e.material instanceof d.Material && e.material.dispose(), this.registry.remove(A.element), e = void 0), !e) {
|
|
1028
|
+
const i = new d.PlaneGeometry(1, 1), g = A.isTraveler ? (r = this.renderTargets[A.captureLayer - 2]) == null ? void 0 : r.texture : this.textureManager.get(A.element), n = K.create(
|
|
1000
1029
|
"BOX",
|
|
1001
|
-
|
|
1030
|
+
A.styles,
|
|
1002
1031
|
"",
|
|
1003
|
-
|
|
1004
|
-
|
|
1032
|
+
A.rect.width,
|
|
1033
|
+
A.rect.height,
|
|
1005
1034
|
this.qualityFactor,
|
|
1006
|
-
|
|
1007
|
-
|
|
1035
|
+
g,
|
|
1036
|
+
A.shaderHooks
|
|
1008
1037
|
);
|
|
1009
|
-
|
|
1038
|
+
e = new d.Mesh(i, n), A.type === "TEXT" && (e.name = "BG_MESH"), this.scene.add(e), this.registry.register(A.element, e), e.userData.baseMaterial = n, e.userData.domElement = A.element, e.userData.shaderHash = s;
|
|
1010
1039
|
}
|
|
1011
|
-
if (
|
|
1012
|
-
for (let
|
|
1013
|
-
|
|
1040
|
+
if (e.userData.clipElements = A.clipElements, e.userData.wasmIndex = A.wasmIndex, (o = A.nativeStyles) != null && o.transform ? e.userData.nativeTransform = A.nativeStyles.transform : e.userData.nativeTransform = void 0, this.updateMeshProperties(e, A), this.updateMeshLayers(e, A), A.isTraveler)
|
|
1041
|
+
for (let i = 0; i < X.MAX_LAYERS; i++)
|
|
1042
|
+
i === A.captureLayer - 2 ? this.travelersByLayer[i].add(e) : this.travelersByLayer[i].delete(e);
|
|
1014
1043
|
else
|
|
1015
|
-
for (const
|
|
1016
|
-
|
|
1017
|
-
if (
|
|
1018
|
-
for (const
|
|
1019
|
-
this.reconcileNode(
|
|
1044
|
+
for (const i of this.travelersByLayer)
|
|
1045
|
+
i.delete(e);
|
|
1046
|
+
if (A.isFixed ? this.fixedMeshes.add(e) : this.fixedMeshes.delete(e), A.styles.imageSrc ? this.textureManager.register(A.element, A.styles.imageSrc) : this.textureManager.unregister(A.element), A.type === "BOX")
|
|
1047
|
+
for (const i of A.children)
|
|
1048
|
+
this.reconcileNode(i);
|
|
1020
1049
|
else
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1050
|
+
A.type === "TEXT" && (this.reconcileTextChild(e, A, !1), e.userData.nativeMesh && A.nativeStyles && this.reconcileTextChild(
|
|
1051
|
+
e.userData.nativeMesh,
|
|
1052
|
+
A,
|
|
1024
1053
|
!0
|
|
1025
1054
|
));
|
|
1026
1055
|
}
|
|
1027
|
-
reconcileTextChild(
|
|
1056
|
+
reconcileTextChild(A, e, s) {
|
|
1028
1057
|
var a;
|
|
1029
|
-
const
|
|
1030
|
-
{ text:
|
|
1031
|
-
],
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1034
|
-
(
|
|
1035
|
-
).forEach((
|
|
1036
|
-
var
|
|
1037
|
-
const
|
|
1038
|
-
(
|
|
1058
|
+
const r = e.textLines || [
|
|
1059
|
+
{ text: e.textContent || "", rect: e.rect }
|
|
1060
|
+
], o = s ? e.nativeStyles : e.textStyles, i = JSON.stringify(o) + e.textContent + r.map((I) => I.text).join("|"), g = (a = A.userData) == null ? void 0 : a.textChildStyleHash;
|
|
1061
|
+
if (e.dirtyMask & TA || i !== g) {
|
|
1062
|
+
A.children.filter(
|
|
1063
|
+
(C) => C.name.startsWith("TEXT_CHILD")
|
|
1064
|
+
).forEach((C) => {
|
|
1065
|
+
var Q;
|
|
1066
|
+
const w = C;
|
|
1067
|
+
(Q = w.material.map) == null || Q.dispose(), w.geometry.dispose(), A.remove(w);
|
|
1039
1068
|
});
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1069
|
+
const c = e.rect, l = c.x + c.width / 2, B = c.y + c.height / 2;
|
|
1070
|
+
r.forEach((C, w) => {
|
|
1071
|
+
const Q = K.create(
|
|
1043
1072
|
"TEXT",
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1073
|
+
o,
|
|
1074
|
+
C.text,
|
|
1075
|
+
C.rect.width,
|
|
1076
|
+
C.rect.height,
|
|
1048
1077
|
this.qualityFactor
|
|
1049
|
-
),
|
|
1050
|
-
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1078
|
+
), b = new d.PlaneGeometry(1, 1), f = new d.Mesh(b, Q);
|
|
1079
|
+
f.name = `TEXT_CHILD_${w}`;
|
|
1080
|
+
const y = e.rect.width === 0 ? 1 : C.rect.width / e.rect.width, U = e.rect.height === 0 ? 1 : C.rect.height / e.rect.height;
|
|
1081
|
+
f.scale.set(y, U, 1);
|
|
1082
|
+
const S = C.rect.x + C.rect.width / 2, D = C.rect.y + C.rect.height / 2, u = S - l, Y = -(D - B);
|
|
1083
|
+
f.position.set(
|
|
1084
|
+
e.rect.width === 0 ? 0 : u / e.rect.width,
|
|
1085
|
+
e.rect.height === 0 ? 0 : Y / e.rect.height,
|
|
1057
1086
|
5e-3
|
|
1058
|
-
),
|
|
1059
|
-
}),
|
|
1087
|
+
), A.add(f);
|
|
1088
|
+
}), A.userData.textChildStyleHash = i;
|
|
1060
1089
|
}
|
|
1061
|
-
|
|
1062
|
-
if (!
|
|
1090
|
+
A.children.forEach((I) => {
|
|
1091
|
+
if (!I.name.startsWith("TEXT_CHILD"))
|
|
1063
1092
|
return;
|
|
1064
|
-
const
|
|
1065
|
-
if (
|
|
1066
|
-
|
|
1093
|
+
const c = I;
|
|
1094
|
+
if (s && e.nativeLayer !== void 0)
|
|
1095
|
+
c.layers.set(L.HIDDEN), e.visibility & j && c.layers.enable(L.getCaptureLayer(e.nativeLayer));
|
|
1067
1096
|
else {
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1070
|
-
if (!
|
|
1071
|
-
for (let
|
|
1072
|
-
|
|
1097
|
+
const l = e.visibility & j ? L.BASE : L.HIDDEN;
|
|
1098
|
+
if (c.layers.set(l), e.visibility & lA && c.layers.enable(L.SELECTED), e.visibility & j)
|
|
1099
|
+
if (!s && e.nativeLayer !== void 0 && e.nativeStyles !== void 0)
|
|
1100
|
+
for (let B = e.captureLayer; B <= X.MAX_LAYERS + 1; B++)
|
|
1101
|
+
B !== e.nativeLayer && c.layers.enable(L.getCaptureLayer(B));
|
|
1073
1102
|
else
|
|
1074
|
-
for (let
|
|
1075
|
-
|
|
1103
|
+
for (let B = e.captureLayer; B <= X.MAX_LAYERS + 1; B++)
|
|
1104
|
+
c.layers.enable(L.getCaptureLayer(B));
|
|
1076
1105
|
}
|
|
1077
1106
|
});
|
|
1078
1107
|
}
|
|
1079
|
-
updateMeshProperties(
|
|
1080
|
-
var
|
|
1081
|
-
const { rect:
|
|
1082
|
-
|
|
1083
|
-
let
|
|
1084
|
-
|
|
1085
|
-
x:
|
|
1086
|
-
y:
|
|
1087
|
-
width:
|
|
1088
|
-
height:
|
|
1089
|
-
};
|
|
1108
|
+
updateMeshProperties(A, e) {
|
|
1109
|
+
var f, y, U, S, D;
|
|
1110
|
+
const { rect: s, styles: r } = e, o = this.renderer.getPixelRatio(), i = this.renderer.domElement.width / o, g = this.renderer.domElement.height / o;
|
|
1111
|
+
A.material = A.userData.baseMaterial;
|
|
1112
|
+
let n = ((f = A.material.userData) == null ? void 0 : f.shadowPadding) || 0;
|
|
1113
|
+
A.scale.set(s.width + n * 2, s.height + n * 2, 1), A.userData.domRect = {
|
|
1114
|
+
x: s.x,
|
|
1115
|
+
y: s.y,
|
|
1116
|
+
width: s.width,
|
|
1117
|
+
height: s.height
|
|
1118
|
+
}, A.userData.needsNativeReset = !0;
|
|
1090
1119
|
const a = 1e-3;
|
|
1091
1120
|
this.renderOrder++;
|
|
1092
|
-
|
|
1093
|
-
let d, m;
|
|
1121
|
+
let I, c;
|
|
1094
1122
|
if (this.isViewport)
|
|
1095
|
-
|
|
1123
|
+
I = s.x - window.innerWidth / 2 + s.width / 2, c = -s.y + window.innerHeight / 2 - s.height / 2;
|
|
1096
1124
|
else {
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1125
|
+
const u = s.x - this.targetPageX, Y = s.y - this.targetPageY;
|
|
1126
|
+
I = u - i / 2 + s.width / 2, c = -Y + g / 2 - s.height / 2;
|
|
1099
1127
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1128
|
+
A.position.set(
|
|
1129
|
+
I,
|
|
1130
|
+
c,
|
|
1131
|
+
r.zIndex + this.renderOrder * a
|
|
1104
1132
|
);
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
const
|
|
1108
|
-
let
|
|
1109
|
-
if (
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1133
|
+
const l = s.x, B = s.y;
|
|
1134
|
+
A.userData.basePosition = { x: I, y: c }, A.userData.originalBasePosition = { x: I, y: c }, A.userData.baseSize = { width: s.width, height: s.height }, A.userData.baseDOM = { x: l, y: B }, A.userData.isFixed = e.isFixed, A.userData.initialScroll = { x: window.scrollX, y: window.scrollY };
|
|
1135
|
+
const C = e.element.nodeType === Node.TEXT_NODE ? e.element.parentElement : e.element, w = window.getComputedStyle(C);
|
|
1136
|
+
let Q = 0, b = 0;
|
|
1137
|
+
if (w.transform && w.transform !== "none") {
|
|
1138
|
+
const u = new DOMMatrix(w.transform);
|
|
1139
|
+
Q = u.m41, b = u.m42;
|
|
1112
1140
|
}
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1141
|
+
if (A.userData.baseTransform = { x: Q, y: b }, delete A.userData.originRatioX, delete A.userData.originRatioY, K.update(
|
|
1142
|
+
A.userData.baseMaterial,
|
|
1115
1143
|
"BOX",
|
|
1116
|
-
|
|
1144
|
+
r,
|
|
1117
1145
|
"",
|
|
1118
|
-
|
|
1119
|
-
|
|
1146
|
+
s.width,
|
|
1147
|
+
s.height,
|
|
1120
1148
|
this.qualityFactor,
|
|
1121
|
-
|
|
1122
|
-
),
|
|
1123
|
-
if (!
|
|
1124
|
-
const
|
|
1149
|
+
e.isTraveler ? (y = this.renderTargets[e.captureLayer - 2]) == null ? void 0 : y.texture : this.textureManager.get(e.element)
|
|
1150
|
+
), e.nativeStyles && e.nativeRect) {
|
|
1151
|
+
if (!A.userData.nativeMesh) {
|
|
1152
|
+
const H = K.create(
|
|
1125
1153
|
"BOX",
|
|
1126
|
-
|
|
1154
|
+
e.nativeStyles,
|
|
1127
1155
|
"",
|
|
1128
|
-
|
|
1129
|
-
|
|
1156
|
+
e.nativeRect.width,
|
|
1157
|
+
e.nativeRect.height,
|
|
1130
1158
|
this.qualityFactor,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
),
|
|
1134
|
-
|
|
1159
|
+
e.isTraveler ? (U = this.renderTargets[e.captureLayer - 2]) == null ? void 0 : U.texture : e.nativeStyles.imageSrc && e.nativeStyles.imageSrc !== e.styles.imageSrc ? new d.TextureLoader().load(e.nativeStyles.imageSrc) : this.textureManager.get(e.element),
|
|
1160
|
+
e.shaderHooks
|
|
1161
|
+
), G = new d.Mesh(A.geometry, H);
|
|
1162
|
+
e.type === "TEXT" && (G.name = "BG_MESH"), this.scene.add(G), A.userData.nativeMesh = G;
|
|
1135
1163
|
}
|
|
1136
|
-
const
|
|
1137
|
-
let
|
|
1164
|
+
const u = A.userData.nativeMesh;
|
|
1165
|
+
let Y, gA;
|
|
1138
1166
|
if (this.isViewport)
|
|
1139
|
-
|
|
1167
|
+
Y = e.nativeRect.x - window.innerWidth / 2 + e.nativeRect.width / 2, gA = -e.nativeRect.y + window.innerHeight / 2 - e.nativeRect.height / 2;
|
|
1140
1168
|
else {
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1169
|
+
const H = e.nativeRect.x - this.targetPageX, G = e.nativeRect.y - this.targetPageY;
|
|
1170
|
+
Y = H - i / 2 + e.nativeRect.width / 2, gA = -G + g / 2 - e.nativeRect.height / 2;
|
|
1143
1171
|
}
|
|
1144
|
-
let
|
|
1145
|
-
if (
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
let
|
|
1149
|
-
|
|
1172
|
+
let cA = e.nativeRect.width, F = e.nativeRect.height, M = Y, P = gA;
|
|
1173
|
+
if (e.nativeStyles.transform) {
|
|
1174
|
+
const H = e.nativeStyles.transform, G = H.match(/scale\(([\d.]+%?)\)/);
|
|
1175
|
+
if (G) {
|
|
1176
|
+
let m = parseFloat(G[1]);
|
|
1177
|
+
G[1].includes("%") && (m /= 100), cA *= m, F *= m;
|
|
1150
1178
|
}
|
|
1151
|
-
const
|
|
1152
|
-
if (
|
|
1153
|
-
let
|
|
1154
|
-
|
|
1179
|
+
const $ = H.match(/scaleX\(([\d.]+%?)\)/);
|
|
1180
|
+
if ($) {
|
|
1181
|
+
let m = parseFloat($[1]);
|
|
1182
|
+
$[1].includes("%") && (m /= 100), cA *= m;
|
|
1155
1183
|
}
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1158
|
-
let
|
|
1159
|
-
|
|
1184
|
+
const IA = H.match(/scaleY\(([\d.]+%?)\)/);
|
|
1185
|
+
if (IA) {
|
|
1186
|
+
let m = parseFloat(IA[1]);
|
|
1187
|
+
IA[1].includes("%") && (m /= 100), F *= m;
|
|
1160
1188
|
}
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
const
|
|
1164
|
-
let
|
|
1165
|
-
|
|
1166
|
-
let
|
|
1167
|
-
|
|
1189
|
+
const iA = H.match(/translate\(([^,]+),\s*([^)]+)\)/);
|
|
1190
|
+
if (iA) {
|
|
1191
|
+
const m = iA[1].trim(), z = iA[2].trim();
|
|
1192
|
+
let EA = parseFloat(m);
|
|
1193
|
+
m.includes("%") && (EA = EA / 100 * e.nativeRect.width);
|
|
1194
|
+
let dA = parseFloat(z);
|
|
1195
|
+
z.includes("%") && (dA = dA / 100 * e.nativeRect.height), M += EA, P -= dA;
|
|
1168
1196
|
}
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1171
|
-
const
|
|
1172
|
-
let
|
|
1173
|
-
|
|
1197
|
+
const AA = H.match(/translateX\(([^)]+)\)/);
|
|
1198
|
+
if (AA) {
|
|
1199
|
+
const m = AA[1].trim();
|
|
1200
|
+
let z = parseFloat(m);
|
|
1201
|
+
m.includes("%") && (z = z / 100 * e.nativeRect.width), M += z;
|
|
1174
1202
|
}
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
const
|
|
1178
|
-
let
|
|
1179
|
-
|
|
1203
|
+
const rA = H.match(/translateY\(([^)]+)\)/);
|
|
1204
|
+
if (rA) {
|
|
1205
|
+
const m = rA[1].trim();
|
|
1206
|
+
let z = parseFloat(m);
|
|
1207
|
+
m.includes("%") && (z = z / 100 * e.nativeRect.height), P -= z;
|
|
1180
1208
|
}
|
|
1181
1209
|
}
|
|
1182
|
-
let
|
|
1183
|
-
|
|
1210
|
+
let BA = ((S = u.material.userData) == null ? void 0 : S.shadowPadding) || 0;
|
|
1211
|
+
u.scale.set(cA + BA * 2, F + BA * 2, 1), u.position.set(
|
|
1184
1212
|
M,
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
),
|
|
1188
|
-
|
|
1213
|
+
P,
|
|
1214
|
+
e.nativeStyles.zIndex + this.renderOrder * a
|
|
1215
|
+
), K.update(
|
|
1216
|
+
u.material,
|
|
1189
1217
|
"BOX",
|
|
1190
|
-
|
|
1218
|
+
e.nativeStyles,
|
|
1191
1219
|
"",
|
|
1192
|
-
|
|
1193
|
-
|
|
1220
|
+
e.nativeRect.width,
|
|
1221
|
+
e.nativeRect.height,
|
|
1194
1222
|
this.qualityFactor,
|
|
1195
|
-
|
|
1223
|
+
e.isTraveler ? (D = this.renderTargets[e.captureLayer - 2]) == null ? void 0 : D.texture : u.material.uniforms.uTexture.value || this.textureManager.get(e.element)
|
|
1196
1224
|
);
|
|
1197
1225
|
} else
|
|
1198
|
-
|
|
1199
|
-
}
|
|
1200
|
-
updateMeshLayers(
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1206
|
-
for (let
|
|
1207
|
-
|
|
1226
|
+
A.userData.nativeMesh && (this.scene.remove(A.userData.nativeMesh), A.userData.nativeMesh.material instanceof d.Material && A.userData.nativeMesh.material.dispose(), delete A.userData.nativeMesh);
|
|
1227
|
+
}
|
|
1228
|
+
updateMeshLayers(A, e) {
|
|
1229
|
+
const s = e.visibility & j ? L.BASE : L.HIDDEN;
|
|
1230
|
+
if (A.layers.set(s), e.visibility & lA && A.layers.enable(L.SELECTED), A.userData.nativeMesh && e.nativeLayer !== void 0) {
|
|
1231
|
+
const r = A.userData.nativeMesh;
|
|
1232
|
+
if (r.layers.set(L.HIDDEN), e.visibility & j) {
|
|
1233
|
+
r.layers.enable(L.getCaptureLayer(e.nativeLayer));
|
|
1234
|
+
for (let o = e.captureLayer; o <= X.MAX_LAYERS + 1; o++)
|
|
1235
|
+
o !== e.nativeLayer && A.layers.enable(L.getCaptureLayer(o));
|
|
1208
1236
|
}
|
|
1209
|
-
} else if (
|
|
1210
|
-
for (let
|
|
1211
|
-
|
|
1237
|
+
} else if (e.visibility & j)
|
|
1238
|
+
for (let r = e.captureLayer; r <= X.MAX_LAYERS + 1; r++)
|
|
1239
|
+
A.layers.enable(L.getCaptureLayer(r));
|
|
1212
1240
|
}
|
|
1213
|
-
captureRenderTarget(
|
|
1214
|
-
if (
|
|
1241
|
+
captureRenderTarget(A, e, s) {
|
|
1242
|
+
if (A.size === 0 || !s)
|
|
1215
1243
|
return;
|
|
1216
|
-
const
|
|
1217
|
-
this.renderer.getClearColor(
|
|
1218
|
-
const
|
|
1219
|
-
for (const
|
|
1220
|
-
|
|
1221
|
-
const
|
|
1222
|
-
let
|
|
1223
|
-
typeof this.clipArea == "number" ?
|
|
1224
|
-
const
|
|
1225
|
-
this.renderer.setScissor(
|
|
1244
|
+
const r = new d.Color(), o = this.renderer.getClearAlpha();
|
|
1245
|
+
this.renderer.getClearColor(r), this.renderer.setClearColor(0, 0), this.renderer.setRenderTarget(s), this.renderer.clear(), this.renderer.autoClear = !1, this.renderer.setScissorTest(!0), this.camera.layers.set(e);
|
|
1246
|
+
const i = new d.Vector3(), g = this.isViewport ? window.innerWidth + this.overscan * 2 : this.targetRect.width, n = this.isViewport ? window.innerHeight + this.overscan * 2 : this.targetRect.height, a = this.renderer.getPixelRatio();
|
|
1247
|
+
for (const I of A) {
|
|
1248
|
+
i.setFromMatrixPosition(I.matrixWorld), i.project(this.camera);
|
|
1249
|
+
const c = (i.x + 1) / 2 * g, l = (i.y + 1) / 2 * n;
|
|
1250
|
+
let B = 0, C = 1;
|
|
1251
|
+
typeof this.clipArea == "number" ? C = this.clipArea : this.clipArea.endsWith("%") ? C = parseFloat(this.clipArea) / 100 : this.clipArea.endsWith("px") && (B = parseFloat(this.clipArea));
|
|
1252
|
+
const w = I.scale.x * C + 0.5, Q = I.scale.y * C + 0.5, b = c - w / 2, f = l - Q / 2, y = (b * this.qualityFactor - B) / a, U = (f * this.qualityFactor - B) / a, S = (w * this.qualityFactor + B * 2) / a, D = (Q * this.qualityFactor + B * 2) / a;
|
|
1253
|
+
this.renderer.setScissor(y, U, S, D), this.renderer.render(this.scene, this.camera);
|
|
1226
1254
|
}
|
|
1227
|
-
this.renderer.setScissorTest(!1), this.renderer.autoClear = !0, this.renderer.setRenderTarget(null), this.camera.layers.set(this.getSceneLayer()), this.renderer.setClearColor(
|
|
1255
|
+
this.renderer.setScissorTest(!1), this.renderer.autoClear = !0, this.renderer.setRenderTarget(null), this.camera.layers.set(this.getSceneLayer()), this.renderer.setClearColor(r, o);
|
|
1228
1256
|
}
|
|
1229
1257
|
render() {
|
|
1230
|
-
for (let
|
|
1231
|
-
const a =
|
|
1258
|
+
for (let n = 0; n < X.MAX_LAYERS; n++) {
|
|
1259
|
+
const a = n + 1;
|
|
1232
1260
|
this.captureRenderTarget(
|
|
1233
|
-
this.travelersByLayer[
|
|
1234
|
-
|
|
1235
|
-
this.renderTargets[
|
|
1261
|
+
this.travelersByLayer[n],
|
|
1262
|
+
L.getCaptureLayer(a),
|
|
1263
|
+
this.renderTargets[n]
|
|
1236
1264
|
);
|
|
1237
1265
|
}
|
|
1238
|
-
const
|
|
1266
|
+
const A = this.renderer.getContext(), e = this.renderer.getPixelRatio(), s = this.renderer.domElement.height / e, r = this.renderer.domElement, o = r.getBoundingClientRect().top, i = r.getBoundingClientRect().left, g = (n, a) => {
|
|
1239
1267
|
if (a && a.width > 0 && a.height > 0) {
|
|
1240
|
-
const
|
|
1241
|
-
(
|
|
1242
|
-
),
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
},
|
|
1246
|
-
|
|
1247
|
-
},
|
|
1268
|
+
const I = Math.floor((a.x - i) * e), c = Math.floor(
|
|
1269
|
+
(s - (a.y - o + a.height)) * e
|
|
1270
|
+
), l = Math.ceil(a.width * e), B = Math.ceil(a.height * e);
|
|
1271
|
+
n.onBeforeRender = () => {
|
|
1272
|
+
A.enable(A.SCISSOR_TEST), A.scissor(I, c, l, B);
|
|
1273
|
+
}, n.onAfterRender = () => {
|
|
1274
|
+
A.disable(A.SCISSOR_TEST);
|
|
1275
|
+
}, n.__hasScissorHook = !0;
|
|
1248
1276
|
} else
|
|
1249
|
-
|
|
1250
|
-
},
|
|
1251
|
-
},
|
|
1277
|
+
n.__hasScissorHook && (n.onBeforeRender = () => {
|
|
1278
|
+
}, n.onAfterRender = () => {
|
|
1279
|
+
}, n.__hasScissorHook = !1);
|
|
1252
1280
|
};
|
|
1253
|
-
this.scene.children.forEach((
|
|
1254
|
-
var
|
|
1255
|
-
const a =
|
|
1256
|
-
|
|
1257
|
-
|
|
1281
|
+
this.scene.children.forEach((n) => {
|
|
1282
|
+
var c;
|
|
1283
|
+
const a = n, I = (c = a.userData) == null ? void 0 : c.scissorRect;
|
|
1284
|
+
g(a, I), a.children.forEach((l) => {
|
|
1285
|
+
l.name.startsWith("TEXT_CHILD") && g(l, I);
|
|
1258
1286
|
});
|
|
1259
1287
|
}), this.renderer.render(this.scene, this.camera);
|
|
1260
1288
|
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1289
|
+
saveInitialLocals(A) {
|
|
1290
|
+
this.scene.children.forEach((e) => {
|
|
1291
|
+
const s = e;
|
|
1292
|
+
if (s.userData.wasmIndex !== void 0) {
|
|
1293
|
+
const r = s.userData.wasmIndex * tA;
|
|
1294
|
+
s.userData.initialLocalX = A[r + pA], s.userData.initialLocalY = A[r + mA];
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
syncMeshesByWasm(A) {
|
|
1299
|
+
const e = this.renderer.getPixelRatio(), s = this.renderer.domElement.width / e, r = this.renderer.domElement.height / e;
|
|
1263
1300
|
this.scene.children.forEach((o) => {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
if (!n.userData || !n.userData.domElement)
|
|
1301
|
+
const i = o;
|
|
1302
|
+
if (!i.userData || i.userData.wasmIndex === void 0)
|
|
1267
1303
|
return;
|
|
1268
|
-
const
|
|
1269
|
-
if (!
|
|
1304
|
+
const n = i.userData.wasmIndex * tA, a = A[n + te], I = A[n + ie], c = i.userData.domRect;
|
|
1305
|
+
if (!c)
|
|
1270
1306
|
return;
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
const m = n.userData.clipElements;
|
|
1286
|
-
if (m && m.length > 0) {
|
|
1287
|
-
let y = -1 / 0, E = -1 / 0, L = 1 / 0, C = 1 / 0;
|
|
1288
|
-
for (const b of m) {
|
|
1289
|
-
const x = b.getBoundingClientRect();
|
|
1290
|
-
y = Math.max(y, x.left), E = Math.max(E, x.top), L = Math.min(L, x.right), C = Math.min(C, x.bottom);
|
|
1291
|
-
}
|
|
1292
|
-
n.userData.scissorRect = {
|
|
1293
|
-
x: y,
|
|
1294
|
-
y: E,
|
|
1295
|
-
width: Math.max(0, L - y),
|
|
1296
|
-
height: Math.max(0, C - E)
|
|
1297
|
-
};
|
|
1298
|
-
} else
|
|
1299
|
-
n.userData.scissorRect = void 0;
|
|
1300
|
-
let g, R;
|
|
1301
|
-
if (this.isViewport)
|
|
1302
|
-
g = a.x - window.innerWidth / 2 + a.width / 2, R = -a.y + window.innerHeight / 2 - a.height / 2;
|
|
1307
|
+
const l = this.fixedMeshes.has(i), B = l ? 0 : this.getScrollX(), C = l ? 0 : this.getScrollY();
|
|
1308
|
+
let w, Q;
|
|
1309
|
+
if (this.isViewport) {
|
|
1310
|
+
const f = a - B, y = I - C;
|
|
1311
|
+
w = f - window.innerWidth / 2 + c.width / 2, Q = -y + window.innerHeight / 2 - c.height / 2;
|
|
1312
|
+
} else {
|
|
1313
|
+
const f = a - this.targetPageX, y = I - this.targetPageY;
|
|
1314
|
+
w = f - s / 2 + c.width / 2, Q = -y + r / 2 - c.height / 2;
|
|
1315
|
+
}
|
|
1316
|
+
const b = i.position.z;
|
|
1317
|
+
if (i.position.set(w, Q, b), i.userData.nativeMesh) {
|
|
1318
|
+
const f = i.userData.nativeMesh;
|
|
1319
|
+
if (i.userData.needsNativeReset)
|
|
1320
|
+
i.userData.needsNativeReset = !1;
|
|
1303
1321
|
else {
|
|
1304
|
-
const y =
|
|
1305
|
-
|
|
1306
|
-
}
|
|
1307
|
-
n.position.setX(g), n.position.setY(R);
|
|
1308
|
-
let v = ((h = n.material.userData) == null ? void 0 : h.shadowPadding) || 0;
|
|
1309
|
-
if (n.scale.set(a.width + v * 2, a.height + v * 2, 1), n.updateMatrixWorld(), n.material instanceof w.ShaderMaterial && H.forceUpdateUniforms(n.material, {
|
|
1310
|
-
width: a.width,
|
|
1311
|
-
height: a.height
|
|
1312
|
-
}), n.userData.nativeMesh) {
|
|
1313
|
-
const y = n.userData.nativeMesh;
|
|
1314
|
-
let E = a.width, L = a.height, C = g, b = R;
|
|
1315
|
-
if (n.userData.nativeTransform) {
|
|
1316
|
-
const X = n.userData.nativeTransform, Y = X.match(/scale\(([\d.]+%?)\)/);
|
|
1317
|
-
if (Y) {
|
|
1318
|
-
let M = parseFloat(Y[1]);
|
|
1319
|
-
Y[1].includes("%") && (M /= 100), E *= M, L *= M;
|
|
1320
|
-
}
|
|
1321
|
-
const A = X.match(/scaleX\(([\d.]+%?)\)/);
|
|
1322
|
-
if (A) {
|
|
1323
|
-
let M = parseFloat(A[1]);
|
|
1324
|
-
A[1].includes("%") && (M /= 100), E *= M;
|
|
1325
|
-
}
|
|
1326
|
-
const N = X.match(/scaleY\(([\d.]+%?)\)/);
|
|
1327
|
-
if (N) {
|
|
1328
|
-
let M = parseFloat(N[1]);
|
|
1329
|
-
N[1].includes("%") && (M /= 100), L *= M;
|
|
1330
|
-
}
|
|
1331
|
-
const U = X.match(/translate\(([^,]+),\s*([^)]+)\)/);
|
|
1332
|
-
if (U) {
|
|
1333
|
-
const M = U[1].trim(), B = U[2].trim();
|
|
1334
|
-
let Z = parseFloat(M);
|
|
1335
|
-
M.includes("%") && (Z = Z / 100 * a.width);
|
|
1336
|
-
let F = parseFloat(B);
|
|
1337
|
-
B.includes("%") && (F = F / 100 * a.height), C += Z, b -= F;
|
|
1338
|
-
}
|
|
1339
|
-
const K = X.match(/translateX\(([^)]+)\)/);
|
|
1340
|
-
if (K) {
|
|
1341
|
-
const M = K[1].trim();
|
|
1342
|
-
let B = parseFloat(M);
|
|
1343
|
-
M.includes("%") && (B = B / 100 * a.width), C += B;
|
|
1344
|
-
}
|
|
1345
|
-
const J = X.match(/translateY\(([^)]+)\)/);
|
|
1346
|
-
if (J) {
|
|
1347
|
-
const M = J[1].trim();
|
|
1348
|
-
let B = parseFloat(M);
|
|
1349
|
-
M.includes("%") && (B = B / 100 * a.height), b -= B;
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
let x = ((d = y.material.userData) == null ? void 0 : d.shadowPadding) || 0;
|
|
1353
|
-
y.position.setX(C), y.position.setY(b), y.scale.set(E + x * 2, L + x * 2, 1), y.updateMatrixWorld(), y.material instanceof w.ShaderMaterial && H.forceUpdateUniforms(y.material, {
|
|
1354
|
-
width: E,
|
|
1355
|
-
height: L
|
|
1356
|
-
});
|
|
1322
|
+
const y = w - i.userData.basePosition.x, U = Q - i.userData.basePosition.y;
|
|
1323
|
+
f.position.setX(f.position.x + y), f.position.setY(f.position.y + U);
|
|
1357
1324
|
}
|
|
1358
1325
|
}
|
|
1326
|
+
i.userData.basePosition.x = w, i.userData.basePosition.y = Q;
|
|
1359
1327
|
});
|
|
1360
1328
|
}
|
|
1361
1329
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const
|
|
1364
|
-
let
|
|
1365
|
-
const
|
|
1366
|
-
for (let
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1370
|
-
if (
|
|
1371
|
-
|
|
1330
|
+
function Fe(t) {
|
|
1331
|
+
const A = t.textContent || "", e = [];
|
|
1332
|
+
let s = "", r = null, o = -1;
|
|
1333
|
+
const i = (a, I) => {
|
|
1334
|
+
for (let c = 0; c < a.length; c++) {
|
|
1335
|
+
const l = a[c], B = document.createRange();
|
|
1336
|
+
B.setStart(t, I + c), B.setEnd(t, I + c + 1);
|
|
1337
|
+
const C = B.getBoundingClientRect();
|
|
1338
|
+
if (C.width === 0 && C.height === 0) {
|
|
1339
|
+
s += l;
|
|
1372
1340
|
continue;
|
|
1373
1341
|
}
|
|
1374
|
-
|
|
1375
|
-
text:
|
|
1342
|
+
o === -1 || Math.abs(C.top - o) > C.height / 2 ? (s && r && e.push({
|
|
1343
|
+
text: s,
|
|
1376
1344
|
rect: {
|
|
1377
|
-
left:
|
|
1378
|
-
top:
|
|
1379
|
-
width:
|
|
1380
|
-
height:
|
|
1345
|
+
left: r.left,
|
|
1346
|
+
top: r.top,
|
|
1347
|
+
width: r.right - r.left,
|
|
1348
|
+
height: r.bottom - r.top
|
|
1381
1349
|
}
|
|
1382
|
-
}),
|
|
1383
|
-
left:
|
|
1384
|
-
top:
|
|
1385
|
-
right:
|
|
1386
|
-
bottom:
|
|
1387
|
-
},
|
|
1388
|
-
|
|
1389
|
-
|
|
1350
|
+
}), s = l, r = {
|
|
1351
|
+
left: C.left,
|
|
1352
|
+
top: C.top,
|
|
1353
|
+
right: C.right,
|
|
1354
|
+
bottom: C.bottom
|
|
1355
|
+
}, o = C.top) : (s += l, r && (r.left = Math.min(r.left, C.left), r.top = Math.min(r.top, C.top), r.right = Math.max(r.right, C.right), r.bottom = Math.max(
|
|
1356
|
+
r.bottom,
|
|
1357
|
+
C.bottom
|
|
1390
1358
|
)));
|
|
1391
1359
|
}
|
|
1392
|
-
},
|
|
1393
|
-
let
|
|
1394
|
-
for (const a of
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
const
|
|
1398
|
-
if (
|
|
1399
|
-
|
|
1360
|
+
}, g = A.match(/[^\s\-]+\-?|\-|\s+/g) || [];
|
|
1361
|
+
let n = 0;
|
|
1362
|
+
for (const a of g) {
|
|
1363
|
+
const I = document.createRange();
|
|
1364
|
+
I.setStart(t, n), I.setEnd(t, n + a.length);
|
|
1365
|
+
const c = I.getClientRects();
|
|
1366
|
+
if (c.length > 1)
|
|
1367
|
+
i(a, n);
|
|
1400
1368
|
else {
|
|
1401
|
-
const
|
|
1402
|
-
if (
|
|
1403
|
-
|
|
1369
|
+
const l = c.length === 1 ? c[0] : I.getBoundingClientRect();
|
|
1370
|
+
if (l.width === 0 && l.height === 0) {
|
|
1371
|
+
s += a, n += a.length;
|
|
1404
1372
|
continue;
|
|
1405
1373
|
}
|
|
1406
|
-
|
|
1407
|
-
text:
|
|
1374
|
+
o === -1 || Math.abs(l.top - o) > l.height / 2 ? (s && r && e.push({
|
|
1375
|
+
text: s,
|
|
1408
1376
|
rect: {
|
|
1409
|
-
left:
|
|
1410
|
-
top:
|
|
1411
|
-
width:
|
|
1412
|
-
height:
|
|
1377
|
+
left: r.left,
|
|
1378
|
+
top: r.top,
|
|
1379
|
+
width: r.right - r.left,
|
|
1380
|
+
height: r.bottom - r.top
|
|
1413
1381
|
}
|
|
1414
|
-
}),
|
|
1415
|
-
left:
|
|
1416
|
-
top:
|
|
1417
|
-
right:
|
|
1418
|
-
bottom:
|
|
1419
|
-
},
|
|
1420
|
-
|
|
1421
|
-
|
|
1382
|
+
}), s = a, r = {
|
|
1383
|
+
left: l.left,
|
|
1384
|
+
top: l.top,
|
|
1385
|
+
right: l.right,
|
|
1386
|
+
bottom: l.bottom
|
|
1387
|
+
}, o = l.top) : (s += a, r && (r.left = Math.min(r.left, l.left), r.top = Math.min(r.top, l.top), r.right = Math.max(r.right, l.right), r.bottom = Math.max(
|
|
1388
|
+
r.bottom,
|
|
1389
|
+
l.bottom
|
|
1422
1390
|
)));
|
|
1423
1391
|
}
|
|
1424
|
-
|
|
1392
|
+
n += a.length;
|
|
1425
1393
|
}
|
|
1426
|
-
return
|
|
1427
|
-
text:
|
|
1394
|
+
return s && r && e.push({
|
|
1395
|
+
text: s,
|
|
1428
1396
|
rect: {
|
|
1429
|
-
left:
|
|
1430
|
-
top:
|
|
1431
|
-
width:
|
|
1432
|
-
height:
|
|
1397
|
+
left: r.left,
|
|
1398
|
+
top: r.top,
|
|
1399
|
+
width: r.right - r.left,
|
|
1400
|
+
height: r.bottom - r.top
|
|
1433
1401
|
}
|
|
1434
|
-
}),
|
|
1402
|
+
}), e.filter(
|
|
1435
1403
|
(a) => a.text.trim().length > 0 && a.rect.width > 0 && a.rect.height > 0
|
|
1436
1404
|
);
|
|
1437
1405
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
isNaN(
|
|
1442
|
-
let
|
|
1443
|
-
return isNaN(
|
|
1444
|
-
font: `${
|
|
1445
|
-
fontSize:
|
|
1446
|
-
color:
|
|
1447
|
-
textAlign:
|
|
1406
|
+
function Ae(t) {
|
|
1407
|
+
const A = parseFloat(t.fontSize);
|
|
1408
|
+
let e = parseFloat(t.lineHeight);
|
|
1409
|
+
isNaN(e) && (e = A * 1.2);
|
|
1410
|
+
let s = parseFloat(t.letterSpacing);
|
|
1411
|
+
return isNaN(s) && (s = 0), {
|
|
1412
|
+
font: `${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`,
|
|
1413
|
+
fontSize: t.fontSize,
|
|
1414
|
+
color: t.color,
|
|
1415
|
+
textAlign: t.textAlign || "start",
|
|
1448
1416
|
textBaseline: "alphabetic",
|
|
1449
|
-
direction:
|
|
1450
|
-
lineHeight:
|
|
1451
|
-
letterSpacing:
|
|
1417
|
+
direction: t.direction || "inherit",
|
|
1418
|
+
lineHeight: e,
|
|
1419
|
+
letterSpacing: s
|
|
1452
1420
|
};
|
|
1453
1421
|
}
|
|
1454
|
-
function
|
|
1455
|
-
var
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1422
|
+
function ne(t, A = nA | fA | Qe | TA | SA, e, s = 1, r = 0, o = 2, i, g, n, a, I = -1, c = 0, l = 0, B = !1) {
|
|
1423
|
+
var kA, UA, XA, HA, JA, zA, _A, WA, KA;
|
|
1424
|
+
const C = (kA = a == null ? void 0 : a.scrollX) != null ? kA : window.scrollX, w = (UA = a == null ? void 0 : a.scrollY) != null ? UA : window.scrollY;
|
|
1425
|
+
if (t.nodeType === Node.TEXT_NODE) {
|
|
1426
|
+
const E = t;
|
|
1427
|
+
if (!E.textContent || !E.textContent.trim())
|
|
1459
1428
|
return null;
|
|
1460
|
-
const
|
|
1461
|
-
if (
|
|
1429
|
+
const R = E.textContent.replace(/\s+/g, " ");
|
|
1430
|
+
if (R.length === 0)
|
|
1462
1431
|
return null;
|
|
1463
|
-
const
|
|
1464
|
-
if (
|
|
1432
|
+
const T = Fe(E);
|
|
1433
|
+
if (T.length === 0)
|
|
1465
1434
|
return null;
|
|
1466
|
-
const _ =
|
|
1467
|
-
if (!
|
|
1435
|
+
const _ = E.parentElement, N = _ ? window.getComputedStyle(_) : null;
|
|
1436
|
+
if (!N)
|
|
1468
1437
|
return null;
|
|
1469
|
-
const
|
|
1438
|
+
const x = B || N.position === "fixed", k = Math.min(...T.map((p) => p.rect.left)), O = Math.min(...T.map((p) => p.rect.top)), v = Math.max(...T.map((p) => p.rect.left + p.rect.width)), W = Math.max(...T.map((p) => p.rect.top + p.rect.height)), V = k + (x ? 0 : C), QA = O + (x ? 0 : w);
|
|
1439
|
+
let sA = -1;
|
|
1440
|
+
if (a && a.sharedArray) {
|
|
1441
|
+
sA = a.currentIndex++;
|
|
1442
|
+
const p = sA * tA;
|
|
1443
|
+
a.sharedArray[p + LA] = I, a.sharedArray[p + pA] = V - c, a.sharedArray[p + mA] = QA - l;
|
|
1444
|
+
}
|
|
1470
1445
|
return {
|
|
1471
1446
|
id: Math.random().toString(36).substring(2, 9),
|
|
1472
1447
|
type: "TEXT",
|
|
1473
|
-
element:
|
|
1448
|
+
element: E,
|
|
1474
1449
|
rect: {
|
|
1475
|
-
x:
|
|
1476
|
-
y:
|
|
1477
|
-
width:
|
|
1478
|
-
height:
|
|
1450
|
+
x: k + (x ? 0 : C),
|
|
1451
|
+
y: O + (x ? 0 : w),
|
|
1452
|
+
width: v - k,
|
|
1453
|
+
height: W - O
|
|
1479
1454
|
},
|
|
1480
1455
|
styles: {
|
|
1481
1456
|
backgroundColor: "transparent",
|
|
1482
1457
|
backgroundImage: "",
|
|
1483
|
-
opacity: _ && _.dataset[
|
|
1484
|
-
zIndex: (isNaN(parseInt(
|
|
1458
|
+
opacity: _ && _.dataset[eA.KEY] === eA.VALUES.HIDE ? 1 : parseFloat(N.opacity),
|
|
1459
|
+
zIndex: (isNaN(parseInt(N.zIndex)) ? 0 : parseInt(N.zIndex)) + r,
|
|
1485
1460
|
borderRadius: "0px",
|
|
1486
1461
|
borderColor: "transparent",
|
|
1487
1462
|
borderWidth: "0px",
|
|
1488
1463
|
isTraveler: !1
|
|
1489
1464
|
},
|
|
1490
|
-
textContent:
|
|
1491
|
-
textLines:
|
|
1492
|
-
text:
|
|
1465
|
+
textContent: R,
|
|
1466
|
+
textLines: T.map((p) => ({
|
|
1467
|
+
text: p.text.trim(),
|
|
1493
1468
|
rect: {
|
|
1494
|
-
x:
|
|
1495
|
-
y:
|
|
1496
|
-
width:
|
|
1497
|
-
height:
|
|
1469
|
+
x: p.rect.left + (x ? 0 : C),
|
|
1470
|
+
y: p.rect.top + (x ? 0 : w),
|
|
1471
|
+
width: p.rect.width,
|
|
1472
|
+
height: p.rect.height
|
|
1498
1473
|
}
|
|
1499
1474
|
})),
|
|
1500
|
-
textStyles:
|
|
1501
|
-
dirtyMask:
|
|
1502
|
-
visibility:
|
|
1475
|
+
textStyles: Ae(N),
|
|
1476
|
+
dirtyMask: A,
|
|
1477
|
+
visibility: e,
|
|
1503
1478
|
isTraveler: !1,
|
|
1504
|
-
captureLayer:
|
|
1505
|
-
isFixed:
|
|
1506
|
-
nativeLayer:
|
|
1507
|
-
nativeStyles:
|
|
1479
|
+
captureLayer: s,
|
|
1480
|
+
isFixed: x,
|
|
1481
|
+
nativeLayer: i,
|
|
1482
|
+
nativeStyles: g ? oA(oA({
|
|
1508
1483
|
backgroundColor: "transparent",
|
|
1509
1484
|
backgroundImage: "",
|
|
1510
|
-
opacity: _ && _.dataset[
|
|
1511
|
-
zIndex: (isNaN(parseInt(
|
|
1485
|
+
opacity: _ && _.dataset[eA.KEY] === eA.VALUES.HIDE ? 1 : parseFloat(N.opacity),
|
|
1486
|
+
zIndex: (isNaN(parseInt(N.zIndex)) ? 0 : parseInt(N.zIndex)) + r,
|
|
1512
1487
|
borderRadius: "0px",
|
|
1513
1488
|
borderColor: "transparent",
|
|
1514
1489
|
borderWidth: "0px",
|
|
1515
1490
|
isTraveler: !1
|
|
1516
|
-
},
|
|
1517
|
-
nativeRect:
|
|
1518
|
-
x:
|
|
1519
|
-
y:
|
|
1520
|
-
width:
|
|
1521
|
-
height:
|
|
1491
|
+
}, Ae(N)), g) : void 0,
|
|
1492
|
+
nativeRect: g ? {
|
|
1493
|
+
x: k + (x ? 0 : C),
|
|
1494
|
+
y: O + (x ? 0 : w),
|
|
1495
|
+
width: v - k,
|
|
1496
|
+
height: W - O
|
|
1522
1497
|
} : void 0,
|
|
1523
|
-
clipElements:
|
|
1498
|
+
clipElements: n,
|
|
1499
|
+
wasmIndex: sA !== -1 ? sA : void 0,
|
|
1524
1500
|
children: []
|
|
1525
1501
|
};
|
|
1526
1502
|
}
|
|
1527
|
-
if (
|
|
1503
|
+
if (t.nodeType !== Node.ELEMENT_NODE)
|
|
1528
1504
|
return null;
|
|
1529
|
-
const
|
|
1530
|
-
let
|
|
1531
|
-
if (
|
|
1532
|
-
const
|
|
1533
|
-
for (const
|
|
1534
|
-
if (!
|
|
1505
|
+
const Q = t, b = Q.dataset[q.KEY];
|
|
1506
|
+
let f = e, y = e;
|
|
1507
|
+
if (b) {
|
|
1508
|
+
const E = new Set(b.split(/\s+/));
|
|
1509
|
+
for (const R of E)
|
|
1510
|
+
if (!ZA.includes(R))
|
|
1535
1511
|
throw new Error(
|
|
1536
|
-
`[MirageEngine] Invalid filter token: '${
|
|
1512
|
+
`[MirageEngine] Invalid filter token: '${R}'. Expected one of: 'include-tree', 'exclude-tree', 'include-self', 'exclude-self', 'end'.`
|
|
1537
1513
|
);
|
|
1538
|
-
if (
|
|
1514
|
+
if (E.has(q.VALUES.END))
|
|
1539
1515
|
return null;
|
|
1540
|
-
if (
|
|
1516
|
+
if (E.has(q.VALUES.INCLUDE_TREE) && E.has(q.VALUES.EXCLUDE_TREE))
|
|
1541
1517
|
throw new Error(
|
|
1542
1518
|
"[MirageEngine] Conflicting filters: 'include-tree' and 'exclude-tree' cannot be used together on the same element."
|
|
1543
1519
|
);
|
|
1544
|
-
if (
|
|
1520
|
+
if (E.has(q.VALUES.INCLUDE_SELF) && E.has(q.VALUES.EXCLUDE_SELF))
|
|
1545
1521
|
throw new Error(
|
|
1546
1522
|
"[MirageEngine] Conflicting filters: 'include-self' and 'exclude-self' cannot be used together on the same element."
|
|
1547
1523
|
);
|
|
1548
|
-
|
|
1524
|
+
E.has(q.VALUES.INCLUDE_TREE) ? f = f | j : E.has(q.VALUES.EXCLUDE_TREE) && (f = f & ~j), y = f, E.has(q.VALUES.INCLUDE_SELF) ? y = y | j : E.has(q.VALUES.EXCLUDE_SELF) && (y = y & ~j);
|
|
1549
1525
|
}
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
const
|
|
1553
|
-
for (const
|
|
1554
|
-
if (!
|
|
1526
|
+
const U = Q.dataset[Z.KEY];
|
|
1527
|
+
if (U) {
|
|
1528
|
+
const E = new Set(U.split(/\s+/));
|
|
1529
|
+
for (const R of E)
|
|
1530
|
+
if (!ZA.includes(R))
|
|
1555
1531
|
throw new Error(
|
|
1556
|
-
`[MirageEngine] Invalid select token: '${
|
|
1532
|
+
`[MirageEngine] Invalid select token: '${R}'. Expected one of: 'include-tree', 'exclude-tree', 'include-self', 'exclude-self', 'end'.`
|
|
1557
1533
|
);
|
|
1558
|
-
if (
|
|
1534
|
+
if (E.has(Z.VALUES.END))
|
|
1559
1535
|
return null;
|
|
1560
|
-
if (
|
|
1536
|
+
if (E.has(Z.VALUES.INCLUDE_TREE) && E.has(Z.VALUES.EXCLUDE_TREE))
|
|
1561
1537
|
throw new Error(
|
|
1562
1538
|
"[MirageEngine] Conflicting selects: 'include-tree' and 'exclude-tree' cannot be used together on the same element."
|
|
1563
1539
|
);
|
|
1564
|
-
if (
|
|
1540
|
+
if (E.has(Z.VALUES.INCLUDE_SELF) && E.has(Z.VALUES.EXCLUDE_SELF))
|
|
1565
1541
|
throw new Error(
|
|
1566
1542
|
"[MirageEngine] Conflicting selects: 'include-self' and 'exclude-self' cannot be used together on the same element."
|
|
1567
1543
|
);
|
|
1568
|
-
|
|
1569
|
-
}
|
|
1570
|
-
const
|
|
1571
|
-
let
|
|
1572
|
-
if (
|
|
1573
|
-
let
|
|
1574
|
-
const
|
|
1575
|
-
let _ =
|
|
1576
|
-
if (
|
|
1577
|
-
_ =
|
|
1578
|
-
const
|
|
1544
|
+
E.has(Z.VALUES.INCLUDE_TREE) ? f = f | lA : E.has(Z.VALUES.EXCLUDE_TREE) && (f = f & ~lA), y = f, E.has(Z.VALUES.INCLUDE_SELF) ? y = y | lA : E.has(Z.VALUES.EXCLUDE_SELF) && (y = y & ~lA);
|
|
1545
|
+
}
|
|
1546
|
+
const S = Q.dataset[X.KEY];
|
|
1547
|
+
let D = !1, u = g ? oA({}, g) : {}, Y = i;
|
|
1548
|
+
if (S) {
|
|
1549
|
+
let E = 1;
|
|
1550
|
+
const R = S.indexOf("{"), T = S.lastIndexOf("}");
|
|
1551
|
+
let _ = S;
|
|
1552
|
+
if (R !== -1 && T !== -1 && T > R) {
|
|
1553
|
+
_ = S.substring(0, R).trim();
|
|
1554
|
+
const v = S.substring(R, T + 1);
|
|
1579
1555
|
try {
|
|
1580
|
-
|
|
1581
|
-
} catch (
|
|
1556
|
+
u = new Function("return " + v)();
|
|
1557
|
+
} catch (W) {
|
|
1582
1558
|
console.warn(
|
|
1583
|
-
`[MirageEngine] Failed to parse travel styles JSON: ${
|
|
1559
|
+
`[MirageEngine] Failed to parse travel styles JSON: ${v}`
|
|
1584
1560
|
);
|
|
1585
1561
|
}
|
|
1586
1562
|
}
|
|
1587
|
-
const
|
|
1588
|
-
let
|
|
1589
|
-
const
|
|
1590
|
-
if (
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1593
|
-
if (
|
|
1594
|
-
|
|
1563
|
+
const N = _.split(/\s+/);
|
|
1564
|
+
let x = !1;
|
|
1565
|
+
const k = N.indexOf(X.VALUES.TRAVELER);
|
|
1566
|
+
if (k !== -1) {
|
|
1567
|
+
D = !0, x = !0;
|
|
1568
|
+
const v = N[k + 1];
|
|
1569
|
+
if (v && !isNaN(parseInt(v, 10)))
|
|
1570
|
+
E = parseInt(v, 10);
|
|
1595
1571
|
else {
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1572
|
+
const W = N.find((V) => !isNaN(parseInt(V, 10)));
|
|
1573
|
+
W && (E = parseInt(W, 10));
|
|
1598
1574
|
}
|
|
1599
1575
|
}
|
|
1600
|
-
const
|
|
1601
|
-
if (
|
|
1602
|
-
const
|
|
1603
|
-
if (
|
|
1604
|
-
|
|
1605
|
-
else if (!
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1576
|
+
const O = N.indexOf(X.VALUES.NATIVE);
|
|
1577
|
+
if (O !== -1) {
|
|
1578
|
+
const v = N[O + 1];
|
|
1579
|
+
if (v && !isNaN(parseInt(v, 10)))
|
|
1580
|
+
Y = parseInt(v, 10);
|
|
1581
|
+
else if (!D) {
|
|
1582
|
+
const W = N.find((V) => !isNaN(parseInt(V, 10)));
|
|
1583
|
+
W && (Y = parseInt(W, 10));
|
|
1608
1584
|
}
|
|
1609
1585
|
}
|
|
1610
|
-
if (
|
|
1611
|
-
const
|
|
1612
|
-
if (
|
|
1586
|
+
if (x) {
|
|
1587
|
+
const v = E + 1;
|
|
1588
|
+
if (v < s)
|
|
1613
1589
|
throw new Error(
|
|
1614
|
-
`[MirageEngine] Traveler layer (${
|
|
1590
|
+
`[MirageEngine] Traveler layer (${E}) cannot be smaller than inherited capture layer (${s - 1}).`
|
|
1615
1591
|
);
|
|
1616
|
-
|
|
1592
|
+
s = Math.min(v, X.MAX_LAYERS + 1);
|
|
1617
1593
|
}
|
|
1618
1594
|
}
|
|
1619
|
-
const
|
|
1620
|
-
let
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
if (
|
|
1595
|
+
const gA = Q.dataset[de.KEY];
|
|
1596
|
+
let cA;
|
|
1597
|
+
gA && (cA = JSON.parse(gA));
|
|
1598
|
+
const F = Q.getBoundingClientRect(), M = window.getComputedStyle(Q);
|
|
1599
|
+
if (F.width === 0 || F.height === 0 || M.display === "none")
|
|
1624
1600
|
return null;
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1601
|
+
const P = B || M.position === "fixed", BA = F.left + (P ? 0 : C), H = F.top + (P ? 0 : w);
|
|
1602
|
+
let G = -1;
|
|
1603
|
+
if (a && a.sharedArray) {
|
|
1604
|
+
G = a.currentIndex++;
|
|
1605
|
+
const E = G * tA;
|
|
1606
|
+
a.sharedArray[E + LA] = I, a.sharedArray[E + pA] = BA - c, a.sharedArray[E + mA] = H - l;
|
|
1607
|
+
}
|
|
1608
|
+
let $ = Q.getAttribute("data-mid");
|
|
1609
|
+
$ || ($ = Math.random().toString(36).substring(2, 11), Q.setAttribute("data-mid", $));
|
|
1610
|
+
const IA = parseInt(M.zIndex), iA = (isNaN(IA) ? 0 : IA) + r;
|
|
1611
|
+
let AA, rA;
|
|
1612
|
+
if (Q.tagName === "IMG")
|
|
1613
|
+
AA = Q.src;
|
|
1614
|
+
else if (Q.tagName.toLowerCase() === "svg") {
|
|
1615
|
+
const E = u == null ? void 0 : u.color, R = u == null ? void 0 : u.fill, T = u == null ? void 0 : u.stroke, _ = u == null ? void 0 : u.opacity, N = (x) => {
|
|
1616
|
+
const k = Q.cloneNode(!0), O = (QA, sA) => {
|
|
1617
|
+
const p = window.getComputedStyle(QA), uA = sA, ce = p.fill === p.color, Ie = p.stroke === p.color, bA = (x ? R || (ce ? E : void 0) : void 0) || p.fill;
|
|
1618
|
+
bA && bA !== "none" && (uA.style.fill = bA);
|
|
1619
|
+
const NA = (x ? T || (Ie ? E : void 0) : void 0) || p.stroke;
|
|
1620
|
+
NA && NA !== "none" && (uA.style.stroke = NA), p.strokeWidth && p.strokeWidth !== "0px" && (uA.style.strokeWidth = p.strokeWidth);
|
|
1621
|
+
const OA = (x ? E : void 0) || p.color;
|
|
1622
|
+
OA && (uA.style.color = OA);
|
|
1623
|
+
const MA = (x ? _ : void 0) || p.opacity;
|
|
1624
|
+
MA && MA !== "1" && (uA.style.opacity = MA);
|
|
1625
|
+
for (let yA = 0; yA < QA.children.length; yA++)
|
|
1626
|
+
O(QA.children[yA], sA.children[yA]);
|
|
1644
1627
|
};
|
|
1645
|
-
Q
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
let
|
|
1649
|
-
return
|
|
1628
|
+
O(Q, k);
|
|
1629
|
+
const v = Q.getBoundingClientRect(), W = window.devicePixelRatio * o;
|
|
1630
|
+
k.hasAttribute("viewBox") || k.setAttribute("viewBox", `0 0 ${v.width} ${v.height}`), k.setAttribute("width", (v.width * W).toString()), k.setAttribute("height", (v.height * W).toString());
|
|
1631
|
+
let V = new XMLSerializer().serializeToString(k);
|
|
1632
|
+
return V.includes("xmlns=") || (V = V.replace(
|
|
1650
1633
|
"<svg",
|
|
1651
1634
|
'<svg xmlns="http://www.w3.org/2000/svg"'
|
|
1652
|
-
)), `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
1635
|
+
)), `data:image/svg+xml;utf8,${encodeURIComponent(V)}`;
|
|
1653
1636
|
};
|
|
1654
|
-
|
|
1655
|
-
} else if (
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
}
|
|
1659
|
-
const
|
|
1660
|
-
backgroundColor:
|
|
1661
|
-
backgroundImage:
|
|
1662
|
-
opacity:
|
|
1663
|
-
zIndex:
|
|
1664
|
-
borderRadius:
|
|
1665
|
-
borderColor:
|
|
1666
|
-
borderWidth:
|
|
1667
|
-
boxShadow:
|
|
1668
|
-
imageSrc:
|
|
1669
|
-
isTraveler:
|
|
1670
|
-
},
|
|
1671
|
-
let
|
|
1672
|
-
const
|
|
1673
|
-
return
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1637
|
+
AA = N(!1), Y !== void 0 && (E || R || T || _) && (rA = N(!0));
|
|
1638
|
+
} else if (M.backgroundImage && M.backgroundImage !== "none") {
|
|
1639
|
+
const E = M.backgroundImage.match(/url\(['"]?(.*?)['"]?\)/);
|
|
1640
|
+
E && (AA = E[1]);
|
|
1641
|
+
}
|
|
1642
|
+
const m = {
|
|
1643
|
+
backgroundColor: M.backgroundColor,
|
|
1644
|
+
backgroundImage: M.backgroundImage,
|
|
1645
|
+
opacity: Q.dataset[eA.KEY] === eA.VALUES.HIDE ? 1 : parseFloat(M.opacity),
|
|
1646
|
+
zIndex: iA,
|
|
1647
|
+
borderRadius: M.borderRadius,
|
|
1648
|
+
borderColor: M.borderColor,
|
|
1649
|
+
borderWidth: M.borderWidth,
|
|
1650
|
+
boxShadow: M.boxShadow,
|
|
1651
|
+
imageSrc: AA,
|
|
1652
|
+
isTraveler: D
|
|
1653
|
+
}, z = m;
|
|
1654
|
+
let EA, dA;
|
|
1655
|
+
const GA = [], ge = M.overflow === "hidden" ? [...n || [], Q] : n;
|
|
1656
|
+
return Q.tagName.toLowerCase() !== "svg" && Array.from(Q.childNodes).forEach((E) => {
|
|
1657
|
+
const R = E.nodeType === Node.TEXT_NODE ? y : f, T = ne(
|
|
1658
|
+
E,
|
|
1659
|
+
A,
|
|
1660
|
+
R,
|
|
1661
|
+
s,
|
|
1662
|
+
iA,
|
|
1663
|
+
o,
|
|
1664
|
+
E.nodeType === Node.TEXT_NODE ? Y : void 0,
|
|
1665
|
+
E.nodeType === Node.TEXT_NODE && Object.keys(u).length > 0 ? u : void 0,
|
|
1666
|
+
ge,
|
|
1667
|
+
a,
|
|
1668
|
+
G,
|
|
1669
|
+
BA,
|
|
1670
|
+
H,
|
|
1671
|
+
P
|
|
1684
1672
|
);
|
|
1685
|
-
|
|
1673
|
+
T && GA.push(T);
|
|
1686
1674
|
}), {
|
|
1687
|
-
id:
|
|
1675
|
+
id: $,
|
|
1688
1676
|
type: "BOX",
|
|
1689
|
-
element:
|
|
1677
|
+
element: Q,
|
|
1690
1678
|
rect: {
|
|
1691
|
-
x:
|
|
1692
|
-
y:
|
|
1693
|
-
width:
|
|
1694
|
-
height:
|
|
1679
|
+
x: F.left + C,
|
|
1680
|
+
y: F.top + w,
|
|
1681
|
+
width: F.width,
|
|
1682
|
+
height: F.height
|
|
1695
1683
|
},
|
|
1696
|
-
styles:
|
|
1697
|
-
textContent:
|
|
1698
|
-
textStyles:
|
|
1699
|
-
dirtyMask:
|
|
1700
|
-
visibility:
|
|
1701
|
-
isTraveler:
|
|
1702
|
-
captureLayer:
|
|
1703
|
-
nativeLayer:
|
|
1704
|
-
nativeStyles:
|
|
1705
|
-
backgroundColor: (
|
|
1706
|
-
backgroundImage: (
|
|
1707
|
-
opacity: (
|
|
1708
|
-
zIndex:
|
|
1709
|
-
borderRadius: (
|
|
1710
|
-
borderColor: (
|
|
1711
|
-
borderWidth: (
|
|
1712
|
-
boxShadow: (
|
|
1713
|
-
isTraveler:
|
|
1714
|
-
transform:
|
|
1715
|
-
imageSrc:
|
|
1684
|
+
styles: z,
|
|
1685
|
+
textContent: EA,
|
|
1686
|
+
textStyles: dA,
|
|
1687
|
+
dirtyMask: A,
|
|
1688
|
+
visibility: y,
|
|
1689
|
+
isTraveler: D,
|
|
1690
|
+
captureLayer: s,
|
|
1691
|
+
nativeLayer: Y,
|
|
1692
|
+
nativeStyles: Y !== void 0 ? jA(oA({}, m), {
|
|
1693
|
+
backgroundColor: (XA = u.backgroundColor) != null ? XA : m.backgroundColor,
|
|
1694
|
+
backgroundImage: (HA = u.backgroundImage) != null ? HA : m.backgroundImage,
|
|
1695
|
+
opacity: (JA = u.opacity) != null ? JA : m.opacity,
|
|
1696
|
+
zIndex: u.zIndex !== void 0 ? u.zIndex + iA : m.zIndex,
|
|
1697
|
+
borderRadius: (zA = u.borderRadius) != null ? zA : m.borderRadius,
|
|
1698
|
+
borderColor: (_A = u.borderColor) != null ? _A : m.borderColor,
|
|
1699
|
+
borderWidth: (WA = u.borderWidth) != null ? WA : m.borderWidth,
|
|
1700
|
+
boxShadow: (KA = u.boxShadow) != null ? KA : m.boxShadow,
|
|
1701
|
+
isTraveler: m.isTraveler,
|
|
1702
|
+
transform: u.transform,
|
|
1703
|
+
imageSrc: rA != null ? rA : AA
|
|
1716
1704
|
}) : void 0,
|
|
1717
|
-
nativeRect:
|
|
1718
|
-
x:
|
|
1719
|
-
y:
|
|
1720
|
-
width:
|
|
1721
|
-
height:
|
|
1705
|
+
nativeRect: Y !== void 0 ? {
|
|
1706
|
+
x: u.x !== void 0 ? parseFloat(u.x) : F.left + C,
|
|
1707
|
+
y: u.y !== void 0 ? parseFloat(u.y) : F.top + w,
|
|
1708
|
+
width: u.width !== void 0 ? parseFloat(u.width) : F.width,
|
|
1709
|
+
height: u.height !== void 0 ? parseFloat(u.height) : F.height
|
|
1722
1710
|
} : void 0,
|
|
1723
|
-
isFixed:
|
|
1724
|
-
clipElements:
|
|
1725
|
-
|
|
1726
|
-
|
|
1711
|
+
isFixed: P,
|
|
1712
|
+
clipElements: n,
|
|
1713
|
+
wasmIndex: G !== -1 ? G : void 0,
|
|
1714
|
+
children: GA,
|
|
1715
|
+
shaderHooks: cA
|
|
1727
1716
|
};
|
|
1728
1717
|
}
|
|
1729
|
-
function
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1718
|
+
function Te(t, A, e) {
|
|
1719
|
+
if (A.size === 0)
|
|
1720
|
+
return;
|
|
1721
|
+
const s = /* @__PURE__ */ new Set();
|
|
1722
|
+
A.forEach((r, o) => {
|
|
1723
|
+
var g, n, a, I;
|
|
1724
|
+
const i = t.get(o);
|
|
1725
|
+
if (!(!i || !i.userData.basePosition)) {
|
|
1726
|
+
if (K.forceUpdateUniforms(i.material, {
|
|
1727
|
+
backgroundColor: r.backgroundColor,
|
|
1728
|
+
backgroundImage: r.backgroundImage,
|
|
1729
|
+
boxShadow: r.boxShadow,
|
|
1730
|
+
opacity: r.opacity,
|
|
1731
|
+
borderRadius: (n = r.borderRadius) != null ? n : (g = i.userData.baseStyles) == null ? void 0 : g.borderRadius
|
|
1732
|
+
}), i.userData.nativeMesh && (K.forceUpdateUniforms(i.userData.nativeMesh.material, {
|
|
1733
|
+
backgroundColor: r.backgroundColor,
|
|
1734
|
+
backgroundImage: r.backgroundImage,
|
|
1735
|
+
boxShadow: r.boxShadow,
|
|
1736
|
+
opacity: r.opacity,
|
|
1737
|
+
borderRadius: (I = r.borderRadius) != null ? I : (a = i.userData.baseStyles) == null ? void 0 : a.borderRadius
|
|
1738
|
+
}), r.scaleX !== void 0 || r.scaleY !== void 0)) {
|
|
1739
|
+
const c = i.userData.nativeMesh, l = c.scale.x, B = c.scale.y, C = c.scale.z;
|
|
1740
|
+
c.scale.set(
|
|
1741
|
+
r.scaleX !== void 0 ? r.scaleX * l : l,
|
|
1742
|
+
r.scaleY !== void 0 ? r.scaleY * B : B,
|
|
1743
|
+
r.scaleZ !== void 0 ? r.scaleZ * C : C
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
if (r.layoutChanged || r.width !== void 0 || r.height !== void 0) {
|
|
1747
|
+
s.add(o);
|
|
1748
|
+
const c = o.querySelectorAll("*");
|
|
1749
|
+
for (let l = 0; l < c.length; l++) {
|
|
1750
|
+
const B = c[l];
|
|
1751
|
+
t.has(B) && s.add(B);
|
|
1752
|
+
}
|
|
1753
|
+
} else if ((r.x !== void 0 || r.y !== void 0) && e && i.userData.wasmIndex !== void 0) {
|
|
1754
|
+
const c = i.userData.wasmIndex * tA;
|
|
1755
|
+
r.x !== void 0 && i.userData.initialLocalX !== void 0 && (e[c + pA] = i.userData.initialLocalX + r.x), r.y !== void 0 && i.userData.initialLocalY !== void 0 && (e[c + mA] = i.userData.initialLocalY + r.y);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}), s.forEach((r) => {
|
|
1759
|
+
var n, a;
|
|
1760
|
+
const o = t.get(r);
|
|
1761
|
+
if (!o)
|
|
1762
|
+
return;
|
|
1763
|
+
const i = r.getBoundingClientRect();
|
|
1764
|
+
o.userData.domRect && (o.userData.domRect.width = i.width, o.userData.domRect.height = i.height);
|
|
1765
|
+
let g = ((n = o.material.userData) == null ? void 0 : n.shadowPadding) || 0;
|
|
1766
|
+
if (o.scale.set(i.width + g * 2, i.height + g * 2, 1), K.forceUpdateUniforms(o.material, {
|
|
1767
|
+
width: i.width,
|
|
1768
|
+
height: i.height
|
|
1769
|
+
}), e && o.userData.wasmIndex !== void 0) {
|
|
1770
|
+
const I = o.userData.wasmIndex * tA, c = i.left + (o.userData.isFixed ? 0 : window.scrollX), l = i.top + (o.userData.isFixed ? 0 : window.scrollY), B = e[I + LA];
|
|
1771
|
+
let C = 0, w = 0;
|
|
1772
|
+
if (B !== -1) {
|
|
1773
|
+
const Q = B * tA;
|
|
1774
|
+
C = e[Q + te], w = e[Q + ie];
|
|
1775
|
+
}
|
|
1776
|
+
e[I + pA] = c - C, e[I + mA] = l - w;
|
|
1777
|
+
}
|
|
1778
|
+
if (o.userData.nativeMesh) {
|
|
1779
|
+
const I = o.userData.nativeMesh;
|
|
1780
|
+
let c = ((a = I.material.userData) == null ? void 0 : a.shadowPadding) || 0;
|
|
1781
|
+
I.scale.set(i.width + c * 2, i.height + c * 2, 1), K.forceUpdateUniforms(I.material, {
|
|
1782
|
+
width: i.width,
|
|
1783
|
+
height: i.height
|
|
1784
|
+
}), o.userData.nativeRect && (o.userData.nativeRect.width = i.width, o.userData.nativeRect.height = i.height);
|
|
1785
|
+
}
|
|
1747
1786
|
});
|
|
1748
1787
|
}
|
|
1749
|
-
class
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1788
|
+
class FA {
|
|
1789
|
+
__destroy_into_raw() {
|
|
1790
|
+
const A = this.__wbg_ptr;
|
|
1791
|
+
return this.__wbg_ptr = 0, ee.unregister(this), A;
|
|
1792
|
+
}
|
|
1793
|
+
free() {
|
|
1794
|
+
const A = this.__destroy_into_raw();
|
|
1795
|
+
J.__wbg_memorymanager_free(A, 0);
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* @returns {number}
|
|
1799
|
+
*/
|
|
1800
|
+
get_length() {
|
|
1801
|
+
return J.memorymanager_get_length(this.__wbg_ptr) >>> 0;
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* @returns {number}
|
|
1805
|
+
*/
|
|
1806
|
+
get_pointer() {
|
|
1807
|
+
return J.memorymanager_get_pointer(this.__wbg_ptr) >>> 0;
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* @param {number} capacity
|
|
1811
|
+
*/
|
|
1812
|
+
constructor(A) {
|
|
1813
|
+
const e = J.memorymanager_new(A);
|
|
1814
|
+
return this.__wbg_ptr = e, ee.register(this, this.__wbg_ptr, this), this;
|
|
1815
|
+
}
|
|
1816
|
+
/**
|
|
1817
|
+
* @param {number} node_count
|
|
1818
|
+
*/
|
|
1819
|
+
update_physics(A) {
|
|
1820
|
+
J.memorymanager_update_physics(this.__wbg_ptr, A);
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
Symbol.dispose && (FA.prototype[Symbol.dispose] = FA.prototype.free);
|
|
1824
|
+
function Ye() {
|
|
1825
|
+
return {
|
|
1826
|
+
__proto__: null,
|
|
1827
|
+
"./wasm_compute_bg.js": {
|
|
1828
|
+
__proto__: null,
|
|
1829
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(A, e) {
|
|
1830
|
+
throw new Error(Ge(A, e));
|
|
1831
|
+
},
|
|
1832
|
+
__wbindgen_init_externref_table: function() {
|
|
1833
|
+
const A = J.__wbindgen_externrefs, e = A.grow(4);
|
|
1834
|
+
A.set(0, void 0), A.set(e + 0, void 0), A.set(e + 1, null), A.set(e + 2, !0), A.set(e + 3, !1);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
const ee = typeof FinalizationRegistry == "undefined" ? { register: () => {
|
|
1840
|
+
}, unregister: () => {
|
|
1841
|
+
} } : new FinalizationRegistry((t) => J.__wbg_memorymanager_free(t, 1));
|
|
1842
|
+
function Ge(t, A) {
|
|
1843
|
+
return Xe(t >>> 0, A);
|
|
1844
|
+
}
|
|
1845
|
+
let wA = null;
|
|
1846
|
+
function ke() {
|
|
1847
|
+
return (wA === null || wA.byteLength === 0) && (wA = new Uint8Array(J.memory.buffer)), wA;
|
|
1848
|
+
}
|
|
1849
|
+
let vA = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
1850
|
+
vA.decode();
|
|
1851
|
+
const Ue = 2146435072;
|
|
1852
|
+
let xA = 0;
|
|
1853
|
+
function Xe(t, A) {
|
|
1854
|
+
return xA += A, xA >= Ue && (vA = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), vA.decode(), xA = A), vA.decode(ke().subarray(t, t + A));
|
|
1855
|
+
}
|
|
1856
|
+
let J;
|
|
1857
|
+
function He(t, A) {
|
|
1858
|
+
return J = t.exports, wA = null, J.__wbindgen_start(), J;
|
|
1859
|
+
}
|
|
1860
|
+
function Je(t, A) {
|
|
1861
|
+
return aA(this, null, function* () {
|
|
1862
|
+
if (typeof Response == "function" && t instanceof Response) {
|
|
1863
|
+
if (!t.ok)
|
|
1864
|
+
throw new Error(`failed to fetch Wasm: ${t.status} ${t.statusText} fetching '${t.url}'`);
|
|
1865
|
+
if (typeof WebAssembly.instantiateStreaming == "function")
|
|
1866
|
+
try {
|
|
1867
|
+
return yield WebAssembly.instantiateStreaming(t, A);
|
|
1868
|
+
} catch (r) {
|
|
1869
|
+
if (e(t.type) && t.headers.get("Content-Type") !== "application/wasm")
|
|
1870
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", r);
|
|
1871
|
+
else
|
|
1872
|
+
throw r;
|
|
1873
|
+
}
|
|
1874
|
+
const s = yield t.arrayBuffer();
|
|
1875
|
+
return yield WebAssembly.instantiate(s, A);
|
|
1876
|
+
} else {
|
|
1877
|
+
const s = yield WebAssembly.instantiate(t, A);
|
|
1878
|
+
return s instanceof WebAssembly.Instance ? { instance: s, module: t } : s;
|
|
1879
|
+
}
|
|
1880
|
+
function e(s) {
|
|
1881
|
+
switch (s) {
|
|
1882
|
+
case "basic":
|
|
1883
|
+
case "cors":
|
|
1884
|
+
case "default":
|
|
1885
|
+
return !0;
|
|
1886
|
+
}
|
|
1887
|
+
return !1;
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
function ze(t) {
|
|
1892
|
+
return aA(this, null, function* () {
|
|
1893
|
+
if (J !== void 0)
|
|
1894
|
+
return J;
|
|
1895
|
+
t !== void 0 && (Object.getPrototypeOf(t) === Object.prototype ? { module_or_path: t } = t : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), t === void 0 && (t = new URL("data:application/wasm;base64,AGFzbQEAAAABNQlgAn9/AGACf38Bf2ADf39/AX9gAABgAX8Bf2ABfwBgA39/fwBgBH9/f38Bf2AFf39/f38AAncCFC4vd2FzbV9jb21wdXRlX2JnLmpzJ19fd2JnX19fd2JpbmRnZW5fdGhyb3dfNWQ5ZTgxNWU2ZmRmMTUwZgAAFC4vd2FzbV9jb21wdXRlX2JnLmpzH19fd2JpbmRnZW5faW5pdF9leHRlcm5yZWZfdGFibGUAAwMuLQQFBwAAAAEBCAAEAAYAAAIGBQQEAAYBBwUFAAAAAAIAAQEGA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AJFDQEgACgCAA0CIABBfzYCACAFIAY2AgwgBSAANgIIIAUgAEEEaiIENgIEIAEEQCAEKAIIIQIgBCgCBCIJIQQDQAJAAkACQAJAAkACQAJAAkAgAiADQQFqSwRAIANBAmogAk8NASACIANNDQIgBEEEaioCACEMIARBCGoqAgAhDSAEKgIAIgtDAAAAAGBFBEAgA0EDaiACTw0EIARBDGogDDgCACADQQRqIAJPDQUgBEEQaiANOAIADAkLIAv8AUEFbCIHQQNqIgggAk8NBSAHQQRqIgcgAk8NBiACIANBA2oiCk0EQCAKIAJBjIPAABASAAsgCSAHQQJ0aioCACELIARBDGogDCAJIAhBAnRqKgIAkjgCACADQQRqIgggAkkNByAIIAJBnIPAABASAAsgA0EBaiACQZyCwAAQEgALIANBAmogAkGsgsAAEBIACyADIAJBvILAABASAAsgA0EDaiACQcyCwAAQEgALIANBBGogAkHcgsAAEBIACyAIIAJB7ILAABASAAsgByACQfyCwAAQEgALIARBEGogDSALkjgCAAsgBEEUaiEEIANBBWohAyABQQFrIgENAAsLIAAgACgCAEEBajYCACAGIAYoAgBBAWsiADYCACAARQRAIAVBDGoQEwsgBUEQaiQADwsQKAsACxApAAuNAQICfwF+IwBBIGsiAiQAIAEoAgBBf0YEQCABKAIMIQMgAkEANgIcIAJCgICAgBA3AhQgAkEUakHYhMAAIAMoAgAiAygCACADKAIEEAQaIAIgAigCHCIDNgIQIAIgAikCFCIENwMIIAEgAzYCCCABIAQ3AgALIABBhIfAADYCBCAAIAE2AgAgAkEgaiQAC1QBAX8CQAJAIAAoAgAgACgCCCIDayACSQRAIAAgAyACEA4gACgCCCEDDAELIAJFDQELIAJFDQAgACgCBCADaiABIAL8CgAACyAAIAIgA2o2AghBAAtPAgF/AX4jAEEgayIDJAAgAyABNgIMIAMgADYCCCADQoCAgICgAiIEIANBCGqthDcDGCADIAQgA0EMaq2ENwMQQYCAwAAgA0EQaiACEBcAC0wBAX8gACgCACIAQQxqKAIAIgEEQCAAQRBqKAIAIAFBAnRBBBA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3VhZ2UBBFJ1c3QADHByb2Nlc3NlZC1ieQMFcnVzdGMdMS45OC4xICg0OGEyMjljZWEgMjAyNi0wOS0wMSkGd2FscnVzBjAuMjYuNQx3YXNtLWJpbmRnZW4TMC4yLjEyOCAoMjQ2OTQ2ZmRkKQBrD3RhcmdldF9mZWF0dXJlcwYrD211dGFibGUtZ2xvYmFscysTbm9udHJhcHBpbmctZnB0b2ludCsLYnVsay1tZW1vcnkrCHNpZ24tZXh0Kw9yZWZlcmVuY2UtdHlwZXMrCm11bHRpdmFsdWU=", self.location));
|
|
1896
|
+
const A = Ye();
|
|
1897
|
+
(typeof t == "string" || typeof Request == "function" && t instanceof Request || typeof URL == "function" && t instanceof URL) && (t = fetch(t));
|
|
1898
|
+
const { instance: e, module: s } = yield Je(yield t, A);
|
|
1899
|
+
return He(e);
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
class _e {
|
|
1903
|
+
constructor() {
|
|
1904
|
+
h(this, "memoryManager", null);
|
|
1905
|
+
h(this, "sharedArray", null);
|
|
1906
|
+
h(this, "isInitialized", !1);
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* Initialize Wasm instance and allocate a 1D Float32Array shared memory
|
|
1910
|
+
* @param capacity The number of Float32 elements to allocate
|
|
1911
|
+
*/
|
|
1912
|
+
initialize(A) {
|
|
1913
|
+
return aA(this, null, function* () {
|
|
1914
|
+
if (!this.isInitialized)
|
|
1915
|
+
try {
|
|
1916
|
+
const e = yield ze();
|
|
1917
|
+
this.memoryManager = new FA(A);
|
|
1918
|
+
const s = this.memoryManager.get_pointer(), r = this.memoryManager.get_length();
|
|
1919
|
+
this.sharedArray = new Float32Array(e.memory.buffer, s, r), this.isInitialized = !0, console.log(`[WasmSynchronizer] Initialized with capacity: ${A} floats (${A * 4} bytes)`);
|
|
1920
|
+
} catch (e) {
|
|
1921
|
+
throw console.error("[WasmSynchronizer] Failed to initialize Wasm:", e), e;
|
|
1922
|
+
}
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
getSharedArray() {
|
|
1926
|
+
if (!this.isInitialized || !this.sharedArray)
|
|
1927
|
+
throw new Error("WasmSynchronizer is not initialized yet. Call initialize() first.");
|
|
1928
|
+
return this.sharedArray;
|
|
1929
|
+
}
|
|
1930
|
+
updatePhysics(A) {
|
|
1931
|
+
this.isInitialized && this.memoryManager && this.memoryManager.update_physics(A);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
class We {
|
|
1935
|
+
constructor(A, e, s, r) {
|
|
1936
|
+
h(this, "target");
|
|
1937
|
+
h(this, "renderer");
|
|
1938
|
+
h(this, "registry");
|
|
1939
|
+
h(this, "isTravelEnabled", !1);
|
|
1940
|
+
h(this, "wasmSync");
|
|
1941
|
+
h(this, "lastWasmNodeCount", 0);
|
|
1942
|
+
h(this, "tracker");
|
|
1943
|
+
this.target = A, this.renderer = e, this.registry = s, this.wasmSync = new _e(), this.tracker = new we(A, {
|
|
1944
|
+
resizeDebounce: r.resizeDebounce
|
|
1945
|
+
}), this.tracker.onLayoutChange.add((o, i) => {
|
|
1946
|
+
document.querySelector(`[${X.NAME}~='${X.VALUES.TRAVELER}']`) !== null && !this.isTravelEnabled && (this.isTravelEnabled = !0, this.renderer.createRenderTarget());
|
|
1947
|
+
const n = this.wasmSync.sharedArray;
|
|
1948
|
+
this.renderer.updateScroll();
|
|
1949
|
+
const a = {
|
|
1950
|
+
sharedArray: n || new Float32Array(),
|
|
1951
|
+
currentIndex: 0,
|
|
1952
|
+
scrollX: this.renderer.getScrollX(),
|
|
1953
|
+
scrollY: this.renderer.getScrollY()
|
|
1954
|
+
}, I = ne(
|
|
1761
1955
|
this.target,
|
|
1762
|
-
|
|
1763
|
-
|
|
1956
|
+
o,
|
|
1957
|
+
j,
|
|
1764
1958
|
1,
|
|
1765
1959
|
0,
|
|
1766
|
-
this.renderer.qualityFactor
|
|
1960
|
+
this.renderer.qualityFactor,
|
|
1961
|
+
void 0,
|
|
1962
|
+
void 0,
|
|
1963
|
+
void 0,
|
|
1964
|
+
a
|
|
1767
1965
|
);
|
|
1768
|
-
|
|
1769
|
-
}), this.tracker.onStyleChange.add((
|
|
1770
|
-
|
|
1966
|
+
I && (this.lastWasmNodeCount = a.currentIndex, this.renderer.syncScene(I, i), n && this.renderer.saveInitialLocals(n));
|
|
1967
|
+
}), this.tracker.onStyleChange.add((o) => {
|
|
1968
|
+
Te(this.registry, o, this.wasmSync.sharedArray || void 0);
|
|
1771
1969
|
}), this.tracker.onRender.add(() => {
|
|
1772
|
-
this.renderer.
|
|
1970
|
+
this.renderer.updateScroll(), this.wasmSync.updatePhysics(this.lastWasmNodeCount), this.wasmSync.sharedArray && this.renderer.syncMeshesByWasm(this.wasmSync.sharedArray), this.renderer.render();
|
|
1773
1971
|
});
|
|
1774
1972
|
}
|
|
1775
1973
|
start() {
|
|
1776
|
-
this
|
|
1974
|
+
return aA(this, null, function* () {
|
|
1975
|
+
yield this.wasmSync.initialize(1e4 * tA), this.tracker.start();
|
|
1976
|
+
});
|
|
1777
1977
|
}
|
|
1778
1978
|
stop() {
|
|
1779
1979
|
this.tracker.stop();
|
|
1780
1980
|
}
|
|
1781
1981
|
}
|
|
1782
|
-
class
|
|
1982
|
+
class Ke {
|
|
1783
1983
|
constructor() {
|
|
1784
|
-
|
|
1984
|
+
h(this, "store");
|
|
1785
1985
|
this.store = /* @__PURE__ */ new WeakMap();
|
|
1786
1986
|
}
|
|
1787
|
-
register(
|
|
1788
|
-
this.store.set(
|
|
1987
|
+
register(A, e) {
|
|
1988
|
+
this.store.set(A, e);
|
|
1789
1989
|
}
|
|
1790
|
-
get(
|
|
1791
|
-
return this.store.get(
|
|
1990
|
+
get(A) {
|
|
1991
|
+
return this.store.get(A);
|
|
1792
1992
|
}
|
|
1793
1993
|
// public register(element: HTMLElement, meshGroup: THREE.Group): void {
|
|
1794
1994
|
// this.store.set(element, meshGroup);
|
|
@@ -1796,41 +1996,43 @@ class ut {
|
|
|
1796
1996
|
// public get(element: HTMLElement): THREE.Group | undefined {
|
|
1797
1997
|
// return this.store.get(element);
|
|
1798
1998
|
// }
|
|
1799
|
-
has(
|
|
1800
|
-
return this.store.has(
|
|
1999
|
+
has(A) {
|
|
2000
|
+
return this.store.has(A);
|
|
1801
2001
|
}
|
|
1802
2002
|
// Optional
|
|
1803
|
-
remove(
|
|
1804
|
-
this.store.delete(
|
|
2003
|
+
remove(A) {
|
|
2004
|
+
this.store.delete(A);
|
|
1805
2005
|
}
|
|
1806
2006
|
}
|
|
1807
|
-
class
|
|
1808
|
-
constructor(
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
var
|
|
1814
|
-
if (this.target =
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
[${
|
|
2007
|
+
class Ve {
|
|
2008
|
+
constructor(A, e) {
|
|
2009
|
+
h(this, "renderer");
|
|
2010
|
+
h(this, "syncer");
|
|
2011
|
+
h(this, "target");
|
|
2012
|
+
h(this, "registry");
|
|
2013
|
+
var r, o, i;
|
|
2014
|
+
if (this.target = A, this.registry = new Ke(), !document.getElementById("mirage-engine-styles")) {
|
|
2015
|
+
const g = document.createElement("style");
|
|
2016
|
+
g.id = "mirage-engine-styles", g.textContent = `
|
|
2017
|
+
[${eA.NAME}="${eA.VALUES.HIDE}"] {
|
|
1818
2018
|
opacity: 0 !important;
|
|
1819
2019
|
}
|
|
1820
|
-
`, document.head.appendChild(
|
|
2020
|
+
`, document.head.appendChild(g);
|
|
1821
2021
|
}
|
|
1822
|
-
let
|
|
1823
|
-
if (
|
|
2022
|
+
let s;
|
|
2023
|
+
if (e.mode === "duplicate" ? s = (o = (r = e.container) != null ? r : this.target.parentElement) != null ? o : void 0 : s = (i = this.target.parentElement) != null ? i : void 0, !s)
|
|
1824
2024
|
throw new Error("[Mirage] Cannot find a container (parent or option).");
|
|
1825
|
-
this.renderer = new
|
|
2025
|
+
this.renderer = new Le(
|
|
1826
2026
|
this.target,
|
|
1827
|
-
|
|
1828
|
-
|
|
2027
|
+
e,
|
|
2028
|
+
s,
|
|
1829
2029
|
this.registry
|
|
1830
|
-
), this.renderer.mount(), this.syncer = new
|
|
2030
|
+
), this.renderer.mount(), this.syncer = new We(this.target, this.renderer, this.registry, e);
|
|
1831
2031
|
}
|
|
1832
2032
|
start() {
|
|
1833
|
-
this
|
|
2033
|
+
return aA(this, null, function* () {
|
|
2034
|
+
yield this.syncer.start();
|
|
2035
|
+
});
|
|
1834
2036
|
}
|
|
1835
2037
|
stop() {
|
|
1836
2038
|
this.syncer.stop();
|
|
@@ -1841,55 +2043,62 @@ class mt {
|
|
|
1841
2043
|
getTracker() {
|
|
1842
2044
|
return this.syncer.tracker;
|
|
1843
2045
|
}
|
|
1844
|
-
updateUniforms(
|
|
1845
|
-
this.renderer.updateUniforms(
|
|
2046
|
+
updateUniforms(A, e) {
|
|
2047
|
+
this.renderer.updateUniforms(A, e);
|
|
1846
2048
|
}
|
|
1847
2049
|
getCanvas() {
|
|
1848
2050
|
return this.renderer.canvas;
|
|
1849
2051
|
}
|
|
1850
2052
|
test() {
|
|
1851
|
-
const
|
|
2053
|
+
const A = this.registry.get(
|
|
1852
2054
|
document.querySelector("#box2")
|
|
1853
2055
|
);
|
|
1854
|
-
if (!
|
|
2056
|
+
if (!A)
|
|
1855
2057
|
return;
|
|
1856
|
-
const
|
|
2058
|
+
const e = {
|
|
1857
2059
|
ArrowRight: !1,
|
|
1858
2060
|
ArrowLeft: !1,
|
|
1859
2061
|
ArrowUp: !1,
|
|
1860
2062
|
ArrowDown: !1
|
|
1861
2063
|
};
|
|
1862
|
-
window.addEventListener("keydown", (
|
|
1863
|
-
|
|
1864
|
-
}), window.addEventListener("keyup", (
|
|
1865
|
-
|
|
2064
|
+
window.addEventListener("keydown", (o) => {
|
|
2065
|
+
e[o.key] !== void 0 && (e[o.key] = !0);
|
|
2066
|
+
}), window.addEventListener("keyup", (o) => {
|
|
2067
|
+
e[o.key] !== void 0 && (e[o.key] = !1);
|
|
1866
2068
|
});
|
|
1867
|
-
const
|
|
1868
|
-
requestAnimationFrame(
|
|
2069
|
+
const s = 2, r = () => {
|
|
2070
|
+
requestAnimationFrame(r), e.ArrowRight && A.position.setX(A.position.x + s), e.ArrowLeft && A.position.setX(A.position.x - s), e.ArrowUp && A.position.setY(A.position.y + s), e.ArrowDown && A.position.setY(A.position.y - s);
|
|
1869
2071
|
};
|
|
1870
|
-
|
|
2072
|
+
r();
|
|
1871
2073
|
}
|
|
1872
2074
|
}
|
|
1873
2075
|
export {
|
|
1874
|
-
|
|
1875
|
-
|
|
2076
|
+
ZA as ALLOWED_FILTERS,
|
|
2077
|
+
eA as ATTR_DOM,
|
|
1876
2078
|
q as ATTR_FILTER,
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
2079
|
+
qe as ATTR_SANDWICH,
|
|
2080
|
+
Z as ATTR_SELECT,
|
|
2081
|
+
de as ATTR_SHADER,
|
|
2082
|
+
X as ATTR_TRAVEL,
|
|
2083
|
+
TA as DIRTY_CONTENT,
|
|
2084
|
+
DA as DIRTY_NONE,
|
|
2085
|
+
nA as DIRTY_RECT,
|
|
2086
|
+
SA as DIRTY_STRUCTURE,
|
|
2087
|
+
fA as DIRTY_STYLE,
|
|
2088
|
+
Qe as DIRTY_ZINDEX,
|
|
2089
|
+
je as EXCLUDED,
|
|
2090
|
+
Ve as Engine,
|
|
2091
|
+
pA as OFFSET_LOCAL_X,
|
|
2092
|
+
mA as OFFSET_LOCAL_Y,
|
|
2093
|
+
LA as OFFSET_PARENT,
|
|
2094
|
+
te as OFFSET_WORLD_X,
|
|
2095
|
+
ie as OFFSET_WORLD_Y,
|
|
2096
|
+
lA as SELECT_LAYER,
|
|
2097
|
+
L as THREE_LAYERS,
|
|
2098
|
+
VA as TRAVEL_VALUES,
|
|
2099
|
+
we as Tracker,
|
|
2100
|
+
j as USER_LAYER,
|
|
2101
|
+
tA as WASM_STRIDE,
|
|
2102
|
+
_e as WasmSynchronizer,
|
|
2103
|
+
fe as extractFromStyle
|
|
1895
2104
|
};
|