@liquidcars/atlas 0.1.43 → 0.1.44
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/README.md +8 -4
- package/dist/liquidcars-atlas.js +678 -539
- package/dist/liquidcars-atlas.js.map +1 -1
- package/package.json +1 -1
- package/src/liquidcars-atlas.js +239 -31
package/dist/liquidcars-atlas.js
CHANGED
|
@@ -42,54 +42,54 @@ function M(e, t) {
|
|
|
42
42
|
function N(e, t, n, r, i) {
|
|
43
43
|
return r + (e - t) * (i - r) / (n - t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function P(e, t, n) {
|
|
46
46
|
return e === t ? 0 : (n - e) / (t - e);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function F(e, t, n) {
|
|
49
49
|
return (1 - n) * e + n * t;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function I(e, t, n, r) {
|
|
52
|
+
return F(e, t, 1 - Math.exp(-n * r));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function ee(e, t = 1) {
|
|
55
55
|
return t - Math.abs(M(e, t * 2) - t);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function te(e, t, n) {
|
|
58
58
|
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * (3 - 2 * e));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function L(e, t, n) {
|
|
61
61
|
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * e * (e * (e * 6 - 15) + 10));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function ne(e, t) {
|
|
64
64
|
return e + Math.floor(Math.random() * (t - e + 1));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function re(e, t) {
|
|
67
67
|
return e + Math.random() * (t - e);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function R(e) {
|
|
70
70
|
return e * (.5 - Math.random());
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function z(e) {
|
|
73
73
|
e !== void 0 && (D = e);
|
|
74
74
|
let t = D += 1831565813;
|
|
75
75
|
return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function B(e) {
|
|
78
78
|
return e * O;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ie(e) {
|
|
81
81
|
return e * k;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ae(e) {
|
|
84
84
|
return !(e & e - 1) && e !== 0;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function oe(e) {
|
|
87
87
|
return 2 ** Math.ceil(Math.log(e) / Math.LN2);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function se(e) {
|
|
90
90
|
return 2 ** Math.floor(Math.log(e) / Math.LN2);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function ce(e, t, n, r, i) {
|
|
93
93
|
let a = Math.cos, o = Math.sin, s = a(n / 2), c = o(n / 2), l = a((t + r) / 2), u = o((t + r) / 2), d = a((t - r) / 2), f = o((t - r) / 2), p = a((r - t) / 2), m = o((r - t) / 2);
|
|
94
94
|
switch (i) {
|
|
95
95
|
case "XYX":
|
|
@@ -113,7 +113,7 @@ function le(e, t, n, r, i) {
|
|
|
113
113
|
default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + i);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function le(e, t) {
|
|
117
117
|
switch (t.constructor) {
|
|
118
118
|
case Float32Array: return e;
|
|
119
119
|
case Uint32Array: return e / 4294967295;
|
|
@@ -125,7 +125,7 @@ function ue(e, t) {
|
|
|
125
125
|
default: throw Error("Invalid component type.");
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function ue(e, t) {
|
|
129
129
|
switch (t.constructor) {
|
|
130
130
|
case Float32Array: return e;
|
|
131
131
|
case Uint32Array: return Math.round(e * 4294967295);
|
|
@@ -144,24 +144,24 @@ var de = {
|
|
|
144
144
|
clamp: j,
|
|
145
145
|
euclideanModulo: M,
|
|
146
146
|
mapLinear: N,
|
|
147
|
-
inverseLerp:
|
|
148
|
-
lerp:
|
|
149
|
-
damp:
|
|
150
|
-
pingpong:
|
|
151
|
-
smoothstep:
|
|
152
|
-
smootherstep:
|
|
153
|
-
randInt:
|
|
154
|
-
randFloat:
|
|
155
|
-
randFloatSpread:
|
|
156
|
-
seededRandom:
|
|
157
|
-
degToRad:
|
|
158
|
-
radToDeg:
|
|
159
|
-
isPowerOfTwo:
|
|
160
|
-
ceilPowerOfTwo:
|
|
161
|
-
floorPowerOfTwo:
|
|
162
|
-
setQuaternionFromProperEuler:
|
|
163
|
-
normalize:
|
|
164
|
-
denormalize:
|
|
147
|
+
inverseLerp: P,
|
|
148
|
+
lerp: F,
|
|
149
|
+
damp: I,
|
|
150
|
+
pingpong: ee,
|
|
151
|
+
smoothstep: te,
|
|
152
|
+
smootherstep: L,
|
|
153
|
+
randInt: ne,
|
|
154
|
+
randFloat: re,
|
|
155
|
+
randFloatSpread: R,
|
|
156
|
+
seededRandom: z,
|
|
157
|
+
degToRad: B,
|
|
158
|
+
radToDeg: ie,
|
|
159
|
+
isPowerOfTwo: ae,
|
|
160
|
+
ceilPowerOfTwo: oe,
|
|
161
|
+
floorPowerOfTwo: se,
|
|
162
|
+
setQuaternionFromProperEuler: ce,
|
|
163
|
+
normalize: ue,
|
|
164
|
+
denormalize: le
|
|
165
165
|
}, V = class e {
|
|
166
166
|
constructor(t = 0, n = 0) {
|
|
167
167
|
e.prototype.isVector2 = !0, this.x = t, this.y = n;
|
|
@@ -1975,8 +1975,8 @@ var Xe = /*@__PURE__*/ new Fe(), Ze = /*@__PURE__*/ new U(), Qe = /*@__PURE__*/
|
|
|
1975
1975
|
return this.multiplyMatrices(e, this);
|
|
1976
1976
|
}
|
|
1977
1977
|
multiplyMatrices(e, t) {
|
|
1978
|
-
let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3],
|
|
1979
|
-
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c *
|
|
1978
|
+
let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3], P = r[7], F = r[11], I = r[15];
|
|
1979
|
+
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * P, i[8] = a * C + o * D + s * j + c * F, i[12] = a * w + o * O + s * M + c * I, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * P, i[9] = l * C + u * D + d * j + f * F, i[13] = l * w + u * O + d * M + f * I, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * P, i[10] = p * C + m * D + h * j + g * F, i[14] = p * w + m * O + h * M + g * I, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * P, i[11] = _ * C + v * D + y * j + b * F, i[15] = _ * w + v * O + y * M + b * I, this;
|
|
1980
1980
|
}
|
|
1981
1981
|
multiplyScalar(e) {
|
|
1982
1982
|
let t = this.elements;
|
|
@@ -2854,7 +2854,7 @@ var X = class {
|
|
|
2854
2854
|
}
|
|
2855
2855
|
lerpHSL(e, t) {
|
|
2856
2856
|
this.getHSL(Zt), e.getHSL(Qt);
|
|
2857
|
-
let n =
|
|
2857
|
+
let n = F(Zt.h, Qt.h, t), r = F(Zt.s, Qt.s, t), i = F(Zt.l, Qt.l, t);
|
|
2858
2858
|
return this.setHSL(n, r, i), this;
|
|
2859
2859
|
}
|
|
2860
2860
|
setFromVector3(e) {
|
|
@@ -3020,47 +3020,47 @@ var tn = 0, nn = class extends T {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
getComponent(e, t) {
|
|
3022
3022
|
let n = this.array[e * this.itemSize + t];
|
|
3023
|
-
return this.normalized && (n =
|
|
3023
|
+
return this.normalized && (n = le(n, this.array)), n;
|
|
3024
3024
|
}
|
|
3025
3025
|
setComponent(e, t, n) {
|
|
3026
|
-
return this.normalized && (n =
|
|
3026
|
+
return this.normalized && (n = ue(n, this.array)), this.array[e * this.itemSize + t] = n, this;
|
|
3027
3027
|
}
|
|
3028
3028
|
getX(e) {
|
|
3029
3029
|
let t = this.array[e * this.itemSize];
|
|
3030
|
-
return this.normalized && (t =
|
|
3030
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3031
3031
|
}
|
|
3032
3032
|
setX(e, t) {
|
|
3033
|
-
return this.normalized && (t =
|
|
3033
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize] = t, this;
|
|
3034
3034
|
}
|
|
3035
3035
|
getY(e) {
|
|
3036
3036
|
let t = this.array[e * this.itemSize + 1];
|
|
3037
|
-
return this.normalized && (t =
|
|
3037
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3038
3038
|
}
|
|
3039
3039
|
setY(e, t) {
|
|
3040
|
-
return this.normalized && (t =
|
|
3040
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
|
|
3041
3041
|
}
|
|
3042
3042
|
getZ(e) {
|
|
3043
3043
|
let t = this.array[e * this.itemSize + 2];
|
|
3044
|
-
return this.normalized && (t =
|
|
3044
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3045
3045
|
}
|
|
3046
3046
|
setZ(e, t) {
|
|
3047
|
-
return this.normalized && (t =
|
|
3047
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
|
|
3048
3048
|
}
|
|
3049
3049
|
getW(e) {
|
|
3050
3050
|
let t = this.array[e * this.itemSize + 3];
|
|
3051
|
-
return this.normalized && (t =
|
|
3051
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3052
3052
|
}
|
|
3053
3053
|
setW(e, t) {
|
|
3054
|
-
return this.normalized && (t =
|
|
3054
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
|
|
3055
3055
|
}
|
|
3056
3056
|
setXY(e, t, n) {
|
|
3057
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3057
|
+
return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;
|
|
3058
3058
|
}
|
|
3059
3059
|
setXYZ(e, t, n, r) {
|
|
3060
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3060
|
+
return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array), r = ue(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this;
|
|
3061
3061
|
}
|
|
3062
3062
|
setXYZW(e, t, n, r, i) {
|
|
3063
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3063
|
+
return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array), r = ue(r, this.array), i = ue(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this;
|
|
3064
3064
|
}
|
|
3065
3065
|
onUpload(e) {
|
|
3066
3066
|
return this.onUploadCallback = e, this;
|
|
@@ -5386,22 +5386,22 @@ var Ji = class e extends vn {
|
|
|
5386
5386
|
}
|
|
5387
5387
|
let j = [];
|
|
5388
5388
|
for (let e = 0, t = D.length, n = t - 1, r = e + 1; e < t; e++, n++, r++) n === t && (n = 0), r === t && (r = 0), j[e] = A(D[e], D[n], D[r]);
|
|
5389
|
-
let M = [], N,
|
|
5389
|
+
let M = [], N, P = j.concat();
|
|
5390
5390
|
for (let e = 0, t = E; e < t; e++) {
|
|
5391
5391
|
let t = w[e];
|
|
5392
5392
|
N = [];
|
|
5393
5393
|
for (let e = 0, n = t.length, r = n - 1, i = e + 1; e < n; e++, r++, i++) r === n && (r = 0), i === n && (i = 0), N[e] = A(t[e], t[r], t[i]);
|
|
5394
|
-
M.push(N),
|
|
5394
|
+
M.push(N), P = P.concat(N);
|
|
5395
5395
|
}
|
|
5396
|
-
let
|
|
5397
|
-
if (p === 0)
|
|
5396
|
+
let F;
|
|
5397
|
+
if (p === 0) F = Gi.triangulateShape(D, w);
|
|
5398
5398
|
else {
|
|
5399
5399
|
let e = [], t = [];
|
|
5400
5400
|
for (let n = 0; n < p; n++) {
|
|
5401
5401
|
let r = n / p, i = u * Math.cos(r * Math.PI / 2), a = d * Math.sin(r * Math.PI / 2) + f;
|
|
5402
5402
|
for (let t = 0, n = D.length; t < n; t++) {
|
|
5403
5403
|
let n = O(D[t], j[t], a);
|
|
5404
|
-
|
|
5404
|
+
re(n.x, n.y, -i), r === 0 && e.push(n);
|
|
5405
5405
|
}
|
|
5406
5406
|
for (let e = 0, n = E; e < n; e++) {
|
|
5407
5407
|
let n = w[e];
|
|
@@ -5409,100 +5409,100 @@ var Ji = class e extends vn {
|
|
|
5409
5409
|
let o = [];
|
|
5410
5410
|
for (let e = 0, t = n.length; e < t; e++) {
|
|
5411
5411
|
let t = O(n[e], N[e], a);
|
|
5412
|
-
|
|
5412
|
+
re(t.x, t.y, -i), r === 0 && o.push(t);
|
|
5413
5413
|
}
|
|
5414
5414
|
r === 0 && t.push(o);
|
|
5415
5415
|
}
|
|
5416
5416
|
}
|
|
5417
|
-
|
|
5417
|
+
F = Gi.triangulateShape(e, t);
|
|
5418
5418
|
}
|
|
5419
|
-
let
|
|
5419
|
+
let I = F.length, ee = d + f;
|
|
5420
5420
|
for (let e = 0; e < k; e++) {
|
|
5421
|
-
let t = l ? O(C[e],
|
|
5422
|
-
_ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y),
|
|
5421
|
+
let t = l ? O(C[e], P[e], ee) : C[e];
|
|
5422
|
+
_ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y), re(x.x, x.y, x.z)) : re(t.x, t.y, 0);
|
|
5423
5423
|
}
|
|
5424
5424
|
for (let e = 1; e <= s; e++) for (let t = 0; t < k; t++) {
|
|
5425
|
-
let n = l ? O(C[t],
|
|
5426
|
-
_ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y),
|
|
5425
|
+
let n = l ? O(C[t], P[t], ee) : C[t];
|
|
5426
|
+
_ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y), re(x.x, x.y, x.z)) : re(n.x, n.y, c / s * e);
|
|
5427
5427
|
}
|
|
5428
5428
|
for (let e = p - 1; e >= 0; e--) {
|
|
5429
5429
|
let t = e / p, n = u * Math.cos(t * Math.PI / 2), r = d * Math.sin(t * Math.PI / 2) + f;
|
|
5430
5430
|
for (let e = 0, t = D.length; e < t; e++) {
|
|
5431
5431
|
let t = O(D[e], j[e], r);
|
|
5432
|
-
|
|
5432
|
+
re(t.x, t.y, c + n);
|
|
5433
5433
|
}
|
|
5434
5434
|
for (let e = 0, t = w.length; e < t; e++) {
|
|
5435
5435
|
let t = w[e];
|
|
5436
5436
|
N = M[e];
|
|
5437
5437
|
for (let e = 0, i = t.length; e < i; e++) {
|
|
5438
5438
|
let i = O(t[e], N[e], r);
|
|
5439
|
-
_ ?
|
|
5439
|
+
_ ? re(i.x, i.y + g[s - 1].y, g[s - 1].x + n) : re(i.x, i.y, c + n);
|
|
5440
5440
|
}
|
|
5441
5441
|
}
|
|
5442
5442
|
}
|
|
5443
|
-
|
|
5444
|
-
function
|
|
5443
|
+
te(), L();
|
|
5444
|
+
function te() {
|
|
5445
5445
|
let e = r.length / 3;
|
|
5446
5446
|
if (l) {
|
|
5447
5447
|
let e = 0, t = k * e;
|
|
5448
|
-
for (let e = 0; e <
|
|
5449
|
-
let n =
|
|
5450
|
-
|
|
5448
|
+
for (let e = 0; e < I; e++) {
|
|
5449
|
+
let n = F[e];
|
|
5450
|
+
R(n[2] + t, n[1] + t, n[0] + t);
|
|
5451
5451
|
}
|
|
5452
5452
|
e = s + p * 2, t = k * e;
|
|
5453
|
-
for (let e = 0; e <
|
|
5454
|
-
let n =
|
|
5455
|
-
|
|
5453
|
+
for (let e = 0; e < I; e++) {
|
|
5454
|
+
let n = F[e];
|
|
5455
|
+
R(n[0] + t, n[1] + t, n[2] + t);
|
|
5456
5456
|
}
|
|
5457
5457
|
} else {
|
|
5458
|
-
for (let e = 0; e <
|
|
5459
|
-
let t =
|
|
5460
|
-
|
|
5458
|
+
for (let e = 0; e < I; e++) {
|
|
5459
|
+
let t = F[e];
|
|
5460
|
+
R(t[2], t[1], t[0]);
|
|
5461
5461
|
}
|
|
5462
|
-
for (let e = 0; e <
|
|
5463
|
-
let t =
|
|
5464
|
-
|
|
5462
|
+
for (let e = 0; e < I; e++) {
|
|
5463
|
+
let t = F[e];
|
|
5464
|
+
R(t[0] + k * s, t[1] + k * s, t[2] + k * s);
|
|
5465
5465
|
}
|
|
5466
5466
|
}
|
|
5467
5467
|
n.addGroup(e, r.length / 3 - e, 0);
|
|
5468
5468
|
}
|
|
5469
|
-
function
|
|
5469
|
+
function L() {
|
|
5470
5470
|
let e = r.length / 3, t = 0;
|
|
5471
|
-
|
|
5471
|
+
ne(D, t), t += D.length;
|
|
5472
5472
|
for (let e = 0, n = w.length; e < n; e++) {
|
|
5473
5473
|
let n = w[e];
|
|
5474
|
-
|
|
5474
|
+
ne(n, t), t += n.length;
|
|
5475
5475
|
}
|
|
5476
5476
|
n.addGroup(e, r.length / 3 - e, 1);
|
|
5477
5477
|
}
|
|
5478
|
-
function
|
|
5478
|
+
function ne(e, t) {
|
|
5479
5479
|
let n = e.length;
|
|
5480
5480
|
for (; --n >= 0;) {
|
|
5481
5481
|
let r = n, i = n - 1;
|
|
5482
5482
|
i < 0 && (i = e.length - 1);
|
|
5483
5483
|
for (let e = 0, n = s + p * 2; e < n; e++) {
|
|
5484
5484
|
let n = k * e, a = k * (e + 1);
|
|
5485
|
-
|
|
5485
|
+
z(t + r + n, t + i + n, t + i + a, t + r + a);
|
|
5486
5486
|
}
|
|
5487
5487
|
}
|
|
5488
5488
|
}
|
|
5489
|
-
function
|
|
5489
|
+
function re(e, t, n) {
|
|
5490
5490
|
a.push(e), a.push(t), a.push(n);
|
|
5491
5491
|
}
|
|
5492
|
-
function
|
|
5493
|
-
|
|
5492
|
+
function R(e, t, i) {
|
|
5493
|
+
B(e), B(t), B(i);
|
|
5494
5494
|
let a = r.length / 3, o = h.generateTopUV(n, r, a - 3, a - 2, a - 1);
|
|
5495
|
-
|
|
5495
|
+
ie(o[0]), ie(o[1]), ie(o[2]);
|
|
5496
5496
|
}
|
|
5497
|
-
function
|
|
5498
|
-
|
|
5497
|
+
function z(e, t, i, a) {
|
|
5498
|
+
B(e), B(t), B(a), B(t), B(i), B(a);
|
|
5499
5499
|
let o = r.length / 3, s = h.generateSideWallUV(n, r, o - 6, o - 3, o - 2, o - 1);
|
|
5500
|
-
|
|
5500
|
+
ie(s[0]), ie(s[1]), ie(s[3]), ie(s[1]), ie(s[2]), ie(s[3]);
|
|
5501
5501
|
}
|
|
5502
|
-
function
|
|
5502
|
+
function B(e) {
|
|
5503
5503
|
r.push(a[e * 3 + 0]), r.push(a[e * 3 + 1]), r.push(a[e * 3 + 2]);
|
|
5504
5504
|
}
|
|
5505
|
-
function
|
|
5505
|
+
function ie(e) {
|
|
5506
5506
|
i.push(e.x), i.push(e.y);
|
|
5507
5507
|
}
|
|
5508
5508
|
}
|
|
@@ -9329,7 +9329,7 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9329
9329
|
let e = Qa[w];
|
|
9330
9330
|
O = e.vertexShader, k = e.fragmentShader;
|
|
9331
9331
|
} else O = a.vertexShader, k = a.fragmentShader, c.update(a), A = c.getVertexShaderID(a), j = c.getFragmentShaderID(a);
|
|
9332
|
-
let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(),
|
|
9332
|
+
let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), P = _.isInstancedMesh === !0, F = _.isBatchedMesh === !0, I = !!a.map, ee = !!a.matcap, te = !!S, L = !!a.aoMap, ne = !!a.lightMap, re = !!a.bumpMap, R = !!a.normalMap, z = !!a.displacementMap, B = !!a.emissiveMap, ie = !!a.metalnessMap, ae = !!a.roughnessMap, oe = a.anisotropy > 0, se = a.clearcoat > 0, ce = a.dispersion > 0, le = a.iridescence > 0, ue = a.sheen > 0, de = a.transmission > 0, V = oe && !!a.anisotropyMap, H = se && !!a.clearcoatMap, U = se && !!a.clearcoatNormalMap, fe = se && !!a.clearcoatRoughnessMap, W = le && !!a.iridescenceMap, G = le && !!a.iridescenceThicknessMap, K = ue && !!a.sheenColorMap, pe = ue && !!a.sheenRoughnessMap, q = !!a.specularMap, me = !!a.specularColorMap, J = !!a.specularIntensityMap, he = de && !!a.transmissionMap, ge = de && !!a.thicknessMap, _e = !!a.gradientMap, ve = !!a.alphaMap, ye = a.alphaTest > 0, be = !!a.alphaHash, xe = !!a.extensions, Se = 0;
|
|
9333
9333
|
a.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Se = e.toneMapping);
|
|
9334
9334
|
let Ce = {
|
|
9335
9335
|
shaderID: w,
|
|
@@ -9343,40 +9343,40 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9343
9343
|
isRawShaderMaterial: a.isRawShaderMaterial === !0,
|
|
9344
9344
|
glslVersion: a.glslVersion,
|
|
9345
9345
|
precision: p,
|
|
9346
|
-
batching:
|
|
9347
|
-
batchingColor:
|
|
9348
|
-
instancing:
|
|
9349
|
-
instancingColor:
|
|
9350
|
-
instancingMorph:
|
|
9346
|
+
batching: F,
|
|
9347
|
+
batchingColor: F && _._colorsTexture !== null,
|
|
9348
|
+
instancing: P,
|
|
9349
|
+
instancingColor: P && _.instanceColor !== null,
|
|
9350
|
+
instancingMorph: P && _.morphTexture !== null,
|
|
9351
9351
|
supportsVertexTextures: f,
|
|
9352
9352
|
outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : b,
|
|
9353
9353
|
alphaToCoverage: !!a.alphaToCoverage,
|
|
9354
|
-
map:
|
|
9355
|
-
matcap:
|
|
9356
|
-
envMap:
|
|
9357
|
-
envMapMode:
|
|
9354
|
+
map: I,
|
|
9355
|
+
matcap: ee,
|
|
9356
|
+
envMap: te,
|
|
9357
|
+
envMapMode: te && S.mapping,
|
|
9358
9358
|
envMapCubeUVHeight: C,
|
|
9359
|
-
aoMap:
|
|
9360
|
-
lightMap:
|
|
9361
|
-
bumpMap:
|
|
9362
|
-
normalMap:
|
|
9363
|
-
displacementMap: f &&
|
|
9364
|
-
emissiveMap:
|
|
9365
|
-
normalMapObjectSpace:
|
|
9366
|
-
normalMapTangentSpace:
|
|
9367
|
-
metalnessMap:
|
|
9368
|
-
roughnessMap:
|
|
9369
|
-
anisotropy:
|
|
9359
|
+
aoMap: L,
|
|
9360
|
+
lightMap: ne,
|
|
9361
|
+
bumpMap: re,
|
|
9362
|
+
normalMap: R,
|
|
9363
|
+
displacementMap: f && z,
|
|
9364
|
+
emissiveMap: B,
|
|
9365
|
+
normalMapObjectSpace: R && a.normalMapType === 1,
|
|
9366
|
+
normalMapTangentSpace: R && a.normalMapType === 0,
|
|
9367
|
+
metalnessMap: ie,
|
|
9368
|
+
roughnessMap: ae,
|
|
9369
|
+
anisotropy: oe,
|
|
9370
9370
|
anisotropyMap: V,
|
|
9371
|
-
clearcoat:
|
|
9371
|
+
clearcoat: se,
|
|
9372
9372
|
clearcoatMap: H,
|
|
9373
9373
|
clearcoatNormalMap: U,
|
|
9374
9374
|
clearcoatRoughnessMap: fe,
|
|
9375
|
-
dispersion:
|
|
9376
|
-
iridescence:
|
|
9375
|
+
dispersion: ce,
|
|
9376
|
+
iridescence: le,
|
|
9377
9377
|
iridescenceMap: W,
|
|
9378
9378
|
iridescenceThicknessMap: G,
|
|
9379
|
-
sheen:
|
|
9379
|
+
sheen: ue,
|
|
9380
9380
|
sheenColorMap: K,
|
|
9381
9381
|
sheenRoughnessMap: pe,
|
|
9382
9382
|
specularMap: q,
|
|
@@ -9391,15 +9391,15 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9391
9391
|
alphaTest: ye,
|
|
9392
9392
|
alphaHash: be,
|
|
9393
9393
|
combine: a.combine,
|
|
9394
|
-
mapUv:
|
|
9395
|
-
aoMapUv:
|
|
9396
|
-
lightMapUv:
|
|
9397
|
-
bumpMapUv:
|
|
9398
|
-
normalMapUv:
|
|
9399
|
-
displacementMapUv:
|
|
9400
|
-
emissiveMapUv:
|
|
9401
|
-
metalnessMapUv:
|
|
9402
|
-
roughnessMapUv:
|
|
9394
|
+
mapUv: I && h(a.map.channel),
|
|
9395
|
+
aoMapUv: L && h(a.aoMap.channel),
|
|
9396
|
+
lightMapUv: ne && h(a.lightMap.channel),
|
|
9397
|
+
bumpMapUv: re && h(a.bumpMap.channel),
|
|
9398
|
+
normalMapUv: R && h(a.normalMap.channel),
|
|
9399
|
+
displacementMapUv: z && h(a.displacementMap.channel),
|
|
9400
|
+
emissiveMapUv: B && h(a.emissiveMap.channel),
|
|
9401
|
+
metalnessMapUv: ie && h(a.metalnessMap.channel),
|
|
9402
|
+
roughnessMapUv: ae && h(a.roughnessMap.channel),
|
|
9403
9403
|
anisotropyMapUv: V && h(a.anisotropyMap.channel),
|
|
9404
9404
|
clearcoatMapUv: H && h(a.clearcoatMap.channel),
|
|
9405
9405
|
clearcoatNormalMapUv: U && h(a.clearcoatNormalMap.channel),
|
|
@@ -9414,10 +9414,10 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9414
9414
|
transmissionMapUv: he && h(a.transmissionMap.channel),
|
|
9415
9415
|
thicknessMapUv: ge && h(a.thicknessMap.channel),
|
|
9416
9416
|
alphaMapUv: ve && h(a.alphaMap.channel),
|
|
9417
|
-
vertexTangents: !!y.attributes.tangent && (
|
|
9417
|
+
vertexTangents: !!y.attributes.tangent && (R || oe),
|
|
9418
9418
|
vertexColors: a.vertexColors,
|
|
9419
9419
|
vertexAlphas: a.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
|
|
9420
|
-
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (
|
|
9420
|
+
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (I || ve),
|
|
9421
9421
|
fog: !!v,
|
|
9422
9422
|
useFog: a.fog === !0,
|
|
9423
9423
|
fogExp2: !!v && v.isFogExp2,
|
|
@@ -9448,8 +9448,8 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9448
9448
|
shadowMapEnabled: e.shadowMap.enabled && u.length > 0,
|
|
9449
9449
|
shadowMapType: e.shadowMap.type,
|
|
9450
9450
|
toneMapping: Se,
|
|
9451
|
-
decodeVideoTexture:
|
|
9452
|
-
decodeVideoTextureEmissive:
|
|
9451
|
+
decodeVideoTexture: I && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
|
|
9452
|
+
decodeVideoTextureEmissive: B && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
|
|
9453
9453
|
premultipliedAlpha: a.premultipliedAlpha,
|
|
9454
9454
|
doubleSided: a.side === 2,
|
|
9455
9455
|
flipSided: a.side === 1,
|
|
@@ -9457,7 +9457,7 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9457
9457
|
depthPacking: a.depthPacking || 0,
|
|
9458
9458
|
index0AttributeName: a.index0AttributeName,
|
|
9459
9459
|
extensionClipCullDistance: xe && a.extensions.clipCullDistance === !0 && r.has("WEBGL_clip_cull_distance"),
|
|
9460
|
-
extensionMultiDraw: (xe && a.extensions.multiDraw === !0 ||
|
|
9460
|
+
extensionMultiDraw: (xe && a.extensions.multiDraw === !0 || F) && r.has("WEBGL_multi_draw"),
|
|
9461
9461
|
rendererExtensionParallelShaderCompile: r.has("KHR_parallel_shader_compile"),
|
|
9462
9462
|
customProgramCacheKey: a.customProgramCacheKey()
|
|
9463
9463
|
};
|
|
@@ -10017,7 +10017,7 @@ function Vc(e, t) {
|
|
|
10017
10017
|
return r;
|
|
10018
10018
|
},
|
|
10019
10019
|
setTest: function(t) {
|
|
10020
|
-
t ?
|
|
10020
|
+
t ? z(e.DEPTH_TEST) : B(e.DEPTH_TEST);
|
|
10021
10021
|
},
|
|
10022
10022
|
setMask: function(t) {
|
|
10023
10023
|
i !== t && !n && (e.depthMask(t), i = t);
|
|
@@ -10069,7 +10069,7 @@ function Vc(e, t) {
|
|
|
10069
10069
|
let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
|
|
10070
10070
|
return {
|
|
10071
10071
|
setTest: function(n) {
|
|
10072
|
-
t || (n ?
|
|
10072
|
+
t || (n ? z(e.STENCIL_TEST) : B(e.STENCIL_TEST));
|
|
10073
10073
|
},
|
|
10074
10074
|
setMask: function(r) {
|
|
10075
10075
|
n !== r && !t && (e.stencilMask(r), n = r);
|
|
@@ -10091,27 +10091,27 @@ function Vc(e, t) {
|
|
|
10091
10091
|
}
|
|
10092
10092
|
};
|
|
10093
10093
|
}
|
|
10094
|
-
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0,
|
|
10095
|
-
|
|
10096
|
-
let
|
|
10097
|
-
function
|
|
10094
|
+
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0, P = e.getParameter(e.VERSION);
|
|
10095
|
+
P.indexOf("WebGL") === -1 ? P.indexOf("OpenGL ES") !== -1 && (N = parseFloat(/^OpenGL ES (\d)/.exec(P)[1]), M = N >= 2) : (N = parseFloat(/^WebGL (\d)/.exec(P)[1]), M = N >= 1);
|
|
10096
|
+
let F = null, I = {}, ee = e.getParameter(e.SCISSOR_BOX), te = e.getParameter(e.VIEWPORT), L = new Ae().fromArray(ee), ne = new Ae().fromArray(te);
|
|
10097
|
+
function re(t, n, r, i) {
|
|
10098
10098
|
let a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();
|
|
10099
10099
|
e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
|
|
10100
10100
|
for (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
|
|
10101
10101
|
return o;
|
|
10102
10102
|
}
|
|
10103
|
-
let
|
|
10104
|
-
|
|
10105
|
-
function
|
|
10103
|
+
let R = {};
|
|
10104
|
+
R[e.TEXTURE_2D] = re(e.TEXTURE_2D, e.TEXTURE_2D, 1), R[e.TEXTURE_CUBE_MAP] = re(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), R[e.TEXTURE_2D_ARRAY] = re(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), R[e.TEXTURE_3D] = re(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), z(e.DEPTH_TEST), o.setFunc(3), de(!1), V(1), z(e.CULL_FACE), le(0);
|
|
10105
|
+
function z(t) {
|
|
10106
10106
|
u[t] !== !0 && (e.enable(t), u[t] = !0);
|
|
10107
10107
|
}
|
|
10108
|
-
function
|
|
10108
|
+
function B(t) {
|
|
10109
10109
|
u[t] !== !1 && (e.disable(t), u[t] = !1);
|
|
10110
10110
|
}
|
|
10111
|
-
function
|
|
10111
|
+
function ie(t, n) {
|
|
10112
10112
|
return d[t] !== n && (e.bindFramebuffer(t, n), d[t] = n, t === e.DRAW_FRAMEBUFFER && (d[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (d[e.DRAW_FRAMEBUFFER] = n), !0);
|
|
10113
10113
|
}
|
|
10114
|
-
function
|
|
10114
|
+
function ae(t, n) {
|
|
10115
10115
|
let r = p, i = !1;
|
|
10116
10116
|
if (t) {
|
|
10117
10117
|
r = f.get(n), r === void 0 && (r = [], f.set(n, r));
|
|
@@ -10123,16 +10123,16 @@ function Vc(e, t) {
|
|
|
10123
10123
|
} else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
|
|
10124
10124
|
i && e.drawBuffers(r);
|
|
10125
10125
|
}
|
|
10126
|
-
function
|
|
10126
|
+
function oe(t) {
|
|
10127
10127
|
return m !== t && (e.useProgram(t), m = t, !0);
|
|
10128
10128
|
}
|
|
10129
|
-
let
|
|
10129
|
+
let se = {
|
|
10130
10130
|
100: e.FUNC_ADD,
|
|
10131
10131
|
101: e.FUNC_SUBTRACT,
|
|
10132
10132
|
102: e.FUNC_REVERSE_SUBTRACT
|
|
10133
10133
|
};
|
|
10134
|
-
|
|
10135
|
-
let
|
|
10134
|
+
se[103] = e.MIN, se[104] = e.MAX;
|
|
10135
|
+
let ce = {
|
|
10136
10136
|
200: e.ZERO,
|
|
10137
10137
|
201: e.ONE,
|
|
10138
10138
|
202: e.SRC_COLOR,
|
|
@@ -10149,12 +10149,12 @@ function Vc(e, t) {
|
|
|
10149
10149
|
213: e.CONSTANT_ALPHA,
|
|
10150
10150
|
214: e.ONE_MINUS_CONSTANT_ALPHA
|
|
10151
10151
|
};
|
|
10152
|
-
function
|
|
10152
|
+
function le(t, n, r, i, a, o, s, c, l, u) {
|
|
10153
10153
|
if (t === 0) {
|
|
10154
|
-
h === !0 && (
|
|
10154
|
+
h === !0 && (B(e.BLEND), h = !1);
|
|
10155
10155
|
return;
|
|
10156
10156
|
}
|
|
10157
|
-
if (h === !1 && (
|
|
10157
|
+
if (h === !1 && (z(e.BLEND), h = !0), t !== 5) {
|
|
10158
10158
|
if (t !== g || u !== T) {
|
|
10159
10159
|
if ((_ !== 100 || b !== 100) && (e.blendEquation(e.FUNC_ADD), _ = 100, b = 100), u) switch (t) {
|
|
10160
10160
|
case 1:
|
|
@@ -10190,43 +10190,43 @@ function Vc(e, t) {
|
|
|
10190
10190
|
}
|
|
10191
10191
|
return;
|
|
10192
10192
|
}
|
|
10193
|
-
a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(
|
|
10193
|
+
a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(se[n], se[a]), _ = n, b = a), (r !== v || i !== y || o !== x || s !== S) && (e.blendFuncSeparate(ce[r], ce[i], ce[o], ce[s]), v = r, y = i, x = o, S = s), (c.equals(C) === !1 || l !== w) && (e.blendColor(c.r, c.g, c.b, l), C.copy(c), w = l), g = t, T = !1;
|
|
10194
10194
|
}
|
|
10195
|
-
function
|
|
10196
|
-
t.side === 2 ?
|
|
10195
|
+
function ue(t, n) {
|
|
10196
|
+
t.side === 2 ? B(e.CULL_FACE) : z(e.CULL_FACE);
|
|
10197
10197
|
let r = t.side === 1;
|
|
10198
|
-
n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ?
|
|
10198
|
+
n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ? le(0) : le(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
|
|
10199
10199
|
let i = t.stencilWrite;
|
|
10200
|
-
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), U(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ?
|
|
10200
|
+
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), U(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? z(e.SAMPLE_ALPHA_TO_COVERAGE) : B(e.SAMPLE_ALPHA_TO_COVERAGE);
|
|
10201
10201
|
}
|
|
10202
10202
|
function de(t) {
|
|
10203
10203
|
E !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), E = t);
|
|
10204
10204
|
}
|
|
10205
10205
|
function V(t) {
|
|
10206
|
-
t === 0 ?
|
|
10206
|
+
t === 0 ? B(e.CULL_FACE) : (z(e.CULL_FACE), t !== D && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), D = t;
|
|
10207
10207
|
}
|
|
10208
10208
|
function H(t) {
|
|
10209
10209
|
t !== O && (M && e.lineWidth(t), O = t);
|
|
10210
10210
|
}
|
|
10211
10211
|
function U(t, n, r) {
|
|
10212
|
-
t ? (
|
|
10212
|
+
t ? (z(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : B(e.POLYGON_OFFSET_FILL);
|
|
10213
10213
|
}
|
|
10214
10214
|
function fe(t) {
|
|
10215
|
-
t ?
|
|
10215
|
+
t ? z(e.SCISSOR_TEST) : B(e.SCISSOR_TEST);
|
|
10216
10216
|
}
|
|
10217
10217
|
function W(t) {
|
|
10218
|
-
t === void 0 && (t = e.TEXTURE0 + j - 1),
|
|
10218
|
+
t === void 0 && (t = e.TEXTURE0 + j - 1), F !== t && (e.activeTexture(t), F = t);
|
|
10219
10219
|
}
|
|
10220
10220
|
function G(t, n, r) {
|
|
10221
|
-
r === void 0 && (r =
|
|
10222
|
-
let i =
|
|
10221
|
+
r === void 0 && (r = F === null ? e.TEXTURE0 + j - 1 : F);
|
|
10222
|
+
let i = I[r];
|
|
10223
10223
|
i === void 0 && (i = {
|
|
10224
10224
|
type: void 0,
|
|
10225
10225
|
texture: void 0
|
|
10226
|
-
},
|
|
10226
|
+
}, I[r] = i), (i.type !== t || i.texture !== n) && (F !== r && (e.activeTexture(r), F = r), e.bindTexture(t, n || R[t]), i.type = t, i.texture = n);
|
|
10227
10227
|
}
|
|
10228
10228
|
function K() {
|
|
10229
|
-
let t = F
|
|
10229
|
+
let t = I[F];
|
|
10230
10230
|
t !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);
|
|
10231
10231
|
}
|
|
10232
10232
|
function pe() {
|
|
@@ -10300,10 +10300,10 @@ function Vc(e, t) {
|
|
|
10300
10300
|
}
|
|
10301
10301
|
}
|
|
10302
10302
|
function be(t) {
|
|
10303
|
-
|
|
10303
|
+
L.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), L.copy(t));
|
|
10304
10304
|
}
|
|
10305
10305
|
function xe(t) {
|
|
10306
|
-
|
|
10306
|
+
ne.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), ne.copy(t));
|
|
10307
10307
|
}
|
|
10308
10308
|
function Se(t, n) {
|
|
10309
10309
|
let r = l.get(n);
|
|
@@ -10316,7 +10316,7 @@ function Vc(e, t) {
|
|
|
10316
10316
|
c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
|
|
10317
10317
|
}
|
|
10318
10318
|
function we() {
|
|
10319
|
-
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {},
|
|
10319
|
+
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {}, F = null, I = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, L.set(0, 0, e.canvas.width, e.canvas.height), ne.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
|
|
10320
10320
|
}
|
|
10321
10321
|
return {
|
|
10322
10322
|
buffers: {
|
|
@@ -10324,13 +10324,13 @@ function Vc(e, t) {
|
|
|
10324
10324
|
depth: o,
|
|
10325
10325
|
stencil: s
|
|
10326
10326
|
},
|
|
10327
|
-
enable:
|
|
10328
|
-
disable:
|
|
10329
|
-
bindFramebuffer:
|
|
10330
|
-
drawBuffers:
|
|
10331
|
-
useProgram:
|
|
10332
|
-
setBlending:
|
|
10333
|
-
setMaterial:
|
|
10327
|
+
enable: z,
|
|
10328
|
+
disable: B,
|
|
10329
|
+
bindFramebuffer: ie,
|
|
10330
|
+
drawBuffers: ae,
|
|
10331
|
+
useProgram: oe,
|
|
10332
|
+
setBlending: le,
|
|
10333
|
+
setMaterial: ue,
|
|
10334
10334
|
setFlipSided: de,
|
|
10335
10335
|
setCullFace: V,
|
|
10336
10336
|
setLineWidth: H,
|
|
@@ -10411,7 +10411,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10411
10411
|
}
|
|
10412
10412
|
function j(e) {
|
|
10413
10413
|
let t = e.target;
|
|
10414
|
-
t.removeEventListener("dispose", j),
|
|
10414
|
+
t.removeEventListener("dispose", j), P(t);
|
|
10415
10415
|
}
|
|
10416
10416
|
function M(e) {
|
|
10417
10417
|
let t = l.get(e);
|
|
@@ -10429,7 +10429,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10429
10429
|
let n = e.source, r = y.get(n);
|
|
10430
10430
|
delete r[t.__cacheKey], p.memory.textures--;
|
|
10431
10431
|
}
|
|
10432
|
-
function
|
|
10432
|
+
function P(e) {
|
|
10433
10433
|
let t = l.get(e);
|
|
10434
10434
|
if (e.depthTexture && (e.depthTexture.dispose(), l.remove(e.depthTexture)), e.isWebGLCubeRenderTarget) for (let e = 0; e < 6; e++) {
|
|
10435
10435
|
if (Array.isArray(t.__webglFramebuffer[e])) for (let n = 0; n < t.__webglFramebuffer[e].length; n++) o.deleteFramebuffer(t.__webglFramebuffer[e][n]);
|
|
@@ -10449,67 +10449,67 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10449
10449
|
}
|
|
10450
10450
|
l.remove(e);
|
|
10451
10451
|
}
|
|
10452
|
-
let
|
|
10453
|
-
function
|
|
10454
|
-
|
|
10452
|
+
let F = 0;
|
|
10453
|
+
function I() {
|
|
10454
|
+
F = 0;
|
|
10455
10455
|
}
|
|
10456
|
-
function
|
|
10457
|
-
let e =
|
|
10458
|
-
return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures),
|
|
10456
|
+
function ee() {
|
|
10457
|
+
let e = F;
|
|
10458
|
+
return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures), F += 1, e;
|
|
10459
10459
|
}
|
|
10460
|
-
function
|
|
10460
|
+
function te(e) {
|
|
10461
10461
|
let t = [];
|
|
10462
10462
|
return t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join();
|
|
10463
10463
|
}
|
|
10464
|
-
function
|
|
10464
|
+
function L(e, t) {
|
|
10465
10465
|
let n = l.get(e);
|
|
10466
10466
|
if (e.isVideoTexture && _e(e), e.isRenderTargetTexture === !1 && e.isExternalTexture !== !0 && e.version > 0 && n.__version !== e.version) {
|
|
10467
10467
|
let r = e.image;
|
|
10468
10468
|
if (r === null) console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
|
|
10469
10469
|
else if (r.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
|
|
10470
10470
|
else {
|
|
10471
|
-
|
|
10471
|
+
le(n, e, t);
|
|
10472
10472
|
return;
|
|
10473
10473
|
}
|
|
10474
10474
|
} else e.isExternalTexture && (n.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
|
|
10475
10475
|
c.bindTexture(o.TEXTURE_2D, n.__webglTexture, o.TEXTURE0 + t);
|
|
10476
10476
|
}
|
|
10477
|
-
function
|
|
10477
|
+
function ne(e, t) {
|
|
10478
10478
|
let n = l.get(e);
|
|
10479
10479
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10480
|
-
|
|
10480
|
+
le(n, e, t);
|
|
10481
10481
|
return;
|
|
10482
10482
|
}
|
|
10483
10483
|
c.bindTexture(o.TEXTURE_2D_ARRAY, n.__webglTexture, o.TEXTURE0 + t);
|
|
10484
10484
|
}
|
|
10485
|
-
function
|
|
10485
|
+
function re(e, t) {
|
|
10486
10486
|
let n = l.get(e);
|
|
10487
10487
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10488
|
-
|
|
10488
|
+
le(n, e, t);
|
|
10489
10489
|
return;
|
|
10490
10490
|
}
|
|
10491
10491
|
c.bindTexture(o.TEXTURE_3D, n.__webglTexture, o.TEXTURE0 + t);
|
|
10492
10492
|
}
|
|
10493
|
-
function
|
|
10493
|
+
function R(e, t) {
|
|
10494
10494
|
let n = l.get(e);
|
|
10495
10495
|
if (e.version > 0 && n.__version !== e.version) {
|
|
10496
|
-
|
|
10496
|
+
ue(n, e, t);
|
|
10497
10497
|
return;
|
|
10498
10498
|
}
|
|
10499
10499
|
c.bindTexture(o.TEXTURE_CUBE_MAP, n.__webglTexture, o.TEXTURE0 + t);
|
|
10500
10500
|
}
|
|
10501
|
-
let
|
|
10501
|
+
let z = {
|
|
10502
10502
|
[e]: o.REPEAT,
|
|
10503
10503
|
[t]: o.CLAMP_TO_EDGE,
|
|
10504
10504
|
[n]: o.MIRRORED_REPEAT
|
|
10505
|
-
},
|
|
10505
|
+
}, B = {
|
|
10506
10506
|
[r]: o.NEAREST,
|
|
10507
10507
|
1004: o.NEAREST_MIPMAP_NEAREST,
|
|
10508
10508
|
1005: o.NEAREST_MIPMAP_LINEAR,
|
|
10509
10509
|
[i]: o.LINEAR,
|
|
10510
10510
|
1007: o.LINEAR_MIPMAP_NEAREST,
|
|
10511
10511
|
[a]: o.LINEAR_MIPMAP_LINEAR
|
|
10512
|
-
},
|
|
10512
|
+
}, ie = {
|
|
10513
10513
|
512: o.NEVER,
|
|
10514
10514
|
519: o.ALWAYS,
|
|
10515
10515
|
513: o.LESS,
|
|
@@ -10519,8 +10519,8 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10519
10519
|
516: o.GREATER,
|
|
10520
10520
|
517: o.NOTEQUAL
|
|
10521
10521
|
};
|
|
10522
|
-
function
|
|
10523
|
-
if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S,
|
|
10522
|
+
function ae(e, t) {
|
|
10523
|
+
if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S, z[t.wrapS]), o.texParameteri(e, o.TEXTURE_WRAP_T, z[t.wrapT]), (e === o.TEXTURE_3D || e === o.TEXTURE_2D_ARRAY) && o.texParameteri(e, o.TEXTURE_WRAP_R, z[t.wrapR]), o.texParameteri(e, o.TEXTURE_MAG_FILTER, B[t.magFilter]), o.texParameteri(e, o.TEXTURE_MIN_FILTER, B[t.minFilter]), t.compareFunction && (o.texParameteri(e, o.TEXTURE_COMPARE_MODE, o.COMPARE_REF_TO_TEXTURE), o.texParameteri(e, o.TEXTURE_COMPARE_FUNC, ie[t.compareFunction])), s.has("EXT_texture_filter_anisotropic") === !0) {
|
|
10524
10524
|
if (t.magFilter === 1003 || t.minFilter !== 1005 && t.minFilter !== 1008 || t.type === 1015 && s.has("OES_texture_float_linear") === !1) return;
|
|
10525
10525
|
if (t.anisotropy > 1 || l.get(t).__currentAnisotropy) {
|
|
10526
10526
|
let n = s.get("EXT_texture_filter_anisotropic");
|
|
@@ -10528,12 +10528,12 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10528
10528
|
}
|
|
10529
10529
|
}
|
|
10530
10530
|
}
|
|
10531
|
-
function
|
|
10531
|
+
function oe(e, t) {
|
|
10532
10532
|
let n = !1;
|
|
10533
10533
|
e.__webglInit === void 0 && (e.__webglInit = !0, t.addEventListener("dispose", A));
|
|
10534
10534
|
let r = t.source, i = y.get(r);
|
|
10535
10535
|
i === void 0 && (i = {}, y.set(r, i));
|
|
10536
|
-
let a =
|
|
10536
|
+
let a = te(t);
|
|
10537
10537
|
if (a !== e.__cacheKey) {
|
|
10538
10538
|
i[a] === void 0 && (i[a] = {
|
|
10539
10539
|
texture: o.createTexture(),
|
|
@@ -10544,18 +10544,18 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10544
10544
|
}
|
|
10545
10545
|
return n;
|
|
10546
10546
|
}
|
|
10547
|
-
function
|
|
10547
|
+
function se(e, t, n) {
|
|
10548
10548
|
return Math.floor(Math.floor(e / n) / t);
|
|
10549
10549
|
}
|
|
10550
|
-
function
|
|
10550
|
+
function ce(e, t, n, r) {
|
|
10551
10551
|
let i = e.updateRanges;
|
|
10552
10552
|
if (i.length === 0) c.texSubImage2D(o.TEXTURE_2D, 0, 0, 0, t.width, t.height, n, r, t.data);
|
|
10553
10553
|
else {
|
|
10554
10554
|
i.sort((e, t) => e.start - t.start);
|
|
10555
10555
|
let a = 0;
|
|
10556
10556
|
for (let e = 1; e < i.length; e++) {
|
|
10557
|
-
let n = i[a], r = i[e], o = n.start + n.count, s =
|
|
10558
|
-
r.start <= o + 1 && s === c &&
|
|
10557
|
+
let n = i[a], r = i[e], o = n.start + n.count, s = se(r.start, t.width, 4), c = se(n.start, t.width, 4);
|
|
10558
|
+
r.start <= o + 1 && s === c && se(r.start + r.count - 1, t.width, 4) === s ? n.count = Math.max(n.count, r.start + r.count - n.start) : (++a, i[a] = r);
|
|
10559
10559
|
}
|
|
10560
10560
|
i.length = a + 1;
|
|
10561
10561
|
let s = o.getParameter(o.UNPACK_ROW_LENGTH), l = o.getParameter(o.UNPACK_SKIP_PIXELS), u = o.getParameter(o.UNPACK_SKIP_ROWS);
|
|
@@ -10567,10 +10567,10 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10567
10567
|
e.clearUpdateRanges(), o.pixelStorei(o.UNPACK_ROW_LENGTH, s), o.pixelStorei(o.UNPACK_SKIP_PIXELS, l), o.pixelStorei(o.UNPACK_SKIP_ROWS, u);
|
|
10568
10568
|
}
|
|
10569
10569
|
}
|
|
10570
|
-
function
|
|
10570
|
+
function le(e, t, n) {
|
|
10571
10571
|
let r = o.TEXTURE_2D;
|
|
10572
10572
|
(t.isDataArrayTexture || t.isCompressedArrayTexture) && (r = o.TEXTURE_2D_ARRAY), t.isData3DTexture && (r = o.TEXTURE_3D);
|
|
10573
|
-
let i =
|
|
10573
|
+
let i = oe(e, t), a = t.source;
|
|
10574
10574
|
c.bindTexture(r, e.__webglTexture, o.TEXTURE0 + n);
|
|
10575
10575
|
let s = l.get(a);
|
|
10576
10576
|
if (a.version !== s.__version || i === !0) {
|
|
@@ -10580,7 +10580,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10580
10580
|
let m = C(t.image, !1, u.maxTextureSize);
|
|
10581
10581
|
m = ve(t, m);
|
|
10582
10582
|
let h = d.convert(t.format, t.colorSpace), g = d.convert(t.type), _ = D(t.internalFormat, h, g, t.colorSpace, t.isVideoTexture);
|
|
10583
|
-
|
|
10583
|
+
ae(r, t);
|
|
10584
10584
|
let v, y = t.mipmaps, b = t.isVideoTexture !== !0, x = s.__version === void 0 || i === !0, S = a.dataReady, E = k(t, m);
|
|
10585
10585
|
if (t.isDepthTexture) _ = O(t.format === f, t.type), x && (b ? c.texStorage2D(o.TEXTURE_2D, 1, _, m.width, m.height) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, null));
|
|
10586
10586
|
else if (t.isDataTexture) {
|
|
@@ -10588,7 +10588,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10588
10588
|
b && x && c.texStorage2D(o.TEXTURE_2D, E, _, y[0].width, y[0].height);
|
|
10589
10589
|
for (let e = 0, t = y.length; e < t; e++) v = y[e], b ? S && c.texSubImage2D(o.TEXTURE_2D, e, 0, 0, v.width, v.height, h, g, v.data) : c.texImage2D(o.TEXTURE_2D, e, _, v.width, v.height, 0, h, g, v.data);
|
|
10590
10590
|
t.generateMipmaps = !1;
|
|
10591
|
-
} else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S &&
|
|
10591
|
+
} else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S && ce(t, m, h, g)) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, m.data);
|
|
10592
10592
|
} else if (t.isCompressedTexture) {
|
|
10593
10593
|
if (t.isCompressedArrayTexture) {
|
|
10594
10594
|
b && x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, y[0].width, y[0].height, m.depth);
|
|
@@ -10652,9 +10652,9 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10652
10652
|
}
|
|
10653
10653
|
e.__version = t.version;
|
|
10654
10654
|
}
|
|
10655
|
-
function
|
|
10655
|
+
function ue(e, t, n) {
|
|
10656
10656
|
if (t.image.length !== 6) return;
|
|
10657
|
-
let r =
|
|
10657
|
+
let r = oe(e, t), i = t.source;
|
|
10658
10658
|
c.bindTexture(o.TEXTURE_CUBE_MAP, e.__webglTexture, o.TEXTURE0 + n);
|
|
10659
10659
|
let a = l.get(i);
|
|
10660
10660
|
if (i.version !== a.__version || r === !0) {
|
|
@@ -10664,7 +10664,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10664
10664
|
let f = t.isCompressedTexture || t.image[0].isCompressedTexture, p = t.image[0] && t.image[0].isDataTexture, m = [];
|
|
10665
10665
|
for (let e = 0; e < 6; e++) !f && !p ? m[e] = C(t.image[e], !0, u.maxCubemapSize) : m[e] = p ? t.image[e].image : t.image[e], m[e] = ve(t, m[e]);
|
|
10666
10666
|
let h = m[0], g = d.convert(t.format, t.colorSpace), _ = d.convert(t.type), v = D(t.internalFormat, g, _, t.colorSpace), y = t.isVideoTexture !== !0, b = a.__version === void 0 || r === !0, x = i.dataReady, S = k(t, h);
|
|
10667
|
-
|
|
10667
|
+
ae(o.TEXTURE_CUBE_MAP, t);
|
|
10668
10668
|
let E;
|
|
10669
10669
|
if (f) {
|
|
10670
10670
|
y && b && c.texStorage2D(o.TEXTURE_CUBE_MAP, S, v, h.width, h.height);
|
|
@@ -10724,7 +10724,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10724
10724
|
if (t && t.isWebGLCubeRenderTarget) throw Error("Depth Texture with cube render targets is not supported");
|
|
10725
10725
|
if (c.bindFramebuffer(o.FRAMEBUFFER, e), !(t.depthTexture && t.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
|
|
10726
10726
|
let n = l.get(t.depthTexture);
|
|
10727
|
-
n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0),
|
|
10727
|
+
n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0), L(t.depthTexture, 0);
|
|
10728
10728
|
let r = n.__webglTexture, i = he(t);
|
|
10729
10729
|
if (t.depthTexture.format === 1026) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0);
|
|
10730
10730
|
else if (t.depthTexture.format === 1027) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0);
|
|
@@ -10798,19 +10798,19 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10798
10798
|
}
|
|
10799
10799
|
}
|
|
10800
10800
|
if (a) {
|
|
10801
|
-
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture),
|
|
10801
|
+
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), ae(o.TEXTURE_CUBE_MAP, t);
|
|
10802
10802
|
for (let r = 0; r < 6; r++) if (t.mipmaps && t.mipmaps.length > 0) for (let i = 0; i < t.mipmaps.length; i++) de(n.__webglFramebuffer[r][i], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, i);
|
|
10803
10803
|
else de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0);
|
|
10804
10804
|
w(t) && T(o.TEXTURE_CUBE_MAP), c.unbindTexture();
|
|
10805
10805
|
} else if (s) {
|
|
10806
10806
|
for (let t = 0, r = i.length; t < r; t++) {
|
|
10807
10807
|
let r = i[t], a = l.get(r), s = o.TEXTURE_2D;
|
|
10808
|
-
(e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture),
|
|
10808
|
+
(e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture), ae(s, r), de(n.__webglFramebuffer, e, r, o.COLOR_ATTACHMENT0 + t, s, 0), w(r) && T(s);
|
|
10809
10809
|
}
|
|
10810
10810
|
c.unbindTexture();
|
|
10811
10811
|
} else {
|
|
10812
10812
|
let i = o.TEXTURE_2D;
|
|
10813
|
-
if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture),
|
|
10813
|
+
if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture), ae(i, t), t.mipmaps && t.mipmaps.length > 0) for (let r = 0; r < t.mipmaps.length; r++) de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, i, r);
|
|
10814
10814
|
else de(n.__webglFramebuffer, e, t, o.COLOR_ATTACHMENT0, i, 0);
|
|
10815
10815
|
w(t) && T(i), c.unbindTexture();
|
|
10816
10816
|
}
|
|
@@ -10873,7 +10873,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10873
10873
|
function ye(e) {
|
|
10874
10874
|
return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (g.width = e.naturalWidth || e.width, g.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (g.width = e.displayWidth, g.height = e.displayHeight) : (g.width = e.width, g.height = e.height), g;
|
|
10875
10875
|
}
|
|
10876
|
-
this.allocateTextureUnit =
|
|
10876
|
+
this.allocateTextureUnit = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube = R, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
|
|
10877
10877
|
}
|
|
10878
10878
|
function Uc(e, t) {
|
|
10879
10879
|
function n(n, r = "") {
|
|
@@ -11004,7 +11004,7 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11004
11004
|
A.viewport = new Ae();
|
|
11005
11005
|
let j = new Kn();
|
|
11006
11006
|
j.viewport = new Ae();
|
|
11007
|
-
let M = [A, j], N = new Aa(),
|
|
11007
|
+
let M = [A, j], N = new Aa(), P = null, F = null;
|
|
11008
11008
|
this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
|
|
11009
11009
|
let t = T[e];
|
|
11010
11010
|
return t === void 0 && (t = new er(), T[e] = t), t.getTargetRaySpace();
|
|
@@ -11015,7 +11015,7 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11015
11015
|
let t = T[e];
|
|
11016
11016
|
return t === void 0 && (t = new er(), T[e] = t), t.getHandSpace();
|
|
11017
11017
|
};
|
|
11018
|
-
function
|
|
11018
|
+
function I(e) {
|
|
11019
11019
|
let t = E.indexOf(e.inputSource);
|
|
11020
11020
|
if (t === -1) return;
|
|
11021
11021
|
let n = T[t];
|
|
@@ -11024,15 +11024,15 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11024
11024
|
data: e.inputSource
|
|
11025
11025
|
}));
|
|
11026
11026
|
}
|
|
11027
|
-
function
|
|
11028
|
-
r.removeEventListener("select",
|
|
11027
|
+
function ee() {
|
|
11028
|
+
r.removeEventListener("select", I), r.removeEventListener("selectstart", I), r.removeEventListener("selectend", I), r.removeEventListener("squeeze", I), r.removeEventListener("squeezestart", I), r.removeEventListener("squeezeend", I), r.removeEventListener("end", ee), r.removeEventListener("inputsourceschange", te);
|
|
11029
11029
|
for (let e = 0; e < T.length; e++) {
|
|
11030
11030
|
let t = E[e];
|
|
11031
11031
|
t !== null && (E[e] = null, T[e].disconnect(t));
|
|
11032
11032
|
}
|
|
11033
|
-
|
|
11033
|
+
P = null, F = null, b.reset();
|
|
11034
11034
|
for (let e in x) delete x[e];
|
|
11035
|
-
e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null,
|
|
11035
|
+
e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null, ae.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
|
|
11036
11036
|
}
|
|
11037
11037
|
this.setFramebufferScaleFactor = function(e) {
|
|
11038
11038
|
i = e, n.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");
|
|
@@ -11052,7 +11052,7 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11052
11052
|
return r;
|
|
11053
11053
|
}, this.setSession = async function(m) {
|
|
11054
11054
|
if (r = m, r !== null) {
|
|
11055
|
-
if (C = e.getRenderTarget(), r.addEventListener("select",
|
|
11055
|
+
if (C = e.getRenderTarget(), r.addEventListener("select", I), r.addEventListener("selectstart", I), r.addEventListener("selectend", I), r.addEventListener("squeeze", I), r.addEventListener("squeezestart", I), r.addEventListener("squeezeend", I), r.addEventListener("end", ee), r.addEventListener("inputsourceschange", te), S.xrCompatible !== !0 && await t.makeXRCompatible(), O = e.getPixelRatio(), e.getSize(D), y && "createProjectionLayer" in XRWebGLBinding.prototype) {
|
|
11056
11056
|
let n = null, a = null, c = null;
|
|
11057
11057
|
S.depth && (c = S.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = S.stencil ? f : d, a = S.stencil ? 1020 : s);
|
|
11058
11058
|
let l = {
|
|
@@ -11087,14 +11087,14 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11087
11087
|
resolveStencilBuffer: _.ignoreDepthValues === !1
|
|
11088
11088
|
});
|
|
11089
11089
|
}
|
|
11090
|
-
w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c),
|
|
11090
|
+
w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c), ae.setContext(r), ae.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
|
|
11091
11091
|
}
|
|
11092
11092
|
}, this.getEnvironmentBlendMode = function() {
|
|
11093
11093
|
if (r !== null) return r.environmentBlendMode;
|
|
11094
11094
|
}, this.getDepthTexture = function() {
|
|
11095
11095
|
return b.getDepthTexture();
|
|
11096
11096
|
};
|
|
11097
|
-
function
|
|
11097
|
+
function te(e) {
|
|
11098
11098
|
for (let t = 0; t < e.removed.length; t++) {
|
|
11099
11099
|
let n = e.removed[t], r = E.indexOf(n);
|
|
11100
11100
|
r >= 0 && (E[r] = null, T[r].disconnect(n));
|
|
@@ -11115,32 +11115,32 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11115
11115
|
i && i.connect(n);
|
|
11116
11116
|
}
|
|
11117
11117
|
}
|
|
11118
|
-
let
|
|
11119
|
-
function
|
|
11120
|
-
|
|
11121
|
-
let r =
|
|
11118
|
+
let L = new U(), ne = new U();
|
|
11119
|
+
function re(e, t, n) {
|
|
11120
|
+
L.setFromMatrixPosition(t.matrixWorld), ne.setFromMatrixPosition(n.matrixWorld);
|
|
11121
|
+
let r = L.distanceTo(ne), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
|
|
11122
11122
|
if (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(h), e.translateZ(m), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), i[10] === -1) e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse);
|
|
11123
11123
|
else {
|
|
11124
11124
|
let t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;
|
|
11125
11125
|
e.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
|
|
11126
11126
|
}
|
|
11127
11127
|
}
|
|
11128
|
-
function
|
|
11128
|
+
function R(e, t) {
|
|
11129
11129
|
t === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();
|
|
11130
11130
|
}
|
|
11131
11131
|
this.updateCamera = function(e) {
|
|
11132
11132
|
if (r === null) return;
|
|
11133
11133
|
let t = e.near, n = e.far;
|
|
11134
|
-
b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (
|
|
11134
|
+
b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (P !== N.near || F !== N.far) && (r.updateRenderState({
|
|
11135
11135
|
depthNear: N.near,
|
|
11136
11136
|
depthFar: N.far
|
|
11137
|
-
}),
|
|
11137
|
+
}), P = N.near, F = N.far), N.layers.mask = e.layers.mask | 6, A.layers.mask = N.layers.mask & 3, j.layers.mask = N.layers.mask & 5;
|
|
11138
11138
|
let i = e.parent, a = N.cameras;
|
|
11139
|
-
|
|
11140
|
-
for (let e = 0; e < a.length; e++)
|
|
11141
|
-
a.length === 2 ?
|
|
11139
|
+
R(N, i);
|
|
11140
|
+
for (let e = 0; e < a.length; e++) R(a[e], i);
|
|
11141
|
+
a.length === 2 ? re(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), z(e, N, i);
|
|
11142
11142
|
};
|
|
11143
|
-
function
|
|
11143
|
+
function z(e, t, n) {
|
|
11144
11144
|
n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = k * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
|
|
11145
11145
|
}
|
|
11146
11146
|
this.getCamera = function() {
|
|
@@ -11156,8 +11156,8 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11156
11156
|
}, this.getCameraTexture = function(e) {
|
|
11157
11157
|
return x[e];
|
|
11158
11158
|
};
|
|
11159
|
-
let
|
|
11160
|
-
function
|
|
11159
|
+
let B = null;
|
|
11160
|
+
function ie(t, i) {
|
|
11161
11161
|
if (m = i.getViewerPose(p || a), v = i, m !== null) {
|
|
11162
11162
|
let t = m.views;
|
|
11163
11163
|
_ !== null && (e.setRenderTargetFramebuffer(w, _.framebuffer), e.setRenderTarget(w));
|
|
@@ -11196,14 +11196,14 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11196
11196
|
let t = E[e], n = T[e];
|
|
11197
11197
|
t !== null && n !== void 0 && n.update(t, i, p || a);
|
|
11198
11198
|
}
|
|
11199
|
-
|
|
11199
|
+
B && B(t, i), i.detectedPlanes && n.dispatchEvent({
|
|
11200
11200
|
type: "planesdetected",
|
|
11201
11201
|
data: i
|
|
11202
11202
|
}), v = null;
|
|
11203
11203
|
}
|
|
11204
|
-
let
|
|
11205
|
-
|
|
11206
|
-
|
|
11204
|
+
let ae = new Xa();
|
|
11205
|
+
ae.setAnimationLoop(ie), this.setAnimationLoop = function(e) {
|
|
11206
|
+
B = e;
|
|
11207
11207
|
}, this.dispose = function() {};
|
|
11208
11208
|
}
|
|
11209
11209
|
}, Jc = /*@__PURE__*/ new vt(), Yc = /*@__PURE__*/ new ct();
|
|
@@ -11366,7 +11366,7 @@ var Qc = class {
|
|
|
11366
11366
|
}, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
|
|
11367
11367
|
let T = this, E = !1;
|
|
11368
11368
|
this._outputColorSpace = y;
|
|
11369
|
-
let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(),
|
|
11369
|
+
let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(), P = null, F = new X(0), I = 0, ee = t.width, te = t.height, L = 1, ne = null, re = null, R = new Ae(0, 0, ee, te), z = new Ae(0, 0, ee, te), B = !1, ie = new lr(), ae = !1, oe = !1, se = new ct(), ce = new U(), le = new Ae(), ue = {
|
|
11370
11370
|
background: null,
|
|
11371
11371
|
fog: null,
|
|
11372
11372
|
environment: null,
|
|
@@ -11374,7 +11374,7 @@ var Qc = class {
|
|
|
11374
11374
|
isScene: !0
|
|
11375
11375
|
}, de = !1;
|
|
11376
11376
|
function V() {
|
|
11377
|
-
return k === null ?
|
|
11377
|
+
return k === null ? L : 1;
|
|
11378
11378
|
}
|
|
11379
11379
|
let H = n;
|
|
11380
11380
|
function fe(e, n) {
|
|
@@ -11415,39 +11415,39 @@ var Qc = class {
|
|
|
11415
11415
|
let e = W.get("WEBGL_lose_context");
|
|
11416
11416
|
e && e.restoreContext();
|
|
11417
11417
|
}, this.getPixelRatio = function() {
|
|
11418
|
-
return
|
|
11418
|
+
return L;
|
|
11419
11419
|
}, this.setPixelRatio = function(e) {
|
|
11420
|
-
e !== void 0 && (
|
|
11420
|
+
e !== void 0 && (L = e, this.setSize(ee, te, !1));
|
|
11421
11421
|
}, this.getSize = function(e) {
|
|
11422
|
-
return e.set(
|
|
11422
|
+
return e.set(ee, te);
|
|
11423
11423
|
}, this.setSize = function(e, n, r = !0) {
|
|
11424
11424
|
if (Re.isPresenting) {
|
|
11425
11425
|
console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");
|
|
11426
11426
|
return;
|
|
11427
11427
|
}
|
|
11428
|
-
|
|
11428
|
+
ee = e, te = n, t.width = Math.floor(e * L), t.height = Math.floor(n * L), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), this.setViewport(0, 0, e, n);
|
|
11429
11429
|
}, this.getDrawingBufferSize = function(e) {
|
|
11430
|
-
return e.set(
|
|
11430
|
+
return e.set(ee * L, te * L).floor();
|
|
11431
11431
|
}, this.setDrawingBufferSize = function(e, n, r) {
|
|
11432
|
-
|
|
11432
|
+
ee = e, te = n, L = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
|
|
11433
11433
|
}, this.getCurrentViewport = function(e) {
|
|
11434
11434
|
return e.copy(M);
|
|
11435
11435
|
}, this.getViewport = function(e) {
|
|
11436
|
-
return e.copy(
|
|
11436
|
+
return e.copy(R);
|
|
11437
11437
|
}, this.setViewport = function(e, t, n, r) {
|
|
11438
|
-
e.isVector4 ?
|
|
11438
|
+
e.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), K.viewport(M.copy(R).multiplyScalar(L).round());
|
|
11439
11439
|
}, this.getScissor = function(e) {
|
|
11440
|
-
return e.copy(
|
|
11440
|
+
return e.copy(z);
|
|
11441
11441
|
}, this.setScissor = function(e, t, n, r) {
|
|
11442
|
-
e.isVector4 ?
|
|
11442
|
+
e.isVector4 ? z.set(e.x, e.y, e.z, e.w) : z.set(e, t, n, r), K.scissor(N.copy(z).multiplyScalar(L).round());
|
|
11443
11443
|
}, this.getScissorTest = function() {
|
|
11444
|
-
return
|
|
11444
|
+
return B;
|
|
11445
11445
|
}, this.setScissorTest = function(e) {
|
|
11446
|
-
K.setScissorTest(
|
|
11446
|
+
K.setScissorTest(B = e);
|
|
11447
11447
|
}, this.setOpaqueSort = function(e) {
|
|
11448
|
-
|
|
11448
|
+
ne = e;
|
|
11449
11449
|
}, this.setTransparentSort = function(e) {
|
|
11450
|
-
|
|
11450
|
+
re = e;
|
|
11451
11451
|
}, this.getClearColor = function(e) {
|
|
11452
11452
|
return e.copy(Oe.getClearColor());
|
|
11453
11453
|
}, this.setClearColor = function() {
|
|
@@ -11504,7 +11504,7 @@ var Qc = class {
|
|
|
11504
11504
|
}), e.isShaderMaterial && Se.releaseShaderCache(e));
|
|
11505
11505
|
}
|
|
11506
11506
|
this.renderBufferDirect = function(e, t, n, r, i, a) {
|
|
11507
|
-
t === null && (t =
|
|
11507
|
+
t === null && (t = ue);
|
|
11508
11508
|
let o = i.isMesh && i.matrixWorld.determinant() < 0, s = at(e, t, n, r, i);
|
|
11509
11509
|
K.setMaterial(r, o);
|
|
11510
11510
|
let c = n.index, l = 1;
|
|
@@ -11591,13 +11591,13 @@ var Qc = class {
|
|
|
11591
11591
|
return;
|
|
11592
11592
|
}
|
|
11593
11593
|
if (E === !0) return;
|
|
11594
|
-
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x),
|
|
11594
|
+
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x), se.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), ie.setFromProjectionMatrix(se, w, t.reversedDepth), oe = this.localClippingEnabled, ae = Ee.init(this.clippingPlanes, oe), v = we.get(e, S.length), v.init(), S.push(v), Re.enabled === !0 && Re.isPresenting === !0) {
|
|
11595
11595
|
let e = T.xr.getDepthSensingMesh();
|
|
11596
11596
|
e !== null && Ze(e, t, -Infinity, T.sortObjects);
|
|
11597
11597
|
}
|
|
11598
|
-
Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(
|
|
11598
|
+
Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(ne, re), de = Re.enabled === !1 || Re.isPresenting === !1 || Re.hasDepthSensing() === !1, de && Oe.addToRenderList(v, e), this.info.render.frame++, ae === !0 && Ee.beginShadows();
|
|
11599
11599
|
let n = x.state.shadowsArray;
|
|
11600
|
-
De.render(n, e, t),
|
|
11600
|
+
De.render(n, e, t), ae === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
|
|
11601
11601
|
let r = v.opaque, i = v.transmissive;
|
|
11602
11602
|
if (x.setupLights(), t.isArrayCamera) {
|
|
11603
11603
|
let n = t.cameras;
|
|
@@ -11611,7 +11611,7 @@ var Qc = class {
|
|
|
11611
11611
|
Qe(v, e, r, r.viewport);
|
|
11612
11612
|
}
|
|
11613
11613
|
} else i.length > 0 && $e(r, i, e, t), de && Oe.render(e), Qe(v, e, t);
|
|
11614
|
-
k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1],
|
|
11614
|
+
k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], ae === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
|
|
11615
11615
|
};
|
|
11616
11616
|
function Ze(e, t, n, r) {
|
|
11617
11617
|
if (e.visible === !1) return;
|
|
@@ -11620,20 +11620,20 @@ var Qc = class {
|
|
|
11620
11620
|
else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
|
|
11621
11621
|
else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
|
|
11622
11622
|
else if (e.isSprite) {
|
|
11623
|
-
if (!e.frustumCulled ||
|
|
11624
|
-
r &&
|
|
11623
|
+
if (!e.frustumCulled || ie.intersectsSprite(e)) {
|
|
11624
|
+
r && le.setFromMatrixPosition(e.matrixWorld).applyMatrix4(se);
|
|
11625
11625
|
let t = xe.update(e), i = e.material;
|
|
11626
|
-
i.visible && v.push(e, t, i, n,
|
|
11626
|
+
i.visible && v.push(e, t, i, n, le.z, null);
|
|
11627
11627
|
}
|
|
11628
|
-
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled ||
|
|
11628
|
+
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || ie.intersectsObject(e))) {
|
|
11629
11629
|
let t = xe.update(e), i = e.material;
|
|
11630
|
-
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(),
|
|
11630
|
+
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), le.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), le.copy(e.boundingSphere.center)), le.applyMatrix4(e.matrixWorld).applyMatrix4(se)), Array.isArray(i)) {
|
|
11631
11631
|
let r = t.groups;
|
|
11632
11632
|
for (let a = 0, o = r.length; a < o; a++) {
|
|
11633
11633
|
let o = r[a], s = i[o.materialIndex];
|
|
11634
|
-
s && s.visible && v.push(e, t, s, n,
|
|
11634
|
+
s && s.visible && v.push(e, t, s, n, le.z, o);
|
|
11635
11635
|
}
|
|
11636
|
-
} else i.visible && v.push(e, t, i, n,
|
|
11636
|
+
} else i.visible && v.push(e, t, i, n, le.z, null);
|
|
11637
11637
|
}
|
|
11638
11638
|
}
|
|
11639
11639
|
let i = e.children;
|
|
@@ -11641,7 +11641,7 @@ var Qc = class {
|
|
|
11641
11641
|
}
|
|
11642
11642
|
function Qe(e, t, n, r) {
|
|
11643
11643
|
let i = e.opaque, a = e.transmissive, o = e.transparent;
|
|
11644
|
-
x.setupLightsView(n),
|
|
11644
|
+
x.setupLightsView(n), ae === !0 && Ee.setGlobalState(T.clippingPlanes, n), r && K.viewport(M.copy(r)), i.length > 0 && et(i, t, n), a.length > 0 && et(a, t, n), o.length > 0 && et(o, t, n), K.buffers.depth.setTest(!0), K.buffers.depth.setMask(!0), K.buffers.color.setMask(!0), K.setPolygonOffset(!1);
|
|
11645
11645
|
}
|
|
11646
11646
|
function $e(e, t, n, r) {
|
|
11647
11647
|
if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
|
|
@@ -11658,11 +11658,11 @@ var Qc = class {
|
|
|
11658
11658
|
let s = x.state.transmissionRenderTarget[r.id], c = r.viewport || M;
|
|
11659
11659
|
s.setSize(c.z * T.transmissionResolutionScale, c.w * T.transmissionResolutionScale);
|
|
11660
11660
|
let u = T.getRenderTarget(), d = T.getActiveCubeFace(), f = T.getActiveMipmapLevel();
|
|
11661
|
-
T.setRenderTarget(s), T.getClearColor(
|
|
11661
|
+
T.setRenderTarget(s), T.getClearColor(F), I = T.getClearAlpha(), I < 1 && T.setClearColor(16777215, .5), T.clear(), de && Oe.render(n);
|
|
11662
11662
|
let p = T.toneMapping;
|
|
11663
11663
|
T.toneMapping = 0;
|
|
11664
11664
|
let m = r.viewport;
|
|
11665
|
-
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r),
|
|
11665
|
+
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), ae === !0 && Ee.setGlobalState(T.clippingPlanes, r), et(e, n, r), J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s), W.has("WEBGL_multisampled_render_to_texture") === !1) {
|
|
11666
11666
|
let e = !1;
|
|
11667
11667
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
11668
11668
|
let a = t[i], o = a.object, s = a.geometry, c = a.material, l = a.group;
|
|
@@ -11673,7 +11673,7 @@ var Qc = class {
|
|
|
11673
11673
|
}
|
|
11674
11674
|
e === !0 && (J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s));
|
|
11675
11675
|
}
|
|
11676
|
-
T.setRenderTarget(u, d, f), T.setClearColor(
|
|
11676
|
+
T.setRenderTarget(u, d, f), T.setClearColor(F, I), m !== void 0 && (r.viewport = m), T.toneMapping = p;
|
|
11677
11677
|
}
|
|
11678
11678
|
function et(e, t, n) {
|
|
11679
11679
|
let r = t.isScene === !0 ? t.overrideMaterial : null;
|
|
@@ -11686,7 +11686,7 @@ var Qc = class {
|
|
|
11686
11686
|
e.onBeforeRender(T, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(T, t, n, r, e, a), i.transparent === !0 && i.side === 2 && i.forceSinglePass === !1 ? (i.side = 1, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 0, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 2) : T.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(T, t, n, r, i, a);
|
|
11687
11687
|
}
|
|
11688
11688
|
function nt(e, t, n) {
|
|
11689
|
-
t.isScene !== !0 && (t =
|
|
11689
|
+
t.isScene !== !0 && (t = ue);
|
|
11690
11690
|
let r = q.get(e), i = x.state.lights, a = x.state.shadowsArray, o = i.state.version, s = Se.getParameters(e, i.state, a, t, n), c = Se.getProgramCacheKey(s), l = r.programs;
|
|
11691
11691
|
r.environment = e.isMeshStandardMaterial ? t.environment : null, r.fog = t.fog, r.envMap = (e.isMeshStandardMaterial ? ve : _e).get(e.envMap || r.environment), r.envMapRotation = r.environment !== null && e.envMap === null ? t.environmentRotation : e.envMapRotation, l === void 0 && (e.addEventListener("dispose", He), l = /* @__PURE__ */ new Map(), r.programs = l);
|
|
11692
11692
|
let u = l.get(c);
|
|
@@ -11708,11 +11708,11 @@ var Qc = class {
|
|
|
11708
11708
|
n.outputColorSpace = t.outputColorSpace, n.batching = t.batching, n.batchingColor = t.batchingColor, n.instancing = t.instancing, n.instancingColor = t.instancingColor, n.instancingMorph = t.instancingMorph, n.skinning = t.skinning, n.morphTargets = t.morphTargets, n.morphNormals = t.morphNormals, n.morphColors = t.morphColors, n.morphTargetsCount = t.morphTargetsCount, n.numClippingPlanes = t.numClippingPlanes, n.numIntersection = t.numClipIntersection, n.vertexAlphas = t.vertexAlphas, n.vertexTangents = t.vertexTangents, n.toneMapping = t.toneMapping;
|
|
11709
11709
|
}
|
|
11710
11710
|
function at(e, t, n, r, i) {
|
|
11711
|
-
t.isScene !== !0 && (t =
|
|
11711
|
+
t.isScene !== !0 && (t = ue), J.resetTextureUnits();
|
|
11712
11712
|
let a = t.fog, o = r.isMeshStandardMaterial ? t.environment : null, s = k === null ? T.outputColorSpace : k.isXRRenderTarget === !0 ? k.texture.colorSpace : b, c = (r.isMeshStandardMaterial ? ve : _e).get(r.envMap || o), l = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, u = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), d = !!n.morphAttributes.position, f = !!n.morphAttributes.normal, p = !!n.morphAttributes.color, m = 0;
|
|
11713
11713
|
r.toneMapped && (k === null || k.isXRRenderTarget === !0) && (m = T.toneMapping);
|
|
11714
11714
|
let h = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, g = h === void 0 ? 0 : h.length, _ = q.get(r), v = x.state.lights;
|
|
11715
|
-
if (
|
|
11715
|
+
if (ae === !0 && (oe === !0 || e !== j)) {
|
|
11716
11716
|
let t = e === j && r.id === A;
|
|
11717
11717
|
Ee.setState(r, e, t);
|
|
11718
11718
|
}
|
|
@@ -11724,7 +11724,7 @@ var Qc = class {
|
|
|
11724
11724
|
if (K.useProgram(S.program) && (C = !0, w = !0, E = !0), r.id !== A && (A = r.id, w = !0), C || j !== e) {
|
|
11725
11725
|
K.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), D.setValue(H, "projectionMatrix", e.projectionMatrix), D.setValue(H, "viewMatrix", e.matrixWorldInverse);
|
|
11726
11726
|
let t = D.map.cameraPosition;
|
|
11727
|
-
t !== void 0 && t.setValue(H,
|
|
11727
|
+
t !== void 0 && t.setValue(H, ce.setFromMatrixPosition(e.matrixWorld)), G.logarithmicDepthBuffer && D.setValue(H, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && D.setValue(H, "isOrthographic", e.isOrthographicCamera === !0), j !== e && (j = e, w = !0, E = !0);
|
|
11728
11728
|
}
|
|
11729
11729
|
if (i.isSkinnedMesh) {
|
|
11730
11730
|
D.setOptional(H, i, "bindMatrix"), D.setOptional(H, i, "bindMatrixInverse");
|
|
@@ -11733,7 +11733,7 @@ var Qc = class {
|
|
|
11733
11733
|
}
|
|
11734
11734
|
i.isBatchedMesh && (D.setOptional(H, i, "batchingTexture"), D.setValue(H, "batchingTexture", i._matricesTexture, J), D.setOptional(H, i, "batchingIdTexture"), D.setValue(H, "batchingIdTexture", i._indirectTexture, J), D.setOptional(H, i, "batchingColorTexture"), i._colorsTexture !== null && D.setValue(H, "batchingColorTexture", i._colorsTexture, J));
|
|
11735
11735
|
let M = n.morphAttributes;
|
|
11736
|
-
if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r,
|
|
11736
|
+
if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r, L, te, x.state.transmissionRenderTarget[e.id]), Us.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Us.upload(H, rt(_), O, J), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && D.setValue(H, "center", i.center), D.setValue(H, "modelViewMatrix", i.modelViewMatrix), D.setValue(H, "normalMatrix", i.normalMatrix), D.setValue(H, "modelMatrix", i.matrixWorld), r.isShaderMaterial || r.isRawShaderMaterial) {
|
|
11737
11737
|
let e = r.uniformsGroups;
|
|
11738
11738
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
11739
11739
|
let n = e[t];
|
|
@@ -11780,9 +11780,9 @@ var Qc = class {
|
|
|
11780
11780
|
let c = e.texture;
|
|
11781
11781
|
(c.isData3DTexture || c.isDataArrayTexture || c.isCompressedArrayTexture) && (o = !0);
|
|
11782
11782
|
let l = q.get(e).__webglFramebuffer;
|
|
11783
|
-
e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor),
|
|
11784
|
-
} else M.copy(
|
|
11785
|
-
if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(
|
|
11783
|
+
e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor), P = e.scissorTest;
|
|
11784
|
+
} else M.copy(R).multiplyScalar(L).floor(), N.copy(z).multiplyScalar(L).floor(), P = B;
|
|
11785
|
+
if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(P), a) {
|
|
11786
11786
|
let r = q.get(e.texture);
|
|
11787
11787
|
H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
|
|
11788
11788
|
} else if (o) {
|
|
@@ -11890,7 +11890,7 @@ var Qc = class {
|
|
|
11890
11890
|
}
|
|
11891
11891
|
}, $c = {
|
|
11892
11892
|
name: "@liquidcars/atlas",
|
|
11893
|
-
version: "0.1.
|
|
11893
|
+
version: "0.1.44",
|
|
11894
11894
|
description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
|
|
11895
11895
|
type: "module",
|
|
11896
11896
|
scripts: {
|
|
@@ -11933,34 +11933,34 @@ var Qc = class {
|
|
|
11933
11933
|
"callers",
|
|
11934
11934
|
"called",
|
|
11935
11935
|
"none"
|
|
11936
|
-
]), rl = .05, il =
|
|
11937
|
-
function cl(e) {
|
|
11938
|
-
return Array.isArray(e) ? e.map(cl) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, cl(t)]));
|
|
11939
|
-
}
|
|
11936
|
+
]), rl = .05, il = 6, al = 15, ol = /* @__PURE__ */ new Map(), sl = /* @__PURE__ */ new Map(), cl = /* @__PURE__ */ new Map();
|
|
11940
11937
|
function ll(e) {
|
|
11941
|
-
return
|
|
11938
|
+
return Array.isArray(e) ? e.map(ll) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, ll(t)]));
|
|
11939
|
+
}
|
|
11940
|
+
function ul(e) {
|
|
11941
|
+
return (e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { name: e } : ll(e)).filter((e) => e && String(e.name || "").trim()).map((e) => ({
|
|
11942
11942
|
...e,
|
|
11943
11943
|
name: String(e.name).trim()
|
|
11944
11944
|
}));
|
|
11945
11945
|
}
|
|
11946
|
-
function
|
|
11946
|
+
function dl(e) {
|
|
11947
11947
|
return [...new Set((e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => String(e || "").trim()).filter(Boolean))];
|
|
11948
11948
|
}
|
|
11949
|
-
function
|
|
11950
|
-
return e ? typeof e == "string" ? { spdx: e } :
|
|
11949
|
+
function fl(e) {
|
|
11950
|
+
return e ? typeof e == "string" ? { spdx: e } : ll(e) : null;
|
|
11951
11951
|
}
|
|
11952
|
-
function
|
|
11953
|
-
let n =
|
|
11952
|
+
function pl(e, t) {
|
|
11953
|
+
let n = ll(e || {}), r = String(n.id || `source-${t + 1}`).trim();
|
|
11954
11954
|
if (!r) throw TypeError("Geometry pack sources require an id.");
|
|
11955
11955
|
return {
|
|
11956
11956
|
...n,
|
|
11957
11957
|
id: r,
|
|
11958
|
-
authors:
|
|
11959
|
-
license:
|
|
11958
|
+
authors: ul(n.authors ?? n.author),
|
|
11959
|
+
license: fl(n.license)
|
|
11960
11960
|
};
|
|
11961
11961
|
}
|
|
11962
|
-
function
|
|
11963
|
-
let r =
|
|
11962
|
+
function ml(e, t, n) {
|
|
11963
|
+
let r = ll(e || {}), i = String(r.id || "").trim();
|
|
11964
11964
|
if (!i) throw TypeError(`Geometry pack resource at index ${t} requires an id.`);
|
|
11965
11965
|
let a = r.source == null ? null : String(r.source).trim();
|
|
11966
11966
|
if (a && !n.has(a)) throw TypeError(`Geometry pack resource '${i}' references unknown source '${a}'.`);
|
|
@@ -11969,13 +11969,13 @@ function pl(e, t, n) {
|
|
|
11969
11969
|
id: i,
|
|
11970
11970
|
kind: String(r.kind || r.type || "asset"),
|
|
11971
11971
|
source: a,
|
|
11972
|
-
authors:
|
|
11973
|
-
license:
|
|
11972
|
+
authors: ul(r.authors ?? r.author),
|
|
11973
|
+
license: fl(r.license)
|
|
11974
11974
|
};
|
|
11975
11975
|
}
|
|
11976
|
-
function
|
|
11976
|
+
function hl(e, t) {
|
|
11977
11977
|
if (!e.showcase || typeof e.showcase != "object") return null;
|
|
11978
|
-
let n =
|
|
11978
|
+
let n = ll(e.showcase), r = Array.isArray(n.groups) ? n.groups : [], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = r.map((e, n) => {
|
|
11979
11979
|
let r = e && typeof e == "object" ? e : {}, o = String(r.id || `group-${n + 1}`).trim();
|
|
11980
11980
|
if (!o || i.has(o)) throw TypeError(`Geometry pack '${t}' showcase contains a duplicate or empty group id.`);
|
|
11981
11981
|
i.add(o);
|
|
@@ -11993,8 +11993,8 @@ function ml(e, t) {
|
|
|
11993
11993
|
...r,
|
|
11994
11994
|
id: s,
|
|
11995
11995
|
geometry: i.includes(".") ? i : `${t}.${i}`,
|
|
11996
|
-
geometryOptions:
|
|
11997
|
-
geometryPalette:
|
|
11996
|
+
geometryOptions: ll(r.geometryOptions || r.options || r.parameters || {}),
|
|
11997
|
+
geometryPalette: ll(r.geometryPalette || r.palette || {})
|
|
11998
11998
|
};
|
|
11999
11999
|
})
|
|
12000
12000
|
};
|
|
@@ -12004,11 +12004,11 @@ function ml(e, t) {
|
|
|
12004
12004
|
title: String(n.title || e.name || t),
|
|
12005
12005
|
description: String(n.description || ""),
|
|
12006
12006
|
groups: o,
|
|
12007
|
-
relations:
|
|
12007
|
+
relations: ll(Array.isArray(n.relations) ? n.relations : [])
|
|
12008
12008
|
};
|
|
12009
12009
|
}
|
|
12010
|
-
function
|
|
12011
|
-
let n = (Array.isArray(e.sources) ? e.sources : []).map(
|
|
12010
|
+
function gl(e, t) {
|
|
12011
|
+
let n = (Array.isArray(e.sources) ? e.sources : []).map(pl), r = new Set(n.map((e) => e.id)), i = (Array.isArray(e.resources) ? e.resources : []).map((e, t) => ml(e, t, r));
|
|
12012
12012
|
if (new Set(i.map((e) => e.id)).size !== i.length) throw TypeError(`Geometry pack '${t}' contains duplicate resource ids.`);
|
|
12013
12013
|
return {
|
|
12014
12014
|
namespace: t,
|
|
@@ -12017,36 +12017,36 @@ function hl(e, t) {
|
|
|
12017
12017
|
description: String(e.description || ""),
|
|
12018
12018
|
category: String(e.category || e.name || t),
|
|
12019
12019
|
homepage: e.homepage ? String(e.homepage) : "",
|
|
12020
|
-
repository:
|
|
12021
|
-
authors:
|
|
12022
|
-
license:
|
|
12020
|
+
repository: ll(e.repository || null),
|
|
12021
|
+
authors: ul(e.authors ?? e.author),
|
|
12022
|
+
license: fl(e.license),
|
|
12023
12023
|
attribution: String(e.attribution || ""),
|
|
12024
|
-
collections:
|
|
12025
|
-
showcase:
|
|
12024
|
+
collections: ll(Array.isArray(e.collections) ? e.collections : []),
|
|
12025
|
+
showcase: hl(e, t),
|
|
12026
12026
|
sources: n,
|
|
12027
12027
|
resources: i,
|
|
12028
12028
|
geometries: []
|
|
12029
12029
|
};
|
|
12030
12030
|
}
|
|
12031
|
-
function
|
|
12031
|
+
function _l(e) {
|
|
12032
12032
|
let { create: t, resourceMap: n, ...r } = e;
|
|
12033
12033
|
return {
|
|
12034
|
-
...
|
|
12034
|
+
...ll(r),
|
|
12035
12035
|
canonicalSize: [...e.canonicalSize],
|
|
12036
|
-
parameters:
|
|
12037
|
-
palette:
|
|
12038
|
-
anchors:
|
|
12036
|
+
parameters: ll(e.parameters),
|
|
12037
|
+
palette: ll(e.palette),
|
|
12038
|
+
anchors: ll(e.anchors)
|
|
12039
12039
|
};
|
|
12040
12040
|
}
|
|
12041
|
-
function _l(e) {
|
|
12042
|
-
return cl(e);
|
|
12043
|
-
}
|
|
12044
12041
|
function vl(e) {
|
|
12042
|
+
return ll(e);
|
|
12043
|
+
}
|
|
12044
|
+
function yl(e) {
|
|
12045
12045
|
if (!e || typeof e != "object") throw TypeError("A geometry pack must be an object.");
|
|
12046
12046
|
let t = String(e.namespace || "").trim();
|
|
12047
12047
|
if (!/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/i.test(t)) throw TypeError("A geometry pack requires a valid dot-separated namespace.");
|
|
12048
12048
|
if (!Array.isArray(e.geometries) || !e.geometries.length) throw TypeError("A geometry pack requires at least one geometry.");
|
|
12049
|
-
let n =
|
|
12049
|
+
let n = gl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(ll(e))]))), i = [];
|
|
12050
12050
|
for (let a of e.geometries) {
|
|
12051
12051
|
if (!a || typeof a != "object" || !a.id) throw TypeError(`Geometry pack '${t}' contains an invalid geometry.`);
|
|
12052
12052
|
let o = String(a.id).includes(".") ? String(a.id).split(".").pop() : String(a.id), s = String(a.id).includes(".") ? String(a.id) : `${t}.${o}`;
|
|
@@ -12059,8 +12059,8 @@ function vl(e) {
|
|
|
12059
12059
|
packVersion: n.version,
|
|
12060
12060
|
category: a.category || n.category,
|
|
12061
12061
|
collection: a.collection == null ? "" : String(a.collection).trim(),
|
|
12062
|
-
tags:
|
|
12063
|
-
keywords:
|
|
12062
|
+
tags: dl(a.tags),
|
|
12063
|
+
keywords: dl(a.keywords),
|
|
12064
12064
|
canonicalSize: Array.isArray(a.canonicalSize) && a.canonicalSize.length === 3 ? a.canonicalSize.map(Number) : [
|
|
12065
12065
|
2.5,
|
|
12066
12066
|
1.5,
|
|
@@ -12078,41 +12078,41 @@ function vl(e) {
|
|
|
12078
12078
|
resourceMap: r
|
|
12079
12079
|
});
|
|
12080
12080
|
}
|
|
12081
|
-
|
|
12081
|
+
bl(t);
|
|
12082
12082
|
let a = [];
|
|
12083
12083
|
for (let e of i) {
|
|
12084
|
-
|
|
12085
|
-
for (let t of e.aliases || [])
|
|
12084
|
+
ol.set(e.id, e), sl.set(e.id, e.id);
|
|
12085
|
+
for (let t of e.aliases || []) sl.set(String(t), e.id);
|
|
12086
12086
|
a.push(e.id);
|
|
12087
12087
|
}
|
|
12088
|
-
n.geometries = [...a],
|
|
12089
|
-
let o =
|
|
12088
|
+
n.geometries = [...a], cl.set(t, n);
|
|
12089
|
+
let o = vl(n);
|
|
12090
12090
|
return typeof globalThis.dispatchEvent == "function" && typeof CustomEvent == "function" && globalThis.dispatchEvent(new CustomEvent("lc-geometry-registry-change", { detail: {
|
|
12091
12091
|
namespace: t,
|
|
12092
12092
|
geometries: a,
|
|
12093
12093
|
pack: o
|
|
12094
12094
|
} })), o;
|
|
12095
12095
|
}
|
|
12096
|
-
function
|
|
12096
|
+
function bl(e) {
|
|
12097
12097
|
let t = [];
|
|
12098
|
-
for (let [n, r] of
|
|
12099
|
-
for (let [e, n] of
|
|
12100
|
-
return
|
|
12101
|
-
}
|
|
12102
|
-
function bl() {
|
|
12103
|
-
return [...al.values()].map(gl);
|
|
12098
|
+
for (let [n, r] of ol) r.namespace === e && (ol.delete(n), t.push(n));
|
|
12099
|
+
for (let [e, n] of sl) t.includes(n) && sl.delete(e);
|
|
12100
|
+
return cl.delete(e), t;
|
|
12104
12101
|
}
|
|
12105
12102
|
function xl() {
|
|
12106
|
-
return [...
|
|
12103
|
+
return [...ol.values()].map(_l);
|
|
12107
12104
|
}
|
|
12108
|
-
function Sl(
|
|
12109
|
-
|
|
12110
|
-
return al.get(t) || null;
|
|
12105
|
+
function Sl() {
|
|
12106
|
+
return [...cl.values()].map(vl);
|
|
12111
12107
|
}
|
|
12112
12108
|
function Cl(e) {
|
|
12109
|
+
let t = sl.get(e) || e;
|
|
12110
|
+
return ol.get(t) || null;
|
|
12111
|
+
}
|
|
12112
|
+
function wl(e) {
|
|
12113
12113
|
return e === "container" || e === "shell";
|
|
12114
12114
|
}
|
|
12115
|
-
function
|
|
12115
|
+
function Tl(e = {}) {
|
|
12116
12116
|
let t = e && typeof e == "object" ? e : {}, n = Number(t.opacity);
|
|
12117
12117
|
return {
|
|
12118
12118
|
mode: t.mode === "connected" ? "connected" : "all",
|
|
@@ -12121,26 +12121,26 @@ function wl(e = {}) {
|
|
|
12121
12121
|
opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
|
|
12122
12122
|
};
|
|
12123
12123
|
}
|
|
12124
|
-
function
|
|
12124
|
+
function El(e) {
|
|
12125
12125
|
return [
|
|
12126
12126
|
"preserve",
|
|
12127
12127
|
"center",
|
|
12128
12128
|
"fit"
|
|
12129
12129
|
].includes(e) ? e : "preserve";
|
|
12130
12130
|
}
|
|
12131
|
-
function
|
|
12131
|
+
function Dl(e) {
|
|
12132
12132
|
return e === "model" ? "model" : "camera";
|
|
12133
12133
|
}
|
|
12134
|
-
function
|
|
12134
|
+
function Ol(e) {
|
|
12135
12135
|
return e === "ring" ? "ring" : tl;
|
|
12136
12136
|
}
|
|
12137
|
-
function
|
|
12137
|
+
function kl(e) {
|
|
12138
12138
|
return nl.includes(e) ? e : "selected";
|
|
12139
12139
|
}
|
|
12140
|
-
function
|
|
12140
|
+
function Al(e, t) {
|
|
12141
12141
|
e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
|
|
12142
12142
|
}
|
|
12143
|
-
|
|
12143
|
+
yl({
|
|
12144
12144
|
namespace: "geo",
|
|
12145
12145
|
name: "Geometric primitives",
|
|
12146
12146
|
version: "1",
|
|
@@ -12197,7 +12197,7 @@ vl({
|
|
|
12197
12197
|
} } : {}
|
|
12198
12198
|
}))
|
|
12199
12199
|
});
|
|
12200
|
-
var
|
|
12200
|
+
var jl = {
|
|
12201
12201
|
background: {
|
|
12202
12202
|
color: "#0a111a",
|
|
12203
12203
|
glow: "#1c2b39",
|
|
@@ -12242,17 +12242,17 @@ var Al = {
|
|
|
12242
12242
|
hint: !0
|
|
12243
12243
|
}
|
|
12244
12244
|
};
|
|
12245
|
-
function
|
|
12245
|
+
function Ml(e, t) {
|
|
12246
12246
|
let n = { ...e };
|
|
12247
12247
|
if (!t || typeof t != "object") return n;
|
|
12248
|
-
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ?
|
|
12248
|
+
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? Ml(e?.[r] || {}, i) : i;
|
|
12249
12249
|
return n;
|
|
12250
12250
|
}
|
|
12251
|
-
function
|
|
12251
|
+
function Nl(e) {
|
|
12252
12252
|
let t = e && typeof e == "object" ? { ...e } : {};
|
|
12253
|
-
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), jl
|
|
12253
|
+
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), Ml(jl, t);
|
|
12254
12254
|
}
|
|
12255
|
-
function
|
|
12255
|
+
function Pl(e) {
|
|
12256
12256
|
if (!e || typeof e != "object") return "directed";
|
|
12257
12257
|
let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
12258
12258
|
return e.bidirectional === !0 || [
|
|
@@ -12267,7 +12267,7 @@ function Nl(e) {
|
|
|
12267
12267
|
"failed"
|
|
12268
12268
|
].includes(t) ? "broken" : "directed";
|
|
12269
12269
|
}
|
|
12270
|
-
var
|
|
12270
|
+
var Fl = [":host{display:block;position:relative;height:var(--lc-height,680px);min-height:420px;color:var(--lc-panel-title,#e9f0f5);font:14px Inter,system-ui,-apple-system,sans-serif;background:var(--lc-bg,#0a111a);border:1px solid #294252;border-radius:12px;overflow:hidden;contain:content}", "*{box-sizing:border-box}.atlas{display:grid;grid-template-columns:minmax(0,1fr) 300px;height:100%}.atlas[data-panel=hidden]{grid-template-columns:1fr}.viewport{position:relative;min-width:0;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,var(--lc-bg-glow,#1c2b39),var(--lc-bg-fade,#0a111a) 82%)}canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.toolbar{position:absolute;z-index:10;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:3px;padding:6px;background:var(--lc-toolbar-bg,#15232fe8);border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:8px;white-space:nowrap}.toolbar[data-hidden=true],.toolbar[hidden],.panel[data-hidden=true],.panel[hidden],.crumbs[data-hidden=true],.crumbs[hidden],.hint[data-hidden=true],.hint[hidden]{display:none!important}.toolbar button{height:30px;padding:0 9px;border:0;border-radius:5px;background:none;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer}.toolbar button:hover,.toolbar button.active{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar i{display:block;width:1px;margin:2px 3px;background:#38515f}.hint{position:absolute;z-index:9;top:8px;bottom:auto;left:0;right:0;text-align:center;padding:2px 8px;font-size:11px;line-height:16px;color:var(--lc-hint,#8da6b8);pointer-events:none}.panel{overflow:auto;padding:24px 20px;background:var(--lc-panel-bg,linear-gradient(140deg,#182633,#0e1925 65%));border-left:1px solid var(--lc-panel-border,#2a3a48)}.panel h2{font-size:26px;line-height:1.12;font-weight:470;margin:12px 0;color:var(--lc-panel-title,#e9f0f5)}.panel h3{font-size:11px;letter-spacing:1.4px;color:#91aabd;margin:24px 0 10px}.panel p{font-size:14px;line-height:1.55;color:var(--lc-panel-text,#b5c6d2)}.panel .eyebrow{font-size:11px;letter-spacing:1.7px;color:#6ad7c0}.panel .sub{font-size:13px;color:#8fa8bd;margin-bottom:16px}.panel .external-link{display:inline-flex;align-items:center;gap:6px;margin:2px 0 12px;color:#6ad7c0;font-size:13px;font-weight:600;text-decoration:none}.panel .external-link:hover{text-decoration:underline}.panel button{display:block;width:100%;padding:10px 0;text-align:left;background:none;border:0;border-bottom:1px solid var(--lc-panel-border,#2a3a48);color:#d9e7eb;cursor:pointer}.panel button:hover{color:#6ad7c0}.panel .relation{padding:10px 0;border-bottom:1px solid var(--lc-panel-border,#2a3a48)}.panel .relation.selected{padding-left:9px;border-left:2px solid #6ad7c0;background:#18343f}.panel .relation strong{display:block;font-weight:550}.panel .relation small{display:block;color:#86a6b9;font-size:12px;margin-top:4px}.panel .back{color:#9db7c8;font-size:13px}.panel .crumbs{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:0 0 12px}.panel .crumbs button{display:inline;width:auto;padding:3px 7px;border:0;border-radius:4px;background:var(--lc-crumb-bg,#142733);color:var(--lc-crumb-text,#91b6c7);font-size:12px}.panel .crumbs button.current{background:var(--lc-crumb-active,#1c4a4d);color:var(--lc-crumb-active-text,#c5f2e9)}.panel .note{border-top:1px solid var(--lc-panel-border,#2a3a48);padding-top:16px;margin-top:22px;font-size:12px;color:#7692a6}.error{position:absolute;inset:20%;padding:18px;background:#172b3b;border:1px solid #7896a9;line-height:1.5;z-index:4}@media(max-width:900px){.toolbar{gap:0}.toolbar button{padding:0 6px;font-size:12px}}@media(max-width:760px){:host{height:680px}.atlas{grid-template-columns:1fr;grid-template-rows:minmax(420px,1fr) auto}.panel{max-height:250px;border-left:0;border-top:1px solid var(--lc-panel-border,#2a3a48);padding:18px}.toolbar{bottom:24px}.hint{top:8px;bottom:auto;display:block}}"].join(""), Il = ".toolbar{max-width:calc(100% - 16px);overflow:visible}.toolbar-group{display:flex;align-items:center;gap:2px}.toolbar-group+.toolbar-group{padding-left:6px;border-left:1px solid #38515f}.toolbar .toolbar-icon{display:grid;width:30px;padding:0;place-items:center}.toolbar-icon svg,.toolbar-menu>summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.toolbar-menu{position:relative}.toolbar-menu>summary{display:flex;align-items:center;height:30px;padding:0 8px;gap:6px;border-radius:5px;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer;list-style:none;user-select:none}.toolbar-menu>summary::-webkit-details-marker{display:none}.toolbar-menu>summary:hover,.toolbar-menu[open]>summary{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar-menu-status{max-width:92px;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.toolbar-menu-chevron{width:10px;height:10px!important;transition:transform .16s ease}.toolbar-menu[open] .toolbar-menu-chevron{transform:rotate(180deg)}.toolbar-popover{position:absolute;right:0;bottom:calc(100% + 8px);display:grid;min-width:218px;padding:6px;border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:9px;background:var(--lc-toolbar-bg,#15232ff7);box-shadow:0 14px 36px #0009}.toolbar-popover-title{padding:7px 9px 5px;color:var(--lc-hint,#8da6b8);font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.toolbar .toolbar-option{display:grid;grid-template-columns:minmax(0,1fr) 18px;align-items:center;width:100%;height:auto;min-height:34px;padding:7px 9px;text-align:left}.toolbar-option span:first-child{overflow:hidden;text-overflow:ellipsis}.toolbar-option-check{color:var(--lc-toolbar-active-text,#c5f2e9);font-weight:700;text-align:center;visibility:hidden}.toolbar-option.active .toolbar-option-check{visibility:visible}.toolbar-option-separator{height:1px;margin:5px 7px;background:#38515f}.toolbar button[disabled]{opacity:.42;cursor:not-allowed}@media(max-width:620px){.toolbar-menu-status{display:none}.toolbar-menu>summary{width:30px;padding:0;justify-content:center}.toolbar-menu-chevron{display:none}.toolbar-group+.toolbar-group{padding-left:3px}.toolbar-popover{right:-4px}}", Ll = [
|
|
12271
12271
|
".viewport>.atlas-print-snapshot{display:none!important}",
|
|
12272
12272
|
"@media print{",
|
|
12273
12273
|
":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
|
|
@@ -12276,17 +12276,17 @@ var Pl = [":host{display:block;position:relative;height:var(--lc-height,680px);m
|
|
|
12276
12276
|
":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
|
|
12277
12277
|
":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
|
|
12278
12278
|
"}"
|
|
12279
|
-
].join(""),
|
|
12280
|
-
minus:
|
|
12281
|
-
plus:
|
|
12282
|
-
fit:
|
|
12283
|
-
front:
|
|
12284
|
-
view:
|
|
12285
|
-
relations:
|
|
12286
|
-
focus:
|
|
12287
|
-
chevron:
|
|
12288
|
-
},
|
|
12289
|
-
function
|
|
12279
|
+
].join(""), Rl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, zl = {
|
|
12280
|
+
minus: Rl("<path d=\"M6 12h12\"/>"),
|
|
12281
|
+
plus: Rl("<path d=\"M12 6v12M6 12h12\"/>"),
|
|
12282
|
+
fit: Rl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12283
|
+
front: Rl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
|
|
12284
|
+
view: Rl("<path d=\"M2.5 12s3.5-5 9.5-5 9.5 5 9.5 5-3.5 5-9.5 5-9.5-5-9.5-5Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12285
|
+
relations: Rl("<circle cx=\"5\" cy=\"6\" r=\"2\"/><circle cx=\"19\" cy=\"7\" r=\"2\"/><circle cx=\"12\" cy=\"18\" r=\"2\"/><path d=\"m6.8 6.3 10.2.5M6.2 7.7l4.6 8.6m6.8-7.5-4.4 7.5\"/>"),
|
|
12286
|
+
focus: Rl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
|
|
12287
|
+
chevron: Rl("<path d=\"m8 10 4 4 4-4\"/>")
|
|
12288
|
+
}, Bl = (e, t, n = !1) => `<button class="toolbar-option${n ? " active" : ""}" data-action="${e}" aria-pressed="${n}"><span>${t}</span><span class="toolbar-option-check" aria-hidden="true">✓</span></button>`, Vl = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}">${r}</span>${zl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Hl = `<div class="atlas"><section class="viewport"><canvas tabindex="0" aria-label="Modelo 3D interactivo"></canvas><div class="toolbar" role="toolbar" aria-label="Controles de la vista"><div class="toolbar-group" data-toolbar-group="camera"><button class="toolbar-icon" data-action="minus" aria-label="Alejar" title="Alejar">${zl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${zl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${zl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${zl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Vl("view", zl.view, "Vista", "Vista", Bl("labels", "Etiquetas", !0) + Bl("panel", "Información", !0) + Bl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Bl("open-all", "Abrir todos") + Bl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Vl("relations", zl.relations, "Relaciones", "Selección", Bl("relations-all", "Todas") + Bl("relations-selected", "Selección", !0) + Bl("relations-callers", "All callers") + Bl("relations-called", "All called") + Bl("relations-none", "Ocultar") + "<div data-relation-groups-section hidden><div class=\"toolbar-option-separator\"></div><div class=\"toolbar-popover-title\">Grupos</div><div data-relation-groups></div></div>")}</div><div class="toolbar-group" data-toolbar-group="focus">${Vl("focus", zl.focus, "Foco", "Todo", Bl("focus-all", "Todo", !0) + Bl("focus-dim", "Conectados") + Bl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Bl("focus-selection", "Enfocar selección") + Bl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: botón derecho / ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic · Enfoca: doble clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
|
|
12289
|
+
function Ul(e) {
|
|
12290
12290
|
return String(e ?? "").replace(/[&<>"']/g, (e) => ({
|
|
12291
12291
|
"&": "&",
|
|
12292
12292
|
"<": "<",
|
|
@@ -12295,17 +12295,39 @@ function Hl(e) {
|
|
|
12295
12295
|
"'": "'"
|
|
12296
12296
|
})[e]);
|
|
12297
12297
|
}
|
|
12298
|
-
function
|
|
12298
|
+
function Wl(e) {
|
|
12299
12299
|
let t = String(e ?? "").trim();
|
|
12300
12300
|
if (!t) return "";
|
|
12301
12301
|
try {
|
|
12302
12302
|
let e = new URL(t, globalThis.location?.href);
|
|
12303
|
-
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" +
|
|
12303
|
+
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Ul(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
|
|
12304
12304
|
} catch {
|
|
12305
12305
|
return "";
|
|
12306
12306
|
}
|
|
12307
12307
|
}
|
|
12308
|
-
function
|
|
12308
|
+
function Gl(e, t = "connection") {
|
|
12309
|
+
return String(e || t).normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
|
|
12310
|
+
}
|
|
12311
|
+
function Kl(e) {
|
|
12312
|
+
let t = Array.isArray(e) ? e : e && typeof e == "object" ? Object.entries(e).map(([e, t]) => typeof t == "string" ? {
|
|
12313
|
+
id: e,
|
|
12314
|
+
label: t
|
|
12315
|
+
} : {
|
|
12316
|
+
id: e,
|
|
12317
|
+
...t || {}
|
|
12318
|
+
}) : [], n = /* @__PURE__ */ new Set();
|
|
12319
|
+
return t.flatMap((e, t) => {
|
|
12320
|
+
let r = String(e?.id || "").trim();
|
|
12321
|
+
return !r || n.has(r) ? [] : (n.add(r), [{
|
|
12322
|
+
...e,
|
|
12323
|
+
id: r,
|
|
12324
|
+
label: String(e.label || e.name || r),
|
|
12325
|
+
...e.color == null ? {} : { color: String(e.color) },
|
|
12326
|
+
...e.description == null ? {} : { description: String(e.description) }
|
|
12327
|
+
}]);
|
|
12328
|
+
});
|
|
12329
|
+
}
|
|
12330
|
+
function ql(e) {
|
|
12309
12331
|
let t = e && typeof e == "object" ? e : {}, n = t.render && typeof t.render == "object" ? t.render : {}, r = Array.isArray(t.entities) ? t.entities.map((e) => ({
|
|
12310
12332
|
...e,
|
|
12311
12333
|
p: Array.isArray(e.p) ? e.p : [
|
|
@@ -12318,19 +12340,35 @@ function Wl(e) {
|
|
|
12318
12340
|
1,
|
|
12319
12341
|
1
|
|
12320
12342
|
]
|
|
12321
|
-
})) : [], i =
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12343
|
+
})) : [], i = /* @__PURE__ */ new Set(), a = (e) => {
|
|
12344
|
+
let t = (e.id == null ? "" : String(e.id).trim()) || [
|
|
12345
|
+
"relation",
|
|
12346
|
+
Gl(e.from, "source"),
|
|
12347
|
+
Gl(e.to, "target"),
|
|
12348
|
+
e.label ? Gl(e.label) : ""
|
|
12349
|
+
].filter(Boolean).join("-"), n = t || "relation", r = 2;
|
|
12350
|
+
for (; i.has(n);) n = `${t || "relation"}-${r++}`;
|
|
12351
|
+
return i.add(n), n;
|
|
12352
|
+
}, o = Array.isArray(t.relations) ? t.relations.map((e, t) => {
|
|
12353
|
+
if (Array.isArray(e)) {
|
|
12354
|
+
let n = {
|
|
12355
|
+
from: e[0],
|
|
12356
|
+
to: e[1],
|
|
12357
|
+
label: e[2] || "",
|
|
12358
|
+
mode: Pl({ mode: e[3] }),
|
|
12359
|
+
index: t
|
|
12360
|
+
};
|
|
12361
|
+
return n.id = a(n), n;
|
|
12362
|
+
}
|
|
12363
|
+
let n = {
|
|
12364
|
+
...e,
|
|
12365
|
+
from: e.from,
|
|
12366
|
+
to: e.to,
|
|
12367
|
+
label: e.label || "",
|
|
12368
|
+
mode: Pl(e),
|
|
12369
|
+
index: t
|
|
12370
|
+
};
|
|
12371
|
+
return n.id = a(n), n.group != null && (n.group = String(n.group).trim() || void 0), n;
|
|
12334
12372
|
}) : [];
|
|
12335
12373
|
return {
|
|
12336
12374
|
...t,
|
|
@@ -12338,16 +12376,17 @@ function Wl(e) {
|
|
|
12338
12376
|
...el,
|
|
12339
12377
|
...t.palette || {}
|
|
12340
12378
|
},
|
|
12341
|
-
theme:
|
|
12379
|
+
theme: Nl(t.theme || t.styles),
|
|
12342
12380
|
render: {
|
|
12343
12381
|
...n,
|
|
12344
|
-
relationMarker:
|
|
12382
|
+
relationMarker: Ol(n.relationMarker)
|
|
12345
12383
|
},
|
|
12384
|
+
relationGroups: Kl(t.relationGroups),
|
|
12346
12385
|
entities: r,
|
|
12347
|
-
relations:
|
|
12386
|
+
relations: o
|
|
12348
12387
|
};
|
|
12349
12388
|
}
|
|
12350
|
-
function
|
|
12389
|
+
function Jl(e, t, n = [
|
|
12351
12390
|
1,
|
|
12352
12391
|
1,
|
|
12353
12392
|
1
|
|
@@ -12366,7 +12405,7 @@ function Gl(e, t, n = [
|
|
|
12366
12405
|
});
|
|
12367
12406
|
return s.center(), s;
|
|
12368
12407
|
}
|
|
12369
|
-
function
|
|
12408
|
+
function Yl(e, t, n) {
|
|
12370
12409
|
let r = new ui();
|
|
12371
12410
|
for (let t = 0; t < e; t++) {
|
|
12372
12411
|
let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
|
|
@@ -12383,7 +12422,7 @@ function Kl(e, t, n) {
|
|
|
12383
12422
|
});
|
|
12384
12423
|
return i.rotateX(Math.PI / 2), i.center(), i;
|
|
12385
12424
|
}
|
|
12386
|
-
function
|
|
12425
|
+
function Xl(e, t, n, r) {
|
|
12387
12426
|
let i = Math.min(.22, Math.max(0, Number(n) || 0));
|
|
12388
12427
|
if (!i) return new Er(t, e, 1, 32);
|
|
12389
12428
|
let a = [new V(0, -.5)];
|
|
@@ -12400,7 +12439,7 @@ function ql(e, t, n, r) {
|
|
|
12400
12439
|
}
|
|
12401
12440
|
return a.push(new V(0, .5)), new Qi(a, 32);
|
|
12402
12441
|
}
|
|
12403
|
-
function
|
|
12442
|
+
function Zl(e, t) {
|
|
12404
12443
|
if (!t) return e;
|
|
12405
12444
|
let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
|
|
12406
12445
|
for (let e = 0; e < r.count; e++) {
|
|
@@ -12409,36 +12448,36 @@ function Jl(e, t) {
|
|
|
12409
12448
|
}
|
|
12410
12449
|
return r.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
12411
12450
|
}
|
|
12412
|
-
function
|
|
12451
|
+
function Ql(e, t = 0, n = 4, r = [
|
|
12413
12452
|
1,
|
|
12414
12453
|
1,
|
|
12415
12454
|
1
|
|
12416
12455
|
]) {
|
|
12417
12456
|
let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
|
|
12418
12457
|
switch (e) {
|
|
12419
|
-
case "cylinder": return i ?
|
|
12420
|
-
case "cone": return i ?
|
|
12458
|
+
case "cylinder": return i ? Xl(.5, .5, i, a) : new Er(.5, .5, 1, 32);
|
|
12459
|
+
case "cone": return i ? Xl(0, .5, i, a) : new Dr(.5, 1, 32);
|
|
12421
12460
|
case "frustum-cone":
|
|
12422
|
-
case "truncated-cone": return i ?
|
|
12461
|
+
case "truncated-cone": return i ? Xl(.28, .5, i, a) : new Er(.28, .5, 1, 32);
|
|
12423
12462
|
case "frustum-pyramid":
|
|
12424
12463
|
case "truncated-pyramid": return new Er(.28, .5, 1, 4);
|
|
12425
12464
|
case "frustum-triangle": return new Er(.28, .5, 1, 3);
|
|
12426
|
-
case "prism": return i ?
|
|
12427
|
-
case "pyramid-square": return i ?
|
|
12428
|
-
case "pyramid-triangle": return i ?
|
|
12465
|
+
case "prism": return i ? Yl(6, i, a) : new Er(.5, .5, 1, 6);
|
|
12466
|
+
case "pyramid-square": return i ? Zl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
|
|
12467
|
+
case "pyramid-triangle": return i ? Zl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
|
|
12429
12468
|
case "sphere": return new ta(.5, 24, 16);
|
|
12430
|
-
case "octahedron": return
|
|
12431
|
-
case "dodecahedron": return
|
|
12432
|
-
case "icosahedron": return
|
|
12433
|
-
default: return i ?
|
|
12469
|
+
case "octahedron": return Zl(new $i(.5), i);
|
|
12470
|
+
case "dodecahedron": return Zl(new kr(.5), i);
|
|
12471
|
+
case "icosahedron": return Zl(new Zi(.5), i);
|
|
12472
|
+
default: return i ? Jl(i, a, r) : new Nn(1, 1, 1);
|
|
12434
12473
|
}
|
|
12435
12474
|
}
|
|
12436
|
-
function
|
|
12475
|
+
function $l(e) {
|
|
12437
12476
|
e.computeBoundingBox();
|
|
12438
12477
|
let t = e.boundingBox?.getSize(new U());
|
|
12439
12478
|
return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
|
|
12440
12479
|
}
|
|
12441
|
-
function
|
|
12480
|
+
function eu(e, t) {
|
|
12442
12481
|
let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
|
|
12443
12482
|
for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
|
|
12444
12483
|
return {
|
|
@@ -12446,10 +12485,10 @@ function Zl(e, t) {
|
|
|
12446
12485
|
...n && typeof n == "object" ? n : {}
|
|
12447
12486
|
};
|
|
12448
12487
|
}
|
|
12449
|
-
function
|
|
12488
|
+
function tu(e, t, n) {
|
|
12450
12489
|
return typeof e != "string" || !e ? n : t[e] || e;
|
|
12451
12490
|
}
|
|
12452
|
-
function
|
|
12491
|
+
function nu(e, t = "#ffffff", n = "transparent") {
|
|
12453
12492
|
let r = document.createElement("canvas");
|
|
12454
12493
|
r.width = 256, r.height = 256;
|
|
12455
12494
|
let i = r.getContext("2d");
|
|
@@ -12457,8 +12496,8 @@ function $l(e, t = "#ffffff", n = "transparent") {
|
|
|
12457
12496
|
let a = new Cr(r);
|
|
12458
12497
|
return a.colorSpace = y, a;
|
|
12459
12498
|
}
|
|
12460
|
-
var
|
|
12461
|
-
function
|
|
12499
|
+
var ru = /^[AaCcHhLlMmQqSsTtVvZz]$/, iu = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?|[AaCcHhLlMmQqSsTtVvZz]/g;
|
|
12500
|
+
function au(e, t, n, r, i, a, o, s, c) {
|
|
12462
12501
|
let l = Math.abs(Number(n)), u = Math.abs(Number(r));
|
|
12463
12502
|
if (!l || !u || e === s && t === c) return [[s, c]];
|
|
12464
12503
|
let d = Number(i || 0) * Math.PI / 180, f = Math.cos(d), p = Math.sin(d), m = (e - s) / 2, h = (t - c) / 2, g = f * m + p * h, _ = -p * m + f * h, v = Math.sqrt(Math.max(1, g * g / (l * l) + _ * _ / (u * u)));
|
|
@@ -12474,12 +12513,12 @@ function nu(e, t, n, r, i, a, o, s, c) {
|
|
|
12474
12513
|
return [w + f * l * r - p * u * i, T + p * l * r + f * u * i];
|
|
12475
12514
|
});
|
|
12476
12515
|
}
|
|
12477
|
-
function
|
|
12478
|
-
let t = String(e || "").match(
|
|
12516
|
+
function ou(e) {
|
|
12517
|
+
let t = String(e || "").match(iu) || [], n = new qa(), r = 0, i = "", a = "", o = 0, s = 0, c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = () => r < t.length && !ru.test(t[r]), h = () => Number(t[r++]), g = () => {
|
|
12479
12518
|
let e = t[r];
|
|
12480
12519
|
return /^[01].+/.test(e) ? (t[r] = e.slice(1), e[0] === "1") : h() !== 0;
|
|
12481
12520
|
}, _ = (e, t, n) => [n ? o + e : e, n ? s + t : t];
|
|
12482
|
-
for (; r < t.length && (
|
|
12521
|
+
for (; r < t.length && (ru.test(t[r]) && (i = t[r++]), i);) {
|
|
12483
12522
|
let e = i.toLowerCase(), t = i === e;
|
|
12484
12523
|
if (e === "z") {
|
|
12485
12524
|
n.currentPath?.closePath(), o = c, s = l, a = i, i = "";
|
|
@@ -12519,7 +12558,7 @@ function ru(e) {
|
|
|
12519
12558
|
}
|
|
12520
12559
|
else if (e === "a") for (; m();) {
|
|
12521
12560
|
let e = h(), r = h(), c = h(), l = g(), u = g(), [d, f] = _(h(), h(), t);
|
|
12522
|
-
for (let [t, i] of
|
|
12561
|
+
for (let [t, i] of au(o, s, e, r, c, l, u, d, f)) n.lineTo(t, -i);
|
|
12523
12562
|
o = d, s = f, a = i;
|
|
12524
12563
|
}
|
|
12525
12564
|
else break;
|
|
@@ -12527,12 +12566,12 @@ function ru(e) {
|
|
|
12527
12566
|
}
|
|
12528
12567
|
return n;
|
|
12529
12568
|
}
|
|
12530
|
-
function
|
|
12569
|
+
function su(e, t = {}) {
|
|
12531
12570
|
let n = String(e || "").match(/<path\b[^>]*>/gi) || [], r = [];
|
|
12532
12571
|
for (let e of n) {
|
|
12533
12572
|
let t = e.match(/\bd\s*=\s*(["'])([\s\S]*?)\1/i);
|
|
12534
12573
|
if (!t) continue;
|
|
12535
|
-
let n =
|
|
12574
|
+
let n = ou(t[2]);
|
|
12536
12575
|
r.push(...n.toShapes(!0, !1));
|
|
12537
12576
|
}
|
|
12538
12577
|
if (!r.length) return new Nn(1, 1, .12);
|
|
@@ -12547,11 +12586,11 @@ function iu(e, t = {}) {
|
|
|
12547
12586
|
});
|
|
12548
12587
|
return a.center(), a;
|
|
12549
12588
|
}
|
|
12550
|
-
function
|
|
12551
|
-
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ?
|
|
12589
|
+
function cu(e) {
|
|
12590
|
+
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ? su(e.svg, e) : Ql(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
|
|
12552
12591
|
}
|
|
12553
|
-
function
|
|
12554
|
-
let a =
|
|
12592
|
+
function lu(e, t, n, r, i) {
|
|
12593
|
+
let a = eu(t, e), o = {
|
|
12555
12594
|
...n,
|
|
12556
12595
|
...e.palette || {},
|
|
12557
12596
|
...t.geometryPalette || t.geometry_palette || {}
|
|
@@ -12566,11 +12605,11 @@ function ou(e, t, n, r, i) {
|
|
|
12566
12605
|
if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
|
|
12567
12606
|
let l = new Qn(), u = [], d = [];
|
|
12568
12607
|
for (let a of c) {
|
|
12569
|
-
let s =
|
|
12570
|
-
|
|
12571
|
-
let c = a.color || "component", f =
|
|
12608
|
+
let s = cu(a);
|
|
12609
|
+
$l(s);
|
|
12610
|
+
let c = a.color || "component", f = tu(c, o, n.component || el.component), p = a.emissive || "#000000", m = new ia({
|
|
12572
12611
|
color: f,
|
|
12573
|
-
emissive:
|
|
12612
|
+
emissive: tu(p, o, "#000000"),
|
|
12574
12613
|
emissiveIntensity: Number.isFinite(Number(a.emissiveIntensity)) ? Math.max(0, Number(a.emissiveIntensity)) : 0,
|
|
12575
12614
|
roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
|
|
12576
12615
|
metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
|
|
@@ -12641,7 +12680,7 @@ function ou(e, t, n, r, i) {
|
|
|
12641
12680
|
n.src = _;
|
|
12642
12681
|
}
|
|
12643
12682
|
})(), m.map.colorSpace = y, m.needsUpdate = !0;
|
|
12644
|
-
} else g != null && g !== "" && (m.map =
|
|
12683
|
+
} else g != null && g !== "" && (m.map = nu(g, tu(a.iconColor || "#ffffff", o, "#ffffff"), tu(a.iconBackground || "transparent", o, "transparent")), m.transparent = !0, m.needsUpdate = !0);
|
|
12645
12684
|
if (h = new An(s, m), h.position.fromArray(Array.isArray(a.position) ? a.position : [
|
|
12646
12685
|
0,
|
|
12647
12686
|
0,
|
|
@@ -12678,23 +12717,23 @@ function ou(e, t, n, r, i) {
|
|
|
12678
12717
|
descriptor: s
|
|
12679
12718
|
};
|
|
12680
12719
|
}
|
|
12681
|
-
var
|
|
12720
|
+
var uu = Object.freeze([
|
|
12682
12721
|
"auto",
|
|
12683
12722
|
"top",
|
|
12684
12723
|
"bottom",
|
|
12685
12724
|
"left",
|
|
12686
12725
|
"right"
|
|
12687
12726
|
]);
|
|
12688
|
-
function
|
|
12727
|
+
function du(e) {
|
|
12689
12728
|
let t = String(e || "auto").trim().toLowerCase();
|
|
12690
|
-
return
|
|
12729
|
+
return uu.includes(t) ? t : "auto";
|
|
12691
12730
|
}
|
|
12692
|
-
function
|
|
12693
|
-
let n = e.style?.label?.anchor ?? e.labelAnchor ?? e.label_anchor, r =
|
|
12694
|
-
return
|
|
12731
|
+
function fu(e = {}, t = {}) {
|
|
12732
|
+
let n = e.style?.label?.anchor ?? e.labelAnchor ?? e.label_anchor, r = wl(e.type) ? "auto" : t?.label?.anchor ?? "bottom";
|
|
12733
|
+
return du(n ?? r);
|
|
12695
12734
|
}
|
|
12696
|
-
function
|
|
12697
|
-
let a =
|
|
12735
|
+
function pu(e, t, n, r, i = .025) {
|
|
12736
|
+
let a = du(e);
|
|
12698
12737
|
if (a === "auto") return null;
|
|
12699
12738
|
let o = Math.max(0, Number(t?.x) || 0), s = Math.max(0, Number(t?.y) || 0);
|
|
12700
12739
|
Math.max(0, Number(n) || 0);
|
|
@@ -12721,7 +12760,7 @@ function uu(e, t, n, r, i = .025) {
|
|
|
12721
12760
|
backRotation: Math.PI / 2
|
|
12722
12761
|
};
|
|
12723
12762
|
}
|
|
12724
|
-
function
|
|
12763
|
+
function mu(e, t, n, r = "", i = !0) {
|
|
12725
12764
|
let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
|
|
12726
12765
|
a.width = Math.ceil(s * 320), a.height = Math.ceil(c * 320), o.imageSmoothingEnabled = !0, o.imageSmoothingQuality = "high", o.clearRect(0, 0, a.width, a.height);
|
|
12727
12766
|
let l = a.height * .62;
|
|
@@ -12758,7 +12797,7 @@ function du(e, t, n, r = "", i = !0) {
|
|
|
12758
12797
|
let C = new An(b, v);
|
|
12759
12798
|
C.rotation.y = Math.PI, C.position.set(0, n.y / 2 - .09 - c / 2, -n.z / 2 - .012);
|
|
12760
12799
|
let w = new An(b, v.clone());
|
|
12761
|
-
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible =
|
|
12800
|
+
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = wl(r), x.add(S, C, w);
|
|
12762
12801
|
for (let e of [
|
|
12763
12802
|
S,
|
|
12764
12803
|
C,
|
|
@@ -12766,7 +12805,7 @@ function du(e, t, n, r = "", i = !0) {
|
|
|
12766
12805
|
]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
|
|
12767
12806
|
return x.renderOrder = 20, x.frustumCulled = !1, x.userData.front = S, x.userData.back = C, x.userData.top = w, x.userData.height = c, x.userData.width = s, x.userData.textOffsetX = h, x.userData.textOffsetY = g, x.userData.nodeLabel = !0, x;
|
|
12768
12807
|
}
|
|
12769
|
-
function
|
|
12808
|
+
function hu(e, t, n, r = globalThis.document) {
|
|
12770
12809
|
if (!e || !t || !n || !r?.createElement) return null;
|
|
12771
12810
|
try {
|
|
12772
12811
|
e.render(t, n);
|
|
@@ -12788,7 +12827,7 @@ function fu(e, t, n, r = globalThis.document) {
|
|
|
12788
12827
|
return null;
|
|
12789
12828
|
}
|
|
12790
12829
|
}
|
|
12791
|
-
var
|
|
12830
|
+
var gu = class extends HTMLElement {
|
|
12792
12831
|
static version = $c;
|
|
12793
12832
|
static get observedAttributes() {
|
|
12794
12833
|
return [
|
|
@@ -12807,23 +12846,23 @@ var pu = class extends HTMLElement {
|
|
|
12807
12846
|
];
|
|
12808
12847
|
}
|
|
12809
12848
|
static registerGeometryPack(e) {
|
|
12810
|
-
return
|
|
12849
|
+
return yl(e);
|
|
12811
12850
|
}
|
|
12812
12851
|
static unregisterGeometryPack(e) {
|
|
12813
|
-
return
|
|
12852
|
+
return bl(e);
|
|
12814
12853
|
}
|
|
12815
12854
|
static getGeometryCatalog() {
|
|
12816
|
-
return
|
|
12855
|
+
return xl();
|
|
12817
12856
|
}
|
|
12818
12857
|
static getGeometryPackCatalog() {
|
|
12819
|
-
return
|
|
12858
|
+
return Sl();
|
|
12820
12859
|
}
|
|
12821
12860
|
constructor() {
|
|
12822
|
-
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" +
|
|
12861
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + Fl + Il + Ll + "</style>" + Hl, this.canvas = this.shadowRoot.querySelector("canvas"), this.panel = this.shadowRoot.querySelector(".panel"), this.scene = new tr(), this.camera = new Kn(30, 1, .1, 2e3), this.cameraPosition = new U(), this.cameraTarget = new U(), this.raycaster = new Wa(), this.pointer = new V(), this.nodes = /* @__PURE__ */ new Map(), this.open = /* @__PURE__ */ new Set(), this._initialOpenContainers = /* @__PURE__ */ new Set(), this.selected = null, this.selectedRelationIndex = null, this.modelData = null, this._loading = !1, this._pendingSelection = null, this._theme = Nl(), this.relationMode = kl(this.getAttribute("relation-mode")), this.relationMarker = Ol(this.getAttribute("relation-marker")), this.visibleRelationGroups = null, this.focusFilter = Tl({
|
|
12823
12862
|
mode: this.getAttribute("focus-mode"),
|
|
12824
12863
|
effect: this.getAttribute("focus-effect"),
|
|
12825
12864
|
layout: this.getAttribute("focus-layout")
|
|
12826
|
-
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation =
|
|
12865
|
+
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = El(this.getAttribute("selection-navigation")), this.itemFacing = Dl(this.getAttribute("item-facing")), this.showShellLabels = this.getAttribute("shell-labels") !== "false", this.yaw = .37, this.pitch = .22, this.zoom = 1, this.targetZoom = 1, this.focus = new U(), this.targetFocus = new U(), this.drag = null, this.pointers = /* @__PURE__ */ new Map(), this.relationGroup = new Qn(), this.scene.add(this.relationGroup), this.relations = [], this.animationFrame = 0, this.ready = !1, this._toolbarVisible = this.getAttribute("toolbar") !== "off", this._panelVisible = this.getAttribute("panel") !== "off", this.toolbar = this.shadowRoot.querySelector(".toolbar"), this._printState = null, this._beforePrintListener = () => this.prepareForPrint(), this._afterPrintListener = () => this.restoreAfterPrint(), this._printMedia = globalThis.matchMedia?.("print") || null, this._printMediaListener = (e) => e.matches ? this.prepareForPrint() : this.restoreAfterPrint(), this._geometryRegistryListener = () => {
|
|
12827
12866
|
this.ready && this.modelData && this._build();
|
|
12828
12867
|
}, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
|
|
12829
12868
|
}
|
|
@@ -12835,7 +12874,7 @@ var pu = class extends HTMLElement {
|
|
|
12835
12874
|
}
|
|
12836
12875
|
attributeChangedCallback(e, t, n) {
|
|
12837
12876
|
if (t !== n) {
|
|
12838
|
-
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "relation-marker" &&
|
|
12877
|
+
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "relation-marker" && Ol(n) !== this.relationMarker && this.setRelationMarker(n, { source: "attribute" }), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" && Dl(n) !== this.itemFacing && this.setItemFacing(n, { source: "attribute" }), e === "focus-mode" && n !== this.focusFilter.mode && this.setFocusFilter({ mode: n }), e === "focus-effect" && n !== this.focusFilter.effect && this.setFocusFilter({ effect: n }), e === "focus-layout" && n !== this.focusFilter.layout && this.setFocusFilter({ layout: n }), e === "shell-labels" && this.ready) {
|
|
12839
12878
|
let e = n !== "false";
|
|
12840
12879
|
e !== this.showShellLabels && (this.showShellLabels = e, this._build({
|
|
12841
12880
|
preserveSelection: this.selected?.id,
|
|
@@ -12878,7 +12917,7 @@ var pu = class extends HTMLElement {
|
|
|
12878
12917
|
this.setPalette(e);
|
|
12879
12918
|
}
|
|
12880
12919
|
captureFrame() {
|
|
12881
|
-
return
|
|
12920
|
+
return hu(this.renderer, this.scene, this.camera, this.ownerDocument);
|
|
12882
12921
|
}
|
|
12883
12922
|
prepareForPrint() {
|
|
12884
12923
|
if (this._printState) return this;
|
|
@@ -12983,13 +13022,13 @@ var pu = class extends HTMLElement {
|
|
|
12983
13022
|
if (!e.size) return null;
|
|
12984
13023
|
for (let t of [...e]) {
|
|
12985
13024
|
let n = this.nodes.get(t);
|
|
12986
|
-
n &&
|
|
13025
|
+
n && wl(n.type) && this._descendantIds(t, e);
|
|
12987
13026
|
}
|
|
12988
13027
|
let t = new Set(e);
|
|
12989
13028
|
for (let n of this.relations) (t.has(n.from) || t.has(n.to)) && (e.add(n.from), e.add(n.to));
|
|
12990
13029
|
for (let t of [...e]) {
|
|
12991
13030
|
let n = this.nodes.get(t);
|
|
12992
|
-
n &&
|
|
13031
|
+
n && wl(n.type) && this._descendantIds(t, e);
|
|
12993
13032
|
}
|
|
12994
13033
|
for (let t of [...e]) {
|
|
12995
13034
|
let n = this.nodes.get(t)?.parent ? this.nodes.get(this.nodes.get(t).parent) : null;
|
|
@@ -13050,6 +13089,11 @@ var pu = class extends HTMLElement {
|
|
|
13050
13089
|
called: "All called",
|
|
13051
13090
|
none: "Ocultar"
|
|
13052
13091
|
}[this.relationMode]);
|
|
13092
|
+
let t = this.modelData?.relationGroups || [], n = this.shadowRoot.querySelector("[data-relation-groups-section]"), r = this.shadowRoot.querySelector("[data-relation-groups]");
|
|
13093
|
+
n && (n.hidden = t.length === 0), r && (r.innerHTML = t.map((e) => {
|
|
13094
|
+
let t = !this.visibleRelationGroups || this.visibleRelationGroups.has(e.id);
|
|
13095
|
+
return Bl("relation-group-toggle", Ul(e.label || e.id), t).replace("data-action=\"relation-group-toggle\"", `data-action="relation-group-toggle" data-relation-group="${Ul(e.id)}"`);
|
|
13096
|
+
}).join(""));
|
|
13053
13097
|
}
|
|
13054
13098
|
_syncPanelToolbar() {
|
|
13055
13099
|
let e = this.shadowRoot?.querySelector("[data-action=\"panel\"]");
|
|
@@ -13073,7 +13117,7 @@ var pu = class extends HTMLElement {
|
|
|
13073
13117
|
});
|
|
13074
13118
|
}
|
|
13075
13119
|
setFocusFilter(e = {}, t = {}) {
|
|
13076
|
-
let n =
|
|
13120
|
+
let n = Tl({
|
|
13077
13121
|
...this.focusFilter,
|
|
13078
13122
|
...e || {}
|
|
13079
13123
|
}), r = JSON.stringify(n) !== JSON.stringify(this.focusFilter);
|
|
@@ -13085,12 +13129,18 @@ var pu = class extends HTMLElement {
|
|
|
13085
13129
|
_applyModelRenderOptions() {
|
|
13086
13130
|
let e = this.modelData?.render;
|
|
13087
13131
|
if (!e || typeof e != "object") return this;
|
|
13088
|
-
nl.includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode),
|
|
13132
|
+
nl.includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Ol(e.relationMarker) !== this.relationMarker && this.setRelationMarker(e.relationMarker, {
|
|
13133
|
+
emit: !1,
|
|
13134
|
+
source: "model"
|
|
13135
|
+
}), Array.isArray(e.visibleRelationGroups) ? this.setVisibleRelationGroups(e.visibleRelationGroups, {
|
|
13136
|
+
emit: !1,
|
|
13137
|
+
source: "model"
|
|
13138
|
+
}) : this.visibleRelationGroups && this.setVisibleRelationGroups(null, {
|
|
13089
13139
|
emit: !1,
|
|
13090
13140
|
source: "model"
|
|
13091
13141
|
}), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
|
|
13092
13142
|
let t = e.navigation?.onSelect ?? e.selectionNavigation;
|
|
13093
|
-
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") &&
|
|
13143
|
+
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") && Dl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
|
|
13094
13144
|
emit: !1,
|
|
13095
13145
|
source: "model"
|
|
13096
13146
|
}), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
|
|
@@ -13103,10 +13153,10 @@ var pu = class extends HTMLElement {
|
|
|
13103
13153
|
}));
|
|
13104
13154
|
}
|
|
13105
13155
|
_containerEntityIds() {
|
|
13106
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13156
|
+
return (this.modelData?.entities || []).filter((e) => wl(e.type)).map((e) => e.id);
|
|
13107
13157
|
}
|
|
13108
13158
|
_declaredOpenContainerIds() {
|
|
13109
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13159
|
+
return (this.modelData?.entities || []).filter((e) => wl(e.type) && e.open === !0).map((e) => e.id);
|
|
13110
13160
|
}
|
|
13111
13161
|
_emitContainerStateChange(e, t = {}) {
|
|
13112
13162
|
if (!e?.changed || t.emit === !1) return;
|
|
@@ -13164,7 +13214,7 @@ var pu = class extends HTMLElement {
|
|
|
13164
13214
|
}
|
|
13165
13215
|
_commitModelChange(e, t = {}, n = {}) {
|
|
13166
13216
|
let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
|
|
13167
|
-
this.modelData =
|
|
13217
|
+
this.modelData = ql(this.modelData);
|
|
13168
13218
|
let o = this._syncInitialContainerState({
|
|
13169
13219
|
refresh: !1,
|
|
13170
13220
|
emit: !1,
|
|
@@ -13181,7 +13231,7 @@ var pu = class extends HTMLElement {
|
|
|
13181
13231
|
}
|
|
13182
13232
|
updateModel(e = {}, t = {}) {
|
|
13183
13233
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
|
|
13184
|
-
let n = this.modelData ||
|
|
13234
|
+
let n = this.modelData || ql({}), r = JSON.stringify(n.render?.camera || null), i = {
|
|
13185
13235
|
...n,
|
|
13186
13236
|
...e,
|
|
13187
13237
|
palette: e.palette ? {
|
|
@@ -13192,11 +13242,11 @@ var pu = class extends HTMLElement {
|
|
|
13192
13242
|
entities: Array.isArray(e.entities) ? e.entities : n.entities,
|
|
13193
13243
|
relations: Array.isArray(e.relations) ? e.relations : n.relations
|
|
13194
13244
|
};
|
|
13195
|
-
return this.modelData =
|
|
13245
|
+
return this.modelData = ql(i), this.theme = this.modelData.theme, this._commitModelChange("model-update", { patch: e }, t), this._applyModelRenderOptions(), JSON.stringify(this.modelData.render?.camera || null) !== r && this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: t.animateCamera !== !1 }), this;
|
|
13196
13246
|
}
|
|
13197
13247
|
addEntity(e, t = {}) {
|
|
13198
13248
|
if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
|
|
13199
|
-
if (this.modelData ||=
|
|
13249
|
+
if (this.modelData ||= ql({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
|
|
13200
13250
|
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
|
|
13201
13251
|
return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
|
|
13202
13252
|
}
|
|
@@ -13270,13 +13320,13 @@ var pu = class extends HTMLElement {
|
|
|
13270
13320
|
}, t);
|
|
13271
13321
|
}
|
|
13272
13322
|
zoomIn() {
|
|
13273
|
-
return this.targetZoom = Math.min(
|
|
13323
|
+
return this.targetZoom = Math.min(il, this.targetZoom * 1.18), this.invalidate(), this;
|
|
13274
13324
|
}
|
|
13275
13325
|
zoomOut() {
|
|
13276
13326
|
return this.targetZoom = Math.max(rl, this.targetZoom / 1.18), this.invalidate(), this;
|
|
13277
13327
|
}
|
|
13278
13328
|
setSelectionNavigation(e) {
|
|
13279
|
-
let t =
|
|
13329
|
+
let t = El(e);
|
|
13280
13330
|
return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
|
|
13281
13331
|
}
|
|
13282
13332
|
focusSelection(e = {}) {
|
|
@@ -13289,7 +13339,7 @@ var pu = class extends HTMLElement {
|
|
|
13289
13339
|
return t ? (this.targetFocus.copy(t), this.targetZoom = n, e.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this) : this;
|
|
13290
13340
|
}
|
|
13291
13341
|
_applySelectionNavigation(e = this.selectionNavigation) {
|
|
13292
|
-
let t =
|
|
13342
|
+
let t = El(e);
|
|
13293
13343
|
if (t === "preserve") return this;
|
|
13294
13344
|
let n = this.targetZoom;
|
|
13295
13345
|
return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
|
|
@@ -13328,7 +13378,7 @@ var pu = class extends HTMLElement {
|
|
|
13328
13378
|
if (!(a > 1e-6)) return this;
|
|
13329
13379
|
this.yaw = Math.atan2(i.x, i.z), this.pitch = Math.asin(Math.max(-1, Math.min(1, i.y / a)));
|
|
13330
13380
|
let o = Number(e.zoom), s = Number.isFinite(o) && o > 0 ? o : this._baseCameraDistance() / a;
|
|
13331
|
-
return this.targetFocus.copy(r), this.targetZoom = Math.max(rl, Math.min(
|
|
13381
|
+
return this.targetFocus.copy(r), this.targetZoom = Math.max(rl, Math.min(il, s)), t.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this;
|
|
13332
13382
|
}
|
|
13333
13383
|
restoreInitialCamera(e = {}) {
|
|
13334
13384
|
let t = this.modelData?.render?.camera;
|
|
@@ -13345,7 +13395,7 @@ var pu = class extends HTMLElement {
|
|
|
13345
13395
|
t.expandByPoint(n.clone().sub(r)), t.expandByPoint(n.clone().add(r));
|
|
13346
13396
|
}
|
|
13347
13397
|
let n = t.isEmpty() ? new U() : t.getCenter(new U()), r = t.isEmpty() ? new U(1, 1, 1) : t.getSize(new U()), i = Math.max(1, r.length() / 2), a = de.degToRad(this.camera.fov), o = i / Math.sin(a / 2) * 1.12, s = this._baseCameraDistance();
|
|
13348
|
-
return this.targetZoom = Math.max(rl, Math.min(
|
|
13398
|
+
return this.targetZoom = Math.max(rl, Math.min(il, s / o)), this.targetFocus.copy(n), e.animate === !1 && (this.zoom = this.targetZoom, this.focus.copy(this.targetFocus)), this.invalidate(), this;
|
|
13349
13399
|
}
|
|
13350
13400
|
frontView() {
|
|
13351
13401
|
return this.yaw = 0, this.pitch = 0, this.invalidate(), this;
|
|
@@ -13361,7 +13411,7 @@ var pu = class extends HTMLElement {
|
|
|
13361
13411
|
return this.setShellLabels(!this.showShellLabels);
|
|
13362
13412
|
}
|
|
13363
13413
|
setItemFacing(e = "camera", t = {}) {
|
|
13364
|
-
let n =
|
|
13414
|
+
let n = Dl(e), r = n !== this.itemFacing;
|
|
13365
13415
|
return this.itemFacing = n, this.getAttribute("item-facing") !== n && this.setAttribute("item-facing", n), this._syncItemFacingToolbar(), this._applyItemFacing(), this.invalidate(), r && t.emit !== !1 && this._emit("lc-item-facing-change", {
|
|
13366
13416
|
mode: n,
|
|
13367
13417
|
source: t.source || "api"
|
|
@@ -13371,7 +13421,7 @@ var pu = class extends HTMLElement {
|
|
|
13371
13421
|
return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
|
|
13372
13422
|
}
|
|
13373
13423
|
_applyItemFacing() {
|
|
13374
|
-
if (this.camera) for (let e of this.nodes.values()) e.group && !
|
|
13424
|
+
if (this.camera) for (let e of this.nodes.values()) e.group && !wl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
|
|
13375
13425
|
}
|
|
13376
13426
|
isContainerOpen(e) {
|
|
13377
13427
|
return this._containerEntityIds().includes(e) && this.open.has(e);
|
|
@@ -13386,14 +13436,14 @@ var pu = class extends HTMLElement {
|
|
|
13386
13436
|
setContainerOpen(e, t = !0, n = {}) {
|
|
13387
13437
|
let r = this.modelData?.entities?.find((t) => t.id === e);
|
|
13388
13438
|
if (!r) throw Error(`No existe una entidad con id "${e}".`);
|
|
13389
|
-
if (!
|
|
13439
|
+
if (!wl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
|
|
13390
13440
|
let i = new Set(this.open);
|
|
13391
13441
|
if (t) i.add(e);
|
|
13392
13442
|
else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
|
|
13393
13443
|
let n = t.parent, r = /* @__PURE__ */ new Set();
|
|
13394
13444
|
for (; n && !r.has(n);) {
|
|
13395
13445
|
if (r.add(n), n === e) {
|
|
13396
|
-
|
|
13446
|
+
wl(t.type) && i.delete(t.id);
|
|
13397
13447
|
break;
|
|
13398
13448
|
}
|
|
13399
13449
|
n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
|
|
@@ -13430,13 +13480,13 @@ var pu = class extends HTMLElement {
|
|
|
13430
13480
|
this.setTheme(e);
|
|
13431
13481
|
}
|
|
13432
13482
|
get theme() {
|
|
13433
|
-
return this._theme ||
|
|
13483
|
+
return this._theme || Nl();
|
|
13434
13484
|
}
|
|
13435
13485
|
set theme(e) {
|
|
13436
|
-
this._theme =
|
|
13486
|
+
this._theme = Nl(e), this.shadowRoot && this._applyTheme();
|
|
13437
13487
|
}
|
|
13438
13488
|
setTheme(e = {}) {
|
|
13439
|
-
return this.theme =
|
|
13489
|
+
return this.theme = Ml(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
|
|
13440
13490
|
}
|
|
13441
13491
|
_applyTheme() {
|
|
13442
13492
|
let e = this.theme, t = this.style;
|
|
@@ -13467,7 +13517,7 @@ var pu = class extends HTMLElement {
|
|
|
13467
13517
|
this._loading = !0, this._pendingSelection = null;
|
|
13468
13518
|
try {
|
|
13469
13519
|
let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
|
|
13470
|
-
this.modelData =
|
|
13520
|
+
this.modelData = ql(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
|
|
13471
13521
|
...this.modelData.palette,
|
|
13472
13522
|
...this._pendingPalette
|
|
13473
13523
|
}, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
|
|
@@ -13498,9 +13548,9 @@ var pu = class extends HTMLElement {
|
|
|
13498
13548
|
}
|
|
13499
13549
|
_applyLighting() {
|
|
13500
13550
|
if (!this.ambientLight || !this.directionalLight) return;
|
|
13501
|
-
let e = this.theme?.lighting ||
|
|
13551
|
+
let e = this.theme?.lighting || jl.lighting;
|
|
13502
13552
|
this.ambientLight.color.set(e.ambientSky), this.ambientLight.groundColor.set(e.ambientGround), this.ambientLight.intensity = Number(e.ambient) || 0, this.directionalLight.color.set(e.directionalColor), this.directionalLight.intensity = Number(e.directional) || 0;
|
|
13503
|
-
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition :
|
|
13553
|
+
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : jl.lighting.directionalPosition;
|
|
13504
13554
|
this.directionalLight.position.fromArray(t);
|
|
13505
13555
|
}
|
|
13506
13556
|
_worldPosition(e, t = /* @__PURE__ */ new Set()) {
|
|
@@ -13537,7 +13587,7 @@ var pu = class extends HTMLElement {
|
|
|
13537
13587
|
...e.geometryPalette || {},
|
|
13538
13588
|
...e.geometryPaletteOverrides || {}
|
|
13539
13589
|
};
|
|
13540
|
-
n.material.color.set(
|
|
13590
|
+
n.material.color.set(tu(n.value, r, t)), n.material.emissive && n.emissiveValue && n.material.emissive.set(tu(n.emissiveValue, r, "#000000"));
|
|
13541
13591
|
}
|
|
13542
13592
|
}
|
|
13543
13593
|
}
|
|
@@ -13550,19 +13600,19 @@ var pu = class extends HTMLElement {
|
|
|
13550
13600
|
for (let e of this.modelData.entities) {
|
|
13551
13601
|
let t = this.nodes.get(e.id);
|
|
13552
13602
|
t.group = new Qn(), t.group.position.copy(this._worldPosition(t));
|
|
13553
|
-
let n = e.geometry || "box", r =
|
|
13603
|
+
let n = e.geometry || "box", r = Cl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
|
|
13554
13604
|
i && this.dispatchEvent(new CustomEvent("lc-warning", { detail: {
|
|
13555
13605
|
code: "GEOMETRY_NOT_REGISTERED",
|
|
13556
13606
|
geometry: n,
|
|
13557
13607
|
entityId: e.id
|
|
13558
13608
|
} }));
|
|
13559
|
-
let o = r?.primitive || n, s = r && !r.primitive && !
|
|
13609
|
+
let o = r?.primitive || n, s = r && !r.primitive && !wl(e.type);
|
|
13560
13610
|
if (t.geometryDefinition = r || null, t.geometryMissing = i, t.geometryPalette = r?.palette || {}, t.geometryPaletteOverrides = e.geometryPalette || e.geometry_palette || {}, t.ports = {
|
|
13561
13611
|
...r?.anchors || {},
|
|
13562
13612
|
...e.ports || {}
|
|
13563
13613
|
}, s) {
|
|
13564
13614
|
try {
|
|
13565
|
-
let n =
|
|
13615
|
+
let n = lu(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
|
|
13566
13616
|
n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
|
|
13567
13617
|
if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
|
|
13568
13618
|
e.userData.node = t;
|
|
@@ -13583,7 +13633,7 @@ var pu = class extends HTMLElement {
|
|
|
13583
13633
|
entityId: e.id,
|
|
13584
13634
|
error: r
|
|
13585
13635
|
} }));
|
|
13586
|
-
let i =
|
|
13636
|
+
let i = $l(Ql("box"));
|
|
13587
13637
|
t.material = new ia({
|
|
13588
13638
|
color: "#ed8f98",
|
|
13589
13639
|
roughness: .72,
|
|
@@ -13592,13 +13642,13 @@ var pu = class extends HTMLElement {
|
|
|
13592
13642
|
}
|
|
13593
13643
|
t.labelSize = new U().fromArray(e.s);
|
|
13594
13644
|
} else {
|
|
13595
|
-
let n = o === "box" && Number(e.radius) > 0, r =
|
|
13596
|
-
n ||
|
|
13645
|
+
let n = o === "box" && Number(e.radius) > 0, r = Ql(o, e.radius, e.segments, e.s);
|
|
13646
|
+
n || $l(r), t.material = new ia({
|
|
13597
13647
|
color: a,
|
|
13598
13648
|
roughness: .72,
|
|
13599
13649
|
metalness: .06,
|
|
13600
13650
|
transparent: !0,
|
|
13601
|
-
opacity:
|
|
13651
|
+
opacity: wl(e.type) ? .96 : 1
|
|
13602
13652
|
}), t.mesh = new An(r, t.material), t.mesh.scale.fromArray(n ? [
|
|
13603
13653
|
1,
|
|
13604
13654
|
1,
|
|
@@ -13613,7 +13663,7 @@ var pu = class extends HTMLElement {
|
|
|
13613
13663
|
1
|
|
13614
13664
|
] : e.s), t.group.add(t.edge);
|
|
13615
13665
|
}
|
|
13616
|
-
t.label =
|
|
13666
|
+
t.label = mu(e.name, a, t.labelSize, e.type, this.showShellLabels), t.labelAnchor = fu(e, this.modelData.style), t.label.userData.node = t, t.label.traverse((e) => {
|
|
13617
13667
|
e.userData.node = t;
|
|
13618
13668
|
}), t.group.add(t.label), this.scene.add(t.group);
|
|
13619
13669
|
}
|
|
@@ -13648,36 +13698,68 @@ var pu = class extends HTMLElement {
|
|
|
13648
13698
|
return i.add(s.multiplyScalar(u));
|
|
13649
13699
|
}
|
|
13650
13700
|
_activeRelationIndexes() {
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13701
|
+
let e = (e) => e.filter((e) => {
|
|
13702
|
+
let t = this.relations[e]?.group;
|
|
13703
|
+
return !t || !this.visibleRelationGroups || this.visibleRelationGroups.has(t);
|
|
13704
|
+
});
|
|
13705
|
+
if (this.relationMode === "all") return e(this.relations.map((e, t) => t));
|
|
13706
|
+
if (this.selectedRelationIndex !== null && this.relationMode === "selected") return e([this.selectedRelationIndex]);
|
|
13707
|
+
if (this.relationMode === "selected") return this.selected ? e(this.relations.map((e, t) => e.from === this.selected.id || e.to === this.selected.id ? t : -1).filter((e) => e >= 0)) : [];
|
|
13654
13708
|
if (!["callers", "called"].includes(this.relationMode)) return [];
|
|
13655
|
-
let
|
|
13656
|
-
return
|
|
13709
|
+
let t = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex], n = this.selected?.id || (this.relationMode === "callers" ? t?.to : t?.from);
|
|
13710
|
+
return n ? e(this._recursiveRelationIndexes(n, this.relationMode)) : [];
|
|
13657
13711
|
}
|
|
13658
13712
|
_recursiveRelationIndexes(e, t) {
|
|
13659
13713
|
let n = [e], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
13660
13714
|
for (; n.length;) {
|
|
13661
13715
|
let e = n.shift();
|
|
13662
13716
|
e && !r.has(e) && (r.add(e), this.relations.forEach((a, o) => {
|
|
13663
|
-
let s =
|
|
13717
|
+
let s = Pl(a) === "bidirectional", c = null;
|
|
13664
13718
|
t === "callers" ? a.to === e ? c = a.from : s && a.from === e && (c = a.to) : a.from === e ? c = a.to : s && a.to === e && (c = a.from), c && (i.add(o), r.has(c) || n.push(c));
|
|
13665
13719
|
}));
|
|
13666
13720
|
}
|
|
13667
13721
|
return [...i].sort((e, t) => e - t);
|
|
13668
13722
|
}
|
|
13669
13723
|
_createRelationMarker(e, t, n, r = this.relationMarker) {
|
|
13670
|
-
let i =
|
|
13724
|
+
let i = Ol(r), a = new An(i === "ring" ? new na(.068, .018, 8, 20) : new Dr(.09, .22, 12), new rn({
|
|
13671
13725
|
color: e,
|
|
13672
13726
|
transparent: !0,
|
|
13673
13727
|
opacity: t,
|
|
13674
13728
|
depthWrite: !1
|
|
13675
13729
|
})), o = i === "ring" ? new U(0, 0, 1) : new U(0, 1, 0);
|
|
13676
|
-
return a.quaternion.setFromUnitVectors(o, n), a.userData.relationMarker = i, a;
|
|
13730
|
+
return a.quaternion.setFromUnitVectors(o, n), a.userData.relationMarker = i, a.userData.markerAxis = o, a;
|
|
13731
|
+
}
|
|
13732
|
+
_relationColor(e) {
|
|
13733
|
+
let t = this.modelData?.palette || el, n = (this.modelData?.relationGroups || []).find((t) => t.id === e.group)?.color;
|
|
13734
|
+
return new X(t[n] || n || t.connection || el.connection);
|
|
13735
|
+
}
|
|
13736
|
+
_relationBundleIndexes(e = this.selectedRelationIndex) {
|
|
13737
|
+
let t = this._relationIndex(e), n = this.relations[t];
|
|
13738
|
+
if (!n) return [];
|
|
13739
|
+
let r = [n.from, n.to].sort().join("\0");
|
|
13740
|
+
return this.relations.map((e, t) => [e, t]).filter(([e]) => [e.from, e.to].sort().join("\0") === r).map(([, e]) => e);
|
|
13741
|
+
}
|
|
13742
|
+
getRelationBundle(e = this.selectedRelationIndex) {
|
|
13743
|
+
return this._relationBundleIndexes(e).map((e) => ({
|
|
13744
|
+
index: e,
|
|
13745
|
+
relation: this._publicRelation(e)
|
|
13746
|
+
}));
|
|
13747
|
+
}
|
|
13748
|
+
_relationCurve(e, t, n = 0, r = 1) {
|
|
13749
|
+
if (r < 2) return new ri(e, t);
|
|
13750
|
+
let i = t.clone().sub(e), a = i.length(), o = i.clone().normalize(), s = Math.abs(o.y) < .88 ? new U(0, 1, 0) : new U(1, 0, 0), c = o.clone().cross(s).normalize(), l = o.clone().cross(c).normalize(), u = n / r * Math.PI * 2, d = Math.min(.15, .055 + Math.min(r, 8) * .011), f = c.multiplyScalar(Math.cos(u) * d).add(l.multiplyScalar(Math.sin(u) * d)), p = Math.min(.22, Math.max(.12, .65 / Math.max(a, .01)));
|
|
13751
|
+
return new Ur([
|
|
13752
|
+
e.clone(),
|
|
13753
|
+
e.clone().lerp(t, p),
|
|
13754
|
+
e.clone().lerp(t, .38).add(f),
|
|
13755
|
+
e.clone().lerp(t, .62).add(f),
|
|
13756
|
+
e.clone().lerp(t, 1 - p),
|
|
13757
|
+
t.clone()
|
|
13758
|
+
]);
|
|
13677
13759
|
}
|
|
13678
13760
|
_rebuildRelations() {
|
|
13679
13761
|
this._clearRelationGroup();
|
|
13680
|
-
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new
|
|
13762
|
+
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = /* @__PURE__ */ new Map();
|
|
13681
13763
|
for (let r of e) {
|
|
13682
13764
|
let e = this.relations[r], i = this.nodes.get(e.from), a = this.nodes.get(e.to);
|
|
13683
13765
|
if (!i || !a) continue;
|
|
@@ -13685,48 +13767,79 @@ var pu = class extends HTMLElement {
|
|
|
13685
13767
|
if (!o && this.focusFilter.effect === "hide") continue;
|
|
13686
13768
|
let s = o ? 1 : this.focusFilter.opacity, c = this._endpoint(i, a, !0, e), l = this._endpoint(a, i, !1, e), u = l.clone().sub(c);
|
|
13687
13769
|
if (u.lengthSq() < .01) continue;
|
|
13688
|
-
let d =
|
|
13689
|
-
|
|
13690
|
-
|
|
13770
|
+
let d = [e.from, e.to].sort().join("\0");
|
|
13771
|
+
n.has(d) || n.set(d, []), n.get(d).push({
|
|
13772
|
+
index: r,
|
|
13773
|
+
relation: e,
|
|
13774
|
+
start: c,
|
|
13775
|
+
end: l,
|
|
13776
|
+
delta: u,
|
|
13777
|
+
focusAlpha: s
|
|
13778
|
+
});
|
|
13779
|
+
}
|
|
13780
|
+
for (let e of n.values()) {
|
|
13781
|
+
e.sort((e, t) => e.index - t.index);
|
|
13782
|
+
let t = e.length > 1;
|
|
13783
|
+
if (t) {
|
|
13784
|
+
let { start: t, end: n, focusAlpha: r } = e[0], i = e.some((e) => e.index === this.selectedRelationIndex), a = new X(this.modelData?.palette.relation_bundle || "#7693a3");
|
|
13785
|
+
i && a.lerp(new X(16777215), .25);
|
|
13786
|
+
let o = new An(new ra(new ri(t, n), 12, .095 + Math.min(.07, e.length * .012), 10, !1), new rn({
|
|
13787
|
+
color: a,
|
|
13691
13788
|
transparent: !0,
|
|
13692
|
-
opacity:
|
|
13789
|
+
opacity: (i ? .34 : .22) * r,
|
|
13693
13790
|
depthTest: !0,
|
|
13694
|
-
depthWrite: !1
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
return i.renderOrder = il, this.relationGroup.add(i), i;
|
|
13699
|
-
}, m = new An(new ra(new ri(c, l), 10, .16, 6, !1), new rn({
|
|
13700
|
-
transparent: !0,
|
|
13701
|
-
opacity: 0,
|
|
13702
|
-
colorWrite: !1,
|
|
13703
|
-
depthTest: !1,
|
|
13704
|
-
depthWrite: !1,
|
|
13705
|
-
side: 2
|
|
13706
|
-
}));
|
|
13707
|
-
if (m.userData.relationIndex = r, m.userData.relationPick = !0, m.frustumCulled = !1, this.relationGroup.add(m), d === "broken") {
|
|
13708
|
-
p(14965603);
|
|
13709
|
-
let e = u.clone().normalize(), t = Math.min(.18, Math.max(.07, u.length() * .018));
|
|
13710
|
-
for (let n = 0; n < 3; n++) {
|
|
13711
|
-
let i = c.clone().lerp(l, (n + 1) / 4), a = this._createRelationMarker(14965603, (f ? 1 : .9) * s, e);
|
|
13712
|
-
a.userData.relationIndex = r, a.userData.phase = n / 3, a.userData.oscillate = !0, a.userData.start = i.clone().sub(e.clone().multiplyScalar(t)), a.userData.end = i.clone().add(e.clone().multiplyScalar(t)), a.renderOrder = il, this.relationGroup.add(a);
|
|
13713
|
-
}
|
|
13714
|
-
continue;
|
|
13715
|
-
}
|
|
13716
|
-
p(n);
|
|
13717
|
-
let h = u.clone().normalize();
|
|
13718
|
-
for (let e = 0; e < 4; e++) {
|
|
13719
|
-
let t = d === "bidirectional" && e % 2 ? -1 : 1, i = this._createRelationMarker(n, (f ? 1 : .9) * s, h.clone().multiplyScalar(t));
|
|
13720
|
-
i.userData.relationIndex = r, i.userData.phase = e / 4, i.userData.direction = t, i.userData.start = c.clone(), i.userData.end = l.clone(), i.renderOrder = il, this.relationGroup.add(i);
|
|
13791
|
+
depthWrite: !1,
|
|
13792
|
+
side: 2
|
|
13793
|
+
}));
|
|
13794
|
+
o.userData.relationBundle = e.map((e) => e.index), o.renderOrder = 14, this.relationGroup.add(o);
|
|
13721
13795
|
}
|
|
13796
|
+
e.forEach((n, r) => {
|
|
13797
|
+
let { index: i, relation: a, start: o, end: s, delta: c, focusAlpha: l } = n, u = Pl(a), d = i === this.selectedRelationIndex, f = this._relationCurve(o, s, r, e.length), p = u === "broken" ? new X(14965603) : this._relationColor(a), m = (e, n = .055, r = .88) => {
|
|
13798
|
+
let a = new rn({
|
|
13799
|
+
color: e,
|
|
13800
|
+
transparent: !0,
|
|
13801
|
+
opacity: r * l,
|
|
13802
|
+
depthTest: !0,
|
|
13803
|
+
depthWrite: !1
|
|
13804
|
+
});
|
|
13805
|
+
d && (a.color.lerp(new X(16777215), .28), a.opacity = 1);
|
|
13806
|
+
let o = new An(new ra(f, t ? 20 : 10, d ? n * 1.45 : n, 6, !1), a);
|
|
13807
|
+
return o.renderOrder = al, o.userData.relationIndex = i, o.userData.relationConductor = t, this.relationGroup.add(o), o;
|
|
13808
|
+
}, h = new An(new ra(f, t ? 20 : 10, t ? .095 : .16, 6, !1), new rn({
|
|
13809
|
+
transparent: !0,
|
|
13810
|
+
opacity: 0,
|
|
13811
|
+
colorWrite: !1,
|
|
13812
|
+
depthTest: !1,
|
|
13813
|
+
depthWrite: !1,
|
|
13814
|
+
side: 2
|
|
13815
|
+
}));
|
|
13816
|
+
if (h.userData.relationIndex = i, h.userData.relationPick = !0, h.frustumCulled = !1, this.relationGroup.add(h), u === "broken") {
|
|
13817
|
+
m(p, t ? .038 : .055);
|
|
13818
|
+
let e = Math.min(.18, Math.max(.07, c.length() * .018)), n = t ? 1 : 3;
|
|
13819
|
+
for (let t = 0; t < n; t++) {
|
|
13820
|
+
let r = (t + 1) / (n + 1), a = f.getPoint(r), o = f.getTangent(r).normalize(), s = this._createRelationMarker(p, (d ? 1 : .9) * l, o);
|
|
13821
|
+
s.userData.relationIndex = i, s.userData.phase = t / n, s.userData.oscillate = !0, s.userData.start = a.clone().sub(o.clone().multiplyScalar(e)), s.userData.end = a.clone().add(o.clone().multiplyScalar(e)), s.renderOrder = al, this.relationGroup.add(s);
|
|
13822
|
+
}
|
|
13823
|
+
return;
|
|
13824
|
+
}
|
|
13825
|
+
m(p, t ? .038 : .055);
|
|
13826
|
+
let g = t ? u === "bidirectional" ? 2 : 1 : 4;
|
|
13827
|
+
for (let e = 0; e < g; e++) {
|
|
13828
|
+
let t = u === "bidirectional" && e % 2 ? -1 : 1, n = (e + 1) / (g + 1), r = f.getTangent(n).normalize(), a = this._createRelationMarker(p, (d ? 1 : .9) * l, r.clone().multiplyScalar(t));
|
|
13829
|
+
a.userData.relationIndex = i, a.userData.phase = e / g, a.userData.direction = t, a.userData.start = o.clone(), a.userData.end = s.clone(), a.userData.curve = f, a.renderOrder = al, this.relationGroup.add(a);
|
|
13830
|
+
}
|
|
13831
|
+
});
|
|
13722
13832
|
}
|
|
13723
13833
|
}
|
|
13724
13834
|
_renderPanel() {
|
|
13725
13835
|
if (!this.modelData) return;
|
|
13726
13836
|
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
|
|
13727
13837
|
if (e) {
|
|
13728
|
-
let t =
|
|
13729
|
-
|
|
13838
|
+
let t = Pl(e), n = (this.modelData.relationGroups || []).find((t) => t.id === e.group), r = new Map((this.modelData.relationGroups || []).map((e) => [e.id, e])), i = this.getRelationBundle(this.selectedRelationIndex), a = e.text ? "<p>" + Ul(e.text) + "</p>" : "", o = Wl(e.url), s = n ? "<h3>GRUPO</h3><p>" + Ul(n.label || n.id) + "</p>" : "", c = i.map(({ index: e, relation: t }) => {
|
|
13839
|
+
let n = r.get(t.group), i = [n?.label || n?.id || "Sin grupo", Pl(t)].join(" · ");
|
|
13840
|
+
return "<button class=\"relation" + (e === this.selectedRelationIndex ? " selected" : "") + "\" data-action=\"relation\" data-relation-index=\"" + e + "\"><strong>" + Ul(t.label || `${t.from} → ${t.to}`) + "</strong><small>" + Ul(i) + "</small></button>";
|
|
13841
|
+
}).join(""), l = i.length === 1 ? "1 conexión" : `${i.length} conexiones`;
|
|
13842
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Ul(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Ul(e.from) + " → " + Ul(e.to) + "</div>" + a + o + s + "<h3>MODO</h3><p>" + Ul(t) + "</p><h3>TUBO VIRTUAL</h3><p>" + Ul(`${e.from} ↔ ${e.to} · ${l}`) + "</p>" + c, this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this._applyTheme();
|
|
13730
13843
|
return;
|
|
13731
13844
|
}
|
|
13732
13845
|
let t = this.selected;
|
|
@@ -13736,11 +13849,11 @@ var pu = class extends HTMLElement {
|
|
|
13736
13849
|
}
|
|
13737
13850
|
let n = this.relations.filter((e) => e.from === t.id || e.to === t.id), r = this.modelData.entities.filter((e) => e.parent === t.id), i = [], a = /* @__PURE__ */ new Set(), o = t;
|
|
13738
13851
|
for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
|
|
13739
|
-
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" +
|
|
13740
|
-
let n = this.relations.indexOf(e), r = e.text ? "<small>" +
|
|
13741
|
-
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" +
|
|
13852
|
+
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + Ul(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Ul(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
|
|
13853
|
+
let n = this.relations.indexOf(e), r = e.text ? "<small>" + Ul(e.text) + "</small>" : "";
|
|
13854
|
+
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Ul(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Ul(e.from) + " → " + Ul(e.to) + "</small>" + r + "</button>";
|
|
13742
13855
|
}).join("");
|
|
13743
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" +
|
|
13856
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" + Ul(wl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Ul(t.name) + "</h2><div class=\"sub\">" + Ul(t.sub || "") + "</div><p>" + Ul(t.text || "") + "</p>" + Wl(t.url) + (wl(t.type) ? "<button data-action=\"toggle-shell\">" + (this.open.has(t.id) ? "Cerrar bloque" : "Abrir bloque") + "</button>" : "") + (r.length ? "<h3>CONTIENE</h3><p>" + r.length + " pieza(s) interna(s).</p>" : "") + "<h3>RELACIONES</h3>" + (c || "<p>No hay relaciones directas.</p>"), this.panel.querySelectorAll("[data-action=\"overview\"]").forEach((e) => e.addEventListener("click", () => this.reset())), this.panel.querySelectorAll("[data-action=\"path\"]").forEach((e) => e.addEventListener("click", () => this.select(e.dataset.id))), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelector("[data-action=\"toggle-shell\"]")?.addEventListener("click", () => {
|
|
13744
13857
|
this.toggleContainer(t.id, { source: "panel" });
|
|
13745
13858
|
}), this._applyTheme();
|
|
13746
13859
|
}
|
|
@@ -13749,7 +13862,7 @@ var pu = class extends HTMLElement {
|
|
|
13749
13862
|
if (!n) return this;
|
|
13750
13863
|
let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
|
|
13751
13864
|
for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
|
|
13752
|
-
return this.selected = n, this.selectedRelationIndex = null,
|
|
13865
|
+
return this.selected = n, this.selectedRelationIndex = null, wl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
|
|
13753
13866
|
refresh: !1,
|
|
13754
13867
|
source: t.source || "api"
|
|
13755
13868
|
}), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncRelationToolbar(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
|
|
@@ -13783,10 +13896,23 @@ var pu = class extends HTMLElement {
|
|
|
13783
13896
|
}), this;
|
|
13784
13897
|
}
|
|
13785
13898
|
setRelationMode(e) {
|
|
13786
|
-
this.relationMode =
|
|
13899
|
+
this.relationMode = kl(e), this.setAttribute("relation-mode", this.relationMode), this._syncRelationToolbar(), this._syncFocusToolbar(), this._rebuildRelations(), this.invalidate(), this.dispatchEvent(new CustomEvent("lc-relation-mode", { detail: { mode: this.relationMode } }));
|
|
13900
|
+
}
|
|
13901
|
+
setVisibleRelationGroups(e = null, t = {}) {
|
|
13902
|
+
let n = new Set((this.modelData?.relationGroups || []).map((e) => e.id)), r = e == null ? null : new Set(Array.from(e).map((e) => String(e)).filter((e) => n.has(e))), i = r && n.size > 0 && r.size === n.size ? null : r, a = this.visibleRelationGroups ? [...this.visibleRelationGroups].sort() : null, o = i ? [...i].sort() : null, s = JSON.stringify(a) !== JSON.stringify(o);
|
|
13903
|
+
return this.visibleRelationGroups = i, this._syncRelationToolbar(), s && this.ready !== !1 && (this._rebuildRelations(), this.invalidate()), s && t.emit !== !1 && this._emit("lc-relation-groups-change", {
|
|
13904
|
+
groups: o,
|
|
13905
|
+
source: t.source || "api"
|
|
13906
|
+
}), this;
|
|
13907
|
+
}
|
|
13908
|
+
toggleRelationGroup(e, t = {}) {
|
|
13909
|
+
let n = (this.modelData?.relationGroups || []).map((e) => e.id);
|
|
13910
|
+
if (!n.includes(e)) return this;
|
|
13911
|
+
let r = new Set(this.visibleRelationGroups || n);
|
|
13912
|
+
return r.has(e) ? r.delete(e) : r.add(e), this.setVisibleRelationGroups(r, t);
|
|
13787
13913
|
}
|
|
13788
13914
|
setRelationMarker(e, t = {}) {
|
|
13789
|
-
let n =
|
|
13915
|
+
let n = Ol(e), r = n !== this.relationMarker;
|
|
13790
13916
|
return this.relationMarker = n, this.getAttribute?.("relation-marker") !== n && this.setAttribute?.("relation-marker", n), r && this.ready && (this._rebuildRelations(), this.invalidate()), r && t.emit !== !1 && this._emit("lc-relation-marker-change", {
|
|
13791
13917
|
marker: n,
|
|
13792
13918
|
source: t.source || "api"
|
|
@@ -13816,20 +13942,20 @@ var pu = class extends HTMLElement {
|
|
|
13816
13942
|
for (let e of this.nodes.values()) {
|
|
13817
13943
|
let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
|
|
13818
13944
|
e.group.visible = n;
|
|
13819
|
-
let r =
|
|
13820
|
-
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material)
|
|
13945
|
+
let r = wl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
|
|
13946
|
+
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) Al(e.material, !0), e.material.opacity = a, e.material.depthWrite = !r, e.material.emissive?.set(e === this.selected ? e.material.color : 0), e.material.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13821
13947
|
else {
|
|
13822
|
-
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite),
|
|
13948
|
+
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite), Al(n, n.userData.atlasBaseTransparent || t < 1), n.depthWrite = n.userData.atlasBaseDepthWrite, n.opacity = n.userData.atlasBaseOpacity * t, n.emissive?.set(e === this.selected ? n.color : 0), n.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13823
13949
|
e._appearanceSelected = e === this.selected;
|
|
13824
13950
|
}
|
|
13825
13951
|
e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
|
|
13826
|
-
let o =
|
|
13952
|
+
let o = wl(e.type) && r, s = o, c = e.label.userData.front, l = e.label.userData.back, u = e.label.userData.top, d = e.label.userData.height, f = e.label.userData.width, p = e.label.userData.textOffsetX || 0;
|
|
13827
13953
|
e.label.userData.textOffsetY;
|
|
13828
|
-
let m = e.labelSize || new U().fromArray(e.s), h =
|
|
13954
|
+
let m = e.labelSize || new U().fromArray(e.s), h = pu(e.labelAnchor, m, f, d);
|
|
13829
13955
|
e.label.visible = n;
|
|
13830
|
-
let g = this._worldPosition(e), _ = this.itemFacing === "camera" && !
|
|
13956
|
+
let g = this._worldPosition(e), _ = this.itemFacing === "camera" && !wl(e.type) || this.camera.position.z >= g.z, v = this.camera.position.y > g.y + .25;
|
|
13831
13957
|
if (h) c.visible = _, l.visible = !_, u.visible = !1, c.scale.setScalar(1), l.scale.setScalar(1), c.position.set(h.x, h.y, m.z / 2 + .025), l.position.set(h.x, h.y, -m.z / 2 - .025), c.rotation.z = h.frontRotation, l.rotation.z = h.backRotation, c.material.color.set(15923964), l.material.color.set(15923964), c.material.opacity = t, l.material.opacity = t;
|
|
13832
|
-
else if (
|
|
13958
|
+
else if (wl(e.type)) {
|
|
13833
13959
|
c.rotation.z = 0, l.rotation.z = 0, c.visible = _ && (!o || s), l.visible = !_ && (!o || s), u.visible = s && v;
|
|
13834
13960
|
let e = s ? .52 : 1;
|
|
13835
13961
|
c.scale.setScalar(e), c.position.x = s ? -m.x / 2 + .18 + f * e / 2 - p * e : 0;
|
|
@@ -13840,7 +13966,12 @@ var pu = class extends HTMLElement {
|
|
|
13840
13966
|
for (let t of this.relationGroup.children) {
|
|
13841
13967
|
if (!t.userData.start) continue;
|
|
13842
13968
|
let n = t.userData.phase || 0, r = t.userData.direction || 1, i = t.userData.oscillate ? .5 + .5 * Math.sin(e * .004 + n * Math.PI * 2) : ((e * 22e-5 * r + n) % 1 + 1) % 1;
|
|
13843
|
-
|
|
13969
|
+
if (t.userData.curve) {
|
|
13970
|
+
let e = i;
|
|
13971
|
+
t.position.copy(t.userData.curve.getPoint(e));
|
|
13972
|
+
let n = t.userData.curve.getTangent(e).normalize().multiplyScalar(r);
|
|
13973
|
+
t.quaternion.setFromUnitVectors(t.userData.markerAxis, n);
|
|
13974
|
+
} else t.position.lerpVectors(t.userData.start, t.userData.end, i);
|
|
13844
13975
|
}
|
|
13845
13976
|
this.renderer.render(this.scene, this.camera), (t > .001 || n > .001 || this.relationGroup.children.length || this.drag) && this.invalidate();
|
|
13846
13977
|
}
|
|
@@ -13848,8 +13979,8 @@ var pu = class extends HTMLElement {
|
|
|
13848
13979
|
let t = this.canvas.getBoundingClientRect();
|
|
13849
13980
|
this.pointer.set((e.clientX - t.left) / t.width * 2 - 1, -(e.clientY - t.top) / t.height * 2 + 1), this.raycaster.setFromCamera(this.pointer, this.camera);
|
|
13850
13981
|
let n = [];
|
|
13851
|
-
for (let e of this.nodes.values()) e.group.visible && (
|
|
13852
|
-
let r = this.raycaster.intersectObjects(n, !0)[0] || null, i = this.relationMode === "none" ? [] : this.relationGroup.children.filter((e) => e.userData?.relationPick), a = this.raycaster.intersectObjects(i, !1)[0] || null;
|
|
13982
|
+
for (let e of this.nodes.values()) e.group.visible && (wl(e.type) && this.open.has(e.id) || n.push(e.pickMesh || e.mesh), e.label?.visible && n.push(...e.label.children.filter((e) => e.visible)));
|
|
13983
|
+
let r = this.raycaster.intersectObjects(n, !0)[0] || null, i = this.relationMode === "none" ? [] : this.relationGroup.children.filter((e) => e.userData?.relationPick || e.userData?.relationBundle), a = this.raycaster.intersectObjects(i, !1)[0] || null;
|
|
13853
13984
|
if (r && (!a || r.distance <= a.distance + .12)) {
|
|
13854
13985
|
let e = r.object;
|
|
13855
13986
|
for (; e;) {
|
|
@@ -13860,6 +13991,14 @@ var pu = class extends HTMLElement {
|
|
|
13860
13991
|
e = e.parent;
|
|
13861
13992
|
}
|
|
13862
13993
|
}
|
|
13994
|
+
if (a?.object.userData?.relationBundle) {
|
|
13995
|
+
let e = a.object.userData.relationBundle;
|
|
13996
|
+
return {
|
|
13997
|
+
kind: "relation",
|
|
13998
|
+
index: e[(e.indexOf(this.selectedRelationIndex) + 1) % e.length],
|
|
13999
|
+
bundle: [...e]
|
|
14000
|
+
};
|
|
14001
|
+
}
|
|
13863
14002
|
return a ? {
|
|
13864
14003
|
kind: "relation",
|
|
13865
14004
|
index: a.object.userData.relationIndex
|
|
@@ -13877,13 +14016,13 @@ var pu = class extends HTMLElement {
|
|
|
13877
14016
|
e.key === "Escape" && (this._closeToolbarMenus(), this.canvas.focus({ preventScroll: !0 }));
|
|
13878
14017
|
}), this.shadowRoot.addEventListener("click", (e) => {
|
|
13879
14018
|
let t = e.target.closest?.("[data-action]"), n = t?.dataset.action;
|
|
13880
|
-
e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "item-facing" && this.toggleItemFacing({ source: "toolbar" }), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-callers" && this.setRelationMode("callers"), n === "relations-called" && this.setRelationMode("called"), n === "relations-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
|
|
14019
|
+
e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "item-facing" && this.toggleItemFacing({ source: "toolbar" }), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-callers" && this.setRelationMode("callers"), n === "relations-called" && this.setRelationMode("called"), n === "relations-none" && this.setRelationMode("none"), n === "relation-group-toggle" && this.toggleRelationGroup(t.dataset.relationGroup, { source: "toolbar" }), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
|
|
13881
14020
|
mode: "connected",
|
|
13882
14021
|
effect: "dim"
|
|
13883
14022
|
}, { source: "toolbar" }), n === "focus-hide" && this.setFocusFilter({
|
|
13884
14023
|
mode: "connected",
|
|
13885
14024
|
effect: "hide"
|
|
13886
|
-
}, { source: "toolbar" }), n === "focus-selection" && this.focusSelection(), n === "focus-layout" && this.setFocusFilter({ layout: this.focusFilter.layout === "reflow" ? "preserve" : "reflow" }, { source: "toolbar" }), t?.closest?.(".toolbar-popover") && this._closeToolbarMenus(), n && this.invalidate();
|
|
14025
|
+
}, { source: "toolbar" }), n === "focus-selection" && this.focusSelection(), n === "focus-layout" && this.setFocusFilter({ layout: this.focusFilter.layout === "reflow" ? "preserve" : "reflow" }, { source: "toolbar" }), t?.closest?.(".toolbar-popover") && n !== "relation-group-toggle" && this._closeToolbarMenus(), n && this.invalidate();
|
|
13887
14026
|
}), this.canvas.addEventListener("contextmenu", (e) => e.preventDefault()), this.canvas.addEventListener("pointerdown", (e) => {
|
|
13888
14027
|
if (e.pointerType !== "touch" && ![
|
|
13889
14028
|
0,
|
|
@@ -13921,7 +14060,7 @@ var pu = class extends HTMLElement {
|
|
|
13921
14060
|
y: e.clientY
|
|
13922
14061
|
}), e.pointerType === "touch" && this.pointers.size >= 2) {
|
|
13923
14062
|
let [e, t] = [...this.pointers.values()], n = (e.x + t.x) / 2, r = (e.y + t.y) / 2, i = Math.max(1, Math.hypot(e.x - t.x, e.y - t.y));
|
|
13924
|
-
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(
|
|
14063
|
+
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(il, Math.max(rl, this.targetZoom * i / Math.max(1, this.drag.distance))), Object.assign(this.drag, {
|
|
13925
14064
|
x: n,
|
|
13926
14065
|
y: r,
|
|
13927
14066
|
distance: i,
|
|
@@ -13992,16 +14131,16 @@ var pu = class extends HTMLElement {
|
|
|
13992
14131
|
navigation: "fit"
|
|
13993
14132
|
});
|
|
13994
14133
|
}), this.canvas.addEventListener("wheel", (e) => {
|
|
13995
|
-
e.preventDefault(), this.targetZoom = Math.min(
|
|
14134
|
+
e.preventDefault(), this.targetZoom = Math.min(il, Math.max(rl, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
|
|
13996
14135
|
}, { passive: !1 });
|
|
13997
14136
|
}
|
|
13998
14137
|
_showError(e) {
|
|
13999
14138
|
let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
|
|
14000
|
-
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" +
|
|
14139
|
+
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Ul(e) + "</div>");
|
|
14001
14140
|
}
|
|
14002
14141
|
};
|
|
14003
|
-
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas",
|
|
14142
|
+
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", gu);
|
|
14004
14143
|
//#endregion
|
|
14005
|
-
export { $c as ATLAS_VERSION, tl as DEFAULT_RELATION_MARKER,
|
|
14144
|
+
export { $c as ATLAS_VERSION, tl as DEFAULT_RELATION_MARKER, gu as LiquidCarsAtlas, nl as RELATION_DISPLAY_MODES, hu as captureRendererFrame, su as createSvgExtrudeGeometry, xl as getGeometryCatalog, Sl as getGeometryPackCatalog, pu as labelPlacementForAnchor, du as normalizeLabelAnchor, ql as normalizeModel, yl as registerGeometryPack, fu as resolveEntityLabelAnchor, bl as unregisterGeometryPack };
|
|
14006
14145
|
|
|
14007
14146
|
//# sourceMappingURL=liquidcars-atlas.js.map
|