@maucwerk/glimmer 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/environment/environment.d.ts +10 -0
- package/dist/environment/sun.d.ts +5 -0
- package/dist/vite/glimmer.mjs +977 -936
- package/dist/vite/glimmer.umd.js +14 -14
- package/package.json +1 -1
package/dist/vite/glimmer.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var _ = (r, e, t) =>
|
|
1
|
+
var Mo = Object.defineProperty;
|
|
2
|
+
var Lo = (r, e, t) => e in r ? Mo(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var _ = (r, e, t) => Lo(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as p from "three";
|
|
5
|
-
import { Controls as
|
|
5
|
+
import { Controls as ko, Vector3 as J, MOUSE as Wt, TOUCH as Bt, Quaternion as is, Spherical as Ki, Vector2 as ke, Ray as Co, Plane as Oo, MathUtils as bi, DataTextureLoader as Do, HalfFloatType as ft, FloatType as Ms, DataUtils as dn, LinearSRGBColorSpace as Pe, LinearFilter as Yt, Loader as wi, RGBAFormat as qi, DataTexture as Io, UVMapping as No, ClampToEdgeWrapping as qs, LinearMipMapLinearFilter as Po, FileLoader as mn, Mesh as ye, ShaderMaterial as Ei, BackSide as Ur, UniformsUtils as Ai, BoxGeometry as Fr, Scene as zo, MeshStandardMaterial as rs, PointLight as jr, MeshBasicMaterial as Ht, TrianglesDrawMode as Uo, TriangleFanDrawMode as Js, TriangleStripDrawMode as Br, InstancedBufferGeometry as Fo, Float32BufferAttribute as Ji, InstancedInterleavedBuffer as Qs, InterleavedBufferAttribute as Et, WireframeGeometry as jo, Box3 as ps, Sphere as Ti, ShaderLib as Qn, UniformsLib as es, Vector4 as In, Line3 as Bo, Matrix4 as pn, LoaderUtils as fn, MeshPhysicalMaterial as qe, Color as lt, SRGBColorSpace as mt, SpotLight as Ho, DirectionalLight as Vo, InstancedMesh as Go, InstancedBufferAttribute as Zo, Object3D as Hr, TextureLoader as Wo, ImageBitmapLoader as Xo, BufferAttribute as at, InterleavedBuffer as $o, LinearMipmapLinearFilter as Vr, NearestMipmapLinearFilter as Yo, LinearMipmapNearestFilter as Ko, NearestMipmapNearestFilter as qo, NearestFilter as Gr, RepeatWrapping as ei, MirroredRepeatWrapping as Jo, PointsMaterial as Qo, Material as Ls, LineBasicMaterial as ea, DoubleSide as ta, PropertyBinding as na, BufferGeometry as Si, SkinnedMesh as sa, LineSegments as Zr, Line as ia, LineLoop as ra, Points as oa, Group as ks, PerspectiveCamera as aa, OrthographicCamera as ca, Skeleton as la, AnimationClip as da, Bone as ua, InterpolateDiscrete as ha, InterpolateLinear as Wr, Texture as Qi, VectorKeyframeTrack as er, NumberKeyframeTrack as tr, QuaternionKeyframeTrack as nr, ColorManagement as ti, FrontSide as fa, Interpolant as ma } from "three";
|
|
6
6
|
var q;
|
|
7
7
|
(function(r) {
|
|
8
8
|
r.assertEqual = (s) => s;
|
|
@@ -39,15 +39,15 @@ var q;
|
|
|
39
39
|
}
|
|
40
40
|
r.joinValues = n, r.jsonStringifyReplacer = (s, i) => typeof i == "bigint" ? i.toString() : i;
|
|
41
41
|
})(q || (q = {}));
|
|
42
|
-
var
|
|
42
|
+
var ni;
|
|
43
43
|
(function(r) {
|
|
44
44
|
r.mergeShapes = (e, t) => ({
|
|
45
45
|
...e,
|
|
46
46
|
...t
|
|
47
47
|
// second overwrites first
|
|
48
48
|
});
|
|
49
|
-
})(
|
|
50
|
-
const
|
|
49
|
+
})(ni || (ni = {}));
|
|
50
|
+
const k = q.arrayToEnum([
|
|
51
51
|
"string",
|
|
52
52
|
"nan",
|
|
53
53
|
"number",
|
|
@@ -71,23 +71,23 @@ const C = q.arrayToEnum([
|
|
|
71
71
|
]), rt = (r) => {
|
|
72
72
|
switch (typeof r) {
|
|
73
73
|
case "undefined":
|
|
74
|
-
return
|
|
74
|
+
return k.undefined;
|
|
75
75
|
case "string":
|
|
76
|
-
return
|
|
76
|
+
return k.string;
|
|
77
77
|
case "number":
|
|
78
|
-
return isNaN(r) ?
|
|
78
|
+
return isNaN(r) ? k.nan : k.number;
|
|
79
79
|
case "boolean":
|
|
80
|
-
return
|
|
80
|
+
return k.boolean;
|
|
81
81
|
case "function":
|
|
82
|
-
return
|
|
82
|
+
return k.function;
|
|
83
83
|
case "bigint":
|
|
84
|
-
return
|
|
84
|
+
return k.bigint;
|
|
85
85
|
case "symbol":
|
|
86
|
-
return
|
|
86
|
+
return k.symbol;
|
|
87
87
|
case "object":
|
|
88
|
-
return Array.isArray(r) ?
|
|
88
|
+
return Array.isArray(r) ? k.array : r === null ? k.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? k.promise : typeof Map < "u" && r instanceof Map ? k.map : typeof Set < "u" && r instanceof Set ? k.set : typeof Date < "u" && r instanceof Date ? k.date : k.object;
|
|
89
89
|
default:
|
|
90
|
-
return
|
|
90
|
+
return k.unknown;
|
|
91
91
|
}
|
|
92
92
|
}, A = q.arrayToEnum([
|
|
93
93
|
"invalid_type",
|
|
@@ -106,7 +106,7 @@ const C = q.arrayToEnum([
|
|
|
106
106
|
"invalid_intersection_types",
|
|
107
107
|
"not_multiple_of",
|
|
108
108
|
"not_finite"
|
|
109
|
-
]),
|
|
109
|
+
]), pa = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
110
110
|
class De extends Error {
|
|
111
111
|
get errors() {
|
|
112
112
|
return this.issues;
|
|
@@ -171,7 +171,7 @@ const Kt = (r, e) => {
|
|
|
171
171
|
let t;
|
|
172
172
|
switch (r.code) {
|
|
173
173
|
case A.invalid_type:
|
|
174
|
-
r.received ===
|
|
174
|
+
r.received === k.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
175
175
|
break;
|
|
176
176
|
case A.invalid_literal:
|
|
177
177
|
t = `Invalid literal value, expected ${JSON.stringify(r.expected, q.jsonStringifyReplacer)}`;
|
|
@@ -223,14 +223,14 @@ const Kt = (r, e) => {
|
|
|
223
223
|
}
|
|
224
224
|
return { message: t };
|
|
225
225
|
};
|
|
226
|
-
let
|
|
227
|
-
function
|
|
228
|
-
|
|
226
|
+
let Xr = Kt;
|
|
227
|
+
function _a(r) {
|
|
228
|
+
Xr = r;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
return
|
|
230
|
+
function os() {
|
|
231
|
+
return Xr;
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const as = (r) => {
|
|
234
234
|
const { data: e, path: t, errorMaps: n, issueData: s } = r, i = [...t, ...s.path || []], o = {
|
|
235
235
|
...s,
|
|
236
236
|
path: i
|
|
@@ -250,9 +250,9 @@ const os = (r) => {
|
|
|
250
250
|
path: i,
|
|
251
251
|
message: a
|
|
252
252
|
};
|
|
253
|
-
},
|
|
253
|
+
}, ga = [];
|
|
254
254
|
function M(r, e) {
|
|
255
|
-
const t =
|
|
255
|
+
const t = os(), n = as({
|
|
256
256
|
issueData: e,
|
|
257
257
|
data: r.data,
|
|
258
258
|
path: r.path,
|
|
@@ -312,12 +312,12 @@ class xe {
|
|
|
312
312
|
}
|
|
313
313
|
const H = Object.freeze({
|
|
314
314
|
status: "aborted"
|
|
315
|
-
}), Vt = (r) => ({ status: "dirty", value: r }), Ee = (r) => ({ status: "valid", value: r }),
|
|
316
|
-
function
|
|
315
|
+
}), Vt = (r) => ({ status: "dirty", value: r }), Ee = (r) => ({ status: "valid", value: r }), si = (r) => r.status === "aborted", ii = (r) => r.status === "dirty", St = (r) => r.status === "valid", _n = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
316
|
+
function cs(r, e, t, n) {
|
|
317
317
|
if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
318
318
|
return e.get(r);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function $r(r, e, t, n, s) {
|
|
321
321
|
if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
322
322
|
return e.set(r, t), t;
|
|
323
323
|
}
|
|
@@ -334,7 +334,7 @@ class Ye {
|
|
|
334
334
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
const
|
|
337
|
+
const sr = (r, e) => {
|
|
338
338
|
if (St(e))
|
|
339
339
|
return { success: !0, data: e.value };
|
|
340
340
|
if (!r.common.issues.length)
|
|
@@ -421,7 +421,7 @@ class X {
|
|
|
421
421
|
data: e,
|
|
422
422
|
parsedType: rt(e)
|
|
423
423
|
}, i = this._parseSync({ data: e, path: s.path, parent: s });
|
|
424
|
-
return
|
|
424
|
+
return sr(s, i);
|
|
425
425
|
}
|
|
426
426
|
"~validate"(e) {
|
|
427
427
|
var t, n;
|
|
@@ -475,7 +475,7 @@ class X {
|
|
|
475
475
|
data: e,
|
|
476
476
|
parsedType: rt(e)
|
|
477
477
|
}, s = this._parse({ data: e, path: n.path, parent: n }), i = await (_n(s) ? s : Promise.resolve(s));
|
|
478
|
-
return
|
|
478
|
+
return sr(n, i);
|
|
479
479
|
}
|
|
480
480
|
refine(e, t) {
|
|
481
481
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
@@ -546,7 +546,7 @@ class X {
|
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
brand() {
|
|
549
|
-
return new
|
|
549
|
+
return new Ri({
|
|
550
550
|
typeName: B.ZodBranded,
|
|
551
551
|
type: this,
|
|
552
552
|
...W(this._def)
|
|
@@ -569,7 +569,7 @@ class X {
|
|
|
569
569
|
});
|
|
570
570
|
}
|
|
571
571
|
pipe(e) {
|
|
572
|
-
return
|
|
572
|
+
return Nn.create(this, e);
|
|
573
573
|
}
|
|
574
574
|
readonly() {
|
|
575
575
|
return Mn.create(this);
|
|
@@ -581,26 +581,26 @@ class X {
|
|
|
581
581
|
return this.safeParse(null).success;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
const
|
|
585
|
-
let
|
|
586
|
-
const
|
|
587
|
-
function
|
|
584
|
+
const ya = /^c[^\s-]{8,}$/i, va = /^[0-9a-z]+$/, xa = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ba = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, wa = /^[a-z0-9_-]{21}$/i, Ea = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Aa = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ta = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Sa = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
585
|
+
let Cs;
|
|
586
|
+
const Ra = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Ma = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, La = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ka = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ca = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Oa = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Yr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Da = new RegExp(`^${Yr}$`);
|
|
587
|
+
function Kr(r) {
|
|
588
588
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
589
589
|
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
590
590
|
}
|
|
591
|
-
function
|
|
592
|
-
return new RegExp(`^${
|
|
591
|
+
function Ia(r) {
|
|
592
|
+
return new RegExp(`^${Kr(r)}$`);
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
let e = `${
|
|
594
|
+
function qr(r) {
|
|
595
|
+
let e = `${Yr}T${Kr(r)}`;
|
|
596
596
|
const t = [];
|
|
597
597
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
598
598
|
}
|
|
599
|
-
function Ia(r, e) {
|
|
600
|
-
return !!((e === "v4" || !e) && Sa.test(r) || (e === "v6" || !e) && Ma.test(r));
|
|
601
|
-
}
|
|
602
599
|
function Na(r, e) {
|
|
603
|
-
|
|
600
|
+
return !!((e === "v4" || !e) && Ra.test(r) || (e === "v6" || !e) && La.test(r));
|
|
601
|
+
}
|
|
602
|
+
function Pa(r, e) {
|
|
603
|
+
if (!Ea.test(r))
|
|
604
604
|
return !1;
|
|
605
605
|
try {
|
|
606
606
|
const [t] = r.split("."), n = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
@@ -609,16 +609,16 @@ function Na(r, e) {
|
|
|
609
609
|
return !1;
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
function
|
|
613
|
-
return !!((e === "v4" || !e) &&
|
|
612
|
+
function za(r, e) {
|
|
613
|
+
return !!((e === "v4" || !e) && Ma.test(r) || (e === "v6" || !e) && ka.test(r));
|
|
614
614
|
}
|
|
615
615
|
class je extends X {
|
|
616
616
|
_parse(e) {
|
|
617
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
617
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== k.string) {
|
|
618
618
|
const i = this._getOrReturnCtx(e);
|
|
619
619
|
return M(i, {
|
|
620
620
|
code: A.invalid_type,
|
|
621
|
-
expected:
|
|
621
|
+
expected: k.string,
|
|
622
622
|
received: i.parsedType
|
|
623
623
|
}), H;
|
|
624
624
|
}
|
|
@@ -661,43 +661,43 @@ class je extends X {
|
|
|
661
661
|
message: i.message
|
|
662
662
|
}), n.dirty());
|
|
663
663
|
} else if (i.kind === "email")
|
|
664
|
-
|
|
664
|
+
Ta.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
665
665
|
validation: "email",
|
|
666
666
|
code: A.invalid_string,
|
|
667
667
|
message: i.message
|
|
668
668
|
}), n.dirty());
|
|
669
669
|
else if (i.kind === "emoji")
|
|
670
|
-
|
|
670
|
+
Cs || (Cs = new RegExp(Sa, "u")), Cs.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
671
671
|
validation: "emoji",
|
|
672
672
|
code: A.invalid_string,
|
|
673
673
|
message: i.message
|
|
674
674
|
}), n.dirty());
|
|
675
675
|
else if (i.kind === "uuid")
|
|
676
|
-
|
|
676
|
+
ba.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
677
677
|
validation: "uuid",
|
|
678
678
|
code: A.invalid_string,
|
|
679
679
|
message: i.message
|
|
680
680
|
}), n.dirty());
|
|
681
681
|
else if (i.kind === "nanoid")
|
|
682
|
-
|
|
682
|
+
wa.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
683
683
|
validation: "nanoid",
|
|
684
684
|
code: A.invalid_string,
|
|
685
685
|
message: i.message
|
|
686
686
|
}), n.dirty());
|
|
687
687
|
else if (i.kind === "cuid")
|
|
688
|
-
|
|
688
|
+
ya.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
689
689
|
validation: "cuid",
|
|
690
690
|
code: A.invalid_string,
|
|
691
691
|
message: i.message
|
|
692
692
|
}), n.dirty());
|
|
693
693
|
else if (i.kind === "cuid2")
|
|
694
|
-
|
|
694
|
+
va.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
695
695
|
validation: "cuid2",
|
|
696
696
|
code: A.invalid_string,
|
|
697
697
|
message: i.message
|
|
698
698
|
}), n.dirty());
|
|
699
699
|
else if (i.kind === "ulid")
|
|
700
|
-
|
|
700
|
+
xa.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
701
701
|
validation: "ulid",
|
|
702
702
|
code: A.invalid_string,
|
|
703
703
|
message: i.message
|
|
@@ -728,31 +728,31 @@ class je extends X {
|
|
|
728
728
|
code: A.invalid_string,
|
|
729
729
|
validation: { endsWith: i.value },
|
|
730
730
|
message: i.message
|
|
731
|
-
}), n.dirty()) : i.kind === "datetime" ?
|
|
731
|
+
}), n.dirty()) : i.kind === "datetime" ? qr(i).test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
732
732
|
code: A.invalid_string,
|
|
733
733
|
validation: "datetime",
|
|
734
734
|
message: i.message
|
|
735
|
-
}), n.dirty()) : i.kind === "date" ?
|
|
735
|
+
}), n.dirty()) : i.kind === "date" ? Da.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
736
736
|
code: A.invalid_string,
|
|
737
737
|
validation: "date",
|
|
738
738
|
message: i.message
|
|
739
|
-
}), n.dirty()) : i.kind === "time" ?
|
|
739
|
+
}), n.dirty()) : i.kind === "time" ? Ia(i).test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
740
740
|
code: A.invalid_string,
|
|
741
741
|
validation: "time",
|
|
742
742
|
message: i.message
|
|
743
|
-
}), n.dirty()) : i.kind === "duration" ?
|
|
743
|
+
}), n.dirty()) : i.kind === "duration" ? Aa.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
744
744
|
validation: "duration",
|
|
745
745
|
code: A.invalid_string,
|
|
746
746
|
message: i.message
|
|
747
|
-
}), n.dirty()) : i.kind === "ip" ?
|
|
747
|
+
}), n.dirty()) : i.kind === "ip" ? Na(e.data, i.version) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
748
748
|
validation: "ip",
|
|
749
749
|
code: A.invalid_string,
|
|
750
750
|
message: i.message
|
|
751
|
-
}), n.dirty()) : i.kind === "jwt" ?
|
|
751
|
+
}), n.dirty()) : i.kind === "jwt" ? Pa(e.data, i.alg) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
752
752
|
validation: "jwt",
|
|
753
753
|
code: A.invalid_string,
|
|
754
754
|
message: i.message
|
|
755
|
-
}), n.dirty()) : i.kind === "cidr" ?
|
|
755
|
+
}), n.dirty()) : i.kind === "cidr" ? za(e.data, i.version) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
756
756
|
validation: "cidr",
|
|
757
757
|
code: A.invalid_string,
|
|
758
758
|
message: i.message
|
|
@@ -999,7 +999,7 @@ je.create = (r) => {
|
|
|
999
999
|
...W(r)
|
|
1000
1000
|
});
|
|
1001
1001
|
};
|
|
1002
|
-
function
|
|
1002
|
+
function Ua(r, e) {
|
|
1003
1003
|
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, i = parseInt(r.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
|
|
1004
1004
|
return i % o / Math.pow(10, s);
|
|
1005
1005
|
}
|
|
@@ -1008,11 +1008,11 @@ class pt extends X {
|
|
|
1008
1008
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1009
1009
|
}
|
|
1010
1010
|
_parse(e) {
|
|
1011
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
1011
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== k.number) {
|
|
1012
1012
|
const i = this._getOrReturnCtx(e);
|
|
1013
1013
|
return M(i, {
|
|
1014
1014
|
code: A.invalid_type,
|
|
1015
|
-
expected:
|
|
1015
|
+
expected: k.number,
|
|
1016
1016
|
received: i.parsedType
|
|
1017
1017
|
}), H;
|
|
1018
1018
|
}
|
|
@@ -1038,7 +1038,7 @@ class pt extends X {
|
|
|
1038
1038
|
inclusive: i.inclusive,
|
|
1039
1039
|
exact: !1,
|
|
1040
1040
|
message: i.message
|
|
1041
|
-
}), s.dirty()) : i.kind === "multipleOf" ?
|
|
1041
|
+
}), s.dirty()) : i.kind === "multipleOf" ? Ua(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1042
1042
|
code: A.not_multiple_of,
|
|
1043
1043
|
multipleOf: i.value,
|
|
1044
1044
|
message: i.message
|
|
@@ -1186,7 +1186,7 @@ class _t extends X {
|
|
|
1186
1186
|
} catch {
|
|
1187
1187
|
return this._getInvalidInput(e);
|
|
1188
1188
|
}
|
|
1189
|
-
if (this._getType(e) !==
|
|
1189
|
+
if (this._getType(e) !== k.bigint)
|
|
1190
1190
|
return this._getInvalidInput(e);
|
|
1191
1191
|
let n;
|
|
1192
1192
|
const s = new xe();
|
|
@@ -1214,7 +1214,7 @@ class _t extends X {
|
|
|
1214
1214
|
const t = this._getOrReturnCtx(e);
|
|
1215
1215
|
return M(t, {
|
|
1216
1216
|
code: A.invalid_type,
|
|
1217
|
-
expected:
|
|
1217
|
+
expected: k.bigint,
|
|
1218
1218
|
received: t.parsedType
|
|
1219
1219
|
}), H;
|
|
1220
1220
|
}
|
|
@@ -1313,11 +1313,11 @@ _t.create = (r) => {
|
|
|
1313
1313
|
};
|
|
1314
1314
|
class gn extends X {
|
|
1315
1315
|
_parse(e) {
|
|
1316
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
1316
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== k.boolean) {
|
|
1317
1317
|
const n = this._getOrReturnCtx(e);
|
|
1318
1318
|
return M(n, {
|
|
1319
1319
|
code: A.invalid_type,
|
|
1320
|
-
expected:
|
|
1320
|
+
expected: k.boolean,
|
|
1321
1321
|
received: n.parsedType
|
|
1322
1322
|
}), H;
|
|
1323
1323
|
}
|
|
@@ -1331,11 +1331,11 @@ gn.create = (r) => new gn({
|
|
|
1331
1331
|
});
|
|
1332
1332
|
class Rt extends X {
|
|
1333
1333
|
_parse(e) {
|
|
1334
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
1334
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== k.date) {
|
|
1335
1335
|
const i = this._getOrReturnCtx(e);
|
|
1336
1336
|
return M(i, {
|
|
1337
1337
|
code: A.invalid_type,
|
|
1338
|
-
expected:
|
|
1338
|
+
expected: k.date,
|
|
1339
1339
|
received: i.parsedType
|
|
1340
1340
|
}), H;
|
|
1341
1341
|
}
|
|
@@ -1407,30 +1407,30 @@ Rt.create = (r) => new Rt({
|
|
|
1407
1407
|
typeName: B.ZodDate,
|
|
1408
1408
|
...W(r)
|
|
1409
1409
|
});
|
|
1410
|
-
class
|
|
1410
|
+
class ls extends X {
|
|
1411
1411
|
_parse(e) {
|
|
1412
|
-
if (this._getType(e) !==
|
|
1412
|
+
if (this._getType(e) !== k.symbol) {
|
|
1413
1413
|
const n = this._getOrReturnCtx(e);
|
|
1414
1414
|
return M(n, {
|
|
1415
1415
|
code: A.invalid_type,
|
|
1416
|
-
expected:
|
|
1416
|
+
expected: k.symbol,
|
|
1417
1417
|
received: n.parsedType
|
|
1418
1418
|
}), H;
|
|
1419
1419
|
}
|
|
1420
1420
|
return Ee(e.data);
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
|
-
|
|
1423
|
+
ls.create = (r) => new ls({
|
|
1424
1424
|
typeName: B.ZodSymbol,
|
|
1425
1425
|
...W(r)
|
|
1426
1426
|
});
|
|
1427
1427
|
class yn extends X {
|
|
1428
1428
|
_parse(e) {
|
|
1429
|
-
if (this._getType(e) !==
|
|
1429
|
+
if (this._getType(e) !== k.undefined) {
|
|
1430
1430
|
const n = this._getOrReturnCtx(e);
|
|
1431
1431
|
return M(n, {
|
|
1432
1432
|
code: A.invalid_type,
|
|
1433
|
-
expected:
|
|
1433
|
+
expected: k.undefined,
|
|
1434
1434
|
received: n.parsedType
|
|
1435
1435
|
}), H;
|
|
1436
1436
|
}
|
|
@@ -1443,11 +1443,11 @@ yn.create = (r) => new yn({
|
|
|
1443
1443
|
});
|
|
1444
1444
|
class vn extends X {
|
|
1445
1445
|
_parse(e) {
|
|
1446
|
-
if (this._getType(e) !==
|
|
1446
|
+
if (this._getType(e) !== k.null) {
|
|
1447
1447
|
const n = this._getOrReturnCtx(e);
|
|
1448
1448
|
return M(n, {
|
|
1449
1449
|
code: A.invalid_type,
|
|
1450
|
-
expected:
|
|
1450
|
+
expected: k.null,
|
|
1451
1451
|
received: n.parsedType
|
|
1452
1452
|
}), H;
|
|
1453
1453
|
}
|
|
@@ -1487,7 +1487,7 @@ class dt extends X {
|
|
|
1487
1487
|
const t = this._getOrReturnCtx(e);
|
|
1488
1488
|
return M(t, {
|
|
1489
1489
|
code: A.invalid_type,
|
|
1490
|
-
expected:
|
|
1490
|
+
expected: k.never,
|
|
1491
1491
|
received: t.parsedType
|
|
1492
1492
|
}), H;
|
|
1493
1493
|
}
|
|
@@ -1496,30 +1496,30 @@ dt.create = (r) => new dt({
|
|
|
1496
1496
|
typeName: B.ZodNever,
|
|
1497
1497
|
...W(r)
|
|
1498
1498
|
});
|
|
1499
|
-
class
|
|
1499
|
+
class ds extends X {
|
|
1500
1500
|
_parse(e) {
|
|
1501
|
-
if (this._getType(e) !==
|
|
1501
|
+
if (this._getType(e) !== k.undefined) {
|
|
1502
1502
|
const n = this._getOrReturnCtx(e);
|
|
1503
1503
|
return M(n, {
|
|
1504
1504
|
code: A.invalid_type,
|
|
1505
|
-
expected:
|
|
1505
|
+
expected: k.void,
|
|
1506
1506
|
received: n.parsedType
|
|
1507
1507
|
}), H;
|
|
1508
1508
|
}
|
|
1509
1509
|
return Ee(e.data);
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
|
|
1512
|
+
ds.create = (r) => new ds({
|
|
1513
1513
|
typeName: B.ZodVoid,
|
|
1514
1514
|
...W(r)
|
|
1515
1515
|
});
|
|
1516
1516
|
class Be extends X {
|
|
1517
1517
|
_parse(e) {
|
|
1518
1518
|
const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
|
|
1519
|
-
if (t.parsedType !==
|
|
1519
|
+
if (t.parsedType !== k.array)
|
|
1520
1520
|
return M(t, {
|
|
1521
1521
|
code: A.invalid_type,
|
|
1522
|
-
expected:
|
|
1522
|
+
expected: k.array,
|
|
1523
1523
|
received: t.parsedType
|
|
1524
1524
|
}), H;
|
|
1525
1525
|
if (s.exactLength !== null) {
|
|
@@ -1613,11 +1613,11 @@ class ie extends X {
|
|
|
1613
1613
|
return this._cached = { shape: e, keys: t };
|
|
1614
1614
|
}
|
|
1615
1615
|
_parse(e) {
|
|
1616
|
-
if (this._getType(e) !==
|
|
1616
|
+
if (this._getType(e) !== k.object) {
|
|
1617
1617
|
const l = this._getOrReturnCtx(e);
|
|
1618
1618
|
return M(l, {
|
|
1619
1619
|
code: A.invalid_type,
|
|
1620
|
-
expected:
|
|
1620
|
+
expected: k.object,
|
|
1621
1621
|
received: l.parsedType
|
|
1622
1622
|
}), H;
|
|
1623
1623
|
}
|
|
@@ -1865,7 +1865,7 @@ class ie extends X {
|
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
1867
|
keyof() {
|
|
1868
|
-
return
|
|
1868
|
+
return Jr(q.objectKeys(this.shape));
|
|
1869
1869
|
}
|
|
1870
1870
|
}
|
|
1871
1871
|
ie.create = (r, e) => new ie({
|
|
@@ -1962,14 +1962,14 @@ xn.create = (r, e) => new xn({
|
|
|
1962
1962
|
typeName: B.ZodUnion,
|
|
1963
1963
|
...W(e)
|
|
1964
1964
|
});
|
|
1965
|
-
const nt = (r) => r instanceof En ? nt(r.schema) : r instanceof He ? nt(r.innerType()) : r instanceof An ? [r.value] : r instanceof gt ? r.options : r instanceof Tn ? q.objectValues(r.enum) : r instanceof Sn ? nt(r._def.innerType) : r instanceof yn ? [void 0] : r instanceof vn ? [null] : r instanceof $e ? [void 0, ...nt(r.unwrap())] : r instanceof yt ? [null, ...nt(r.unwrap())] : r instanceof
|
|
1966
|
-
class
|
|
1965
|
+
const nt = (r) => r instanceof En ? nt(r.schema) : r instanceof He ? nt(r.innerType()) : r instanceof An ? [r.value] : r instanceof gt ? r.options : r instanceof Tn ? q.objectValues(r.enum) : r instanceof Sn ? nt(r._def.innerType) : r instanceof yn ? [void 0] : r instanceof vn ? [null] : r instanceof $e ? [void 0, ...nt(r.unwrap())] : r instanceof yt ? [null, ...nt(r.unwrap())] : r instanceof Ri || r instanceof Mn ? nt(r.unwrap()) : r instanceof Rn ? nt(r._def.innerType) : [];
|
|
1966
|
+
class _s extends X {
|
|
1967
1967
|
_parse(e) {
|
|
1968
1968
|
const { ctx: t } = this._processInputParams(e);
|
|
1969
|
-
if (t.parsedType !==
|
|
1969
|
+
if (t.parsedType !== k.object)
|
|
1970
1970
|
return M(t, {
|
|
1971
1971
|
code: A.invalid_type,
|
|
1972
|
-
expected:
|
|
1972
|
+
expected: k.object,
|
|
1973
1973
|
received: t.parsedType
|
|
1974
1974
|
}), H;
|
|
1975
1975
|
const n = this.discriminator, s = t.data[n], i = this.optionsMap.get(s);
|
|
@@ -2016,7 +2016,7 @@ class ps extends X {
|
|
|
2016
2016
|
s.set(a, i);
|
|
2017
2017
|
}
|
|
2018
2018
|
}
|
|
2019
|
-
return new
|
|
2019
|
+
return new _s({
|
|
2020
2020
|
typeName: B.ZodDiscriminatedUnion,
|
|
2021
2021
|
discriminator: e,
|
|
2022
2022
|
options: t,
|
|
@@ -2025,39 +2025,39 @@ class ps extends X {
|
|
|
2025
2025
|
});
|
|
2026
2026
|
}
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2028
|
+
function ri(r, e) {
|
|
2029
2029
|
const t = rt(r), n = rt(e);
|
|
2030
2030
|
if (r === e)
|
|
2031
2031
|
return { valid: !0, data: r };
|
|
2032
|
-
if (t ===
|
|
2032
|
+
if (t === k.object && n === k.object) {
|
|
2033
2033
|
const s = q.objectKeys(e), i = q.objectKeys(r).filter((a) => s.indexOf(a) !== -1), o = { ...r, ...e };
|
|
2034
2034
|
for (const a of i) {
|
|
2035
|
-
const c =
|
|
2035
|
+
const c = ri(r[a], e[a]);
|
|
2036
2036
|
if (!c.valid)
|
|
2037
2037
|
return { valid: !1 };
|
|
2038
2038
|
o[a] = c.data;
|
|
2039
2039
|
}
|
|
2040
2040
|
return { valid: !0, data: o };
|
|
2041
|
-
} else if (t ===
|
|
2041
|
+
} else if (t === k.array && n === k.array) {
|
|
2042
2042
|
if (r.length !== e.length)
|
|
2043
2043
|
return { valid: !1 };
|
|
2044
2044
|
const s = [];
|
|
2045
2045
|
for (let i = 0; i < r.length; i++) {
|
|
2046
|
-
const o = r[i], a = e[i], c =
|
|
2046
|
+
const o = r[i], a = e[i], c = ri(o, a);
|
|
2047
2047
|
if (!c.valid)
|
|
2048
2048
|
return { valid: !1 };
|
|
2049
2049
|
s.push(c.data);
|
|
2050
2050
|
}
|
|
2051
2051
|
return { valid: !0, data: s };
|
|
2052
|
-
} else return t ===
|
|
2052
|
+
} else return t === k.date && n === k.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
2053
2053
|
}
|
|
2054
2054
|
class bn extends X {
|
|
2055
2055
|
_parse(e) {
|
|
2056
2056
|
const { status: t, ctx: n } = this._processInputParams(e), s = (i, o) => {
|
|
2057
|
-
if (
|
|
2057
|
+
if (si(i) || si(o))
|
|
2058
2058
|
return H;
|
|
2059
|
-
const a =
|
|
2060
|
-
return a.valid ? ((
|
|
2059
|
+
const a = ri(i.value, o.value);
|
|
2060
|
+
return a.valid ? ((ii(i) || ii(o)) && t.dirty(), { status: t.value, value: a.data }) : (M(n, {
|
|
2061
2061
|
code: A.invalid_intersection_types
|
|
2062
2062
|
}), H);
|
|
2063
2063
|
};
|
|
@@ -2092,10 +2092,10 @@ bn.create = (r, e, t) => new bn({
|
|
|
2092
2092
|
class Ke extends X {
|
|
2093
2093
|
_parse(e) {
|
|
2094
2094
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2095
|
-
if (n.parsedType !==
|
|
2095
|
+
if (n.parsedType !== k.array)
|
|
2096
2096
|
return M(n, {
|
|
2097
2097
|
code: A.invalid_type,
|
|
2098
|
-
expected:
|
|
2098
|
+
expected: k.array,
|
|
2099
2099
|
received: n.parsedType
|
|
2100
2100
|
}), H;
|
|
2101
2101
|
if (n.data.length < this._def.items.length)
|
|
@@ -2148,10 +2148,10 @@ class wn extends X {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
_parse(e) {
|
|
2150
2150
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2151
|
-
if (n.parsedType !==
|
|
2151
|
+
if (n.parsedType !== k.object)
|
|
2152
2152
|
return M(n, {
|
|
2153
2153
|
code: A.invalid_type,
|
|
2154
|
-
expected:
|
|
2154
|
+
expected: k.object,
|
|
2155
2155
|
received: n.parsedType
|
|
2156
2156
|
}), H;
|
|
2157
2157
|
const s = [], i = this._def.keyType, o = this._def.valueType;
|
|
@@ -2180,7 +2180,7 @@ class wn extends X {
|
|
|
2180
2180
|
});
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
|
-
class
|
|
2183
|
+
class us extends X {
|
|
2184
2184
|
get keySchema() {
|
|
2185
2185
|
return this._def.keyType;
|
|
2186
2186
|
}
|
|
@@ -2189,10 +2189,10 @@ class ds extends X {
|
|
|
2189
2189
|
}
|
|
2190
2190
|
_parse(e) {
|
|
2191
2191
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2192
|
-
if (n.parsedType !==
|
|
2192
|
+
if (n.parsedType !== k.map)
|
|
2193
2193
|
return M(n, {
|
|
2194
2194
|
code: A.invalid_type,
|
|
2195
|
-
expected:
|
|
2195
|
+
expected: k.map,
|
|
2196
2196
|
received: n.parsedType
|
|
2197
2197
|
}), H;
|
|
2198
2198
|
const s = this._def.keyType, i = this._def.valueType, o = [...n.data.entries()].map(([a, c], l) => ({
|
|
@@ -2222,7 +2222,7 @@ class ds extends X {
|
|
|
2222
2222
|
}
|
|
2223
2223
|
}
|
|
2224
2224
|
}
|
|
2225
|
-
|
|
2225
|
+
us.create = (r, e, t) => new us({
|
|
2226
2226
|
valueType: e,
|
|
2227
2227
|
keyType: r,
|
|
2228
2228
|
typeName: B.ZodMap,
|
|
@@ -2231,10 +2231,10 @@ ds.create = (r, e, t) => new ds({
|
|
|
2231
2231
|
class Mt extends X {
|
|
2232
2232
|
_parse(e) {
|
|
2233
2233
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2234
|
-
if (n.parsedType !==
|
|
2234
|
+
if (n.parsedType !== k.set)
|
|
2235
2235
|
return M(n, {
|
|
2236
2236
|
code: A.invalid_type,
|
|
2237
|
-
expected:
|
|
2237
|
+
expected: k.set,
|
|
2238
2238
|
received: n.parsedType
|
|
2239
2239
|
}), H;
|
|
2240
2240
|
const s = this._def;
|
|
@@ -2298,20 +2298,20 @@ class Xt extends X {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
_parse(e) {
|
|
2300
2300
|
const { ctx: t } = this._processInputParams(e);
|
|
2301
|
-
if (t.parsedType !==
|
|
2301
|
+
if (t.parsedType !== k.function)
|
|
2302
2302
|
return M(t, {
|
|
2303
2303
|
code: A.invalid_type,
|
|
2304
|
-
expected:
|
|
2304
|
+
expected: k.function,
|
|
2305
2305
|
received: t.parsedType
|
|
2306
2306
|
}), H;
|
|
2307
2307
|
function n(a, c) {
|
|
2308
|
-
return
|
|
2308
|
+
return as({
|
|
2309
2309
|
data: a,
|
|
2310
2310
|
path: t.path,
|
|
2311
2311
|
errorMaps: [
|
|
2312
2312
|
t.common.contextualErrorMap,
|
|
2313
2313
|
t.schemaErrorMap,
|
|
2314
|
-
|
|
2314
|
+
os(),
|
|
2315
2315
|
Kt
|
|
2316
2316
|
].filter((l) => !!l),
|
|
2317
2317
|
issueData: {
|
|
@@ -2321,13 +2321,13 @@ class Xt extends X {
|
|
|
2321
2321
|
});
|
|
2322
2322
|
}
|
|
2323
2323
|
function s(a, c) {
|
|
2324
|
-
return
|
|
2324
|
+
return as({
|
|
2325
2325
|
data: a,
|
|
2326
2326
|
path: t.path,
|
|
2327
2327
|
errorMaps: [
|
|
2328
2328
|
t.common.contextualErrorMap,
|
|
2329
2329
|
t.schemaErrorMap,
|
|
2330
|
-
|
|
2330
|
+
os(),
|
|
2331
2331
|
Kt
|
|
2332
2332
|
].filter((l) => !!l),
|
|
2333
2333
|
issueData: {
|
|
@@ -2428,7 +2428,7 @@ An.create = (r, e) => new An({
|
|
|
2428
2428
|
typeName: B.ZodLiteral,
|
|
2429
2429
|
...W(e)
|
|
2430
2430
|
});
|
|
2431
|
-
function
|
|
2431
|
+
function Jr(r, e) {
|
|
2432
2432
|
return new gt({
|
|
2433
2433
|
values: r,
|
|
2434
2434
|
typeName: B.ZodEnum,
|
|
@@ -2448,7 +2448,7 @@ class gt extends X {
|
|
|
2448
2448
|
code: A.invalid_type
|
|
2449
2449
|
}), H;
|
|
2450
2450
|
}
|
|
2451
|
-
if (
|
|
2451
|
+
if (cs(this, un) || $r(this, un, new Set(this._def.values)), !cs(this, un).has(e.data)) {
|
|
2452
2452
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2453
2453
|
return M(t, {
|
|
2454
2454
|
received: t.data,
|
|
@@ -2493,14 +2493,14 @@ class gt extends X {
|
|
|
2493
2493
|
}
|
|
2494
2494
|
}
|
|
2495
2495
|
un = /* @__PURE__ */ new WeakMap();
|
|
2496
|
-
gt.create =
|
|
2496
|
+
gt.create = Jr;
|
|
2497
2497
|
class Tn extends X {
|
|
2498
2498
|
constructor() {
|
|
2499
2499
|
super(...arguments), hn.set(this, void 0);
|
|
2500
2500
|
}
|
|
2501
2501
|
_parse(e) {
|
|
2502
2502
|
const t = q.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2503
|
-
if (n.parsedType !==
|
|
2503
|
+
if (n.parsedType !== k.string && n.parsedType !== k.number) {
|
|
2504
2504
|
const s = q.objectValues(t);
|
|
2505
2505
|
return M(n, {
|
|
2506
2506
|
expected: q.joinValues(s),
|
|
@@ -2508,7 +2508,7 @@ class Tn extends X {
|
|
|
2508
2508
|
code: A.invalid_type
|
|
2509
2509
|
}), H;
|
|
2510
2510
|
}
|
|
2511
|
-
if (
|
|
2511
|
+
if (cs(this, hn) || $r(this, hn, new Set(q.getValidEnumValues(this._def.values))), !cs(this, hn).has(e.data)) {
|
|
2512
2512
|
const s = q.objectValues(t);
|
|
2513
2513
|
return M(n, {
|
|
2514
2514
|
received: n.data,
|
|
@@ -2534,13 +2534,13 @@ class Jt extends X {
|
|
|
2534
2534
|
}
|
|
2535
2535
|
_parse(e) {
|
|
2536
2536
|
const { ctx: t } = this._processInputParams(e);
|
|
2537
|
-
if (t.parsedType !==
|
|
2537
|
+
if (t.parsedType !== k.promise && t.common.async === !1)
|
|
2538
2538
|
return M(t, {
|
|
2539
2539
|
code: A.invalid_type,
|
|
2540
|
-
expected:
|
|
2540
|
+
expected: k.promise,
|
|
2541
2541
|
received: t.parsedType
|
|
2542
2542
|
}), H;
|
|
2543
|
-
const n = t.parsedType ===
|
|
2543
|
+
const n = t.parsedType === k.promise ? t.data : Promise.resolve(t.data);
|
|
2544
2544
|
return Ee(n.then((s) => this._def.type.parseAsync(s, {
|
|
2545
2545
|
path: t.path,
|
|
2546
2546
|
errorMap: t.common.contextualErrorMap
|
|
@@ -2643,7 +2643,7 @@ He.createWithPreprocess = (r, e, t) => new He({
|
|
|
2643
2643
|
});
|
|
2644
2644
|
class $e extends X {
|
|
2645
2645
|
_parse(e) {
|
|
2646
|
-
return this._getType(e) ===
|
|
2646
|
+
return this._getType(e) === k.undefined ? Ee(void 0) : this._def.innerType._parse(e);
|
|
2647
2647
|
}
|
|
2648
2648
|
unwrap() {
|
|
2649
2649
|
return this._def.innerType;
|
|
@@ -2656,7 +2656,7 @@ $e.create = (r, e) => new $e({
|
|
|
2656
2656
|
});
|
|
2657
2657
|
class yt extends X {
|
|
2658
2658
|
_parse(e) {
|
|
2659
|
-
return this._getType(e) ===
|
|
2659
|
+
return this._getType(e) === k.null ? Ee(null) : this._def.innerType._parse(e);
|
|
2660
2660
|
}
|
|
2661
2661
|
unwrap() {
|
|
2662
2662
|
return this._def.innerType;
|
|
@@ -2671,7 +2671,7 @@ class Sn extends X {
|
|
|
2671
2671
|
_parse(e) {
|
|
2672
2672
|
const { ctx: t } = this._processInputParams(e);
|
|
2673
2673
|
let n = t.data;
|
|
2674
|
-
return t.parsedType ===
|
|
2674
|
+
return t.parsedType === k.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
2675
2675
|
data: n,
|
|
2676
2676
|
path: t.path,
|
|
2677
2677
|
parent: t
|
|
@@ -2730,25 +2730,25 @@ Rn.create = (r, e) => new Rn({
|
|
|
2730
2730
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2731
2731
|
...W(e)
|
|
2732
2732
|
});
|
|
2733
|
-
class
|
|
2733
|
+
class hs extends X {
|
|
2734
2734
|
_parse(e) {
|
|
2735
|
-
if (this._getType(e) !==
|
|
2735
|
+
if (this._getType(e) !== k.nan) {
|
|
2736
2736
|
const n = this._getOrReturnCtx(e);
|
|
2737
2737
|
return M(n, {
|
|
2738
2738
|
code: A.invalid_type,
|
|
2739
|
-
expected:
|
|
2739
|
+
expected: k.nan,
|
|
2740
2740
|
received: n.parsedType
|
|
2741
2741
|
}), H;
|
|
2742
2742
|
}
|
|
2743
2743
|
return { status: "valid", value: e.data };
|
|
2744
2744
|
}
|
|
2745
2745
|
}
|
|
2746
|
-
|
|
2746
|
+
hs.create = (r) => new hs({
|
|
2747
2747
|
typeName: B.ZodNaN,
|
|
2748
2748
|
...W(r)
|
|
2749
2749
|
});
|
|
2750
|
-
const
|
|
2751
|
-
class
|
|
2750
|
+
const Fa = Symbol("zod_brand");
|
|
2751
|
+
class Ri extends X {
|
|
2752
2752
|
_parse(e) {
|
|
2753
2753
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2754
2754
|
return this._def.type._parse({
|
|
@@ -2761,7 +2761,7 @@ class Si extends X {
|
|
|
2761
2761
|
return this._def.type;
|
|
2762
2762
|
}
|
|
2763
2763
|
}
|
|
2764
|
-
class
|
|
2764
|
+
class Nn extends X {
|
|
2765
2765
|
_parse(e) {
|
|
2766
2766
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2767
2767
|
if (n.common.async)
|
|
@@ -2794,7 +2794,7 @@ class In extends X {
|
|
|
2794
2794
|
}
|
|
2795
2795
|
}
|
|
2796
2796
|
static create(e, t) {
|
|
2797
|
-
return new
|
|
2797
|
+
return new Nn({
|
|
2798
2798
|
in: e,
|
|
2799
2799
|
out: t,
|
|
2800
2800
|
typeName: B.ZodPipeline
|
|
@@ -2815,11 +2815,11 @@ Mn.create = (r, e) => new Mn({
|
|
|
2815
2815
|
typeName: B.ZodReadonly,
|
|
2816
2816
|
...W(e)
|
|
2817
2817
|
});
|
|
2818
|
-
function
|
|
2818
|
+
function ir(r, e) {
|
|
2819
2819
|
const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
|
|
2820
2820
|
return typeof t == "string" ? { message: t } : t;
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2822
|
+
function Qr(r, e = {}, t) {
|
|
2823
2823
|
return r ? qt.create().superRefine((n, s) => {
|
|
2824
2824
|
var i, o;
|
|
2825
2825
|
const a = r(n);
|
|
@@ -2827,26 +2827,26 @@ function Jr(r, e = {}, t) {
|
|
|
2827
2827
|
return a.then((c) => {
|
|
2828
2828
|
var l, d;
|
|
2829
2829
|
if (!c) {
|
|
2830
|
-
const u =
|
|
2830
|
+
const u = ir(e, n), h = (d = (l = u.fatal) !== null && l !== void 0 ? l : t) !== null && d !== void 0 ? d : !0;
|
|
2831
2831
|
s.addIssue({ code: "custom", ...u, fatal: h });
|
|
2832
2832
|
}
|
|
2833
2833
|
});
|
|
2834
2834
|
if (!a) {
|
|
2835
|
-
const c =
|
|
2835
|
+
const c = ir(e, n), l = (o = (i = c.fatal) !== null && i !== void 0 ? i : t) !== null && o !== void 0 ? o : !0;
|
|
2836
2836
|
s.addIssue({ code: "custom", ...c, fatal: l });
|
|
2837
2837
|
}
|
|
2838
2838
|
}) : qt.create();
|
|
2839
2839
|
}
|
|
2840
|
-
const
|
|
2840
|
+
const ja = {
|
|
2841
2841
|
object: ie.lazycreate
|
|
2842
2842
|
};
|
|
2843
2843
|
var B;
|
|
2844
2844
|
(function(r) {
|
|
2845
2845
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
2846
2846
|
})(B || (B = {}));
|
|
2847
|
-
const
|
|
2847
|
+
const Ba = (r, e = {
|
|
2848
2848
|
message: `Input not instance of ${r.name}`
|
|
2849
|
-
}) =>
|
|
2849
|
+
}) => Qr((t) => t instanceof r, e), eo = je.create, to = pt.create, Ha = hs.create, Va = _t.create, no = gn.create, Ga = Rt.create, Za = ls.create, Wa = yn.create, Xa = vn.create, $a = qt.create, Ya = At.create, Ka = dt.create, qa = ds.create, Ja = Be.create, Qa = ie.create, ec = ie.strictCreate, tc = xn.create, nc = _s.create, sc = bn.create, ic = Ke.create, rc = wn.create, oc = us.create, ac = Mt.create, cc = Xt.create, lc = En.create, dc = An.create, uc = gt.create, hc = Tn.create, fc = Jt.create, rr = He.create, mc = $e.create, pc = yt.create, _c = He.createWithPreprocess, gc = Nn.create, yc = () => eo().optional(), vc = () => to().optional(), xc = () => no().optional(), bc = {
|
|
2850
2850
|
string: (r) => je.create({ ...r, coerce: !0 }),
|
|
2851
2851
|
number: (r) => pt.create({ ...r, coerce: !0 }),
|
|
2852
2852
|
boolean: (r) => gn.create({
|
|
@@ -2855,53 +2855,53 @@ const ja = (r, e = {
|
|
|
2855
2855
|
}),
|
|
2856
2856
|
bigint: (r) => _t.create({ ...r, coerce: !0 }),
|
|
2857
2857
|
date: (r) => Rt.create({ ...r, coerce: !0 })
|
|
2858
|
-
},
|
|
2858
|
+
}, wc = H;
|
|
2859
2859
|
var E = /* @__PURE__ */ Object.freeze({
|
|
2860
2860
|
__proto__: null,
|
|
2861
2861
|
defaultErrorMap: Kt,
|
|
2862
|
-
setErrorMap:
|
|
2863
|
-
getErrorMap:
|
|
2864
|
-
makeIssue:
|
|
2865
|
-
EMPTY_PATH:
|
|
2862
|
+
setErrorMap: _a,
|
|
2863
|
+
getErrorMap: os,
|
|
2864
|
+
makeIssue: as,
|
|
2865
|
+
EMPTY_PATH: ga,
|
|
2866
2866
|
addIssueToContext: M,
|
|
2867
2867
|
ParseStatus: xe,
|
|
2868
2868
|
INVALID: H,
|
|
2869
2869
|
DIRTY: Vt,
|
|
2870
2870
|
OK: Ee,
|
|
2871
|
-
isAborted:
|
|
2872
|
-
isDirty:
|
|
2871
|
+
isAborted: si,
|
|
2872
|
+
isDirty: ii,
|
|
2873
2873
|
isValid: St,
|
|
2874
2874
|
isAsync: _n,
|
|
2875
2875
|
get util() {
|
|
2876
2876
|
return q;
|
|
2877
2877
|
},
|
|
2878
2878
|
get objectUtil() {
|
|
2879
|
-
return
|
|
2879
|
+
return ni;
|
|
2880
2880
|
},
|
|
2881
|
-
ZodParsedType:
|
|
2881
|
+
ZodParsedType: k,
|
|
2882
2882
|
getParsedType: rt,
|
|
2883
2883
|
ZodType: X,
|
|
2884
|
-
datetimeRegex:
|
|
2884
|
+
datetimeRegex: qr,
|
|
2885
2885
|
ZodString: je,
|
|
2886
2886
|
ZodNumber: pt,
|
|
2887
2887
|
ZodBigInt: _t,
|
|
2888
2888
|
ZodBoolean: gn,
|
|
2889
2889
|
ZodDate: Rt,
|
|
2890
|
-
ZodSymbol:
|
|
2890
|
+
ZodSymbol: ls,
|
|
2891
2891
|
ZodUndefined: yn,
|
|
2892
2892
|
ZodNull: vn,
|
|
2893
2893
|
ZodAny: qt,
|
|
2894
2894
|
ZodUnknown: At,
|
|
2895
2895
|
ZodNever: dt,
|
|
2896
|
-
ZodVoid:
|
|
2896
|
+
ZodVoid: ds,
|
|
2897
2897
|
ZodArray: Be,
|
|
2898
2898
|
ZodObject: ie,
|
|
2899
2899
|
ZodUnion: xn,
|
|
2900
|
-
ZodDiscriminatedUnion:
|
|
2900
|
+
ZodDiscriminatedUnion: _s,
|
|
2901
2901
|
ZodIntersection: bn,
|
|
2902
2902
|
ZodTuple: Ke,
|
|
2903
2903
|
ZodRecord: wn,
|
|
2904
|
-
ZodMap:
|
|
2904
|
+
ZodMap: us,
|
|
2905
2905
|
ZodSet: Mt,
|
|
2906
2906
|
ZodFunction: Xt,
|
|
2907
2907
|
ZodLazy: En,
|
|
@@ -2915,69 +2915,69 @@ var E = /* @__PURE__ */ Object.freeze({
|
|
|
2915
2915
|
ZodNullable: yt,
|
|
2916
2916
|
ZodDefault: Sn,
|
|
2917
2917
|
ZodCatch: Rn,
|
|
2918
|
-
ZodNaN:
|
|
2919
|
-
BRAND:
|
|
2920
|
-
ZodBranded:
|
|
2921
|
-
ZodPipeline:
|
|
2918
|
+
ZodNaN: hs,
|
|
2919
|
+
BRAND: Fa,
|
|
2920
|
+
ZodBranded: Ri,
|
|
2921
|
+
ZodPipeline: Nn,
|
|
2922
2922
|
ZodReadonly: Mn,
|
|
2923
|
-
custom:
|
|
2923
|
+
custom: Qr,
|
|
2924
2924
|
Schema: X,
|
|
2925
2925
|
ZodSchema: X,
|
|
2926
|
-
late:
|
|
2926
|
+
late: ja,
|
|
2927
2927
|
get ZodFirstPartyTypeKind() {
|
|
2928
2928
|
return B;
|
|
2929
2929
|
},
|
|
2930
|
-
coerce:
|
|
2931
|
-
any:
|
|
2932
|
-
array:
|
|
2933
|
-
bigint:
|
|
2934
|
-
boolean:
|
|
2935
|
-
date:
|
|
2936
|
-
discriminatedUnion:
|
|
2937
|
-
effect:
|
|
2938
|
-
enum:
|
|
2939
|
-
function:
|
|
2940
|
-
instanceof:
|
|
2941
|
-
intersection:
|
|
2942
|
-
lazy:
|
|
2943
|
-
literal:
|
|
2944
|
-
map:
|
|
2945
|
-
nan:
|
|
2946
|
-
nativeEnum:
|
|
2947
|
-
never:
|
|
2948
|
-
null:
|
|
2949
|
-
nullable:
|
|
2950
|
-
number:
|
|
2951
|
-
object:
|
|
2952
|
-
oboolean:
|
|
2953
|
-
onumber:
|
|
2954
|
-
optional:
|
|
2955
|
-
ostring:
|
|
2956
|
-
pipeline:
|
|
2957
|
-
preprocess:
|
|
2958
|
-
promise:
|
|
2959
|
-
record:
|
|
2960
|
-
set:
|
|
2961
|
-
strictObject:
|
|
2962
|
-
string:
|
|
2963
|
-
symbol:
|
|
2964
|
-
transformer:
|
|
2965
|
-
tuple:
|
|
2966
|
-
undefined:
|
|
2967
|
-
union:
|
|
2968
|
-
unknown:
|
|
2969
|
-
void:
|
|
2970
|
-
NEVER:
|
|
2930
|
+
coerce: bc,
|
|
2931
|
+
any: $a,
|
|
2932
|
+
array: Ja,
|
|
2933
|
+
bigint: Va,
|
|
2934
|
+
boolean: no,
|
|
2935
|
+
date: Ga,
|
|
2936
|
+
discriminatedUnion: nc,
|
|
2937
|
+
effect: rr,
|
|
2938
|
+
enum: uc,
|
|
2939
|
+
function: cc,
|
|
2940
|
+
instanceof: Ba,
|
|
2941
|
+
intersection: sc,
|
|
2942
|
+
lazy: lc,
|
|
2943
|
+
literal: dc,
|
|
2944
|
+
map: oc,
|
|
2945
|
+
nan: Ha,
|
|
2946
|
+
nativeEnum: hc,
|
|
2947
|
+
never: Ka,
|
|
2948
|
+
null: Xa,
|
|
2949
|
+
nullable: pc,
|
|
2950
|
+
number: to,
|
|
2951
|
+
object: Qa,
|
|
2952
|
+
oboolean: xc,
|
|
2953
|
+
onumber: vc,
|
|
2954
|
+
optional: mc,
|
|
2955
|
+
ostring: yc,
|
|
2956
|
+
pipeline: gc,
|
|
2957
|
+
preprocess: _c,
|
|
2958
|
+
promise: fc,
|
|
2959
|
+
record: rc,
|
|
2960
|
+
set: ac,
|
|
2961
|
+
strictObject: ec,
|
|
2962
|
+
string: eo,
|
|
2963
|
+
symbol: Za,
|
|
2964
|
+
transformer: rr,
|
|
2965
|
+
tuple: ic,
|
|
2966
|
+
undefined: Wa,
|
|
2967
|
+
union: tc,
|
|
2968
|
+
unknown: Ya,
|
|
2969
|
+
void: qa,
|
|
2970
|
+
NEVER: wc,
|
|
2971
2971
|
ZodIssueCode: A,
|
|
2972
|
-
quotelessJson:
|
|
2972
|
+
quotelessJson: pa,
|
|
2973
2973
|
ZodError: De
|
|
2974
2974
|
});
|
|
2975
|
-
const
|
|
2975
|
+
const Ec = E.object({
|
|
2976
2976
|
latitude: E.number().min(-90).max(90),
|
|
2977
2977
|
longitude: E.number().min(-180).max(180),
|
|
2978
2978
|
/** ISO 8601 instant (interpreted as UTC when no offset is present). */
|
|
2979
2979
|
datetime: E.string().refine((r) => !Number.isNaN(Date.parse(r)), { message: "Invalid ISO datetime" })
|
|
2980
|
-
}),
|
|
2980
|
+
}), Ac = E.object({
|
|
2981
2981
|
color: E.number().default(16711680),
|
|
2982
2982
|
intensity: E.number().default(1),
|
|
2983
2983
|
position: E.tuple([E.number(), E.number(), E.number()]).default([10, 10, 10]),
|
|
@@ -2987,13 +2987,13 @@ const wc = E.object({
|
|
|
2987
2987
|
* true solar position for the given location and moment. Intensity and
|
|
2988
2988
|
* color are treated as midday references and dim/warm toward the horizon.
|
|
2989
2989
|
*/
|
|
2990
|
-
solar:
|
|
2991
|
-
}),
|
|
2990
|
+
solar: Ec.optional()
|
|
2991
|
+
}), Tc = E.object({
|
|
2992
2992
|
type: E.enum(["sky", "hdr", "ultra", "room", "none"]).default("none"),
|
|
2993
2993
|
url: E.string().optional(),
|
|
2994
|
-
sun:
|
|
2994
|
+
sun: Ac.optional(),
|
|
2995
2995
|
transparent: E.boolean().default(!1)
|
|
2996
|
-
}),
|
|
2996
|
+
}), Sc = E.object({
|
|
2997
2997
|
url: E.string(),
|
|
2998
2998
|
color: E.number().optional(),
|
|
2999
2999
|
shadow: E.boolean().default(!1),
|
|
@@ -3015,32 +3015,32 @@ const wc = E.object({
|
|
|
3015
3015
|
fit_offset: E.number().optional(),
|
|
3016
3016
|
height_offset: E.number().optional()
|
|
3017
3017
|
}).optional()
|
|
3018
|
-
}),
|
|
3019
|
-
environment:
|
|
3020
|
-
models: E.array(
|
|
3018
|
+
}), ts = E.object({
|
|
3019
|
+
environment: Tc.default({ type: "none" }),
|
|
3020
|
+
models: E.array(Sc).default([])
|
|
3021
3021
|
});
|
|
3022
|
-
let
|
|
3023
|
-
const
|
|
3022
|
+
let or = "info";
|
|
3023
|
+
const ar = {
|
|
3024
3024
|
silent: 0,
|
|
3025
3025
|
error: 1,
|
|
3026
3026
|
warn: 2,
|
|
3027
3027
|
info: 3,
|
|
3028
3028
|
debug: 4
|
|
3029
3029
|
};
|
|
3030
|
-
function
|
|
3031
|
-
return
|
|
3030
|
+
function Vn(r) {
|
|
3031
|
+
return ar[r] <= ar[or] && or !== "silent";
|
|
3032
3032
|
}
|
|
3033
3033
|
const j = {
|
|
3034
|
-
error: (...r) =>
|
|
3035
|
-
warn: (...r) =>
|
|
3036
|
-
info: (...r) =>
|
|
3037
|
-
debug: (...r) =>
|
|
3034
|
+
error: (...r) => Vn("error") && console.error("[glimmer]", ...r),
|
|
3035
|
+
warn: (...r) => Vn("warn") && console.warn("[glimmer]", ...r),
|
|
3036
|
+
info: (...r) => Vn("info") && console.log("[glimmer]", ...r),
|
|
3037
|
+
debug: (...r) => Vn("debug") && console.log("[glimmer:debug]", ...r)
|
|
3038
3038
|
}, We = class We extends EventTarget {
|
|
3039
3039
|
constructor(t) {
|
|
3040
3040
|
super();
|
|
3041
3041
|
_(this, "settings");
|
|
3042
3042
|
try {
|
|
3043
|
-
const n =
|
|
3043
|
+
const n = ts.parse({}), s = {
|
|
3044
3044
|
...n,
|
|
3045
3045
|
...t,
|
|
3046
3046
|
environment: {
|
|
@@ -3049,7 +3049,7 @@ const j = {
|
|
|
3049
3049
|
},
|
|
3050
3050
|
models: t.models || n.models
|
|
3051
3051
|
};
|
|
3052
|
-
this.settings =
|
|
3052
|
+
this.settings = ts.parse(s), j.info("Settings initialized:", this.settings);
|
|
3053
3053
|
} catch (n) {
|
|
3054
3054
|
throw j.error("Error initializing settings:", n), n;
|
|
3055
3055
|
}
|
|
@@ -3072,7 +3072,7 @@ const j = {
|
|
|
3072
3072
|
return this.settings[t];
|
|
3073
3073
|
}
|
|
3074
3074
|
update(t) {
|
|
3075
|
-
const n =
|
|
3075
|
+
const n = ts.parse({
|
|
3076
3076
|
...this.settings,
|
|
3077
3077
|
...t,
|
|
3078
3078
|
environment: {
|
|
@@ -3109,8 +3109,8 @@ const j = {
|
|
|
3109
3109
|
}
|
|
3110
3110
|
};
|
|
3111
3111
|
_(We, "instance");
|
|
3112
|
-
let
|
|
3113
|
-
const
|
|
3112
|
+
let oi = We;
|
|
3113
|
+
const cr = { type: "change" }, Mi = { type: "start" }, so = { type: "end" }, Gn = new Co(), lr = new Oo(), Rc = Math.cos(70 * bi.DEG2RAD), ce = new J(), Le = 2 * Math.PI, te = {
|
|
3114
3114
|
NONE: -1,
|
|
3115
3115
|
ROTATE: 0,
|
|
3116
3116
|
DOLLY: 1,
|
|
@@ -3119,8 +3119,8 @@ const ar = { type: "change" }, Ri = { type: "start" }, no = { type: "end" }, Vn
|
|
|
3119
3119
|
TOUCH_PAN: 4,
|
|
3120
3120
|
TOUCH_DOLLY_PAN: 5,
|
|
3121
3121
|
TOUCH_DOLLY_ROTATE: 6
|
|
3122
|
-
},
|
|
3123
|
-
class
|
|
3122
|
+
}, Os = 1e-6;
|
|
3123
|
+
class Mc extends ko {
|
|
3124
3124
|
/**
|
|
3125
3125
|
* Constructs a new controls instance.
|
|
3126
3126
|
*
|
|
@@ -3128,7 +3128,7 @@ class Rc extends Lo {
|
|
|
3128
3128
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
3129
3129
|
*/
|
|
3130
3130
|
constructor(e, t = null) {
|
|
3131
|
-
super(e, t), this.state = te.NONE, this.target = new J(), this.cursor = new J(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Wt.ROTATE, MIDDLE: Wt.DOLLY, RIGHT: Wt.PAN }, this.touches = { ONE: Bt.ROTATE, TWO: Bt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new J(), this._lastQuaternion = new
|
|
3131
|
+
super(e, t), this.state = te.NONE, this.target = new J(), this.cursor = new J(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Wt.ROTATE, MIDDLE: Wt.DOLLY, RIGHT: Wt.PAN }, this.touches = { ONE: Bt.ROTATE, TWO: Bt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new J(), this._lastQuaternion = new is(), this._lastTargetPosition = new J(), this._quat = new is().setFromUnitVectors(e.up, new J(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ki(), this._sphericalDelta = new Ki(), this._scale = 1, this._panOffset = new J(), this._rotateStart = new ke(), this._rotateEnd = new ke(), this._rotateDelta = new ke(), this._panStart = new ke(), this._panEnd = new ke(), this._panDelta = new ke(), this._dollyStart = new ke(), this._dollyEnd = new ke(), this._dollyDelta = new ke(), this._dollyDirection = new J(), this._mouse = new ke(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = kc.bind(this), this._onPointerDown = Lc.bind(this), this._onPointerUp = Cc.bind(this), this._onContextMenu = Uc.bind(this), this._onMouseWheel = Ic.bind(this), this._onKeyDown = Nc.bind(this), this._onTouchStart = Pc.bind(this), this._onTouchMove = zc.bind(this), this._onMouseDown = Oc.bind(this), this._onMouseMove = Dc.bind(this), this._interceptControlDown = Fc.bind(this), this._interceptControlUp = jc.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
3132
3132
|
}
|
|
3133
3133
|
connect(e) {
|
|
3134
3134
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
@@ -3189,7 +3189,7 @@ class Rc extends Lo {
|
|
|
3189
3189
|
* was called, or the initial state.
|
|
3190
3190
|
*/
|
|
3191
3191
|
reset() {
|
|
3192
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
3192
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(cr), this.update(), this.state = te.NONE;
|
|
3193
3193
|
}
|
|
3194
3194
|
update(e = null) {
|
|
3195
3195
|
const t = this.object.position;
|
|
@@ -3219,12 +3219,12 @@ class Rc extends Lo {
|
|
|
3219
3219
|
l.unproject(this.object), this.object.position.sub(l).add(a), this.object.updateMatrixWorld(), o = ce.length();
|
|
3220
3220
|
} else
|
|
3221
3221
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
3222
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (
|
|
3222
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Gn.origin.copy(this.object.position), Gn.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Gn.direction)) < Rc ? this.object.lookAt(this.target) : (lr.setFromNormalAndCoplanarPoint(this.object.up, this.target), Gn.intersectPlane(lr, this.target))));
|
|
3223
3223
|
} else if (this.object.isOrthographicCamera) {
|
|
3224
3224
|
const o = this.object.zoom;
|
|
3225
3225
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
3226
3226
|
}
|
|
3227
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) >
|
|
3227
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > Os || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Os || this._lastTargetPosition.distanceToSquared(this.target) > Os ? (this.dispatchEvent(cr), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
3228
3228
|
}
|
|
3229
3229
|
_getAutoRotationAngle(e) {
|
|
3230
3230
|
return e !== null ? Le / 60 * this.autoRotateSpeed * e : Le / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -3392,7 +3392,7 @@ class Rc extends Lo {
|
|
|
3392
3392
|
}
|
|
3393
3393
|
_trackPointer(e) {
|
|
3394
3394
|
let t = this._pointerPositions[e.pointerId];
|
|
3395
|
-
t === void 0 && (t = new
|
|
3395
|
+
t === void 0 && (t = new ke(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
|
|
3396
3396
|
}
|
|
3397
3397
|
_getSecondPointerPosition(e) {
|
|
3398
3398
|
const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -3416,16 +3416,16 @@ class Rc extends Lo {
|
|
|
3416
3416
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
3417
3417
|
}
|
|
3418
3418
|
}
|
|
3419
|
-
function
|
|
3419
|
+
function Lc(r) {
|
|
3420
3420
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(r.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(r) && (this._addPointer(r), r.pointerType === "touch" ? this._onTouchStart(r) : this._onMouseDown(r)));
|
|
3421
3421
|
}
|
|
3422
|
-
function
|
|
3422
|
+
function kc(r) {
|
|
3423
3423
|
this.enabled !== !1 && (r.pointerType === "touch" ? this._onTouchMove(r) : this._onMouseMove(r));
|
|
3424
3424
|
}
|
|
3425
3425
|
function Cc(r) {
|
|
3426
3426
|
switch (this._removePointer(r), this._pointers.length) {
|
|
3427
3427
|
case 0:
|
|
3428
|
-
this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
3428
|
+
this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(so), this.state = te.NONE;
|
|
3429
3429
|
break;
|
|
3430
3430
|
case 1:
|
|
3431
3431
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -3474,9 +3474,9 @@ function Oc(r) {
|
|
|
3474
3474
|
default:
|
|
3475
3475
|
this.state = te.NONE;
|
|
3476
3476
|
}
|
|
3477
|
-
this.state !== te.NONE && this.dispatchEvent(
|
|
3477
|
+
this.state !== te.NONE && this.dispatchEvent(Mi);
|
|
3478
3478
|
}
|
|
3479
|
-
function
|
|
3479
|
+
function Dc(r) {
|
|
3480
3480
|
switch (this.state) {
|
|
3481
3481
|
case te.ROTATE:
|
|
3482
3482
|
if (this.enableRotate === !1) return;
|
|
@@ -3492,13 +3492,13 @@ function kc(r) {
|
|
|
3492
3492
|
break;
|
|
3493
3493
|
}
|
|
3494
3494
|
}
|
|
3495
|
-
function Dc(r) {
|
|
3496
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== te.NONE || (r.preventDefault(), this.dispatchEvent(Ri), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(no));
|
|
3497
|
-
}
|
|
3498
3495
|
function Ic(r) {
|
|
3499
|
-
this.enabled
|
|
3496
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== te.NONE || (r.preventDefault(), this.dispatchEvent(Mi), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(so));
|
|
3500
3497
|
}
|
|
3501
3498
|
function Nc(r) {
|
|
3499
|
+
this.enabled !== !1 && this._handleKeyDown(r);
|
|
3500
|
+
}
|
|
3501
|
+
function Pc(r) {
|
|
3502
3502
|
switch (this._trackPointer(r), this._pointers.length) {
|
|
3503
3503
|
case 1:
|
|
3504
3504
|
switch (this.touches.ONE) {
|
|
@@ -3531,9 +3531,9 @@ function Nc(r) {
|
|
|
3531
3531
|
default:
|
|
3532
3532
|
this.state = te.NONE;
|
|
3533
3533
|
}
|
|
3534
|
-
this.state !== te.NONE && this.dispatchEvent(
|
|
3534
|
+
this.state !== te.NONE && this.dispatchEvent(Mi);
|
|
3535
3535
|
}
|
|
3536
|
-
function
|
|
3536
|
+
function zc(r) {
|
|
3537
3537
|
switch (this._trackPointer(r), this.state) {
|
|
3538
3538
|
case te.TOUCH_ROTATE:
|
|
3539
3539
|
if (this.enableRotate === !1) return;
|
|
@@ -3555,16 +3555,16 @@ function Pc(r) {
|
|
|
3555
3555
|
this.state = te.NONE;
|
|
3556
3556
|
}
|
|
3557
3557
|
}
|
|
3558
|
-
function
|
|
3558
|
+
function Uc(r) {
|
|
3559
3559
|
this.enabled !== !1 && r.preventDefault();
|
|
3560
3560
|
}
|
|
3561
|
-
function
|
|
3561
|
+
function Fc(r) {
|
|
3562
3562
|
r.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
3563
3563
|
}
|
|
3564
|
-
function
|
|
3564
|
+
function jc(r) {
|
|
3565
3565
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
3566
3566
|
}
|
|
3567
|
-
class
|
|
3567
|
+
class Bc {
|
|
3568
3568
|
constructor(e) {
|
|
3569
3569
|
_(this, "group");
|
|
3570
3570
|
_(this, "sphere");
|
|
@@ -3638,7 +3638,7 @@ class jc {
|
|
|
3638
3638
|
this.scene.remove(this.group), this.sphere.geometry.dispose(), this.sphere.material.dispose(), this.arrow.dispose();
|
|
3639
3639
|
}
|
|
3640
3640
|
}
|
|
3641
|
-
class
|
|
3641
|
+
class Hc extends EventTarget {
|
|
3642
3642
|
constructor(t, n, s, i) {
|
|
3643
3643
|
super();
|
|
3644
3644
|
_(this, "camera");
|
|
@@ -3713,7 +3713,7 @@ class Bc extends EventTarget {
|
|
|
3713
3713
|
this.stop_animation(), this._orbit_restart_timeout_id && (clearTimeout(this._orbit_restart_timeout_id), this._orbit_restart_timeout_id = void 0);
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
|
-
class
|
|
3716
|
+
class Vc {
|
|
3717
3717
|
/**
|
|
3718
3718
|
* Create a new RaycastHelper.
|
|
3719
3719
|
* @param camera - The camera to raycast from
|
|
@@ -3752,7 +3752,7 @@ class Hc {
|
|
|
3752
3752
|
return this.raycaster;
|
|
3753
3753
|
}
|
|
3754
3754
|
}
|
|
3755
|
-
class
|
|
3755
|
+
class Gc extends EventTarget {
|
|
3756
3756
|
/**
|
|
3757
3757
|
* Create a new Viewer instance.
|
|
3758
3758
|
* @param container The HTML element where the viewer will be rendered.
|
|
@@ -3801,7 +3801,7 @@ class Vc extends EventTarget {
|
|
|
3801
3801
|
});
|
|
3802
3802
|
this.scene = new p.Scene(), this.settings = n, this.container = t, this.renderer = new p.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(t.clientWidth, t.clientHeight), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(t.clientWidth, t.clientHeight), this.renderer.toneMapping = p.ACESFilmicToneMapping, this.renderer.outputColorSpace = p.SRGBColorSpace, this.container.appendChild(this.renderer.domElement);
|
|
3803
3803
|
const s = t.clientWidth / t.clientHeight;
|
|
3804
|
-
this.camera = new p.PerspectiveCamera(75, s, 0.1, 1e3), this.camera.position.set(0, 2, 5), this.controls = new
|
|
3804
|
+
this.camera = new p.PerspectiveCamera(75, s, 0.1, 1e3), this.camera.position.set(0, 2, 5), this.controls = new Mc(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.orbit_controller = new Hc(this.camera, this.controls, this.renderer, this.scene), this.raycast_helper = new Vc(this.camera, this.renderer.domElement, this.scene.children), this._setup_orbit_animation_user_override(), window.addEventListener("resize", this._resize_handler), this.animate(), j.info("Viewer: Initializing...");
|
|
3805
3805
|
}
|
|
3806
3806
|
/*
|
|
3807
3807
|
* Animation Mixers
|
|
@@ -3925,7 +3925,7 @@ class Vc extends EventTarget {
|
|
|
3925
3925
|
* @param objects - Optional array of objects to raycast against
|
|
3926
3926
|
*/
|
|
3927
3927
|
enable_3d_cursor(t) {
|
|
3928
|
-
this.cursor_3d || (this.cursor_3d = new
|
|
3928
|
+
this.cursor_3d || (this.cursor_3d = new Bc(this.scene)), this.cursor_3d.enable(), this._cursor_3d_mouse_handler = (n) => {
|
|
3929
3929
|
var i;
|
|
3930
3930
|
const s = this.raycast_from_event(n, t);
|
|
3931
3931
|
(i = this.cursor_3d) == null || i.update(s);
|
|
@@ -3960,7 +3960,7 @@ class Vc extends EventTarget {
|
|
|
3960
3960
|
this.orbit_controller.dispose(), this.disable_3d_cursor(), this.cursor_3d && (this.cursor_3d.dispose(), this.cursor_3d = void 0), window.removeEventListener("resize", this._resize_handler), this.animation_mixers.clear(), this.animation_callbacks.clear(), this.renderer.dispose(), this.renderer.domElement && this.renderer.domElement.parentElement && this.renderer.domElement.parentElement.removeChild(this.renderer.domElement), this._resolution_materials.clear();
|
|
3961
3961
|
}
|
|
3962
3962
|
}
|
|
3963
|
-
class
|
|
3963
|
+
class Zc extends Do {
|
|
3964
3964
|
/**
|
|
3965
3965
|
* Constructs a new RGBE loader.
|
|
3966
3966
|
*
|
|
@@ -3989,14 +3989,14 @@ class Gc extends ko {
|
|
|
3989
3989
|
throw new Error("THREE.RGBELoader: Memory Error: " + (R || ""));
|
|
3990
3990
|
}
|
|
3991
3991
|
}, d = `
|
|
3992
|
-
`, u = function(L, R,
|
|
3992
|
+
`, u = function(L, R, C) {
|
|
3993
3993
|
R = R || 1024;
|
|
3994
|
-
let G = L.pos, Z = -1,
|
|
3995
|
-
for (; 0 > (Z = $.indexOf(d)) &&
|
|
3996
|
-
ee += $,
|
|
3997
|
-
return -1 < Z ? (L.pos +=
|
|
3994
|
+
let G = L.pos, Z = -1, O = 0, ee = "", $ = String.fromCharCode.apply(null, new Uint16Array(L.subarray(G, G + 128)));
|
|
3995
|
+
for (; 0 > (Z = $.indexOf(d)) && O < R && G < L.byteLength; )
|
|
3996
|
+
ee += $, O += $.length, G += 128, $ += String.fromCharCode.apply(null, new Uint16Array(L.subarray(G, G + 128)));
|
|
3997
|
+
return -1 < Z ? (L.pos += O + Z + 1, ee + $.slice(0, Z)) : !1;
|
|
3998
3998
|
}, h = function(L) {
|
|
3999
|
-
const R = /^#\?(\S+)/,
|
|
3999
|
+
const R = /^#\?(\S+)/, C = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/, N = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/, G = /^\s*FORMAT=(\S+)\s*$/, Z = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/, O = {
|
|
4000
4000
|
valid: 0,
|
|
4001
4001
|
/* indicate which fields are valid */
|
|
4002
4002
|
string: "",
|
|
@@ -4016,18 +4016,18 @@ class Gc extends ko {
|
|
|
4016
4016
|
/* image dimensions, width/height */
|
|
4017
4017
|
};
|
|
4018
4018
|
let ee, $;
|
|
4019
|
-
for ((L.pos >= L.byteLength || !(ee = u(L))) && o(1, "no header found"), ($ = ee.match(R)) || o(3, "bad initial token"),
|
|
4019
|
+
for ((L.pos >= L.byteLength || !(ee = u(L))) && o(1, "no header found"), ($ = ee.match(R)) || o(3, "bad initial token"), O.valid |= 1, O.programtype = $[1], O.string += ee + `
|
|
4020
4020
|
`; ee = u(L), ee !== !1; ) {
|
|
4021
|
-
if (
|
|
4021
|
+
if (O.string += ee + `
|
|
4022
4022
|
`, ee.charAt(0) === "#") {
|
|
4023
|
-
|
|
4023
|
+
O.comments += ee + `
|
|
4024
4024
|
`;
|
|
4025
4025
|
continue;
|
|
4026
4026
|
}
|
|
4027
|
-
if (($ = ee.match(
|
|
4027
|
+
if (($ = ee.match(C)) && (O.gamma = parseFloat($[1])), ($ = ee.match(N)) && (O.exposure = parseFloat($[1])), ($ = ee.match(G)) && (O.valid |= 2, O.format = $[1]), ($ = ee.match(Z)) && (O.valid |= 4, O.height = parseInt($[1], 10), O.width = parseInt($[2], 10)), O.valid & 2 && O.valid & 4) break;
|
|
4028
4028
|
}
|
|
4029
|
-
return
|
|
4030
|
-
}, f = function(L, R,
|
|
4029
|
+
return O.valid & 2 || o(3, "missing format specifier"), O.valid & 4 || o(3, "missing image size specifier"), O;
|
|
4030
|
+
}, f = function(L, R, C) {
|
|
4031
4031
|
const N = R;
|
|
4032
4032
|
if (
|
|
4033
4033
|
// run length encoding is not allowed so read flat
|
|
@@ -4036,23 +4036,23 @@ class Gc extends ko {
|
|
|
4036
4036
|
)
|
|
4037
4037
|
return new Uint8Array(L);
|
|
4038
4038
|
N !== (L[2] << 8 | L[3]) && o(3, "wrong scanline width");
|
|
4039
|
-
const G = new Uint8Array(4 * R *
|
|
4039
|
+
const G = new Uint8Array(4 * R * C);
|
|
4040
4040
|
G.length || o(4, "unable to allocate buffer space");
|
|
4041
|
-
let Z = 0,
|
|
4041
|
+
let Z = 0, O = 0;
|
|
4042
4042
|
const ee = 4 * N, $ = new Uint8Array(4), be = new Uint8Array(ee);
|
|
4043
|
-
let le =
|
|
4044
|
-
for (; le > 0 &&
|
|
4045
|
-
|
|
4043
|
+
let le = C;
|
|
4044
|
+
for (; le > 0 && O < L.byteLength; ) {
|
|
4045
|
+
O + 4 > L.byteLength && o(1), $[0] = L[O++], $[1] = L[O++], $[2] = L[O++], $[3] = L[O++], ($[0] != 2 || $[1] != 2 || ($[2] << 8 | $[3]) != N) && o(3, "bad rgbe scanline format");
|
|
4046
4046
|
let Ue = 0, Se;
|
|
4047
|
-
for (; Ue < ee &&
|
|
4048
|
-
Se = L[
|
|
4047
|
+
for (; Ue < ee && O < L.byteLength; ) {
|
|
4048
|
+
Se = L[O++];
|
|
4049
4049
|
const ue = Se > 128;
|
|
4050
4050
|
if (ue && (Se -= 128), (Se === 0 || Ue + Se > ee) && o(3, "bad scanline data"), ue) {
|
|
4051
|
-
const Q = L[
|
|
4051
|
+
const Q = L[O++];
|
|
4052
4052
|
for (let ut = 0; ut < Se; ut++)
|
|
4053
4053
|
be[Ue++] = Q;
|
|
4054
4054
|
} else
|
|
4055
|
-
be.set(L.subarray(
|
|
4055
|
+
be.set(L.subarray(O, O + Se), Ue), Ue += Se, O += Se;
|
|
4056
4056
|
}
|
|
4057
4057
|
const ne = N;
|
|
4058
4058
|
for (let ue = 0; ue < ne; ue++) {
|
|
@@ -4062,12 +4062,12 @@ class Gc extends ko {
|
|
|
4062
4062
|
le--;
|
|
4063
4063
|
}
|
|
4064
4064
|
return G;
|
|
4065
|
-
}, g = function(L, R,
|
|
4065
|
+
}, g = function(L, R, C, N) {
|
|
4066
4066
|
const G = L[R + 3], Z = Math.pow(2, G - 128) / 255;
|
|
4067
|
-
|
|
4068
|
-
}, y = function(L, R,
|
|
4067
|
+
C[N + 0] = L[R + 0] * Z, C[N + 1] = L[R + 1] * Z, C[N + 2] = L[R + 2] * Z, C[N + 3] = 1;
|
|
4068
|
+
}, y = function(L, R, C, N) {
|
|
4069
4069
|
const G = L[R + 3], Z = Math.pow(2, G - 128) / 255;
|
|
4070
|
-
|
|
4070
|
+
C[N + 0] = dn.toHalfFloat(Math.min(L[R + 0] * Z, 65504)), C[N + 1] = dn.toHalfFloat(Math.min(L[R + 1] * Z, 65504)), C[N + 2] = dn.toHalfFloat(Math.min(L[R + 2] * Z, 65504)), C[N + 3] = dn.toHalfFloat(1);
|
|
4071
4071
|
}, x = new Uint8Array(e);
|
|
4072
4072
|
x.pos = 0;
|
|
4073
4073
|
const b = h(x), w = b.width, T = b.height, v = f(x.subarray(x.pos), w, T);
|
|
@@ -4076,15 +4076,15 @@ class Gc extends ko {
|
|
|
4076
4076
|
case Ms:
|
|
4077
4077
|
F = v.length / 4;
|
|
4078
4078
|
const L = new Float32Array(F * 4);
|
|
4079
|
-
for (let
|
|
4080
|
-
g(v,
|
|
4079
|
+
for (let C = 0; C < F; C++)
|
|
4080
|
+
g(v, C * 4, L, C * 4);
|
|
4081
4081
|
P = L, V = Ms;
|
|
4082
4082
|
break;
|
|
4083
4083
|
case ft:
|
|
4084
4084
|
F = v.length / 4;
|
|
4085
4085
|
const R = new Uint16Array(F * 4);
|
|
4086
|
-
for (let
|
|
4087
|
-
y(v,
|
|
4086
|
+
for (let C = 0; C < F; C++)
|
|
4087
|
+
y(v, C * 4, R, C * 4);
|
|
4088
4088
|
P = R, V = ft;
|
|
4089
4089
|
break;
|
|
4090
4090
|
default:
|
|
@@ -4122,10 +4122,10 @@ class Gc extends ko {
|
|
|
4122
4122
|
return super.load(e, i, n, s);
|
|
4123
4123
|
}
|
|
4124
4124
|
}
|
|
4125
|
-
const
|
|
4125
|
+
const Wc = Array(1024).fill(0).map(
|
|
4126
4126
|
(r, e) => Math.pow(e / 255 * 0.9478672986 + 0.0521327014, 2.4)
|
|
4127
4127
|
);
|
|
4128
|
-
class
|
|
4128
|
+
class Xc extends wi {
|
|
4129
4129
|
/**
|
|
4130
4130
|
* Constructs a new Ultra HDR loader.
|
|
4131
4131
|
*
|
|
@@ -4234,7 +4234,7 @@ class Wc extends bi {
|
|
|
4234
4234
|
width: u,
|
|
4235
4235
|
height: h,
|
|
4236
4236
|
data: d,
|
|
4237
|
-
format:
|
|
4237
|
+
format: qi,
|
|
4238
4238
|
type: this.type
|
|
4239
4239
|
});
|
|
4240
4240
|
},
|
|
@@ -4256,17 +4256,17 @@ class Wc extends bi {
|
|
|
4256
4256
|
* @return {DataTexture} The Ultra HDR texture.
|
|
4257
4257
|
*/
|
|
4258
4258
|
load(e, t, n, s) {
|
|
4259
|
-
const i = new
|
|
4259
|
+
const i = new Io(
|
|
4260
4260
|
this.type === ft ? new Uint16Array() : new Float32Array(),
|
|
4261
4261
|
0,
|
|
4262
4262
|
0,
|
|
4263
|
-
|
|
4263
|
+
qi,
|
|
4264
4264
|
this.type,
|
|
4265
|
-
Io,
|
|
4266
|
-
Ks,
|
|
4267
|
-
Ks,
|
|
4268
|
-
Yt,
|
|
4269
4265
|
No,
|
|
4266
|
+
qs,
|
|
4267
|
+
qs,
|
|
4268
|
+
Yt,
|
|
4269
|
+
Po,
|
|
4270
4270
|
1,
|
|
4271
4271
|
Pe
|
|
4272
4272
|
);
|
|
@@ -4319,7 +4319,7 @@ class Wc extends bi {
|
|
|
4319
4319
|
}
|
|
4320
4320
|
}
|
|
4321
4321
|
_srgbToLinear(e) {
|
|
4322
|
-
return e / 255 < 0.04045 ? e / 255 * 0.0773993808 : e < 1024 ?
|
|
4322
|
+
return e / 255 < 0.04045 ? e / 255 * 0.0773993808 : e < 1024 ? Wc[~~e] : Math.pow(e / 255 * 0.9478672986 + 0.0521327014, 2.4);
|
|
4323
4323
|
}
|
|
4324
4324
|
_applyGainmapToSDR(e, t, n, s, i) {
|
|
4325
4325
|
const o = (a) => new Promise((c, l) => {
|
|
@@ -4393,11 +4393,11 @@ class Wc extends bi {
|
|
|
4393
4393
|
for (let v = 0; v < g.data.length; v += 4) {
|
|
4394
4394
|
const P = v / 4 % a.width, V = Math.floor(v / 4 / a.width);
|
|
4395
4395
|
for (let F = 0; F < 3; F++) {
|
|
4396
|
-
const L = g.data[v + F], R = (V * a.width + P) * 4 + F,
|
|
4396
|
+
const L = g.data[v + F], R = (V * a.width + P) * 4 + F, C = f.data[R] / 255, N = T ? C : Math.pow(C, 1 / e.gamma), G = e.gainMapMin * (1 - N) + e.gainMapMax * N, Z = (L + e.offsetSDR) * (G * w === 0 ? 1 : Math.pow(2, G * w)) - e.offsetHDR, O = Math.min(
|
|
4397
4397
|
Math.max(this._srgbToLinear(Z), 0),
|
|
4398
4398
|
65504
|
|
4399
4399
|
);
|
|
4400
|
-
y[v + F] = this.type === ft ? dn.toHalfFloat(
|
|
4400
|
+
y[v + F] = this.type === ft ? dn.toHalfFloat(O) : O;
|
|
4401
4401
|
}
|
|
4402
4402
|
}
|
|
4403
4403
|
s(y, a.width, a.height);
|
|
@@ -4408,23 +4408,23 @@ class Wc extends bi {
|
|
|
4408
4408
|
});
|
|
4409
4409
|
}
|
|
4410
4410
|
}
|
|
4411
|
-
class
|
|
4411
|
+
class Ln extends ye {
|
|
4412
4412
|
/**
|
|
4413
4413
|
* Constructs a new skydome.
|
|
4414
4414
|
*/
|
|
4415
4415
|
constructor() {
|
|
4416
|
-
const e =
|
|
4416
|
+
const e = Ln.SkyShader, t = new Ei({
|
|
4417
4417
|
name: e.name,
|
|
4418
|
-
uniforms:
|
|
4418
|
+
uniforms: Ai.clone(e.uniforms),
|
|
4419
4419
|
vertexShader: e.vertexShader,
|
|
4420
4420
|
fragmentShader: e.fragmentShader,
|
|
4421
|
-
side:
|
|
4421
|
+
side: Ur,
|
|
4422
4422
|
depthWrite: !1
|
|
4423
4423
|
});
|
|
4424
|
-
super(new
|
|
4424
|
+
super(new Fr(1, 1, 1), t), this.isSky = !0;
|
|
4425
4425
|
}
|
|
4426
4426
|
}
|
|
4427
|
-
|
|
4427
|
+
Ln.SkyShader = {
|
|
4428
4428
|
name: "SkyShader",
|
|
4429
4429
|
uniforms: {
|
|
4430
4430
|
turbidity: { value: 2 },
|
|
@@ -4596,12 +4596,12 @@ _s.SkyShader = {
|
|
|
4596
4596
|
}`
|
|
4597
4597
|
)
|
|
4598
4598
|
};
|
|
4599
|
-
class
|
|
4599
|
+
class $c extends zo {
|
|
4600
4600
|
constructor() {
|
|
4601
4601
|
super();
|
|
4602
|
-
const e = new
|
|
4602
|
+
const e = new Fr();
|
|
4603
4603
|
e.deleteAttribute("uv");
|
|
4604
|
-
const t = new
|
|
4604
|
+
const t = new rs({ side: Ur }), n = new rs(), s = new jr(16777215, 900, 28, 2);
|
|
4605
4605
|
s.position.set(0.418, 16.199, 0.3), this.add(s);
|
|
4606
4606
|
const i = new ye(e, t);
|
|
4607
4607
|
i.position.set(-0.757, 13.219, 0.717), i.scale.set(31.713, 28.305, 28.591), this.add(i);
|
|
@@ -4678,7 +4678,7 @@ class ve extends Error {
|
|
|
4678
4678
|
return `${this.name} [${this.component}:${this.code}]: ${this.message}`;
|
|
4679
4679
|
}
|
|
4680
4680
|
}
|
|
4681
|
-
const
|
|
4681
|
+
const Ce = {
|
|
4682
4682
|
INITIALIZATION_FAILED: "INITIALIZATION_FAILED",
|
|
4683
4683
|
// Environment errors
|
|
4684
4684
|
HDR_LOAD_FAILED: "HDR_LOAD_FAILED",
|
|
@@ -4690,7 +4690,11 @@ const Oe = {
|
|
|
4690
4690
|
INVALID_STORY_JSON: "INVALID_STORY_JSON",
|
|
4691
4691
|
INVALID_SLIDE_INDEX: "INVALID_SLIDE_INDEX"
|
|
4692
4692
|
};
|
|
4693
|
-
|
|
4693
|
+
function Ds(r) {
|
|
4694
|
+
const e = r;
|
|
4695
|
+
e && typeof e.dispose == "function" && e.dispose();
|
|
4696
|
+
}
|
|
4697
|
+
class Yc extends EventTarget {
|
|
4694
4698
|
constructor(t, n) {
|
|
4695
4699
|
super();
|
|
4696
4700
|
_(this, "settings");
|
|
@@ -4704,6 +4708,9 @@ class $c extends EventTarget {
|
|
|
4704
4708
|
_(this, "env_map", null);
|
|
4705
4709
|
_(this, "sky", null);
|
|
4706
4710
|
_(this, "Sun", null);
|
|
4711
|
+
_(this, "sky_pmrem", null);
|
|
4712
|
+
_(this, "sky_env_rt", null);
|
|
4713
|
+
_(this, "last_sky_dir", null);
|
|
4707
4714
|
this.viewer = t, this.settings = n, this.renderer = t.renderer, this.scene = t.scene, this.settings.addEventListener("update", (s) => {
|
|
4708
4715
|
const i = s.detail;
|
|
4709
4716
|
this.update(i.environment);
|
|
@@ -4732,7 +4739,7 @@ class $c extends EventTarget {
|
|
|
4732
4739
|
const o = new ve(
|
|
4733
4740
|
`Failed to update environment: ${i instanceof Error ? i.message : i}`,
|
|
4734
4741
|
"Environment",
|
|
4735
|
-
|
|
4742
|
+
Ce.ENVIRONMENT_UPDATE_FAILED,
|
|
4736
4743
|
{ type: n, url: s, error: i }
|
|
4737
4744
|
);
|
|
4738
4745
|
throw this.dispatchEvent(
|
|
@@ -4743,16 +4750,43 @@ class $c extends EventTarget {
|
|
|
4743
4750
|
}
|
|
4744
4751
|
}
|
|
4745
4752
|
clear_environment() {
|
|
4746
|
-
this.scene.background = null, this.scene.environment = null, this.sky = null, this.texture = null;
|
|
4753
|
+
this.scene.background = null, this.scene.environment = null, this.sky = null, this.texture = null, this.last_sky_dir = null, this.sky_env_rt && (Ds(this.sky_env_rt), this.sky_env_rt = null);
|
|
4747
4754
|
}
|
|
4748
4755
|
set_sky_environment() {
|
|
4749
|
-
const t = new
|
|
4756
|
+
const t = new Ln();
|
|
4750
4757
|
t.scale.setScalar(45e4);
|
|
4751
4758
|
const n = p.MathUtils.degToRad(90), s = p.MathUtils.degToRad(180), i = new p.Vector3().setFromSphericalCoords(1, n, s);
|
|
4752
|
-
t.material.uniforms.sunPosition.value = i, this.sky = t, this.scene.add(this.sky);
|
|
4759
|
+
t.material.uniforms.sunPosition.value = i, this.sky = t, this.scene.add(this.sky), this.update_sky_environment(i);
|
|
4760
|
+
}
|
|
4761
|
+
/**
|
|
4762
|
+
* Point the sky dome's sun disc at the given direction and rebuild the
|
|
4763
|
+
* image-based ambient light (scene.environment) from the sky, so both the
|
|
4764
|
+
* visible sky and the ambient light follow the sun. Skips the rebuild when
|
|
4765
|
+
* the direction barely changed (e.g. during slider drags).
|
|
4766
|
+
*/
|
|
4767
|
+
update_sky_environment(t) {
|
|
4768
|
+
if (this.sky)
|
|
4769
|
+
try {
|
|
4770
|
+
const n = t, s = Math.hypot((n == null ? void 0 : n.x) ?? 0, (n == null ? void 0 : n.y) ?? 1, (n == null ? void 0 : n.z) ?? 0) || 1, i = new p.Vector3(((n == null ? void 0 : n.x) ?? 0) / s, ((n == null ? void 0 : n.y) ?? 1) / s, ((n == null ? void 0 : n.z) ?? 0) / s);
|
|
4771
|
+
if (this.last_sky_dir && this.last_sky_dir.angleTo(i) < p.MathUtils.degToRad(0.5))
|
|
4772
|
+
return;
|
|
4773
|
+
this.last_sky_dir = i.clone();
|
|
4774
|
+
const o = this.sky.material.uniforms;
|
|
4775
|
+
o.sunPosition.value.copy(i);
|
|
4776
|
+
const a = new Ln();
|
|
4777
|
+
a.scale.setScalar(100);
|
|
4778
|
+
const c = a.material.uniforms;
|
|
4779
|
+
c.sunPosition.value.copy(i), c.turbidity.value = o.turbidity.value, c.rayleigh.value = o.rayleigh.value, a.updateMatrixWorld(!0);
|
|
4780
|
+
const l = new p.Scene();
|
|
4781
|
+
l.add(a), this.sky_pmrem || (this.sky_pmrem = new p.PMREMGenerator(this.renderer));
|
|
4782
|
+
const d = this.sky_pmrem.fromScene(l, 0, 0.1, 500);
|
|
4783
|
+
this.sky_env_rt && this.sky_env_rt.dispose(), this.sky_env_rt = d, this.scene.environment = d.texture, l.remove(a), a.geometry.dispose(), a.material.dispose();
|
|
4784
|
+
} catch (n) {
|
|
4785
|
+
j.warn("Skipping sky environment rebuild:", n);
|
|
4786
|
+
}
|
|
4753
4787
|
}
|
|
4754
4788
|
set_room_environment() {
|
|
4755
|
-
const t = new
|
|
4789
|
+
const t = new $c(), s = new p.PMREMGenerator(this.renderer).fromScene(t).texture;
|
|
4756
4790
|
this.scene.background = s, this.scene.environment = s;
|
|
4757
4791
|
}
|
|
4758
4792
|
set_color_environment(t = 16777215) {
|
|
@@ -4761,7 +4795,7 @@ class $c extends EventTarget {
|
|
|
4761
4795
|
async set_hdr_environment(t, n = !1) {
|
|
4762
4796
|
const s = new p.PMREMGenerator(this.renderer);
|
|
4763
4797
|
s.compileEquirectangularShader();
|
|
4764
|
-
const i = n ? new
|
|
4798
|
+
const i = n ? new Xc() : new Zc();
|
|
4765
4799
|
await new Promise((o, a) => {
|
|
4766
4800
|
i.load(
|
|
4767
4801
|
t,
|
|
@@ -4777,7 +4811,7 @@ class $c extends EventTarget {
|
|
|
4777
4811
|
void 0,
|
|
4778
4812
|
(c) => {
|
|
4779
4813
|
j.error("Error loading HDR texture:", c), a(
|
|
4780
|
-
new ve(`Failed to load HDR texture from ${t}`, "Environment",
|
|
4814
|
+
new ve(`Failed to load HDR texture from ${t}`, "Environment", Ce.HDR_LOAD_FAILED, {
|
|
4781
4815
|
url: t,
|
|
4782
4816
|
ultra: n,
|
|
4783
4817
|
error: c
|
|
@@ -4792,74 +4826,74 @@ class $c extends EventTarget {
|
|
|
4792
4826
|
}
|
|
4793
4827
|
dispose() {
|
|
4794
4828
|
var t, n;
|
|
4795
|
-
this.clear_environment(), this.ambient && (this.scene.remove(this.ambient), (n = (t = this.ambient).dispose) == null || n.call(t), this.ambient = null), this.env_map && (this.env_map.dispose(), this.env_map = null), this.texture && (this.texture.dispose(), this.texture = null), this.sky && (this.scene.remove(this.sky), this.sky = null);
|
|
4829
|
+
this.clear_environment(), this.ambient && (this.scene.remove(this.ambient), (n = (t = this.ambient).dispose) == null || n.call(t), this.ambient = null), this.env_map && (this.env_map.dispose(), this.env_map = null), this.sky_env_rt && (Ds(this.sky_env_rt), this.sky_env_rt = null), this.sky_pmrem && (Ds(this.sky_pmrem), this.sky_pmrem = null), this.last_sky_dir = null, this.texture && (this.texture.dispose(), this.texture = null), this.sky && (this.scene.remove(this.sky), this.sky = null);
|
|
4796
4830
|
}
|
|
4797
4831
|
}
|
|
4798
|
-
function
|
|
4832
|
+
function dr(r) {
|
|
4799
4833
|
const t = new p.Box3().setFromObject(r).getSize(new p.Vector3());
|
|
4800
4834
|
return Math.max(10, Math.max(t.x, t.y, t.z));
|
|
4801
4835
|
}
|
|
4802
|
-
const
|
|
4803
|
-
function rl(r) {
|
|
4804
|
-
return r.valueOf() / nl - 0.5 + sl - il;
|
|
4805
|
-
}
|
|
4836
|
+
const Kc = 512, qc = 100, Jc = 30, Qc = -1e-3, el = 3, tl = 16, { PI: nl, sin: ot, cos: ct, tan: io, asin: ro, atan2: oo } = Math, Ne = nl / 180, sl = 1e3 * 60 * 60 * 24, il = 2440588, rl = 2451545;
|
|
4806
4837
|
function ol(r) {
|
|
4838
|
+
return r.valueOf() / sl - 0.5 + il - rl;
|
|
4839
|
+
}
|
|
4840
|
+
function al(r) {
|
|
4807
4841
|
const e = 2e3 + r / 365.2425;
|
|
4808
4842
|
let t;
|
|
4809
4843
|
return e < 1920 ? (t = e - 1900, -2.79 + t * (1.494119 + t * (-0.0598939 + t * (61966e-7 - t * 197e-6)))) : e < 1941 ? (t = e - 1920, 21.2 + t * (0.84493 + t * (-0.0761 + t * 20936e-7))) : e < 1961 ? (t = e - 1950, 29.07 + t * (0.407 + t * (-1 / 233 + t / 2547))) : e < 1986 ? (t = e - 1975, 45.45 + t * (1.067 + t * (-1 / 260 - t / 718))) : e < 2005 ? (t = e - 2e3, 63.86 + t * (0.3345 + t * (-0.060374 + t * (17275e-7 + t * (651814e-9 + t * 2373599e-11))))) : e < 2050 ? (t = e - 2e3, 62.92 + t * (0.32217 + t * 5589e-6)) : (t = (e - 1820) / 100, -20 + 32 * t * t - 0.5628 * (2150 - e));
|
|
4810
4844
|
}
|
|
4811
|
-
function
|
|
4812
|
-
return r +
|
|
4813
|
-
}
|
|
4814
|
-
function cl(r, e, t) {
|
|
4815
|
-
return (ro(ot(r), ct(r) * ot(e) - so(t) * ct(e)) / Ne + 540) % 360;
|
|
4845
|
+
function cl(r) {
|
|
4846
|
+
return r + al(r) / 86400;
|
|
4816
4847
|
}
|
|
4817
4848
|
function ll(r, e, t) {
|
|
4818
|
-
return
|
|
4849
|
+
return (oo(ot(r), ct(r) * ot(e) - io(t) * ct(e)) / Ne + 540) % 360;
|
|
4819
4850
|
}
|
|
4820
|
-
function dl(r, e) {
|
|
4821
|
-
return
|
|
4851
|
+
function dl(r, e, t) {
|
|
4852
|
+
return ro(ot(e) * ot(t) + ct(e) * ct(t) * ct(r));
|
|
4822
4853
|
}
|
|
4823
|
-
function ul(r) {
|
|
4824
|
-
return
|
|
4854
|
+
function ul(r, e) {
|
|
4855
|
+
return Ne * (280.46061837 + 360.98564736629 * r) - e;
|
|
4825
4856
|
}
|
|
4826
4857
|
function hl(r) {
|
|
4858
|
+
return r < 0 && (r = 0), 2967e-7 / io(r + 312536e-8 / (r + 0.08901179));
|
|
4859
|
+
}
|
|
4860
|
+
function fl(r) {
|
|
4827
4861
|
const e = r / 36525, t = Ne * (280.46646 + e * (36000.76983 + e * 3032e-7)), n = Ne * (357.52911 + e * (35999.05029 - e * 1537e-7)), s = ot(n), i = ct(n), o = Ne * ((1.914602 - e * (4817e-6 + e * 14e-6)) * s + // equation of center
|
|
4828
4862
|
(0.019993 - 101e-6 * e) * 2 * s * i + 289e-6 * s * (3 - 4 * s * s)), a = Ne * (125.04 - 1934.136 * e), c = t + o - Ne * (569e-5 + 478e-5 * ot(a)), l = Ne * (23.439291 - e * (0.0130042 + e * (16e-8 - e * 504e-9))) + Ne * 256e-5 * ct(a);
|
|
4829
4863
|
return {
|
|
4830
|
-
ra:
|
|
4864
|
+
ra: oo(ct(l) * ot(c), ct(c)),
|
|
4831
4865
|
// 25.6
|
|
4832
|
-
dec:
|
|
4866
|
+
dec: ro(ot(l) * ot(c)),
|
|
4833
4867
|
// 25.7
|
|
4834
4868
|
lon: c
|
|
4835
4869
|
};
|
|
4836
4870
|
}
|
|
4837
|
-
function
|
|
4838
|
-
const n = Ne * -t, s = Ne * e, i =
|
|
4871
|
+
function ml(r, e, t) {
|
|
4872
|
+
const n = Ne * -t, s = Ne * e, i = ol(r), o = fl(cl(i)), a = ul(i, n) - o.ra, c = dl(a, s, o.dec);
|
|
4839
4873
|
return {
|
|
4840
|
-
azimuth:
|
|
4874
|
+
azimuth: ll(a, s, o.dec),
|
|
4841
4875
|
// apparent (refraction-corrected) altitude in degrees
|
|
4842
|
-
altitude: (c +
|
|
4876
|
+
altitude: (c + hl(c)) / Ne
|
|
4843
4877
|
};
|
|
4844
4878
|
}
|
|
4845
|
-
const
|
|
4846
|
-
function
|
|
4847
|
-
const n =
|
|
4879
|
+
const ai = Math.PI / 180;
|
|
4880
|
+
function pl(r, e, t) {
|
|
4881
|
+
const n = ml(t, r, e), s = n.altitude, i = (n.azimuth % 360 + 360) % 360, o = s * ai, a = i * ai, c = new p.Vector3(
|
|
4848
4882
|
Math.cos(o) * Math.sin(a),
|
|
4849
4883
|
Math.sin(o),
|
|
4850
4884
|
-Math.cos(o) * Math.cos(a)
|
|
4851
4885
|
);
|
|
4852
4886
|
return { altitude_deg: s, azimuth_deg: i, direction: c };
|
|
4853
4887
|
}
|
|
4854
|
-
const
|
|
4855
|
-
function
|
|
4888
|
+
const _l = -6;
|
|
4889
|
+
function gl(r, e, t) {
|
|
4856
4890
|
const n = new p.Color(t);
|
|
4857
|
-
if (r <=
|
|
4891
|
+
if (r <= _l)
|
|
4858
4892
|
return { intensity: 0, color: new p.Color(0) };
|
|
4859
|
-
const s = Math.max(0, r), i = Math.sin(Math.min(s, 90) *
|
|
4893
|
+
const s = Math.max(0, r), i = Math.sin(Math.min(s, 90) * ai), o = e * (0.12 + 0.88 * i), a = 1 - Math.min(s / 30, 1), l = new p.Color(16747586).lerp(n, 1 - a * 0.85);
|
|
4860
4894
|
return { intensity: o, color: l };
|
|
4861
4895
|
}
|
|
4862
|
-
class
|
|
4896
|
+
class yl {
|
|
4863
4897
|
constructor(e, t, n, s) {
|
|
4864
4898
|
_(this, "viewer");
|
|
4865
4899
|
_(this, "scene");
|
|
@@ -4891,11 +4925,18 @@ class gl {
|
|
|
4891
4925
|
const t = this._infer_sun_position_from_env_map();
|
|
4892
4926
|
t && (j.debug("Inferred Sun position from env map:", t), this.sun_settings.position = [t.x, t.y, t.z]);
|
|
4893
4927
|
}
|
|
4894
|
-
this.sun_create(e ?? void 0);
|
|
4928
|
+
this.sun_create(e ?? void 0), this.sun_settings && this.sync_sky((e == null ? void 0 : e.position) ?? this.sun_settings.position);
|
|
4895
4929
|
});
|
|
4896
4930
|
}
|
|
4931
|
+
/**
|
|
4932
|
+
* Point the sky dome (and its image-based ambient light) at the same sun
|
|
4933
|
+
* the directional light uses, so sky and lighting stay in agreement.
|
|
4934
|
+
*/
|
|
4935
|
+
sync_sky(e) {
|
|
4936
|
+
e && this.environment.update_sky_environment(new p.Vector3(e[0], e[1], e[2]));
|
|
4937
|
+
}
|
|
4897
4938
|
sun_fit_object(e = this.scene) {
|
|
4898
|
-
const t =
|
|
4939
|
+
const t = dr(e);
|
|
4899
4940
|
let n = new p.Vector3(0, 1, 0).normalize();
|
|
4900
4941
|
n = n.multiplyScalar(t * 2), this.sun && (n = this.sun.position.clone());
|
|
4901
4942
|
}
|
|
@@ -4908,15 +4949,15 @@ class gl {
|
|
|
4908
4949
|
for (const o of this.model_manager.models.values())
|
|
4909
4950
|
o.settings.shadow && e.add(o.group.clone());
|
|
4910
4951
|
e.children.length === 0 && j.warn("No models with shadows found to fit shadow map."), j.debug("Models in fit_object:", e);
|
|
4911
|
-
const t =
|
|
4952
|
+
const t = dr(e), n = Kc, s = Math.ceil(t / qc), i = Math.min(
|
|
4912
4953
|
Math.pow(2, Math.ceil(Math.log2(n * s))),
|
|
4913
4954
|
this.viewer.renderer.capabilities.maxTextureSize
|
|
4914
4955
|
// Ensure it's within the device limit
|
|
4915
4956
|
);
|
|
4916
4957
|
if (j.debug("Shadow map size:", i), this.sun) {
|
|
4917
4958
|
this.sun.shadow.mapSize.width = i, this.sun.shadow.mapSize.height = i;
|
|
4918
|
-
const o =
|
|
4919
|
-
this.sun.shadow.camera.left = -(t / 2 + o), this.sun.shadow.camera.right = t / 2 + o, this.sun.shadow.camera.top = t / 2 + o, this.sun.shadow.camera.bottom = -(t / 2 + o), this.sun.shadow.camera.near = 0.1, this.sun.shadow.camera.far = t * 2, this.sun.shadow.bias =
|
|
4959
|
+
const o = Jc;
|
|
4960
|
+
this.sun.shadow.camera.left = -(t / 2 + o), this.sun.shadow.camera.right = t / 2 + o, this.sun.shadow.camera.top = t / 2 + o, this.sun.shadow.camera.bottom = -(t / 2 + o), this.sun.shadow.camera.near = 0.1, this.sun.shadow.camera.far = t * 2, this.sun.shadow.bias = Qc, this.sun.shadow.radius = el, this.sun.shadow.blurSamples = tl, j.info(`Recreated sun with shadow map size: ${i}x${i}`);
|
|
4920
4961
|
}
|
|
4921
4962
|
}
|
|
4922
4963
|
/**
|
|
@@ -4926,7 +4967,7 @@ class gl {
|
|
|
4926
4967
|
* so repeated updates cannot drift.
|
|
4927
4968
|
*/
|
|
4928
4969
|
resolve_solar() {
|
|
4929
|
-
const e = this.sun_settings.solar, t =
|
|
4970
|
+
const e = this.sun_settings.solar, t = pl(e.latitude, e.longitude, new Date(e.datetime)), n = gl(t.altitude_deg, this.sun_settings.intensity, this.sun_settings.color), s = t.direction.multiplyScalar(100);
|
|
4930
4971
|
let i = 0;
|
|
4931
4972
|
return n.intensity > 0 && (i = +`0x${n.color.getHexString()}`), j.debug(
|
|
4932
4973
|
`Solar sun: lat ${e.latitude}, lon ${e.longitude}, alt ${t.altitude_deg.toFixed(1)}°, az ${t.azimuth_deg.toFixed(1)}°`
|
|
@@ -4998,31 +5039,31 @@ class gl {
|
|
|
4998
5039
|
const pe = [];
|
|
4999
5040
|
for (let r = 0; r < 256; ++r)
|
|
5000
5041
|
pe.push((r + 256).toString(16).slice(1));
|
|
5001
|
-
function
|
|
5042
|
+
function vl(r, e = 0) {
|
|
5002
5043
|
return (pe[r[e + 0]] + pe[r[e + 1]] + pe[r[e + 2]] + pe[r[e + 3]] + "-" + pe[r[e + 4]] + pe[r[e + 5]] + "-" + pe[r[e + 6]] + pe[r[e + 7]] + "-" + pe[r[e + 8]] + pe[r[e + 9]] + "-" + pe[r[e + 10]] + pe[r[e + 11]] + pe[r[e + 12]] + pe[r[e + 13]] + pe[r[e + 14]] + pe[r[e + 15]]).toLowerCase();
|
|
5003
5044
|
}
|
|
5004
|
-
let
|
|
5005
|
-
const
|
|
5006
|
-
function
|
|
5007
|
-
if (!
|
|
5045
|
+
let Is;
|
|
5046
|
+
const xl = new Uint8Array(16);
|
|
5047
|
+
function bl() {
|
|
5048
|
+
if (!Is) {
|
|
5008
5049
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
5009
5050
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
5010
|
-
|
|
5051
|
+
Is = crypto.getRandomValues.bind(crypto);
|
|
5011
5052
|
}
|
|
5012
|
-
return
|
|
5053
|
+
return Is(xl);
|
|
5013
5054
|
}
|
|
5014
|
-
const
|
|
5015
|
-
function
|
|
5055
|
+
const wl = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ur = { randomUUID: wl };
|
|
5056
|
+
function El(r, e, t) {
|
|
5016
5057
|
var s;
|
|
5017
|
-
if (
|
|
5018
|
-
return
|
|
5058
|
+
if (ur.randomUUID && !r)
|
|
5059
|
+
return ur.randomUUID();
|
|
5019
5060
|
r = r || {};
|
|
5020
|
-
const n = r.random ?? ((s = r.rng) == null ? void 0 : s.call(r)) ??
|
|
5061
|
+
const n = r.random ?? ((s = r.rng) == null ? void 0 : s.call(r)) ?? bl();
|
|
5021
5062
|
if (n.length < 16)
|
|
5022
5063
|
throw new Error("Random bytes length must be >= 16");
|
|
5023
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128,
|
|
5064
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, vl(n);
|
|
5024
5065
|
}
|
|
5025
|
-
function
|
|
5066
|
+
function Al(r, e = 1e-4) {
|
|
5026
5067
|
e = Math.max(e, Number.EPSILON);
|
|
5027
5068
|
const t = {}, n = r.getIndex(), s = r.getAttribute("position"), i = n ? n.count : s.count;
|
|
5028
5069
|
let o = 0;
|
|
@@ -5046,19 +5087,19 @@ function El(r, e = 1e-4) {
|
|
|
5046
5087
|
let v = "";
|
|
5047
5088
|
for (let P = 0, V = a.length; P < V; P++) {
|
|
5048
5089
|
const F = a[P], L = r.getAttribute(F), R = L.itemSize;
|
|
5049
|
-
for (let
|
|
5050
|
-
v += `${~~(L[u[
|
|
5090
|
+
for (let C = 0; C < R; C++)
|
|
5091
|
+
v += `${~~(L[u[C]](T) * y + x)},`;
|
|
5051
5092
|
}
|
|
5052
5093
|
if (v in t)
|
|
5053
5094
|
d.push(t[v]);
|
|
5054
5095
|
else {
|
|
5055
5096
|
for (let P = 0, V = a.length; P < V; P++) {
|
|
5056
|
-
const F = a[P], L = r.getAttribute(F), R = r.morphAttributes[F],
|
|
5057
|
-
for (let Z = 0; Z <
|
|
5058
|
-
const
|
|
5059
|
-
if (N[ee](o, L[
|
|
5097
|
+
const F = a[P], L = r.getAttribute(F), R = r.morphAttributes[F], C = L.itemSize, N = c[F], G = l[F];
|
|
5098
|
+
for (let Z = 0; Z < C; Z++) {
|
|
5099
|
+
const O = u[Z], ee = h[Z];
|
|
5100
|
+
if (N[ee](o, L[O](T)), R)
|
|
5060
5101
|
for (let $ = 0, be = R.length; $ < be; $++)
|
|
5061
|
-
G[$][ee](o, R[$][
|
|
5102
|
+
G[$][ee](o, R[$][O](T));
|
|
5062
5103
|
}
|
|
5063
5104
|
}
|
|
5064
5105
|
t[v] = o, d.push(o), o++;
|
|
@@ -5083,10 +5124,10 @@ function El(r, e = 1e-4) {
|
|
|
5083
5124
|
}
|
|
5084
5125
|
return b.setIndex(d), b;
|
|
5085
5126
|
}
|
|
5086
|
-
function
|
|
5087
|
-
if (e ===
|
|
5127
|
+
function hr(r, e) {
|
|
5128
|
+
if (e === Uo)
|
|
5088
5129
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
5089
|
-
if (e ===
|
|
5130
|
+
if (e === Js || e === Br) {
|
|
5090
5131
|
let t = r.getIndex();
|
|
5091
5132
|
if (t === null) {
|
|
5092
5133
|
const o = [], a = r.getAttribute("position");
|
|
@@ -5098,7 +5139,7 @@ function ur(r, e) {
|
|
|
5098
5139
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
|
|
5099
5140
|
}
|
|
5100
5141
|
const n = t.count - 2, s = [];
|
|
5101
|
-
if (e ===
|
|
5142
|
+
if (e === Js)
|
|
5102
5143
|
for (let o = 1; o <= n; o++)
|
|
5103
5144
|
s.push(t.getX(0)), s.push(t.getX(o)), s.push(t.getX(o + 1));
|
|
5104
5145
|
else
|
|
@@ -5110,15 +5151,15 @@ function ur(r, e) {
|
|
|
5110
5151
|
} else
|
|
5111
5152
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), r;
|
|
5112
5153
|
}
|
|
5113
|
-
const
|
|
5114
|
-
class
|
|
5154
|
+
const fr = new ps(), Zn = new J();
|
|
5155
|
+
class Li extends Fo {
|
|
5115
5156
|
/**
|
|
5116
5157
|
* Constructs a new line segments geometry.
|
|
5117
5158
|
*/
|
|
5118
5159
|
constructor() {
|
|
5119
5160
|
super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry";
|
|
5120
5161
|
const e = [-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], t = [-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], n = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
|
|
5121
|
-
this.setIndex(n), this.setAttribute("position", new
|
|
5162
|
+
this.setIndex(n), this.setAttribute("position", new Ji(e, 3)), this.setAttribute("uv", new Ji(t, 2));
|
|
5122
5163
|
}
|
|
5123
5164
|
/**
|
|
5124
5165
|
* Applies the given 4x4 transformation matrix to the geometry.
|
|
@@ -5140,7 +5181,7 @@ class Mi extends Uo {
|
|
|
5140
5181
|
setPositions(e) {
|
|
5141
5182
|
let t;
|
|
5142
5183
|
e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
|
|
5143
|
-
const n = new
|
|
5184
|
+
const n = new Qs(t, 6, 1);
|
|
5144
5185
|
return this.setAttribute("instanceStart", new Et(n, 3, 0)), this.setAttribute("instanceEnd", new Et(n, 3, 3)), this.instanceCount = this.attributes.instanceStart.count, this.computeBoundingBox(), this.computeBoundingSphere(), this;
|
|
5145
5186
|
}
|
|
5146
5187
|
/**
|
|
@@ -5153,7 +5194,7 @@ class Mi extends Uo {
|
|
|
5153
5194
|
setColors(e) {
|
|
5154
5195
|
let t;
|
|
5155
5196
|
e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
|
|
5156
|
-
const n = new
|
|
5197
|
+
const n = new Qs(t, 6, 1);
|
|
5157
5198
|
return this.setAttribute("instanceColorStart", new Et(n, 3, 0)), this.setAttribute("instanceColorEnd", new Et(n, 3, 3)), this;
|
|
5158
5199
|
}
|
|
5159
5200
|
/**
|
|
@@ -5181,7 +5222,7 @@ class Mi extends Uo {
|
|
|
5181
5222
|
* @return {LineSegmentsGeometry} A reference to this geometry.
|
|
5182
5223
|
*/
|
|
5183
5224
|
fromMesh(e) {
|
|
5184
|
-
return this.fromWireframeGeometry(new
|
|
5225
|
+
return this.fromWireframeGeometry(new jo(e.geometry)), this;
|
|
5185
5226
|
}
|
|
5186
5227
|
/**
|
|
5187
5228
|
* Setups this line segments geometry from the given line segments.
|
|
@@ -5195,40 +5236,40 @@ class Mi extends Uo {
|
|
|
5195
5236
|
return this.setPositions(t.attributes.position.array), this;
|
|
5196
5237
|
}
|
|
5197
5238
|
computeBoundingBox() {
|
|
5198
|
-
this.boundingBox === null && (this.boundingBox = new
|
|
5239
|
+
this.boundingBox === null && (this.boundingBox = new ps());
|
|
5199
5240
|
const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
|
|
5200
|
-
e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e),
|
|
5241
|
+
e !== void 0 && t !== void 0 && (this.boundingBox.setFromBufferAttribute(e), fr.setFromBufferAttribute(t), this.boundingBox.union(fr));
|
|
5201
5242
|
}
|
|
5202
5243
|
computeBoundingSphere() {
|
|
5203
|
-
this.boundingSphere === null && (this.boundingSphere = new
|
|
5244
|
+
this.boundingSphere === null && (this.boundingSphere = new Ti()), this.boundingBox === null && this.computeBoundingBox();
|
|
5204
5245
|
const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
|
|
5205
5246
|
if (e !== void 0 && t !== void 0) {
|
|
5206
5247
|
const n = this.boundingSphere.center;
|
|
5207
5248
|
this.boundingBox.getCenter(n);
|
|
5208
5249
|
let s = 0;
|
|
5209
5250
|
for (let i = 0, o = e.count; i < o; i++)
|
|
5210
|
-
|
|
5251
|
+
Zn.fromBufferAttribute(e, i), s = Math.max(s, n.distanceToSquared(Zn)), Zn.fromBufferAttribute(t, i), s = Math.max(s, n.distanceToSquared(Zn));
|
|
5211
5252
|
this.boundingSphere.radius = Math.sqrt(s), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this);
|
|
5212
5253
|
}
|
|
5213
5254
|
}
|
|
5214
5255
|
toJSON() {
|
|
5215
5256
|
}
|
|
5216
5257
|
}
|
|
5217
|
-
|
|
5258
|
+
es.line = {
|
|
5218
5259
|
worldUnits: { value: 1 },
|
|
5219
5260
|
linewidth: { value: 1 },
|
|
5220
|
-
resolution: { value: new
|
|
5261
|
+
resolution: { value: new ke(1, 1) },
|
|
5221
5262
|
dashOffset: { value: 0 },
|
|
5222
5263
|
dashScale: { value: 1 },
|
|
5223
5264
|
dashSize: { value: 1 },
|
|
5224
5265
|
gapSize: { value: 1 }
|
|
5225
5266
|
// todo FIX - maybe change to totalSize
|
|
5226
5267
|
};
|
|
5227
|
-
|
|
5228
|
-
uniforms:
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5268
|
+
Qn.line = {
|
|
5269
|
+
uniforms: Ai.merge([
|
|
5270
|
+
es.common,
|
|
5271
|
+
es.fog,
|
|
5272
|
+
es.line
|
|
5232
5273
|
]),
|
|
5233
5274
|
vertexShader: (
|
|
5234
5275
|
/* glsl */
|
|
@@ -5609,7 +5650,7 @@ Jn.line = {
|
|
|
5609
5650
|
`
|
|
5610
5651
|
)
|
|
5611
5652
|
};
|
|
5612
|
-
class
|
|
5653
|
+
class ao extends Ei {
|
|
5613
5654
|
/**
|
|
5614
5655
|
* Constructs a new line segments geometry.
|
|
5615
5656
|
*
|
|
@@ -5622,9 +5663,9 @@ class oo extends wi {
|
|
|
5622
5663
|
constructor(e) {
|
|
5623
5664
|
super({
|
|
5624
5665
|
type: "LineMaterial",
|
|
5625
|
-
uniforms:
|
|
5626
|
-
vertexShader:
|
|
5627
|
-
fragmentShader:
|
|
5666
|
+
uniforms: Ai.clone(Qn.line.uniforms),
|
|
5667
|
+
vertexShader: Qn.line.vertexShader,
|
|
5668
|
+
fragmentShader: Qn.line.fragmentShader,
|
|
5628
5669
|
clipping: !0
|
|
5629
5670
|
// required for clipping support
|
|
5630
5671
|
}), this.isLineMaterial = !0, this.setValues(e);
|
|
@@ -5764,12 +5805,12 @@ class oo extends wi {
|
|
|
5764
5805
|
this.defines && (e === !0 !== this.alphaToCoverage && (this.needsUpdate = !0), e === !0 ? this.defines.USE_ALPHA_TO_COVERAGE = "" : delete this.defines.USE_ALPHA_TO_COVERAGE);
|
|
5765
5806
|
}
|
|
5766
5807
|
}
|
|
5767
|
-
const
|
|
5808
|
+
const Ns = new In(), mr = new J(), pr = new J(), fe = new In(), me = new In(), Ge = new In(), Ps = new J(), zs = new pn(), _e = new Bo(), _r = new J(), Wn = new ps(), Xn = new Ti(), Ze = new In();
|
|
5768
5809
|
let Xe, Tt;
|
|
5769
|
-
function
|
|
5810
|
+
function gr(r, e, t) {
|
|
5770
5811
|
return Ze.set(0, 0, -e, 1).applyMatrix4(r.projectionMatrix), Ze.multiplyScalar(1 / Ze.w), Ze.x = Tt / t.width, Ze.y = Tt / t.height, Ze.applyMatrix4(r.projectionMatrixInverse), Ze.multiplyScalar(1 / Ze.w), Math.abs(Math.max(Ze.x, Ze.y));
|
|
5771
5812
|
}
|
|
5772
|
-
function
|
|
5813
|
+
function Tl(r, e) {
|
|
5773
5814
|
const t = r.matrixWorld, n = r.geometry, s = n.attributes.instanceStart, i = n.attributes.instanceEnd, o = Math.min(n.instanceCount, s.count);
|
|
5774
5815
|
for (let a = 0, c = o; a < c; a++) {
|
|
5775
5816
|
_e.start.fromBufferAttribute(s, a), _e.end.fromBufferAttribute(i, a), _e.applyMatrix4(t);
|
|
@@ -5786,11 +5827,11 @@ function Al(r, e) {
|
|
|
5786
5827
|
});
|
|
5787
5828
|
}
|
|
5788
5829
|
}
|
|
5789
|
-
function
|
|
5830
|
+
function Sl(r, e, t) {
|
|
5790
5831
|
const n = e.projectionMatrix, i = r.material.resolution, o = r.matrixWorld, a = r.geometry, c = a.attributes.instanceStart, l = a.attributes.instanceEnd, d = Math.min(a.instanceCount, c.count), u = -e.near;
|
|
5791
|
-
Xe.at(1, Ge), Ge.w = 1, Ge.applyMatrix4(e.matrixWorldInverse), Ge.applyMatrix4(n), Ge.multiplyScalar(1 / Ge.w), Ge.x *= i.x / 2, Ge.y *= i.y / 2, Ge.z = 0,
|
|
5832
|
+
Xe.at(1, Ge), Ge.w = 1, Ge.applyMatrix4(e.matrixWorldInverse), Ge.applyMatrix4(n), Ge.multiplyScalar(1 / Ge.w), Ge.x *= i.x / 2, Ge.y *= i.y / 2, Ge.z = 0, Ps.copy(Ge), zs.multiplyMatrices(e.matrixWorldInverse, o);
|
|
5792
5833
|
for (let h = 0, f = d; h < f; h++) {
|
|
5793
|
-
if (fe.fromBufferAttribute(c, h), me.fromBufferAttribute(l, h), fe.w = 1, me.w = 1, fe.applyMatrix4(
|
|
5834
|
+
if (fe.fromBufferAttribute(c, h), me.fromBufferAttribute(l, h), fe.w = 1, me.w = 1, fe.applyMatrix4(zs), me.applyMatrix4(zs), fe.z > u && me.z > u)
|
|
5794
5835
|
continue;
|
|
5795
5836
|
if (fe.z > u) {
|
|
5796
5837
|
const T = fe.z - me.z, v = (fe.z - u) / T;
|
|
@@ -5800,9 +5841,9 @@ function Tl(r, e, t) {
|
|
|
5800
5841
|
me.lerp(fe, v);
|
|
5801
5842
|
}
|
|
5802
5843
|
fe.applyMatrix4(n), me.applyMatrix4(n), fe.multiplyScalar(1 / fe.w), me.multiplyScalar(1 / me.w), fe.x *= i.x / 2, fe.y *= i.y / 2, me.x *= i.x / 2, me.y *= i.y / 2, _e.start.copy(fe), _e.start.z = 0, _e.end.copy(me), _e.end.z = 0;
|
|
5803
|
-
const y = _e.closestPointToPointParameter(
|
|
5804
|
-
_e.at(y,
|
|
5805
|
-
const x =
|
|
5844
|
+
const y = _e.closestPointToPointParameter(Ps, !0);
|
|
5845
|
+
_e.at(y, _r);
|
|
5846
|
+
const x = bi.lerp(fe.z, me.z, y), b = x >= -1 && x <= 1, w = Ps.distanceTo(_r) < Tt * 0.5;
|
|
5806
5847
|
if (b && w) {
|
|
5807
5848
|
_e.start.fromBufferAttribute(c, h), _e.end.fromBufferAttribute(l, h), _e.start.applyMatrix4(o), _e.end.applyMatrix4(o);
|
|
5808
5849
|
const T = new J(), v = new J();
|
|
@@ -5819,14 +5860,14 @@ function Tl(r, e, t) {
|
|
|
5819
5860
|
}
|
|
5820
5861
|
}
|
|
5821
5862
|
}
|
|
5822
|
-
class
|
|
5863
|
+
class yr extends ye {
|
|
5823
5864
|
/**
|
|
5824
5865
|
* Constructs a new wide line.
|
|
5825
5866
|
*
|
|
5826
5867
|
* @param {LineSegmentsGeometry} [geometry] - The line geometry.
|
|
5827
5868
|
* @param {LineMaterial} [material] - The line material.
|
|
5828
5869
|
*/
|
|
5829
|
-
constructor(e = new
|
|
5870
|
+
constructor(e = new Li(), t = new ao({ color: Math.random() * 16777215 })) {
|
|
5830
5871
|
super(e, t), this.isLineSegments2 = !0, this.type = "LineSegments2";
|
|
5831
5872
|
}
|
|
5832
5873
|
/**
|
|
@@ -5839,8 +5880,8 @@ class gr extends ye {
|
|
|
5839
5880
|
computeLineDistances() {
|
|
5840
5881
|
const e = this.geometry, t = e.attributes.instanceStart, n = e.attributes.instanceEnd, s = new Float32Array(2 * t.count);
|
|
5841
5882
|
for (let o = 0, a = 0, c = t.count; o < c; o++, a += 2)
|
|
5842
|
-
|
|
5843
|
-
const i = new
|
|
5883
|
+
mr.fromBufferAttribute(t, o), pr.fromBufferAttribute(n, o), s[a] = a === 0 ? 0 : s[a - 1], s[a + 1] = s[a] + mr.distanceTo(pr);
|
|
5884
|
+
const i = new Qs(s, 2, 1);
|
|
5844
5885
|
return e.setAttribute("instanceDistanceStart", new Et(i, 1, 0)), e.setAttribute("instanceDistanceEnd", new Et(i, 1, 1)), this;
|
|
5845
5886
|
}
|
|
5846
5887
|
/**
|
|
@@ -5855,32 +5896,32 @@ class gr extends ye {
|
|
|
5855
5896
|
const i = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
|
|
5856
5897
|
Xe = e.ray;
|
|
5857
5898
|
const o = this.matrixWorld, a = this.geometry, c = this.material;
|
|
5858
|
-
Tt = c.linewidth + i, a.boundingSphere === null && a.computeBoundingSphere(),
|
|
5899
|
+
Tt = c.linewidth + i, a.boundingSphere === null && a.computeBoundingSphere(), Xn.copy(a.boundingSphere).applyMatrix4(o);
|
|
5859
5900
|
let l;
|
|
5860
5901
|
if (n)
|
|
5861
5902
|
l = Tt * 0.5;
|
|
5862
5903
|
else {
|
|
5863
|
-
const u = Math.max(s.near,
|
|
5864
|
-
l =
|
|
5904
|
+
const u = Math.max(s.near, Xn.distanceToPoint(Xe.origin));
|
|
5905
|
+
l = gr(s, u, c.resolution);
|
|
5865
5906
|
}
|
|
5866
|
-
if (
|
|
5907
|
+
if (Xn.radius += l, Xe.intersectsSphere(Xn) === !1)
|
|
5867
5908
|
return;
|
|
5868
|
-
a.boundingBox === null && a.computeBoundingBox(),
|
|
5909
|
+
a.boundingBox === null && a.computeBoundingBox(), Wn.copy(a.boundingBox).applyMatrix4(o);
|
|
5869
5910
|
let d;
|
|
5870
5911
|
if (n)
|
|
5871
5912
|
d = Tt * 0.5;
|
|
5872
5913
|
else {
|
|
5873
|
-
const u = Math.max(s.near,
|
|
5874
|
-
d =
|
|
5914
|
+
const u = Math.max(s.near, Wn.distanceToPoint(Xe.origin));
|
|
5915
|
+
d = gr(s, u, c.resolution);
|
|
5875
5916
|
}
|
|
5876
|
-
|
|
5917
|
+
Wn.expandByScalar(d), Xe.intersectsBox(Wn) !== !1 && (n ? Tl(this, t) : Sl(this, s, t));
|
|
5877
5918
|
}
|
|
5878
5919
|
onBeforeRender(e) {
|
|
5879
5920
|
const t = this.material.uniforms;
|
|
5880
|
-
t && t.resolution && (e.getViewport(
|
|
5921
|
+
t && t.resolution && (e.getViewport(Ns), this.material.uniforms.resolution.value.set(Ns.z, Ns.w));
|
|
5881
5922
|
}
|
|
5882
5923
|
}
|
|
5883
|
-
class
|
|
5924
|
+
class vr extends p.BufferGeometry {
|
|
5884
5925
|
constructor(e, t = 4) {
|
|
5885
5926
|
super();
|
|
5886
5927
|
const n = {}, s = e.attributes.position;
|
|
@@ -5894,8 +5935,8 @@ class yr extends p.BufferGeometry {
|
|
|
5894
5935
|
for (let T = 0, v = i.count; T < v; T += 3) {
|
|
5895
5936
|
const P = [i.getX(T + 0), i.getX(T + 1), i.getX(T + 2)];
|
|
5896
5937
|
for (let V = 0; V < 3; V++) {
|
|
5897
|
-
const F = P[V], L = P[(V + 1) % 3], R = `${F}_${L}`,
|
|
5898
|
-
|
|
5938
|
+
const F = P[V], L = P[(V + 1) % 3], R = `${F}_${L}`, C = `${L}_${F}`;
|
|
5939
|
+
C in n ? (n[C].controlIndex1 = P[(V + 2) % 3], n[C].tri1 = T / 3) : n[R] = {
|
|
5899
5940
|
index0: F,
|
|
5900
5941
|
index1: L,
|
|
5901
5942
|
controlIndex0: P[(V + 2) % 3],
|
|
@@ -5910,13 +5951,13 @@ class yr extends p.BufferGeometry {
|
|
|
5910
5951
|
const { index0: v, index1: P, controlIndex0: V, controlIndex1: F, tri0: L, tri1: R } = n[T];
|
|
5911
5952
|
if (F === null) continue;
|
|
5912
5953
|
d.a.fromBufferAttribute(s, i.getX(L * 3 + 0)), d.b.fromBufferAttribute(s, i.getX(L * 3 + 1)), d.c.fromBufferAttribute(s, i.getX(L * 3 + 2)), u.a.fromBufferAttribute(s, i.getX(R * 3 + 0)), u.b.fromBufferAttribute(s, i.getX(R * 3 + 1)), u.c.fromBufferAttribute(s, i.getX(R * 3 + 2)), d.getNormal(h).normalize(), u.getNormal(f).normalize();
|
|
5913
|
-
const
|
|
5914
|
-
h.dot(f) >
|
|
5954
|
+
const C = Math.cos(p.MathUtils.degToRad(t));
|
|
5955
|
+
h.dot(f) > C || (g.fromBufferAttribute(s, v), y.fromBufferAttribute(s, P), x.subVectors(g, y), b.fromBufferAttribute(s, V), w.fromBufferAttribute(s, F), o.push(g.x, g.y, g.z), a.push(x.x, x.y, x.z), c.push(b.x, b.y, b.z), l.push(w.x, w.y, w.z), o.push(y.x, y.y, y.z), a.push(x.x, x.y, x.z), c.push(b.x, b.y, b.z), l.push(w.x, w.y, w.z));
|
|
5915
5956
|
}
|
|
5916
5957
|
this.setAttribute("position", new p.BufferAttribute(new Float32Array(o), 3, !1)), this.setAttribute("direction", new p.BufferAttribute(new Float32Array(a), 3, !1)), this.setAttribute("control0", new p.BufferAttribute(new Float32Array(c), 3, !1)), this.setAttribute("control1", new p.BufferAttribute(new Float32Array(l), 3, !1));
|
|
5917
5958
|
}
|
|
5918
5959
|
}
|
|
5919
|
-
class
|
|
5960
|
+
class Rl extends Li {
|
|
5920
5961
|
/**
|
|
5921
5962
|
* Populates this geometry from a ConditionalEdgesGeometry (or any BufferGeometry
|
|
5922
5963
|
* whose attributes include `direction`, `control0`, and `control1`).
|
|
@@ -5975,7 +6016,7 @@ class Sl extends Mi {
|
|
|
5975
6016
|
), this;
|
|
5976
6017
|
}
|
|
5977
6018
|
}
|
|
5978
|
-
const
|
|
6019
|
+
const Ml = `
|
|
5979
6020
|
attribute vec3 control0;
|
|
5980
6021
|
attribute vec3 control1;
|
|
5981
6022
|
attribute vec3 direction;
|
|
@@ -6025,7 +6066,7 @@ const Rl = `
|
|
|
6025
6066
|
#include <fog_vertex>
|
|
6026
6067
|
|
|
6027
6068
|
}
|
|
6028
|
-
`,
|
|
6069
|
+
`, Ll = `
|
|
6029
6070
|
uniform vec3 diffuse;
|
|
6030
6071
|
uniform float opacity;
|
|
6031
6072
|
|
|
@@ -6052,7 +6093,7 @@ const Rl = `
|
|
|
6052
6093
|
#include <premultiplied_alpha_fragment>
|
|
6053
6094
|
|
|
6054
6095
|
}
|
|
6055
|
-
`,
|
|
6096
|
+
`, kl = {
|
|
6056
6097
|
uniforms: {
|
|
6057
6098
|
diffuse: {
|
|
6058
6099
|
value: new p.Color()
|
|
@@ -6061,8 +6102,8 @@ const Rl = `
|
|
|
6061
6102
|
value: 1
|
|
6062
6103
|
}
|
|
6063
6104
|
},
|
|
6064
|
-
vertexShader:
|
|
6065
|
-
fragmentShader:
|
|
6105
|
+
vertexShader: Ml,
|
|
6106
|
+
fragmentShader: Ll
|
|
6066
6107
|
}, Cl = `
|
|
6067
6108
|
#include <common>
|
|
6068
6109
|
#include <color_pars_vertex>
|
|
@@ -6294,24 +6335,24 @@ const Rl = `
|
|
|
6294
6335
|
#include <premultiplied_alpha_fragment>
|
|
6295
6336
|
|
|
6296
6337
|
}
|
|
6297
|
-
`,
|
|
6338
|
+
`, Dl = {
|
|
6298
6339
|
linewidth: { value: 1 },
|
|
6299
6340
|
resolution: { value: new p.Vector2(1, 1) },
|
|
6300
6341
|
dashScale: { value: 1 },
|
|
6301
6342
|
dashSize: { value: 1 },
|
|
6302
6343
|
gapSize: { value: 1 },
|
|
6303
6344
|
opacity: { value: 1 }
|
|
6304
|
-
},
|
|
6305
|
-
uniforms: p.UniformsUtils.merge([p.UniformsLib.common, p.UniformsLib.fog,
|
|
6345
|
+
}, Us = {
|
|
6346
|
+
uniforms: p.UniformsUtils.merge([p.UniformsLib.common, p.UniformsLib.fog, Dl]),
|
|
6306
6347
|
vertexShader: Cl,
|
|
6307
6348
|
fragmentShader: Ol
|
|
6308
6349
|
};
|
|
6309
|
-
class
|
|
6350
|
+
class Il extends p.ShaderMaterial {
|
|
6310
6351
|
constructor(t) {
|
|
6311
6352
|
super({
|
|
6312
|
-
uniforms: p.UniformsUtils.clone(
|
|
6313
|
-
vertexShader:
|
|
6314
|
-
fragmentShader:
|
|
6353
|
+
uniforms: p.UniformsUtils.clone(Us.uniforms),
|
|
6354
|
+
vertexShader: Us.vertexShader,
|
|
6355
|
+
fragmentShader: Us.fragmentShader,
|
|
6315
6356
|
clipping: !0
|
|
6316
6357
|
// required for clipping support
|
|
6317
6358
|
});
|
|
@@ -6370,7 +6411,7 @@ class Dl extends p.ShaderMaterial {
|
|
|
6370
6411
|
}), this.setValues(t);
|
|
6371
6412
|
}
|
|
6372
6413
|
}
|
|
6373
|
-
class
|
|
6414
|
+
class Nl {
|
|
6374
6415
|
constructor(e, t, n, s) {
|
|
6375
6416
|
_(this, "group");
|
|
6376
6417
|
// public mixers: THREE.AnimationMixer[] = []
|
|
@@ -6378,7 +6419,7 @@ class Il {
|
|
|
6378
6419
|
_(this, "viewer");
|
|
6379
6420
|
_(this, "scene");
|
|
6380
6421
|
_(this, "settings");
|
|
6381
|
-
this.group = new p.Group(), s ? this.group.name = s : this.group.name =
|
|
6422
|
+
this.group = new p.Group(), s ? this.group.name = s : this.group.name = El(), this.viewer = e, this.scene = e.scene, this.loader = t, this.settings = n;
|
|
6382
6423
|
}
|
|
6383
6424
|
/**
|
|
6384
6425
|
* Load the model from the settings URL and add it to the scene.
|
|
@@ -6561,7 +6602,7 @@ class Il {
|
|
|
6561
6602
|
_bake_mesh(e) {
|
|
6562
6603
|
const t = e.geometry.clone().toNonIndexed();
|
|
6563
6604
|
["normal", "uv", "uv2"].forEach((i) => t.deleteAttribute(i));
|
|
6564
|
-
const n =
|
|
6605
|
+
const n = Al(t);
|
|
6565
6606
|
return new p.Mesh(n);
|
|
6566
6607
|
}
|
|
6567
6608
|
/**
|
|
@@ -6588,12 +6629,12 @@ class Il {
|
|
|
6588
6629
|
_generate_threshold_edges(e, t, n, s = 1) {
|
|
6589
6630
|
var i, o;
|
|
6590
6631
|
if (e.geometry && e.geometry.attributes && e.geometry.attributes.position && e.geometry.attributes.position.count > 0) {
|
|
6591
|
-
const a = new p.EdgesGeometry(e.geometry, t), c = new
|
|
6632
|
+
const a = new p.EdgesGeometry(e.geometry, t), c = new Li().fromEdgesGeometry(a), l = new ao({
|
|
6592
6633
|
color: n,
|
|
6593
6634
|
linewidth: s
|
|
6594
6635
|
});
|
|
6595
6636
|
(o = (i = this.viewer).register_resolution_material) == null || o.call(i, l);
|
|
6596
|
-
const d = new
|
|
6637
|
+
const d = new yr(c, l);
|
|
6597
6638
|
return d.userData.is_threshold_edge = !0, d;
|
|
6598
6639
|
}
|
|
6599
6640
|
}
|
|
@@ -6612,20 +6653,20 @@ class Il {
|
|
|
6612
6653
|
*/
|
|
6613
6654
|
_generate_conditional_thick_edges(e, t, n = 1, s = 2) {
|
|
6614
6655
|
var d, u;
|
|
6615
|
-
const i = new p.Group(), o = new
|
|
6656
|
+
const i = new p.Group(), o = new vr(e.geometry, s), a = new Rl().from_conditional_edges_geometry(
|
|
6616
6657
|
o
|
|
6617
6658
|
// <-- Accepts custom attributes, OK for Three.js usage
|
|
6618
|
-
), c = new
|
|
6659
|
+
), c = new Il({
|
|
6619
6660
|
color: t,
|
|
6620
6661
|
linewidth: n
|
|
6621
6662
|
});
|
|
6622
6663
|
(u = (d = this.viewer).register_resolution_material) == null || u.call(d, c);
|
|
6623
|
-
const l = new
|
|
6664
|
+
const l = new yr(a, c);
|
|
6624
6665
|
return i.add(l), i.userData.is_conditional_edge = !0, i;
|
|
6625
6666
|
}
|
|
6626
6667
|
// fallback
|
|
6627
6668
|
_generate_conditional_thin_edges(e, t, n = 2) {
|
|
6628
|
-
const s = new p.Group(), i = new
|
|
6669
|
+
const s = new p.Group(), i = new vr(e.geometry, n), o = new p.ShaderMaterial(kl);
|
|
6629
6670
|
o.uniforms.diffuse.value.set(t);
|
|
6630
6671
|
const a = new p.LineSegments(i, o);
|
|
6631
6672
|
return s.add(a), s;
|
|
@@ -6634,7 +6675,7 @@ class Il {
|
|
|
6634
6675
|
this.remove();
|
|
6635
6676
|
}
|
|
6636
6677
|
}
|
|
6637
|
-
class
|
|
6678
|
+
class Pl extends wi {
|
|
6638
6679
|
/**
|
|
6639
6680
|
* Constructs a new glTF loader.
|
|
6640
6681
|
*
|
|
@@ -6642,39 +6683,39 @@ class Nl extends bi {
|
|
|
6642
6683
|
*/
|
|
6643
6684
|
constructor(e) {
|
|
6644
6685
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
6645
|
-
return new jl(t);
|
|
6646
|
-
}), this.register(function(t) {
|
|
6647
6686
|
return new Bl(t);
|
|
6648
6687
|
}), this.register(function(t) {
|
|
6649
|
-
return new
|
|
6688
|
+
return new Hl(t);
|
|
6650
6689
|
}), this.register(function(t) {
|
|
6651
6690
|
return new ql(t);
|
|
6652
6691
|
}), this.register(function(t) {
|
|
6653
6692
|
return new Jl(t);
|
|
6654
6693
|
}), this.register(function(t) {
|
|
6655
|
-
return new
|
|
6694
|
+
return new Ql(t);
|
|
6656
6695
|
}), this.register(function(t) {
|
|
6657
6696
|
return new Gl(t);
|
|
6658
6697
|
}), this.register(function(t) {
|
|
6659
6698
|
return new Zl(t);
|
|
6660
6699
|
}), this.register(function(t) {
|
|
6661
6700
|
return new Wl(t);
|
|
6662
|
-
}), this.register(function(t) {
|
|
6663
|
-
return new Fl(t);
|
|
6664
6701
|
}), this.register(function(t) {
|
|
6665
6702
|
return new Xl(t);
|
|
6666
6703
|
}), this.register(function(t) {
|
|
6667
|
-
return new
|
|
6668
|
-
}), this.register(function(t) {
|
|
6669
|
-
return new Yl(t);
|
|
6704
|
+
return new jl(t);
|
|
6670
6705
|
}), this.register(function(t) {
|
|
6671
6706
|
return new $l(t);
|
|
6672
6707
|
}), this.register(function(t) {
|
|
6673
|
-
return new
|
|
6708
|
+
return new Vl(t);
|
|
6709
|
+
}), this.register(function(t) {
|
|
6710
|
+
return new Kl(t);
|
|
6674
6711
|
}), this.register(function(t) {
|
|
6675
|
-
return new
|
|
6712
|
+
return new Yl(t);
|
|
6713
|
+
}), this.register(function(t) {
|
|
6714
|
+
return new Ul(t);
|
|
6676
6715
|
}), this.register(function(t) {
|
|
6677
6716
|
return new ed(t);
|
|
6717
|
+
}), this.register(function(t) {
|
|
6718
|
+
return new td(t);
|
|
6678
6719
|
});
|
|
6679
6720
|
}
|
|
6680
6721
|
/**
|
|
@@ -6774,9 +6815,9 @@ class Nl extends bi {
|
|
|
6774
6815
|
if (typeof e == "string")
|
|
6775
6816
|
i = JSON.parse(e);
|
|
6776
6817
|
else if (e instanceof ArrayBuffer)
|
|
6777
|
-
if (c.decode(new Uint8Array(e, 0, 4)) ===
|
|
6818
|
+
if (c.decode(new Uint8Array(e, 0, 4)) === co) {
|
|
6778
6819
|
try {
|
|
6779
|
-
o[K.KHR_BINARY_GLTF] = new
|
|
6820
|
+
o[K.KHR_BINARY_GLTF] = new nd(e);
|
|
6780
6821
|
} catch (u) {
|
|
6781
6822
|
s && s(u);
|
|
6782
6823
|
return;
|
|
@@ -6790,7 +6831,7 @@ class Nl extends bi {
|
|
|
6790
6831
|
s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
6791
6832
|
return;
|
|
6792
6833
|
}
|
|
6793
|
-
const l = new
|
|
6834
|
+
const l = new pd(i, {
|
|
6794
6835
|
path: t || this.resourcePath || "",
|
|
6795
6836
|
crossOrigin: this.crossOrigin,
|
|
6796
6837
|
requestHeader: this.requestHeader,
|
|
@@ -6808,16 +6849,16 @@ class Nl extends bi {
|
|
|
6808
6849
|
const u = i.extensionsUsed[d], h = i.extensionsRequired || [];
|
|
6809
6850
|
switch (u) {
|
|
6810
6851
|
case K.KHR_MATERIALS_UNLIT:
|
|
6811
|
-
o[u] = new
|
|
6852
|
+
o[u] = new Fl();
|
|
6812
6853
|
break;
|
|
6813
6854
|
case K.KHR_DRACO_MESH_COMPRESSION:
|
|
6814
|
-
o[u] = new
|
|
6855
|
+
o[u] = new sd(i, this.dracoLoader);
|
|
6815
6856
|
break;
|
|
6816
6857
|
case K.KHR_TEXTURE_TRANSFORM:
|
|
6817
|
-
o[u] = new
|
|
6858
|
+
o[u] = new id();
|
|
6818
6859
|
break;
|
|
6819
6860
|
case K.KHR_MESH_QUANTIZATION:
|
|
6820
|
-
o[u] = new
|
|
6861
|
+
o[u] = new rd();
|
|
6821
6862
|
break;
|
|
6822
6863
|
default:
|
|
6823
6864
|
h.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
@@ -6840,7 +6881,7 @@ class Nl extends bi {
|
|
|
6840
6881
|
});
|
|
6841
6882
|
}
|
|
6842
6883
|
}
|
|
6843
|
-
function
|
|
6884
|
+
function zl() {
|
|
6844
6885
|
let r = {};
|
|
6845
6886
|
return {
|
|
6846
6887
|
get: function(e) {
|
|
@@ -6881,7 +6922,7 @@ const K = {
|
|
|
6881
6922
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
6882
6923
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
6883
6924
|
};
|
|
6884
|
-
class
|
|
6925
|
+
class Ul {
|
|
6885
6926
|
constructor(e) {
|
|
6886
6927
|
this.parser = e, this.name = K.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
6887
6928
|
}
|
|
@@ -6903,13 +6944,13 @@ class zl {
|
|
|
6903
6944
|
const u = c.range !== void 0 ? c.range : 0;
|
|
6904
6945
|
switch (c.type) {
|
|
6905
6946
|
case "directional":
|
|
6906
|
-
l = new
|
|
6947
|
+
l = new Vo(d), l.target.position.set(0, 0, -1), l.add(l.target);
|
|
6907
6948
|
break;
|
|
6908
6949
|
case "point":
|
|
6909
|
-
l = new
|
|
6950
|
+
l = new jr(d), l.distance = u;
|
|
6910
6951
|
break;
|
|
6911
6952
|
case "spot":
|
|
6912
|
-
l = new
|
|
6953
|
+
l = new Ho(d), l.distance = u, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, l.angle = c.spot.outerConeAngle, l.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);
|
|
6913
6954
|
break;
|
|
6914
6955
|
default:
|
|
6915
6956
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);
|
|
@@ -6927,7 +6968,7 @@ class zl {
|
|
|
6927
6968
|
});
|
|
6928
6969
|
}
|
|
6929
6970
|
}
|
|
6930
|
-
class
|
|
6971
|
+
class Fl {
|
|
6931
6972
|
constructor() {
|
|
6932
6973
|
this.name = K.KHR_MATERIALS_UNLIT;
|
|
6933
6974
|
}
|
|
@@ -6948,7 +6989,7 @@ class Ul {
|
|
|
6948
6989
|
return Promise.all(s);
|
|
6949
6990
|
}
|
|
6950
6991
|
}
|
|
6951
|
-
class
|
|
6992
|
+
class jl {
|
|
6952
6993
|
constructor(e) {
|
|
6953
6994
|
this.parser = e, this.name = K.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
6954
6995
|
}
|
|
@@ -6960,7 +7001,7 @@ class Fl {
|
|
|
6960
7001
|
return i !== void 0 && (t.emissiveIntensity = i), Promise.resolve();
|
|
6961
7002
|
}
|
|
6962
7003
|
}
|
|
6963
|
-
class
|
|
7004
|
+
class Bl {
|
|
6964
7005
|
constructor(e) {
|
|
6965
7006
|
this.parser = e, this.name = K.KHR_MATERIALS_CLEARCOAT;
|
|
6966
7007
|
}
|
|
@@ -6975,12 +7016,12 @@ class jl {
|
|
|
6975
7016
|
const i = [], o = s.extensions[this.name];
|
|
6976
7017
|
if (o.clearcoatFactor !== void 0 && (t.clearcoat = o.clearcoatFactor), o.clearcoatTexture !== void 0 && i.push(n.assignTexture(t, "clearcoatMap", o.clearcoatTexture)), o.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = o.clearcoatRoughnessFactor), o.clearcoatRoughnessTexture !== void 0 && i.push(n.assignTexture(t, "clearcoatRoughnessMap", o.clearcoatRoughnessTexture)), o.clearcoatNormalTexture !== void 0 && (i.push(n.assignTexture(t, "clearcoatNormalMap", o.clearcoatNormalTexture)), o.clearcoatNormalTexture.scale !== void 0)) {
|
|
6977
7018
|
const a = o.clearcoatNormalTexture.scale;
|
|
6978
|
-
t.clearcoatNormalScale = new
|
|
7019
|
+
t.clearcoatNormalScale = new ke(a, a);
|
|
6979
7020
|
}
|
|
6980
7021
|
return Promise.all(i);
|
|
6981
7022
|
}
|
|
6982
7023
|
}
|
|
6983
|
-
class
|
|
7024
|
+
class Hl {
|
|
6984
7025
|
constructor(e) {
|
|
6985
7026
|
this.parser = e, this.name = K.KHR_MATERIALS_DISPERSION;
|
|
6986
7027
|
}
|
|
@@ -6996,7 +7037,7 @@ class Bl {
|
|
|
6996
7037
|
return t.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
|
|
6997
7038
|
}
|
|
6998
7039
|
}
|
|
6999
|
-
class
|
|
7040
|
+
class Vl {
|
|
7000
7041
|
constructor(e) {
|
|
7001
7042
|
this.parser = e, this.name = K.KHR_MATERIALS_IRIDESCENCE;
|
|
7002
7043
|
}
|
|
@@ -7012,7 +7053,7 @@ class Hl {
|
|
|
7012
7053
|
return o.iridescenceFactor !== void 0 && (t.iridescence = o.iridescenceFactor), o.iridescenceTexture !== void 0 && i.push(n.assignTexture(t, "iridescenceMap", o.iridescenceTexture)), o.iridescenceIor !== void 0 && (t.iridescenceIOR = o.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), o.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = o.iridescenceThicknessMinimum), o.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = o.iridescenceThicknessMaximum), o.iridescenceThicknessTexture !== void 0 && i.push(n.assignTexture(t, "iridescenceThicknessMap", o.iridescenceThicknessTexture)), Promise.all(i);
|
|
7013
7054
|
}
|
|
7014
7055
|
}
|
|
7015
|
-
class
|
|
7056
|
+
class Gl {
|
|
7016
7057
|
constructor(e) {
|
|
7017
7058
|
this.parser = e, this.name = K.KHR_MATERIALS_SHEEN;
|
|
7018
7059
|
}
|
|
@@ -7034,7 +7075,7 @@ class Vl {
|
|
|
7034
7075
|
return o.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = o.sheenRoughnessFactor), o.sheenColorTexture !== void 0 && i.push(n.assignTexture(t, "sheenColorMap", o.sheenColorTexture, mt)), o.sheenRoughnessTexture !== void 0 && i.push(n.assignTexture(t, "sheenRoughnessMap", o.sheenRoughnessTexture)), Promise.all(i);
|
|
7035
7076
|
}
|
|
7036
7077
|
}
|
|
7037
|
-
class
|
|
7078
|
+
class Zl {
|
|
7038
7079
|
constructor(e) {
|
|
7039
7080
|
this.parser = e, this.name = K.KHR_MATERIALS_TRANSMISSION;
|
|
7040
7081
|
}
|
|
@@ -7050,7 +7091,7 @@ class Gl {
|
|
|
7050
7091
|
return o.transmissionFactor !== void 0 && (t.transmission = o.transmissionFactor), o.transmissionTexture !== void 0 && i.push(n.assignTexture(t, "transmissionMap", o.transmissionTexture)), Promise.all(i);
|
|
7051
7092
|
}
|
|
7052
7093
|
}
|
|
7053
|
-
class
|
|
7094
|
+
class Wl {
|
|
7054
7095
|
constructor(e) {
|
|
7055
7096
|
this.parser = e, this.name = K.KHR_MATERIALS_VOLUME;
|
|
7056
7097
|
}
|
|
@@ -7068,7 +7109,7 @@ class Zl {
|
|
|
7068
7109
|
return t.attenuationColor = new lt().setRGB(a[0], a[1], a[2], Pe), Promise.all(i);
|
|
7069
7110
|
}
|
|
7070
7111
|
}
|
|
7071
|
-
class
|
|
7112
|
+
class Xl {
|
|
7072
7113
|
constructor(e) {
|
|
7073
7114
|
this.parser = e, this.name = K.KHR_MATERIALS_IOR;
|
|
7074
7115
|
}
|
|
@@ -7084,7 +7125,7 @@ class Wl {
|
|
|
7084
7125
|
return t.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
|
|
7085
7126
|
}
|
|
7086
7127
|
}
|
|
7087
|
-
class
|
|
7128
|
+
class $l {
|
|
7088
7129
|
constructor(e) {
|
|
7089
7130
|
this.parser = e, this.name = K.KHR_MATERIALS_SPECULAR;
|
|
7090
7131
|
}
|
|
@@ -7102,7 +7143,7 @@ class Xl {
|
|
|
7102
7143
|
return t.specularColor = new lt().setRGB(a[0], a[1], a[2], Pe), o.specularColorTexture !== void 0 && i.push(n.assignTexture(t, "specularColorMap", o.specularColorTexture, mt)), Promise.all(i);
|
|
7103
7144
|
}
|
|
7104
7145
|
}
|
|
7105
|
-
class
|
|
7146
|
+
class Yl {
|
|
7106
7147
|
constructor(e) {
|
|
7107
7148
|
this.parser = e, this.name = K.EXT_MATERIALS_BUMP;
|
|
7108
7149
|
}
|
|
@@ -7118,7 +7159,7 @@ class $l {
|
|
|
7118
7159
|
return t.bumpScale = o.bumpFactor !== void 0 ? o.bumpFactor : 1, o.bumpTexture !== void 0 && i.push(n.assignTexture(t, "bumpMap", o.bumpTexture)), Promise.all(i);
|
|
7119
7160
|
}
|
|
7120
7161
|
}
|
|
7121
|
-
class
|
|
7162
|
+
class Kl {
|
|
7122
7163
|
constructor(e) {
|
|
7123
7164
|
this.parser = e, this.name = K.KHR_MATERIALS_ANISOTROPY;
|
|
7124
7165
|
}
|
|
@@ -7134,7 +7175,7 @@ class Yl {
|
|
|
7134
7175
|
return o.anisotropyStrength !== void 0 && (t.anisotropy = o.anisotropyStrength), o.anisotropyRotation !== void 0 && (t.anisotropyRotation = o.anisotropyRotation), o.anisotropyTexture !== void 0 && i.push(n.assignTexture(t, "anisotropyMap", o.anisotropyTexture)), Promise.all(i);
|
|
7135
7176
|
}
|
|
7136
7177
|
}
|
|
7137
|
-
class
|
|
7178
|
+
class ql {
|
|
7138
7179
|
constructor(e) {
|
|
7139
7180
|
this.parser = e, this.name = K.KHR_TEXTURE_BASISU;
|
|
7140
7181
|
}
|
|
@@ -7151,7 +7192,7 @@ class Kl {
|
|
|
7151
7192
|
return t.loadTextureImage(e, i.source, o);
|
|
7152
7193
|
}
|
|
7153
7194
|
}
|
|
7154
|
-
class
|
|
7195
|
+
class Jl {
|
|
7155
7196
|
constructor(e) {
|
|
7156
7197
|
this.parser = e, this.name = K.EXT_TEXTURE_WEBP, this.isSupported = null;
|
|
7157
7198
|
}
|
|
@@ -7181,7 +7222,7 @@ class ql {
|
|
|
7181
7222
|
})), this.isSupported;
|
|
7182
7223
|
}
|
|
7183
7224
|
}
|
|
7184
|
-
class
|
|
7225
|
+
class Ql {
|
|
7185
7226
|
constructor(e) {
|
|
7186
7227
|
this.parser = e, this.name = K.EXT_TEXTURE_AVIF, this.isSupported = null;
|
|
7187
7228
|
}
|
|
@@ -7211,7 +7252,7 @@ class Jl {
|
|
|
7211
7252
|
})), this.isSupported;
|
|
7212
7253
|
}
|
|
7213
7254
|
}
|
|
7214
|
-
class
|
|
7255
|
+
class ed {
|
|
7215
7256
|
constructor(e) {
|
|
7216
7257
|
this.name = K.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
7217
7258
|
}
|
|
@@ -7237,7 +7278,7 @@ class Ql {
|
|
|
7237
7278
|
return null;
|
|
7238
7279
|
}
|
|
7239
7280
|
}
|
|
7240
|
-
class
|
|
7281
|
+
class td {
|
|
7241
7282
|
constructor(e) {
|
|
7242
7283
|
this.name = K.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
7243
7284
|
}
|
|
@@ -7255,22 +7296,22 @@ class ed {
|
|
|
7255
7296
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((l) => {
|
|
7256
7297
|
const d = l.pop(), u = d.isGroup ? d.children : [d], h = l[0].count, f = [];
|
|
7257
7298
|
for (const g of u) {
|
|
7258
|
-
const y = new pn(), x = new J(), b = new
|
|
7299
|
+
const y = new pn(), x = new J(), b = new is(), w = new J(1, 1, 1), T = new Go(g.geometry, g.material, h);
|
|
7259
7300
|
for (let v = 0; v < h; v++)
|
|
7260
7301
|
c.TRANSLATION && x.fromBufferAttribute(c.TRANSLATION, v), c.ROTATION && b.fromBufferAttribute(c.ROTATION, v), c.SCALE && w.fromBufferAttribute(c.SCALE, v), T.setMatrixAt(v, y.compose(x, b, w));
|
|
7261
7302
|
for (const v in c)
|
|
7262
7303
|
if (v === "_COLOR_0") {
|
|
7263
7304
|
const P = c[v];
|
|
7264
|
-
T.instanceColor = new
|
|
7305
|
+
T.instanceColor = new Zo(P.array, P.itemSize, P.normalized);
|
|
7265
7306
|
} else v !== "TRANSLATION" && v !== "ROTATION" && v !== "SCALE" && g.geometry.setAttribute(v, c[v]);
|
|
7266
|
-
|
|
7307
|
+
Hr.prototype.copy.call(T, g), this.parser.assignFinalMaterial(T), f.push(T);
|
|
7267
7308
|
}
|
|
7268
7309
|
return d.isGroup ? (d.clear(), d.add(...f), d) : f[0];
|
|
7269
7310
|
}));
|
|
7270
7311
|
}
|
|
7271
7312
|
}
|
|
7272
|
-
const
|
|
7273
|
-
class
|
|
7313
|
+
const co = "glTF", tn = 12, xr = { JSON: 1313821514, BIN: 5130562 };
|
|
7314
|
+
class nd {
|
|
7274
7315
|
constructor(e) {
|
|
7275
7316
|
this.name = K.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
7276
7317
|
const t = new DataView(e, 0, tn), n = new TextDecoder();
|
|
@@ -7278,7 +7319,7 @@ class td {
|
|
|
7278
7319
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
7279
7320
|
version: t.getUint32(4, !0),
|
|
7280
7321
|
length: t.getUint32(8, !0)
|
|
7281
|
-
}, this.header.magic !==
|
|
7322
|
+
}, this.header.magic !== co)
|
|
7282
7323
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
7283
7324
|
if (this.header.version < 2)
|
|
7284
7325
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
@@ -7288,10 +7329,10 @@ class td {
|
|
|
7288
7329
|
const a = i.getUint32(o, !0);
|
|
7289
7330
|
o += 4;
|
|
7290
7331
|
const c = i.getUint32(o, !0);
|
|
7291
|
-
if (o += 4, c ===
|
|
7332
|
+
if (o += 4, c === xr.JSON) {
|
|
7292
7333
|
const l = new Uint8Array(e, tn + o, a);
|
|
7293
7334
|
this.content = n.decode(l);
|
|
7294
|
-
} else if (c ===
|
|
7335
|
+
} else if (c === xr.BIN) {
|
|
7295
7336
|
const l = tn + o;
|
|
7296
7337
|
this.body = e.slice(l, l + a);
|
|
7297
7338
|
}
|
|
@@ -7301,7 +7342,7 @@ class td {
|
|
|
7301
7342
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
7302
7343
|
}
|
|
7303
7344
|
}
|
|
7304
|
-
class
|
|
7345
|
+
class sd {
|
|
7305
7346
|
constructor(e, t) {
|
|
7306
7347
|
if (!t)
|
|
7307
7348
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
@@ -7310,11 +7351,11 @@ class nd {
|
|
|
7310
7351
|
decodePrimitive(e, t) {
|
|
7311
7352
|
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, c = {}, l = {};
|
|
7312
7353
|
for (const d in o) {
|
|
7313
|
-
const u =
|
|
7354
|
+
const u = ci[d] || d.toLowerCase();
|
|
7314
7355
|
a[u] = o[d];
|
|
7315
7356
|
}
|
|
7316
7357
|
for (const d in e.attributes) {
|
|
7317
|
-
const u =
|
|
7358
|
+
const u = ci[d] || d.toLowerCase();
|
|
7318
7359
|
if (o[d] !== void 0) {
|
|
7319
7360
|
const h = n.accessors[e.attributes[d]], f = $t[h.componentType];
|
|
7320
7361
|
l[u] = f.name, c[u] = h.normalized === !0;
|
|
@@ -7333,7 +7374,7 @@ class nd {
|
|
|
7333
7374
|
});
|
|
7334
7375
|
}
|
|
7335
7376
|
}
|
|
7336
|
-
class
|
|
7377
|
+
class id {
|
|
7337
7378
|
constructor() {
|
|
7338
7379
|
this.name = K.KHR_TEXTURE_TRANSFORM;
|
|
7339
7380
|
}
|
|
@@ -7341,12 +7382,12 @@ class sd {
|
|
|
7341
7382
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
7342
7383
|
}
|
|
7343
7384
|
}
|
|
7344
|
-
class
|
|
7385
|
+
class rd {
|
|
7345
7386
|
constructor() {
|
|
7346
7387
|
this.name = K.KHR_MESH_QUANTIZATION;
|
|
7347
7388
|
}
|
|
7348
7389
|
}
|
|
7349
|
-
class
|
|
7390
|
+
class lo extends ma {
|
|
7350
7391
|
constructor(e, t, n, s) {
|
|
7351
7392
|
super(e, t, n, s);
|
|
7352
7393
|
}
|
|
@@ -7365,11 +7406,11 @@ class co extends fa {
|
|
|
7365
7406
|
return i;
|
|
7366
7407
|
}
|
|
7367
7408
|
}
|
|
7368
|
-
const
|
|
7369
|
-
class
|
|
7409
|
+
const od = new is();
|
|
7410
|
+
class ad extends lo {
|
|
7370
7411
|
interpolate_(e, t, n, s) {
|
|
7371
7412
|
const i = super.interpolate_(e, t, n, s);
|
|
7372
|
-
return
|
|
7413
|
+
return od.fromArray(i).normalize().toArray(i), i;
|
|
7373
7414
|
}
|
|
7374
7415
|
}
|
|
7375
7416
|
const Ie = {
|
|
@@ -7387,18 +7428,18 @@ const Ie = {
|
|
|
7387
7428
|
5123: Uint16Array,
|
|
7388
7429
|
5125: Uint32Array,
|
|
7389
7430
|
5126: Float32Array
|
|
7390
|
-
}, xr = {
|
|
7391
|
-
9728: Vr,
|
|
7392
|
-
9729: Yt,
|
|
7393
|
-
9984: Ko,
|
|
7394
|
-
9985: Yo,
|
|
7395
|
-
9986: $o,
|
|
7396
|
-
9987: Hr
|
|
7397
7431
|
}, br = {
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7432
|
+
9728: Gr,
|
|
7433
|
+
9729: Yt,
|
|
7434
|
+
9984: qo,
|
|
7435
|
+
9985: Ko,
|
|
7436
|
+
9986: Yo,
|
|
7437
|
+
9987: Vr
|
|
7438
|
+
}, wr = {
|
|
7439
|
+
33071: qs,
|
|
7440
|
+
33648: Jo,
|
|
7441
|
+
10497: ei
|
|
7442
|
+
}, Fs = {
|
|
7402
7443
|
SCALAR: 1,
|
|
7403
7444
|
VEC2: 2,
|
|
7404
7445
|
VEC3: 3,
|
|
@@ -7406,7 +7447,7 @@ const Ie = {
|
|
|
7406
7447
|
MAT2: 4,
|
|
7407
7448
|
MAT3: 9,
|
|
7408
7449
|
MAT4: 16
|
|
7409
|
-
},
|
|
7450
|
+
}, ci = {
|
|
7410
7451
|
POSITION: "position",
|
|
7411
7452
|
NORMAL: "normal",
|
|
7412
7453
|
TANGENT: "tangent",
|
|
@@ -7422,26 +7463,26 @@ const Ie = {
|
|
|
7422
7463
|
translation: "position",
|
|
7423
7464
|
rotation: "quaternion",
|
|
7424
7465
|
weights: "morphTargetInfluences"
|
|
7425
|
-
},
|
|
7466
|
+
}, cd = {
|
|
7426
7467
|
CUBICSPLINE: void 0,
|
|
7427
7468
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
7428
7469
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
7429
|
-
LINEAR:
|
|
7430
|
-
STEP:
|
|
7431
|
-
},
|
|
7470
|
+
LINEAR: Wr,
|
|
7471
|
+
STEP: ha
|
|
7472
|
+
}, js = {
|
|
7432
7473
|
OPAQUE: "OPAQUE",
|
|
7433
7474
|
MASK: "MASK",
|
|
7434
7475
|
BLEND: "BLEND"
|
|
7435
7476
|
};
|
|
7436
|
-
function
|
|
7437
|
-
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new
|
|
7477
|
+
function ld(r) {
|
|
7478
|
+
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new rs({
|
|
7438
7479
|
color: 16777215,
|
|
7439
7480
|
emissive: 0,
|
|
7440
7481
|
metalness: 1,
|
|
7441
7482
|
roughness: 1,
|
|
7442
7483
|
transparent: !1,
|
|
7443
7484
|
depthTest: !0,
|
|
7444
|
-
side:
|
|
7485
|
+
side: fa
|
|
7445
7486
|
})), r.DefaultMaterial;
|
|
7446
7487
|
}
|
|
7447
7488
|
function bt(r, e, t) {
|
|
@@ -7451,7 +7492,7 @@ function bt(r, e, t) {
|
|
|
7451
7492
|
function it(r, e) {
|
|
7452
7493
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
7453
7494
|
}
|
|
7454
|
-
function
|
|
7495
|
+
function dd(r, e, t) {
|
|
7455
7496
|
let n = !1, s = !1, i = !1;
|
|
7456
7497
|
for (let l = 0, d = e.length; l < d; l++) {
|
|
7457
7498
|
const u = e[l];
|
|
@@ -7483,7 +7524,7 @@ function ld(r, e, t) {
|
|
|
7483
7524
|
return n && (r.morphAttributes.position = d), s && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = h), r.morphTargetsRelative = !0, r;
|
|
7484
7525
|
});
|
|
7485
7526
|
}
|
|
7486
|
-
function
|
|
7527
|
+
function ud(r, e) {
|
|
7487
7528
|
if (r.updateMorphTargets(), e.weights !== void 0)
|
|
7488
7529
|
for (let t = 0, n = e.weights.length; t < n; t++)
|
|
7489
7530
|
r.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -7497,22 +7538,22 @@ function dd(r, e) {
|
|
|
7497
7538
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
7498
7539
|
}
|
|
7499
7540
|
}
|
|
7500
|
-
function
|
|
7541
|
+
function hd(r) {
|
|
7501
7542
|
let e;
|
|
7502
7543
|
const t = r.extensions && r.extensions[K.KHR_DRACO_MESH_COMPRESSION];
|
|
7503
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" +
|
|
7544
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Bs(t.attributes) : e = r.indices + ":" + Bs(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
7504
7545
|
for (let n = 0, s = r.targets.length; n < s; n++)
|
|
7505
|
-
e += ":" +
|
|
7546
|
+
e += ":" + Bs(r.targets[n]);
|
|
7506
7547
|
return e;
|
|
7507
7548
|
}
|
|
7508
|
-
function
|
|
7549
|
+
function Bs(r) {
|
|
7509
7550
|
let e = "";
|
|
7510
7551
|
const t = Object.keys(r).sort();
|
|
7511
7552
|
for (let n = 0, s = t.length; n < s; n++)
|
|
7512
7553
|
e += t[n] + ":" + r[t[n]] + ";";
|
|
7513
7554
|
return e;
|
|
7514
7555
|
}
|
|
7515
|
-
function
|
|
7556
|
+
function li(r) {
|
|
7516
7557
|
switch (r) {
|
|
7517
7558
|
case Int8Array:
|
|
7518
7559
|
return 1 / 127;
|
|
@@ -7526,13 +7567,13 @@ function ci(r) {
|
|
|
7526
7567
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
7527
7568
|
}
|
|
7528
7569
|
}
|
|
7529
|
-
function
|
|
7570
|
+
function fd(r) {
|
|
7530
7571
|
return r.search(/\.jpe?g($|\?)/i) > 0 || r.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : r.search(/\.webp($|\?)/i) > 0 || r.search(/^data\:image\/webp/) === 0 ? "image/webp" : r.search(/\.ktx2($|\?)/i) > 0 || r.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
7531
7572
|
}
|
|
7532
|
-
const
|
|
7533
|
-
class
|
|
7573
|
+
const md = new pn();
|
|
7574
|
+
class pd {
|
|
7534
7575
|
constructor(e = {}, t = {}) {
|
|
7535
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
7576
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new zl(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
7536
7577
|
let n = !1, s = -1, i = !1, o = -1;
|
|
7537
7578
|
if (typeof navigator < "u") {
|
|
7538
7579
|
const a = navigator.userAgent;
|
|
@@ -7540,7 +7581,7 @@ class md {
|
|
|
7540
7581
|
const c = a.match(/Version\/(\d+)/);
|
|
7541
7582
|
s = n && c ? parseInt(c[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
7542
7583
|
}
|
|
7543
|
-
typeof createImageBitmap > "u" || n && s < 17 || i && o < 98 ? this.textureLoader = new
|
|
7584
|
+
typeof createImageBitmap > "u" || n && s < 17 || i && o < 98 ? this.textureLoader = new Wo(this.options.manager) : this.textureLoader = new Xo(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new mn(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
7544
7585
|
}
|
|
7545
7586
|
setExtensions(e) {
|
|
7546
7587
|
this.extensions = e;
|
|
@@ -7780,21 +7821,21 @@ class md {
|
|
|
7780
7821
|
loadAccessor(e) {
|
|
7781
7822
|
const t = this, n = this.json, s = this.json.accessors[e];
|
|
7782
7823
|
if (s.bufferView === void 0 && s.sparse === void 0) {
|
|
7783
|
-
const o =
|
|
7824
|
+
const o = Fs[s.type], a = $t[s.componentType], c = s.normalized === !0, l = new a(s.count * o);
|
|
7784
7825
|
return Promise.resolve(new at(l, o, c));
|
|
7785
7826
|
}
|
|
7786
7827
|
const i = [];
|
|
7787
7828
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
7788
|
-
const a = o[0], c =
|
|
7829
|
+
const a = o[0], c = Fs[s.type], l = $t[s.componentType], d = l.BYTES_PER_ELEMENT, u = d * c, h = s.byteOffset || 0, f = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, g = s.normalized === !0;
|
|
7789
7830
|
let y, x;
|
|
7790
7831
|
if (f && f !== u) {
|
|
7791
7832
|
const b = Math.floor(h / f), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + b + ":" + s.count;
|
|
7792
7833
|
let T = t.cache.get(w);
|
|
7793
|
-
T || (y = new l(a, b * f, s.count * f / d), T = new
|
|
7834
|
+
T || (y = new l(a, b * f, s.count * f / d), T = new $o(y, f / d), t.cache.add(w, T)), x = new Et(T, c, h % f / d, g);
|
|
7794
7835
|
} else
|
|
7795
7836
|
a === null ? y = new l(s.count * c) : y = new l(a, h, s.count * c), x = new at(y, c, g);
|
|
7796
7837
|
if (s.sparse !== void 0) {
|
|
7797
|
-
const b =
|
|
7838
|
+
const b = Fs.SCALAR, w = $t[s.sparse.indices.componentType], T = s.sparse.indices.byteOffset || 0, v = s.sparse.values.byteOffset || 0, P = new w(o[1], T, s.sparse.count * b), V = new l(o[2], v, s.sparse.count * c);
|
|
7798
7839
|
a !== null && (x = new at(x.array.slice(), x.itemSize, x.normalized)), x.normalized = !1;
|
|
7799
7840
|
for (let F = 0, L = P.length; F < L; F++) {
|
|
7800
7841
|
const R = P[F];
|
|
@@ -7828,7 +7869,7 @@ class md {
|
|
|
7828
7869
|
const l = this.loadImageSource(t, n).then(function(d) {
|
|
7829
7870
|
d.flipY = !1, d.name = o.name || a.name || "", d.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (d.name = a.uri);
|
|
7830
7871
|
const h = (i.samplers || {})[o.sampler] || {};
|
|
7831
|
-
return d.magFilter =
|
|
7872
|
+
return d.magFilter = br[h.magFilter] || Yt, d.minFilter = br[h.minFilter] || Vr, d.wrapS = wr[h.wrapS] || ei, d.wrapT = wr[h.wrapT] || ei, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== Gr && d.minFilter !== Yt, s.associations.set(d, { textures: e }), d;
|
|
7832
7873
|
}).catch(function() {
|
|
7833
7874
|
return null;
|
|
7834
7875
|
});
|
|
@@ -7852,12 +7893,12 @@ class md {
|
|
|
7852
7893
|
return new Promise(function(h, f) {
|
|
7853
7894
|
let g = h;
|
|
7854
7895
|
t.isImageBitmapLoader === !0 && (g = function(y) {
|
|
7855
|
-
const x = new
|
|
7896
|
+
const x = new Qi(y);
|
|
7856
7897
|
x.needsUpdate = !0, h(x);
|
|
7857
7898
|
}), t.load(fn.resolveURL(u, i.path), g, void 0, f);
|
|
7858
7899
|
});
|
|
7859
7900
|
}).then(function(u) {
|
|
7860
|
-
return l === !0 && a.revokeObjectURL(c), it(u, o), u.userData.mimeType = o.mimeType ||
|
|
7901
|
+
return l === !0 && a.revokeObjectURL(c), it(u, o), u.userData.mimeType = o.mimeType || fd(o.uri), u;
|
|
7861
7902
|
}).catch(function(u) {
|
|
7862
7903
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", c), u;
|
|
7863
7904
|
});
|
|
@@ -7904,11 +7945,11 @@ class md {
|
|
|
7904
7945
|
if (e.isPoints) {
|
|
7905
7946
|
const a = "PointsMaterial:" + n.uuid;
|
|
7906
7947
|
let c = this.cache.get(a);
|
|
7907
|
-
c || (c = new
|
|
7948
|
+
c || (c = new Qo(), Ls.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, c.sizeAttenuation = !1, this.cache.add(a, c)), n = c;
|
|
7908
7949
|
} else if (e.isLine) {
|
|
7909
7950
|
const a = "LineBasicMaterial:" + n.uuid;
|
|
7910
7951
|
let c = this.cache.get(a);
|
|
7911
|
-
c || (c = new
|
|
7952
|
+
c || (c = new ea(), Ls.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, this.cache.add(a, c)), n = c;
|
|
7912
7953
|
}
|
|
7913
7954
|
if (s || i || o) {
|
|
7914
7955
|
let a = "ClonedMaterial:" + n.uuid + ":";
|
|
@@ -7919,7 +7960,7 @@ class md {
|
|
|
7919
7960
|
e.material = n;
|
|
7920
7961
|
}
|
|
7921
7962
|
getMaterialType() {
|
|
7922
|
-
return
|
|
7963
|
+
return rs;
|
|
7923
7964
|
}
|
|
7924
7965
|
/**
|
|
7925
7966
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -7947,9 +7988,9 @@ class md {
|
|
|
7947
7988
|
return h.extendMaterialParams && h.extendMaterialParams(e, a);
|
|
7948
7989
|
})));
|
|
7949
7990
|
}
|
|
7950
|
-
i.doubleSided === !0 && (a.side =
|
|
7951
|
-
const d = i.alphaMode ||
|
|
7952
|
-
if (d ===
|
|
7991
|
+
i.doubleSided === !0 && (a.side = ta);
|
|
7992
|
+
const d = i.alphaMode || js.OPAQUE;
|
|
7993
|
+
if (d === js.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === js.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Ht && (l.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new ke(1, 1), i.normalTexture.scale !== void 0)) {
|
|
7953
7994
|
const u = i.normalTexture.scale;
|
|
7954
7995
|
a.normalScale.set(u, u);
|
|
7955
7996
|
}
|
|
@@ -7970,7 +8011,7 @@ class md {
|
|
|
7970
8011
|
* @return {string}
|
|
7971
8012
|
*/
|
|
7972
8013
|
createUniqueName(e) {
|
|
7973
|
-
const t =
|
|
8014
|
+
const t = na.sanitizeNodeName(e || "");
|
|
7974
8015
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
7975
8016
|
}
|
|
7976
8017
|
/**
|
|
@@ -7986,17 +8027,17 @@ class md {
|
|
|
7986
8027
|
const t = this, n = this.extensions, s = this.primitiveCache;
|
|
7987
8028
|
function i(a) {
|
|
7988
8029
|
return n[K.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(c) {
|
|
7989
|
-
return
|
|
8030
|
+
return Er(c, a, t);
|
|
7990
8031
|
});
|
|
7991
8032
|
}
|
|
7992
8033
|
const o = [];
|
|
7993
8034
|
for (let a = 0, c = e.length; a < c; a++) {
|
|
7994
|
-
const l = e[a], d =
|
|
8035
|
+
const l = e[a], d = hd(l), u = s[d];
|
|
7995
8036
|
if (u)
|
|
7996
8037
|
o.push(u.promise);
|
|
7997
8038
|
else {
|
|
7998
8039
|
let h;
|
|
7999
|
-
l.extensions && l.extensions[K.KHR_DRACO_MESH_COMPRESSION] ? h = i(l) : h =
|
|
8040
|
+
l.extensions && l.extensions[K.KHR_DRACO_MESH_COMPRESSION] ? h = i(l) : h = Er(new Si(), l, t), s[d] = { primitive: l, promise: h }, o.push(h);
|
|
8000
8041
|
}
|
|
8001
8042
|
}
|
|
8002
8043
|
return Promise.all(o);
|
|
@@ -8011,7 +8052,7 @@ class md {
|
|
|
8011
8052
|
loadMesh(e) {
|
|
8012
8053
|
const t = this, n = this.json, s = this.extensions, i = n.meshes[e], o = i.primitives, a = [];
|
|
8013
8054
|
for (let c = 0, l = o.length; c < l; c++) {
|
|
8014
|
-
const d = o[c].material === void 0 ?
|
|
8055
|
+
const d = o[c].material === void 0 ? ld(this.cache) : this.getDependency("material", o[c].material);
|
|
8015
8056
|
a.push(d);
|
|
8016
8057
|
}
|
|
8017
8058
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
|
|
@@ -8021,18 +8062,18 @@ class md {
|
|
|
8021
8062
|
let b;
|
|
8022
8063
|
const w = l[f];
|
|
8023
8064
|
if (x.mode === Ie.TRIANGLES || x.mode === Ie.TRIANGLE_STRIP || x.mode === Ie.TRIANGLE_FAN || x.mode === void 0)
|
|
8024
|
-
b = i.isSkinnedMesh === !0 ? new
|
|
8065
|
+
b = i.isSkinnedMesh === !0 ? new sa(y, w) : new ye(y, w), b.isSkinnedMesh === !0 && b.normalizeSkinWeights(), x.mode === Ie.TRIANGLE_STRIP ? b.geometry = hr(b.geometry, Br) : x.mode === Ie.TRIANGLE_FAN && (b.geometry = hr(b.geometry, Js));
|
|
8025
8066
|
else if (x.mode === Ie.LINES)
|
|
8026
|
-
b = new
|
|
8067
|
+
b = new Zr(y, w);
|
|
8027
8068
|
else if (x.mode === Ie.LINE_STRIP)
|
|
8028
|
-
b = new sa(y, w);
|
|
8029
|
-
else if (x.mode === Ie.LINE_LOOP)
|
|
8030
8069
|
b = new ia(y, w);
|
|
8031
|
-
else if (x.mode === Ie.
|
|
8070
|
+
else if (x.mode === Ie.LINE_LOOP)
|
|
8032
8071
|
b = new ra(y, w);
|
|
8072
|
+
else if (x.mode === Ie.POINTS)
|
|
8073
|
+
b = new oa(y, w);
|
|
8033
8074
|
else
|
|
8034
8075
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + x.mode);
|
|
8035
|
-
Object.keys(b.geometry.morphAttributes).length > 0 &&
|
|
8076
|
+
Object.keys(b.geometry.morphAttributes).length > 0 && ud(b, i), b.name = t.createUniqueName(i.name || "mesh_" + e), it(b, i), x.extensions && bt(s, b, x), t.assignFinalMaterial(b), u.push(b);
|
|
8036
8077
|
}
|
|
8037
8078
|
for (let f = 0, g = u.length; f < g; f++)
|
|
8038
8079
|
t.associations.set(u[f], {
|
|
@@ -8041,7 +8082,7 @@ class md {
|
|
|
8041
8082
|
});
|
|
8042
8083
|
if (u.length === 1)
|
|
8043
8084
|
return i.extensions && bt(s, u[0], i), u[0];
|
|
8044
|
-
const h = new
|
|
8085
|
+
const h = new ks();
|
|
8045
8086
|
i.extensions && bt(s, h, i), t.associations.set(h, { meshes: e });
|
|
8046
8087
|
for (let f = 0, g = u.length; f < g; f++)
|
|
8047
8088
|
h.add(u[f]);
|
|
@@ -8062,7 +8103,7 @@ class md {
|
|
|
8062
8103
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
8063
8104
|
return;
|
|
8064
8105
|
}
|
|
8065
|
-
return n.type === "perspective" ? t = new
|
|
8106
|
+
return n.type === "perspective" ? t = new aa(bi.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new ca(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), it(t, n), Promise.resolve(t);
|
|
8066
8107
|
}
|
|
8067
8108
|
/**
|
|
8068
8109
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -8086,7 +8127,7 @@ class md {
|
|
|
8086
8127
|
} else
|
|
8087
8128
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[l]);
|
|
8088
8129
|
}
|
|
8089
|
-
return new
|
|
8130
|
+
return new la(a, c);
|
|
8090
8131
|
});
|
|
8091
8132
|
}
|
|
8092
8133
|
/**
|
|
@@ -8116,10 +8157,10 @@ class md {
|
|
|
8116
8157
|
v.updateMatrix && v.updateMatrix();
|
|
8117
8158
|
const R = n._createAnimationTracks(v, P, V, F, L);
|
|
8118
8159
|
if (R)
|
|
8119
|
-
for (let
|
|
8120
|
-
b.push(R[
|
|
8160
|
+
for (let C = 0; C < R.length; C++)
|
|
8161
|
+
b.push(R[C]);
|
|
8121
8162
|
}
|
|
8122
|
-
return new
|
|
8163
|
+
return new da(i, void 0, b);
|
|
8123
8164
|
});
|
|
8124
8165
|
}
|
|
8125
8166
|
createNodeMesh(e) {
|
|
@@ -8152,7 +8193,7 @@ class md {
|
|
|
8152
8193
|
]).then(function(l) {
|
|
8153
8194
|
const d = l[0], u = l[1], h = l[2];
|
|
8154
8195
|
h !== null && d.traverse(function(f) {
|
|
8155
|
-
f.isSkinnedMesh && f.bind(h,
|
|
8196
|
+
f.isSkinnedMesh && f.bind(h, md);
|
|
8156
8197
|
});
|
|
8157
8198
|
for (let f = 0, g = u.length; f < g; f++)
|
|
8158
8199
|
d.add(u[f]);
|
|
@@ -8176,7 +8217,7 @@ class md {
|
|
|
8176
8217
|
a.push(l);
|
|
8177
8218
|
}), this.nodeCache[e] = Promise.all(a).then(function(l) {
|
|
8178
8219
|
let d;
|
|
8179
|
-
if (i.isBone === !0 ? d = new
|
|
8220
|
+
if (i.isBone === !0 ? d = new ua() : l.length > 1 ? d = new ks() : l.length === 1 ? d = l[0] : d = new Hr(), d !== l[0])
|
|
8180
8221
|
for (let u = 0, h = l.length; u < h; u++)
|
|
8181
8222
|
d.add(l[u]);
|
|
8182
8223
|
if (i.name && (d.userData.name = i.name, d.name = o), it(d, i), i.extensions && bt(n, d, i), i.matrix !== void 0) {
|
|
@@ -8195,7 +8236,7 @@ class md {
|
|
|
8195
8236
|
* @return {Promise<Group>}
|
|
8196
8237
|
*/
|
|
8197
8238
|
loadScene(e) {
|
|
8198
|
-
const t = this.extensions, n = this.json.scenes[e], s = this, i = new
|
|
8239
|
+
const t = this.extensions, n = this.json.scenes[e], s = this, i = new ks();
|
|
8199
8240
|
n.name && (i.name = s.createUniqueName(n.name)), it(i, n), n.extensions && bt(t, i, n);
|
|
8200
8241
|
const o = n.nodes || [], a = [];
|
|
8201
8242
|
for (let c = 0, l = o.length; c < l; c++)
|
|
@@ -8206,7 +8247,7 @@ class md {
|
|
|
8206
8247
|
const l = (d) => {
|
|
8207
8248
|
const u = /* @__PURE__ */ new Map();
|
|
8208
8249
|
for (const [h, f] of s.associations)
|
|
8209
|
-
(h instanceof Ls || h instanceof
|
|
8250
|
+
(h instanceof Ls || h instanceof Qi) && u.set(h, f);
|
|
8210
8251
|
return d.traverse((h) => {
|
|
8211
8252
|
const f = s.associations.get(h);
|
|
8212
8253
|
f != null && u.set(h, f);
|
|
@@ -8223,29 +8264,29 @@ class md {
|
|
|
8223
8264
|
let l;
|
|
8224
8265
|
switch (ht[i.path]) {
|
|
8225
8266
|
case ht.weights:
|
|
8226
|
-
l =
|
|
8267
|
+
l = tr;
|
|
8227
8268
|
break;
|
|
8228
8269
|
case ht.rotation:
|
|
8229
|
-
l =
|
|
8270
|
+
l = nr;
|
|
8230
8271
|
break;
|
|
8231
8272
|
case ht.translation:
|
|
8232
8273
|
case ht.scale:
|
|
8233
|
-
l =
|
|
8274
|
+
l = er;
|
|
8234
8275
|
break;
|
|
8235
8276
|
default:
|
|
8236
8277
|
switch (n.itemSize) {
|
|
8237
8278
|
case 1:
|
|
8238
|
-
l =
|
|
8279
|
+
l = tr;
|
|
8239
8280
|
break;
|
|
8240
8281
|
case 2:
|
|
8241
8282
|
case 3:
|
|
8242
8283
|
default:
|
|
8243
|
-
l =
|
|
8284
|
+
l = er;
|
|
8244
8285
|
break;
|
|
8245
8286
|
}
|
|
8246
8287
|
break;
|
|
8247
8288
|
}
|
|
8248
|
-
const d = s.interpolation !== void 0 ?
|
|
8289
|
+
const d = s.interpolation !== void 0 ? cd[s.interpolation] : Wr, u = this._getArrayFromAccessor(n);
|
|
8249
8290
|
for (let h = 0, f = c.length; h < f; h++) {
|
|
8250
8291
|
const g = new l(
|
|
8251
8292
|
c[h] + "." + ht[i.path],
|
|
@@ -8260,7 +8301,7 @@ class md {
|
|
|
8260
8301
|
_getArrayFromAccessor(e) {
|
|
8261
8302
|
let t = e.array;
|
|
8262
8303
|
if (e.normalized) {
|
|
8263
|
-
const n =
|
|
8304
|
+
const n = li(t.constructor), s = new Float32Array(t.length);
|
|
8264
8305
|
for (let i = 0, o = t.length; i < o; i++)
|
|
8265
8306
|
s[i] = t[i] * n;
|
|
8266
8307
|
t = s;
|
|
@@ -8269,13 +8310,13 @@ class md {
|
|
|
8269
8310
|
}
|
|
8270
8311
|
_createCubicSplineTrackInterpolant(e) {
|
|
8271
8312
|
e.createInterpolant = function(n) {
|
|
8272
|
-
const s = this instanceof
|
|
8313
|
+
const s = this instanceof nr ? ad : lo;
|
|
8273
8314
|
return new s(this.times, this.values, this.getValueSize() / 3, n);
|
|
8274
8315
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
8275
8316
|
}
|
|
8276
8317
|
}
|
|
8277
|
-
function
|
|
8278
|
-
const n = e.attributes, s = new
|
|
8318
|
+
function _d(r, e, t) {
|
|
8319
|
+
const n = e.attributes, s = new ps();
|
|
8279
8320
|
if (n.POSITION !== void 0) {
|
|
8280
8321
|
const a = t.json.accessors[n.POSITION], c = a.min, l = a.max;
|
|
8281
8322
|
if (c !== void 0 && l !== void 0) {
|
|
@@ -8283,7 +8324,7 @@ function pd(r, e, t) {
|
|
|
8283
8324
|
new J(c[0], c[1], c[2]),
|
|
8284
8325
|
new J(l[0], l[1], l[2])
|
|
8285
8326
|
), a.normalized) {
|
|
8286
|
-
const d =
|
|
8327
|
+
const d = li($t[a.componentType]);
|
|
8287
8328
|
s.min.multiplyScalar(d), s.max.multiplyScalar(d);
|
|
8288
8329
|
}
|
|
8289
8330
|
} else {
|
|
@@ -8301,7 +8342,7 @@ function pd(r, e, t) {
|
|
|
8301
8342
|
const h = t.json.accessors[u.POSITION], f = h.min, g = h.max;
|
|
8302
8343
|
if (f !== void 0 && g !== void 0) {
|
|
8303
8344
|
if (c.setX(Math.max(Math.abs(f[0]), Math.abs(g[0]))), c.setY(Math.max(Math.abs(f[1]), Math.abs(g[1]))), c.setZ(Math.max(Math.abs(f[2]), Math.abs(g[2]))), h.normalized) {
|
|
8304
|
-
const y =
|
|
8345
|
+
const y = li($t[h.componentType]);
|
|
8305
8346
|
c.multiplyScalar(y);
|
|
8306
8347
|
}
|
|
8307
8348
|
a.max(c);
|
|
@@ -8312,10 +8353,10 @@ function pd(r, e, t) {
|
|
|
8312
8353
|
s.expandByVector(a);
|
|
8313
8354
|
}
|
|
8314
8355
|
r.boundingBox = s;
|
|
8315
|
-
const o = new
|
|
8356
|
+
const o = new Ti();
|
|
8316
8357
|
s.getCenter(o.center), o.radius = s.min.distanceTo(s.max) / 2, r.boundingSphere = o;
|
|
8317
8358
|
}
|
|
8318
|
-
function
|
|
8359
|
+
function Er(r, e, t) {
|
|
8319
8360
|
const n = e.attributes, s = [];
|
|
8320
8361
|
function i(o, a) {
|
|
8321
8362
|
return t.getDependency("accessor", o).then(function(c) {
|
|
@@ -8323,7 +8364,7 @@ function wr(r, e, t) {
|
|
|
8323
8364
|
});
|
|
8324
8365
|
}
|
|
8325
8366
|
for (const o in n) {
|
|
8326
|
-
const a =
|
|
8367
|
+
const a = ci[o] || o.toLowerCase();
|
|
8327
8368
|
a in r.attributes || s.push(i(n[o], a));
|
|
8328
8369
|
}
|
|
8329
8370
|
if (e.indices !== void 0 && !r.index) {
|
|
@@ -8332,12 +8373,12 @@ function wr(r, e, t) {
|
|
|
8332
8373
|
});
|
|
8333
8374
|
s.push(o);
|
|
8334
8375
|
}
|
|
8335
|
-
return
|
|
8336
|
-
return e.targets !== void 0 ?
|
|
8376
|
+
return ti.workingColorSpace !== Pe && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ti.workingColorSpace}" not supported.`), it(r, e), _d(r, e, t), Promise.all(s).then(function() {
|
|
8377
|
+
return e.targets !== void 0 ? dd(r, e.targets, t) : r;
|
|
8337
8378
|
});
|
|
8338
8379
|
}
|
|
8339
|
-
const
|
|
8340
|
-
class
|
|
8380
|
+
const Hs = /* @__PURE__ */ new WeakMap();
|
|
8381
|
+
class gd extends wi {
|
|
8341
8382
|
/**
|
|
8342
8383
|
* Constructs a new Draco loader.
|
|
8343
8384
|
*
|
|
@@ -8423,8 +8464,8 @@ class _d extends bi {
|
|
|
8423
8464
|
}
|
|
8424
8465
|
decodeGeometry(e, t) {
|
|
8425
8466
|
const n = JSON.stringify(t);
|
|
8426
|
-
if (
|
|
8427
|
-
const c =
|
|
8467
|
+
if (Hs.has(e)) {
|
|
8468
|
+
const c = Hs.get(e);
|
|
8428
8469
|
if (c.key === n)
|
|
8429
8470
|
return c.promise;
|
|
8430
8471
|
if (e.byteLength === 0)
|
|
@@ -8438,13 +8479,13 @@ class _d extends bi {
|
|
|
8438
8479
|
}))).then((c) => this._createGeometry(c.geometry));
|
|
8439
8480
|
return a.catch(() => !0).then(() => {
|
|
8440
8481
|
s && i && this._releaseTask(s, i);
|
|
8441
|
-
}),
|
|
8482
|
+
}), Hs.set(e, {
|
|
8442
8483
|
key: n,
|
|
8443
8484
|
promise: a
|
|
8444
8485
|
}), a;
|
|
8445
8486
|
}
|
|
8446
8487
|
_createGeometry(e) {
|
|
8447
|
-
const t = new
|
|
8488
|
+
const t = new Si();
|
|
8448
8489
|
e.index && t.setIndex(new at(e.index.array, 1));
|
|
8449
8490
|
for (let n = 0; n < e.attributes.length; n++) {
|
|
8450
8491
|
const s = e.attributes[n], i = s.name, o = s.array, a = s.itemSize, c = new at(o, a);
|
|
@@ -8456,7 +8497,7 @@ class _d extends bi {
|
|
|
8456
8497
|
if (t !== mt) return;
|
|
8457
8498
|
const n = new lt();
|
|
8458
8499
|
for (let s = 0, i = e.count; s < i; s++)
|
|
8459
|
-
n.fromBufferAttribute(e, s),
|
|
8500
|
+
n.fromBufferAttribute(e, s), ti.toWorkingColorSpace(n, mt), e.setXYZ(s, n.r, n.g, n.b);
|
|
8460
8501
|
}
|
|
8461
8502
|
_loadLibrary(e, t) {
|
|
8462
8503
|
const n = new mn(this.manager);
|
|
@@ -8473,7 +8514,7 @@ class _d extends bi {
|
|
|
8473
8514
|
return e ? t.push(this._loadLibrary("draco_decoder.js", "text")) : (t.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), t.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(t).then((n) => {
|
|
8474
8515
|
const s = n[0];
|
|
8475
8516
|
e || (this.decoderConfig.wasmBinary = n[1]);
|
|
8476
|
-
const i =
|
|
8517
|
+
const i = yd.toString(), o = [
|
|
8477
8518
|
"/* draco decoder */",
|
|
8478
8519
|
s,
|
|
8479
8520
|
"",
|
|
@@ -8521,7 +8562,7 @@ class _d extends bi {
|
|
|
8521
8562
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
8522
8563
|
}
|
|
8523
8564
|
}
|
|
8524
|
-
function
|
|
8565
|
+
function yd() {
|
|
8525
8566
|
let r, e;
|
|
8526
8567
|
onmessage = function(o) {
|
|
8527
8568
|
const a = o.data;
|
|
@@ -8611,12 +8652,12 @@ function gd() {
|
|
|
8611
8652
|
}
|
|
8612
8653
|
}
|
|
8613
8654
|
}
|
|
8614
|
-
class
|
|
8655
|
+
class vd {
|
|
8615
8656
|
constructor(e) {
|
|
8616
8657
|
_(this, "gltf_loader");
|
|
8617
8658
|
e || (e = "/examples/jsm/libs/draco/gltf/");
|
|
8618
|
-
const t = new
|
|
8619
|
-
e && t.setDecoderPath(e), this.gltf_loader = new
|
|
8659
|
+
const t = new gd();
|
|
8660
|
+
e && t.setDecoderPath(e), this.gltf_loader = new Pl(), this.gltf_loader.setDRACOLoader(t);
|
|
8620
8661
|
}
|
|
8621
8662
|
/**
|
|
8622
8663
|
* Loads a GLTF/GLB and returns a THREE.Group
|
|
@@ -8631,7 +8672,7 @@ class yd {
|
|
|
8631
8672
|
void 0,
|
|
8632
8673
|
(s) => {
|
|
8633
8674
|
n(
|
|
8634
|
-
new ve(`Failed to load model from ${e}`, "ModelLoader",
|
|
8675
|
+
new ve(`Failed to load model from ${e}`, "ModelLoader", Ce.MODEL_LOAD_FAILED, {
|
|
8635
8676
|
url: e,
|
|
8636
8677
|
error: s
|
|
8637
8678
|
})
|
|
@@ -8641,7 +8682,7 @@ class yd {
|
|
|
8641
8682
|
});
|
|
8642
8683
|
}
|
|
8643
8684
|
}
|
|
8644
|
-
class
|
|
8685
|
+
class xd extends EventTarget {
|
|
8645
8686
|
constructor(t, n) {
|
|
8646
8687
|
super();
|
|
8647
8688
|
// private scene: THREE.Scene
|
|
@@ -8651,7 +8692,7 @@ class vd extends EventTarget {
|
|
|
8651
8692
|
_(this, "loader");
|
|
8652
8693
|
_(this, "viewer");
|
|
8653
8694
|
_(this, "settings");
|
|
8654
|
-
this.viewer = t, this.loader = new
|
|
8695
|
+
this.viewer = t, this.loader = new vd(), this.settings = n, this.settings.addEventListener("update", (s) => {
|
|
8655
8696
|
const i = s.detail;
|
|
8656
8697
|
i.models && this.update_models(i.models);
|
|
8657
8698
|
}), this.ready = this.init();
|
|
@@ -8691,7 +8732,7 @@ class vd extends EventTarget {
|
|
|
8691
8732
|
detail: { url: t.url }
|
|
8692
8733
|
})
|
|
8693
8734
|
);
|
|
8694
|
-
const n = new
|
|
8735
|
+
const n = new Nl(this.viewer, this.loader, t);
|
|
8695
8736
|
await n.load(), this.models.set(t.url, n), this.dispatchEvent(
|
|
8696
8737
|
new CustomEvent("loaded", {
|
|
8697
8738
|
detail: { url: t.url, model: n }
|
|
@@ -8761,7 +8802,7 @@ class Cu extends EventTarget {
|
|
|
8761
8802
|
_(this, "environment");
|
|
8762
8803
|
_(this, "sun");
|
|
8763
8804
|
_(this, "model_manager");
|
|
8764
|
-
this.settings =
|
|
8805
|
+
this.settings = oi.use(n), this.viewer = new Gc(t, this.settings), this.environment = new Yc(this.viewer, this.settings), this.model_manager = new xd(this.viewer, this.settings), this.sun = new yl(this.viewer, this.settings, this.environment, this.model_manager), this.settings.addEventListener("update", (s) => {
|
|
8765
8806
|
const i = s.detail;
|
|
8766
8807
|
this.environment.update(i.environment);
|
|
8767
8808
|
});
|
|
@@ -8773,7 +8814,7 @@ class Cu extends EventTarget {
|
|
|
8773
8814
|
const n = new ve(
|
|
8774
8815
|
`Failed to initialize Glimmer: ${t instanceof Error ? t.message : t}`,
|
|
8775
8816
|
"Glimmer",
|
|
8776
|
-
|
|
8817
|
+
Ce.INITIALIZATION_FAILED,
|
|
8777
8818
|
{ error: t }
|
|
8778
8819
|
);
|
|
8779
8820
|
throw this.dispatchEvent(
|
|
@@ -8788,7 +8829,7 @@ class Cu extends EventTarget {
|
|
|
8788
8829
|
(t = this.sun) == null || t.dispose(), (n = this.environment) == null || n.dispose(), (s = this.model_manager) == null || s.dispose(), (i = this.viewer) == null || i.dispose(), this.dispatchEvent(new CustomEvent("dispose", { detail: {} }));
|
|
8789
8830
|
}
|
|
8790
8831
|
}
|
|
8791
|
-
const
|
|
8832
|
+
const bd = E.object({
|
|
8792
8833
|
type: E.enum(["2d", "3d"]),
|
|
8793
8834
|
position: E.tuple([E.number(), E.number(), E.number()]),
|
|
8794
8835
|
// [x, y, z] in 3D world coordinates
|
|
@@ -8803,7 +8844,7 @@ const xd = E.object({
|
|
|
8803
8844
|
// Position in model's local space
|
|
8804
8845
|
}).optional()
|
|
8805
8846
|
// Optional anchor for 3D annotations
|
|
8806
|
-
}),
|
|
8847
|
+
}), wd = E.object({
|
|
8807
8848
|
min: E.object({
|
|
8808
8849
|
x: E.number(),
|
|
8809
8850
|
y: E.number(),
|
|
@@ -8814,50 +8855,50 @@ const xd = E.object({
|
|
|
8814
8855
|
y: E.number(),
|
|
8815
8856
|
z: E.number()
|
|
8816
8857
|
})
|
|
8817
|
-
}),
|
|
8858
|
+
}), ns = E.object({
|
|
8818
8859
|
id: E.string(),
|
|
8819
8860
|
title: E.string().optional(),
|
|
8820
8861
|
description: E.string().optional(),
|
|
8821
8862
|
// Glimmer settings to apply for this slide
|
|
8822
|
-
settings:
|
|
8863
|
+
settings: ts.partial(),
|
|
8823
8864
|
// Camera configuration
|
|
8824
8865
|
camera: E.object({
|
|
8825
8866
|
position: E.tuple([E.number(), E.number(), E.number()]),
|
|
8826
8867
|
target: E.tuple([E.number(), E.number(), E.number()])
|
|
8827
8868
|
}),
|
|
8828
8869
|
// Optional annotations
|
|
8829
|
-
annotations: E.array(
|
|
8870
|
+
annotations: E.array(bd).optional(),
|
|
8830
8871
|
// Optional section box
|
|
8831
|
-
section_box:
|
|
8872
|
+
section_box: wd.optional(),
|
|
8832
8873
|
section_box_enabled: E.boolean().optional().default(!1)
|
|
8833
|
-
}),
|
|
8874
|
+
}), Ed = E.object({
|
|
8834
8875
|
duration: E.number().default(1e3),
|
|
8835
8876
|
// milliseconds
|
|
8836
8877
|
easing: E.string().default("linear")
|
|
8837
8878
|
// 'linear' | 'ease-in-out' etc.
|
|
8838
|
-
}),
|
|
8879
|
+
}), $n = E.object({
|
|
8839
8880
|
version: E.string().default("1.0.0"),
|
|
8840
8881
|
title: E.string(),
|
|
8841
8882
|
description: E.string().optional(),
|
|
8842
|
-
slides: E.array(
|
|
8883
|
+
slides: E.array(ns).min(1, "Story must have at least one slide"),
|
|
8843
8884
|
// Optional: default transition settings (for future transitions)
|
|
8844
|
-
transition:
|
|
8885
|
+
transition: Ed.optional()
|
|
8845
8886
|
});
|
|
8846
8887
|
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
|
|
8847
8888
|
const {
|
|
8848
|
-
entries:
|
|
8849
|
-
setPrototypeOf:
|
|
8850
|
-
isFrozen:
|
|
8851
|
-
getPrototypeOf:
|
|
8852
|
-
getOwnPropertyDescriptor:
|
|
8889
|
+
entries: uo,
|
|
8890
|
+
setPrototypeOf: Ar,
|
|
8891
|
+
isFrozen: Ad,
|
|
8892
|
+
getPrototypeOf: Td,
|
|
8893
|
+
getOwnPropertyDescriptor: Sd
|
|
8853
8894
|
} = Object;
|
|
8854
8895
|
let {
|
|
8855
8896
|
freeze: Ae,
|
|
8856
8897
|
seal: ze,
|
|
8857
|
-
create:
|
|
8898
|
+
create: di
|
|
8858
8899
|
} = Object, {
|
|
8859
|
-
apply:
|
|
8860
|
-
construct:
|
|
8900
|
+
apply: ui,
|
|
8901
|
+
construct: hi
|
|
8861
8902
|
} = typeof Reflect < "u" && Reflect;
|
|
8862
8903
|
Ae || (Ae = function(e) {
|
|
8863
8904
|
return e;
|
|
@@ -8865,41 +8906,41 @@ Ae || (Ae = function(e) {
|
|
|
8865
8906
|
ze || (ze = function(e) {
|
|
8866
8907
|
return e;
|
|
8867
8908
|
});
|
|
8868
|
-
|
|
8909
|
+
ui || (ui = function(e, t) {
|
|
8869
8910
|
for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), i = 2; i < n; i++)
|
|
8870
8911
|
s[i - 2] = arguments[i];
|
|
8871
8912
|
return e.apply(t, s);
|
|
8872
8913
|
});
|
|
8873
|
-
|
|
8914
|
+
hi || (hi = function(e) {
|
|
8874
8915
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
8875
8916
|
n[s - 1] = arguments[s];
|
|
8876
8917
|
return new e(...n);
|
|
8877
8918
|
});
|
|
8878
|
-
const
|
|
8919
|
+
const Yn = Te(Array.prototype.forEach), Rd = Te(Array.prototype.lastIndexOf), Tr = Te(Array.prototype.pop), nn = Te(Array.prototype.push), Md = Te(Array.prototype.splice), ss = Te(String.prototype.toLowerCase), Vs = Te(String.prototype.toString), Gs = Te(String.prototype.match), sn = Te(String.prototype.replace), Ld = Te(String.prototype.indexOf), kd = Te(String.prototype.trim), Fe = Te(Object.prototype.hasOwnProperty), we = Te(RegExp.prototype.test), rn = Cd(TypeError);
|
|
8879
8920
|
function Te(r) {
|
|
8880
8921
|
return function(e) {
|
|
8881
8922
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
8882
8923
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
8883
8924
|
n[s - 1] = arguments[s];
|
|
8884
|
-
return
|
|
8925
|
+
return ui(r, e, n);
|
|
8885
8926
|
};
|
|
8886
8927
|
}
|
|
8887
8928
|
function Cd(r) {
|
|
8888
8929
|
return function() {
|
|
8889
8930
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
8890
8931
|
t[n] = arguments[n];
|
|
8891
|
-
return
|
|
8932
|
+
return hi(r, t);
|
|
8892
8933
|
};
|
|
8893
8934
|
}
|
|
8894
8935
|
function Y(r, e) {
|
|
8895
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
8896
|
-
|
|
8936
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ss;
|
|
8937
|
+
Ar && Ar(r, null);
|
|
8897
8938
|
let n = e.length;
|
|
8898
8939
|
for (; n--; ) {
|
|
8899
8940
|
let s = e[n];
|
|
8900
8941
|
if (typeof s == "string") {
|
|
8901
8942
|
const i = t(s);
|
|
8902
|
-
i !== s && (
|
|
8943
|
+
i !== s && (Ad(e) || (e[n] = i), s = i);
|
|
8903
8944
|
}
|
|
8904
8945
|
r[s] = !0;
|
|
8905
8946
|
}
|
|
@@ -8911,46 +8952,46 @@ function Od(r) {
|
|
|
8911
8952
|
return r;
|
|
8912
8953
|
}
|
|
8913
8954
|
function st(r) {
|
|
8914
|
-
const e =
|
|
8915
|
-
for (const [t, n] of
|
|
8955
|
+
const e = di(null);
|
|
8956
|
+
for (const [t, n] of uo(r))
|
|
8916
8957
|
Fe(r, t) && (Array.isArray(n) ? e[t] = Od(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = st(n) : e[t] = n);
|
|
8917
8958
|
return e;
|
|
8918
8959
|
}
|
|
8919
8960
|
function on(r, e) {
|
|
8920
8961
|
for (; r !== null; ) {
|
|
8921
|
-
const n =
|
|
8962
|
+
const n = Sd(r, e);
|
|
8922
8963
|
if (n) {
|
|
8923
8964
|
if (n.get)
|
|
8924
8965
|
return Te(n.get);
|
|
8925
8966
|
if (typeof n.value == "function")
|
|
8926
8967
|
return Te(n.value);
|
|
8927
8968
|
}
|
|
8928
|
-
r =
|
|
8969
|
+
r = Td(r);
|
|
8929
8970
|
}
|
|
8930
8971
|
function t() {
|
|
8931
8972
|
return null;
|
|
8932
8973
|
}
|
|
8933
8974
|
return t;
|
|
8934
8975
|
}
|
|
8935
|
-
const
|
|
8976
|
+
const Sr = Ae(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Zs = Ae(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ws = Ae(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Dd = Ae(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Xs = Ae(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Id = Ae(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Rr = Ae(["#text"]), Mr = Ae(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), $s = Ae(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Lr = Ae(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Kn = Ae(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Nd = ze(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Pd = ze(/<%[\w\W]*|[\w\W]*%>/gm), zd = ze(/\$\{[\w\W]*/gm), Ud = ze(/^data-[\-\w.\u00B7-\uFFFF]+$/), Fd = ze(/^aria-[\-\w]+$/), ho = ze(
|
|
8936
8977
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
8937
8978
|
// eslint-disable-line no-useless-escape
|
|
8938
|
-
),
|
|
8979
|
+
), jd = ze(/^(?:\w+script|data):/i), Bd = ze(
|
|
8939
8980
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
8940
8981
|
// eslint-disable-line no-control-regex
|
|
8941
|
-
),
|
|
8942
|
-
var
|
|
8982
|
+
), fo = ze(/^html$/i), Hd = ze(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
8983
|
+
var kr = /* @__PURE__ */ Object.freeze({
|
|
8943
8984
|
__proto__: null,
|
|
8944
|
-
ARIA_ATTR:
|
|
8945
|
-
ATTR_WHITESPACE:
|
|
8946
|
-
CUSTOM_ELEMENT:
|
|
8947
|
-
DATA_ATTR:
|
|
8948
|
-
DOCTYPE_NAME:
|
|
8949
|
-
ERB_EXPR:
|
|
8950
|
-
IS_ALLOWED_URI:
|
|
8951
|
-
IS_SCRIPT_OR_DATA:
|
|
8952
|
-
MUSTACHE_EXPR:
|
|
8953
|
-
TMPLIT_EXPR:
|
|
8985
|
+
ARIA_ATTR: Fd,
|
|
8986
|
+
ATTR_WHITESPACE: Bd,
|
|
8987
|
+
CUSTOM_ELEMENT: Hd,
|
|
8988
|
+
DATA_ATTR: Ud,
|
|
8989
|
+
DOCTYPE_NAME: fo,
|
|
8990
|
+
ERB_EXPR: Pd,
|
|
8991
|
+
IS_ALLOWED_URI: ho,
|
|
8992
|
+
IS_SCRIPT_OR_DATA: jd,
|
|
8993
|
+
MUSTACHE_EXPR: Nd,
|
|
8994
|
+
TMPLIT_EXPR: zd
|
|
8954
8995
|
});
|
|
8955
8996
|
const an = {
|
|
8956
8997
|
element: 1,
|
|
@@ -8959,9 +9000,9 @@ const an = {
|
|
|
8959
9000
|
progressingInstruction: 7,
|
|
8960
9001
|
comment: 8,
|
|
8961
9002
|
document: 9
|
|
8962
|
-
},
|
|
9003
|
+
}, Vd = function() {
|
|
8963
9004
|
return typeof window > "u" ? null : window;
|
|
8964
|
-
},
|
|
9005
|
+
}, Gd = function(e, t) {
|
|
8965
9006
|
if (typeof e != "object" || typeof e.createPolicy != "function")
|
|
8966
9007
|
return null;
|
|
8967
9008
|
let n = null;
|
|
@@ -8993,9 +9034,9 @@ const an = {
|
|
|
8993
9034
|
uponSanitizeShadowNode: []
|
|
8994
9035
|
};
|
|
8995
9036
|
};
|
|
8996
|
-
function
|
|
8997
|
-
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
8998
|
-
const e = (U) =>
|
|
9037
|
+
function mo() {
|
|
9038
|
+
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Vd();
|
|
9039
|
+
const e = (U) => mo(U);
|
|
8999
9040
|
if (e.version = "3.3.0", e.removed = [], !r || !r.document || r.document.nodeType !== an.document || !r.Element)
|
|
9000
9041
|
return e.isSupported = !1, e;
|
|
9001
9042
|
let {
|
|
@@ -9023,27 +9064,27 @@ function fo() {
|
|
|
9023
9064
|
createDocumentFragment: L,
|
|
9024
9065
|
getElementsByTagName: R
|
|
9025
9066
|
} = t, {
|
|
9026
|
-
importNode:
|
|
9067
|
+
importNode: C
|
|
9027
9068
|
} = n;
|
|
9028
9069
|
let N = Cr();
|
|
9029
|
-
e.isSupported = typeof
|
|
9070
|
+
e.isSupported = typeof uo == "function" && typeof T == "function" && V && V.createHTMLDocument !== void 0;
|
|
9030
9071
|
const {
|
|
9031
9072
|
MUSTACHE_EXPR: G,
|
|
9032
9073
|
ERB_EXPR: Z,
|
|
9033
|
-
TMPLIT_EXPR:
|
|
9074
|
+
TMPLIT_EXPR: O,
|
|
9034
9075
|
DATA_ATTR: ee,
|
|
9035
9076
|
ARIA_ATTR: $,
|
|
9036
9077
|
IS_SCRIPT_OR_DATA: be,
|
|
9037
9078
|
ATTR_WHITESPACE: le,
|
|
9038
9079
|
CUSTOM_ELEMENT: Ue
|
|
9039
|
-
} =
|
|
9080
|
+
} = kr;
|
|
9040
9081
|
let {
|
|
9041
9082
|
IS_ALLOWED_URI: Se
|
|
9042
|
-
} =
|
|
9043
|
-
const ue = Y({}, [...
|
|
9083
|
+
} = kr, ne = null;
|
|
9084
|
+
const ue = Y({}, [...Sr, ...Zs, ...Ws, ...Xs, ...Rr]);
|
|
9044
9085
|
let Q = null;
|
|
9045
|
-
const ut = Y({}, [...
|
|
9046
|
-
let z = Object.seal(
|
|
9086
|
+
const ut = Y({}, [...Mr, ...$s, ...Lr, ...Kn]);
|
|
9087
|
+
let z = Object.seal(di(null, {
|
|
9047
9088
|
tagNameCheck: {
|
|
9048
9089
|
writable: !0,
|
|
9049
9090
|
configurable: !1,
|
|
@@ -9062,8 +9103,8 @@ function fo() {
|
|
|
9062
9103
|
enumerable: !0,
|
|
9063
9104
|
value: !1
|
|
9064
9105
|
}
|
|
9065
|
-
})), Re = null,
|
|
9066
|
-
const Je = Object.seal(
|
|
9106
|
+
})), Re = null, kt = null;
|
|
9107
|
+
const Je = Object.seal(di(null, {
|
|
9067
9108
|
tagCheck: {
|
|
9068
9109
|
writable: !0,
|
|
9069
9110
|
configurable: !1,
|
|
@@ -9077,45 +9118,45 @@ function fo() {
|
|
|
9077
9118
|
value: null
|
|
9078
9119
|
}
|
|
9079
9120
|
}));
|
|
9080
|
-
let gs = !0, ys = !0,
|
|
9081
|
-
const
|
|
9121
|
+
let gs = !0, ys = !0, ki = !1, Ci = !0, Ct = !1, Pn = !0, vt = !1, vs = !1, xs = !1, Ot = !1, zn = !1, Un = !1, Oi = !0, Di = !1;
|
|
9122
|
+
const xo = "user-content-";
|
|
9082
9123
|
let bs = !0, Qt = !1, Dt = {}, It = null;
|
|
9083
|
-
const
|
|
9084
|
-
let
|
|
9085
|
-
const
|
|
9124
|
+
const Ii = Y({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
9125
|
+
let Ni = null;
|
|
9126
|
+
const Pi = Y({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
9086
9127
|
let ws = null;
|
|
9087
|
-
const
|
|
9128
|
+
const zi = Y({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Fn = "http://www.w3.org/1998/Math/MathML", jn = "http://www.w3.org/2000/svg", Qe = "http://www.w3.org/1999/xhtml";
|
|
9088
9129
|
let Nt = Qe, Es = !1, As = null;
|
|
9089
|
-
const
|
|
9090
|
-
let
|
|
9091
|
-
const
|
|
9130
|
+
const bo = Y({}, [Fn, jn, Qe], Vs);
|
|
9131
|
+
let Bn = Y({}, ["mi", "mo", "mn", "ms", "mtext"]), Hn = Y({}, ["annotation-xml"]);
|
|
9132
|
+
const wo = Y({}, ["title", "style", "font", "a", "script"]);
|
|
9092
9133
|
let en = null;
|
|
9093
|
-
const
|
|
9134
|
+
const Eo = ["application/xhtml+xml", "text/html"], Ao = "text/html";
|
|
9094
9135
|
let de = null, Pt = null;
|
|
9095
|
-
const
|
|
9136
|
+
const To = t.createElement("form"), Ui = function(m) {
|
|
9096
9137
|
return m instanceof RegExp || m instanceof Function;
|
|
9097
9138
|
}, Ts = function() {
|
|
9098
9139
|
let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
9099
9140
|
if (!(Pt && Pt === m)) {
|
|
9100
9141
|
if ((!m || typeof m != "object") && (m = {}), m = st(m), en = // eslint-disable-next-line unicorn/prefer-includes
|
|
9101
|
-
|
|
9142
|
+
Eo.indexOf(m.PARSER_MEDIA_TYPE) === -1 ? Ao : m.PARSER_MEDIA_TYPE, de = en === "application/xhtml+xml" ? Vs : ss, ne = Fe(m, "ALLOWED_TAGS") ? Y({}, m.ALLOWED_TAGS, de) : ue, Q = Fe(m, "ALLOWED_ATTR") ? Y({}, m.ALLOWED_ATTR, de) : ut, As = Fe(m, "ALLOWED_NAMESPACES") ? Y({}, m.ALLOWED_NAMESPACES, Vs) : bo, ws = Fe(m, "ADD_URI_SAFE_ATTR") ? Y(st(zi), m.ADD_URI_SAFE_ATTR, de) : zi, Ni = Fe(m, "ADD_DATA_URI_TAGS") ? Y(st(Pi), m.ADD_DATA_URI_TAGS, de) : Pi, It = Fe(m, "FORBID_CONTENTS") ? Y({}, m.FORBID_CONTENTS, de) : Ii, Re = Fe(m, "FORBID_TAGS") ? Y({}, m.FORBID_TAGS, de) : st({}), kt = Fe(m, "FORBID_ATTR") ? Y({}, m.FORBID_ATTR, de) : st({}), Dt = Fe(m, "USE_PROFILES") ? m.USE_PROFILES : !1, gs = m.ALLOW_ARIA_ATTR !== !1, ys = m.ALLOW_DATA_ATTR !== !1, ki = m.ALLOW_UNKNOWN_PROTOCOLS || !1, Ci = m.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ct = m.SAFE_FOR_TEMPLATES || !1, Pn = m.SAFE_FOR_XML !== !1, vt = m.WHOLE_DOCUMENT || !1, Ot = m.RETURN_DOM || !1, zn = m.RETURN_DOM_FRAGMENT || !1, Un = m.RETURN_TRUSTED_TYPE || !1, xs = m.FORCE_BODY || !1, Oi = m.SANITIZE_DOM !== !1, Di = m.SANITIZE_NAMED_PROPS || !1, bs = m.KEEP_CONTENT !== !1, Qt = m.IN_PLACE || !1, Se = m.ALLOWED_URI_REGEXP || ho, Nt = m.NAMESPACE || Qe, Bn = m.MATHML_TEXT_INTEGRATION_POINTS || Bn, Hn = m.HTML_INTEGRATION_POINTS || Hn, z = m.CUSTOM_ELEMENT_HANDLING || {}, m.CUSTOM_ELEMENT_HANDLING && Ui(m.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (z.tagNameCheck = m.CUSTOM_ELEMENT_HANDLING.tagNameCheck), m.CUSTOM_ELEMENT_HANDLING && Ui(m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (z.attributeNameCheck = m.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), m.CUSTOM_ELEMENT_HANDLING && typeof m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = m.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ct && (ys = !1), zn && (Ot = !0), Dt && (ne = Y({}, Rr), Q = [], Dt.html === !0 && (Y(ne, Sr), Y(Q, Mr)), Dt.svg === !0 && (Y(ne, Zs), Y(Q, $s), Y(Q, Kn)), Dt.svgFilters === !0 && (Y(ne, Ws), Y(Q, $s), Y(Q, Kn)), Dt.mathMl === !0 && (Y(ne, Xs), Y(Q, Lr), Y(Q, Kn))), m.ADD_TAGS && (typeof m.ADD_TAGS == "function" ? Je.tagCheck = m.ADD_TAGS : (ne === ue && (ne = st(ne)), Y(ne, m.ADD_TAGS, de))), m.ADD_ATTR && (typeof m.ADD_ATTR == "function" ? Je.attributeCheck = m.ADD_ATTR : (Q === ut && (Q = st(Q)), Y(Q, m.ADD_ATTR, de))), m.ADD_URI_SAFE_ATTR && Y(ws, m.ADD_URI_SAFE_ATTR, de), m.FORBID_CONTENTS && (It === Ii && (It = st(It)), Y(It, m.FORBID_CONTENTS, de)), bs && (ne["#text"] = !0), vt && Y(ne, ["html", "head", "body"]), ne.table && (Y(ne, ["tbody"]), delete Re.tbody), m.TRUSTED_TYPES_POLICY) {
|
|
9102
9143
|
if (typeof m.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
9103
9144
|
throw rn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
9104
9145
|
if (typeof m.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
9105
9146
|
throw rn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
9106
9147
|
v = m.TRUSTED_TYPES_POLICY, P = v.createHTML("");
|
|
9107
9148
|
} else
|
|
9108
|
-
v === void 0 && (v =
|
|
9149
|
+
v === void 0 && (v = Gd(f, s)), v !== null && typeof P == "string" && (P = v.createHTML(""));
|
|
9109
9150
|
Ae && Ae(m), Pt = m;
|
|
9110
9151
|
}
|
|
9111
|
-
},
|
|
9152
|
+
}, Fi = Y({}, [...Zs, ...Ws, ...Dd]), ji = Y({}, [...Xs, ...Id]), So = function(m) {
|
|
9112
9153
|
let S = T(m);
|
|
9113
9154
|
(!S || !S.tagName) && (S = {
|
|
9114
9155
|
namespaceURI: Nt,
|
|
9115
9156
|
tagName: "template"
|
|
9116
9157
|
});
|
|
9117
|
-
const D =
|
|
9118
|
-
return As[m.namespaceURI] ? m.namespaceURI ===
|
|
9158
|
+
const D = ss(m.tagName), se = ss(S.tagName);
|
|
9159
|
+
return As[m.namespaceURI] ? m.namespaceURI === jn ? S.namespaceURI === Qe ? D === "svg" : S.namespaceURI === Fn ? D === "svg" && (se === "annotation-xml" || Bn[se]) : !!Fi[D] : m.namespaceURI === Fn ? S.namespaceURI === Qe ? D === "math" : S.namespaceURI === jn ? D === "math" && Hn[se] : !!ji[D] : m.namespaceURI === Qe ? S.namespaceURI === jn && !Hn[se] || S.namespaceURI === Fn && !Bn[se] ? !1 : !ji[D] && (wo[D] || !Fi[D]) : !!(en === "application/xhtml+xml" && As[m.namespaceURI]) : !1;
|
|
9119
9160
|
}, Ve = function(m) {
|
|
9120
9161
|
nn(e.removed, {
|
|
9121
9162
|
element: m
|
|
@@ -9138,7 +9179,7 @@ function fo() {
|
|
|
9138
9179
|
});
|
|
9139
9180
|
}
|
|
9140
9181
|
if (S.removeAttribute(m), m === "is")
|
|
9141
|
-
if (
|
|
9182
|
+
if (Ot || zn)
|
|
9142
9183
|
try {
|
|
9143
9184
|
Ve(S);
|
|
9144
9185
|
} catch {
|
|
@@ -9148,12 +9189,12 @@ function fo() {
|
|
|
9148
9189
|
S.setAttribute(m, "");
|
|
9149
9190
|
} catch {
|
|
9150
9191
|
}
|
|
9151
|
-
},
|
|
9192
|
+
}, Bi = function(m) {
|
|
9152
9193
|
let S = null, D = null;
|
|
9153
9194
|
if (xs)
|
|
9154
9195
|
m = "<remove></remove>" + m;
|
|
9155
9196
|
else {
|
|
9156
|
-
const oe =
|
|
9197
|
+
const oe = Gs(m, /^[\r\n\t ]+/);
|
|
9157
9198
|
D = oe && oe[0];
|
|
9158
9199
|
}
|
|
9159
9200
|
en === "application/xhtml+xml" && Nt === Qe && (m = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + m + "</body></html>");
|
|
@@ -9172,7 +9213,7 @@ function fo() {
|
|
|
9172
9213
|
}
|
|
9173
9214
|
const ge = S.body || S.documentElement;
|
|
9174
9215
|
return m && D && ge.insertBefore(t.createTextNode(D), ge.childNodes[0] || null), Nt === Qe ? R.call(S, vt ? "html" : "body")[0] : vt ? S.documentElement : ge;
|
|
9175
|
-
},
|
|
9216
|
+
}, Hi = function(m) {
|
|
9176
9217
|
return F.call(
|
|
9177
9218
|
m.ownerDocument || m,
|
|
9178
9219
|
m,
|
|
@@ -9182,15 +9223,15 @@ function fo() {
|
|
|
9182
9223
|
);
|
|
9183
9224
|
}, Ss = function(m) {
|
|
9184
9225
|
return m instanceof u && (typeof m.nodeName != "string" || typeof m.textContent != "string" || typeof m.removeChild != "function" || !(m.attributes instanceof d) || typeof m.removeAttribute != "function" || typeof m.setAttribute != "function" || typeof m.namespaceURI != "string" || typeof m.insertBefore != "function" || typeof m.hasChildNodes != "function");
|
|
9185
|
-
},
|
|
9226
|
+
}, Vi = function(m) {
|
|
9186
9227
|
return typeof a == "function" && m instanceof a;
|
|
9187
9228
|
};
|
|
9188
9229
|
function et(U, m, S) {
|
|
9189
|
-
|
|
9230
|
+
Yn(U, (D) => {
|
|
9190
9231
|
D.call(e, m, S, Pt);
|
|
9191
9232
|
});
|
|
9192
9233
|
}
|
|
9193
|
-
const
|
|
9234
|
+
const Gi = function(m) {
|
|
9194
9235
|
let S = null;
|
|
9195
9236
|
if (et(N.beforeSanitizeElements, m, null), Ss(m))
|
|
9196
9237
|
return Ve(m), !0;
|
|
@@ -9198,10 +9239,10 @@ function fo() {
|
|
|
9198
9239
|
if (et(N.uponSanitizeElement, m, {
|
|
9199
9240
|
tagName: D,
|
|
9200
9241
|
allowedTags: ne
|
|
9201
|
-
}),
|
|
9242
|
+
}), Pn && m.hasChildNodes() && !Vi(m.firstElementChild) && we(/<[/\w!]/g, m.innerHTML) && we(/<[/\w!]/g, m.textContent) || m.nodeType === an.progressingInstruction || Pn && m.nodeType === an.comment && we(/<[/\w]/g, m.data))
|
|
9202
9243
|
return Ve(m), !0;
|
|
9203
9244
|
if (!(Je.tagCheck instanceof Function && Je.tagCheck(D)) && (!ne[D] || Re[D])) {
|
|
9204
|
-
if (!Re[D] &&
|
|
9245
|
+
if (!Re[D] && Wi(D) && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, D) || z.tagNameCheck instanceof Function && z.tagNameCheck(D)))
|
|
9205
9246
|
return !1;
|
|
9206
9247
|
if (bs && !It[D]) {
|
|
9207
9248
|
const se = T(m) || m.parentNode, ge = w(m) || m.childNodes;
|
|
@@ -9215,30 +9256,30 @@ function fo() {
|
|
|
9215
9256
|
}
|
|
9216
9257
|
return Ve(m), !0;
|
|
9217
9258
|
}
|
|
9218
|
-
return m instanceof c && !
|
|
9259
|
+
return m instanceof c && !So(m) || (D === "noscript" || D === "noembed" || D === "noframes") && we(/<\/no(script|embed|frames)/i, m.innerHTML) ? (Ve(m), !0) : (Ct && m.nodeType === an.text && (S = m.textContent, Yn([G, Z, O], (se) => {
|
|
9219
9260
|
S = sn(S, se, " ");
|
|
9220
9261
|
}), m.textContent !== S && (nn(e.removed, {
|
|
9221
9262
|
element: m.cloneNode()
|
|
9222
9263
|
}), m.textContent = S)), et(N.afterSanitizeElements, m, null), !1);
|
|
9223
|
-
},
|
|
9224
|
-
if (Oi && (S === "id" || S === "name") && (D in t || D in
|
|
9264
|
+
}, Zi = function(m, S, D) {
|
|
9265
|
+
if (Oi && (S === "id" || S === "name") && (D in t || D in To))
|
|
9225
9266
|
return !1;
|
|
9226
|
-
if (!(ys && !
|
|
9267
|
+
if (!(ys && !kt[S] && we(ee, S))) {
|
|
9227
9268
|
if (!(gs && we($, S))) {
|
|
9228
9269
|
if (!(Je.attributeCheck instanceof Function && Je.attributeCheck(S, m))) {
|
|
9229
|
-
if (!Q[S] ||
|
|
9270
|
+
if (!Q[S] || kt[S]) {
|
|
9230
9271
|
if (
|
|
9231
9272
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
9232
9273
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
9233
9274
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
9234
|
-
!(
|
|
9275
|
+
!(Wi(m) && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, m) || z.tagNameCheck instanceof Function && z.tagNameCheck(m)) && (z.attributeNameCheck instanceof RegExp && we(z.attributeNameCheck, S) || z.attributeNameCheck instanceof Function && z.attributeNameCheck(S, m)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
9235
9276
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
9236
9277
|
S === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, D) || z.tagNameCheck instanceof Function && z.tagNameCheck(D)))
|
|
9237
9278
|
) return !1;
|
|
9238
9279
|
} else if (!ws[S]) {
|
|
9239
9280
|
if (!we(Se, sn(D, le, ""))) {
|
|
9240
|
-
if (!((S === "src" || S === "xlink:href" || S === "href") && m !== "script" &&
|
|
9241
|
-
if (!(
|
|
9281
|
+
if (!((S === "src" || S === "xlink:href" || S === "href") && m !== "script" && Ld(D, "data:") === 0 && Ni[m])) {
|
|
9282
|
+
if (!(ki && !we(be, sn(D, le, "")))) {
|
|
9242
9283
|
if (D)
|
|
9243
9284
|
return !1;
|
|
9244
9285
|
}
|
|
@@ -9249,9 +9290,9 @@ function fo() {
|
|
|
9249
9290
|
}
|
|
9250
9291
|
}
|
|
9251
9292
|
return !0;
|
|
9252
|
-
}, Zi = function(m) {
|
|
9253
|
-
return m !== "annotation-xml" && Vs(m, Ue);
|
|
9254
9293
|
}, Wi = function(m) {
|
|
9294
|
+
return m !== "annotation-xml" && Gs(m, Ue);
|
|
9295
|
+
}, Xi = function(m) {
|
|
9255
9296
|
et(N.beforeSanitizeAttributes, m, null);
|
|
9256
9297
|
const {
|
|
9257
9298
|
attributes: S
|
|
@@ -9272,12 +9313,12 @@ function fo() {
|
|
|
9272
9313
|
namespaceURI: Me,
|
|
9273
9314
|
value: tt
|
|
9274
9315
|
} = ge, zt = de(oe), Rs = tt;
|
|
9275
|
-
let he = oe === "value" ? Rs :
|
|
9276
|
-
if (D.attrName = zt, D.attrValue = he, D.keepAttr = !0, D.forceKeepAttr = void 0, et(N.uponSanitizeAttribute, m, D), he = D.attrValue,
|
|
9316
|
+
let he = oe === "value" ? Rs : kd(Rs);
|
|
9317
|
+
if (D.attrName = zt, D.attrValue = he, D.keepAttr = !0, D.forceKeepAttr = void 0, et(N.uponSanitizeAttribute, m, D), he = D.attrValue, Di && (zt === "id" || zt === "name") && (xt(oe, m), he = xo + he), Pn && we(/((--!?|])>)|<\/(style|title|textarea)/i, he)) {
|
|
9277
9318
|
xt(oe, m);
|
|
9278
9319
|
continue;
|
|
9279
9320
|
}
|
|
9280
|
-
if (zt === "attributename" &&
|
|
9321
|
+
if (zt === "attributename" && Gs(he, "href")) {
|
|
9281
9322
|
xt(oe, m);
|
|
9282
9323
|
continue;
|
|
9283
9324
|
}
|
|
@@ -9291,16 +9332,16 @@ function fo() {
|
|
|
9291
9332
|
xt(oe, m);
|
|
9292
9333
|
continue;
|
|
9293
9334
|
}
|
|
9294
|
-
|
|
9295
|
-
he = sn(he,
|
|
9335
|
+
Ct && Yn([G, Z, O], (Yi) => {
|
|
9336
|
+
he = sn(he, Yi, " ");
|
|
9296
9337
|
});
|
|
9297
|
-
const
|
|
9298
|
-
if (!
|
|
9338
|
+
const $i = de(m.nodeName);
|
|
9339
|
+
if (!Zi($i, zt, he)) {
|
|
9299
9340
|
xt(oe, m);
|
|
9300
9341
|
continue;
|
|
9301
9342
|
}
|
|
9302
9343
|
if (v && typeof f == "object" && typeof f.getAttributeType == "function" && !Me)
|
|
9303
|
-
switch (f.getAttributeType(
|
|
9344
|
+
switch (f.getAttributeType($i, zt)) {
|
|
9304
9345
|
case "TrustedHTML": {
|
|
9305
9346
|
he = v.createHTML(he);
|
|
9306
9347
|
break;
|
|
@@ -9312,22 +9353,22 @@ function fo() {
|
|
|
9312
9353
|
}
|
|
9313
9354
|
if (he !== Rs)
|
|
9314
9355
|
try {
|
|
9315
|
-
Me ? m.setAttributeNS(Me, oe, he) : m.setAttribute(oe, he), Ss(m) ? Ve(m) :
|
|
9356
|
+
Me ? m.setAttributeNS(Me, oe, he) : m.setAttribute(oe, he), Ss(m) ? Ve(m) : Tr(e.removed);
|
|
9316
9357
|
} catch {
|
|
9317
9358
|
xt(oe, m);
|
|
9318
9359
|
}
|
|
9319
9360
|
}
|
|
9320
9361
|
et(N.afterSanitizeAttributes, m, null);
|
|
9321
|
-
},
|
|
9362
|
+
}, Ro = function U(m) {
|
|
9322
9363
|
let S = null;
|
|
9323
|
-
const D =
|
|
9364
|
+
const D = Hi(m);
|
|
9324
9365
|
for (et(N.beforeSanitizeShadowDOM, m, null); S = D.nextNode(); )
|
|
9325
|
-
et(N.uponSanitizeShadowNode, S, null),
|
|
9366
|
+
et(N.uponSanitizeShadowNode, S, null), Gi(S), Xi(S), S.content instanceof i && U(S.content);
|
|
9326
9367
|
et(N.afterSanitizeShadowDOM, m, null);
|
|
9327
9368
|
};
|
|
9328
9369
|
return e.sanitize = function(U) {
|
|
9329
9370
|
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, S = null, D = null, se = null, ge = null;
|
|
9330
|
-
if (Es = !U, Es && (U = "<!-->"), typeof U != "string" && !
|
|
9371
|
+
if (Es = !U, Es && (U = "<!-->"), typeof U != "string" && !Vi(U))
|
|
9331
9372
|
if (typeof U.toString == "function") {
|
|
9332
9373
|
if (U = U.toString(), typeof U != "string")
|
|
9333
9374
|
throw rn("dirty is not a string, aborting");
|
|
@@ -9342,33 +9383,33 @@ function fo() {
|
|
|
9342
9383
|
throw rn("root node is forbidden and cannot be sanitized in-place");
|
|
9343
9384
|
}
|
|
9344
9385
|
} else if (U instanceof a)
|
|
9345
|
-
S =
|
|
9386
|
+
S = Bi("<!---->"), D = S.ownerDocument.importNode(U, !0), D.nodeType === an.element && D.nodeName === "BODY" || D.nodeName === "HTML" ? S = D : S.appendChild(D);
|
|
9346
9387
|
else {
|
|
9347
|
-
if (!
|
|
9388
|
+
if (!Ot && !Ct && !vt && // eslint-disable-next-line unicorn/prefer-includes
|
|
9348
9389
|
U.indexOf("<") === -1)
|
|
9349
|
-
return v &&
|
|
9350
|
-
if (S =
|
|
9351
|
-
return
|
|
9390
|
+
return v && Un ? v.createHTML(U) : U;
|
|
9391
|
+
if (S = Bi(U), !S)
|
|
9392
|
+
return Ot ? null : Un ? P : "";
|
|
9352
9393
|
}
|
|
9353
9394
|
S && xs && Ve(S.firstChild);
|
|
9354
|
-
const oe =
|
|
9395
|
+
const oe = Hi(Qt ? U : S);
|
|
9355
9396
|
for (; se = oe.nextNode(); )
|
|
9356
|
-
|
|
9397
|
+
Gi(se), Xi(se), se.content instanceof i && Ro(se.content);
|
|
9357
9398
|
if (Qt)
|
|
9358
9399
|
return U;
|
|
9359
|
-
if (
|
|
9360
|
-
if (
|
|
9400
|
+
if (Ot) {
|
|
9401
|
+
if (zn)
|
|
9361
9402
|
for (ge = L.call(S.ownerDocument); S.firstChild; )
|
|
9362
9403
|
ge.appendChild(S.firstChild);
|
|
9363
9404
|
else
|
|
9364
9405
|
ge = S;
|
|
9365
|
-
return (Q.shadowroot || Q.shadowrootmode) && (ge =
|
|
9406
|
+
return (Q.shadowroot || Q.shadowrootmode) && (ge = C.call(n, ge, !0)), ge;
|
|
9366
9407
|
}
|
|
9367
9408
|
let Me = vt ? S.outerHTML : S.innerHTML;
|
|
9368
|
-
return vt && ne["!doctype"] && S.ownerDocument && S.ownerDocument.doctype && S.ownerDocument.doctype.name && we(
|
|
9369
|
-
` + Me),
|
|
9409
|
+
return vt && ne["!doctype"] && S.ownerDocument && S.ownerDocument.doctype && S.ownerDocument.doctype.name && we(fo, S.ownerDocument.doctype.name) && (Me = "<!DOCTYPE " + S.ownerDocument.doctype.name + `>
|
|
9410
|
+
` + Me), Ct && Yn([G, Z, O], (tt) => {
|
|
9370
9411
|
Me = sn(Me, tt, " ");
|
|
9371
|
-
}), v &&
|
|
9412
|
+
}), v && Un ? v.createHTML(Me) : Me;
|
|
9372
9413
|
}, e.setConfig = function() {
|
|
9373
9414
|
let U = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
9374
9415
|
Ts(U), vs = !0;
|
|
@@ -9377,23 +9418,23 @@ function fo() {
|
|
|
9377
9418
|
}, e.isValidAttribute = function(U, m, S) {
|
|
9378
9419
|
Pt || Ts({});
|
|
9379
9420
|
const D = de(U), se = de(m);
|
|
9380
|
-
return
|
|
9421
|
+
return Zi(D, se, S);
|
|
9381
9422
|
}, e.addHook = function(U, m) {
|
|
9382
9423
|
typeof m == "function" && nn(N[U], m);
|
|
9383
9424
|
}, e.removeHook = function(U, m) {
|
|
9384
9425
|
if (m !== void 0) {
|
|
9385
|
-
const S =
|
|
9386
|
-
return S === -1 ? void 0 :
|
|
9426
|
+
const S = Rd(N[U], m);
|
|
9427
|
+
return S === -1 ? void 0 : Md(N[U], S, 1)[0];
|
|
9387
9428
|
}
|
|
9388
|
-
return
|
|
9429
|
+
return Tr(N[U]);
|
|
9389
9430
|
}, e.removeHooks = function(U) {
|
|
9390
9431
|
N[U] = [];
|
|
9391
9432
|
}, e.removeAllHooks = function() {
|
|
9392
9433
|
N = Cr();
|
|
9393
9434
|
}, e;
|
|
9394
9435
|
}
|
|
9395
|
-
var
|
|
9396
|
-
class
|
|
9436
|
+
var Zd = mo();
|
|
9437
|
+
class Wd {
|
|
9397
9438
|
constructor(e) {
|
|
9398
9439
|
_(this, "container");
|
|
9399
9440
|
_(this, "elements", []);
|
|
@@ -9405,7 +9446,7 @@ class Zd {
|
|
|
9405
9446
|
*/
|
|
9406
9447
|
render(e) {
|
|
9407
9448
|
const t = document.createElement("div");
|
|
9408
|
-
t.className = "glimmer-annotation-2d", t.innerHTML =
|
|
9449
|
+
t.className = "glimmer-annotation-2d", t.innerHTML = Zd.sanitize(e.content), t.style.position = "absolute", t.style.pointerEvents = "auto", t.style.left = `${e.position[0]}%`, t.style.top = `${e.position[1]}%`, t.style.transform = "translate(-50%, -50%)", e.style && Object.assign(t.style, e.style), this.container.appendChild(t), this.elements.push(t);
|
|
9409
9450
|
}
|
|
9410
9451
|
/**
|
|
9411
9452
|
* Clear all rendered 2D annotations
|
|
@@ -9420,7 +9461,7 @@ class Zd {
|
|
|
9420
9461
|
this.clear();
|
|
9421
9462
|
}
|
|
9422
9463
|
}
|
|
9423
|
-
class
|
|
9464
|
+
class Xd {
|
|
9424
9465
|
constructor(e) {
|
|
9425
9466
|
_(this, "group");
|
|
9426
9467
|
_(this, "sprites", []);
|
|
@@ -9463,7 +9504,7 @@ class Wd {
|
|
|
9463
9504
|
return this.group;
|
|
9464
9505
|
}
|
|
9465
9506
|
}
|
|
9466
|
-
class
|
|
9507
|
+
class $d {
|
|
9467
9508
|
constructor() {
|
|
9468
9509
|
_(this, "triggers", /* @__PURE__ */ new Map());
|
|
9469
9510
|
_(this, "handlers", /* @__PURE__ */ new Map());
|
|
@@ -9532,7 +9573,7 @@ class Xd {
|
|
|
9532
9573
|
typeof e == "string" ? window.removeEventListener(e, t) : e.removeEventListener("click", t);
|
|
9533
9574
|
}
|
|
9534
9575
|
}
|
|
9535
|
-
class
|
|
9576
|
+
class Yd extends EventTarget {
|
|
9536
9577
|
constructor(t, n) {
|
|
9537
9578
|
super();
|
|
9538
9579
|
_(this, "camera");
|
|
@@ -9563,7 +9604,7 @@ class $d extends EventTarget {
|
|
|
9563
9604
|
);
|
|
9564
9605
|
}
|
|
9565
9606
|
}
|
|
9566
|
-
class
|
|
9607
|
+
class Kd {
|
|
9567
9608
|
constructor(e, t) {
|
|
9568
9609
|
_(this, "mesh");
|
|
9569
9610
|
_(this, "axis");
|
|
@@ -9634,7 +9675,7 @@ class Yd {
|
|
|
9634
9675
|
this.mesh.geometry.dispose(), this.mesh.material.dispose();
|
|
9635
9676
|
}
|
|
9636
9677
|
}
|
|
9637
|
-
class
|
|
9678
|
+
class qd extends EventTarget {
|
|
9638
9679
|
constructor(t) {
|
|
9639
9680
|
super();
|
|
9640
9681
|
_(this, "bounds");
|
|
@@ -9688,7 +9729,7 @@ class Kd extends EventTarget {
|
|
|
9688
9729
|
["z", "min"],
|
|
9689
9730
|
["z", "max"]
|
|
9690
9731
|
].forEach(([a, c]) => {
|
|
9691
|
-
const l = new
|
|
9732
|
+
const l = new Kd(a, c);
|
|
9692
9733
|
l.update_from_bounds(this.bounds), this.plane_handles.push(l), t.add(l.mesh);
|
|
9693
9734
|
}), this.setup_interactions(n, s);
|
|
9694
9735
|
}
|
|
@@ -9802,7 +9843,7 @@ class Kd extends EventTarget {
|
|
|
9802
9843
|
}), this.event_listeners = []);
|
|
9803
9844
|
}
|
|
9804
9845
|
}
|
|
9805
|
-
const Or = 8,
|
|
9846
|
+
const Or = 8, Jd = `
|
|
9806
9847
|
attribute vec3 aN0;
|
|
9807
9848
|
attribute vec3 aN1;
|
|
9808
9849
|
attribute vec4 aOtherVert;
|
|
@@ -9856,7 +9897,7 @@ void main() {
|
|
|
9856
9897
|
|
|
9857
9898
|
gl_Position.z = -2000.;
|
|
9858
9899
|
}
|
|
9859
|
-
`,
|
|
9900
|
+
`, Qd = `
|
|
9860
9901
|
uniform vec3 uColor;
|
|
9861
9902
|
uniform int uClipPlaneCount;
|
|
9862
9903
|
uniform vec4 uClipPlanes[8];
|
|
@@ -9871,11 +9912,11 @@ void main() {
|
|
|
9871
9912
|
gl_FragColor = vec4(uColor, 1.);
|
|
9872
9913
|
}
|
|
9873
9914
|
`;
|
|
9874
|
-
class
|
|
9915
|
+
class fi extends Ei {
|
|
9875
9916
|
constructor(e = 0, t = !0, n = "#000000") {
|
|
9876
9917
|
super({
|
|
9877
|
-
vertexShader:
|
|
9878
|
-
fragmentShader:
|
|
9918
|
+
vertexShader: Jd,
|
|
9919
|
+
fragmentShader: Qd,
|
|
9879
9920
|
uniforms: {
|
|
9880
9921
|
uAngleThresh: { value: 0 },
|
|
9881
9922
|
uOutline: { value: Number(t) },
|
|
@@ -9911,10 +9952,10 @@ class hi extends wi {
|
|
|
9911
9952
|
}
|
|
9912
9953
|
}
|
|
9913
9954
|
}
|
|
9914
|
-
const
|
|
9915
|
-
class
|
|
9916
|
-
constructor(e, t = new
|
|
9917
|
-
super(new
|
|
9955
|
+
const Ys = 1e3;
|
|
9956
|
+
class eu extends Zr {
|
|
9957
|
+
constructor(e, t = new fi()) {
|
|
9958
|
+
super(new Si(), t), this.extract_geometry(e.geometry);
|
|
9918
9959
|
}
|
|
9919
9960
|
extract_geometry(e) {
|
|
9920
9961
|
const { v_array: t, n0_array: n, n1_array: s, other_vert_array: i } = e.index ? this.extract_indexed(e) : this.extract_soup(), o = this.geometry;
|
|
@@ -9938,9 +9979,9 @@ class Qd extends Gr {
|
|
|
9938
9979
|
const n = {}, s = {}, i = [], o = [];
|
|
9939
9980
|
for (let a = 0, c = 0; a < t.count; a++) {
|
|
9940
9981
|
const l = a * 3, d = [
|
|
9941
|
-
Math.round(t.array[l] *
|
|
9942
|
-
Math.round(t.array[l + 1] *
|
|
9943
|
-
Math.round(t.array[l + 2] *
|
|
9982
|
+
Math.round(t.array[l] * Ys),
|
|
9983
|
+
Math.round(t.array[l + 1] * Ys),
|
|
9984
|
+
Math.round(t.array[l + 2] * Ys)
|
|
9944
9985
|
].join(":");
|
|
9945
9986
|
n[d] === void 0 && (n[d] = c++, i.push(
|
|
9946
9987
|
t.array[l],
|
|
@@ -9982,16 +10023,16 @@ class Qd extends Gr {
|
|
|
9982
10023
|
return { v_array: [], n0_array: [], n1_array: [], other_vert_array: [] };
|
|
9983
10024
|
}
|
|
9984
10025
|
}
|
|
9985
|
-
const
|
|
9986
|
-
let
|
|
9987
|
-
function
|
|
10026
|
+
const kn = /* @__PURE__ */ new Set();
|
|
10027
|
+
let mi = !1;
|
|
10028
|
+
function tu(r, e, t = 2) {
|
|
9988
10029
|
const n = e && e.length, s = n ? e[0] * t : r.length;
|
|
9989
|
-
|
|
9990
|
-
let i =
|
|
10030
|
+
kn.size && kn.clear();
|
|
10031
|
+
let i = po(r, 0, s, t, !0);
|
|
9991
10032
|
const o = [];
|
|
9992
10033
|
if (!i || i.next === i.prev) return o;
|
|
9993
10034
|
let a = 0, c = 0, l = 0;
|
|
9994
|
-
if (n && (i =
|
|
10035
|
+
if (n && (i = ou(r, e, i, t)), r.length > 80 * t) {
|
|
9995
10036
|
a = r[0], c = r[1];
|
|
9996
10037
|
let d = a, u = c;
|
|
9997
10038
|
for (let h = t; h < s; h += t) {
|
|
@@ -10000,86 +10041,86 @@ function eu(r, e, t = 2) {
|
|
|
10000
10041
|
}
|
|
10001
10042
|
l = Math.max(d - a, u - c), l = l !== 0 ? 32767 / l : 0;
|
|
10002
10043
|
}
|
|
10003
|
-
return
|
|
10044
|
+
return pi(i, o, a, c, l), o;
|
|
10004
10045
|
}
|
|
10005
|
-
function
|
|
10046
|
+
function po(r, e, t, n, s) {
|
|
10006
10047
|
let i = null;
|
|
10007
|
-
if (s ===
|
|
10008
|
-
for (let o = e; o < t; o += n) i =
|
|
10048
|
+
if (s === vu(r, e, t, n) > 0)
|
|
10049
|
+
for (let o = e; o < t; o += n) i = Nr(o / n | 0, r[o], r[o + 1], i);
|
|
10009
10050
|
else
|
|
10010
|
-
for (let o = t - n; o >= e; o -= n) i =
|
|
10011
|
-
return i && Cn(i, i.next) && (
|
|
10051
|
+
for (let o = t - n; o >= e; o -= n) i = Nr(o / n | 0, r[o], r[o + 1], i);
|
|
10052
|
+
return i && Cn(i, i.next) && (Dn(i), i = i.next), i;
|
|
10012
10053
|
}
|
|
10013
10054
|
function Lt(r, e = r) {
|
|
10014
10055
|
const t = e === r;
|
|
10015
10056
|
let n = r, s;
|
|
10016
10057
|
do
|
|
10017
|
-
s = !1, n !== n.next && (
|
|
10058
|
+
s = !1, n !== n.next && (kn.size === 0 || !kn.has(n)) && (Cn(n, n.next) || ae(n.prev, n, n.next) === 0) ? ((t || n === e) && (e = n.prev), mi = !0, Dn(n), n = n.prev, s = !0) : (t || n !== e) && (n = n.next, s = !t);
|
|
10018
10059
|
while (s || n !== e);
|
|
10019
10060
|
return e;
|
|
10020
10061
|
}
|
|
10021
|
-
function
|
|
10022
|
-
s &&
|
|
10062
|
+
function pi(r, e, t, n, s) {
|
|
10063
|
+
s && fu(r, t, n, s);
|
|
10023
10064
|
let i = r, o = !1;
|
|
10024
10065
|
for (; r.prev !== r.next; ) {
|
|
10025
10066
|
const a = r.prev, c = r.next;
|
|
10026
|
-
if (ae(a, r, c) < 0 && (s ?
|
|
10027
|
-
e.push(a.i, r.i, c.i),
|
|
10067
|
+
if (ae(a, r, c) < 0 && (s ? su(r, t, n, s) : nu(r))) {
|
|
10068
|
+
e.push(a.i, r.i, c.i), Dn(r), r = c, i = c;
|
|
10028
10069
|
continue;
|
|
10029
10070
|
}
|
|
10030
10071
|
if (r = c, r === i) {
|
|
10031
|
-
if (
|
|
10072
|
+
if (mi = !1, r = Lt(r), mi) {
|
|
10032
10073
|
i = r;
|
|
10033
10074
|
continue;
|
|
10034
10075
|
}
|
|
10035
10076
|
if (!o) {
|
|
10036
|
-
r =
|
|
10077
|
+
r = iu(r, e), i = r, o = !0;
|
|
10037
10078
|
continue;
|
|
10038
10079
|
}
|
|
10039
|
-
|
|
10080
|
+
ru(r, e, t, n, s);
|
|
10040
10081
|
break;
|
|
10041
10082
|
}
|
|
10042
10083
|
}
|
|
10043
10084
|
}
|
|
10044
|
-
function
|
|
10085
|
+
function nu(r) {
|
|
10045
10086
|
const e = r.prev, t = r, n = r.next, s = e.x, i = t.x, o = n.x, a = e.y, c = t.y, l = n.y, d = Math.min(s, i, o), u = Math.min(a, c, l), h = Math.max(s, i, o), f = Math.max(a, c, l);
|
|
10046
10087
|
let g = n.next;
|
|
10047
10088
|
for (; g !== e; ) {
|
|
10048
|
-
if (g.x >= d && g.x <= h && g.y >= u && g.y <= f && !(s === g.x && a === g.y) &&
|
|
10089
|
+
if (g.x >= d && g.x <= h && g.y >= u && g.y <= f && !(s === g.x && a === g.y) && ms(s, a, i, c, o, l, g.x, g.y) && ae(g.prev, g, g.next) >= 0) return !1;
|
|
10049
10090
|
g = g.next;
|
|
10050
10091
|
}
|
|
10051
10092
|
return !0;
|
|
10052
10093
|
}
|
|
10053
|
-
function
|
|
10054
|
-
const s = r.prev, i = r, o = r.next, a = s.x, c = i.x, l = o.x, d = s.y, u = i.y, h = o.y, f = Math.min(a, c, l), g = Math.min(d, u, h), y = Math.max(a, c, l), x = Math.max(d, u, h), b =
|
|
10094
|
+
function su(r, e, t, n) {
|
|
10095
|
+
const s = r.prev, i = r, o = r.next, a = s.x, c = i.x, l = o.x, d = s.y, u = i.y, h = o.y, f = Math.min(a, c, l), g = Math.min(d, u, h), y = Math.max(a, c, l), x = Math.max(d, u, h), b = vi(f, g, e, t, n), w = vi(y, x, e, t, n);
|
|
10055
10096
|
let T = r.prevZ;
|
|
10056
10097
|
for (; T && T.z >= b; ) {
|
|
10057
|
-
if (T.x >= f && T.x <= y && T.y >= g && T.y <= x && T !== o && !(a === T.x && d === T.y) &&
|
|
10098
|
+
if (T.x >= f && T.x <= y && T.y >= g && T.y <= x && T !== o && !(a === T.x && d === T.y) && ms(a, d, c, u, l, h, T.x, T.y) && ae(T.prev, T, T.next) >= 0) return !1;
|
|
10058
10099
|
T = T.prevZ;
|
|
10059
10100
|
}
|
|
10060
10101
|
let v = r.nextZ;
|
|
10061
10102
|
for (; v && v.z <= w; ) {
|
|
10062
|
-
if (v.x >= f && v.x <= y && v.y >= g && v.y <= x && v !== o && !(a === v.x && d === v.y) &&
|
|
10103
|
+
if (v.x >= f && v.x <= y && v.y >= g && v.y <= x && v !== o && !(a === v.x && d === v.y) && ms(a, d, c, u, l, h, v.x, v.y) && ae(v.prev, v, v.next) >= 0) return !1;
|
|
10063
10104
|
v = v.nextZ;
|
|
10064
10105
|
}
|
|
10065
10106
|
return !0;
|
|
10066
10107
|
}
|
|
10067
|
-
function
|
|
10108
|
+
function iu(r, e) {
|
|
10068
10109
|
let t = r, n = !1;
|
|
10069
10110
|
do {
|
|
10070
10111
|
const s = t.prev, i = t.next.next;
|
|
10071
|
-
|
|
10112
|
+
yo(s, t, t.next, i, !1) && On(s, i) && On(i, s) && (e.push(s.i, t.i, i.i), Dn(t), Dn(t.next), t = r = i, n = !0), t = t.next;
|
|
10072
10113
|
} while (t !== r);
|
|
10073
10114
|
return n ? Lt(t) : t;
|
|
10074
10115
|
}
|
|
10075
|
-
function
|
|
10116
|
+
function ru(r, e, t, n, s) {
|
|
10076
10117
|
let i = r;
|
|
10077
10118
|
do {
|
|
10078
10119
|
let o = i.next.next;
|
|
10079
10120
|
for (; o !== i.prev; ) {
|
|
10080
|
-
if (i.i !== o.i &&
|
|
10081
|
-
let a =
|
|
10082
|
-
i = Lt(i, i.next), a = Lt(a, a.next),
|
|
10121
|
+
if (i.i !== o.i && _u(i, o)) {
|
|
10122
|
+
let a = vo(i, o);
|
|
10123
|
+
i = Lt(i, i.next), a = Lt(a, a.next), pi(i, e, t, n, s), pi(a, e, t, n, s);
|
|
10083
10124
|
return;
|
|
10084
10125
|
}
|
|
10085
10126
|
o = o.next;
|
|
@@ -10087,76 +10128,76 @@ function iu(r, e, t, n, s) {
|
|
|
10087
10128
|
i = i.next;
|
|
10088
10129
|
} while (i !== r);
|
|
10089
10130
|
}
|
|
10090
|
-
let
|
|
10091
|
-
function
|
|
10131
|
+
let _i = !1;
|
|
10132
|
+
function ou(r, e, t, n) {
|
|
10092
10133
|
const s = [];
|
|
10093
10134
|
for (let i = 0, o = e.length; i < o; i++) {
|
|
10094
10135
|
const a = e[i] * n, c = i < o - 1 ? e[i + 1] * n : r.length, l = (
|
|
10095
10136
|
/** @type {Node} */
|
|
10096
|
-
|
|
10137
|
+
po(r, a, c, n, !1)
|
|
10097
10138
|
);
|
|
10098
|
-
l === l.next &&
|
|
10139
|
+
l === l.next && kn.add(l), s.push(pu(l));
|
|
10099
10140
|
}
|
|
10100
|
-
s.sort(
|
|
10141
|
+
s.sort(au), lu(r.length / n, e.length), go(t, t), _i = !0;
|
|
10101
10142
|
for (let i = 0; i < s.length; i++)
|
|
10102
|
-
t =
|
|
10103
|
-
return
|
|
10143
|
+
t = cu(s[i], t);
|
|
10144
|
+
return _i = !1, Lt(t);
|
|
10104
10145
|
}
|
|
10105
|
-
function
|
|
10146
|
+
function au(r, e) {
|
|
10106
10147
|
return r.x - e.x || r.y - e.y || (r.next.y - r.y) / (r.next.x - r.x) - (e.next.y - e.y) / (e.next.x - e.x);
|
|
10107
10148
|
}
|
|
10108
|
-
function
|
|
10109
|
-
const t =
|
|
10149
|
+
function cu(r, e) {
|
|
10150
|
+
const t = uu(r, e);
|
|
10110
10151
|
if (!t)
|
|
10111
10152
|
return e;
|
|
10112
|
-
const n =
|
|
10113
|
-
return
|
|
10153
|
+
const n = vo(t, r), s = n.next;
|
|
10154
|
+
return go(t, s.next), Lt(n, n.next), Lt(t, t.next);
|
|
10114
10155
|
}
|
|
10115
|
-
const
|
|
10116
|
-
let re = new Float64Array(0),
|
|
10117
|
-
const
|
|
10118
|
-
function
|
|
10119
|
-
const t = Math.ceil((r + 2 * e) /
|
|
10120
|
-
re.length < t * 4 && (re = new Float64Array(t * 4)),
|
|
10156
|
+
const _o = 16;
|
|
10157
|
+
let re = new Float64Array(0), fs = 0;
|
|
10158
|
+
const gi = [], yi = [];
|
|
10159
|
+
function lu(r, e) {
|
|
10160
|
+
const t = Math.ceil((r + 2 * e) / _o) + e + 2;
|
|
10161
|
+
re.length < t * 4 && (re = new Float64Array(t * 4)), fs = 0;
|
|
10121
10162
|
}
|
|
10122
|
-
function
|
|
10163
|
+
function go(r, e) {
|
|
10123
10164
|
let t = r;
|
|
10124
10165
|
do {
|
|
10125
|
-
const n =
|
|
10126
|
-
|
|
10166
|
+
const n = fs++;
|
|
10167
|
+
gi[n] = t;
|
|
10127
10168
|
let s = t.x, i = t.y, o = t.x, a = t.y, c = 0;
|
|
10128
10169
|
do {
|
|
10129
10170
|
const d = t.next;
|
|
10130
10171
|
t.z = n, d.x < s && (s = d.x), d.x > o && (o = d.x), d.y < i && (i = d.y), d.y > a && (a = d.y), t = d;
|
|
10131
|
-
} while (++c <
|
|
10132
|
-
|
|
10172
|
+
} while (++c < _o && t !== e);
|
|
10173
|
+
yi[n] = t;
|
|
10133
10174
|
const l = n * 4;
|
|
10134
10175
|
re[l] = s, re[l + 1] = i, re[l + 2] = o, re[l + 3] = a;
|
|
10135
10176
|
} while (t !== e);
|
|
10136
10177
|
}
|
|
10137
|
-
function
|
|
10178
|
+
function du(r, e) {
|
|
10138
10179
|
const t = r.z * 4;
|
|
10139
10180
|
e.x < re[t] && (re[t] = e.x), e.y < re[t + 1] && (re[t + 1] = e.y), e.x > re[t + 2] && (re[t + 2] = e.x), e.y > re[t + 3] && (re[t + 3] = e.y);
|
|
10140
10181
|
}
|
|
10141
|
-
function
|
|
10142
|
-
let e =
|
|
10182
|
+
function Dr(r) {
|
|
10183
|
+
let e = yi[r];
|
|
10143
10184
|
for (; e.prev.next !== e; ) e = e.next;
|
|
10144
|
-
return
|
|
10185
|
+
return yi[r] = e, e;
|
|
10145
10186
|
}
|
|
10146
|
-
function
|
|
10147
|
-
let e =
|
|
10187
|
+
function Ir(r) {
|
|
10188
|
+
let e = gi[r];
|
|
10148
10189
|
for (; e.prev.next !== e; ) e = e.next;
|
|
10149
|
-
return
|
|
10190
|
+
return gi[r] = e, e;
|
|
10150
10191
|
}
|
|
10151
|
-
function
|
|
10192
|
+
function uu(r, e) {
|
|
10152
10193
|
let t = e;
|
|
10153
10194
|
const n = r.x, s = r.y;
|
|
10154
10195
|
let i = -1 / 0, o;
|
|
10155
10196
|
if (Cn(r, t)) return t;
|
|
10156
|
-
for (let h = 0, f = 0; h <
|
|
10197
|
+
for (let h = 0, f = 0; h < fs; h++, f += 4) {
|
|
10157
10198
|
if (s < re[f + 1] || s > re[f + 3] || re[f] > n || re[f + 2] <= i) continue;
|
|
10158
|
-
const g =
|
|
10159
|
-
t =
|
|
10199
|
+
const g = Dr(h);
|
|
10200
|
+
t = Ir(h);
|
|
10160
10201
|
do {
|
|
10161
10202
|
if (t.prev.next === t) {
|
|
10162
10203
|
if (Cn(r, t.next)) return t.next;
|
|
@@ -10172,39 +10213,39 @@ function du(r, e) {
|
|
|
10172
10213
|
if (!o) return null;
|
|
10173
10214
|
const a = o.x, c = o.y, l = Math.min(s, c), d = Math.max(s, c);
|
|
10174
10215
|
let u = 1 / 0;
|
|
10175
|
-
for (let h = 0, f = 0; h <
|
|
10216
|
+
for (let h = 0, f = 0; h < fs; h++, f += 4) {
|
|
10176
10217
|
if (re[f + 2] < a || re[f] > n || re[f + 3] < l || re[f + 1] > d) continue;
|
|
10177
|
-
const g =
|
|
10178
|
-
t =
|
|
10218
|
+
const g = Dr(h);
|
|
10219
|
+
t = Ir(h);
|
|
10179
10220
|
do {
|
|
10180
10221
|
if (t.prev.next === t && n >= t.x && t.x >= a && n !== t.x && // skip dead nodes
|
|
10181
|
-
|
|
10222
|
+
ms(s < c ? n : i, s, a, c, s < c ? i : n, s, t.x, t.y)) {
|
|
10182
10223
|
const y = Math.abs(s - t.y) / (n - t.x);
|
|
10183
|
-
(On(t, r) || t.y === s && t.next.y === s && t.next.x > n) && (y < u || y === u && (t.x > o.x || t.x === o.x &&
|
|
10224
|
+
(On(t, r) || t.y === s && t.next.y === s && t.next.x > n) && (y < u || y === u && (t.x > o.x || t.x === o.x && hu(o, t))) && (o = t, u = y);
|
|
10184
10225
|
}
|
|
10185
10226
|
t = t.next;
|
|
10186
10227
|
} while (t !== g);
|
|
10187
10228
|
}
|
|
10188
10229
|
return o;
|
|
10189
10230
|
}
|
|
10190
|
-
function
|
|
10231
|
+
function hu(r, e) {
|
|
10191
10232
|
return ae(r.prev, r, e.prev) < 0 && ae(e.next, r, r.next) < 0;
|
|
10192
10233
|
}
|
|
10193
|
-
const
|
|
10234
|
+
const Oe = [];
|
|
10194
10235
|
let jt = [], wt = new Uint32Array(0), cn = new Uint32Array(0);
|
|
10195
10236
|
const ln = new Uint32Array(256);
|
|
10196
|
-
function
|
|
10237
|
+
function fu(r, e, t, n) {
|
|
10197
10238
|
let s = r, i = 0;
|
|
10198
10239
|
do
|
|
10199
|
-
s.z =
|
|
10240
|
+
s.z = vi(s.x, s.y, e, t, n), Oe[i++] = s, s = s.next;
|
|
10200
10241
|
while (s !== r);
|
|
10201
|
-
|
|
10242
|
+
mu(i);
|
|
10202
10243
|
let o = null;
|
|
10203
10244
|
for (let a = 0; a < i; a++) {
|
|
10204
|
-
const c =
|
|
10245
|
+
const c = Oe[a];
|
|
10205
10246
|
c.prevZ = o, o && (o.nextZ = c), o = c;
|
|
10206
10247
|
}
|
|
10207
|
-
o.nextZ = null,
|
|
10248
|
+
o.nextZ = null, Oe.fill(
|
|
10208
10249
|
/** @type {Node} */
|
|
10209
10250
|
/** @type {unknown} */
|
|
10210
10251
|
null,
|
|
@@ -10218,22 +10259,22 @@ function hu(r, e, t, n) {
|
|
|
10218
10259
|
i
|
|
10219
10260
|
);
|
|
10220
10261
|
}
|
|
10221
|
-
function
|
|
10262
|
+
function mu(r) {
|
|
10222
10263
|
if (r <= 32) {
|
|
10223
10264
|
for (let e = 1; e < r; e++) {
|
|
10224
|
-
const t =
|
|
10265
|
+
const t = Oe[e], n = t.z;
|
|
10225
10266
|
let s = e - 1;
|
|
10226
|
-
for (; s >= 0 &&
|
|
10227
|
-
|
|
10228
|
-
|
|
10267
|
+
for (; s >= 0 && Oe[s].z > n; )
|
|
10268
|
+
Oe[s + 1] = Oe[s], s--;
|
|
10269
|
+
Oe[s + 1] = t;
|
|
10229
10270
|
}
|
|
10230
10271
|
return;
|
|
10231
10272
|
}
|
|
10232
10273
|
wt.length < r && (wt = new Uint32Array(r), cn = new Uint32Array(r), jt = new Array(r));
|
|
10233
|
-
for (let e = 0; e < r; e++) wt[e] =
|
|
10234
|
-
|
|
10274
|
+
for (let e = 0; e < r; e++) wt[e] = Oe[e].z;
|
|
10275
|
+
qn(r, Oe, wt, jt, cn, 0), qn(r, jt, cn, Oe, wt, 8), qn(r, Oe, wt, jt, cn, 16), qn(r, jt, cn, Oe, wt, 24);
|
|
10235
10276
|
}
|
|
10236
|
-
function
|
|
10277
|
+
function qn(r, e, t, n, s, i) {
|
|
10237
10278
|
ln.fill(0);
|
|
10238
10279
|
for (let a = 0; a < r; a++) ln[t[a] >>> i & 255]++;
|
|
10239
10280
|
let o = 0;
|
|
@@ -10246,24 +10287,24 @@ function Kn(r, e, t, n, s, i) {
|
|
|
10246
10287
|
n[l] = e[a], s[l] = c;
|
|
10247
10288
|
}
|
|
10248
10289
|
}
|
|
10249
|
-
function
|
|
10290
|
+
function vi(r, e, t, n, s) {
|
|
10250
10291
|
return r = (r - t) * s | 0, e = (e - n) * s | 0, r = (r | r << 8) & 16711935, r = (r | r << 4) & 252645135, r = (r | r << 2) & 858993459, r = (r | r << 1) & 1431655765, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, r | e << 1;
|
|
10251
10292
|
}
|
|
10252
|
-
function
|
|
10293
|
+
function pu(r) {
|
|
10253
10294
|
let e = r, t = r;
|
|
10254
10295
|
do
|
|
10255
10296
|
(e.x < t.x || e.x === t.x && e.y < t.y) && (t = e), e = e.next;
|
|
10256
10297
|
while (e !== r);
|
|
10257
10298
|
return t;
|
|
10258
10299
|
}
|
|
10259
|
-
function
|
|
10300
|
+
function ms(r, e, t, n, s, i, o, a) {
|
|
10260
10301
|
return (s - o) * (e - a) >= (r - o) * (i - a) && (r - o) * (n - a) >= (t - o) * (e - a) && (t - o) * (i - a) >= (s - o) * (n - a);
|
|
10261
10302
|
}
|
|
10262
|
-
function
|
|
10303
|
+
function _u(r, e) {
|
|
10263
10304
|
const t = Cn(r, e) && ae(r.prev, r, r.next) > 0 && ae(e.prev, e, e.next) > 0;
|
|
10264
10305
|
return r.next.i !== e.i && (t || On(r, e) && On(e, r) && // // locally visible
|
|
10265
10306
|
(ae(r.prev, r, e.prev) !== 0 || ae(r, e.prev, e) !== 0)) && // no opposite-facing sectors
|
|
10266
|
-
!
|
|
10307
|
+
!gu(r, e) && (t || yu(r, e));
|
|
10267
10308
|
}
|
|
10268
10309
|
function ae(r, e, t) {
|
|
10269
10310
|
return (e.y - r.y) * (t.x - e.x) - (e.x - r.x) * (t.y - e.y);
|
|
@@ -10271,14 +10312,14 @@ function ae(r, e, t) {
|
|
|
10271
10312
|
function Cn(r, e) {
|
|
10272
10313
|
return r.x === e.x && r.y === e.y;
|
|
10273
10314
|
}
|
|
10274
|
-
function
|
|
10315
|
+
function yo(r, e, t, n, s = !0) {
|
|
10275
10316
|
const i = ae(r, e, t), o = ae(r, e, n), a = ae(t, n, r), c = ae(t, n, e);
|
|
10276
|
-
return (i > 0 && o < 0 || i < 0 && o > 0) && (a > 0 && c < 0 || a < 0 && c > 0) ? !0 : s ? !!(i === 0 &&
|
|
10317
|
+
return (i > 0 && o < 0 || i < 0 && o > 0) && (a > 0 && c < 0 || a < 0 && c > 0) ? !0 : s ? !!(i === 0 && Jn(r, t, e) || o === 0 && Jn(r, n, e) || a === 0 && Jn(t, r, n) || c === 0 && Jn(t, e, n)) : !1;
|
|
10277
10318
|
}
|
|
10278
|
-
function
|
|
10319
|
+
function Jn(r, e, t) {
|
|
10279
10320
|
return e.x <= Math.max(r.x, t.x) && e.x >= Math.min(r.x, t.x) && e.y <= Math.max(r.y, t.y) && e.y >= Math.min(r.y, t.y);
|
|
10280
10321
|
}
|
|
10281
|
-
function
|
|
10322
|
+
function gu(r, e) {
|
|
10282
10323
|
const t = Math.min(r.x, e.x), n = Math.max(r.x, e.x), s = Math.min(r.y, e.y), i = Math.max(r.y, e.y);
|
|
10283
10324
|
let o = r;
|
|
10284
10325
|
do {
|
|
@@ -10287,7 +10328,7 @@ function _u(r, e) {
|
|
|
10287
10328
|
o = a;
|
|
10288
10329
|
continue;
|
|
10289
10330
|
}
|
|
10290
|
-
if (o.i !== r.i && a.i !== r.i && o.i !== e.i && a.i !== e.i &&
|
|
10331
|
+
if (o.i !== r.i && a.i !== r.i && o.i !== e.i && a.i !== e.i && yo(o, a, r, e)) return !0;
|
|
10291
10332
|
o = a;
|
|
10292
10333
|
} while (o !== r);
|
|
10293
10334
|
return !1;
|
|
@@ -10295,7 +10336,7 @@ function _u(r, e) {
|
|
|
10295
10336
|
function On(r, e) {
|
|
10296
10337
|
return ae(r.prev, r, r.next) < 0 ? ae(r, e, r.next) >= 0 && ae(r, r.prev, e) >= 0 : ae(r, e, r.prev) < 0 || ae(r, r.next, e) < 0;
|
|
10297
10338
|
}
|
|
10298
|
-
function
|
|
10339
|
+
function yu(r, e) {
|
|
10299
10340
|
let t = r, n = !1;
|
|
10300
10341
|
const s = (r.x + e.x) / 2, i = (r.y + e.y) / 2;
|
|
10301
10342
|
do {
|
|
@@ -10304,18 +10345,18 @@ function gu(r, e) {
|
|
|
10304
10345
|
} while (t !== r);
|
|
10305
10346
|
return n;
|
|
10306
10347
|
}
|
|
10307
|
-
function
|
|
10308
|
-
const t =
|
|
10348
|
+
function vo(r, e) {
|
|
10349
|
+
const t = xi(r.i, r.x, r.y), n = xi(e.i, e.x, e.y), s = r.next, i = e.prev;
|
|
10309
10350
|
return r.next = e, e.prev = r, t.next = s, s.prev = t, n.next = t, t.prev = n, i.next = n, n.prev = i, n;
|
|
10310
10351
|
}
|
|
10311
|
-
function
|
|
10312
|
-
const s =
|
|
10352
|
+
function Nr(r, e, t, n) {
|
|
10353
|
+
const s = xi(r, e, t);
|
|
10313
10354
|
return n ? (s.next = n.next, s.prev = n, n.next.prev = s, n.next = s) : (s.prev = s, s.next = s), s;
|
|
10314
10355
|
}
|
|
10315
|
-
function
|
|
10316
|
-
r.next.prev = r.prev, r.prev.next = r.next, r.prevZ && (r.prevZ.nextZ = r.nextZ), r.nextZ && (r.nextZ.prevZ = r.prevZ),
|
|
10356
|
+
function Dn(r) {
|
|
10357
|
+
r.next.prev = r.prev, r.prev.next = r.next, r.prevZ && (r.prevZ.nextZ = r.nextZ), r.nextZ && (r.nextZ.prevZ = r.prevZ), _i && du(r.prev, r.next);
|
|
10317
10358
|
}
|
|
10318
|
-
function
|
|
10359
|
+
function xi(r, e, t) {
|
|
10319
10360
|
return (
|
|
10320
10361
|
/** @type {Node} */
|
|
10321
10362
|
/** @type {unknown} */
|
|
@@ -10336,13 +10377,13 @@ function vi(r, e, t) {
|
|
|
10336
10377
|
}
|
|
10337
10378
|
);
|
|
10338
10379
|
}
|
|
10339
|
-
function
|
|
10380
|
+
function vu(r, e, t, n) {
|
|
10340
10381
|
let s = 0;
|
|
10341
10382
|
for (let i = e, o = t - n; i < t; i += n)
|
|
10342
10383
|
s += (r[o] - r[i]) * (r[i + 1] + r[o + 1]), o = i;
|
|
10343
10384
|
return s;
|
|
10344
10385
|
}
|
|
10345
|
-
function
|
|
10386
|
+
function xu(r, e) {
|
|
10346
10387
|
const t = [], n = (i) => {
|
|
10347
10388
|
for (let o = 0; o < t.length; o++)
|
|
10348
10389
|
if (t[o].distanceTo(i) <= e) return o;
|
|
@@ -10354,7 +10395,7 @@ function vu(r, e) {
|
|
|
10354
10395
|
}
|
|
10355
10396
|
return { segments: s, points: t };
|
|
10356
10397
|
}
|
|
10357
|
-
function
|
|
10398
|
+
function Ks(r) {
|
|
10358
10399
|
let e = 0;
|
|
10359
10400
|
for (let t = 0; t < r.length; t++) {
|
|
10360
10401
|
const n = (t + 1) % r.length;
|
|
@@ -10362,7 +10403,7 @@ function Ys(r) {
|
|
|
10362
10403
|
}
|
|
10363
10404
|
return e / 2;
|
|
10364
10405
|
}
|
|
10365
|
-
function
|
|
10406
|
+
function bu(r, e, t = 1e-9) {
|
|
10366
10407
|
let n = !1;
|
|
10367
10408
|
const s = r.x, i = r.y;
|
|
10368
10409
|
for (let o = 0, a = e.length - 1; o < e.length; a = o++) {
|
|
@@ -10373,13 +10414,13 @@ function xu(r, e, t = 1e-9) {
|
|
|
10373
10414
|
}
|
|
10374
10415
|
return n;
|
|
10375
10416
|
}
|
|
10376
|
-
function
|
|
10417
|
+
function wu(r, e) {
|
|
10377
10418
|
const t = r.reduce((s, i) => s + i.x, 0) / r.length, n = r.reduce((s, i) => s + i.y, 0) / r.length;
|
|
10378
|
-
return
|
|
10419
|
+
return bu(new p.Vector2(t, n), e);
|
|
10379
10420
|
}
|
|
10380
|
-
function
|
|
10421
|
+
function Eu(r, e) {
|
|
10381
10422
|
if (r.length < 3) return [];
|
|
10382
|
-
const { points: t, segments: n } =
|
|
10423
|
+
const { points: t, segments: n } = xu(r, e);
|
|
10383
10424
|
if (n.length < 3) return [];
|
|
10384
10425
|
const s = Array.from({ length: t.length }, () => []), i = (l, d) => l < d ? `${l},${d}` : `${d},${l}`, o = /* @__PURE__ */ new Set();
|
|
10385
10426
|
for (const [l, d] of n) {
|
|
@@ -10423,7 +10464,7 @@ function wu(r, e) {
|
|
|
10423
10464
|
}
|
|
10424
10465
|
return c.map((l) => l.map((d) => t[d]));
|
|
10425
10466
|
}
|
|
10426
|
-
function
|
|
10467
|
+
function Au(r, e, t, n) {
|
|
10427
10468
|
let s = r.distanceToPoint(e), i = r.distanceToPoint(t), o = r.distanceToPoint(n);
|
|
10428
10469
|
const a = 1e-10;
|
|
10429
10470
|
if (Math.abs(s) < a && (s = 0), Math.abs(i) < a && (i = 0), Math.abs(o) < a && (o = 0), s >= 0 == i >= 0 && s >= 0 == o >= 0) return null;
|
|
@@ -10447,7 +10488,7 @@ function Eu(r, e, t, n) {
|
|
|
10447
10488
|
d.every((h) => h.distanceTo(u) >= a) && d.push(u);
|
|
10448
10489
|
return d.length >= 2 ? [d[0], d[1]] : null;
|
|
10449
10490
|
}
|
|
10450
|
-
function
|
|
10491
|
+
function Tu(r) {
|
|
10451
10492
|
r.traverse((e) => {
|
|
10452
10493
|
var t;
|
|
10453
10494
|
if (e.isMesh || e.isLine) {
|
|
@@ -10462,52 +10503,52 @@ function Au(r) {
|
|
|
10462
10503
|
}
|
|
10463
10504
|
});
|
|
10464
10505
|
}
|
|
10465
|
-
function
|
|
10506
|
+
function Su(r, e, t) {
|
|
10466
10507
|
const n = (t == null ? void 0 : t.epsilon) ?? 1e-3, s = (t == null ? void 0 : t.color) ?? 16737792, i = (t == null ? void 0 : t.side) ?? p.DoubleSide, o = (t == null ? void 0 : t.polygon_offset) ?? !0, a = (t == null ? void 0 : t.polygon_offset_factor) ?? -1, c = (t == null ? void 0 : t.polygon_offset_units) ?? -1, l = [];
|
|
10467
10508
|
r.traverse((R) => {
|
|
10468
|
-
const
|
|
10469
|
-
if (!
|
|
10470
|
-
const N =
|
|
10471
|
-
for (let
|
|
10472
|
-
const ee = new p.Vector3(N.getX(G.getX(
|
|
10473
|
-
N.getX(G.getX(
|
|
10474
|
-
N.getY(G.getX(
|
|
10475
|
-
N.getZ(G.getX(
|
|
10509
|
+
const C = R;
|
|
10510
|
+
if (!C.isMesh || !C.visible || !C.geometry.index || !C.geometry.attributes.position) return;
|
|
10511
|
+
const N = C.geometry.attributes.position, G = C.geometry.index, Z = C.matrixWorld;
|
|
10512
|
+
for (let O = 0; O < G.count; O += 3) {
|
|
10513
|
+
const ee = new p.Vector3(N.getX(G.getX(O)), N.getY(G.getX(O)), N.getZ(G.getX(O))).applyMatrix4(Z), $ = new p.Vector3(
|
|
10514
|
+
N.getX(G.getX(O + 1)),
|
|
10515
|
+
N.getY(G.getX(O + 1)),
|
|
10516
|
+
N.getZ(G.getX(O + 1))
|
|
10476
10517
|
).applyMatrix4(Z), be = new p.Vector3(
|
|
10477
|
-
N.getX(G.getX(
|
|
10478
|
-
N.getY(G.getX(
|
|
10479
|
-
N.getZ(G.getX(
|
|
10480
|
-
).applyMatrix4(Z), le =
|
|
10518
|
+
N.getX(G.getX(O + 2)),
|
|
10519
|
+
N.getY(G.getX(O + 2)),
|
|
10520
|
+
N.getZ(G.getX(O + 2))
|
|
10521
|
+
).applyMatrix4(Z), le = Au(e, ee, $, be);
|
|
10481
10522
|
le && l.push(le);
|
|
10482
10523
|
}
|
|
10483
10524
|
});
|
|
10484
|
-
const d =
|
|
10525
|
+
const d = Eu(l, n);
|
|
10485
10526
|
if (d.length === 0) return null;
|
|
10486
|
-
const u = new p.Vector3(0, 1, 0), h = new p.Vector3(1, 0, 0), f = new p.Vector3().crossVectors(e.normal, Math.abs(e.normal.dot(u)) < 0.9 ? u : h).normalize(), g = new p.Vector3().crossVectors(e.normal, f).normalize(), y = (R) => R.map((
|
|
10527
|
+
const u = new p.Vector3(0, 1, 0), h = new p.Vector3(1, 0, 0), f = new p.Vector3().crossVectors(e.normal, Math.abs(e.normal.dot(u)) < 0.9 ? u : h).normalize(), g = new p.Vector3().crossVectors(e.normal, f).normalize(), y = (R) => R.map((C) => new p.Vector2(C.dot(f), C.dot(g))), x = d.map(y), b = x.map((R, C) => ({ i: C, area: Math.abs(Ks(R)) })).sort((R, C) => C.area - R.area).map((R) => R.i), w = b.map((R) => d[R]), T = b.map((R) => x[R]), v = (t == null ? void 0 : t.plane_offset) ?? 1e-4, P = e.normal.clone().multiplyScalar(v), V = [], F = new Array(w.length).fill(!1);
|
|
10487
10528
|
for (let R = 0; R < w.length; R++) {
|
|
10488
10529
|
if (F[R]) continue;
|
|
10489
|
-
const
|
|
10530
|
+
const C = w[R], N = T[R], G = [], Z = [];
|
|
10490
10531
|
for (let z = R + 1; z < w.length; z++)
|
|
10491
|
-
!F[z] &&
|
|
10492
|
-
F[R] = !0,
|
|
10532
|
+
!F[z] && wu(T[z], N) && (G.push(w[z]), Z.push(T[z]), F[z] = !0);
|
|
10533
|
+
F[R] = !0, Ks(N) < 0 && (N.reverse(), C.reverse());
|
|
10493
10534
|
for (let z = 0; z < Z.length; z++)
|
|
10494
|
-
|
|
10495
|
-
const
|
|
10496
|
-
for (const z of
|
|
10535
|
+
Ks(Z[z]) > 0 && (Z[z].reverse(), G[z].reverse());
|
|
10536
|
+
const O = [...N, ...Z.flat()], ee = [];
|
|
10537
|
+
for (const z of O)
|
|
10497
10538
|
ee.push(z.x, z.y);
|
|
10498
10539
|
const $ = [];
|
|
10499
10540
|
let be = N.length;
|
|
10500
10541
|
for (const z of Z)
|
|
10501
10542
|
$.push(be), be += z.length;
|
|
10502
|
-
const le =
|
|
10543
|
+
const le = tu(ee, $.length > 0 ? $ : void 0, 2);
|
|
10503
10544
|
if (!le || le.length < 3) continue;
|
|
10504
10545
|
const Ue = [];
|
|
10505
10546
|
for (let z = 0; z < le.length; z += 3) {
|
|
10506
|
-
const Re =
|
|
10507
|
-
Math.abs((
|
|
10547
|
+
const Re = O[le[z]], kt = O[le[z + 1]], Je = O[le[z + 2]];
|
|
10548
|
+
Math.abs((kt.x - Re.x) * (Je.y - Re.y) - (kt.y - Re.y) * (Je.x - Re.x)) > 1e-10 && Ue.push(le[z], le[z + 1], le[z + 2]);
|
|
10508
10549
|
}
|
|
10509
10550
|
if (Ue.length < 3) continue;
|
|
10510
|
-
const Se = Ue, ne = [...
|
|
10551
|
+
const Se = Ue, ne = [...C, ...G.flat()], ue = new Float32Array(ne.length * 3);
|
|
10511
10552
|
for (let z = 0; z < ne.length; z++) {
|
|
10512
10553
|
const Re = ne[z].clone().add(P);
|
|
10513
10554
|
ue[z * 3] = Re.x, ue[z * 3 + 1] = Re.y, ue[z * 3 + 2] = Re.z;
|
|
@@ -10529,7 +10570,7 @@ function Tu(r, e, t) {
|
|
|
10529
10570
|
for (const R of V) L.add(R);
|
|
10530
10571
|
return L;
|
|
10531
10572
|
}
|
|
10532
|
-
class
|
|
10573
|
+
class Ru extends EventTarget {
|
|
10533
10574
|
constructor(t) {
|
|
10534
10575
|
super();
|
|
10535
10576
|
_(this, "bounds");
|
|
@@ -10669,7 +10710,7 @@ class Su extends EventTarget {
|
|
|
10669
10710
|
this.clear_caps();
|
|
10670
10711
|
const t = this.model;
|
|
10671
10712
|
for (const n of this.build_planes()) {
|
|
10672
|
-
const s =
|
|
10713
|
+
const s = Su(t, n, {
|
|
10673
10714
|
color: this.cap_color,
|
|
10674
10715
|
clipping_planes: this.planes
|
|
10675
10716
|
});
|
|
@@ -10684,7 +10725,7 @@ class Su extends EventTarget {
|
|
|
10684
10725
|
if (!n.isMesh) return;
|
|
10685
10726
|
const s = n;
|
|
10686
10727
|
if (!s.geometry || !s.geometry.index) return;
|
|
10687
|
-
const i = new
|
|
10728
|
+
const i = new eu(s, new fi(20, !0, "#222222"));
|
|
10688
10729
|
i.visible = this.outline_active, this.outline_meshes.push(i), s.add(i);
|
|
10689
10730
|
});
|
|
10690
10731
|
}
|
|
@@ -10709,7 +10750,7 @@ class Su extends EventTarget {
|
|
|
10709
10750
|
}));
|
|
10710
10751
|
for (const s of this.outline_meshes) {
|
|
10711
10752
|
const i = s.material;
|
|
10712
|
-
!Array.isArray(i) && i instanceof
|
|
10753
|
+
!Array.isArray(i) && i instanceof fi && i.set_clip_planes(n);
|
|
10713
10754
|
}
|
|
10714
10755
|
}
|
|
10715
10756
|
clear_caps() {
|
|
@@ -10719,7 +10760,7 @@ class Su extends EventTarget {
|
|
|
10719
10760
|
}
|
|
10720
10761
|
this.remove_outlines_for_group(this.caps);
|
|
10721
10762
|
for (const t of this.caps)
|
|
10722
|
-
this.scene.remove(t),
|
|
10763
|
+
this.scene.remove(t), Tu(t);
|
|
10723
10764
|
this.caps = [];
|
|
10724
10765
|
}
|
|
10725
10766
|
remove_visuals() {
|
|
@@ -10774,21 +10815,21 @@ class Su extends EventTarget {
|
|
|
10774
10815
|
this.bound_handlers = [];
|
|
10775
10816
|
}
|
|
10776
10817
|
}
|
|
10777
|
-
class
|
|
10818
|
+
class Mu extends EventTarget {
|
|
10778
10819
|
constructor(t) {
|
|
10779
10820
|
super();
|
|
10780
10821
|
_(this, "viewer");
|
|
10781
10822
|
_(this, "gizmo");
|
|
10782
10823
|
_(this, "section_box");
|
|
10783
10824
|
_(this, "sectioned_model");
|
|
10784
|
-
this.viewer = t, this.section_box = new
|
|
10825
|
+
this.viewer = t, this.section_box = new Ru();
|
|
10785
10826
|
}
|
|
10786
10827
|
/**
|
|
10787
10828
|
* Create gizmo and enter interactive edit mode
|
|
10788
10829
|
* @param model - Model to fit the section box to
|
|
10789
10830
|
*/
|
|
10790
10831
|
create_for_model(t) {
|
|
10791
|
-
this.gizmo && this.dispose_gizmo(), this.gizmo = new
|
|
10832
|
+
this.gizmo && this.dispose_gizmo(), this.gizmo = new qd(), this.gizmo.fit_to_model(t.group), this.gizmo.enter_edit_mode(
|
|
10792
10833
|
this.viewer.scene,
|
|
10793
10834
|
this.viewer.camera,
|
|
10794
10835
|
this.viewer.renderer.domElement,
|
|
@@ -10892,21 +10933,21 @@ class Ou extends EventTarget {
|
|
|
10892
10933
|
if (this.glimmer = t, typeof n == "string")
|
|
10893
10934
|
try {
|
|
10894
10935
|
const s = JSON.parse(n);
|
|
10895
|
-
this.story =
|
|
10936
|
+
this.story = $n.parse(s);
|
|
10896
10937
|
} catch (s) {
|
|
10897
10938
|
throw j.error("Failed to parse story JSON:", s), new ve(
|
|
10898
10939
|
`Invalid story JSON: ${s instanceof Error ? s.message : s}`,
|
|
10899
10940
|
"StoryManager",
|
|
10900
|
-
|
|
10941
|
+
Ce.INVALID_STORY_JSON,
|
|
10901
10942
|
{ error: s }
|
|
10902
10943
|
);
|
|
10903
10944
|
}
|
|
10904
10945
|
else
|
|
10905
|
-
this.story =
|
|
10906
|
-
j.info("StoryManager initialized with story:", this.story.title), this.glimmer.viewer.stop_camera_orbit_animation(), this.annotation_container = this._create_annotation_container(), this.annotation_2d_renderer = new
|
|
10946
|
+
this.story = $n.parse(n);
|
|
10947
|
+
j.info("StoryManager initialized with story:", this.story.title), this.glimmer.viewer.stop_camera_orbit_animation(), this.annotation_container = this._create_annotation_container(), this.annotation_2d_renderer = new Wd({ container: this.annotation_container }), this.annotation_3d_renderer = new Xd({
|
|
10907
10948
|
scene: this.glimmer.viewer.scene,
|
|
10908
10949
|
group_name: "story-annotations"
|
|
10909
|
-
}), this.trigger_manager = new
|
|
10950
|
+
}), this.trigger_manager = new $d(), this.transition_manager = new Yd(this.glimmer.viewer.camera, this.glimmer.viewer.controls), this.section_box_manager = new Mu(this.glimmer.viewer), this.goto(0);
|
|
10910
10951
|
}
|
|
10911
10952
|
/**
|
|
10912
10953
|
* Navigate to the next slide
|
|
@@ -11013,7 +11054,7 @@ class Ou extends EventTarget {
|
|
|
11013
11054
|
},
|
|
11014
11055
|
section_box_enabled: !1
|
|
11015
11056
|
}, a = this.section_box_manager.get_bounds();
|
|
11016
|
-
return a && (o.section_box = a, o.section_box_enabled = !0),
|
|
11057
|
+
return a && (o.section_box = a, o.section_box_enabled = !0), ns.parse(o);
|
|
11017
11058
|
}
|
|
11018
11059
|
/**
|
|
11019
11060
|
* Export the story as JSON
|
|
@@ -11028,7 +11069,7 @@ class Ou extends EventTarget {
|
|
|
11028
11069
|
* @returns The index where the slide was added
|
|
11029
11070
|
*/
|
|
11030
11071
|
add_slide(t, n) {
|
|
11031
|
-
const s =
|
|
11072
|
+
const s = ns.parse(t), i = n !== void 0 ? Math.max(0, Math.min(n, this.story.slides.length)) : this.story.slides.length;
|
|
11032
11073
|
return this.story.slides.splice(i, 0, s), j.info(`Added slide "${s.id}" at index ${i}`), this._emit_story_change("add", i), i;
|
|
11033
11074
|
}
|
|
11034
11075
|
/**
|
|
@@ -11041,9 +11082,9 @@ class Ou extends EventTarget {
|
|
|
11041
11082
|
throw new ve(
|
|
11042
11083
|
`Invalid slide index: ${t}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11043
11084
|
"StoryManager",
|
|
11044
|
-
|
|
11085
|
+
Ce.INVALID_STORY_JSON
|
|
11045
11086
|
);
|
|
11046
|
-
const s = { ...this.story.slides[t], ...n }, i =
|
|
11087
|
+
const s = { ...this.story.slides[t], ...n }, i = ns.parse(s);
|
|
11047
11088
|
this.story.slides[t] = i, j.info(`Updated slide at index ${t}: "${i.id}"`), this._emit_story_change("update", t), t === this.current_index && this.goto(t);
|
|
11048
11089
|
}
|
|
11049
11090
|
/**
|
|
@@ -11055,13 +11096,13 @@ class Ou extends EventTarget {
|
|
|
11055
11096
|
throw new ve(
|
|
11056
11097
|
"Cannot delete the last slide. Story must have at least one slide.",
|
|
11057
11098
|
"StoryManager",
|
|
11058
|
-
|
|
11099
|
+
Ce.INVALID_STORY_JSON
|
|
11059
11100
|
);
|
|
11060
11101
|
if (t < 0 || t >= this.story.slides.length)
|
|
11061
11102
|
throw new ve(
|
|
11062
11103
|
`Invalid slide index: ${t}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11063
11104
|
"StoryManager",
|
|
11064
|
-
|
|
11105
|
+
Ce.INVALID_STORY_JSON
|
|
11065
11106
|
);
|
|
11066
11107
|
const n = this.story.slides[t];
|
|
11067
11108
|
this.story.slides.splice(t, 1), j.info(`Deleted slide at index ${t}: "${n.id}"`), this.current_index >= this.story.slides.length && (this.current_index = this.story.slides.length - 1), this._emit_story_change("delete", t), this.goto(this.current_index);
|
|
@@ -11076,13 +11117,13 @@ class Ou extends EventTarget {
|
|
|
11076
11117
|
throw new ve(
|
|
11077
11118
|
`Invalid from_index: ${t}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11078
11119
|
"StoryManager",
|
|
11079
|
-
|
|
11120
|
+
Ce.INVALID_STORY_JSON
|
|
11080
11121
|
);
|
|
11081
11122
|
if (n < 0 || n >= this.story.slides.length)
|
|
11082
11123
|
throw new ve(
|
|
11083
11124
|
`Invalid to_index: ${n}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11084
11125
|
"StoryManager",
|
|
11085
|
-
|
|
11126
|
+
Ce.INVALID_STORY_JSON
|
|
11086
11127
|
);
|
|
11087
11128
|
if (t === n)
|
|
11088
11129
|
return;
|
|
@@ -11097,17 +11138,17 @@ class Ou extends EventTarget {
|
|
|
11097
11138
|
if (typeof t == "string")
|
|
11098
11139
|
try {
|
|
11099
11140
|
const n = JSON.parse(t);
|
|
11100
|
-
this.story =
|
|
11141
|
+
this.story = $n.parse(n);
|
|
11101
11142
|
} catch (n) {
|
|
11102
11143
|
throw new ve(
|
|
11103
11144
|
`Invalid story JSON: ${n instanceof Error ? n.message : n}`,
|
|
11104
11145
|
"StoryManager",
|
|
11105
|
-
|
|
11146
|
+
Ce.INVALID_STORY_JSON,
|
|
11106
11147
|
{ error: n }
|
|
11107
11148
|
);
|
|
11108
11149
|
}
|
|
11109
11150
|
else
|
|
11110
|
-
this.story =
|
|
11151
|
+
this.story = $n.parse(t);
|
|
11111
11152
|
j.info("Story replaced:", this.story.title), this.current_index = 0, this.goto(0), this._emit_story_change("replace", 0);
|
|
11112
11153
|
}
|
|
11113
11154
|
/**
|
|
@@ -11122,7 +11163,7 @@ class Ou extends EventTarget {
|
|
|
11122
11163
|
throw new ve(
|
|
11123
11164
|
`Annotation index ${t} out of range`,
|
|
11124
11165
|
"StoryManager.add_annotation_anchor",
|
|
11125
|
-
|
|
11166
|
+
Ce.INVALID_SLIDE_INDEX
|
|
11126
11167
|
);
|
|
11127
11168
|
i.annotations[t].anchor = {
|
|
11128
11169
|
model_url: n,
|
|
@@ -11139,7 +11180,7 @@ class Ou extends EventTarget {
|
|
|
11139
11180
|
throw new ve(
|
|
11140
11181
|
`Annotation index ${t} out of range`,
|
|
11141
11182
|
"StoryManager.remove_annotation_anchor",
|
|
11142
|
-
|
|
11183
|
+
Ce.INVALID_SLIDE_INDEX
|
|
11143
11184
|
);
|
|
11144
11185
|
delete n.annotations[t].anchor, this._render_annotations(n.annotations), this._emit_story_change("update", this.current_index);
|
|
11145
11186
|
}
|
|
@@ -11161,7 +11202,7 @@ class Ou extends EventTarget {
|
|
|
11161
11202
|
throw new ve(
|
|
11162
11203
|
"No model loaded. Cannot enter section box edit mode.",
|
|
11163
11204
|
"StoryManager.enter_section_box_edit_mode",
|
|
11164
|
-
|
|
11205
|
+
Ce.MODEL_NOT_FOUND
|
|
11165
11206
|
);
|
|
11166
11207
|
this.section_box_manager.create_for_model(n);
|
|
11167
11208
|
}
|
|
@@ -11422,7 +11463,7 @@ _(Gt, "AXIS_COLORS", {
|
|
|
11422
11463
|
z: 255
|
|
11423
11464
|
// Blue
|
|
11424
11465
|
});
|
|
11425
|
-
let
|
|
11466
|
+
let Pr = Gt;
|
|
11426
11467
|
const Zt = class Zt extends EventTarget {
|
|
11427
11468
|
constructor() {
|
|
11428
11469
|
super();
|
|
@@ -11598,22 +11639,22 @@ _(Zt, "AXIS_COLORS", {
|
|
|
11598
11639
|
z: 255
|
|
11599
11640
|
// Blue
|
|
11600
11641
|
});
|
|
11601
|
-
let
|
|
11642
|
+
let zr = Zt;
|
|
11602
11643
|
export {
|
|
11603
|
-
|
|
11644
|
+
Yc as Environment,
|
|
11604
11645
|
Cu as Glimmer,
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11646
|
+
Nl as Model,
|
|
11647
|
+
xd as ModelManager,
|
|
11648
|
+
Pr as MoveGizmo,
|
|
11649
|
+
fi as OutlineMaterial,
|
|
11650
|
+
eu as OutlineMesh,
|
|
11651
|
+
Kd as PlaneHandle,
|
|
11652
|
+
zr as RotateGizmo,
|
|
11653
|
+
Ru as SectionBox,
|
|
11654
|
+
qd as SectionBoxGizmo,
|
|
11655
|
+
Mu as SectionBoxManager,
|
|
11656
|
+
oi as Settings,
|
|
11616
11657
|
Ou as StoryManager,
|
|
11617
|
-
|
|
11618
|
-
|
|
11658
|
+
yl as Sun,
|
|
11659
|
+
Gc as Viewer
|
|
11619
11660
|
};
|