@maucwerk/glimmer 1.1.1 → 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 +6 -2
- package/dist/environment/environment.d.ts +10 -0
- package/dist/environment/sun.d.ts +2 -2
- package/dist/vite/glimmer.mjs +972 -944
- 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");
|
|
@@ -4895,20 +4929,14 @@ class gl {
|
|
|
4895
4929
|
});
|
|
4896
4930
|
}
|
|
4897
4931
|
/**
|
|
4898
|
-
* Point the
|
|
4899
|
-
*
|
|
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.
|
|
4900
4934
|
*/
|
|
4901
4935
|
sync_sky(e) {
|
|
4902
|
-
|
|
4903
|
-
const t = this.environment.sky;
|
|
4904
|
-
if (!t) return;
|
|
4905
|
-
const n = t.material.uniforms;
|
|
4906
|
-
n != null && n.sunPosition && n.sunPosition.value.copy(
|
|
4907
|
-
new p.Vector3(e[0], e[1], e[2]).normalize()
|
|
4908
|
-
);
|
|
4936
|
+
e && this.environment.update_sky_environment(new p.Vector3(e[0], e[1], e[2]));
|
|
4909
4937
|
}
|
|
4910
4938
|
sun_fit_object(e = this.scene) {
|
|
4911
|
-
const t =
|
|
4939
|
+
const t = dr(e);
|
|
4912
4940
|
let n = new p.Vector3(0, 1, 0).normalize();
|
|
4913
4941
|
n = n.multiplyScalar(t * 2), this.sun && (n = this.sun.position.clone());
|
|
4914
4942
|
}
|
|
@@ -4921,15 +4949,15 @@ class gl {
|
|
|
4921
4949
|
for (const o of this.model_manager.models.values())
|
|
4922
4950
|
o.settings.shadow && e.add(o.group.clone());
|
|
4923
4951
|
e.children.length === 0 && j.warn("No models with shadows found to fit shadow map."), j.debug("Models in fit_object:", e);
|
|
4924
|
-
const t =
|
|
4952
|
+
const t = dr(e), n = Kc, s = Math.ceil(t / qc), i = Math.min(
|
|
4925
4953
|
Math.pow(2, Math.ceil(Math.log2(n * s))),
|
|
4926
4954
|
this.viewer.renderer.capabilities.maxTextureSize
|
|
4927
4955
|
// Ensure it's within the device limit
|
|
4928
4956
|
);
|
|
4929
4957
|
if (j.debug("Shadow map size:", i), this.sun) {
|
|
4930
4958
|
this.sun.shadow.mapSize.width = i, this.sun.shadow.mapSize.height = i;
|
|
4931
|
-
const o =
|
|
4932
|
-
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}`);
|
|
4933
4961
|
}
|
|
4934
4962
|
}
|
|
4935
4963
|
/**
|
|
@@ -4939,7 +4967,7 @@ class gl {
|
|
|
4939
4967
|
* so repeated updates cannot drift.
|
|
4940
4968
|
*/
|
|
4941
4969
|
resolve_solar() {
|
|
4942
|
-
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);
|
|
4943
4971
|
let i = 0;
|
|
4944
4972
|
return n.intensity > 0 && (i = +`0x${n.color.getHexString()}`), j.debug(
|
|
4945
4973
|
`Solar sun: lat ${e.latitude}, lon ${e.longitude}, alt ${t.altitude_deg.toFixed(1)}°, az ${t.azimuth_deg.toFixed(1)}°`
|
|
@@ -5011,31 +5039,31 @@ class gl {
|
|
|
5011
5039
|
const pe = [];
|
|
5012
5040
|
for (let r = 0; r < 256; ++r)
|
|
5013
5041
|
pe.push((r + 256).toString(16).slice(1));
|
|
5014
|
-
function
|
|
5042
|
+
function vl(r, e = 0) {
|
|
5015
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();
|
|
5016
5044
|
}
|
|
5017
|
-
let
|
|
5018
|
-
const
|
|
5019
|
-
function
|
|
5020
|
-
if (!
|
|
5045
|
+
let Is;
|
|
5046
|
+
const xl = new Uint8Array(16);
|
|
5047
|
+
function bl() {
|
|
5048
|
+
if (!Is) {
|
|
5021
5049
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
5022
5050
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
5023
|
-
|
|
5051
|
+
Is = crypto.getRandomValues.bind(crypto);
|
|
5024
5052
|
}
|
|
5025
|
-
return
|
|
5053
|
+
return Is(xl);
|
|
5026
5054
|
}
|
|
5027
|
-
const
|
|
5028
|
-
function
|
|
5055
|
+
const wl = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ur = { randomUUID: wl };
|
|
5056
|
+
function El(r, e, t) {
|
|
5029
5057
|
var s;
|
|
5030
|
-
if (
|
|
5031
|
-
return
|
|
5058
|
+
if (ur.randomUUID && !r)
|
|
5059
|
+
return ur.randomUUID();
|
|
5032
5060
|
r = r || {};
|
|
5033
|
-
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();
|
|
5034
5062
|
if (n.length < 16)
|
|
5035
5063
|
throw new Error("Random bytes length must be >= 16");
|
|
5036
|
-
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);
|
|
5037
5065
|
}
|
|
5038
|
-
function
|
|
5066
|
+
function Al(r, e = 1e-4) {
|
|
5039
5067
|
e = Math.max(e, Number.EPSILON);
|
|
5040
5068
|
const t = {}, n = r.getIndex(), s = r.getAttribute("position"), i = n ? n.count : s.count;
|
|
5041
5069
|
let o = 0;
|
|
@@ -5059,19 +5087,19 @@ function El(r, e = 1e-4) {
|
|
|
5059
5087
|
let v = "";
|
|
5060
5088
|
for (let P = 0, V = a.length; P < V; P++) {
|
|
5061
5089
|
const F = a[P], L = r.getAttribute(F), R = L.itemSize;
|
|
5062
|
-
for (let
|
|
5063
|
-
v += `${~~(L[u[
|
|
5090
|
+
for (let C = 0; C < R; C++)
|
|
5091
|
+
v += `${~~(L[u[C]](T) * y + x)},`;
|
|
5064
5092
|
}
|
|
5065
5093
|
if (v in t)
|
|
5066
5094
|
d.push(t[v]);
|
|
5067
5095
|
else {
|
|
5068
5096
|
for (let P = 0, V = a.length; P < V; P++) {
|
|
5069
|
-
const F = a[P], L = r.getAttribute(F), R = r.morphAttributes[F],
|
|
5070
|
-
for (let Z = 0; Z <
|
|
5071
|
-
const
|
|
5072
|
-
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)
|
|
5073
5101
|
for (let $ = 0, be = R.length; $ < be; $++)
|
|
5074
|
-
G[$][ee](o, R[$][
|
|
5102
|
+
G[$][ee](o, R[$][O](T));
|
|
5075
5103
|
}
|
|
5076
5104
|
}
|
|
5077
5105
|
t[v] = o, d.push(o), o++;
|
|
@@ -5096,10 +5124,10 @@ function El(r, e = 1e-4) {
|
|
|
5096
5124
|
}
|
|
5097
5125
|
return b.setIndex(d), b;
|
|
5098
5126
|
}
|
|
5099
|
-
function
|
|
5100
|
-
if (e ===
|
|
5127
|
+
function hr(r, e) {
|
|
5128
|
+
if (e === Uo)
|
|
5101
5129
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
5102
|
-
if (e ===
|
|
5130
|
+
if (e === Js || e === Br) {
|
|
5103
5131
|
let t = r.getIndex();
|
|
5104
5132
|
if (t === null) {
|
|
5105
5133
|
const o = [], a = r.getAttribute("position");
|
|
@@ -5111,7 +5139,7 @@ function ur(r, e) {
|
|
|
5111
5139
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
|
|
5112
5140
|
}
|
|
5113
5141
|
const n = t.count - 2, s = [];
|
|
5114
|
-
if (e ===
|
|
5142
|
+
if (e === Js)
|
|
5115
5143
|
for (let o = 1; o <= n; o++)
|
|
5116
5144
|
s.push(t.getX(0)), s.push(t.getX(o)), s.push(t.getX(o + 1));
|
|
5117
5145
|
else
|
|
@@ -5123,15 +5151,15 @@ function ur(r, e) {
|
|
|
5123
5151
|
} else
|
|
5124
5152
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), r;
|
|
5125
5153
|
}
|
|
5126
|
-
const
|
|
5127
|
-
class
|
|
5154
|
+
const fr = new ps(), Zn = new J();
|
|
5155
|
+
class Li extends Fo {
|
|
5128
5156
|
/**
|
|
5129
5157
|
* Constructs a new line segments geometry.
|
|
5130
5158
|
*/
|
|
5131
5159
|
constructor() {
|
|
5132
5160
|
super(), this.isLineSegmentsGeometry = !0, this.type = "LineSegmentsGeometry";
|
|
5133
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];
|
|
5134
|
-
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));
|
|
5135
5163
|
}
|
|
5136
5164
|
/**
|
|
5137
5165
|
* Applies the given 4x4 transformation matrix to the geometry.
|
|
@@ -5153,7 +5181,7 @@ class Mi extends Uo {
|
|
|
5153
5181
|
setPositions(e) {
|
|
5154
5182
|
let t;
|
|
5155
5183
|
e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
|
|
5156
|
-
const n = new
|
|
5184
|
+
const n = new Qs(t, 6, 1);
|
|
5157
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;
|
|
5158
5186
|
}
|
|
5159
5187
|
/**
|
|
@@ -5166,7 +5194,7 @@ class Mi extends Uo {
|
|
|
5166
5194
|
setColors(e) {
|
|
5167
5195
|
let t;
|
|
5168
5196
|
e instanceof Float32Array ? t = e : Array.isArray(e) && (t = new Float32Array(e));
|
|
5169
|
-
const n = new
|
|
5197
|
+
const n = new Qs(t, 6, 1);
|
|
5170
5198
|
return this.setAttribute("instanceColorStart", new Et(n, 3, 0)), this.setAttribute("instanceColorEnd", new Et(n, 3, 3)), this;
|
|
5171
5199
|
}
|
|
5172
5200
|
/**
|
|
@@ -5194,7 +5222,7 @@ class Mi extends Uo {
|
|
|
5194
5222
|
* @return {LineSegmentsGeometry} A reference to this geometry.
|
|
5195
5223
|
*/
|
|
5196
5224
|
fromMesh(e) {
|
|
5197
|
-
return this.fromWireframeGeometry(new
|
|
5225
|
+
return this.fromWireframeGeometry(new jo(e.geometry)), this;
|
|
5198
5226
|
}
|
|
5199
5227
|
/**
|
|
5200
5228
|
* Setups this line segments geometry from the given line segments.
|
|
@@ -5208,40 +5236,40 @@ class Mi extends Uo {
|
|
|
5208
5236
|
return this.setPositions(t.attributes.position.array), this;
|
|
5209
5237
|
}
|
|
5210
5238
|
computeBoundingBox() {
|
|
5211
|
-
this.boundingBox === null && (this.boundingBox = new
|
|
5239
|
+
this.boundingBox === null && (this.boundingBox = new ps());
|
|
5212
5240
|
const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
|
|
5213
|
-
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));
|
|
5214
5242
|
}
|
|
5215
5243
|
computeBoundingSphere() {
|
|
5216
|
-
this.boundingSphere === null && (this.boundingSphere = new
|
|
5244
|
+
this.boundingSphere === null && (this.boundingSphere = new Ti()), this.boundingBox === null && this.computeBoundingBox();
|
|
5217
5245
|
const e = this.attributes.instanceStart, t = this.attributes.instanceEnd;
|
|
5218
5246
|
if (e !== void 0 && t !== void 0) {
|
|
5219
5247
|
const n = this.boundingSphere.center;
|
|
5220
5248
|
this.boundingBox.getCenter(n);
|
|
5221
5249
|
let s = 0;
|
|
5222
5250
|
for (let i = 0, o = e.count; i < o; i++)
|
|
5223
|
-
|
|
5251
|
+
Zn.fromBufferAttribute(e, i), s = Math.max(s, n.distanceToSquared(Zn)), Zn.fromBufferAttribute(t, i), s = Math.max(s, n.distanceToSquared(Zn));
|
|
5224
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);
|
|
5225
5253
|
}
|
|
5226
5254
|
}
|
|
5227
5255
|
toJSON() {
|
|
5228
5256
|
}
|
|
5229
5257
|
}
|
|
5230
|
-
|
|
5258
|
+
es.line = {
|
|
5231
5259
|
worldUnits: { value: 1 },
|
|
5232
5260
|
linewidth: { value: 1 },
|
|
5233
|
-
resolution: { value: new
|
|
5261
|
+
resolution: { value: new ke(1, 1) },
|
|
5234
5262
|
dashOffset: { value: 0 },
|
|
5235
5263
|
dashScale: { value: 1 },
|
|
5236
5264
|
dashSize: { value: 1 },
|
|
5237
5265
|
gapSize: { value: 1 }
|
|
5238
5266
|
// todo FIX - maybe change to totalSize
|
|
5239
5267
|
};
|
|
5240
|
-
|
|
5241
|
-
uniforms:
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5268
|
+
Qn.line = {
|
|
5269
|
+
uniforms: Ai.merge([
|
|
5270
|
+
es.common,
|
|
5271
|
+
es.fog,
|
|
5272
|
+
es.line
|
|
5245
5273
|
]),
|
|
5246
5274
|
vertexShader: (
|
|
5247
5275
|
/* glsl */
|
|
@@ -5622,7 +5650,7 @@ Jn.line = {
|
|
|
5622
5650
|
`
|
|
5623
5651
|
)
|
|
5624
5652
|
};
|
|
5625
|
-
class
|
|
5653
|
+
class ao extends Ei {
|
|
5626
5654
|
/**
|
|
5627
5655
|
* Constructs a new line segments geometry.
|
|
5628
5656
|
*
|
|
@@ -5635,9 +5663,9 @@ class oo extends wi {
|
|
|
5635
5663
|
constructor(e) {
|
|
5636
5664
|
super({
|
|
5637
5665
|
type: "LineMaterial",
|
|
5638
|
-
uniforms:
|
|
5639
|
-
vertexShader:
|
|
5640
|
-
fragmentShader:
|
|
5666
|
+
uniforms: Ai.clone(Qn.line.uniforms),
|
|
5667
|
+
vertexShader: Qn.line.vertexShader,
|
|
5668
|
+
fragmentShader: Qn.line.fragmentShader,
|
|
5641
5669
|
clipping: !0
|
|
5642
5670
|
// required for clipping support
|
|
5643
5671
|
}), this.isLineMaterial = !0, this.setValues(e);
|
|
@@ -5777,12 +5805,12 @@ class oo extends wi {
|
|
|
5777
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);
|
|
5778
5806
|
}
|
|
5779
5807
|
}
|
|
5780
|
-
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();
|
|
5781
5809
|
let Xe, Tt;
|
|
5782
|
-
function
|
|
5810
|
+
function gr(r, e, t) {
|
|
5783
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));
|
|
5784
5812
|
}
|
|
5785
|
-
function
|
|
5813
|
+
function Tl(r, e) {
|
|
5786
5814
|
const t = r.matrixWorld, n = r.geometry, s = n.attributes.instanceStart, i = n.attributes.instanceEnd, o = Math.min(n.instanceCount, s.count);
|
|
5787
5815
|
for (let a = 0, c = o; a < c; a++) {
|
|
5788
5816
|
_e.start.fromBufferAttribute(s, a), _e.end.fromBufferAttribute(i, a), _e.applyMatrix4(t);
|
|
@@ -5799,11 +5827,11 @@ function Al(r, e) {
|
|
|
5799
5827
|
});
|
|
5800
5828
|
}
|
|
5801
5829
|
}
|
|
5802
|
-
function
|
|
5830
|
+
function Sl(r, e, t) {
|
|
5803
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;
|
|
5804
|
-
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);
|
|
5805
5833
|
for (let h = 0, f = d; h < f; h++) {
|
|
5806
|
-
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)
|
|
5807
5835
|
continue;
|
|
5808
5836
|
if (fe.z > u) {
|
|
5809
5837
|
const T = fe.z - me.z, v = (fe.z - u) / T;
|
|
@@ -5813,9 +5841,9 @@ function Tl(r, e, t) {
|
|
|
5813
5841
|
me.lerp(fe, v);
|
|
5814
5842
|
}
|
|
5815
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;
|
|
5816
|
-
const y = _e.closestPointToPointParameter(
|
|
5817
|
-
_e.at(y,
|
|
5818
|
-
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;
|
|
5819
5847
|
if (b && w) {
|
|
5820
5848
|
_e.start.fromBufferAttribute(c, h), _e.end.fromBufferAttribute(l, h), _e.start.applyMatrix4(o), _e.end.applyMatrix4(o);
|
|
5821
5849
|
const T = new J(), v = new J();
|
|
@@ -5832,14 +5860,14 @@ function Tl(r, e, t) {
|
|
|
5832
5860
|
}
|
|
5833
5861
|
}
|
|
5834
5862
|
}
|
|
5835
|
-
class
|
|
5863
|
+
class yr extends ye {
|
|
5836
5864
|
/**
|
|
5837
5865
|
* Constructs a new wide line.
|
|
5838
5866
|
*
|
|
5839
5867
|
* @param {LineSegmentsGeometry} [geometry] - The line geometry.
|
|
5840
5868
|
* @param {LineMaterial} [material] - The line material.
|
|
5841
5869
|
*/
|
|
5842
|
-
constructor(e = new
|
|
5870
|
+
constructor(e = new Li(), t = new ao({ color: Math.random() * 16777215 })) {
|
|
5843
5871
|
super(e, t), this.isLineSegments2 = !0, this.type = "LineSegments2";
|
|
5844
5872
|
}
|
|
5845
5873
|
/**
|
|
@@ -5852,8 +5880,8 @@ class gr extends ye {
|
|
|
5852
5880
|
computeLineDistances() {
|
|
5853
5881
|
const e = this.geometry, t = e.attributes.instanceStart, n = e.attributes.instanceEnd, s = new Float32Array(2 * t.count);
|
|
5854
5882
|
for (let o = 0, a = 0, c = t.count; o < c; o++, a += 2)
|
|
5855
|
-
|
|
5856
|
-
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);
|
|
5857
5885
|
return e.setAttribute("instanceDistanceStart", new Et(i, 1, 0)), e.setAttribute("instanceDistanceEnd", new Et(i, 1, 1)), this;
|
|
5858
5886
|
}
|
|
5859
5887
|
/**
|
|
@@ -5868,32 +5896,32 @@ class gr extends ye {
|
|
|
5868
5896
|
const i = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
|
|
5869
5897
|
Xe = e.ray;
|
|
5870
5898
|
const o = this.matrixWorld, a = this.geometry, c = this.material;
|
|
5871
|
-
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);
|
|
5872
5900
|
let l;
|
|
5873
5901
|
if (n)
|
|
5874
5902
|
l = Tt * 0.5;
|
|
5875
5903
|
else {
|
|
5876
|
-
const u = Math.max(s.near,
|
|
5877
|
-
l =
|
|
5904
|
+
const u = Math.max(s.near, Xn.distanceToPoint(Xe.origin));
|
|
5905
|
+
l = gr(s, u, c.resolution);
|
|
5878
5906
|
}
|
|
5879
|
-
if (
|
|
5907
|
+
if (Xn.radius += l, Xe.intersectsSphere(Xn) === !1)
|
|
5880
5908
|
return;
|
|
5881
|
-
a.boundingBox === null && a.computeBoundingBox(),
|
|
5909
|
+
a.boundingBox === null && a.computeBoundingBox(), Wn.copy(a.boundingBox).applyMatrix4(o);
|
|
5882
5910
|
let d;
|
|
5883
5911
|
if (n)
|
|
5884
5912
|
d = Tt * 0.5;
|
|
5885
5913
|
else {
|
|
5886
|
-
const u = Math.max(s.near,
|
|
5887
|
-
d =
|
|
5914
|
+
const u = Math.max(s.near, Wn.distanceToPoint(Xe.origin));
|
|
5915
|
+
d = gr(s, u, c.resolution);
|
|
5888
5916
|
}
|
|
5889
|
-
|
|
5917
|
+
Wn.expandByScalar(d), Xe.intersectsBox(Wn) !== !1 && (n ? Tl(this, t) : Sl(this, s, t));
|
|
5890
5918
|
}
|
|
5891
5919
|
onBeforeRender(e) {
|
|
5892
5920
|
const t = this.material.uniforms;
|
|
5893
|
-
t && t.resolution && (e.getViewport(
|
|
5921
|
+
t && t.resolution && (e.getViewport(Ns), this.material.uniforms.resolution.value.set(Ns.z, Ns.w));
|
|
5894
5922
|
}
|
|
5895
5923
|
}
|
|
5896
|
-
class
|
|
5924
|
+
class vr extends p.BufferGeometry {
|
|
5897
5925
|
constructor(e, t = 4) {
|
|
5898
5926
|
super();
|
|
5899
5927
|
const n = {}, s = e.attributes.position;
|
|
@@ -5907,8 +5935,8 @@ class yr extends p.BufferGeometry {
|
|
|
5907
5935
|
for (let T = 0, v = i.count; T < v; T += 3) {
|
|
5908
5936
|
const P = [i.getX(T + 0), i.getX(T + 1), i.getX(T + 2)];
|
|
5909
5937
|
for (let V = 0; V < 3; V++) {
|
|
5910
|
-
const F = P[V], L = P[(V + 1) % 3], R = `${F}_${L}`,
|
|
5911
|
-
|
|
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] = {
|
|
5912
5940
|
index0: F,
|
|
5913
5941
|
index1: L,
|
|
5914
5942
|
controlIndex0: P[(V + 2) % 3],
|
|
@@ -5923,13 +5951,13 @@ class yr extends p.BufferGeometry {
|
|
|
5923
5951
|
const { index0: v, index1: P, controlIndex0: V, controlIndex1: F, tri0: L, tri1: R } = n[T];
|
|
5924
5952
|
if (F === null) continue;
|
|
5925
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();
|
|
5926
|
-
const
|
|
5927
|
-
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));
|
|
5928
5956
|
}
|
|
5929
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));
|
|
5930
5958
|
}
|
|
5931
5959
|
}
|
|
5932
|
-
class
|
|
5960
|
+
class Rl extends Li {
|
|
5933
5961
|
/**
|
|
5934
5962
|
* Populates this geometry from a ConditionalEdgesGeometry (or any BufferGeometry
|
|
5935
5963
|
* whose attributes include `direction`, `control0`, and `control1`).
|
|
@@ -5988,7 +6016,7 @@ class Sl extends Mi {
|
|
|
5988
6016
|
), this;
|
|
5989
6017
|
}
|
|
5990
6018
|
}
|
|
5991
|
-
const
|
|
6019
|
+
const Ml = `
|
|
5992
6020
|
attribute vec3 control0;
|
|
5993
6021
|
attribute vec3 control1;
|
|
5994
6022
|
attribute vec3 direction;
|
|
@@ -6038,7 +6066,7 @@ const Rl = `
|
|
|
6038
6066
|
#include <fog_vertex>
|
|
6039
6067
|
|
|
6040
6068
|
}
|
|
6041
|
-
`,
|
|
6069
|
+
`, Ll = `
|
|
6042
6070
|
uniform vec3 diffuse;
|
|
6043
6071
|
uniform float opacity;
|
|
6044
6072
|
|
|
@@ -6065,7 +6093,7 @@ const Rl = `
|
|
|
6065
6093
|
#include <premultiplied_alpha_fragment>
|
|
6066
6094
|
|
|
6067
6095
|
}
|
|
6068
|
-
`,
|
|
6096
|
+
`, kl = {
|
|
6069
6097
|
uniforms: {
|
|
6070
6098
|
diffuse: {
|
|
6071
6099
|
value: new p.Color()
|
|
@@ -6074,8 +6102,8 @@ const Rl = `
|
|
|
6074
6102
|
value: 1
|
|
6075
6103
|
}
|
|
6076
6104
|
},
|
|
6077
|
-
vertexShader:
|
|
6078
|
-
fragmentShader:
|
|
6105
|
+
vertexShader: Ml,
|
|
6106
|
+
fragmentShader: Ll
|
|
6079
6107
|
}, Cl = `
|
|
6080
6108
|
#include <common>
|
|
6081
6109
|
#include <color_pars_vertex>
|
|
@@ -6307,24 +6335,24 @@ const Rl = `
|
|
|
6307
6335
|
#include <premultiplied_alpha_fragment>
|
|
6308
6336
|
|
|
6309
6337
|
}
|
|
6310
|
-
`,
|
|
6338
|
+
`, Dl = {
|
|
6311
6339
|
linewidth: { value: 1 },
|
|
6312
6340
|
resolution: { value: new p.Vector2(1, 1) },
|
|
6313
6341
|
dashScale: { value: 1 },
|
|
6314
6342
|
dashSize: { value: 1 },
|
|
6315
6343
|
gapSize: { value: 1 },
|
|
6316
6344
|
opacity: { value: 1 }
|
|
6317
|
-
},
|
|
6318
|
-
uniforms: p.UniformsUtils.merge([p.UniformsLib.common, p.UniformsLib.fog,
|
|
6345
|
+
}, Us = {
|
|
6346
|
+
uniforms: p.UniformsUtils.merge([p.UniformsLib.common, p.UniformsLib.fog, Dl]),
|
|
6319
6347
|
vertexShader: Cl,
|
|
6320
6348
|
fragmentShader: Ol
|
|
6321
6349
|
};
|
|
6322
|
-
class
|
|
6350
|
+
class Il extends p.ShaderMaterial {
|
|
6323
6351
|
constructor(t) {
|
|
6324
6352
|
super({
|
|
6325
|
-
uniforms: p.UniformsUtils.clone(
|
|
6326
|
-
vertexShader:
|
|
6327
|
-
fragmentShader:
|
|
6353
|
+
uniforms: p.UniformsUtils.clone(Us.uniforms),
|
|
6354
|
+
vertexShader: Us.vertexShader,
|
|
6355
|
+
fragmentShader: Us.fragmentShader,
|
|
6328
6356
|
clipping: !0
|
|
6329
6357
|
// required for clipping support
|
|
6330
6358
|
});
|
|
@@ -6383,7 +6411,7 @@ class Dl extends p.ShaderMaterial {
|
|
|
6383
6411
|
}), this.setValues(t);
|
|
6384
6412
|
}
|
|
6385
6413
|
}
|
|
6386
|
-
class
|
|
6414
|
+
class Nl {
|
|
6387
6415
|
constructor(e, t, n, s) {
|
|
6388
6416
|
_(this, "group");
|
|
6389
6417
|
// public mixers: THREE.AnimationMixer[] = []
|
|
@@ -6391,7 +6419,7 @@ class Il {
|
|
|
6391
6419
|
_(this, "viewer");
|
|
6392
6420
|
_(this, "scene");
|
|
6393
6421
|
_(this, "settings");
|
|
6394
|
-
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;
|
|
6395
6423
|
}
|
|
6396
6424
|
/**
|
|
6397
6425
|
* Load the model from the settings URL and add it to the scene.
|
|
@@ -6574,7 +6602,7 @@ class Il {
|
|
|
6574
6602
|
_bake_mesh(e) {
|
|
6575
6603
|
const t = e.geometry.clone().toNonIndexed();
|
|
6576
6604
|
["normal", "uv", "uv2"].forEach((i) => t.deleteAttribute(i));
|
|
6577
|
-
const n =
|
|
6605
|
+
const n = Al(t);
|
|
6578
6606
|
return new p.Mesh(n);
|
|
6579
6607
|
}
|
|
6580
6608
|
/**
|
|
@@ -6601,12 +6629,12 @@ class Il {
|
|
|
6601
6629
|
_generate_threshold_edges(e, t, n, s = 1) {
|
|
6602
6630
|
var i, o;
|
|
6603
6631
|
if (e.geometry && e.geometry.attributes && e.geometry.attributes.position && e.geometry.attributes.position.count > 0) {
|
|
6604
|
-
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({
|
|
6605
6633
|
color: n,
|
|
6606
6634
|
linewidth: s
|
|
6607
6635
|
});
|
|
6608
6636
|
(o = (i = this.viewer).register_resolution_material) == null || o.call(i, l);
|
|
6609
|
-
const d = new
|
|
6637
|
+
const d = new yr(c, l);
|
|
6610
6638
|
return d.userData.is_threshold_edge = !0, d;
|
|
6611
6639
|
}
|
|
6612
6640
|
}
|
|
@@ -6625,20 +6653,20 @@ class Il {
|
|
|
6625
6653
|
*/
|
|
6626
6654
|
_generate_conditional_thick_edges(e, t, n = 1, s = 2) {
|
|
6627
6655
|
var d, u;
|
|
6628
|
-
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(
|
|
6629
6657
|
o
|
|
6630
6658
|
// <-- Accepts custom attributes, OK for Three.js usage
|
|
6631
|
-
), c = new
|
|
6659
|
+
), c = new Il({
|
|
6632
6660
|
color: t,
|
|
6633
6661
|
linewidth: n
|
|
6634
6662
|
});
|
|
6635
6663
|
(u = (d = this.viewer).register_resolution_material) == null || u.call(d, c);
|
|
6636
|
-
const l = new
|
|
6664
|
+
const l = new yr(a, c);
|
|
6637
6665
|
return i.add(l), i.userData.is_conditional_edge = !0, i;
|
|
6638
6666
|
}
|
|
6639
6667
|
// fallback
|
|
6640
6668
|
_generate_conditional_thin_edges(e, t, n = 2) {
|
|
6641
|
-
const s = new p.Group(), i = new
|
|
6669
|
+
const s = new p.Group(), i = new vr(e.geometry, n), o = new p.ShaderMaterial(kl);
|
|
6642
6670
|
o.uniforms.diffuse.value.set(t);
|
|
6643
6671
|
const a = new p.LineSegments(i, o);
|
|
6644
6672
|
return s.add(a), s;
|
|
@@ -6647,7 +6675,7 @@ class Il {
|
|
|
6647
6675
|
this.remove();
|
|
6648
6676
|
}
|
|
6649
6677
|
}
|
|
6650
|
-
class
|
|
6678
|
+
class Pl extends wi {
|
|
6651
6679
|
/**
|
|
6652
6680
|
* Constructs a new glTF loader.
|
|
6653
6681
|
*
|
|
@@ -6655,39 +6683,39 @@ class Nl extends bi {
|
|
|
6655
6683
|
*/
|
|
6656
6684
|
constructor(e) {
|
|
6657
6685
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
6658
|
-
return new jl(t);
|
|
6659
|
-
}), this.register(function(t) {
|
|
6660
6686
|
return new Bl(t);
|
|
6661
6687
|
}), this.register(function(t) {
|
|
6662
|
-
return new
|
|
6688
|
+
return new Hl(t);
|
|
6663
6689
|
}), this.register(function(t) {
|
|
6664
6690
|
return new ql(t);
|
|
6665
6691
|
}), this.register(function(t) {
|
|
6666
6692
|
return new Jl(t);
|
|
6667
6693
|
}), this.register(function(t) {
|
|
6668
|
-
return new
|
|
6694
|
+
return new Ql(t);
|
|
6669
6695
|
}), this.register(function(t) {
|
|
6670
6696
|
return new Gl(t);
|
|
6671
6697
|
}), this.register(function(t) {
|
|
6672
6698
|
return new Zl(t);
|
|
6673
6699
|
}), this.register(function(t) {
|
|
6674
6700
|
return new Wl(t);
|
|
6675
|
-
}), this.register(function(t) {
|
|
6676
|
-
return new Fl(t);
|
|
6677
6701
|
}), this.register(function(t) {
|
|
6678
6702
|
return new Xl(t);
|
|
6679
6703
|
}), this.register(function(t) {
|
|
6680
|
-
return new
|
|
6681
|
-
}), this.register(function(t) {
|
|
6682
|
-
return new Yl(t);
|
|
6704
|
+
return new jl(t);
|
|
6683
6705
|
}), this.register(function(t) {
|
|
6684
6706
|
return new $l(t);
|
|
6685
6707
|
}), this.register(function(t) {
|
|
6686
|
-
return new
|
|
6708
|
+
return new Vl(t);
|
|
6687
6709
|
}), this.register(function(t) {
|
|
6688
|
-
return new
|
|
6710
|
+
return new Kl(t);
|
|
6711
|
+
}), this.register(function(t) {
|
|
6712
|
+
return new Yl(t);
|
|
6713
|
+
}), this.register(function(t) {
|
|
6714
|
+
return new Ul(t);
|
|
6689
6715
|
}), this.register(function(t) {
|
|
6690
6716
|
return new ed(t);
|
|
6717
|
+
}), this.register(function(t) {
|
|
6718
|
+
return new td(t);
|
|
6691
6719
|
});
|
|
6692
6720
|
}
|
|
6693
6721
|
/**
|
|
@@ -6787,9 +6815,9 @@ class Nl extends bi {
|
|
|
6787
6815
|
if (typeof e == "string")
|
|
6788
6816
|
i = JSON.parse(e);
|
|
6789
6817
|
else if (e instanceof ArrayBuffer)
|
|
6790
|
-
if (c.decode(new Uint8Array(e, 0, 4)) ===
|
|
6818
|
+
if (c.decode(new Uint8Array(e, 0, 4)) === co) {
|
|
6791
6819
|
try {
|
|
6792
|
-
o[K.KHR_BINARY_GLTF] = new
|
|
6820
|
+
o[K.KHR_BINARY_GLTF] = new nd(e);
|
|
6793
6821
|
} catch (u) {
|
|
6794
6822
|
s && s(u);
|
|
6795
6823
|
return;
|
|
@@ -6803,7 +6831,7 @@ class Nl extends bi {
|
|
|
6803
6831
|
s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
6804
6832
|
return;
|
|
6805
6833
|
}
|
|
6806
|
-
const l = new
|
|
6834
|
+
const l = new pd(i, {
|
|
6807
6835
|
path: t || this.resourcePath || "",
|
|
6808
6836
|
crossOrigin: this.crossOrigin,
|
|
6809
6837
|
requestHeader: this.requestHeader,
|
|
@@ -6821,16 +6849,16 @@ class Nl extends bi {
|
|
|
6821
6849
|
const u = i.extensionsUsed[d], h = i.extensionsRequired || [];
|
|
6822
6850
|
switch (u) {
|
|
6823
6851
|
case K.KHR_MATERIALS_UNLIT:
|
|
6824
|
-
o[u] = new
|
|
6852
|
+
o[u] = new Fl();
|
|
6825
6853
|
break;
|
|
6826
6854
|
case K.KHR_DRACO_MESH_COMPRESSION:
|
|
6827
|
-
o[u] = new
|
|
6855
|
+
o[u] = new sd(i, this.dracoLoader);
|
|
6828
6856
|
break;
|
|
6829
6857
|
case K.KHR_TEXTURE_TRANSFORM:
|
|
6830
|
-
o[u] = new
|
|
6858
|
+
o[u] = new id();
|
|
6831
6859
|
break;
|
|
6832
6860
|
case K.KHR_MESH_QUANTIZATION:
|
|
6833
|
-
o[u] = new
|
|
6861
|
+
o[u] = new rd();
|
|
6834
6862
|
break;
|
|
6835
6863
|
default:
|
|
6836
6864
|
h.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
@@ -6853,7 +6881,7 @@ class Nl extends bi {
|
|
|
6853
6881
|
});
|
|
6854
6882
|
}
|
|
6855
6883
|
}
|
|
6856
|
-
function
|
|
6884
|
+
function zl() {
|
|
6857
6885
|
let r = {};
|
|
6858
6886
|
return {
|
|
6859
6887
|
get: function(e) {
|
|
@@ -6894,7 +6922,7 @@ const K = {
|
|
|
6894
6922
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
6895
6923
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
6896
6924
|
};
|
|
6897
|
-
class
|
|
6925
|
+
class Ul {
|
|
6898
6926
|
constructor(e) {
|
|
6899
6927
|
this.parser = e, this.name = K.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
6900
6928
|
}
|
|
@@ -6916,13 +6944,13 @@ class zl {
|
|
|
6916
6944
|
const u = c.range !== void 0 ? c.range : 0;
|
|
6917
6945
|
switch (c.type) {
|
|
6918
6946
|
case "directional":
|
|
6919
|
-
l = new
|
|
6947
|
+
l = new Vo(d), l.target.position.set(0, 0, -1), l.add(l.target);
|
|
6920
6948
|
break;
|
|
6921
6949
|
case "point":
|
|
6922
|
-
l = new
|
|
6950
|
+
l = new jr(d), l.distance = u;
|
|
6923
6951
|
break;
|
|
6924
6952
|
case "spot":
|
|
6925
|
-
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);
|
|
6926
6954
|
break;
|
|
6927
6955
|
default:
|
|
6928
6956
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);
|
|
@@ -6940,7 +6968,7 @@ class zl {
|
|
|
6940
6968
|
});
|
|
6941
6969
|
}
|
|
6942
6970
|
}
|
|
6943
|
-
class
|
|
6971
|
+
class Fl {
|
|
6944
6972
|
constructor() {
|
|
6945
6973
|
this.name = K.KHR_MATERIALS_UNLIT;
|
|
6946
6974
|
}
|
|
@@ -6961,7 +6989,7 @@ class Ul {
|
|
|
6961
6989
|
return Promise.all(s);
|
|
6962
6990
|
}
|
|
6963
6991
|
}
|
|
6964
|
-
class
|
|
6992
|
+
class jl {
|
|
6965
6993
|
constructor(e) {
|
|
6966
6994
|
this.parser = e, this.name = K.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
6967
6995
|
}
|
|
@@ -6973,7 +7001,7 @@ class Fl {
|
|
|
6973
7001
|
return i !== void 0 && (t.emissiveIntensity = i), Promise.resolve();
|
|
6974
7002
|
}
|
|
6975
7003
|
}
|
|
6976
|
-
class
|
|
7004
|
+
class Bl {
|
|
6977
7005
|
constructor(e) {
|
|
6978
7006
|
this.parser = e, this.name = K.KHR_MATERIALS_CLEARCOAT;
|
|
6979
7007
|
}
|
|
@@ -6988,12 +7016,12 @@ class jl {
|
|
|
6988
7016
|
const i = [], o = s.extensions[this.name];
|
|
6989
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)) {
|
|
6990
7018
|
const a = o.clearcoatNormalTexture.scale;
|
|
6991
|
-
t.clearcoatNormalScale = new
|
|
7019
|
+
t.clearcoatNormalScale = new ke(a, a);
|
|
6992
7020
|
}
|
|
6993
7021
|
return Promise.all(i);
|
|
6994
7022
|
}
|
|
6995
7023
|
}
|
|
6996
|
-
class
|
|
7024
|
+
class Hl {
|
|
6997
7025
|
constructor(e) {
|
|
6998
7026
|
this.parser = e, this.name = K.KHR_MATERIALS_DISPERSION;
|
|
6999
7027
|
}
|
|
@@ -7009,7 +7037,7 @@ class Bl {
|
|
|
7009
7037
|
return t.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
|
|
7010
7038
|
}
|
|
7011
7039
|
}
|
|
7012
|
-
class
|
|
7040
|
+
class Vl {
|
|
7013
7041
|
constructor(e) {
|
|
7014
7042
|
this.parser = e, this.name = K.KHR_MATERIALS_IRIDESCENCE;
|
|
7015
7043
|
}
|
|
@@ -7025,7 +7053,7 @@ class Hl {
|
|
|
7025
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);
|
|
7026
7054
|
}
|
|
7027
7055
|
}
|
|
7028
|
-
class
|
|
7056
|
+
class Gl {
|
|
7029
7057
|
constructor(e) {
|
|
7030
7058
|
this.parser = e, this.name = K.KHR_MATERIALS_SHEEN;
|
|
7031
7059
|
}
|
|
@@ -7047,7 +7075,7 @@ class Vl {
|
|
|
7047
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);
|
|
7048
7076
|
}
|
|
7049
7077
|
}
|
|
7050
|
-
class
|
|
7078
|
+
class Zl {
|
|
7051
7079
|
constructor(e) {
|
|
7052
7080
|
this.parser = e, this.name = K.KHR_MATERIALS_TRANSMISSION;
|
|
7053
7081
|
}
|
|
@@ -7063,7 +7091,7 @@ class Gl {
|
|
|
7063
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);
|
|
7064
7092
|
}
|
|
7065
7093
|
}
|
|
7066
|
-
class
|
|
7094
|
+
class Wl {
|
|
7067
7095
|
constructor(e) {
|
|
7068
7096
|
this.parser = e, this.name = K.KHR_MATERIALS_VOLUME;
|
|
7069
7097
|
}
|
|
@@ -7081,7 +7109,7 @@ class Zl {
|
|
|
7081
7109
|
return t.attenuationColor = new lt().setRGB(a[0], a[1], a[2], Pe), Promise.all(i);
|
|
7082
7110
|
}
|
|
7083
7111
|
}
|
|
7084
|
-
class
|
|
7112
|
+
class Xl {
|
|
7085
7113
|
constructor(e) {
|
|
7086
7114
|
this.parser = e, this.name = K.KHR_MATERIALS_IOR;
|
|
7087
7115
|
}
|
|
@@ -7097,7 +7125,7 @@ class Wl {
|
|
|
7097
7125
|
return t.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
|
|
7098
7126
|
}
|
|
7099
7127
|
}
|
|
7100
|
-
class
|
|
7128
|
+
class $l {
|
|
7101
7129
|
constructor(e) {
|
|
7102
7130
|
this.parser = e, this.name = K.KHR_MATERIALS_SPECULAR;
|
|
7103
7131
|
}
|
|
@@ -7115,7 +7143,7 @@ class Xl {
|
|
|
7115
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);
|
|
7116
7144
|
}
|
|
7117
7145
|
}
|
|
7118
|
-
class
|
|
7146
|
+
class Yl {
|
|
7119
7147
|
constructor(e) {
|
|
7120
7148
|
this.parser = e, this.name = K.EXT_MATERIALS_BUMP;
|
|
7121
7149
|
}
|
|
@@ -7131,7 +7159,7 @@ class $l {
|
|
|
7131
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);
|
|
7132
7160
|
}
|
|
7133
7161
|
}
|
|
7134
|
-
class
|
|
7162
|
+
class Kl {
|
|
7135
7163
|
constructor(e) {
|
|
7136
7164
|
this.parser = e, this.name = K.KHR_MATERIALS_ANISOTROPY;
|
|
7137
7165
|
}
|
|
@@ -7147,7 +7175,7 @@ class Yl {
|
|
|
7147
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);
|
|
7148
7176
|
}
|
|
7149
7177
|
}
|
|
7150
|
-
class
|
|
7178
|
+
class ql {
|
|
7151
7179
|
constructor(e) {
|
|
7152
7180
|
this.parser = e, this.name = K.KHR_TEXTURE_BASISU;
|
|
7153
7181
|
}
|
|
@@ -7164,7 +7192,7 @@ class Kl {
|
|
|
7164
7192
|
return t.loadTextureImage(e, i.source, o);
|
|
7165
7193
|
}
|
|
7166
7194
|
}
|
|
7167
|
-
class
|
|
7195
|
+
class Jl {
|
|
7168
7196
|
constructor(e) {
|
|
7169
7197
|
this.parser = e, this.name = K.EXT_TEXTURE_WEBP, this.isSupported = null;
|
|
7170
7198
|
}
|
|
@@ -7194,7 +7222,7 @@ class ql {
|
|
|
7194
7222
|
})), this.isSupported;
|
|
7195
7223
|
}
|
|
7196
7224
|
}
|
|
7197
|
-
class
|
|
7225
|
+
class Ql {
|
|
7198
7226
|
constructor(e) {
|
|
7199
7227
|
this.parser = e, this.name = K.EXT_TEXTURE_AVIF, this.isSupported = null;
|
|
7200
7228
|
}
|
|
@@ -7224,7 +7252,7 @@ class Jl {
|
|
|
7224
7252
|
})), this.isSupported;
|
|
7225
7253
|
}
|
|
7226
7254
|
}
|
|
7227
|
-
class
|
|
7255
|
+
class ed {
|
|
7228
7256
|
constructor(e) {
|
|
7229
7257
|
this.name = K.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
7230
7258
|
}
|
|
@@ -7250,7 +7278,7 @@ class Ql {
|
|
|
7250
7278
|
return null;
|
|
7251
7279
|
}
|
|
7252
7280
|
}
|
|
7253
|
-
class
|
|
7281
|
+
class td {
|
|
7254
7282
|
constructor(e) {
|
|
7255
7283
|
this.name = K.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
7256
7284
|
}
|
|
@@ -7268,22 +7296,22 @@ class ed {
|
|
|
7268
7296
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((l) => {
|
|
7269
7297
|
const d = l.pop(), u = d.isGroup ? d.children : [d], h = l[0].count, f = [];
|
|
7270
7298
|
for (const g of u) {
|
|
7271
|
-
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);
|
|
7272
7300
|
for (let v = 0; v < h; v++)
|
|
7273
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));
|
|
7274
7302
|
for (const v in c)
|
|
7275
7303
|
if (v === "_COLOR_0") {
|
|
7276
7304
|
const P = c[v];
|
|
7277
|
-
T.instanceColor = new
|
|
7305
|
+
T.instanceColor = new Zo(P.array, P.itemSize, P.normalized);
|
|
7278
7306
|
} else v !== "TRANSLATION" && v !== "ROTATION" && v !== "SCALE" && g.geometry.setAttribute(v, c[v]);
|
|
7279
|
-
|
|
7307
|
+
Hr.prototype.copy.call(T, g), this.parser.assignFinalMaterial(T), f.push(T);
|
|
7280
7308
|
}
|
|
7281
7309
|
return d.isGroup ? (d.clear(), d.add(...f), d) : f[0];
|
|
7282
7310
|
}));
|
|
7283
7311
|
}
|
|
7284
7312
|
}
|
|
7285
|
-
const
|
|
7286
|
-
class
|
|
7313
|
+
const co = "glTF", tn = 12, xr = { JSON: 1313821514, BIN: 5130562 };
|
|
7314
|
+
class nd {
|
|
7287
7315
|
constructor(e) {
|
|
7288
7316
|
this.name = K.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
7289
7317
|
const t = new DataView(e, 0, tn), n = new TextDecoder();
|
|
@@ -7291,7 +7319,7 @@ class td {
|
|
|
7291
7319
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
7292
7320
|
version: t.getUint32(4, !0),
|
|
7293
7321
|
length: t.getUint32(8, !0)
|
|
7294
|
-
}, this.header.magic !==
|
|
7322
|
+
}, this.header.magic !== co)
|
|
7295
7323
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
7296
7324
|
if (this.header.version < 2)
|
|
7297
7325
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
@@ -7301,10 +7329,10 @@ class td {
|
|
|
7301
7329
|
const a = i.getUint32(o, !0);
|
|
7302
7330
|
o += 4;
|
|
7303
7331
|
const c = i.getUint32(o, !0);
|
|
7304
|
-
if (o += 4, c ===
|
|
7332
|
+
if (o += 4, c === xr.JSON) {
|
|
7305
7333
|
const l = new Uint8Array(e, tn + o, a);
|
|
7306
7334
|
this.content = n.decode(l);
|
|
7307
|
-
} else if (c ===
|
|
7335
|
+
} else if (c === xr.BIN) {
|
|
7308
7336
|
const l = tn + o;
|
|
7309
7337
|
this.body = e.slice(l, l + a);
|
|
7310
7338
|
}
|
|
@@ -7314,7 +7342,7 @@ class td {
|
|
|
7314
7342
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
7315
7343
|
}
|
|
7316
7344
|
}
|
|
7317
|
-
class
|
|
7345
|
+
class sd {
|
|
7318
7346
|
constructor(e, t) {
|
|
7319
7347
|
if (!t)
|
|
7320
7348
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
@@ -7323,11 +7351,11 @@ class nd {
|
|
|
7323
7351
|
decodePrimitive(e, t) {
|
|
7324
7352
|
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, c = {}, l = {};
|
|
7325
7353
|
for (const d in o) {
|
|
7326
|
-
const u =
|
|
7354
|
+
const u = ci[d] || d.toLowerCase();
|
|
7327
7355
|
a[u] = o[d];
|
|
7328
7356
|
}
|
|
7329
7357
|
for (const d in e.attributes) {
|
|
7330
|
-
const u =
|
|
7358
|
+
const u = ci[d] || d.toLowerCase();
|
|
7331
7359
|
if (o[d] !== void 0) {
|
|
7332
7360
|
const h = n.accessors[e.attributes[d]], f = $t[h.componentType];
|
|
7333
7361
|
l[u] = f.name, c[u] = h.normalized === !0;
|
|
@@ -7346,7 +7374,7 @@ class nd {
|
|
|
7346
7374
|
});
|
|
7347
7375
|
}
|
|
7348
7376
|
}
|
|
7349
|
-
class
|
|
7377
|
+
class id {
|
|
7350
7378
|
constructor() {
|
|
7351
7379
|
this.name = K.KHR_TEXTURE_TRANSFORM;
|
|
7352
7380
|
}
|
|
@@ -7354,12 +7382,12 @@ class sd {
|
|
|
7354
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;
|
|
7355
7383
|
}
|
|
7356
7384
|
}
|
|
7357
|
-
class
|
|
7385
|
+
class rd {
|
|
7358
7386
|
constructor() {
|
|
7359
7387
|
this.name = K.KHR_MESH_QUANTIZATION;
|
|
7360
7388
|
}
|
|
7361
7389
|
}
|
|
7362
|
-
class
|
|
7390
|
+
class lo extends ma {
|
|
7363
7391
|
constructor(e, t, n, s) {
|
|
7364
7392
|
super(e, t, n, s);
|
|
7365
7393
|
}
|
|
@@ -7378,11 +7406,11 @@ class co extends fa {
|
|
|
7378
7406
|
return i;
|
|
7379
7407
|
}
|
|
7380
7408
|
}
|
|
7381
|
-
const
|
|
7382
|
-
class
|
|
7409
|
+
const od = new is();
|
|
7410
|
+
class ad extends lo {
|
|
7383
7411
|
interpolate_(e, t, n, s) {
|
|
7384
7412
|
const i = super.interpolate_(e, t, n, s);
|
|
7385
|
-
return
|
|
7413
|
+
return od.fromArray(i).normalize().toArray(i), i;
|
|
7386
7414
|
}
|
|
7387
7415
|
}
|
|
7388
7416
|
const Ie = {
|
|
@@ -7400,18 +7428,18 @@ const Ie = {
|
|
|
7400
7428
|
5123: Uint16Array,
|
|
7401
7429
|
5125: Uint32Array,
|
|
7402
7430
|
5126: Float32Array
|
|
7403
|
-
}, xr = {
|
|
7404
|
-
9728: Vr,
|
|
7405
|
-
9729: Yt,
|
|
7406
|
-
9984: Ko,
|
|
7407
|
-
9985: Yo,
|
|
7408
|
-
9986: $o,
|
|
7409
|
-
9987: Hr
|
|
7410
7431
|
}, br = {
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
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 = {
|
|
7415
7443
|
SCALAR: 1,
|
|
7416
7444
|
VEC2: 2,
|
|
7417
7445
|
VEC3: 3,
|
|
@@ -7419,7 +7447,7 @@ const Ie = {
|
|
|
7419
7447
|
MAT2: 4,
|
|
7420
7448
|
MAT3: 9,
|
|
7421
7449
|
MAT4: 16
|
|
7422
|
-
},
|
|
7450
|
+
}, ci = {
|
|
7423
7451
|
POSITION: "position",
|
|
7424
7452
|
NORMAL: "normal",
|
|
7425
7453
|
TANGENT: "tangent",
|
|
@@ -7435,26 +7463,26 @@ const Ie = {
|
|
|
7435
7463
|
translation: "position",
|
|
7436
7464
|
rotation: "quaternion",
|
|
7437
7465
|
weights: "morphTargetInfluences"
|
|
7438
|
-
},
|
|
7466
|
+
}, cd = {
|
|
7439
7467
|
CUBICSPLINE: void 0,
|
|
7440
7468
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
7441
7469
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
7442
|
-
LINEAR:
|
|
7443
|
-
STEP:
|
|
7444
|
-
},
|
|
7470
|
+
LINEAR: Wr,
|
|
7471
|
+
STEP: ha
|
|
7472
|
+
}, js = {
|
|
7445
7473
|
OPAQUE: "OPAQUE",
|
|
7446
7474
|
MASK: "MASK",
|
|
7447
7475
|
BLEND: "BLEND"
|
|
7448
7476
|
};
|
|
7449
|
-
function
|
|
7450
|
-
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new
|
|
7477
|
+
function ld(r) {
|
|
7478
|
+
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new rs({
|
|
7451
7479
|
color: 16777215,
|
|
7452
7480
|
emissive: 0,
|
|
7453
7481
|
metalness: 1,
|
|
7454
7482
|
roughness: 1,
|
|
7455
7483
|
transparent: !1,
|
|
7456
7484
|
depthTest: !0,
|
|
7457
|
-
side:
|
|
7485
|
+
side: fa
|
|
7458
7486
|
})), r.DefaultMaterial;
|
|
7459
7487
|
}
|
|
7460
7488
|
function bt(r, e, t) {
|
|
@@ -7464,7 +7492,7 @@ function bt(r, e, t) {
|
|
|
7464
7492
|
function it(r, e) {
|
|
7465
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));
|
|
7466
7494
|
}
|
|
7467
|
-
function
|
|
7495
|
+
function dd(r, e, t) {
|
|
7468
7496
|
let n = !1, s = !1, i = !1;
|
|
7469
7497
|
for (let l = 0, d = e.length; l < d; l++) {
|
|
7470
7498
|
const u = e[l];
|
|
@@ -7496,7 +7524,7 @@ function ld(r, e, t) {
|
|
|
7496
7524
|
return n && (r.morphAttributes.position = d), s && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = h), r.morphTargetsRelative = !0, r;
|
|
7497
7525
|
});
|
|
7498
7526
|
}
|
|
7499
|
-
function
|
|
7527
|
+
function ud(r, e) {
|
|
7500
7528
|
if (r.updateMorphTargets(), e.weights !== void 0)
|
|
7501
7529
|
for (let t = 0, n = e.weights.length; t < n; t++)
|
|
7502
7530
|
r.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -7510,22 +7538,22 @@ function dd(r, e) {
|
|
|
7510
7538
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
7511
7539
|
}
|
|
7512
7540
|
}
|
|
7513
|
-
function
|
|
7541
|
+
function hd(r) {
|
|
7514
7542
|
let e;
|
|
7515
7543
|
const t = r.extensions && r.extensions[K.KHR_DRACO_MESH_COMPRESSION];
|
|
7516
|
-
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)
|
|
7517
7545
|
for (let n = 0, s = r.targets.length; n < s; n++)
|
|
7518
|
-
e += ":" +
|
|
7546
|
+
e += ":" + Bs(r.targets[n]);
|
|
7519
7547
|
return e;
|
|
7520
7548
|
}
|
|
7521
|
-
function
|
|
7549
|
+
function Bs(r) {
|
|
7522
7550
|
let e = "";
|
|
7523
7551
|
const t = Object.keys(r).sort();
|
|
7524
7552
|
for (let n = 0, s = t.length; n < s; n++)
|
|
7525
7553
|
e += t[n] + ":" + r[t[n]] + ";";
|
|
7526
7554
|
return e;
|
|
7527
7555
|
}
|
|
7528
|
-
function
|
|
7556
|
+
function li(r) {
|
|
7529
7557
|
switch (r) {
|
|
7530
7558
|
case Int8Array:
|
|
7531
7559
|
return 1 / 127;
|
|
@@ -7539,13 +7567,13 @@ function ci(r) {
|
|
|
7539
7567
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
7540
7568
|
}
|
|
7541
7569
|
}
|
|
7542
|
-
function
|
|
7570
|
+
function fd(r) {
|
|
7543
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";
|
|
7544
7572
|
}
|
|
7545
|
-
const
|
|
7546
|
-
class
|
|
7573
|
+
const md = new pn();
|
|
7574
|
+
class pd {
|
|
7547
7575
|
constructor(e = {}, t = {}) {
|
|
7548
|
-
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 = {};
|
|
7549
7577
|
let n = !1, s = -1, i = !1, o = -1;
|
|
7550
7578
|
if (typeof navigator < "u") {
|
|
7551
7579
|
const a = navigator.userAgent;
|
|
@@ -7553,7 +7581,7 @@ class md {
|
|
|
7553
7581
|
const c = a.match(/Version\/(\d+)/);
|
|
7554
7582
|
s = n && c ? parseInt(c[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
7555
7583
|
}
|
|
7556
|
-
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);
|
|
7557
7585
|
}
|
|
7558
7586
|
setExtensions(e) {
|
|
7559
7587
|
this.extensions = e;
|
|
@@ -7793,21 +7821,21 @@ class md {
|
|
|
7793
7821
|
loadAccessor(e) {
|
|
7794
7822
|
const t = this, n = this.json, s = this.json.accessors[e];
|
|
7795
7823
|
if (s.bufferView === void 0 && s.sparse === void 0) {
|
|
7796
|
-
const o =
|
|
7824
|
+
const o = Fs[s.type], a = $t[s.componentType], c = s.normalized === !0, l = new a(s.count * o);
|
|
7797
7825
|
return Promise.resolve(new at(l, o, c));
|
|
7798
7826
|
}
|
|
7799
7827
|
const i = [];
|
|
7800
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) {
|
|
7801
|
-
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;
|
|
7802
7830
|
let y, x;
|
|
7803
7831
|
if (f && f !== u) {
|
|
7804
7832
|
const b = Math.floor(h / f), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + b + ":" + s.count;
|
|
7805
7833
|
let T = t.cache.get(w);
|
|
7806
|
-
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);
|
|
7807
7835
|
} else
|
|
7808
7836
|
a === null ? y = new l(s.count * c) : y = new l(a, h, s.count * c), x = new at(y, c, g);
|
|
7809
7837
|
if (s.sparse !== void 0) {
|
|
7810
|
-
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);
|
|
7811
7839
|
a !== null && (x = new at(x.array.slice(), x.itemSize, x.normalized)), x.normalized = !1;
|
|
7812
7840
|
for (let F = 0, L = P.length; F < L; F++) {
|
|
7813
7841
|
const R = P[F];
|
|
@@ -7841,7 +7869,7 @@ class md {
|
|
|
7841
7869
|
const l = this.loadImageSource(t, n).then(function(d) {
|
|
7842
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);
|
|
7843
7871
|
const h = (i.samplers || {})[o.sampler] || {};
|
|
7844
|
-
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;
|
|
7845
7873
|
}).catch(function() {
|
|
7846
7874
|
return null;
|
|
7847
7875
|
});
|
|
@@ -7865,12 +7893,12 @@ class md {
|
|
|
7865
7893
|
return new Promise(function(h, f) {
|
|
7866
7894
|
let g = h;
|
|
7867
7895
|
t.isImageBitmapLoader === !0 && (g = function(y) {
|
|
7868
|
-
const x = new
|
|
7896
|
+
const x = new Qi(y);
|
|
7869
7897
|
x.needsUpdate = !0, h(x);
|
|
7870
7898
|
}), t.load(fn.resolveURL(u, i.path), g, void 0, f);
|
|
7871
7899
|
});
|
|
7872
7900
|
}).then(function(u) {
|
|
7873
|
-
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;
|
|
7874
7902
|
}).catch(function(u) {
|
|
7875
7903
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", c), u;
|
|
7876
7904
|
});
|
|
@@ -7917,11 +7945,11 @@ class md {
|
|
|
7917
7945
|
if (e.isPoints) {
|
|
7918
7946
|
const a = "PointsMaterial:" + n.uuid;
|
|
7919
7947
|
let c = this.cache.get(a);
|
|
7920
|
-
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;
|
|
7921
7949
|
} else if (e.isLine) {
|
|
7922
7950
|
const a = "LineBasicMaterial:" + n.uuid;
|
|
7923
7951
|
let c = this.cache.get(a);
|
|
7924
|
-
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;
|
|
7925
7953
|
}
|
|
7926
7954
|
if (s || i || o) {
|
|
7927
7955
|
let a = "ClonedMaterial:" + n.uuid + ":";
|
|
@@ -7932,7 +7960,7 @@ class md {
|
|
|
7932
7960
|
e.material = n;
|
|
7933
7961
|
}
|
|
7934
7962
|
getMaterialType() {
|
|
7935
|
-
return
|
|
7963
|
+
return rs;
|
|
7936
7964
|
}
|
|
7937
7965
|
/**
|
|
7938
7966
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -7960,9 +7988,9 @@ class md {
|
|
|
7960
7988
|
return h.extendMaterialParams && h.extendMaterialParams(e, a);
|
|
7961
7989
|
})));
|
|
7962
7990
|
}
|
|
7963
|
-
i.doubleSided === !0 && (a.side =
|
|
7964
|
-
const d = i.alphaMode ||
|
|
7965
|
-
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)) {
|
|
7966
7994
|
const u = i.normalTexture.scale;
|
|
7967
7995
|
a.normalScale.set(u, u);
|
|
7968
7996
|
}
|
|
@@ -7983,7 +8011,7 @@ class md {
|
|
|
7983
8011
|
* @return {string}
|
|
7984
8012
|
*/
|
|
7985
8013
|
createUniqueName(e) {
|
|
7986
|
-
const t =
|
|
8014
|
+
const t = na.sanitizeNodeName(e || "");
|
|
7987
8015
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
7988
8016
|
}
|
|
7989
8017
|
/**
|
|
@@ -7999,17 +8027,17 @@ class md {
|
|
|
7999
8027
|
const t = this, n = this.extensions, s = this.primitiveCache;
|
|
8000
8028
|
function i(a) {
|
|
8001
8029
|
return n[K.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(c) {
|
|
8002
|
-
return
|
|
8030
|
+
return Er(c, a, t);
|
|
8003
8031
|
});
|
|
8004
8032
|
}
|
|
8005
8033
|
const o = [];
|
|
8006
8034
|
for (let a = 0, c = e.length; a < c; a++) {
|
|
8007
|
-
const l = e[a], d =
|
|
8035
|
+
const l = e[a], d = hd(l), u = s[d];
|
|
8008
8036
|
if (u)
|
|
8009
8037
|
o.push(u.promise);
|
|
8010
8038
|
else {
|
|
8011
8039
|
let h;
|
|
8012
|
-
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);
|
|
8013
8041
|
}
|
|
8014
8042
|
}
|
|
8015
8043
|
return Promise.all(o);
|
|
@@ -8024,7 +8052,7 @@ class md {
|
|
|
8024
8052
|
loadMesh(e) {
|
|
8025
8053
|
const t = this, n = this.json, s = this.extensions, i = n.meshes[e], o = i.primitives, a = [];
|
|
8026
8054
|
for (let c = 0, l = o.length; c < l; c++) {
|
|
8027
|
-
const d = o[c].material === void 0 ?
|
|
8055
|
+
const d = o[c].material === void 0 ? ld(this.cache) : this.getDependency("material", o[c].material);
|
|
8028
8056
|
a.push(d);
|
|
8029
8057
|
}
|
|
8030
8058
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
|
|
@@ -8034,18 +8062,18 @@ class md {
|
|
|
8034
8062
|
let b;
|
|
8035
8063
|
const w = l[f];
|
|
8036
8064
|
if (x.mode === Ie.TRIANGLES || x.mode === Ie.TRIANGLE_STRIP || x.mode === Ie.TRIANGLE_FAN || x.mode === void 0)
|
|
8037
|
-
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));
|
|
8038
8066
|
else if (x.mode === Ie.LINES)
|
|
8039
|
-
b = new
|
|
8067
|
+
b = new Zr(y, w);
|
|
8040
8068
|
else if (x.mode === Ie.LINE_STRIP)
|
|
8041
|
-
b = new sa(y, w);
|
|
8042
|
-
else if (x.mode === Ie.LINE_LOOP)
|
|
8043
8069
|
b = new ia(y, w);
|
|
8044
|
-
else if (x.mode === Ie.
|
|
8070
|
+
else if (x.mode === Ie.LINE_LOOP)
|
|
8045
8071
|
b = new ra(y, w);
|
|
8072
|
+
else if (x.mode === Ie.POINTS)
|
|
8073
|
+
b = new oa(y, w);
|
|
8046
8074
|
else
|
|
8047
8075
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + x.mode);
|
|
8048
|
-
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);
|
|
8049
8077
|
}
|
|
8050
8078
|
for (let f = 0, g = u.length; f < g; f++)
|
|
8051
8079
|
t.associations.set(u[f], {
|
|
@@ -8054,7 +8082,7 @@ class md {
|
|
|
8054
8082
|
});
|
|
8055
8083
|
if (u.length === 1)
|
|
8056
8084
|
return i.extensions && bt(s, u[0], i), u[0];
|
|
8057
|
-
const h = new
|
|
8085
|
+
const h = new ks();
|
|
8058
8086
|
i.extensions && bt(s, h, i), t.associations.set(h, { meshes: e });
|
|
8059
8087
|
for (let f = 0, g = u.length; f < g; f++)
|
|
8060
8088
|
h.add(u[f]);
|
|
@@ -8075,7 +8103,7 @@ class md {
|
|
|
8075
8103
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
8076
8104
|
return;
|
|
8077
8105
|
}
|
|
8078
|
-
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);
|
|
8079
8107
|
}
|
|
8080
8108
|
/**
|
|
8081
8109
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -8099,7 +8127,7 @@ class md {
|
|
|
8099
8127
|
} else
|
|
8100
8128
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[l]);
|
|
8101
8129
|
}
|
|
8102
|
-
return new
|
|
8130
|
+
return new la(a, c);
|
|
8103
8131
|
});
|
|
8104
8132
|
}
|
|
8105
8133
|
/**
|
|
@@ -8129,10 +8157,10 @@ class md {
|
|
|
8129
8157
|
v.updateMatrix && v.updateMatrix();
|
|
8130
8158
|
const R = n._createAnimationTracks(v, P, V, F, L);
|
|
8131
8159
|
if (R)
|
|
8132
|
-
for (let
|
|
8133
|
-
b.push(R[
|
|
8160
|
+
for (let C = 0; C < R.length; C++)
|
|
8161
|
+
b.push(R[C]);
|
|
8134
8162
|
}
|
|
8135
|
-
return new
|
|
8163
|
+
return new da(i, void 0, b);
|
|
8136
8164
|
});
|
|
8137
8165
|
}
|
|
8138
8166
|
createNodeMesh(e) {
|
|
@@ -8165,7 +8193,7 @@ class md {
|
|
|
8165
8193
|
]).then(function(l) {
|
|
8166
8194
|
const d = l[0], u = l[1], h = l[2];
|
|
8167
8195
|
h !== null && d.traverse(function(f) {
|
|
8168
|
-
f.isSkinnedMesh && f.bind(h,
|
|
8196
|
+
f.isSkinnedMesh && f.bind(h, md);
|
|
8169
8197
|
});
|
|
8170
8198
|
for (let f = 0, g = u.length; f < g; f++)
|
|
8171
8199
|
d.add(u[f]);
|
|
@@ -8189,7 +8217,7 @@ class md {
|
|
|
8189
8217
|
a.push(l);
|
|
8190
8218
|
}), this.nodeCache[e] = Promise.all(a).then(function(l) {
|
|
8191
8219
|
let d;
|
|
8192
|
-
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])
|
|
8193
8221
|
for (let u = 0, h = l.length; u < h; u++)
|
|
8194
8222
|
d.add(l[u]);
|
|
8195
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) {
|
|
@@ -8208,7 +8236,7 @@ class md {
|
|
|
8208
8236
|
* @return {Promise<Group>}
|
|
8209
8237
|
*/
|
|
8210
8238
|
loadScene(e) {
|
|
8211
|
-
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();
|
|
8212
8240
|
n.name && (i.name = s.createUniqueName(n.name)), it(i, n), n.extensions && bt(t, i, n);
|
|
8213
8241
|
const o = n.nodes || [], a = [];
|
|
8214
8242
|
for (let c = 0, l = o.length; c < l; c++)
|
|
@@ -8219,7 +8247,7 @@ class md {
|
|
|
8219
8247
|
const l = (d) => {
|
|
8220
8248
|
const u = /* @__PURE__ */ new Map();
|
|
8221
8249
|
for (const [h, f] of s.associations)
|
|
8222
|
-
(h instanceof Ls || h instanceof
|
|
8250
|
+
(h instanceof Ls || h instanceof Qi) && u.set(h, f);
|
|
8223
8251
|
return d.traverse((h) => {
|
|
8224
8252
|
const f = s.associations.get(h);
|
|
8225
8253
|
f != null && u.set(h, f);
|
|
@@ -8236,29 +8264,29 @@ class md {
|
|
|
8236
8264
|
let l;
|
|
8237
8265
|
switch (ht[i.path]) {
|
|
8238
8266
|
case ht.weights:
|
|
8239
|
-
l =
|
|
8267
|
+
l = tr;
|
|
8240
8268
|
break;
|
|
8241
8269
|
case ht.rotation:
|
|
8242
|
-
l =
|
|
8270
|
+
l = nr;
|
|
8243
8271
|
break;
|
|
8244
8272
|
case ht.translation:
|
|
8245
8273
|
case ht.scale:
|
|
8246
|
-
l =
|
|
8274
|
+
l = er;
|
|
8247
8275
|
break;
|
|
8248
8276
|
default:
|
|
8249
8277
|
switch (n.itemSize) {
|
|
8250
8278
|
case 1:
|
|
8251
|
-
l =
|
|
8279
|
+
l = tr;
|
|
8252
8280
|
break;
|
|
8253
8281
|
case 2:
|
|
8254
8282
|
case 3:
|
|
8255
8283
|
default:
|
|
8256
|
-
l =
|
|
8284
|
+
l = er;
|
|
8257
8285
|
break;
|
|
8258
8286
|
}
|
|
8259
8287
|
break;
|
|
8260
8288
|
}
|
|
8261
|
-
const d = s.interpolation !== void 0 ?
|
|
8289
|
+
const d = s.interpolation !== void 0 ? cd[s.interpolation] : Wr, u = this._getArrayFromAccessor(n);
|
|
8262
8290
|
for (let h = 0, f = c.length; h < f; h++) {
|
|
8263
8291
|
const g = new l(
|
|
8264
8292
|
c[h] + "." + ht[i.path],
|
|
@@ -8273,7 +8301,7 @@ class md {
|
|
|
8273
8301
|
_getArrayFromAccessor(e) {
|
|
8274
8302
|
let t = e.array;
|
|
8275
8303
|
if (e.normalized) {
|
|
8276
|
-
const n =
|
|
8304
|
+
const n = li(t.constructor), s = new Float32Array(t.length);
|
|
8277
8305
|
for (let i = 0, o = t.length; i < o; i++)
|
|
8278
8306
|
s[i] = t[i] * n;
|
|
8279
8307
|
t = s;
|
|
@@ -8282,13 +8310,13 @@ class md {
|
|
|
8282
8310
|
}
|
|
8283
8311
|
_createCubicSplineTrackInterpolant(e) {
|
|
8284
8312
|
e.createInterpolant = function(n) {
|
|
8285
|
-
const s = this instanceof
|
|
8313
|
+
const s = this instanceof nr ? ad : lo;
|
|
8286
8314
|
return new s(this.times, this.values, this.getValueSize() / 3, n);
|
|
8287
8315
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
8288
8316
|
}
|
|
8289
8317
|
}
|
|
8290
|
-
function
|
|
8291
|
-
const n = e.attributes, s = new
|
|
8318
|
+
function _d(r, e, t) {
|
|
8319
|
+
const n = e.attributes, s = new ps();
|
|
8292
8320
|
if (n.POSITION !== void 0) {
|
|
8293
8321
|
const a = t.json.accessors[n.POSITION], c = a.min, l = a.max;
|
|
8294
8322
|
if (c !== void 0 && l !== void 0) {
|
|
@@ -8296,7 +8324,7 @@ function pd(r, e, t) {
|
|
|
8296
8324
|
new J(c[0], c[1], c[2]),
|
|
8297
8325
|
new J(l[0], l[1], l[2])
|
|
8298
8326
|
), a.normalized) {
|
|
8299
|
-
const d =
|
|
8327
|
+
const d = li($t[a.componentType]);
|
|
8300
8328
|
s.min.multiplyScalar(d), s.max.multiplyScalar(d);
|
|
8301
8329
|
}
|
|
8302
8330
|
} else {
|
|
@@ -8314,7 +8342,7 @@ function pd(r, e, t) {
|
|
|
8314
8342
|
const h = t.json.accessors[u.POSITION], f = h.min, g = h.max;
|
|
8315
8343
|
if (f !== void 0 && g !== void 0) {
|
|
8316
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) {
|
|
8317
|
-
const y =
|
|
8345
|
+
const y = li($t[h.componentType]);
|
|
8318
8346
|
c.multiplyScalar(y);
|
|
8319
8347
|
}
|
|
8320
8348
|
a.max(c);
|
|
@@ -8325,10 +8353,10 @@ function pd(r, e, t) {
|
|
|
8325
8353
|
s.expandByVector(a);
|
|
8326
8354
|
}
|
|
8327
8355
|
r.boundingBox = s;
|
|
8328
|
-
const o = new
|
|
8356
|
+
const o = new Ti();
|
|
8329
8357
|
s.getCenter(o.center), o.radius = s.min.distanceTo(s.max) / 2, r.boundingSphere = o;
|
|
8330
8358
|
}
|
|
8331
|
-
function
|
|
8359
|
+
function Er(r, e, t) {
|
|
8332
8360
|
const n = e.attributes, s = [];
|
|
8333
8361
|
function i(o, a) {
|
|
8334
8362
|
return t.getDependency("accessor", o).then(function(c) {
|
|
@@ -8336,7 +8364,7 @@ function wr(r, e, t) {
|
|
|
8336
8364
|
});
|
|
8337
8365
|
}
|
|
8338
8366
|
for (const o in n) {
|
|
8339
|
-
const a =
|
|
8367
|
+
const a = ci[o] || o.toLowerCase();
|
|
8340
8368
|
a in r.attributes || s.push(i(n[o], a));
|
|
8341
8369
|
}
|
|
8342
8370
|
if (e.indices !== void 0 && !r.index) {
|
|
@@ -8345,12 +8373,12 @@ function wr(r, e, t) {
|
|
|
8345
8373
|
});
|
|
8346
8374
|
s.push(o);
|
|
8347
8375
|
}
|
|
8348
|
-
return
|
|
8349
|
-
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;
|
|
8350
8378
|
});
|
|
8351
8379
|
}
|
|
8352
|
-
const
|
|
8353
|
-
class
|
|
8380
|
+
const Hs = /* @__PURE__ */ new WeakMap();
|
|
8381
|
+
class gd extends wi {
|
|
8354
8382
|
/**
|
|
8355
8383
|
* Constructs a new Draco loader.
|
|
8356
8384
|
*
|
|
@@ -8436,8 +8464,8 @@ class _d extends bi {
|
|
|
8436
8464
|
}
|
|
8437
8465
|
decodeGeometry(e, t) {
|
|
8438
8466
|
const n = JSON.stringify(t);
|
|
8439
|
-
if (
|
|
8440
|
-
const c =
|
|
8467
|
+
if (Hs.has(e)) {
|
|
8468
|
+
const c = Hs.get(e);
|
|
8441
8469
|
if (c.key === n)
|
|
8442
8470
|
return c.promise;
|
|
8443
8471
|
if (e.byteLength === 0)
|
|
@@ -8451,13 +8479,13 @@ class _d extends bi {
|
|
|
8451
8479
|
}))).then((c) => this._createGeometry(c.geometry));
|
|
8452
8480
|
return a.catch(() => !0).then(() => {
|
|
8453
8481
|
s && i && this._releaseTask(s, i);
|
|
8454
|
-
}),
|
|
8482
|
+
}), Hs.set(e, {
|
|
8455
8483
|
key: n,
|
|
8456
8484
|
promise: a
|
|
8457
8485
|
}), a;
|
|
8458
8486
|
}
|
|
8459
8487
|
_createGeometry(e) {
|
|
8460
|
-
const t = new
|
|
8488
|
+
const t = new Si();
|
|
8461
8489
|
e.index && t.setIndex(new at(e.index.array, 1));
|
|
8462
8490
|
for (let n = 0; n < e.attributes.length; n++) {
|
|
8463
8491
|
const s = e.attributes[n], i = s.name, o = s.array, a = s.itemSize, c = new at(o, a);
|
|
@@ -8469,7 +8497,7 @@ class _d extends bi {
|
|
|
8469
8497
|
if (t !== mt) return;
|
|
8470
8498
|
const n = new lt();
|
|
8471
8499
|
for (let s = 0, i = e.count; s < i; s++)
|
|
8472
|
-
n.fromBufferAttribute(e, s),
|
|
8500
|
+
n.fromBufferAttribute(e, s), ti.toWorkingColorSpace(n, mt), e.setXYZ(s, n.r, n.g, n.b);
|
|
8473
8501
|
}
|
|
8474
8502
|
_loadLibrary(e, t) {
|
|
8475
8503
|
const n = new mn(this.manager);
|
|
@@ -8486,7 +8514,7 @@ class _d extends bi {
|
|
|
8486
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) => {
|
|
8487
8515
|
const s = n[0];
|
|
8488
8516
|
e || (this.decoderConfig.wasmBinary = n[1]);
|
|
8489
|
-
const i =
|
|
8517
|
+
const i = yd.toString(), o = [
|
|
8490
8518
|
"/* draco decoder */",
|
|
8491
8519
|
s,
|
|
8492
8520
|
"",
|
|
@@ -8534,7 +8562,7 @@ class _d extends bi {
|
|
|
8534
8562
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
8535
8563
|
}
|
|
8536
8564
|
}
|
|
8537
|
-
function
|
|
8565
|
+
function yd() {
|
|
8538
8566
|
let r, e;
|
|
8539
8567
|
onmessage = function(o) {
|
|
8540
8568
|
const a = o.data;
|
|
@@ -8624,12 +8652,12 @@ function gd() {
|
|
|
8624
8652
|
}
|
|
8625
8653
|
}
|
|
8626
8654
|
}
|
|
8627
|
-
class
|
|
8655
|
+
class vd {
|
|
8628
8656
|
constructor(e) {
|
|
8629
8657
|
_(this, "gltf_loader");
|
|
8630
8658
|
e || (e = "/examples/jsm/libs/draco/gltf/");
|
|
8631
|
-
const t = new
|
|
8632
|
-
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);
|
|
8633
8661
|
}
|
|
8634
8662
|
/**
|
|
8635
8663
|
* Loads a GLTF/GLB and returns a THREE.Group
|
|
@@ -8644,7 +8672,7 @@ class yd {
|
|
|
8644
8672
|
void 0,
|
|
8645
8673
|
(s) => {
|
|
8646
8674
|
n(
|
|
8647
|
-
new ve(`Failed to load model from ${e}`, "ModelLoader",
|
|
8675
|
+
new ve(`Failed to load model from ${e}`, "ModelLoader", Ce.MODEL_LOAD_FAILED, {
|
|
8648
8676
|
url: e,
|
|
8649
8677
|
error: s
|
|
8650
8678
|
})
|
|
@@ -8654,7 +8682,7 @@ class yd {
|
|
|
8654
8682
|
});
|
|
8655
8683
|
}
|
|
8656
8684
|
}
|
|
8657
|
-
class
|
|
8685
|
+
class xd extends EventTarget {
|
|
8658
8686
|
constructor(t, n) {
|
|
8659
8687
|
super();
|
|
8660
8688
|
// private scene: THREE.Scene
|
|
@@ -8664,7 +8692,7 @@ class vd extends EventTarget {
|
|
|
8664
8692
|
_(this, "loader");
|
|
8665
8693
|
_(this, "viewer");
|
|
8666
8694
|
_(this, "settings");
|
|
8667
|
-
this.viewer = t, this.loader = new
|
|
8695
|
+
this.viewer = t, this.loader = new vd(), this.settings = n, this.settings.addEventListener("update", (s) => {
|
|
8668
8696
|
const i = s.detail;
|
|
8669
8697
|
i.models && this.update_models(i.models);
|
|
8670
8698
|
}), this.ready = this.init();
|
|
@@ -8704,7 +8732,7 @@ class vd extends EventTarget {
|
|
|
8704
8732
|
detail: { url: t.url }
|
|
8705
8733
|
})
|
|
8706
8734
|
);
|
|
8707
|
-
const n = new
|
|
8735
|
+
const n = new Nl(this.viewer, this.loader, t);
|
|
8708
8736
|
await n.load(), this.models.set(t.url, n), this.dispatchEvent(
|
|
8709
8737
|
new CustomEvent("loaded", {
|
|
8710
8738
|
detail: { url: t.url, model: n }
|
|
@@ -8774,7 +8802,7 @@ class Cu extends EventTarget {
|
|
|
8774
8802
|
_(this, "environment");
|
|
8775
8803
|
_(this, "sun");
|
|
8776
8804
|
_(this, "model_manager");
|
|
8777
|
-
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) => {
|
|
8778
8806
|
const i = s.detail;
|
|
8779
8807
|
this.environment.update(i.environment);
|
|
8780
8808
|
});
|
|
@@ -8786,7 +8814,7 @@ class Cu extends EventTarget {
|
|
|
8786
8814
|
const n = new ve(
|
|
8787
8815
|
`Failed to initialize Glimmer: ${t instanceof Error ? t.message : t}`,
|
|
8788
8816
|
"Glimmer",
|
|
8789
|
-
|
|
8817
|
+
Ce.INITIALIZATION_FAILED,
|
|
8790
8818
|
{ error: t }
|
|
8791
8819
|
);
|
|
8792
8820
|
throw this.dispatchEvent(
|
|
@@ -8801,7 +8829,7 @@ class Cu extends EventTarget {
|
|
|
8801
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: {} }));
|
|
8802
8830
|
}
|
|
8803
8831
|
}
|
|
8804
|
-
const
|
|
8832
|
+
const bd = E.object({
|
|
8805
8833
|
type: E.enum(["2d", "3d"]),
|
|
8806
8834
|
position: E.tuple([E.number(), E.number(), E.number()]),
|
|
8807
8835
|
// [x, y, z] in 3D world coordinates
|
|
@@ -8816,7 +8844,7 @@ const xd = E.object({
|
|
|
8816
8844
|
// Position in model's local space
|
|
8817
8845
|
}).optional()
|
|
8818
8846
|
// Optional anchor for 3D annotations
|
|
8819
|
-
}),
|
|
8847
|
+
}), wd = E.object({
|
|
8820
8848
|
min: E.object({
|
|
8821
8849
|
x: E.number(),
|
|
8822
8850
|
y: E.number(),
|
|
@@ -8827,50 +8855,50 @@ const xd = E.object({
|
|
|
8827
8855
|
y: E.number(),
|
|
8828
8856
|
z: E.number()
|
|
8829
8857
|
})
|
|
8830
|
-
}),
|
|
8858
|
+
}), ns = E.object({
|
|
8831
8859
|
id: E.string(),
|
|
8832
8860
|
title: E.string().optional(),
|
|
8833
8861
|
description: E.string().optional(),
|
|
8834
8862
|
// Glimmer settings to apply for this slide
|
|
8835
|
-
settings:
|
|
8863
|
+
settings: ts.partial(),
|
|
8836
8864
|
// Camera configuration
|
|
8837
8865
|
camera: E.object({
|
|
8838
8866
|
position: E.tuple([E.number(), E.number(), E.number()]),
|
|
8839
8867
|
target: E.tuple([E.number(), E.number(), E.number()])
|
|
8840
8868
|
}),
|
|
8841
8869
|
// Optional annotations
|
|
8842
|
-
annotations: E.array(
|
|
8870
|
+
annotations: E.array(bd).optional(),
|
|
8843
8871
|
// Optional section box
|
|
8844
|
-
section_box:
|
|
8872
|
+
section_box: wd.optional(),
|
|
8845
8873
|
section_box_enabled: E.boolean().optional().default(!1)
|
|
8846
|
-
}),
|
|
8874
|
+
}), Ed = E.object({
|
|
8847
8875
|
duration: E.number().default(1e3),
|
|
8848
8876
|
// milliseconds
|
|
8849
8877
|
easing: E.string().default("linear")
|
|
8850
8878
|
// 'linear' | 'ease-in-out' etc.
|
|
8851
|
-
}),
|
|
8879
|
+
}), $n = E.object({
|
|
8852
8880
|
version: E.string().default("1.0.0"),
|
|
8853
8881
|
title: E.string(),
|
|
8854
8882
|
description: E.string().optional(),
|
|
8855
|
-
slides: E.array(
|
|
8883
|
+
slides: E.array(ns).min(1, "Story must have at least one slide"),
|
|
8856
8884
|
// Optional: default transition settings (for future transitions)
|
|
8857
|
-
transition:
|
|
8885
|
+
transition: Ed.optional()
|
|
8858
8886
|
});
|
|
8859
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 */
|
|
8860
8888
|
const {
|
|
8861
|
-
entries:
|
|
8862
|
-
setPrototypeOf:
|
|
8863
|
-
isFrozen:
|
|
8864
|
-
getPrototypeOf:
|
|
8865
|
-
getOwnPropertyDescriptor:
|
|
8889
|
+
entries: uo,
|
|
8890
|
+
setPrototypeOf: Ar,
|
|
8891
|
+
isFrozen: Ad,
|
|
8892
|
+
getPrototypeOf: Td,
|
|
8893
|
+
getOwnPropertyDescriptor: Sd
|
|
8866
8894
|
} = Object;
|
|
8867
8895
|
let {
|
|
8868
8896
|
freeze: Ae,
|
|
8869
8897
|
seal: ze,
|
|
8870
|
-
create:
|
|
8898
|
+
create: di
|
|
8871
8899
|
} = Object, {
|
|
8872
|
-
apply:
|
|
8873
|
-
construct:
|
|
8900
|
+
apply: ui,
|
|
8901
|
+
construct: hi
|
|
8874
8902
|
} = typeof Reflect < "u" && Reflect;
|
|
8875
8903
|
Ae || (Ae = function(e) {
|
|
8876
8904
|
return e;
|
|
@@ -8878,41 +8906,41 @@ Ae || (Ae = function(e) {
|
|
|
8878
8906
|
ze || (ze = function(e) {
|
|
8879
8907
|
return e;
|
|
8880
8908
|
});
|
|
8881
|
-
|
|
8909
|
+
ui || (ui = function(e, t) {
|
|
8882
8910
|
for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), i = 2; i < n; i++)
|
|
8883
8911
|
s[i - 2] = arguments[i];
|
|
8884
8912
|
return e.apply(t, s);
|
|
8885
8913
|
});
|
|
8886
|
-
|
|
8914
|
+
hi || (hi = function(e) {
|
|
8887
8915
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
8888
8916
|
n[s - 1] = arguments[s];
|
|
8889
8917
|
return new e(...n);
|
|
8890
8918
|
});
|
|
8891
|
-
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);
|
|
8892
8920
|
function Te(r) {
|
|
8893
8921
|
return function(e) {
|
|
8894
8922
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
8895
8923
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
8896
8924
|
n[s - 1] = arguments[s];
|
|
8897
|
-
return
|
|
8925
|
+
return ui(r, e, n);
|
|
8898
8926
|
};
|
|
8899
8927
|
}
|
|
8900
8928
|
function Cd(r) {
|
|
8901
8929
|
return function() {
|
|
8902
8930
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
8903
8931
|
t[n] = arguments[n];
|
|
8904
|
-
return
|
|
8932
|
+
return hi(r, t);
|
|
8905
8933
|
};
|
|
8906
8934
|
}
|
|
8907
8935
|
function Y(r, e) {
|
|
8908
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
8909
|
-
|
|
8936
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ss;
|
|
8937
|
+
Ar && Ar(r, null);
|
|
8910
8938
|
let n = e.length;
|
|
8911
8939
|
for (; n--; ) {
|
|
8912
8940
|
let s = e[n];
|
|
8913
8941
|
if (typeof s == "string") {
|
|
8914
8942
|
const i = t(s);
|
|
8915
|
-
i !== s && (
|
|
8943
|
+
i !== s && (Ad(e) || (e[n] = i), s = i);
|
|
8916
8944
|
}
|
|
8917
8945
|
r[s] = !0;
|
|
8918
8946
|
}
|
|
@@ -8924,46 +8952,46 @@ function Od(r) {
|
|
|
8924
8952
|
return r;
|
|
8925
8953
|
}
|
|
8926
8954
|
function st(r) {
|
|
8927
|
-
const e =
|
|
8928
|
-
for (const [t, n] of
|
|
8955
|
+
const e = di(null);
|
|
8956
|
+
for (const [t, n] of uo(r))
|
|
8929
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);
|
|
8930
8958
|
return e;
|
|
8931
8959
|
}
|
|
8932
8960
|
function on(r, e) {
|
|
8933
8961
|
for (; r !== null; ) {
|
|
8934
|
-
const n =
|
|
8962
|
+
const n = Sd(r, e);
|
|
8935
8963
|
if (n) {
|
|
8936
8964
|
if (n.get)
|
|
8937
8965
|
return Te(n.get);
|
|
8938
8966
|
if (typeof n.value == "function")
|
|
8939
8967
|
return Te(n.value);
|
|
8940
8968
|
}
|
|
8941
|
-
r =
|
|
8969
|
+
r = Td(r);
|
|
8942
8970
|
}
|
|
8943
8971
|
function t() {
|
|
8944
8972
|
return null;
|
|
8945
8973
|
}
|
|
8946
8974
|
return t;
|
|
8947
8975
|
}
|
|
8948
|
-
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(
|
|
8949
8977
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
8950
8978
|
// eslint-disable-line no-useless-escape
|
|
8951
|
-
),
|
|
8979
|
+
), jd = ze(/^(?:\w+script|data):/i), Bd = ze(
|
|
8952
8980
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
8953
8981
|
// eslint-disable-line no-control-regex
|
|
8954
|
-
),
|
|
8955
|
-
var
|
|
8982
|
+
), fo = ze(/^html$/i), Hd = ze(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
8983
|
+
var kr = /* @__PURE__ */ Object.freeze({
|
|
8956
8984
|
__proto__: null,
|
|
8957
|
-
ARIA_ATTR:
|
|
8958
|
-
ATTR_WHITESPACE:
|
|
8959
|
-
CUSTOM_ELEMENT:
|
|
8960
|
-
DATA_ATTR:
|
|
8961
|
-
DOCTYPE_NAME:
|
|
8962
|
-
ERB_EXPR:
|
|
8963
|
-
IS_ALLOWED_URI:
|
|
8964
|
-
IS_SCRIPT_OR_DATA:
|
|
8965
|
-
MUSTACHE_EXPR:
|
|
8966
|
-
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
|
|
8967
8995
|
});
|
|
8968
8996
|
const an = {
|
|
8969
8997
|
element: 1,
|
|
@@ -8972,9 +9000,9 @@ const an = {
|
|
|
8972
9000
|
progressingInstruction: 7,
|
|
8973
9001
|
comment: 8,
|
|
8974
9002
|
document: 9
|
|
8975
|
-
},
|
|
9003
|
+
}, Vd = function() {
|
|
8976
9004
|
return typeof window > "u" ? null : window;
|
|
8977
|
-
},
|
|
9005
|
+
}, Gd = function(e, t) {
|
|
8978
9006
|
if (typeof e != "object" || typeof e.createPolicy != "function")
|
|
8979
9007
|
return null;
|
|
8980
9008
|
let n = null;
|
|
@@ -9006,9 +9034,9 @@ const an = {
|
|
|
9006
9034
|
uponSanitizeShadowNode: []
|
|
9007
9035
|
};
|
|
9008
9036
|
};
|
|
9009
|
-
function
|
|
9010
|
-
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
9011
|
-
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);
|
|
9012
9040
|
if (e.version = "3.3.0", e.removed = [], !r || !r.document || r.document.nodeType !== an.document || !r.Element)
|
|
9013
9041
|
return e.isSupported = !1, e;
|
|
9014
9042
|
let {
|
|
@@ -9036,27 +9064,27 @@ function fo() {
|
|
|
9036
9064
|
createDocumentFragment: L,
|
|
9037
9065
|
getElementsByTagName: R
|
|
9038
9066
|
} = t, {
|
|
9039
|
-
importNode:
|
|
9067
|
+
importNode: C
|
|
9040
9068
|
} = n;
|
|
9041
9069
|
let N = Cr();
|
|
9042
|
-
e.isSupported = typeof
|
|
9070
|
+
e.isSupported = typeof uo == "function" && typeof T == "function" && V && V.createHTMLDocument !== void 0;
|
|
9043
9071
|
const {
|
|
9044
9072
|
MUSTACHE_EXPR: G,
|
|
9045
9073
|
ERB_EXPR: Z,
|
|
9046
|
-
TMPLIT_EXPR:
|
|
9074
|
+
TMPLIT_EXPR: O,
|
|
9047
9075
|
DATA_ATTR: ee,
|
|
9048
9076
|
ARIA_ATTR: $,
|
|
9049
9077
|
IS_SCRIPT_OR_DATA: be,
|
|
9050
9078
|
ATTR_WHITESPACE: le,
|
|
9051
9079
|
CUSTOM_ELEMENT: Ue
|
|
9052
|
-
} =
|
|
9080
|
+
} = kr;
|
|
9053
9081
|
let {
|
|
9054
9082
|
IS_ALLOWED_URI: Se
|
|
9055
|
-
} =
|
|
9056
|
-
const ue = Y({}, [...
|
|
9083
|
+
} = kr, ne = null;
|
|
9084
|
+
const ue = Y({}, [...Sr, ...Zs, ...Ws, ...Xs, ...Rr]);
|
|
9057
9085
|
let Q = null;
|
|
9058
|
-
const ut = Y({}, [...
|
|
9059
|
-
let z = Object.seal(
|
|
9086
|
+
const ut = Y({}, [...Mr, ...$s, ...Lr, ...Kn]);
|
|
9087
|
+
let z = Object.seal(di(null, {
|
|
9060
9088
|
tagNameCheck: {
|
|
9061
9089
|
writable: !0,
|
|
9062
9090
|
configurable: !1,
|
|
@@ -9075,8 +9103,8 @@ function fo() {
|
|
|
9075
9103
|
enumerable: !0,
|
|
9076
9104
|
value: !1
|
|
9077
9105
|
}
|
|
9078
|
-
})), Re = null,
|
|
9079
|
-
const Je = Object.seal(
|
|
9106
|
+
})), Re = null, kt = null;
|
|
9107
|
+
const Je = Object.seal(di(null, {
|
|
9080
9108
|
tagCheck: {
|
|
9081
9109
|
writable: !0,
|
|
9082
9110
|
configurable: !1,
|
|
@@ -9090,45 +9118,45 @@ function fo() {
|
|
|
9090
9118
|
value: null
|
|
9091
9119
|
}
|
|
9092
9120
|
}));
|
|
9093
|
-
let gs = !0, ys = !0,
|
|
9094
|
-
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-";
|
|
9095
9123
|
let bs = !0, Qt = !1, Dt = {}, It = null;
|
|
9096
|
-
const
|
|
9097
|
-
let
|
|
9098
|
-
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"]);
|
|
9099
9127
|
let ws = null;
|
|
9100
|
-
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";
|
|
9101
9129
|
let Nt = Qe, Es = !1, As = null;
|
|
9102
|
-
const
|
|
9103
|
-
let
|
|
9104
|
-
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"]);
|
|
9105
9133
|
let en = null;
|
|
9106
|
-
const
|
|
9134
|
+
const Eo = ["application/xhtml+xml", "text/html"], Ao = "text/html";
|
|
9107
9135
|
let de = null, Pt = null;
|
|
9108
|
-
const
|
|
9136
|
+
const To = t.createElement("form"), Ui = function(m) {
|
|
9109
9137
|
return m instanceof RegExp || m instanceof Function;
|
|
9110
9138
|
}, Ts = function() {
|
|
9111
9139
|
let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
9112
9140
|
if (!(Pt && Pt === m)) {
|
|
9113
9141
|
if ((!m || typeof m != "object") && (m = {}), m = st(m), en = // eslint-disable-next-line unicorn/prefer-includes
|
|
9114
|
-
|
|
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) {
|
|
9115
9143
|
if (typeof m.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
9116
9144
|
throw rn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
9117
9145
|
if (typeof m.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
9118
9146
|
throw rn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
9119
9147
|
v = m.TRUSTED_TYPES_POLICY, P = v.createHTML("");
|
|
9120
9148
|
} else
|
|
9121
|
-
v === void 0 && (v =
|
|
9149
|
+
v === void 0 && (v = Gd(f, s)), v !== null && typeof P == "string" && (P = v.createHTML(""));
|
|
9122
9150
|
Ae && Ae(m), Pt = m;
|
|
9123
9151
|
}
|
|
9124
|
-
},
|
|
9152
|
+
}, Fi = Y({}, [...Zs, ...Ws, ...Dd]), ji = Y({}, [...Xs, ...Id]), So = function(m) {
|
|
9125
9153
|
let S = T(m);
|
|
9126
9154
|
(!S || !S.tagName) && (S = {
|
|
9127
9155
|
namespaceURI: Nt,
|
|
9128
9156
|
tagName: "template"
|
|
9129
9157
|
});
|
|
9130
|
-
const D =
|
|
9131
|
-
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;
|
|
9132
9160
|
}, Ve = function(m) {
|
|
9133
9161
|
nn(e.removed, {
|
|
9134
9162
|
element: m
|
|
@@ -9151,7 +9179,7 @@ function fo() {
|
|
|
9151
9179
|
});
|
|
9152
9180
|
}
|
|
9153
9181
|
if (S.removeAttribute(m), m === "is")
|
|
9154
|
-
if (
|
|
9182
|
+
if (Ot || zn)
|
|
9155
9183
|
try {
|
|
9156
9184
|
Ve(S);
|
|
9157
9185
|
} catch {
|
|
@@ -9161,12 +9189,12 @@ function fo() {
|
|
|
9161
9189
|
S.setAttribute(m, "");
|
|
9162
9190
|
} catch {
|
|
9163
9191
|
}
|
|
9164
|
-
},
|
|
9192
|
+
}, Bi = function(m) {
|
|
9165
9193
|
let S = null, D = null;
|
|
9166
9194
|
if (xs)
|
|
9167
9195
|
m = "<remove></remove>" + m;
|
|
9168
9196
|
else {
|
|
9169
|
-
const oe =
|
|
9197
|
+
const oe = Gs(m, /^[\r\n\t ]+/);
|
|
9170
9198
|
D = oe && oe[0];
|
|
9171
9199
|
}
|
|
9172
9200
|
en === "application/xhtml+xml" && Nt === Qe && (m = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + m + "</body></html>");
|
|
@@ -9185,7 +9213,7 @@ function fo() {
|
|
|
9185
9213
|
}
|
|
9186
9214
|
const ge = S.body || S.documentElement;
|
|
9187
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;
|
|
9188
|
-
},
|
|
9216
|
+
}, Hi = function(m) {
|
|
9189
9217
|
return F.call(
|
|
9190
9218
|
m.ownerDocument || m,
|
|
9191
9219
|
m,
|
|
@@ -9195,15 +9223,15 @@ function fo() {
|
|
|
9195
9223
|
);
|
|
9196
9224
|
}, Ss = function(m) {
|
|
9197
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");
|
|
9198
|
-
},
|
|
9226
|
+
}, Vi = function(m) {
|
|
9199
9227
|
return typeof a == "function" && m instanceof a;
|
|
9200
9228
|
};
|
|
9201
9229
|
function et(U, m, S) {
|
|
9202
|
-
|
|
9230
|
+
Yn(U, (D) => {
|
|
9203
9231
|
D.call(e, m, S, Pt);
|
|
9204
9232
|
});
|
|
9205
9233
|
}
|
|
9206
|
-
const
|
|
9234
|
+
const Gi = function(m) {
|
|
9207
9235
|
let S = null;
|
|
9208
9236
|
if (et(N.beforeSanitizeElements, m, null), Ss(m))
|
|
9209
9237
|
return Ve(m), !0;
|
|
@@ -9211,10 +9239,10 @@ function fo() {
|
|
|
9211
9239
|
if (et(N.uponSanitizeElement, m, {
|
|
9212
9240
|
tagName: D,
|
|
9213
9241
|
allowedTags: ne
|
|
9214
|
-
}),
|
|
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))
|
|
9215
9243
|
return Ve(m), !0;
|
|
9216
9244
|
if (!(Je.tagCheck instanceof Function && Je.tagCheck(D)) && (!ne[D] || Re[D])) {
|
|
9217
|
-
if (!Re[D] &&
|
|
9245
|
+
if (!Re[D] && Wi(D) && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, D) || z.tagNameCheck instanceof Function && z.tagNameCheck(D)))
|
|
9218
9246
|
return !1;
|
|
9219
9247
|
if (bs && !It[D]) {
|
|
9220
9248
|
const se = T(m) || m.parentNode, ge = w(m) || m.childNodes;
|
|
@@ -9228,30 +9256,30 @@ function fo() {
|
|
|
9228
9256
|
}
|
|
9229
9257
|
return Ve(m), !0;
|
|
9230
9258
|
}
|
|
9231
|
-
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) => {
|
|
9232
9260
|
S = sn(S, se, " ");
|
|
9233
9261
|
}), m.textContent !== S && (nn(e.removed, {
|
|
9234
9262
|
element: m.cloneNode()
|
|
9235
9263
|
}), m.textContent = S)), et(N.afterSanitizeElements, m, null), !1);
|
|
9236
|
-
},
|
|
9237
|
-
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))
|
|
9238
9266
|
return !1;
|
|
9239
|
-
if (!(ys && !
|
|
9267
|
+
if (!(ys && !kt[S] && we(ee, S))) {
|
|
9240
9268
|
if (!(gs && we($, S))) {
|
|
9241
9269
|
if (!(Je.attributeCheck instanceof Function && Je.attributeCheck(S, m))) {
|
|
9242
|
-
if (!Q[S] ||
|
|
9270
|
+
if (!Q[S] || kt[S]) {
|
|
9243
9271
|
if (
|
|
9244
9272
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
9245
9273
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
9246
9274
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
9247
|
-
!(
|
|
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
|
|
9248
9276
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
9249
9277
|
S === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, D) || z.tagNameCheck instanceof Function && z.tagNameCheck(D)))
|
|
9250
9278
|
) return !1;
|
|
9251
9279
|
} else if (!ws[S]) {
|
|
9252
9280
|
if (!we(Se, sn(D, le, ""))) {
|
|
9253
|
-
if (!((S === "src" || S === "xlink:href" || S === "href") && m !== "script" &&
|
|
9254
|
-
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, "")))) {
|
|
9255
9283
|
if (D)
|
|
9256
9284
|
return !1;
|
|
9257
9285
|
}
|
|
@@ -9262,9 +9290,9 @@ function fo() {
|
|
|
9262
9290
|
}
|
|
9263
9291
|
}
|
|
9264
9292
|
return !0;
|
|
9265
|
-
}, Zi = function(m) {
|
|
9266
|
-
return m !== "annotation-xml" && Vs(m, Ue);
|
|
9267
9293
|
}, Wi = function(m) {
|
|
9294
|
+
return m !== "annotation-xml" && Gs(m, Ue);
|
|
9295
|
+
}, Xi = function(m) {
|
|
9268
9296
|
et(N.beforeSanitizeAttributes, m, null);
|
|
9269
9297
|
const {
|
|
9270
9298
|
attributes: S
|
|
@@ -9285,12 +9313,12 @@ function fo() {
|
|
|
9285
9313
|
namespaceURI: Me,
|
|
9286
9314
|
value: tt
|
|
9287
9315
|
} = ge, zt = de(oe), Rs = tt;
|
|
9288
|
-
let he = oe === "value" ? Rs :
|
|
9289
|
-
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)) {
|
|
9290
9318
|
xt(oe, m);
|
|
9291
9319
|
continue;
|
|
9292
9320
|
}
|
|
9293
|
-
if (zt === "attributename" &&
|
|
9321
|
+
if (zt === "attributename" && Gs(he, "href")) {
|
|
9294
9322
|
xt(oe, m);
|
|
9295
9323
|
continue;
|
|
9296
9324
|
}
|
|
@@ -9304,16 +9332,16 @@ function fo() {
|
|
|
9304
9332
|
xt(oe, m);
|
|
9305
9333
|
continue;
|
|
9306
9334
|
}
|
|
9307
|
-
|
|
9308
|
-
he = sn(he,
|
|
9335
|
+
Ct && Yn([G, Z, O], (Yi) => {
|
|
9336
|
+
he = sn(he, Yi, " ");
|
|
9309
9337
|
});
|
|
9310
|
-
const
|
|
9311
|
-
if (!
|
|
9338
|
+
const $i = de(m.nodeName);
|
|
9339
|
+
if (!Zi($i, zt, he)) {
|
|
9312
9340
|
xt(oe, m);
|
|
9313
9341
|
continue;
|
|
9314
9342
|
}
|
|
9315
9343
|
if (v && typeof f == "object" && typeof f.getAttributeType == "function" && !Me)
|
|
9316
|
-
switch (f.getAttributeType(
|
|
9344
|
+
switch (f.getAttributeType($i, zt)) {
|
|
9317
9345
|
case "TrustedHTML": {
|
|
9318
9346
|
he = v.createHTML(he);
|
|
9319
9347
|
break;
|
|
@@ -9325,22 +9353,22 @@ function fo() {
|
|
|
9325
9353
|
}
|
|
9326
9354
|
if (he !== Rs)
|
|
9327
9355
|
try {
|
|
9328
|
-
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);
|
|
9329
9357
|
} catch {
|
|
9330
9358
|
xt(oe, m);
|
|
9331
9359
|
}
|
|
9332
9360
|
}
|
|
9333
9361
|
et(N.afterSanitizeAttributes, m, null);
|
|
9334
|
-
},
|
|
9362
|
+
}, Ro = function U(m) {
|
|
9335
9363
|
let S = null;
|
|
9336
|
-
const D =
|
|
9364
|
+
const D = Hi(m);
|
|
9337
9365
|
for (et(N.beforeSanitizeShadowDOM, m, null); S = D.nextNode(); )
|
|
9338
|
-
et(N.uponSanitizeShadowNode, S, null),
|
|
9366
|
+
et(N.uponSanitizeShadowNode, S, null), Gi(S), Xi(S), S.content instanceof i && U(S.content);
|
|
9339
9367
|
et(N.afterSanitizeShadowDOM, m, null);
|
|
9340
9368
|
};
|
|
9341
9369
|
return e.sanitize = function(U) {
|
|
9342
9370
|
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, S = null, D = null, se = null, ge = null;
|
|
9343
|
-
if (Es = !U, Es && (U = "<!-->"), typeof U != "string" && !
|
|
9371
|
+
if (Es = !U, Es && (U = "<!-->"), typeof U != "string" && !Vi(U))
|
|
9344
9372
|
if (typeof U.toString == "function") {
|
|
9345
9373
|
if (U = U.toString(), typeof U != "string")
|
|
9346
9374
|
throw rn("dirty is not a string, aborting");
|
|
@@ -9355,33 +9383,33 @@ function fo() {
|
|
|
9355
9383
|
throw rn("root node is forbidden and cannot be sanitized in-place");
|
|
9356
9384
|
}
|
|
9357
9385
|
} else if (U instanceof a)
|
|
9358
|
-
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);
|
|
9359
9387
|
else {
|
|
9360
|
-
if (!
|
|
9388
|
+
if (!Ot && !Ct && !vt && // eslint-disable-next-line unicorn/prefer-includes
|
|
9361
9389
|
U.indexOf("<") === -1)
|
|
9362
|
-
return v &&
|
|
9363
|
-
if (S =
|
|
9364
|
-
return
|
|
9390
|
+
return v && Un ? v.createHTML(U) : U;
|
|
9391
|
+
if (S = Bi(U), !S)
|
|
9392
|
+
return Ot ? null : Un ? P : "";
|
|
9365
9393
|
}
|
|
9366
9394
|
S && xs && Ve(S.firstChild);
|
|
9367
|
-
const oe =
|
|
9395
|
+
const oe = Hi(Qt ? U : S);
|
|
9368
9396
|
for (; se = oe.nextNode(); )
|
|
9369
|
-
|
|
9397
|
+
Gi(se), Xi(se), se.content instanceof i && Ro(se.content);
|
|
9370
9398
|
if (Qt)
|
|
9371
9399
|
return U;
|
|
9372
|
-
if (
|
|
9373
|
-
if (
|
|
9400
|
+
if (Ot) {
|
|
9401
|
+
if (zn)
|
|
9374
9402
|
for (ge = L.call(S.ownerDocument); S.firstChild; )
|
|
9375
9403
|
ge.appendChild(S.firstChild);
|
|
9376
9404
|
else
|
|
9377
9405
|
ge = S;
|
|
9378
|
-
return (Q.shadowroot || Q.shadowrootmode) && (ge =
|
|
9406
|
+
return (Q.shadowroot || Q.shadowrootmode) && (ge = C.call(n, ge, !0)), ge;
|
|
9379
9407
|
}
|
|
9380
9408
|
let Me = vt ? S.outerHTML : S.innerHTML;
|
|
9381
|
-
return vt && ne["!doctype"] && S.ownerDocument && S.ownerDocument.doctype && S.ownerDocument.doctype.name && we(
|
|
9382
|
-
` + 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) => {
|
|
9383
9411
|
Me = sn(Me, tt, " ");
|
|
9384
|
-
}), v &&
|
|
9412
|
+
}), v && Un ? v.createHTML(Me) : Me;
|
|
9385
9413
|
}, e.setConfig = function() {
|
|
9386
9414
|
let U = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
9387
9415
|
Ts(U), vs = !0;
|
|
@@ -9390,23 +9418,23 @@ function fo() {
|
|
|
9390
9418
|
}, e.isValidAttribute = function(U, m, S) {
|
|
9391
9419
|
Pt || Ts({});
|
|
9392
9420
|
const D = de(U), se = de(m);
|
|
9393
|
-
return
|
|
9421
|
+
return Zi(D, se, S);
|
|
9394
9422
|
}, e.addHook = function(U, m) {
|
|
9395
9423
|
typeof m == "function" && nn(N[U], m);
|
|
9396
9424
|
}, e.removeHook = function(U, m) {
|
|
9397
9425
|
if (m !== void 0) {
|
|
9398
|
-
const S =
|
|
9399
|
-
return S === -1 ? void 0 :
|
|
9426
|
+
const S = Rd(N[U], m);
|
|
9427
|
+
return S === -1 ? void 0 : Md(N[U], S, 1)[0];
|
|
9400
9428
|
}
|
|
9401
|
-
return
|
|
9429
|
+
return Tr(N[U]);
|
|
9402
9430
|
}, e.removeHooks = function(U) {
|
|
9403
9431
|
N[U] = [];
|
|
9404
9432
|
}, e.removeAllHooks = function() {
|
|
9405
9433
|
N = Cr();
|
|
9406
9434
|
}, e;
|
|
9407
9435
|
}
|
|
9408
|
-
var
|
|
9409
|
-
class
|
|
9436
|
+
var Zd = mo();
|
|
9437
|
+
class Wd {
|
|
9410
9438
|
constructor(e) {
|
|
9411
9439
|
_(this, "container");
|
|
9412
9440
|
_(this, "elements", []);
|
|
@@ -9418,7 +9446,7 @@ class Zd {
|
|
|
9418
9446
|
*/
|
|
9419
9447
|
render(e) {
|
|
9420
9448
|
const t = document.createElement("div");
|
|
9421
|
-
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);
|
|
9422
9450
|
}
|
|
9423
9451
|
/**
|
|
9424
9452
|
* Clear all rendered 2D annotations
|
|
@@ -9433,7 +9461,7 @@ class Zd {
|
|
|
9433
9461
|
this.clear();
|
|
9434
9462
|
}
|
|
9435
9463
|
}
|
|
9436
|
-
class
|
|
9464
|
+
class Xd {
|
|
9437
9465
|
constructor(e) {
|
|
9438
9466
|
_(this, "group");
|
|
9439
9467
|
_(this, "sprites", []);
|
|
@@ -9476,7 +9504,7 @@ class Wd {
|
|
|
9476
9504
|
return this.group;
|
|
9477
9505
|
}
|
|
9478
9506
|
}
|
|
9479
|
-
class
|
|
9507
|
+
class $d {
|
|
9480
9508
|
constructor() {
|
|
9481
9509
|
_(this, "triggers", /* @__PURE__ */ new Map());
|
|
9482
9510
|
_(this, "handlers", /* @__PURE__ */ new Map());
|
|
@@ -9545,7 +9573,7 @@ class Xd {
|
|
|
9545
9573
|
typeof e == "string" ? window.removeEventListener(e, t) : e.removeEventListener("click", t);
|
|
9546
9574
|
}
|
|
9547
9575
|
}
|
|
9548
|
-
class
|
|
9576
|
+
class Yd extends EventTarget {
|
|
9549
9577
|
constructor(t, n) {
|
|
9550
9578
|
super();
|
|
9551
9579
|
_(this, "camera");
|
|
@@ -9576,7 +9604,7 @@ class $d extends EventTarget {
|
|
|
9576
9604
|
);
|
|
9577
9605
|
}
|
|
9578
9606
|
}
|
|
9579
|
-
class
|
|
9607
|
+
class Kd {
|
|
9580
9608
|
constructor(e, t) {
|
|
9581
9609
|
_(this, "mesh");
|
|
9582
9610
|
_(this, "axis");
|
|
@@ -9647,7 +9675,7 @@ class Yd {
|
|
|
9647
9675
|
this.mesh.geometry.dispose(), this.mesh.material.dispose();
|
|
9648
9676
|
}
|
|
9649
9677
|
}
|
|
9650
|
-
class
|
|
9678
|
+
class qd extends EventTarget {
|
|
9651
9679
|
constructor(t) {
|
|
9652
9680
|
super();
|
|
9653
9681
|
_(this, "bounds");
|
|
@@ -9701,7 +9729,7 @@ class Kd extends EventTarget {
|
|
|
9701
9729
|
["z", "min"],
|
|
9702
9730
|
["z", "max"]
|
|
9703
9731
|
].forEach(([a, c]) => {
|
|
9704
|
-
const l = new
|
|
9732
|
+
const l = new Kd(a, c);
|
|
9705
9733
|
l.update_from_bounds(this.bounds), this.plane_handles.push(l), t.add(l.mesh);
|
|
9706
9734
|
}), this.setup_interactions(n, s);
|
|
9707
9735
|
}
|
|
@@ -9815,7 +9843,7 @@ class Kd extends EventTarget {
|
|
|
9815
9843
|
}), this.event_listeners = []);
|
|
9816
9844
|
}
|
|
9817
9845
|
}
|
|
9818
|
-
const Or = 8,
|
|
9846
|
+
const Or = 8, Jd = `
|
|
9819
9847
|
attribute vec3 aN0;
|
|
9820
9848
|
attribute vec3 aN1;
|
|
9821
9849
|
attribute vec4 aOtherVert;
|
|
@@ -9869,7 +9897,7 @@ void main() {
|
|
|
9869
9897
|
|
|
9870
9898
|
gl_Position.z = -2000.;
|
|
9871
9899
|
}
|
|
9872
|
-
`,
|
|
9900
|
+
`, Qd = `
|
|
9873
9901
|
uniform vec3 uColor;
|
|
9874
9902
|
uniform int uClipPlaneCount;
|
|
9875
9903
|
uniform vec4 uClipPlanes[8];
|
|
@@ -9884,11 +9912,11 @@ void main() {
|
|
|
9884
9912
|
gl_FragColor = vec4(uColor, 1.);
|
|
9885
9913
|
}
|
|
9886
9914
|
`;
|
|
9887
|
-
class
|
|
9915
|
+
class fi extends Ei {
|
|
9888
9916
|
constructor(e = 0, t = !0, n = "#000000") {
|
|
9889
9917
|
super({
|
|
9890
|
-
vertexShader:
|
|
9891
|
-
fragmentShader:
|
|
9918
|
+
vertexShader: Jd,
|
|
9919
|
+
fragmentShader: Qd,
|
|
9892
9920
|
uniforms: {
|
|
9893
9921
|
uAngleThresh: { value: 0 },
|
|
9894
9922
|
uOutline: { value: Number(t) },
|
|
@@ -9924,10 +9952,10 @@ class hi extends wi {
|
|
|
9924
9952
|
}
|
|
9925
9953
|
}
|
|
9926
9954
|
}
|
|
9927
|
-
const
|
|
9928
|
-
class
|
|
9929
|
-
constructor(e, t = new
|
|
9930
|
-
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);
|
|
9931
9959
|
}
|
|
9932
9960
|
extract_geometry(e) {
|
|
9933
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;
|
|
@@ -9951,9 +9979,9 @@ class Qd extends Gr {
|
|
|
9951
9979
|
const n = {}, s = {}, i = [], o = [];
|
|
9952
9980
|
for (let a = 0, c = 0; a < t.count; a++) {
|
|
9953
9981
|
const l = a * 3, d = [
|
|
9954
|
-
Math.round(t.array[l] *
|
|
9955
|
-
Math.round(t.array[l + 1] *
|
|
9956
|
-
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)
|
|
9957
9985
|
].join(":");
|
|
9958
9986
|
n[d] === void 0 && (n[d] = c++, i.push(
|
|
9959
9987
|
t.array[l],
|
|
@@ -9995,16 +10023,16 @@ class Qd extends Gr {
|
|
|
9995
10023
|
return { v_array: [], n0_array: [], n1_array: [], other_vert_array: [] };
|
|
9996
10024
|
}
|
|
9997
10025
|
}
|
|
9998
|
-
const
|
|
9999
|
-
let
|
|
10000
|
-
function
|
|
10026
|
+
const kn = /* @__PURE__ */ new Set();
|
|
10027
|
+
let mi = !1;
|
|
10028
|
+
function tu(r, e, t = 2) {
|
|
10001
10029
|
const n = e && e.length, s = n ? e[0] * t : r.length;
|
|
10002
|
-
|
|
10003
|
-
let i =
|
|
10030
|
+
kn.size && kn.clear();
|
|
10031
|
+
let i = po(r, 0, s, t, !0);
|
|
10004
10032
|
const o = [];
|
|
10005
10033
|
if (!i || i.next === i.prev) return o;
|
|
10006
10034
|
let a = 0, c = 0, l = 0;
|
|
10007
|
-
if (n && (i =
|
|
10035
|
+
if (n && (i = ou(r, e, i, t)), r.length > 80 * t) {
|
|
10008
10036
|
a = r[0], c = r[1];
|
|
10009
10037
|
let d = a, u = c;
|
|
10010
10038
|
for (let h = t; h < s; h += t) {
|
|
@@ -10013,86 +10041,86 @@ function eu(r, e, t = 2) {
|
|
|
10013
10041
|
}
|
|
10014
10042
|
l = Math.max(d - a, u - c), l = l !== 0 ? 32767 / l : 0;
|
|
10015
10043
|
}
|
|
10016
|
-
return
|
|
10044
|
+
return pi(i, o, a, c, l), o;
|
|
10017
10045
|
}
|
|
10018
|
-
function
|
|
10046
|
+
function po(r, e, t, n, s) {
|
|
10019
10047
|
let i = null;
|
|
10020
|
-
if (s ===
|
|
10021
|
-
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);
|
|
10022
10050
|
else
|
|
10023
|
-
for (let o = t - n; o >= e; o -= n) i =
|
|
10024
|
-
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;
|
|
10025
10053
|
}
|
|
10026
10054
|
function Lt(r, e = r) {
|
|
10027
10055
|
const t = e === r;
|
|
10028
10056
|
let n = r, s;
|
|
10029
10057
|
do
|
|
10030
|
-
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);
|
|
10031
10059
|
while (s || n !== e);
|
|
10032
10060
|
return e;
|
|
10033
10061
|
}
|
|
10034
|
-
function
|
|
10035
|
-
s &&
|
|
10062
|
+
function pi(r, e, t, n, s) {
|
|
10063
|
+
s && fu(r, t, n, s);
|
|
10036
10064
|
let i = r, o = !1;
|
|
10037
10065
|
for (; r.prev !== r.next; ) {
|
|
10038
10066
|
const a = r.prev, c = r.next;
|
|
10039
|
-
if (ae(a, r, c) < 0 && (s ?
|
|
10040
|
-
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;
|
|
10041
10069
|
continue;
|
|
10042
10070
|
}
|
|
10043
10071
|
if (r = c, r === i) {
|
|
10044
|
-
if (
|
|
10072
|
+
if (mi = !1, r = Lt(r), mi) {
|
|
10045
10073
|
i = r;
|
|
10046
10074
|
continue;
|
|
10047
10075
|
}
|
|
10048
10076
|
if (!o) {
|
|
10049
|
-
r =
|
|
10077
|
+
r = iu(r, e), i = r, o = !0;
|
|
10050
10078
|
continue;
|
|
10051
10079
|
}
|
|
10052
|
-
|
|
10080
|
+
ru(r, e, t, n, s);
|
|
10053
10081
|
break;
|
|
10054
10082
|
}
|
|
10055
10083
|
}
|
|
10056
10084
|
}
|
|
10057
|
-
function
|
|
10085
|
+
function nu(r) {
|
|
10058
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);
|
|
10059
10087
|
let g = n.next;
|
|
10060
10088
|
for (; g !== e; ) {
|
|
10061
|
-
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;
|
|
10062
10090
|
g = g.next;
|
|
10063
10091
|
}
|
|
10064
10092
|
return !0;
|
|
10065
10093
|
}
|
|
10066
|
-
function
|
|
10067
|
-
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);
|
|
10068
10096
|
let T = r.prevZ;
|
|
10069
10097
|
for (; T && T.z >= b; ) {
|
|
10070
|
-
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;
|
|
10071
10099
|
T = T.prevZ;
|
|
10072
10100
|
}
|
|
10073
10101
|
let v = r.nextZ;
|
|
10074
10102
|
for (; v && v.z <= w; ) {
|
|
10075
|
-
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;
|
|
10076
10104
|
v = v.nextZ;
|
|
10077
10105
|
}
|
|
10078
10106
|
return !0;
|
|
10079
10107
|
}
|
|
10080
|
-
function
|
|
10108
|
+
function iu(r, e) {
|
|
10081
10109
|
let t = r, n = !1;
|
|
10082
10110
|
do {
|
|
10083
10111
|
const s = t.prev, i = t.next.next;
|
|
10084
|
-
|
|
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;
|
|
10085
10113
|
} while (t !== r);
|
|
10086
10114
|
return n ? Lt(t) : t;
|
|
10087
10115
|
}
|
|
10088
|
-
function
|
|
10116
|
+
function ru(r, e, t, n, s) {
|
|
10089
10117
|
let i = r;
|
|
10090
10118
|
do {
|
|
10091
10119
|
let o = i.next.next;
|
|
10092
10120
|
for (; o !== i.prev; ) {
|
|
10093
|
-
if (i.i !== o.i &&
|
|
10094
|
-
let a =
|
|
10095
|
-
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);
|
|
10096
10124
|
return;
|
|
10097
10125
|
}
|
|
10098
10126
|
o = o.next;
|
|
@@ -10100,76 +10128,76 @@ function iu(r, e, t, n, s) {
|
|
|
10100
10128
|
i = i.next;
|
|
10101
10129
|
} while (i !== r);
|
|
10102
10130
|
}
|
|
10103
|
-
let
|
|
10104
|
-
function
|
|
10131
|
+
let _i = !1;
|
|
10132
|
+
function ou(r, e, t, n) {
|
|
10105
10133
|
const s = [];
|
|
10106
10134
|
for (let i = 0, o = e.length; i < o; i++) {
|
|
10107
10135
|
const a = e[i] * n, c = i < o - 1 ? e[i + 1] * n : r.length, l = (
|
|
10108
10136
|
/** @type {Node} */
|
|
10109
|
-
|
|
10137
|
+
po(r, a, c, n, !1)
|
|
10110
10138
|
);
|
|
10111
|
-
l === l.next &&
|
|
10139
|
+
l === l.next && kn.add(l), s.push(pu(l));
|
|
10112
10140
|
}
|
|
10113
|
-
s.sort(
|
|
10141
|
+
s.sort(au), lu(r.length / n, e.length), go(t, t), _i = !0;
|
|
10114
10142
|
for (let i = 0; i < s.length; i++)
|
|
10115
|
-
t =
|
|
10116
|
-
return
|
|
10143
|
+
t = cu(s[i], t);
|
|
10144
|
+
return _i = !1, Lt(t);
|
|
10117
10145
|
}
|
|
10118
|
-
function
|
|
10146
|
+
function au(r, e) {
|
|
10119
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);
|
|
10120
10148
|
}
|
|
10121
|
-
function
|
|
10122
|
-
const t =
|
|
10149
|
+
function cu(r, e) {
|
|
10150
|
+
const t = uu(r, e);
|
|
10123
10151
|
if (!t)
|
|
10124
10152
|
return e;
|
|
10125
|
-
const n =
|
|
10126
|
-
return
|
|
10153
|
+
const n = vo(t, r), s = n.next;
|
|
10154
|
+
return go(t, s.next), Lt(n, n.next), Lt(t, t.next);
|
|
10127
10155
|
}
|
|
10128
|
-
const
|
|
10129
|
-
let re = new Float64Array(0),
|
|
10130
|
-
const
|
|
10131
|
-
function
|
|
10132
|
-
const t = Math.ceil((r + 2 * e) /
|
|
10133
|
-
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;
|
|
10134
10162
|
}
|
|
10135
|
-
function
|
|
10163
|
+
function go(r, e) {
|
|
10136
10164
|
let t = r;
|
|
10137
10165
|
do {
|
|
10138
|
-
const n =
|
|
10139
|
-
|
|
10166
|
+
const n = fs++;
|
|
10167
|
+
gi[n] = t;
|
|
10140
10168
|
let s = t.x, i = t.y, o = t.x, a = t.y, c = 0;
|
|
10141
10169
|
do {
|
|
10142
10170
|
const d = t.next;
|
|
10143
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;
|
|
10144
|
-
} while (++c <
|
|
10145
|
-
|
|
10172
|
+
} while (++c < _o && t !== e);
|
|
10173
|
+
yi[n] = t;
|
|
10146
10174
|
const l = n * 4;
|
|
10147
10175
|
re[l] = s, re[l + 1] = i, re[l + 2] = o, re[l + 3] = a;
|
|
10148
10176
|
} while (t !== e);
|
|
10149
10177
|
}
|
|
10150
|
-
function
|
|
10178
|
+
function du(r, e) {
|
|
10151
10179
|
const t = r.z * 4;
|
|
10152
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);
|
|
10153
10181
|
}
|
|
10154
|
-
function
|
|
10155
|
-
let e =
|
|
10182
|
+
function Dr(r) {
|
|
10183
|
+
let e = yi[r];
|
|
10156
10184
|
for (; e.prev.next !== e; ) e = e.next;
|
|
10157
|
-
return
|
|
10185
|
+
return yi[r] = e, e;
|
|
10158
10186
|
}
|
|
10159
|
-
function
|
|
10160
|
-
let e =
|
|
10187
|
+
function Ir(r) {
|
|
10188
|
+
let e = gi[r];
|
|
10161
10189
|
for (; e.prev.next !== e; ) e = e.next;
|
|
10162
|
-
return
|
|
10190
|
+
return gi[r] = e, e;
|
|
10163
10191
|
}
|
|
10164
|
-
function
|
|
10192
|
+
function uu(r, e) {
|
|
10165
10193
|
let t = e;
|
|
10166
10194
|
const n = r.x, s = r.y;
|
|
10167
10195
|
let i = -1 / 0, o;
|
|
10168
10196
|
if (Cn(r, t)) return t;
|
|
10169
|
-
for (let h = 0, f = 0; h <
|
|
10197
|
+
for (let h = 0, f = 0; h < fs; h++, f += 4) {
|
|
10170
10198
|
if (s < re[f + 1] || s > re[f + 3] || re[f] > n || re[f + 2] <= i) continue;
|
|
10171
|
-
const g =
|
|
10172
|
-
t =
|
|
10199
|
+
const g = Dr(h);
|
|
10200
|
+
t = Ir(h);
|
|
10173
10201
|
do {
|
|
10174
10202
|
if (t.prev.next === t) {
|
|
10175
10203
|
if (Cn(r, t.next)) return t.next;
|
|
@@ -10185,39 +10213,39 @@ function du(r, e) {
|
|
|
10185
10213
|
if (!o) return null;
|
|
10186
10214
|
const a = o.x, c = o.y, l = Math.min(s, c), d = Math.max(s, c);
|
|
10187
10215
|
let u = 1 / 0;
|
|
10188
|
-
for (let h = 0, f = 0; h <
|
|
10216
|
+
for (let h = 0, f = 0; h < fs; h++, f += 4) {
|
|
10189
10217
|
if (re[f + 2] < a || re[f] > n || re[f + 3] < l || re[f + 1] > d) continue;
|
|
10190
|
-
const g =
|
|
10191
|
-
t =
|
|
10218
|
+
const g = Dr(h);
|
|
10219
|
+
t = Ir(h);
|
|
10192
10220
|
do {
|
|
10193
10221
|
if (t.prev.next === t && n >= t.x && t.x >= a && n !== t.x && // skip dead nodes
|
|
10194
|
-
|
|
10222
|
+
ms(s < c ? n : i, s, a, c, s < c ? i : n, s, t.x, t.y)) {
|
|
10195
10223
|
const y = Math.abs(s - t.y) / (n - t.x);
|
|
10196
|
-
(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);
|
|
10197
10225
|
}
|
|
10198
10226
|
t = t.next;
|
|
10199
10227
|
} while (t !== g);
|
|
10200
10228
|
}
|
|
10201
10229
|
return o;
|
|
10202
10230
|
}
|
|
10203
|
-
function
|
|
10231
|
+
function hu(r, e) {
|
|
10204
10232
|
return ae(r.prev, r, e.prev) < 0 && ae(e.next, r, r.next) < 0;
|
|
10205
10233
|
}
|
|
10206
|
-
const
|
|
10234
|
+
const Oe = [];
|
|
10207
10235
|
let jt = [], wt = new Uint32Array(0), cn = new Uint32Array(0);
|
|
10208
10236
|
const ln = new Uint32Array(256);
|
|
10209
|
-
function
|
|
10237
|
+
function fu(r, e, t, n) {
|
|
10210
10238
|
let s = r, i = 0;
|
|
10211
10239
|
do
|
|
10212
|
-
s.z =
|
|
10240
|
+
s.z = vi(s.x, s.y, e, t, n), Oe[i++] = s, s = s.next;
|
|
10213
10241
|
while (s !== r);
|
|
10214
|
-
|
|
10242
|
+
mu(i);
|
|
10215
10243
|
let o = null;
|
|
10216
10244
|
for (let a = 0; a < i; a++) {
|
|
10217
|
-
const c =
|
|
10245
|
+
const c = Oe[a];
|
|
10218
10246
|
c.prevZ = o, o && (o.nextZ = c), o = c;
|
|
10219
10247
|
}
|
|
10220
|
-
o.nextZ = null,
|
|
10248
|
+
o.nextZ = null, Oe.fill(
|
|
10221
10249
|
/** @type {Node} */
|
|
10222
10250
|
/** @type {unknown} */
|
|
10223
10251
|
null,
|
|
@@ -10231,22 +10259,22 @@ function hu(r, e, t, n) {
|
|
|
10231
10259
|
i
|
|
10232
10260
|
);
|
|
10233
10261
|
}
|
|
10234
|
-
function
|
|
10262
|
+
function mu(r) {
|
|
10235
10263
|
if (r <= 32) {
|
|
10236
10264
|
for (let e = 1; e < r; e++) {
|
|
10237
|
-
const t =
|
|
10265
|
+
const t = Oe[e], n = t.z;
|
|
10238
10266
|
let s = e - 1;
|
|
10239
|
-
for (; s >= 0 &&
|
|
10240
|
-
|
|
10241
|
-
|
|
10267
|
+
for (; s >= 0 && Oe[s].z > n; )
|
|
10268
|
+
Oe[s + 1] = Oe[s], s--;
|
|
10269
|
+
Oe[s + 1] = t;
|
|
10242
10270
|
}
|
|
10243
10271
|
return;
|
|
10244
10272
|
}
|
|
10245
10273
|
wt.length < r && (wt = new Uint32Array(r), cn = new Uint32Array(r), jt = new Array(r));
|
|
10246
|
-
for (let e = 0; e < r; e++) wt[e] =
|
|
10247
|
-
|
|
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);
|
|
10248
10276
|
}
|
|
10249
|
-
function
|
|
10277
|
+
function qn(r, e, t, n, s, i) {
|
|
10250
10278
|
ln.fill(0);
|
|
10251
10279
|
for (let a = 0; a < r; a++) ln[t[a] >>> i & 255]++;
|
|
10252
10280
|
let o = 0;
|
|
@@ -10259,24 +10287,24 @@ function Kn(r, e, t, n, s, i) {
|
|
|
10259
10287
|
n[l] = e[a], s[l] = c;
|
|
10260
10288
|
}
|
|
10261
10289
|
}
|
|
10262
|
-
function
|
|
10290
|
+
function vi(r, e, t, n, s) {
|
|
10263
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;
|
|
10264
10292
|
}
|
|
10265
|
-
function
|
|
10293
|
+
function pu(r) {
|
|
10266
10294
|
let e = r, t = r;
|
|
10267
10295
|
do
|
|
10268
10296
|
(e.x < t.x || e.x === t.x && e.y < t.y) && (t = e), e = e.next;
|
|
10269
10297
|
while (e !== r);
|
|
10270
10298
|
return t;
|
|
10271
10299
|
}
|
|
10272
|
-
function
|
|
10300
|
+
function ms(r, e, t, n, s, i, o, a) {
|
|
10273
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);
|
|
10274
10302
|
}
|
|
10275
|
-
function
|
|
10303
|
+
function _u(r, e) {
|
|
10276
10304
|
const t = Cn(r, e) && ae(r.prev, r, r.next) > 0 && ae(e.prev, e, e.next) > 0;
|
|
10277
10305
|
return r.next.i !== e.i && (t || On(r, e) && On(e, r) && // // locally visible
|
|
10278
10306
|
(ae(r.prev, r, e.prev) !== 0 || ae(r, e.prev, e) !== 0)) && // no opposite-facing sectors
|
|
10279
|
-
!
|
|
10307
|
+
!gu(r, e) && (t || yu(r, e));
|
|
10280
10308
|
}
|
|
10281
10309
|
function ae(r, e, t) {
|
|
10282
10310
|
return (e.y - r.y) * (t.x - e.x) - (e.x - r.x) * (t.y - e.y);
|
|
@@ -10284,14 +10312,14 @@ function ae(r, e, t) {
|
|
|
10284
10312
|
function Cn(r, e) {
|
|
10285
10313
|
return r.x === e.x && r.y === e.y;
|
|
10286
10314
|
}
|
|
10287
|
-
function
|
|
10315
|
+
function yo(r, e, t, n, s = !0) {
|
|
10288
10316
|
const i = ae(r, e, t), o = ae(r, e, n), a = ae(t, n, r), c = ae(t, n, e);
|
|
10289
|
-
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;
|
|
10290
10318
|
}
|
|
10291
|
-
function
|
|
10319
|
+
function Jn(r, e, t) {
|
|
10292
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);
|
|
10293
10321
|
}
|
|
10294
|
-
function
|
|
10322
|
+
function gu(r, e) {
|
|
10295
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);
|
|
10296
10324
|
let o = r;
|
|
10297
10325
|
do {
|
|
@@ -10300,7 +10328,7 @@ function _u(r, e) {
|
|
|
10300
10328
|
o = a;
|
|
10301
10329
|
continue;
|
|
10302
10330
|
}
|
|
10303
|
-
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;
|
|
10304
10332
|
o = a;
|
|
10305
10333
|
} while (o !== r);
|
|
10306
10334
|
return !1;
|
|
@@ -10308,7 +10336,7 @@ function _u(r, e) {
|
|
|
10308
10336
|
function On(r, e) {
|
|
10309
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;
|
|
10310
10338
|
}
|
|
10311
|
-
function
|
|
10339
|
+
function yu(r, e) {
|
|
10312
10340
|
let t = r, n = !1;
|
|
10313
10341
|
const s = (r.x + e.x) / 2, i = (r.y + e.y) / 2;
|
|
10314
10342
|
do {
|
|
@@ -10317,18 +10345,18 @@ function gu(r, e) {
|
|
|
10317
10345
|
} while (t !== r);
|
|
10318
10346
|
return n;
|
|
10319
10347
|
}
|
|
10320
|
-
function
|
|
10321
|
-
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;
|
|
10322
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;
|
|
10323
10351
|
}
|
|
10324
|
-
function
|
|
10325
|
-
const s =
|
|
10352
|
+
function Nr(r, e, t, n) {
|
|
10353
|
+
const s = xi(r, e, t);
|
|
10326
10354
|
return n ? (s.next = n.next, s.prev = n, n.next.prev = s, n.next = s) : (s.prev = s, s.next = s), s;
|
|
10327
10355
|
}
|
|
10328
|
-
function
|
|
10329
|
-
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);
|
|
10330
10358
|
}
|
|
10331
|
-
function
|
|
10359
|
+
function xi(r, e, t) {
|
|
10332
10360
|
return (
|
|
10333
10361
|
/** @type {Node} */
|
|
10334
10362
|
/** @type {unknown} */
|
|
@@ -10349,13 +10377,13 @@ function vi(r, e, t) {
|
|
|
10349
10377
|
}
|
|
10350
10378
|
);
|
|
10351
10379
|
}
|
|
10352
|
-
function
|
|
10380
|
+
function vu(r, e, t, n) {
|
|
10353
10381
|
let s = 0;
|
|
10354
10382
|
for (let i = e, o = t - n; i < t; i += n)
|
|
10355
10383
|
s += (r[o] - r[i]) * (r[i + 1] + r[o + 1]), o = i;
|
|
10356
10384
|
return s;
|
|
10357
10385
|
}
|
|
10358
|
-
function
|
|
10386
|
+
function xu(r, e) {
|
|
10359
10387
|
const t = [], n = (i) => {
|
|
10360
10388
|
for (let o = 0; o < t.length; o++)
|
|
10361
10389
|
if (t[o].distanceTo(i) <= e) return o;
|
|
@@ -10367,7 +10395,7 @@ function vu(r, e) {
|
|
|
10367
10395
|
}
|
|
10368
10396
|
return { segments: s, points: t };
|
|
10369
10397
|
}
|
|
10370
|
-
function
|
|
10398
|
+
function Ks(r) {
|
|
10371
10399
|
let e = 0;
|
|
10372
10400
|
for (let t = 0; t < r.length; t++) {
|
|
10373
10401
|
const n = (t + 1) % r.length;
|
|
@@ -10375,7 +10403,7 @@ function Ys(r) {
|
|
|
10375
10403
|
}
|
|
10376
10404
|
return e / 2;
|
|
10377
10405
|
}
|
|
10378
|
-
function
|
|
10406
|
+
function bu(r, e, t = 1e-9) {
|
|
10379
10407
|
let n = !1;
|
|
10380
10408
|
const s = r.x, i = r.y;
|
|
10381
10409
|
for (let o = 0, a = e.length - 1; o < e.length; a = o++) {
|
|
@@ -10386,13 +10414,13 @@ function xu(r, e, t = 1e-9) {
|
|
|
10386
10414
|
}
|
|
10387
10415
|
return n;
|
|
10388
10416
|
}
|
|
10389
|
-
function
|
|
10417
|
+
function wu(r, e) {
|
|
10390
10418
|
const t = r.reduce((s, i) => s + i.x, 0) / r.length, n = r.reduce((s, i) => s + i.y, 0) / r.length;
|
|
10391
|
-
return
|
|
10419
|
+
return bu(new p.Vector2(t, n), e);
|
|
10392
10420
|
}
|
|
10393
|
-
function
|
|
10421
|
+
function Eu(r, e) {
|
|
10394
10422
|
if (r.length < 3) return [];
|
|
10395
|
-
const { points: t, segments: n } =
|
|
10423
|
+
const { points: t, segments: n } = xu(r, e);
|
|
10396
10424
|
if (n.length < 3) return [];
|
|
10397
10425
|
const s = Array.from({ length: t.length }, () => []), i = (l, d) => l < d ? `${l},${d}` : `${d},${l}`, o = /* @__PURE__ */ new Set();
|
|
10398
10426
|
for (const [l, d] of n) {
|
|
@@ -10436,7 +10464,7 @@ function wu(r, e) {
|
|
|
10436
10464
|
}
|
|
10437
10465
|
return c.map((l) => l.map((d) => t[d]));
|
|
10438
10466
|
}
|
|
10439
|
-
function
|
|
10467
|
+
function Au(r, e, t, n) {
|
|
10440
10468
|
let s = r.distanceToPoint(e), i = r.distanceToPoint(t), o = r.distanceToPoint(n);
|
|
10441
10469
|
const a = 1e-10;
|
|
10442
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;
|
|
@@ -10460,7 +10488,7 @@ function Eu(r, e, t, n) {
|
|
|
10460
10488
|
d.every((h) => h.distanceTo(u) >= a) && d.push(u);
|
|
10461
10489
|
return d.length >= 2 ? [d[0], d[1]] : null;
|
|
10462
10490
|
}
|
|
10463
|
-
function
|
|
10491
|
+
function Tu(r) {
|
|
10464
10492
|
r.traverse((e) => {
|
|
10465
10493
|
var t;
|
|
10466
10494
|
if (e.isMesh || e.isLine) {
|
|
@@ -10475,52 +10503,52 @@ function Au(r) {
|
|
|
10475
10503
|
}
|
|
10476
10504
|
});
|
|
10477
10505
|
}
|
|
10478
|
-
function
|
|
10506
|
+
function Su(r, e, t) {
|
|
10479
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 = [];
|
|
10480
10508
|
r.traverse((R) => {
|
|
10481
|
-
const
|
|
10482
|
-
if (!
|
|
10483
|
-
const N =
|
|
10484
|
-
for (let
|
|
10485
|
-
const ee = new p.Vector3(N.getX(G.getX(
|
|
10486
|
-
N.getX(G.getX(
|
|
10487
|
-
N.getY(G.getX(
|
|
10488
|
-
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))
|
|
10489
10517
|
).applyMatrix4(Z), be = new p.Vector3(
|
|
10490
|
-
N.getX(G.getX(
|
|
10491
|
-
N.getY(G.getX(
|
|
10492
|
-
N.getZ(G.getX(
|
|
10493
|
-
).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);
|
|
10494
10522
|
le && l.push(le);
|
|
10495
10523
|
}
|
|
10496
10524
|
});
|
|
10497
|
-
const d =
|
|
10525
|
+
const d = Eu(l, n);
|
|
10498
10526
|
if (d.length === 0) return null;
|
|
10499
|
-
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);
|
|
10500
10528
|
for (let R = 0; R < w.length; R++) {
|
|
10501
10529
|
if (F[R]) continue;
|
|
10502
|
-
const
|
|
10530
|
+
const C = w[R], N = T[R], G = [], Z = [];
|
|
10503
10531
|
for (let z = R + 1; z < w.length; z++)
|
|
10504
|
-
!F[z] &&
|
|
10505
|
-
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());
|
|
10506
10534
|
for (let z = 0; z < Z.length; z++)
|
|
10507
|
-
|
|
10508
|
-
const
|
|
10509
|
-
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)
|
|
10510
10538
|
ee.push(z.x, z.y);
|
|
10511
10539
|
const $ = [];
|
|
10512
10540
|
let be = N.length;
|
|
10513
10541
|
for (const z of Z)
|
|
10514
10542
|
$.push(be), be += z.length;
|
|
10515
|
-
const le =
|
|
10543
|
+
const le = tu(ee, $.length > 0 ? $ : void 0, 2);
|
|
10516
10544
|
if (!le || le.length < 3) continue;
|
|
10517
10545
|
const Ue = [];
|
|
10518
10546
|
for (let z = 0; z < le.length; z += 3) {
|
|
10519
|
-
const Re =
|
|
10520
|
-
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]);
|
|
10521
10549
|
}
|
|
10522
10550
|
if (Ue.length < 3) continue;
|
|
10523
|
-
const Se = Ue, ne = [...
|
|
10551
|
+
const Se = Ue, ne = [...C, ...G.flat()], ue = new Float32Array(ne.length * 3);
|
|
10524
10552
|
for (let z = 0; z < ne.length; z++) {
|
|
10525
10553
|
const Re = ne[z].clone().add(P);
|
|
10526
10554
|
ue[z * 3] = Re.x, ue[z * 3 + 1] = Re.y, ue[z * 3 + 2] = Re.z;
|
|
@@ -10542,7 +10570,7 @@ function Tu(r, e, t) {
|
|
|
10542
10570
|
for (const R of V) L.add(R);
|
|
10543
10571
|
return L;
|
|
10544
10572
|
}
|
|
10545
|
-
class
|
|
10573
|
+
class Ru extends EventTarget {
|
|
10546
10574
|
constructor(t) {
|
|
10547
10575
|
super();
|
|
10548
10576
|
_(this, "bounds");
|
|
@@ -10682,7 +10710,7 @@ class Su extends EventTarget {
|
|
|
10682
10710
|
this.clear_caps();
|
|
10683
10711
|
const t = this.model;
|
|
10684
10712
|
for (const n of this.build_planes()) {
|
|
10685
|
-
const s =
|
|
10713
|
+
const s = Su(t, n, {
|
|
10686
10714
|
color: this.cap_color,
|
|
10687
10715
|
clipping_planes: this.planes
|
|
10688
10716
|
});
|
|
@@ -10697,7 +10725,7 @@ class Su extends EventTarget {
|
|
|
10697
10725
|
if (!n.isMesh) return;
|
|
10698
10726
|
const s = n;
|
|
10699
10727
|
if (!s.geometry || !s.geometry.index) return;
|
|
10700
|
-
const i = new
|
|
10728
|
+
const i = new eu(s, new fi(20, !0, "#222222"));
|
|
10701
10729
|
i.visible = this.outline_active, this.outline_meshes.push(i), s.add(i);
|
|
10702
10730
|
});
|
|
10703
10731
|
}
|
|
@@ -10722,7 +10750,7 @@ class Su extends EventTarget {
|
|
|
10722
10750
|
}));
|
|
10723
10751
|
for (const s of this.outline_meshes) {
|
|
10724
10752
|
const i = s.material;
|
|
10725
|
-
!Array.isArray(i) && i instanceof
|
|
10753
|
+
!Array.isArray(i) && i instanceof fi && i.set_clip_planes(n);
|
|
10726
10754
|
}
|
|
10727
10755
|
}
|
|
10728
10756
|
clear_caps() {
|
|
@@ -10732,7 +10760,7 @@ class Su extends EventTarget {
|
|
|
10732
10760
|
}
|
|
10733
10761
|
this.remove_outlines_for_group(this.caps);
|
|
10734
10762
|
for (const t of this.caps)
|
|
10735
|
-
this.scene.remove(t),
|
|
10763
|
+
this.scene.remove(t), Tu(t);
|
|
10736
10764
|
this.caps = [];
|
|
10737
10765
|
}
|
|
10738
10766
|
remove_visuals() {
|
|
@@ -10787,21 +10815,21 @@ class Su extends EventTarget {
|
|
|
10787
10815
|
this.bound_handlers = [];
|
|
10788
10816
|
}
|
|
10789
10817
|
}
|
|
10790
|
-
class
|
|
10818
|
+
class Mu extends EventTarget {
|
|
10791
10819
|
constructor(t) {
|
|
10792
10820
|
super();
|
|
10793
10821
|
_(this, "viewer");
|
|
10794
10822
|
_(this, "gizmo");
|
|
10795
10823
|
_(this, "section_box");
|
|
10796
10824
|
_(this, "sectioned_model");
|
|
10797
|
-
this.viewer = t, this.section_box = new
|
|
10825
|
+
this.viewer = t, this.section_box = new Ru();
|
|
10798
10826
|
}
|
|
10799
10827
|
/**
|
|
10800
10828
|
* Create gizmo and enter interactive edit mode
|
|
10801
10829
|
* @param model - Model to fit the section box to
|
|
10802
10830
|
*/
|
|
10803
10831
|
create_for_model(t) {
|
|
10804
|
-
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(
|
|
10805
10833
|
this.viewer.scene,
|
|
10806
10834
|
this.viewer.camera,
|
|
10807
10835
|
this.viewer.renderer.domElement,
|
|
@@ -10905,21 +10933,21 @@ class Ou extends EventTarget {
|
|
|
10905
10933
|
if (this.glimmer = t, typeof n == "string")
|
|
10906
10934
|
try {
|
|
10907
10935
|
const s = JSON.parse(n);
|
|
10908
|
-
this.story =
|
|
10936
|
+
this.story = $n.parse(s);
|
|
10909
10937
|
} catch (s) {
|
|
10910
10938
|
throw j.error("Failed to parse story JSON:", s), new ve(
|
|
10911
10939
|
`Invalid story JSON: ${s instanceof Error ? s.message : s}`,
|
|
10912
10940
|
"StoryManager",
|
|
10913
|
-
|
|
10941
|
+
Ce.INVALID_STORY_JSON,
|
|
10914
10942
|
{ error: s }
|
|
10915
10943
|
);
|
|
10916
10944
|
}
|
|
10917
10945
|
else
|
|
10918
|
-
this.story =
|
|
10919
|
-
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({
|
|
10920
10948
|
scene: this.glimmer.viewer.scene,
|
|
10921
10949
|
group_name: "story-annotations"
|
|
10922
|
-
}), 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);
|
|
10923
10951
|
}
|
|
10924
10952
|
/**
|
|
10925
10953
|
* Navigate to the next slide
|
|
@@ -11026,7 +11054,7 @@ class Ou extends EventTarget {
|
|
|
11026
11054
|
},
|
|
11027
11055
|
section_box_enabled: !1
|
|
11028
11056
|
}, a = this.section_box_manager.get_bounds();
|
|
11029
|
-
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);
|
|
11030
11058
|
}
|
|
11031
11059
|
/**
|
|
11032
11060
|
* Export the story as JSON
|
|
@@ -11041,7 +11069,7 @@ class Ou extends EventTarget {
|
|
|
11041
11069
|
* @returns The index where the slide was added
|
|
11042
11070
|
*/
|
|
11043
11071
|
add_slide(t, n) {
|
|
11044
|
-
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;
|
|
11045
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;
|
|
11046
11074
|
}
|
|
11047
11075
|
/**
|
|
@@ -11054,9 +11082,9 @@ class Ou extends EventTarget {
|
|
|
11054
11082
|
throw new ve(
|
|
11055
11083
|
`Invalid slide index: ${t}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11056
11084
|
"StoryManager",
|
|
11057
|
-
|
|
11085
|
+
Ce.INVALID_STORY_JSON
|
|
11058
11086
|
);
|
|
11059
|
-
const s = { ...this.story.slides[t], ...n }, i =
|
|
11087
|
+
const s = { ...this.story.slides[t], ...n }, i = ns.parse(s);
|
|
11060
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);
|
|
11061
11089
|
}
|
|
11062
11090
|
/**
|
|
@@ -11068,13 +11096,13 @@ class Ou extends EventTarget {
|
|
|
11068
11096
|
throw new ve(
|
|
11069
11097
|
"Cannot delete the last slide. Story must have at least one slide.",
|
|
11070
11098
|
"StoryManager",
|
|
11071
|
-
|
|
11099
|
+
Ce.INVALID_STORY_JSON
|
|
11072
11100
|
);
|
|
11073
11101
|
if (t < 0 || t >= this.story.slides.length)
|
|
11074
11102
|
throw new ve(
|
|
11075
11103
|
`Invalid slide index: ${t}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11076
11104
|
"StoryManager",
|
|
11077
|
-
|
|
11105
|
+
Ce.INVALID_STORY_JSON
|
|
11078
11106
|
);
|
|
11079
11107
|
const n = this.story.slides[t];
|
|
11080
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);
|
|
@@ -11089,13 +11117,13 @@ class Ou extends EventTarget {
|
|
|
11089
11117
|
throw new ve(
|
|
11090
11118
|
`Invalid from_index: ${t}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11091
11119
|
"StoryManager",
|
|
11092
|
-
|
|
11120
|
+
Ce.INVALID_STORY_JSON
|
|
11093
11121
|
);
|
|
11094
11122
|
if (n < 0 || n >= this.story.slides.length)
|
|
11095
11123
|
throw new ve(
|
|
11096
11124
|
`Invalid to_index: ${n}. Valid range: 0-${this.story.slides.length - 1}`,
|
|
11097
11125
|
"StoryManager",
|
|
11098
|
-
|
|
11126
|
+
Ce.INVALID_STORY_JSON
|
|
11099
11127
|
);
|
|
11100
11128
|
if (t === n)
|
|
11101
11129
|
return;
|
|
@@ -11110,17 +11138,17 @@ class Ou extends EventTarget {
|
|
|
11110
11138
|
if (typeof t == "string")
|
|
11111
11139
|
try {
|
|
11112
11140
|
const n = JSON.parse(t);
|
|
11113
|
-
this.story =
|
|
11141
|
+
this.story = $n.parse(n);
|
|
11114
11142
|
} catch (n) {
|
|
11115
11143
|
throw new ve(
|
|
11116
11144
|
`Invalid story JSON: ${n instanceof Error ? n.message : n}`,
|
|
11117
11145
|
"StoryManager",
|
|
11118
|
-
|
|
11146
|
+
Ce.INVALID_STORY_JSON,
|
|
11119
11147
|
{ error: n }
|
|
11120
11148
|
);
|
|
11121
11149
|
}
|
|
11122
11150
|
else
|
|
11123
|
-
this.story =
|
|
11151
|
+
this.story = $n.parse(t);
|
|
11124
11152
|
j.info("Story replaced:", this.story.title), this.current_index = 0, this.goto(0), this._emit_story_change("replace", 0);
|
|
11125
11153
|
}
|
|
11126
11154
|
/**
|
|
@@ -11135,7 +11163,7 @@ class Ou extends EventTarget {
|
|
|
11135
11163
|
throw new ve(
|
|
11136
11164
|
`Annotation index ${t} out of range`,
|
|
11137
11165
|
"StoryManager.add_annotation_anchor",
|
|
11138
|
-
|
|
11166
|
+
Ce.INVALID_SLIDE_INDEX
|
|
11139
11167
|
);
|
|
11140
11168
|
i.annotations[t].anchor = {
|
|
11141
11169
|
model_url: n,
|
|
@@ -11152,7 +11180,7 @@ class Ou extends EventTarget {
|
|
|
11152
11180
|
throw new ve(
|
|
11153
11181
|
`Annotation index ${t} out of range`,
|
|
11154
11182
|
"StoryManager.remove_annotation_anchor",
|
|
11155
|
-
|
|
11183
|
+
Ce.INVALID_SLIDE_INDEX
|
|
11156
11184
|
);
|
|
11157
11185
|
delete n.annotations[t].anchor, this._render_annotations(n.annotations), this._emit_story_change("update", this.current_index);
|
|
11158
11186
|
}
|
|
@@ -11174,7 +11202,7 @@ class Ou extends EventTarget {
|
|
|
11174
11202
|
throw new ve(
|
|
11175
11203
|
"No model loaded. Cannot enter section box edit mode.",
|
|
11176
11204
|
"StoryManager.enter_section_box_edit_mode",
|
|
11177
|
-
|
|
11205
|
+
Ce.MODEL_NOT_FOUND
|
|
11178
11206
|
);
|
|
11179
11207
|
this.section_box_manager.create_for_model(n);
|
|
11180
11208
|
}
|
|
@@ -11435,7 +11463,7 @@ _(Gt, "AXIS_COLORS", {
|
|
|
11435
11463
|
z: 255
|
|
11436
11464
|
// Blue
|
|
11437
11465
|
});
|
|
11438
|
-
let
|
|
11466
|
+
let Pr = Gt;
|
|
11439
11467
|
const Zt = class Zt extends EventTarget {
|
|
11440
11468
|
constructor() {
|
|
11441
11469
|
super();
|
|
@@ -11611,22 +11639,22 @@ _(Zt, "AXIS_COLORS", {
|
|
|
11611
11639
|
z: 255
|
|
11612
11640
|
// Blue
|
|
11613
11641
|
});
|
|
11614
|
-
let
|
|
11642
|
+
let zr = Zt;
|
|
11615
11643
|
export {
|
|
11616
|
-
|
|
11644
|
+
Yc as Environment,
|
|
11617
11645
|
Cu as Glimmer,
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
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,
|
|
11629
11657
|
Ou as StoryManager,
|
|
11630
|
-
|
|
11631
|
-
|
|
11658
|
+
yl as Sun,
|
|
11659
|
+
Gc as Viewer
|
|
11632
11660
|
};
|