endset_three_editor 0.2.3 → 0.2.4

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as Ge, ref as G, inject as Tn, computed as Ze, watchEffect as xn, resolveComponent as En, openBlock as N, createElementBlock as U, createElementVNode as g, normalizeClass as He, withModifiers as At, unref as Mn, toDisplayString as Ee, Fragment as en, renderList as tn, createBlock as ot, createCommentVNode as de, watch as nn, toRef as vn, provide as Sn, reactive as sn, withDirectives as D, vModelText as Q, vShow as he, shallowRef as Rn, onMounted as An, createVNode as Pn } from "vue";
1
+ import { defineComponent as Ge, ref as G, inject as xn, computed as Ze, watchEffect as En, resolveComponent as Mn, openBlock as N, createElementBlock as U, createElementVNode as g, normalizeClass as He, withModifiers as Lt, unref as vn, toDisplayString as Ee, Fragment as nn, renderList as sn, createBlock as ot, createCommentVNode as de, watch as on, toRef as Sn, provide as An, reactive as rn, withDirectives as D, vModelText as Q, vShow as he, shallowRef as Rn, onMounted as Pn, createVNode as Ln } from "vue";
2
2
  import * as F from "three";
3
- import { Controls as on, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as Pt, Vector2 as V, Ray as Ln, Plane as In, MathUtils as rn, Raycaster as On, Object3D as Ue, MeshBasicMaterial as _e, LineBasicMaterial as ke, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as ze, Float32BufferAttribute as ue, Mesh as T, OctahedronGeometry as Qe, Line as re, TorusGeometry as Pe, SphereGeometry as Cn, Euler as Dn, Matrix4 as Se, PlaneGeometry as Nn, DoubleSide as an, Loader as ln, FileLoader as xt, Color as pe, SRGBColorSpace as Re, Group as tt, Material as je, PointsMaterial as Ce, MeshPhongMaterial as kn, LineSegments as mt, Points as nt, TrianglesDrawMode as jn, TriangleFanDrawMode as gt, TriangleStripDrawMode as cn, LoaderUtils as Fe, MeshPhysicalMaterial as se, LinearSRGBColorSpace as ae, SpotLight as Fn, PointLight as Hn, DirectionalLight as Un, InstancedMesh as zn, InstancedBufferAttribute as Gn, TextureLoader as Xn, ImageBitmapLoader as Yn, BufferAttribute as rt, InterleavedBuffer as Bn, InterleavedBufferAttribute as Kn, LinearMipmapLinearFilter as hn, NearestMipmapLinearFilter as Vn, LinearMipmapNearestFilter as Zn, NearestMipmapNearestFilter as Qn, LinearFilter as yt, NearestFilter as un, RepeatWrapping as _t, MirroredRepeatWrapping as qn, ClampToEdgeWrapping as Wn, MeshStandardMaterial as dn, PropertyBinding as $n, SkinnedMesh as Jn, LineLoop as es, PerspectiveCamera as ts, OrthographicCamera as ns, Skeleton as ss, AnimationClip as is, Bone as os, InterpolateDiscrete as rs, InterpolateLinear as pn, Texture as Lt, VectorKeyframeTrack as It, NumberKeyframeTrack as Ot, QuaternionKeyframeTrack as Ct, ColorManagement as Dt, FrontSide as as, Interpolant as ls, Box3 as cs, Sphere as hs } from "three";
4
- import us from "@tweenjs/tween.js";
5
- const Nt = { type: "change" }, Et = { type: "start" }, fn = { type: "end" }, qe = new Ln(), kt = new In(), ds = Math.cos(70 * rn.DEG2RAD), k = new M(), B = 2 * Math.PI, P = {
3
+ import { Controls as an, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as It, Vector2 as V, Ray as In, Plane as On, MathUtils as ln, Raycaster as Cn, Object3D as Ue, MeshBasicMaterial as _e, LineBasicMaterial as ke, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as ze, Float32BufferAttribute as ue, Mesh as T, OctahedronGeometry as Qe, Line as re, TorusGeometry as Pe, SphereGeometry as Dn, Euler as Nn, Matrix4 as Se, PlaneGeometry as kn, DoubleSide as cn, Loader as hn, FileLoader as Et, Color as pe, SRGBColorSpace as Ae, Group as tt, Material as je, PointsMaterial as Ce, MeshPhongMaterial as jn, LineSegments as gt, Points as nt, TrianglesDrawMode as Fn, TriangleFanDrawMode as yt, TriangleStripDrawMode as un, LoaderUtils as Fe, MeshPhysicalMaterial as se, LinearSRGBColorSpace as ae, SpotLight as Hn, PointLight as Un, DirectionalLight as zn, InstancedMesh as Gn, InstancedBufferAttribute as Xn, TextureLoader as Yn, ImageBitmapLoader as Bn, BufferAttribute as rt, InterleavedBuffer as Kn, InterleavedBufferAttribute as Vn, LinearMipmapLinearFilter as dn, NearestMipmapLinearFilter as Zn, LinearMipmapNearestFilter as Qn, NearestMipmapNearestFilter as qn, LinearFilter as _t, NearestFilter as pn, RepeatWrapping as bt, MirroredRepeatWrapping as Wn, ClampToEdgeWrapping as $n, MeshStandardMaterial as fn, PropertyBinding as Jn, SkinnedMesh as es, LineLoop as ts, PerspectiveCamera as ns, OrthographicCamera as ss, Skeleton as is, AnimationClip as os, Bone as rs, InterpolateDiscrete as as, InterpolateLinear as mn, Texture as Ot, VectorKeyframeTrack as Ct, NumberKeyframeTrack as Dt, QuaternionKeyframeTrack as Nt, ColorManagement as kt, FrontSide as ls, Interpolant as cs, Box3 as hs, Sphere as us } from "three";
4
+ import ds from "@tweenjs/tween.js";
5
+ const jt = { type: "change" }, Mt = { type: "start" }, gn = { type: "end" }, qe = new In(), Ft = new On(), ps = Math.cos(70 * ln.DEG2RAD), k = new M(), B = 2 * Math.PI, P = {
6
6
  NONE: -1,
7
7
  ROTATE: 0,
8
8
  DOLLY: 1,
@@ -12,7 +12,7 @@ const Nt = { type: "change" }, Et = { type: "start" }, fn = { type: "end" }, qe
12
12
  TOUCH_DOLLY_PAN: 5,
13
13
  TOUCH_DOLLY_ROTATE: 6
14
14
  }, at = 1e-6;
15
- class ps extends on {
15
+ class fs extends an {
16
16
  /**
17
17
  * Constructs a new controls instance.
18
18
  *
@@ -20,7 +20,7 @@ class ps extends on {
20
20
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
21
21
  */
22
22
  constructor(e, t = null) {
23
- super(e, t), this.state = P.NONE, this.target = new M(), this.cursor = new M(), 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: Me.ROTATE, MIDDLE: Me.DOLLY, RIGHT: Me.PAN }, this.touches = { ONE: xe.ROTATE, TWO: xe.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Pt(), this._sphericalDelta = new Pt(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new V(), this._rotateEnd = new V(), this._rotateDelta = new V(), this._panStart = new V(), this._panEnd = new V(), this._panDelta = new V(), this._dollyStart = new V(), this._dollyEnd = new V(), this._dollyDelta = new V(), this._dollyDirection = new M(), this._mouse = new V(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ms.bind(this), this._onPointerDown = fs.bind(this), this._onPointerUp = gs.bind(this), this._onContextMenu = Es.bind(this), this._onMouseWheel = bs.bind(this), this._onKeyDown = ws.bind(this), this._onTouchStart = Ts.bind(this), this._onTouchMove = xs.bind(this), this._onMouseDown = ys.bind(this), this._onMouseMove = _s.bind(this), this._interceptControlDown = Ms.bind(this), this._interceptControlUp = vs.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
23
+ super(e, t), this.state = P.NONE, this.target = new M(), this.cursor = new M(), 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: Me.ROTATE, MIDDLE: Me.DOLLY, RIGHT: Me.PAN }, this.touches = { ONE: xe.ROTATE, TWO: xe.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new It(), this._sphericalDelta = new It(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new V(), this._rotateEnd = new V(), this._rotateDelta = new V(), this._panStart = new V(), this._panEnd = new V(), this._panDelta = new V(), this._dollyStart = new V(), this._dollyEnd = new V(), this._dollyDelta = new V(), this._dollyDirection = new M(), this._mouse = new V(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = gs.bind(this), this._onPointerDown = ms.bind(this), this._onPointerUp = ys.bind(this), this._onContextMenu = Ms.bind(this), this._onMouseWheel = ws.bind(this), this._onKeyDown = Ts.bind(this), this._onTouchStart = xs.bind(this), this._onTouchMove = Es.bind(this), this._onMouseDown = _s.bind(this), this._onMouseMove = bs.bind(this), this._interceptControlDown = vs.bind(this), this._interceptControlUp = Ss.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
24
24
  }
25
25
  /**
26
26
  * Defines the visual representation of the cursor.
@@ -93,7 +93,7 @@ class ps extends on {
93
93
  * was called, or the initial state.
94
94
  */
95
95
  reset() {
96
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Nt), this.update(), this.state = P.NONE;
96
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(jt), this.update(), this.state = P.NONE;
97
97
  }
98
98
  /**
99
99
  * Programmatically pan the camera.
@@ -164,12 +164,12 @@ class ps extends on {
164
164
  h.unproject(this.object), this.object.position.sub(h).add(a), this.object.updateMatrixWorld(), o = k.length();
165
165
  } else
166
166
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
167
- o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (qe.origin.copy(this.object.position), qe.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(qe.direction)) < ds ? this.object.lookAt(this.target) : (kt.setFromNormalAndCoplanarPoint(this.object.up, this.target), qe.intersectPlane(kt, this.target))));
167
+ o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (qe.origin.copy(this.object.position), qe.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(qe.direction)) < ps ? this.object.lookAt(this.target) : (Ft.setFromNormalAndCoplanarPoint(this.object.up, this.target), qe.intersectPlane(Ft, this.target))));
168
168
  } else if (this.object.isOrthographicCamera) {
169
169
  const o = this.object.zoom;
170
170
  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);
171
171
  }
172
- return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > at || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > at || this._lastTargetPosition.distanceToSquared(this.target) > at ? (this.dispatchEvent(Nt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
172
+ return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > at || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > at || this._lastTargetPosition.distanceToSquared(this.target) > at ? (this.dispatchEvent(jt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
173
173
  }
174
174
  _getAutoRotationAngle(e) {
175
175
  return e !== null ? B / 60 * this.autoRotateSpeed * e : B / 60 / 60 * this.autoRotateSpeed;
@@ -361,16 +361,16 @@ class ps extends on {
361
361
  return e.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
362
362
  }
363
363
  }
364
- function fs(r) {
364
+ function ms(r) {
365
365
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(r.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(r) && (this._addPointer(r), r.pointerType === "touch" ? this._onTouchStart(r) : this._onMouseDown(r), this._cursorStyle === "grab" && (this.domElement.style.cursor = "grabbing")));
366
366
  }
367
- function ms(r) {
367
+ function gs(r) {
368
368
  this.enabled !== !1 && (r.pointerType === "touch" ? this._onTouchMove(r) : this._onMouseMove(r));
369
369
  }
370
- function gs(r) {
370
+ function ys(r) {
371
371
  switch (this._removePointer(r), this._pointers.length) {
372
372
  case 0:
373
- this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(fn), this.state = P.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
373
+ this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(gn), this.state = P.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
374
374
  break;
375
375
  case 1:
376
376
  const e = this._pointers[0], t = this._pointerPositions[e];
@@ -378,7 +378,7 @@ function gs(r) {
378
378
  break;
379
379
  }
380
380
  }
381
- function ys(r) {
381
+ function _s(r) {
382
382
  let e;
383
383
  switch (r.button) {
384
384
  case 0:
@@ -419,9 +419,9 @@ function ys(r) {
419
419
  default:
420
420
  this.state = P.NONE;
421
421
  }
422
- this.state !== P.NONE && this.dispatchEvent(Et);
422
+ this.state !== P.NONE && this.dispatchEvent(Mt);
423
423
  }
424
- function _s(r) {
424
+ function bs(r) {
425
425
  switch (this.state) {
426
426
  case P.ROTATE:
427
427
  if (this.enableRotate === !1) return;
@@ -437,13 +437,13 @@ function _s(r) {
437
437
  break;
438
438
  }
439
439
  }
440
- function bs(r) {
441
- this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(Et), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(fn));
442
- }
443
440
  function ws(r) {
444
- this.enabled !== !1 && this._handleKeyDown(r);
441
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== P.NONE || (r.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(gn));
445
442
  }
446
443
  function Ts(r) {
444
+ this.enabled !== !1 && this._handleKeyDown(r);
445
+ }
446
+ function xs(r) {
447
447
  switch (this._trackPointer(r), this._pointers.length) {
448
448
  case 1:
449
449
  switch (this.touches.ONE) {
@@ -476,9 +476,9 @@ function Ts(r) {
476
476
  default:
477
477
  this.state = P.NONE;
478
478
  }
479
- this.state !== P.NONE && this.dispatchEvent(Et);
479
+ this.state !== P.NONE && this.dispatchEvent(Mt);
480
480
  }
481
- function xs(r) {
481
+ function Es(r) {
482
482
  switch (this._trackPointer(r), this.state) {
483
483
  case P.TOUCH_ROTATE:
484
484
  if (this.enableRotate === !1) return;
@@ -500,21 +500,21 @@ function xs(r) {
500
500
  this.state = P.NONE;
501
501
  }
502
502
  }
503
- function Es(r) {
503
+ function Ms(r) {
504
504
  this.enabled !== !1 && r.preventDefault();
505
505
  }
506
- function Ms(r) {
506
+ function vs(r) {
507
507
  r.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
508
508
  }
509
- function vs(r) {
509
+ function Ss(r) {
510
510
  r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
511
511
  }
512
- const me = new On(), H = new M(), le = new M(), O = new K(), jt = {
512
+ const me = new Cn(), H = new M(), le = new M(), O = new K(), Ht = {
513
513
  X: new M(1, 0, 0),
514
514
  Y: new M(0, 1, 0),
515
515
  Z: new M(0, 0, 1)
516
- }, lt = { type: "change" }, Ft = { type: "mouseDown", mode: null }, Ht = { type: "mouseUp", mode: null }, Ut = { type: "objectChange" };
517
- class Ss extends on {
516
+ }, lt = { type: "change" }, Ut = { type: "mouseDown", mode: null }, zt = { type: "mouseUp", mode: null }, Gt = { type: "objectChange" };
517
+ class As extends an {
518
518
  /**
519
519
  * Constructs a new controls instance.
520
520
  *
@@ -523,27 +523,27 @@ class Ss extends on {
523
523
  */
524
524
  constructor(e, t = null) {
525
525
  super(void 0, t);
526
- const s = new Os(this);
526
+ const s = new Cs(this);
527
527
  this._root = s;
528
- const n = new Cs();
528
+ const n = new Ds();
529
529
  this._gizmo = n, s.add(n);
530
- const i = new Ds();
530
+ const i = new Ns();
531
531
  this._plane = i, s.add(i);
532
532
  const o = this;
533
533
  function a(x, S) {
534
- let A = S;
534
+ let R = S;
535
535
  Object.defineProperty(o, x, {
536
536
  get: function() {
537
- return A !== void 0 ? A : S;
537
+ return R !== void 0 ? R : S;
538
538
  },
539
539
  set: function(v) {
540
- A !== v && (A = v, i[x] = v, n[x] = v, o.dispatchEvent({ type: x + "-changed", value: v }), o.dispatchEvent(lt));
540
+ R !== v && (R = v, i[x] = v, n[x] = v, o.dispatchEvent({ type: x + "-changed", value: v }), o.dispatchEvent(lt));
541
541
  }
542
542
  }), o[x] = S, i[x] = S, n[x] = S;
543
543
  }
544
544
  a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
545
545
  const l = new M(), h = new M(), u = new K(), c = new K(), p = new M(), m = new K(), b = new M(), f = new M(), y = new M(), d = 0, _ = new M();
546
- a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = Rs.bind(this), this._onPointerDown = Ps.bind(this), this._onPointerHover = As.bind(this), this._onPointerMove = Ls.bind(this), this._onPointerUp = Is.bind(this), t !== null && this.connect(t);
546
+ a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = Rs.bind(this), this._onPointerDown = Ls.bind(this), this._onPointerHover = Ps.bind(this), this._onPointerMove = Is.bind(this), this._onPointerUp = Os.bind(this), t !== null && this.connect(t);
547
547
  }
548
548
  connect(e) {
549
549
  super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
@@ -570,7 +570,7 @@ class Ss extends on {
570
570
  if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
571
571
  e !== null && me.setFromCamera(e, this.camera);
572
572
  const t = ct(this._plane, me, !0);
573
- t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, Ft.mode = this.mode, this.dispatchEvent(Ft);
573
+ t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, Ut.mode = this.mode, this.dispatchEvent(Ut);
574
574
  }
575
575
  }
576
576
  pointerMove(e) {
@@ -593,13 +593,13 @@ class Ss extends on {
593
593
  this._offset.copy(this.pointEnd).sub(this.pointStart);
594
594
  const a = 20 / this.worldPosition.distanceTo(H.setFromMatrixPosition(this.camera.matrixWorld));
595
595
  let l = !1;
596
- t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(H.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(jt[t]), H.copy(jt[t]), i === "local" && H.applyQuaternion(this.worldQuaternion), H.cross(this.eye), H.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(H.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
596
+ t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(H.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Ht[t]), H.copy(Ht[t]), i === "local" && H.applyQuaternion(this.worldQuaternion), H.cross(this.eye), H.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(H.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(O.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
597
597
  }
598
- this.dispatchEvent(lt), this.dispatchEvent(Ut);
598
+ this.dispatchEvent(lt), this.dispatchEvent(Gt);
599
599
  }
600
600
  }
601
601
  pointerUp(e) {
602
- e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (Ht.mode = this.mode, this.dispatchEvent(Ht)), this.dragging = !1, this.axis = null);
602
+ e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (zt.mode = this.mode, this.dispatchEvent(zt)), this.dragging = !1, this.axis = null);
603
603
  }
604
604
  dispose() {
605
605
  this.disconnect(), this._root.dispose();
@@ -625,7 +625,7 @@ class Ss extends on {
625
625
  * Resets the object's position, rotation and scale to when the current transform began.
626
626
  */
627
627
  reset() {
628
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(lt), this.dispatchEvent(Ut), this.pointStart.copy(this.pointEnd));
628
+ this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(lt), this.dispatchEvent(Gt), this.pointStart.copy(this.pointEnd));
629
629
  }
630
630
  /**
631
631
  * Returns the raycaster that is used for user interaction. This object is shared between all
@@ -721,7 +721,7 @@ function Rs(r) {
721
721
  };
722
722
  }
723
723
  }
724
- function As(r) {
724
+ function Ps(r) {
725
725
  if (this.enabled)
726
726
  switch (r.pointerType) {
727
727
  case "mouse":
@@ -730,13 +730,13 @@ function As(r) {
730
730
  break;
731
731
  }
732
732
  }
733
- function Ps(r) {
733
+ function Ls(r) {
734
734
  this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(r.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(r)), this.pointerDown(this._getPointer(r)));
735
735
  }
736
- function Ls(r) {
736
+ function Is(r) {
737
737
  this.enabled && this.pointerMove(this._getPointer(r));
738
738
  }
739
- function Is(r) {
739
+ function Os(r) {
740
740
  this.enabled && (this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(r)));
741
741
  }
742
742
  function ct(r, e, t) {
@@ -746,8 +746,8 @@ function ct(r, e, t) {
746
746
  return s[n];
747
747
  return !1;
748
748
  }
749
- const We = new Dn(), L = new M(0, 1, 0), zt = new M(0, 0, 0), Gt = new Se(), $e = new K(), st = new K(), te = new M(), Xt = new Se(), De = new M(1, 0, 0), ye = new M(0, 1, 0), Ne = new M(0, 0, 1), Je = new M(), Le = new M(), Ie = new M();
750
- class Os extends Ue {
749
+ const We = new Nn(), L = new M(0, 1, 0), Xt = new M(0, 0, 0), Yt = new Se(), $e = new K(), st = new K(), te = new M(), Bt = new Se(), De = new M(1, 0, 0), ye = new M(0, 1, 0), Ne = new M(0, 0, 1), Je = new M(), Le = new M(), Ie = new M();
750
+ class Cs extends Ue {
751
751
  constructor(e) {
752
752
  super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
753
753
  }
@@ -762,7 +762,7 @@ class Os extends Ue {
762
762
  });
763
763
  }
764
764
  }
765
- class Cs extends Ue {
765
+ class Ds extends Ue {
766
766
  constructor() {
767
767
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
768
768
  const e = new _e({
@@ -826,7 +826,7 @@ class Cs extends Ue {
826
826
  const Z = new ze();
827
827
  return Z.setAttribute("position", new ue([0, 0, 0, 1, 1, 1], 3)), Z;
828
828
  }
829
- const A = {
829
+ const R = {
830
830
  X: [
831
831
  [new T(f, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
832
832
  [new T(f, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
@@ -920,7 +920,7 @@ class Cs extends Ue {
920
920
  ]
921
921
  }, fe = {
922
922
  XYZE: [
923
- [new T(new Cn(0.25, 10, 8), s)]
923
+ [new T(new Dn(0.25, 10, 8), s)]
924
924
  ],
925
925
  X: [
926
926
  [new T(new Pe(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
@@ -1002,14 +1002,14 @@ class Cs extends Ue {
1002
1002
  const Ye = new Ue();
1003
1003
  for (const J in Z)
1004
1004
  for (let Te = Z[J].length; Te--; ) {
1005
- const X = Z[J][Te][0].clone(), Be = Z[J][Te][1], Ke = Z[J][Te][2], Ve = Z[J][Te][3], wn = Z[J][Te][4];
1006
- X.name = J, X.tag = wn, Be && X.position.set(Be[0], Be[1], Be[2]), Ke && X.rotation.set(Ke[0], Ke[1], Ke[2]), Ve && X.scale.set(Ve[0], Ve[1], Ve[2]), X.updateMatrix();
1007
- const Rt = X.geometry.clone();
1008
- Rt.applyMatrix4(X.matrix), X.geometry = Rt, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1), Ye.add(X);
1005
+ const X = Z[J][Te][0].clone(), Be = Z[J][Te][1], Ke = Z[J][Te][2], Ve = Z[J][Te][3], Tn = Z[J][Te][4];
1006
+ X.name = J, X.tag = Tn, Be && X.position.set(Be[0], Be[1], Be[2]), Ke && X.rotation.set(Ke[0], Ke[1], Ke[2]), Ve && X.scale.set(Ve[0], Ve[1], Ve[2]), X.updateMatrix();
1007
+ const Pt = X.geometry.clone();
1008
+ Pt.applyMatrix4(X.matrix), X.geometry = Pt, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1), Ye.add(X);
1009
1009
  }
1010
1010
  return Ye;
1011
1011
  }
1012
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(A)), this.add(this.gizmo.rotate = oe(ie)), this.add(this.gizmo.scale = oe($)), this.add(this.picker.translate = oe(v)), this.add(this.picker.rotate = oe(fe)), this.add(this.picker.scale = oe(E)), this.add(this.helper.translate = oe(I)), this.add(this.helper.rotate = oe(ee)), this.add(this.helper.scale = oe(j)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1012
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(R)), this.add(this.gizmo.rotate = oe(ie)), this.add(this.gizmo.scale = oe($)), this.add(this.picker.translate = oe(v)), this.add(this.picker.rotate = oe(fe)), this.add(this.picker.scale = oe(E)), this.add(this.helper.translate = oe(I)), this.add(this.helper.rotate = oe(ee)), this.add(this.helper.scale = oe(j)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1013
1013
  }
1014
1014
  // updateMatrixWorld will update transformations and appearance of individual handles
1015
1015
  updateMatrixWorld(e) {
@@ -1022,21 +1022,21 @@ class Cs extends Ue {
1022
1022
  o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
1023
1023
  let a;
1024
1024
  if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), o.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), o.tag === "helper") {
1025
- o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (O.setFromEuler(We.set(0, 0, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (O.setFromEuler(We.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (O.setFromEuler(We.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (O.setFromEuler(We.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(Gt.lookAt(zt, L, ye)), o.quaternion.multiply(O), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), H.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), H.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(H), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
1025
+ o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (O.setFromEuler(We.set(0, 0, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (O.setFromEuler(We.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (O.setFromEuler(We.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(O), Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (O.setFromEuler(We.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(Yt.lookAt(Xt, L, ye)), o.quaternion.multiply(O), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), H.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), H.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(H), o.visible = this.dragging) : (o.quaternion.copy(s), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
1026
1026
  continue;
1027
1027
  }
1028
- o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && ($e.copy(s), L.copy(this.eye).applyQuaternion(O.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(Gt.lookAt(this.eye, zt, ye)), o.name === "X" && (O.setFromAxisAngle(De, Math.atan2(-L.y, L.z)), O.multiplyQuaternions($e, O), o.quaternion.copy(O)), o.name === "Y" && (O.setFromAxisAngle(ye, Math.atan2(L.x, L.z)), O.multiplyQuaternions($e, O), o.quaternion.copy(O)), o.name === "Z" && (O.setFromAxisAngle(Ne, Math.atan2(L.y, L.x)), O.multiplyQuaternions($e, O), o.quaternion.copy(O))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
1028
+ o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(L.copy(Ne).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(L.copy(De).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(L.copy(ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && ($e.copy(s), L.copy(this.eye).applyQuaternion(O.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(Yt.lookAt(this.eye, Xt, ye)), o.name === "X" && (O.setFromAxisAngle(De, Math.atan2(-L.y, L.z)), O.multiplyQuaternions($e, O), o.quaternion.copy(O)), o.name === "Y" && (O.setFromAxisAngle(ye, Math.atan2(L.x, L.z)), O.multiplyQuaternions($e, O), o.quaternion.copy(O)), o.name === "Z" && (O.setFromAxisAngle(Ne, Math.atan2(L.y, L.x)), O.multiplyQuaternions($e, O), o.quaternion.copy(O))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
1029
1029
  return o.name === l;
1030
1030
  }) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
1031
1031
  }
1032
1032
  super.updateMatrixWorld(e);
1033
1033
  }
1034
1034
  }
1035
- class Ds extends T {
1035
+ class Ns extends T {
1036
1036
  constructor() {
1037
1037
  super(
1038
- new Nn(1e5, 1e5, 2, 2),
1039
- new _e({ visible: !1, wireframe: !0, side: an, transparent: !0, opacity: 0.1, toneMapped: !1 })
1038
+ new kn(1e5, 1e5, 2, 2),
1039
+ new _e({ visible: !1, wireframe: !0, side: cn, transparent: !0, opacity: 0.1, toneMapped: !1 })
1040
1040
  ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
1041
1041
  }
1042
1042
  updateMatrixWorld(e) {
@@ -1073,7 +1073,7 @@ class Ds extends T {
1073
1073
  default:
1074
1074
  te.set(0, 0, 0);
1075
1075
  }
1076
- te.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Xt.lookAt(H.set(0, 0, 0), te, L), this.quaternion.setFromRotationMatrix(Xt)), super.updateMatrixWorld(e);
1076
+ te.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Bt.lookAt(H.set(0, 0, 0), te, L), this.quaternion.setFromRotationMatrix(Bt)), super.updateMatrixWorld(e);
1077
1077
  }
1078
1078
  }
1079
1079
  const w = {
@@ -1095,87 +1095,86 @@ const w = {
1095
1095
  /** 当前选中的物体 */
1096
1096
  selectedObject: null
1097
1097
  };
1098
- let ht = !1, Ae = !1, be = null, bt = null, it = null, we = [];
1099
- function Ns(r, e = "edit", t) {
1100
- if (w.container = r, w.mode = e, ks(), js(), Hs(), t) {
1101
- ei(t.scene, e);
1098
+ let ht = !1, Re = !1, be = null, wt = null, it = null, we = [], ut;
1099
+ function ks(r, e = "edit", t) {
1100
+ if (w.container = r, w.mode = e, js(), Fs(), Us(), t && (ti(t.scene, e), t != null && t.camera)) {
1102
1101
  const s = t.camera;
1103
1102
  w.camera.position.set(
1104
- s.position.x,
1105
- s.position.y,
1106
- s.position.z
1103
+ s.position[0],
1104
+ s.position[1],
1105
+ s.position[2]
1107
1106
  ), w.camera.rotation.set(
1108
- s.rotation._x,
1109
- s.rotation._y,
1110
- s.rotation._z
1111
- );
1107
+ s.rotation[0],
1108
+ s.rotation[1],
1109
+ s.rotation[2]
1110
+ ), w.camera.updateProjectionMatrix(), ut = s.target;
1112
1111
  }
1113
- zs(), Us(), Qs(), mn(), e === "edit" && r.addEventListener("click", Ys), window.addEventListener("resize", Xs), t || Gs(), e === "edit" && Fs();
1112
+ Gs(), zs(), ut && w.orbitControls && (w.orbitControls.target.fromArray(ut), w.orbitControls.update()), qs(), yn(), e === "edit" && r.addEventListener("click", Bs), window.addEventListener("resize", Ys), t || Xs(), e === "edit" && Hs();
1114
1113
  }
1115
- function ks() {
1114
+ function js() {
1116
1115
  const r = new F.WebGLRenderer({ antialias: !0, alpha: !0 });
1117
1116
  r.setSize(w.container.clientWidth, w.container.clientHeight), r.setPixelRatio(Math.min(window.devicePixelRatio, 2)), w.container.appendChild(r.domElement), w.renderer = r;
1118
1117
  }
1119
- function js() {
1118
+ function Fs() {
1120
1119
  w.scene = new F.Scene(), w.scene.name = "sl_scene";
1121
1120
  }
1122
- function Fs() {
1121
+ function Hs() {
1123
1122
  const r = new F.GridHelper(30, 30, 8956671, 3364232);
1124
1123
  r.name = "地板", r.userData.type = "initFloor", w.scene.add(r), w.gridHelper = r;
1125
1124
  }
1126
- function Hs() {
1125
+ function Us() {
1127
1126
  const r = w.container, e = r.clientWidth / r.clientHeight, t = new F.PerspectiveCamera(45, e, 0.1, 1e3);
1128
1127
  t.position.set(0, 6, 15), t.lookAt(0, 0, 0), w.camera = t;
1129
1128
  }
1130
- function Us() {
1131
- const r = new ps(w.camera, w.renderer.domElement);
1129
+ function zs() {
1130
+ const r = new fs(w.camera, w.renderer.domElement);
1132
1131
  r.minDistance = 0, r.maxDistance = 1 / 0, r.addEventListener("start", () => {
1133
1132
  ht = !1;
1134
1133
  }), r.addEventListener("change", () => {
1135
1134
  ht = !0;
1136
1135
  }), r.addEventListener("end", () => {
1137
- ht && (Ae = !0, setTimeout(() => {
1138
- Ae = !1;
1136
+ ht && (Re = !0, setTimeout(() => {
1137
+ Re = !1;
1139
1138
  }, 200));
1140
1139
  }), w.orbitControls = r;
1141
1140
  }
1142
- function zs() {
1143
- const r = new Ss(
1141
+ function Gs() {
1142
+ const r = new As(
1144
1143
  w.camera,
1145
1144
  w.renderer.domElement
1146
1145
  );
1147
1146
  r.addEventListener("dragging-changed", (e) => {
1148
- w.orbitControls.enabled = !e.value, e.value || (Ae = !0, setTimeout(() => {
1149
- Ae = !1;
1147
+ w.orbitControls.enabled = !e.value, e.value || (Re = !0, setTimeout(() => {
1148
+ Re = !1;
1150
1149
  }, 200));
1151
1150
  }), r.addEventListener("objectChange", () => {
1152
- bt && w.selectedObject && bt(w.selectedObject);
1151
+ wt && w.selectedObject && wt(w.selectedObject);
1153
1152
  }), w.scene.add(r.getHelper()), w.transformControls = r;
1154
1153
  }
1155
- function Gs() {
1154
+ function Xs() {
1156
1155
  const r = new F.AmbientLight(16777215, 2);
1157
1156
  w.scene.add(r);
1158
1157
  const e = new F.DirectionalLight(16777215, 3);
1159
1158
  e.position.set(48, 104, 138), w.scene.add(e);
1160
1159
  }
1161
- function mn() {
1160
+ function yn() {
1162
1161
  var r, e;
1163
- requestAnimationFrame(mn), us.update(), (r = w.orbitControls) == null || r.update(), (e = w.renderer) == null || e.render(w.scene, w.camera);
1162
+ requestAnimationFrame(yn), ds.update(), (r = w.orbitControls) == null || r.update(), (e = w.renderer) == null || e.render(w.scene, w.camera);
1164
1163
  }
1165
- function Xs() {
1164
+ function Ys() {
1166
1165
  if (!w.container || !w.camera || !w.renderer) return;
1167
1166
  const r = w.container.clientWidth, e = w.container.clientHeight;
1168
1167
  r === 0 || e === 0 || (w.camera.aspect = r / e, w.camera.updateProjectionMatrix(), w.renderer.setSize(r, e));
1169
1168
  }
1170
- function Mt(r) {
1169
+ function vt(r) {
1171
1170
  w.selectedObject !== r && (w.selectedObject && w.transformControls.detach(), w.selectedObject = r, w.transformControls.attach(r), w.transformControls.setMode("translate"), w.transformControls.showX = !0, w.transformControls.showY = !0, w.transformControls.showZ = !0, be == null || be(r));
1172
1171
  }
1173
- function gn() {
1172
+ function St() {
1174
1173
  w.selectedObject && (w.transformControls.detach(), w.selectedObject = null, be == null || be(null));
1175
1174
  }
1176
- function Ys(r) {
1177
- if (Ae) {
1178
- Ae = !1;
1175
+ function Bs(r) {
1176
+ if (Re) {
1177
+ Re = !1;
1179
1178
  return;
1180
1179
  }
1181
1180
  const e = w.renderer.domElement.getBoundingClientRect(), t = new F.Vector2(
@@ -1188,76 +1187,78 @@ function Ys(r) {
1188
1187
  o.type === "Mesh" && o.userData.isMovable && n.push(o);
1189
1188
  });
1190
1189
  const i = s.intersectObjects(n);
1191
- i.length > 0 ? Mt(i[0].object) : gn();
1192
- }
1193
- function vt(r, e = !1) {
1194
- w.scene.add(r), r.userData.isMovable && (Vs(r), St()), e && w.mode === "edit" && Mt(r);
1190
+ i.length > 0 ? vt(i[0].object) : St();
1195
1191
  }
1196
- function Bs(r) {
1197
- w.selectedObject === r && gn(), r.parent ? r.parent.remove(r) : w.scene.remove(r), Zs(r), St();
1192
+ function At(r, e = !1) {
1193
+ w.scene.add(r), r.userData.isMovable && (Zs(r), Rt()), e && w.mode === "edit" && vt(r);
1198
1194
  }
1199
1195
  function Ks(r) {
1200
- const e = w.scene.getObjectByProperty("uuid", r);
1201
- e && Bs(e);
1196
+ w.selectedObject === r && St(), r.parent ? r.parent.remove(r) : w.scene.remove(r), Qs(r), Rt();
1202
1197
  }
1203
1198
  function Vs(r) {
1204
- r.userData.isMovable && r.parent === w.scene && (we.includes(r) || we.push(r));
1199
+ const e = w.scene.getObjectByProperty("uuid", r);
1200
+ e && Ks(e);
1205
1201
  }
1206
1202
  function Zs(r) {
1203
+ r.userData.isMovable && r.parent === w.scene && (we.includes(r) || we.push(r));
1204
+ }
1205
+ function Qs(r) {
1207
1206
  const e = we.indexOf(r);
1208
1207
  e !== -1 && we.splice(e, 1);
1209
1208
  }
1210
- function Qs() {
1209
+ function qs() {
1211
1210
  const r = [];
1212
1211
  w.scene.children.forEach((e) => {
1213
1212
  e.userData.isMovable && r.push(e);
1214
- }), we = r, St();
1213
+ }), we = r, Rt();
1215
1214
  }
1216
- function St() {
1215
+ function Rt() {
1217
1216
  it == null || it([...we]);
1218
1217
  }
1219
- function qs(r) {
1220
- be = r;
1221
- }
1222
1218
  function Ws(r) {
1223
- bt = r;
1219
+ be = r;
1224
1220
  }
1225
1221
  function $s(r) {
1222
+ wt = r;
1223
+ }
1224
+ function Js(r) {
1226
1225
  it = r;
1227
1226
  }
1228
- function Js() {
1227
+ function ei() {
1229
1228
  return we;
1230
1229
  }
1231
- function Go() {
1230
+ function Xo() {
1232
1231
  return w.scene;
1233
1232
  }
1234
- function Xo() {
1233
+ function Yo() {
1235
1234
  return w.camera;
1236
1235
  }
1237
- function Yo() {
1236
+ function Bo() {
1238
1237
  return w.renderer;
1239
1238
  }
1240
- function Bo() {
1241
- var n, i;
1239
+ function Ko() {
1240
+ var n, i, o;
1241
+ St();
1242
1242
  const r = w.scene;
1243
1243
  if (!r) return "{}";
1244
1244
  let e = r;
1245
1245
  e = r.clone(), e.children = e.children.filter(
1246
- (o) => o.userData.type !== "initFloor"
1246
+ (a) => a.userData.type !== "initFloor"
1247
1247
  );
1248
1248
  const t = e.toJSON(), s = {
1249
- position: (n = w.camera) == null ? void 0 : n.position,
1250
- rotation: (i = w.camera) == null ? void 0 : i.rotation
1249
+ position: (n = w.camera) == null ? void 0 : n.position.toArray(),
1250
+ rotation: (i = w.camera) == null ? void 0 : i.rotation.toArray(),
1251
+ target: ((o = w.orbitControls) == null ? void 0 : o.target.toArray()) || [0, 0, 0]
1251
1252
  };
1252
1253
  return JSON.stringify({ scene: t, camera: s });
1253
1254
  }
1254
- function ei(r, e = "edit") {
1255
+ function ti(r, e = "edit") {
1255
1256
  var i;
1256
1257
  const t = typeof r == "string" ? JSON.parse(r) : r, n = new F.ObjectLoader().parse(t);
1257
1258
  n.type === "Scene" ? w.scene = n : (i = w.scene) == null || i.add(n);
1258
1259
  }
1259
- const ti = /^[og]\s*(.+)?/, ni = /^mtllib /, si = /^usemtl /, ii = /^usemap /, Yt = /\s+/, Bt = new M(), ut = new M(), Kt = new M(), Vt = new M(), q = new M(), et = new pe();
1260
- function oi() {
1260
+ const ni = /^[og]\s*(.+)?/, si = /^mtllib /, ii = /^usemtl /, oi = /^usemap /, Kt = /\s+/, Vt = new M(), dt = new M(), Zt = new M(), Qt = new M(), q = new M(), et = new pe();
1261
+ function ri() {
1261
1262
  const r = {
1262
1263
  objects: [],
1263
1264
  object: {},
@@ -1366,7 +1367,7 @@ function oi() {
1366
1367
  },
1367
1368
  addFaceNormal: function(e, t, s) {
1368
1369
  const n = this.vertices, i = this.object.geometry.normals;
1369
- Bt.fromArray(n, e), ut.fromArray(n, t), Kt.fromArray(n, s), q.subVectors(Kt, ut), Vt.subVectors(Bt, ut), q.cross(Vt), q.normalize(), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z);
1370
+ Vt.fromArray(n, e), dt.fromArray(n, t), Zt.fromArray(n, s), q.subVectors(Zt, dt), Qt.subVectors(Vt, dt), q.cross(Qt), q.normalize(), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z), i.push(q.x, q.y, q.z);
1370
1371
  },
1371
1372
  addColor: function(e, t, s) {
1372
1373
  const n = this.colors, i = this.object.geometry.colors;
@@ -1417,7 +1418,7 @@ function oi() {
1417
1418
  };
1418
1419
  return r.startObject("", !1), r;
1419
1420
  }
1420
- class ri extends ln {
1421
+ class ai extends hn {
1421
1422
  /**
1422
1423
  * Constructs a new OBJ loader.
1423
1424
  *
@@ -1436,7 +1437,7 @@ class ri extends ln {
1436
1437
  * @param {onErrorCallback} onError - Executed when errors occur.
1437
1438
  */
1438
1439
  load(e, t, s, n) {
1439
- const i = this, o = new xt(this.manager);
1440
+ const i = this, o = new Et(this.manager);
1440
1441
  o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a) {
1441
1442
  try {
1442
1443
  t(i.parse(a));
@@ -1461,7 +1462,7 @@ class ri extends ln {
1461
1462
  * @return {Group} The parsed OBJ.
1462
1463
  */
1463
1464
  parse(e) {
1464
- const t = new oi();
1465
+ const t = new ri();
1465
1466
  e.indexOf(`\r
1466
1467
  `) !== -1 && (e = e.replace(/\r\n/g, `
1467
1468
  `)), e.indexOf(`\\
@@ -1475,7 +1476,7 @@ class ri extends ln {
1475
1476
  const u = h.charAt(0);
1476
1477
  if (u !== "#")
1477
1478
  if (u === "v") {
1478
- const c = h.split(Yt);
1479
+ const c = h.split(Kt);
1479
1480
  switch (c[0]) {
1480
1481
  case "v":
1481
1482
  t.vertices.push(
@@ -1486,7 +1487,7 @@ class ri extends ln {
1486
1487
  parseFloat(c[4]),
1487
1488
  parseFloat(c[5]),
1488
1489
  parseFloat(c[6]),
1489
- Re
1490
+ Ae
1490
1491
  ), t.colors.push(et.r, et.g, et.b)) : t.colors.push(void 0, void 0, void 0);
1491
1492
  break;
1492
1493
  case "vn":
@@ -1504,7 +1505,7 @@ class ri extends ln {
1504
1505
  break;
1505
1506
  }
1506
1507
  } else if (u === "f") {
1507
- const p = h.slice(1).trim().split(Yt), m = [];
1508
+ const p = h.slice(1).trim().split(Kt), m = [];
1508
1509
  for (let f = 0, y = p.length; f < y; f++) {
1509
1510
  const d = p[f];
1510
1511
  if (d.length > 0) {
@@ -1542,14 +1543,14 @@ class ri extends ln {
1542
1543
  } else if (u === "p") {
1543
1544
  const p = h.slice(1).trim().split(" ");
1544
1545
  t.addPointGeometry(p);
1545
- } else if ((n = ti.exec(h)) !== null) {
1546
+ } else if ((n = ni.exec(h)) !== null) {
1546
1547
  const c = (" " + n[0].slice(1).trim()).slice(1);
1547
1548
  t.startObject(c);
1548
- } else if (si.test(h))
1549
+ } else if (ii.test(h))
1549
1550
  t.object.startMaterial(h.substring(7).trim(), t.materialLibraries);
1550
- else if (ni.test(h))
1551
+ else if (si.test(h))
1551
1552
  t.materialLibraries.push(h.substring(7).trim());
1552
- else if (ii.test(h))
1553
+ else if (oi.test(h))
1553
1554
  console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
1554
1555
  else if (u === "s") {
1555
1556
  if (n = h.split(" "), n.length > 1) {
@@ -1575,8 +1576,8 @@ class ri extends ln {
1575
1576
  f.setAttribute("position", new ue(u.vertices, 3)), u.normals.length > 0 && f.setAttribute("normal", new ue(u.normals, 3)), u.colors.length > 0 && (b = !0, f.setAttribute("color", new ue(u.colors, 3))), u.hasUVIndices === !0 && f.setAttribute("uv", new ue(u.uvs, 2));
1576
1577
  const y = [];
1577
1578
  for (let _ = 0, x = c.length; _ < x; _++) {
1578
- const S = c[_], A = S.name + "_" + S.smooth + "_" + b;
1579
- let v = t.materials[A];
1579
+ const S = c[_], R = S.name + "_" + S.smooth + "_" + b;
1580
+ let v = t.materials[R];
1580
1581
  if (this.materials !== null) {
1581
1582
  if (v = this.materials.create(S.name), p && v && !(v instanceof ke)) {
1582
1583
  const I = new ke();
@@ -1586,7 +1587,7 @@ class ri extends ln {
1586
1587
  je.prototype.copy.call(I, v), I.color.copy(v.color), I.map = v.map, v = I;
1587
1588
  }
1588
1589
  }
1589
- v === void 0 && (p ? v = new ke() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new kn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[A] = v), y.push(v);
1590
+ v === void 0 && (p ? v = new ke() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new jn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[R] = v), y.push(v);
1590
1591
  }
1591
1592
  let d;
1592
1593
  if (y.length > 1) {
@@ -1594,9 +1595,9 @@ class ri extends ln {
1594
1595
  const S = c[_];
1595
1596
  f.addGroup(S.groupStart, S.groupCount, _);
1596
1597
  }
1597
- p ? d = new mt(f, y) : m ? d = new nt(f, y) : d = new T(f, y);
1598
+ p ? d = new gt(f, y) : m ? d = new nt(f, y) : d = new T(f, y);
1598
1599
  } else
1599
- p ? d = new mt(f, y[0]) : m ? d = new nt(f, y[0]) : d = new T(f, y[0]);
1600
+ p ? d = new gt(f, y[0]) : m ? d = new nt(f, y[0]) : d = new T(f, y[0]);
1600
1601
  d.name = h.name, i.add(d);
1601
1602
  }
1602
1603
  else if (t.vertices.length > 0) {
@@ -1608,10 +1609,10 @@ class ri extends ln {
1608
1609
  return i;
1609
1610
  }
1610
1611
  }
1611
- function Zt(r, e) {
1612
- if (e === jn)
1612
+ function qt(r, e) {
1613
+ if (e === Fn)
1613
1614
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
1614
- if (e === gt || e === cn) {
1615
+ if (e === yt || e === un) {
1615
1616
  let t = r.getIndex();
1616
1617
  if (t === null) {
1617
1618
  const o = [], a = r.getAttribute("position");
@@ -1623,7 +1624,7 @@ function Zt(r, e) {
1623
1624
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), r;
1624
1625
  }
1625
1626
  const s = t.count - 2, n = [];
1626
- if (e === gt)
1627
+ if (e === yt)
1627
1628
  for (let o = 1; o <= s; o++)
1628
1629
  n.push(t.getX(0)), n.push(t.getX(o)), n.push(t.getX(o + 1));
1629
1630
  else
@@ -1635,9 +1636,9 @@ function Zt(r, e) {
1635
1636
  } else
1636
1637
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), r;
1637
1638
  }
1638
- function ai(r) {
1639
+ function li(r) {
1639
1640
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), s = r.clone();
1640
- return yn(r, s, function(n, i) {
1641
+ return _n(r, s, function(n, i) {
1641
1642
  e.set(i, n), t.set(n, i);
1642
1643
  }), s.traverse(function(n) {
1643
1644
  if (!n.isSkinnedMesh) return;
@@ -1647,12 +1648,12 @@ function ai(r) {
1647
1648
  }), i.bind(i.skeleton, i.bindMatrix);
1648
1649
  }), s;
1649
1650
  }
1650
- function yn(r, e, t) {
1651
+ function _n(r, e, t) {
1651
1652
  t(r, e);
1652
1653
  for (let s = 0; s < r.children.length; s++)
1653
- yn(r.children[s], e.children[s], t);
1654
+ _n(r.children[s], e.children[s], t);
1654
1655
  }
1655
- class li extends ln {
1656
+ class ci extends hn {
1656
1657
  /**
1657
1658
  * Constructs a new glTF loader.
1658
1659
  *
@@ -1660,41 +1661,41 @@ class li extends ln {
1660
1661
  */
1661
1662
  constructor(e) {
1662
1663
  super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
1663
- return new pi(t);
1664
- }), this.register(function(t) {
1665
1664
  return new fi(t);
1666
1665
  }), this.register(function(t) {
1667
- return new Ei(t);
1666
+ return new mi(t);
1668
1667
  }), this.register(function(t) {
1669
1668
  return new Mi(t);
1670
1669
  }), this.register(function(t) {
1671
1670
  return new vi(t);
1672
1671
  }), this.register(function(t) {
1673
- return new gi(t);
1672
+ return new Si(t);
1674
1673
  }), this.register(function(t) {
1675
1674
  return new yi(t);
1676
1675
  }), this.register(function(t) {
1677
1676
  return new _i(t);
1678
1677
  }), this.register(function(t) {
1679
1678
  return new bi(t);
1680
- }), this.register(function(t) {
1681
- return new di(t);
1682
1679
  }), this.register(function(t) {
1683
1680
  return new wi(t);
1684
1681
  }), this.register(function(t) {
1685
- return new mi(t);
1686
- }), this.register(function(t) {
1687
- return new xi(t);
1682
+ return new pi(t);
1688
1683
  }), this.register(function(t) {
1689
1684
  return new Ti(t);
1690
1685
  }), this.register(function(t) {
1691
- return new hi(t);
1686
+ return new gi(t);
1692
1687
  }), this.register(function(t) {
1693
- return new Qt(t, R.EXT_MESHOPT_COMPRESSION);
1688
+ return new Ei(t);
1694
1689
  }), this.register(function(t) {
1695
- return new Qt(t, R.KHR_MESHOPT_COMPRESSION);
1690
+ return new xi(t);
1696
1691
  }), this.register(function(t) {
1697
- return new Si(t);
1692
+ return new ui(t);
1693
+ }), this.register(function(t) {
1694
+ return new Wt(t, A.EXT_MESHOPT_COMPRESSION);
1695
+ }), this.register(function(t) {
1696
+ return new Wt(t, A.KHR_MESHOPT_COMPRESSION);
1697
+ }), this.register(function(t) {
1698
+ return new Ai(t);
1698
1699
  });
1699
1700
  }
1700
1701
  /**
@@ -1719,7 +1720,7 @@ class li extends ln {
1719
1720
  this.manager.itemStart(e);
1720
1721
  const a = function(h) {
1721
1722
  n ? n(h) : console.error(h), i.manager.itemError(e), i.manager.itemEnd(e);
1722
- }, l = new xt(this.manager);
1723
+ }, l = new Et(this.manager);
1723
1724
  l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(h) {
1724
1725
  try {
1725
1726
  i.parse(h, o, function(u) {
@@ -1794,14 +1795,14 @@ class li extends ln {
1794
1795
  if (typeof e == "string")
1795
1796
  i = JSON.parse(e);
1796
1797
  else if (e instanceof ArrayBuffer)
1797
- if (l.decode(new Uint8Array(e, 0, 4)) === _n) {
1798
+ if (l.decode(new Uint8Array(e, 0, 4)) === bn) {
1798
1799
  try {
1799
- o[R.KHR_BINARY_GLTF] = new Ri(e);
1800
+ o[A.KHR_BINARY_GLTF] = new Ri(e);
1800
1801
  } catch (c) {
1801
1802
  n && n(c);
1802
1803
  return;
1803
1804
  }
1804
- i = JSON.parse(o[R.KHR_BINARY_GLTF].content);
1805
+ i = JSON.parse(o[A.KHR_BINARY_GLTF].content);
1805
1806
  } else
1806
1807
  i = JSON.parse(l.decode(e));
1807
1808
  else
@@ -1810,7 +1811,7 @@ class li extends ln {
1810
1811
  n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
1811
1812
  return;
1812
1813
  }
1813
- const h = new Ui(i, {
1814
+ const h = new zi(i, {
1814
1815
  path: t || this.resourcePath || "",
1815
1816
  crossOrigin: this.crossOrigin,
1816
1817
  requestHeader: this.requestHeader,
@@ -1827,18 +1828,18 @@ class li extends ln {
1827
1828
  for (let u = 0; u < i.extensionsUsed.length; ++u) {
1828
1829
  const c = i.extensionsUsed[u], p = i.extensionsRequired || [];
1829
1830
  switch (c) {
1830
- case R.KHR_MATERIALS_UNLIT:
1831
- o[c] = new ui();
1832
- break;
1833
- case R.KHR_DRACO_MESH_COMPRESSION:
1834
- o[c] = new Ai(i, this.dracoLoader);
1831
+ case A.KHR_MATERIALS_UNLIT:
1832
+ o[c] = new di();
1835
1833
  break;
1836
- case R.KHR_TEXTURE_TRANSFORM:
1837
- o[c] = new Pi();
1834
+ case A.KHR_DRACO_MESH_COMPRESSION:
1835
+ o[c] = new Pi(i, this.dracoLoader);
1838
1836
  break;
1839
- case R.KHR_MESH_QUANTIZATION:
1837
+ case A.KHR_TEXTURE_TRANSFORM:
1840
1838
  o[c] = new Li();
1841
1839
  break;
1840
+ case A.KHR_MESH_QUANTIZATION:
1841
+ o[c] = new Ii();
1842
+ break;
1842
1843
  default:
1843
1844
  p.indexOf(c) >= 0 && a[c] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + c + '".');
1844
1845
  }
@@ -1860,7 +1861,7 @@ class li extends ln {
1860
1861
  });
1861
1862
  }
1862
1863
  }
1863
- function ci() {
1864
+ function hi() {
1864
1865
  let r = {};
1865
1866
  return {
1866
1867
  get: function(e) {
@@ -1881,7 +1882,7 @@ function C(r, e, t) {
1881
1882
  const s = r.json.materials[e];
1882
1883
  return s.extensions && s.extensions[t] ? s.extensions[t] : null;
1883
1884
  }
1884
- const R = {
1885
+ const A = {
1885
1886
  KHR_BINARY_GLTF: "KHR_binary_glTF",
1886
1887
  KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
1887
1888
  KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
@@ -1906,9 +1907,9 @@ const R = {
1906
1907
  KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
1907
1908
  EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
1908
1909
  };
1909
- class hi {
1910
+ class ui {
1910
1911
  constructor(e) {
1911
- this.parser = e, this.name = R.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
1912
+ this.parser = e, this.name = A.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
1912
1913
  }
1913
1914
  _markDefs() {
1914
1915
  const e = this.parser, t = this.parser.json.nodes || [];
@@ -1928,13 +1929,13 @@ class hi {
1928
1929
  const c = l.range !== void 0 ? l.range : 0;
1929
1930
  switch (l.type) {
1930
1931
  case "directional":
1931
- h = new Un(u), h.target.position.set(0, 0, -1), h.add(h.target);
1932
+ h = new zn(u), h.target.position.set(0, 0, -1), h.add(h.target);
1932
1933
  break;
1933
1934
  case "point":
1934
- h = new Hn(u), h.distance = c;
1935
+ h = new Un(u), h.distance = c;
1935
1936
  break;
1936
1937
  case "spot":
1937
- h = new Fn(u), h.distance = c, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, h.angle = l.spot.outerConeAngle, h.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, h.target.position.set(0, 0, -1), h.add(h.target);
1938
+ h = new Hn(u), h.distance = c, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, h.angle = l.spot.outerConeAngle, h.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, h.target.position.set(0, 0, -1), h.add(h.target);
1938
1939
  break;
1939
1940
  default:
1940
1941
  throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
@@ -1952,9 +1953,9 @@ class hi {
1952
1953
  });
1953
1954
  }
1954
1955
  }
1955
- class ui {
1956
+ class di {
1956
1957
  constructor() {
1957
- this.name = R.KHR_MATERIALS_UNLIT;
1958
+ this.name = A.KHR_MATERIALS_UNLIT;
1958
1959
  }
1959
1960
  getMaterialType() {
1960
1961
  return _e;
@@ -1968,23 +1969,23 @@ class ui {
1968
1969
  const o = i.baseColorFactor;
1969
1970
  e.color.setRGB(o[0], o[1], o[2], ae), e.opacity = o[3];
1970
1971
  }
1971
- i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, Re));
1972
+ i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, Ae));
1972
1973
  }
1973
1974
  return Promise.all(n);
1974
1975
  }
1975
1976
  }
1976
- class di {
1977
+ class pi {
1977
1978
  constructor(e) {
1978
- this.parser = e, this.name = R.KHR_MATERIALS_EMISSIVE_STRENGTH;
1979
+ this.parser = e, this.name = A.KHR_MATERIALS_EMISSIVE_STRENGTH;
1979
1980
  }
1980
1981
  extendMaterialParams(e, t) {
1981
1982
  const s = C(this.parser, e, this.name);
1982
1983
  return s === null || s.emissiveStrength !== void 0 && (t.emissiveIntensity = s.emissiveStrength), Promise.resolve();
1983
1984
  }
1984
1985
  }
1985
- class pi {
1986
+ class fi {
1986
1987
  constructor(e) {
1987
- this.parser = e, this.name = R.KHR_MATERIALS_CLEARCOAT;
1988
+ this.parser = e, this.name = A.KHR_MATERIALS_CLEARCOAT;
1988
1989
  }
1989
1990
  getMaterialType(e) {
1990
1991
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2000,9 +2001,9 @@ class pi {
2000
2001
  return Promise.all(n);
2001
2002
  }
2002
2003
  }
2003
- class fi {
2004
+ class mi {
2004
2005
  constructor(e) {
2005
- this.parser = e, this.name = R.KHR_MATERIALS_DISPERSION;
2006
+ this.parser = e, this.name = A.KHR_MATERIALS_DISPERSION;
2006
2007
  }
2007
2008
  getMaterialType(e) {
2008
2009
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2012,9 +2013,9 @@ class fi {
2012
2013
  return s === null || (t.dispersion = s.dispersion !== void 0 ? s.dispersion : 0), Promise.resolve();
2013
2014
  }
2014
2015
  }
2015
- class mi {
2016
+ class gi {
2016
2017
  constructor(e) {
2017
- this.parser = e, this.name = R.KHR_MATERIALS_IRIDESCENCE;
2018
+ this.parser = e, this.name = A.KHR_MATERIALS_IRIDESCENCE;
2018
2019
  }
2019
2020
  getMaterialType(e) {
2020
2021
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2026,9 +2027,9 @@ class mi {
2026
2027
  return s.iridescenceFactor !== void 0 && (t.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (t.iridescenceIOR = s.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(n);
2027
2028
  }
2028
2029
  }
2029
- class gi {
2030
+ class yi {
2030
2031
  constructor(e) {
2031
- this.parser = e, this.name = R.KHR_MATERIALS_SHEEN;
2032
+ this.parser = e, this.name = A.KHR_MATERIALS_SHEEN;
2032
2033
  }
2033
2034
  getMaterialType(e) {
2034
2035
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2041,12 +2042,12 @@ class gi {
2041
2042
  const i = s.sheenColorFactor;
2042
2043
  t.sheenColor.setRGB(i[0], i[1], i[2], ae);
2043
2044
  }
2044
- return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture, Re)), s.sheenRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(n);
2045
+ return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture, Ae)), s.sheenRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(n);
2045
2046
  }
2046
2047
  }
2047
- class yi {
2048
+ class _i {
2048
2049
  constructor(e) {
2049
- this.parser = e, this.name = R.KHR_MATERIALS_TRANSMISSION;
2050
+ this.parser = e, this.name = A.KHR_MATERIALS_TRANSMISSION;
2050
2051
  }
2051
2052
  getMaterialType(e) {
2052
2053
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2058,9 +2059,9 @@ class yi {
2058
2059
  return s.transmissionFactor !== void 0 && (t.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && n.push(this.parser.assignTexture(t, "transmissionMap", s.transmissionTexture)), Promise.all(n);
2059
2060
  }
2060
2061
  }
2061
- class _i {
2062
+ class bi {
2062
2063
  constructor(e) {
2063
- this.parser = e, this.name = R.KHR_MATERIALS_VOLUME;
2064
+ this.parser = e, this.name = A.KHR_MATERIALS_VOLUME;
2064
2065
  }
2065
2066
  getMaterialType(e) {
2066
2067
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2074,9 +2075,9 @@ class _i {
2074
2075
  return t.attenuationColor = new pe().setRGB(i[0], i[1], i[2], ae), Promise.all(n);
2075
2076
  }
2076
2077
  }
2077
- class bi {
2078
+ class wi {
2078
2079
  constructor(e) {
2079
- this.parser = e, this.name = R.KHR_MATERIALS_IOR;
2080
+ this.parser = e, this.name = A.KHR_MATERIALS_IOR;
2080
2081
  }
2081
2082
  getMaterialType(e) {
2082
2083
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2086,9 +2087,9 @@ class bi {
2086
2087
  return s === null || (t.ior = s.ior !== void 0 ? s.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
2087
2088
  }
2088
2089
  }
2089
- class wi {
2090
+ class Ti {
2090
2091
  constructor(e) {
2091
- this.parser = e, this.name = R.KHR_MATERIALS_SPECULAR;
2092
+ this.parser = e, this.name = A.KHR_MATERIALS_SPECULAR;
2092
2093
  }
2093
2094
  getMaterialType(e) {
2094
2095
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2099,12 +2100,12 @@ class wi {
2099
2100
  const n = [];
2100
2101
  t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
2101
2102
  const i = s.specularColorFactor || [1, 1, 1];
2102
- return t.specularColor = new pe().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Re)), Promise.all(n);
2103
+ return t.specularColor = new pe().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
2103
2104
  }
2104
2105
  }
2105
- class Ti {
2106
+ class xi {
2106
2107
  constructor(e) {
2107
- this.parser = e, this.name = R.EXT_MATERIALS_BUMP;
2108
+ this.parser = e, this.name = A.EXT_MATERIALS_BUMP;
2108
2109
  }
2109
2110
  getMaterialType(e) {
2110
2111
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2116,9 +2117,9 @@ class Ti {
2116
2117
  return t.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && n.push(this.parser.assignTexture(t, "bumpMap", s.bumpTexture)), Promise.all(n);
2117
2118
  }
2118
2119
  }
2119
- class xi {
2120
+ class Ei {
2120
2121
  constructor(e) {
2121
- this.parser = e, this.name = R.KHR_MATERIALS_ANISOTROPY;
2122
+ this.parser = e, this.name = A.KHR_MATERIALS_ANISOTROPY;
2122
2123
  }
2123
2124
  getMaterialType(e) {
2124
2125
  return C(this.parser, e, this.name) !== null ? se : null;
@@ -2130,9 +2131,9 @@ class xi {
2130
2131
  return s.anisotropyStrength !== void 0 && (t.anisotropy = s.anisotropyStrength), s.anisotropyRotation !== void 0 && (t.anisotropyRotation = s.anisotropyRotation), s.anisotropyTexture !== void 0 && n.push(this.parser.assignTexture(t, "anisotropyMap", s.anisotropyTexture)), Promise.all(n);
2131
2132
  }
2132
2133
  }
2133
- class Ei {
2134
+ class Mi {
2134
2135
  constructor(e) {
2135
- this.parser = e, this.name = R.KHR_TEXTURE_BASISU;
2136
+ this.parser = e, this.name = A.KHR_TEXTURE_BASISU;
2136
2137
  }
2137
2138
  loadTexture(e) {
2138
2139
  const t = this.parser, s = t.json, n = s.textures[e];
@@ -2147,9 +2148,9 @@ class Ei {
2147
2148
  return t.loadTextureImage(e, i.source, o);
2148
2149
  }
2149
2150
  }
2150
- class Mi {
2151
+ class vi {
2151
2152
  constructor(e) {
2152
- this.parser = e, this.name = R.EXT_TEXTURE_WEBP;
2153
+ this.parser = e, this.name = A.EXT_TEXTURE_WEBP;
2153
2154
  }
2154
2155
  loadTexture(e) {
2155
2156
  const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
@@ -2164,9 +2165,9 @@ class Mi {
2164
2165
  return s.loadTextureImage(e, o.source, l);
2165
2166
  }
2166
2167
  }
2167
- class vi {
2168
+ class Si {
2168
2169
  constructor(e) {
2169
- this.parser = e, this.name = R.EXT_TEXTURE_AVIF;
2170
+ this.parser = e, this.name = A.EXT_TEXTURE_AVIF;
2170
2171
  }
2171
2172
  loadTexture(e) {
2172
2173
  const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
@@ -2181,7 +2182,7 @@ class vi {
2181
2182
  return s.loadTextureImage(e, o.source, l);
2182
2183
  }
2183
2184
  }
2184
- class Qt {
2185
+ class Wt {
2185
2186
  constructor(e, t) {
2186
2187
  this.name = t, this.parser = e;
2187
2188
  }
@@ -2207,9 +2208,9 @@ class Qt {
2207
2208
  return null;
2208
2209
  }
2209
2210
  }
2210
- class Si {
2211
+ class Ai {
2211
2212
  constructor(e) {
2212
- this.name = R.EXT_MESH_GPU_INSTANCING, this.parser = e;
2213
+ this.name = A.EXT_MESH_GPU_INSTANCING, this.parser = e;
2213
2214
  }
2214
2215
  createNodeMesh(e) {
2215
2216
  const t = this.parser.json, s = t.nodes[e];
@@ -2225,13 +2226,13 @@ class Si {
2225
2226
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((h) => {
2226
2227
  const u = h.pop(), c = u.isGroup ? u.children : [u], p = h[0].count, m = [];
2227
2228
  for (const b of c) {
2228
- const f = new Se(), y = new M(), d = new K(), _ = new M(1, 1, 1), x = new zn(b.geometry, b.material, p);
2229
+ const f = new Se(), y = new M(), d = new K(), _ = new M(1, 1, 1), x = new Gn(b.geometry, b.material, p);
2229
2230
  for (let S = 0; S < p; S++)
2230
2231
  l.TRANSLATION && y.fromBufferAttribute(l.TRANSLATION, S), l.ROTATION && d.fromBufferAttribute(l.ROTATION, S), l.SCALE && _.fromBufferAttribute(l.SCALE, S), x.setMatrixAt(S, f.compose(y, d, _));
2231
2232
  for (const S in l)
2232
2233
  if (S === "_COLOR_0") {
2233
- const A = l[S];
2234
- x.instanceColor = new Gn(A.array, A.itemSize, A.normalized);
2234
+ const R = l[S];
2235
+ x.instanceColor = new Xn(R.array, R.itemSize, R.normalized);
2235
2236
  } else S !== "TRANSLATION" && S !== "ROTATION" && S !== "SCALE" && b.geometry.setAttribute(S, l[S]);
2236
2237
  Ue.prototype.copy.call(x, b), this.parser.assignFinalMaterial(x), m.push(x);
2237
2238
  }
@@ -2239,16 +2240,16 @@ class Si {
2239
2240
  }));
2240
2241
  }
2241
2242
  }
2242
- const _n = "glTF", Oe = 12, qt = { JSON: 1313821514, BIN: 5130562 };
2243
+ const bn = "glTF", Oe = 12, $t = { JSON: 1313821514, BIN: 5130562 };
2243
2244
  class Ri {
2244
2245
  constructor(e) {
2245
- this.name = R.KHR_BINARY_GLTF, this.content = null, this.body = null;
2246
+ this.name = A.KHR_BINARY_GLTF, this.content = null, this.body = null;
2246
2247
  const t = new DataView(e, 0, Oe), s = new TextDecoder();
2247
2248
  if (this.header = {
2248
2249
  magic: s.decode(new Uint8Array(e.slice(0, 4))),
2249
2250
  version: t.getUint32(4, !0),
2250
2251
  length: t.getUint32(8, !0)
2251
- }, this.header.magic !== _n)
2252
+ }, this.header.magic !== bn)
2252
2253
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
2253
2254
  if (this.header.version < 2)
2254
2255
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
@@ -2258,10 +2259,10 @@ class Ri {
2258
2259
  const a = i.getUint32(o, !0);
2259
2260
  o += 4;
2260
2261
  const l = i.getUint32(o, !0);
2261
- if (o += 4, l === qt.JSON) {
2262
+ if (o += 4, l === $t.JSON) {
2262
2263
  const h = new Uint8Array(e, Oe + o, a);
2263
2264
  this.content = s.decode(h);
2264
- } else if (l === qt.BIN) {
2265
+ } else if (l === $t.BIN) {
2265
2266
  const h = Oe + o;
2266
2267
  this.body = e.slice(h, h + a);
2267
2268
  }
@@ -2271,20 +2272,20 @@ class Ri {
2271
2272
  throw new Error("THREE.GLTFLoader: JSON content not found.");
2272
2273
  }
2273
2274
  }
2274
- class Ai {
2275
+ class Pi {
2275
2276
  constructor(e, t) {
2276
2277
  if (!t)
2277
2278
  throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
2278
- this.name = R.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
2279
+ this.name = A.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
2279
2280
  }
2280
2281
  decodePrimitive(e, t) {
2281
2282
  const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, h = {};
2282
2283
  for (const u in o) {
2283
- const c = wt[u] || u.toLowerCase();
2284
+ const c = Tt[u] || u.toLowerCase();
2284
2285
  a[c] = o[u];
2285
2286
  }
2286
2287
  for (const u in e.attributes) {
2287
- const c = wt[u] || u.toLowerCase();
2288
+ const c = Tt[u] || u.toLowerCase();
2288
2289
  if (o[u] !== void 0) {
2289
2290
  const p = s.accessors[e.attributes[u]], m = ve[p.componentType];
2290
2291
  h[c] = m.name, l[c] = p.normalized === !0;
@@ -2303,20 +2304,20 @@ class Ai {
2303
2304
  });
2304
2305
  }
2305
2306
  }
2306
- class Pi {
2307
+ class Li {
2307
2308
  constructor() {
2308
- this.name = R.KHR_TEXTURE_TRANSFORM;
2309
+ this.name = A.KHR_TEXTURE_TRANSFORM;
2309
2310
  }
2310
2311
  extendTexture(e, t) {
2311
2312
  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;
2312
2313
  }
2313
2314
  }
2314
- class Li {
2315
+ class Ii {
2315
2316
  constructor() {
2316
- this.name = R.KHR_MESH_QUANTIZATION;
2317
+ this.name = A.KHR_MESH_QUANTIZATION;
2317
2318
  }
2318
2319
  }
2319
- class bn extends ls {
2320
+ class wn extends cs {
2320
2321
  constructor(e, t, s, n) {
2321
2322
  super(e, t, s, n);
2322
2323
  }
@@ -2329,17 +2330,17 @@ class bn extends ls {
2329
2330
  interpolate_(e, t, s, n) {
2330
2331
  const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, h = a * 3, u = n - t, c = (s - t) / u, p = c * c, m = p * c, b = e * h, f = b - h, y = -2 * m + 3 * p, d = m - p, _ = 1 - y, x = d - p + c;
2331
2332
  for (let S = 0; S !== a; S++) {
2332
- const A = o[f + S + a], v = o[f + S + l] * u, I = o[b + S + a], ie = o[b + S] * u;
2333
- i[S] = _ * A + x * v + y * I + d * ie;
2333
+ const R = o[f + S + a], v = o[f + S + l] * u, I = o[b + S + a], ie = o[b + S] * u;
2334
+ i[S] = _ * R + x * v + y * I + d * ie;
2334
2335
  }
2335
2336
  return i;
2336
2337
  }
2337
2338
  }
2338
- const Ii = new K();
2339
- class Oi extends bn {
2339
+ const Oi = new K();
2340
+ class Ci extends wn {
2340
2341
  interpolate_(e, t, s, n) {
2341
2342
  const i = super.interpolate_(e, t, s, n);
2342
- return Ii.fromArray(i).normalize().toArray(i), i;
2343
+ return Oi.fromArray(i).normalize().toArray(i), i;
2343
2344
  }
2344
2345
  }
2345
2346
  const W = {
@@ -2357,18 +2358,18 @@ const W = {
2357
2358
  5123: Uint16Array,
2358
2359
  5125: Uint32Array,
2359
2360
  5126: Float32Array
2360
- }, Wt = {
2361
- 9728: un,
2362
- 9729: yt,
2363
- 9984: Qn,
2364
- 9985: Zn,
2365
- 9986: Vn,
2366
- 9987: hn
2367
- }, $t = {
2368
- 33071: Wn,
2369
- 33648: qn,
2370
- 10497: _t
2371
- }, dt = {
2361
+ }, Jt = {
2362
+ 9728: pn,
2363
+ 9729: _t,
2364
+ 9984: qn,
2365
+ 9985: Qn,
2366
+ 9986: Zn,
2367
+ 9987: dn
2368
+ }, en = {
2369
+ 33071: $n,
2370
+ 33648: Wn,
2371
+ 10497: bt
2372
+ }, pt = {
2372
2373
  SCALAR: 1,
2373
2374
  VEC2: 2,
2374
2375
  VEC3: 3,
@@ -2376,7 +2377,7 @@ const W = {
2376
2377
  MAT2: 4,
2377
2378
  MAT3: 9,
2378
2379
  MAT4: 16
2379
- }, wt = {
2380
+ }, Tt = {
2380
2381
  POSITION: "position",
2381
2382
  NORMAL: "normal",
2382
2383
  TANGENT: "tangent",
@@ -2392,26 +2393,26 @@ const W = {
2392
2393
  translation: "position",
2393
2394
  rotation: "quaternion",
2394
2395
  weights: "morphTargetInfluences"
2395
- }, Ci = {
2396
+ }, Di = {
2396
2397
  CUBICSPLINE: void 0,
2397
2398
  // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
2398
2399
  // keyframe track will be initialized with a default interpolation type, then modified.
2399
- LINEAR: pn,
2400
- STEP: rs
2401
- }, pt = {
2400
+ LINEAR: mn,
2401
+ STEP: as
2402
+ }, ft = {
2402
2403
  OPAQUE: "OPAQUE",
2403
2404
  MASK: "MASK",
2404
2405
  BLEND: "BLEND"
2405
2406
  };
2406
- function Di(r) {
2407
- return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new dn({
2407
+ function Ni(r) {
2408
+ return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new fn({
2408
2409
  color: 16777215,
2409
2410
  emissive: 0,
2410
2411
  metalness: 1,
2411
2412
  roughness: 1,
2412
2413
  transparent: !1,
2413
2414
  depthTest: !0,
2414
- side: as
2415
+ side: ls
2415
2416
  })), r.DefaultMaterial;
2416
2417
  }
2417
2418
  function ge(r, e, t) {
@@ -2421,7 +2422,7 @@ function ge(r, e, t) {
2421
2422
  function ne(r, e) {
2422
2423
  e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
2423
2424
  }
2424
- function Ni(r, e, t) {
2425
+ function ki(r, e, t) {
2425
2426
  let s = !1, n = !1, i = !1;
2426
2427
  for (let h = 0, u = e.length; h < u; h++) {
2427
2428
  const c = e[h];
@@ -2453,7 +2454,7 @@ function Ni(r, e, t) {
2453
2454
  return s && (r.morphAttributes.position = u), n && (r.morphAttributes.normal = c), i && (r.morphAttributes.color = p), r.morphTargetsRelative = !0, r;
2454
2455
  });
2455
2456
  }
2456
- function ki(r, e) {
2457
+ function ji(r, e) {
2457
2458
  if (r.updateMorphTargets(), e.weights !== void 0)
2458
2459
  for (let t = 0, s = e.weights.length; t < s; t++)
2459
2460
  r.morphTargetInfluences[t] = e.weights[t];
@@ -2467,22 +2468,22 @@ function ki(r, e) {
2467
2468
  console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
2468
2469
  }
2469
2470
  }
2470
- function ji(r) {
2471
+ function Fi(r) {
2471
2472
  let e;
2472
- const t = r.extensions && r.extensions[R.KHR_DRACO_MESH_COMPRESSION];
2473
- if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + ft(t.attributes) : e = r.indices + ":" + ft(r.attributes) + ":" + r.mode, r.targets !== void 0)
2473
+ const t = r.extensions && r.extensions[A.KHR_DRACO_MESH_COMPRESSION];
2474
+ if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + mt(t.attributes) : e = r.indices + ":" + mt(r.attributes) + ":" + r.mode, r.targets !== void 0)
2474
2475
  for (let s = 0, n = r.targets.length; s < n; s++)
2475
- e += ":" + ft(r.targets[s]);
2476
+ e += ":" + mt(r.targets[s]);
2476
2477
  return e;
2477
2478
  }
2478
- function ft(r) {
2479
+ function mt(r) {
2479
2480
  let e = "";
2480
2481
  const t = Object.keys(r).sort();
2481
2482
  for (let s = 0, n = t.length; s < n; s++)
2482
2483
  e += t[s] + ":" + r[t[s]] + ";";
2483
2484
  return e;
2484
2485
  }
2485
- function Tt(r) {
2486
+ function xt(r) {
2486
2487
  switch (r) {
2487
2488
  case Int8Array:
2488
2489
  return 1 / 127;
@@ -2496,13 +2497,13 @@ function Tt(r) {
2496
2497
  throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
2497
2498
  }
2498
2499
  }
2499
- function Fi(r) {
2500
+ function Hi(r) {
2500
2501
  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";
2501
2502
  }
2502
- const Hi = new Se();
2503
- class Ui {
2503
+ const Ui = new Se();
2504
+ class zi {
2504
2505
  constructor(e = {}, t = {}) {
2505
- this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new ci(), 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 = {};
2506
+ this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new hi(), 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 = {};
2506
2507
  let s = !1, n = -1, i = !1, o = -1;
2507
2508
  if (typeof navigator < "u" && typeof navigator.userAgent < "u") {
2508
2509
  const a = navigator.userAgent;
@@ -2510,7 +2511,7 @@ class Ui {
2510
2511
  const l = a.match(/Version\/(\d+)/);
2511
2512
  n = s && l ? parseInt(l[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
2512
2513
  }
2513
- typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new Xn(this.options.manager) : this.textureLoader = new Yn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new xt(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
2514
+ typeof createImageBitmap > "u" || s && n < 17 || i && o < 98 ? this.textureLoader = new Yn(this.options.manager) : this.textureLoader = new Bn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Et(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
2514
2515
  }
2515
2516
  setExtensions(e) {
2516
2517
  this.extensions = e;
@@ -2718,7 +2719,7 @@ class Ui {
2718
2719
  if (t.type && t.type !== "arraybuffer")
2719
2720
  throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
2720
2721
  if (t.uri === void 0 && e === 0)
2721
- return Promise.resolve(this.extensions[R.KHR_BINARY_GLTF].body);
2722
+ return Promise.resolve(this.extensions[A.KHR_BINARY_GLTF].body);
2722
2723
  const n = this.options;
2723
2724
  return new Promise(function(i, o) {
2724
2725
  s.load(Fe.resolveURL(t.uri, n.path), i, void 0, function() {
@@ -2750,24 +2751,24 @@ class Ui {
2750
2751
  loadAccessor(e) {
2751
2752
  const t = this, s = this.json, n = this.json.accessors[e];
2752
2753
  if (n.bufferView === void 0 && n.sparse === void 0) {
2753
- const o = dt[n.type], a = ve[n.componentType], l = n.normalized === !0, h = new a(n.count * o);
2754
+ const o = pt[n.type], a = ve[n.componentType], l = n.normalized === !0, h = new a(n.count * o);
2754
2755
  return Promise.resolve(new rt(h, o, l));
2755
2756
  }
2756
2757
  const i = [];
2757
2758
  return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(o) {
2758
- const a = o[0], l = dt[n.type], h = ve[n.componentType], u = h.BYTES_PER_ELEMENT, c = u * l, p = n.byteOffset || 0, m = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, b = n.normalized === !0;
2759
+ const a = o[0], l = pt[n.type], h = ve[n.componentType], u = h.BYTES_PER_ELEMENT, c = u * l, p = n.byteOffset || 0, m = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, b = n.normalized === !0;
2759
2760
  let f, y;
2760
2761
  if (m && m !== c) {
2761
2762
  const d = Math.floor(p / m), _ = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + d + ":" + n.count;
2762
2763
  let x = t.cache.get(_);
2763
- x || (f = new h(a, d * m, n.count * m / u), x = new Bn(f, m / u), t.cache.add(_, x)), y = new Kn(x, l, p % m / u, b);
2764
+ x || (f = new h(a, d * m, n.count * m / u), x = new Kn(f, m / u), t.cache.add(_, x)), y = new Vn(x, l, p % m / u, b);
2764
2765
  } else
2765
2766
  a === null ? f = new h(n.count * l) : f = new h(a, p, n.count * l), y = new rt(f, l, b);
2766
2767
  if (n.sparse !== void 0) {
2767
- const d = dt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0, A = new _(o[1], x, n.sparse.count * d), v = new h(o[2], S, n.sparse.count * l);
2768
+ const d = pt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0, R = new _(o[1], x, n.sparse.count * d), v = new h(o[2], S, n.sparse.count * l);
2768
2769
  a !== null && (y = new rt(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
2769
- for (let I = 0, ie = A.length; I < ie; I++) {
2770
- const ee = A[I];
2770
+ for (let I = 0, ie = R.length; I < ie; I++) {
2771
+ const ee = R[I];
2771
2772
  if (y.setX(ee, v[I * l]), l >= 2 && y.setY(ee, v[I * l + 1]), l >= 3 && y.setZ(ee, v[I * l + 2]), l >= 4 && y.setW(ee, v[I * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
2772
2773
  }
2773
2774
  y.normalized = b;
@@ -2798,7 +2799,7 @@ class Ui {
2798
2799
  const h = this.loadImageSource(t, s).then(function(u) {
2799
2800
  u.flipY = !1, u.name = o.name || a.name || "", u.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (u.name = a.uri);
2800
2801
  const p = (i.samplers || {})[o.sampler] || {};
2801
- return u.magFilter = Wt[p.magFilter] || yt, u.minFilter = Wt[p.minFilter] || hn, u.wrapS = $t[p.wrapS] || _t, u.wrapT = $t[p.wrapT] || _t, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== un && u.minFilter !== yt, n.associations.set(u, { textures: e }), u;
2802
+ return u.magFilter = Jt[p.magFilter] || _t, u.minFilter = Jt[p.minFilter] || dn, u.wrapS = en[p.wrapS] || bt, u.wrapT = en[p.wrapT] || bt, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== pn && u.minFilter !== _t, n.associations.set(u, { textures: e }), u;
2802
2803
  }).catch(function() {
2803
2804
  return null;
2804
2805
  });
@@ -2822,12 +2823,12 @@ class Ui {
2822
2823
  return new Promise(function(p, m) {
2823
2824
  let b = p;
2824
2825
  t.isImageBitmapLoader === !0 && (b = function(f) {
2825
- const y = new Lt(f);
2826
+ const y = new Ot(f);
2826
2827
  y.needsUpdate = !0, p(y);
2827
2828
  }), t.load(Fe.resolveURL(c, i.path), b, void 0, m);
2828
2829
  });
2829
2830
  }).then(function(c) {
2830
- return h === !0 && a.revokeObjectURL(l), ne(c, o), c.userData.mimeType = o.mimeType || Fi(o.uri), c;
2831
+ return h === !0 && a.revokeObjectURL(l), ne(c, o), c.userData.mimeType = o.mimeType || Hi(o.uri), c;
2831
2832
  }).catch(function(c) {
2832
2833
  throw console.error("THREE.GLTFLoader: Couldn't load texture", l), c;
2833
2834
  });
@@ -2847,11 +2848,11 @@ class Ui {
2847
2848
  const i = this;
2848
2849
  return this.getDependency("texture", s.index).then(function(o) {
2849
2850
  if (!o) return null;
2850
- if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[R.KHR_TEXTURE_TRANSFORM]) {
2851
- const a = s.extensions !== void 0 ? s.extensions[R.KHR_TEXTURE_TRANSFORM] : void 0;
2851
+ if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[A.KHR_TEXTURE_TRANSFORM]) {
2852
+ const a = s.extensions !== void 0 ? s.extensions[A.KHR_TEXTURE_TRANSFORM] : void 0;
2852
2853
  if (a) {
2853
2854
  const l = i.associations.get(o);
2854
- o = i.extensions[R.KHR_TEXTURE_TRANSFORM].extendTexture(o, a), i.associations.set(o, l);
2855
+ o = i.extensions[A.KHR_TEXTURE_TRANSFORM].extendTexture(o, a), i.associations.set(o, l);
2855
2856
  }
2856
2857
  }
2857
2858
  return n !== void 0 && (o.colorSpace = n), e[t] = o, o;
@@ -2889,7 +2890,7 @@ class Ui {
2889
2890
  e.material = s;
2890
2891
  }
2891
2892
  getMaterialType() {
2892
- return dn;
2893
+ return fn;
2893
2894
  }
2894
2895
  /**
2895
2896
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
@@ -2902,8 +2903,8 @@ class Ui {
2902
2903
  const t = this, s = this.json, n = this.extensions, i = s.materials[e];
2903
2904
  let o;
2904
2905
  const a = {}, l = i.extensions || {}, h = [];
2905
- if (l[R.KHR_MATERIALS_UNLIT]) {
2906
- const c = n[R.KHR_MATERIALS_UNLIT];
2906
+ if (l[A.KHR_MATERIALS_UNLIT]) {
2907
+ const c = n[A.KHR_MATERIALS_UNLIT];
2907
2908
  o = c.getMaterialType(), h.push(c.extendParams(a, i, t));
2908
2909
  } else {
2909
2910
  const c = i.pbrMetallicRoughness || {};
@@ -2911,15 +2912,15 @@ class Ui {
2911
2912
  const p = c.baseColorFactor;
2912
2913
  a.color.setRGB(p[0], p[1], p[2], ae), a.opacity = p[3];
2913
2914
  }
2914
- c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture, Re)), a.metalness = c.metallicFactor !== void 0 ? c.metallicFactor : 1, a.roughness = c.roughnessFactor !== void 0 ? c.roughnessFactor : 1, c.metallicRoughnessTexture !== void 0 && (h.push(t.assignTexture(a, "metalnessMap", c.metallicRoughnessTexture)), h.push(t.assignTexture(a, "roughnessMap", c.metallicRoughnessTexture))), o = this._invokeOne(function(p) {
2915
+ c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture, Ae)), a.metalness = c.metallicFactor !== void 0 ? c.metallicFactor : 1, a.roughness = c.roughnessFactor !== void 0 ? c.roughnessFactor : 1, c.metallicRoughnessTexture !== void 0 && (h.push(t.assignTexture(a, "metalnessMap", c.metallicRoughnessTexture)), h.push(t.assignTexture(a, "roughnessMap", c.metallicRoughnessTexture))), o = this._invokeOne(function(p) {
2915
2916
  return p.getMaterialType && p.getMaterialType(e);
2916
2917
  }), h.push(Promise.all(this._invokeAll(function(p) {
2917
2918
  return p.extendMaterialParams && p.extendMaterialParams(e, a);
2918
2919
  })));
2919
2920
  }
2920
- i.doubleSided === !0 && (a.side = an);
2921
- const u = i.alphaMode || pt.OPAQUE;
2922
- if (u === pt.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === pt.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== _e && (h.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new V(1, 1), i.normalTexture.scale !== void 0)) {
2921
+ i.doubleSided === !0 && (a.side = cn);
2922
+ const u = i.alphaMode || ft.OPAQUE;
2923
+ if (u === ft.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === ft.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== _e && (h.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new V(1, 1), i.normalTexture.scale !== void 0)) {
2923
2924
  const c = i.normalTexture.scale;
2924
2925
  a.normalScale.set(c, c);
2925
2926
  }
@@ -2927,7 +2928,7 @@ class Ui {
2927
2928
  const c = i.emissiveFactor;
2928
2929
  a.emissive = new pe().setRGB(c[0], c[1], c[2], ae);
2929
2930
  }
2930
- return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Re)), Promise.all(h).then(function() {
2931
+ return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Ae)), Promise.all(h).then(function() {
2931
2932
  const c = new o(a);
2932
2933
  return i.name && (c.name = i.name), ne(c, i), t.associations.set(c, { materials: e }), i.extensions && ge(n, c, i), c;
2933
2934
  });
@@ -2940,7 +2941,7 @@ class Ui {
2940
2941
  * @return {string}
2941
2942
  */
2942
2943
  createUniqueName(e) {
2943
- const t = $n.sanitizeNodeName(e || "");
2944
+ const t = Jn.sanitizeNodeName(e || "");
2944
2945
  return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
2945
2946
  }
2946
2947
  /**
@@ -2955,18 +2956,18 @@ class Ui {
2955
2956
  loadGeometries(e) {
2956
2957
  const t = this, s = this.extensions, n = this.primitiveCache;
2957
2958
  function i(a) {
2958
- return s[R.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
2959
- return Jt(l, a, t);
2959
+ return s[A.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
2960
+ return tn(l, a, t);
2960
2961
  });
2961
2962
  }
2962
2963
  const o = [];
2963
2964
  for (let a = 0, l = e.length; a < l; a++) {
2964
- const h = e[a], u = ji(h), c = n[u];
2965
+ const h = e[a], u = Fi(h), c = n[u];
2965
2966
  if (c)
2966
2967
  o.push(c.promise);
2967
2968
  else {
2968
2969
  let p;
2969
- h.extensions && h.extensions[R.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = Jt(new ze(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
2970
+ h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = tn(new ze(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
2970
2971
  }
2971
2972
  }
2972
2973
  return Promise.all(o);
@@ -2981,7 +2982,7 @@ class Ui {
2981
2982
  loadMesh(e) {
2982
2983
  const t = this, s = this.json, n = this.extensions, i = s.meshes[e], o = i.primitives, a = [];
2983
2984
  for (let l = 0, h = o.length; l < h; l++) {
2984
- const u = o[l].material === void 0 ? Di(this.cache) : this.getDependency("material", o[l].material);
2985
+ const u = o[l].material === void 0 ? Ni(this.cache) : this.getDependency("material", o[l].material);
2985
2986
  a.push(u);
2986
2987
  }
2987
2988
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
@@ -2991,18 +2992,18 @@ class Ui {
2991
2992
  let d;
2992
2993
  const _ = h[m];
2993
2994
  if (y.mode === W.TRIANGLES || y.mode === W.TRIANGLE_STRIP || y.mode === W.TRIANGLE_FAN || y.mode === void 0)
2994
- d = i.isSkinnedMesh === !0 ? new Jn(f, _) : new T(f, _), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), y.mode === W.TRIANGLE_STRIP ? d.geometry = Zt(d.geometry, cn) : y.mode === W.TRIANGLE_FAN && (d.geometry = Zt(d.geometry, gt));
2995
+ d = i.isSkinnedMesh === !0 ? new es(f, _) : new T(f, _), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), y.mode === W.TRIANGLE_STRIP ? d.geometry = qt(d.geometry, un) : y.mode === W.TRIANGLE_FAN && (d.geometry = qt(d.geometry, yt));
2995
2996
  else if (y.mode === W.LINES)
2996
- d = new mt(f, _);
2997
+ d = new gt(f, _);
2997
2998
  else if (y.mode === W.LINE_STRIP)
2998
2999
  d = new re(f, _);
2999
3000
  else if (y.mode === W.LINE_LOOP)
3000
- d = new es(f, _);
3001
+ d = new ts(f, _);
3001
3002
  else if (y.mode === W.POINTS)
3002
3003
  d = new nt(f, _);
3003
3004
  else
3004
3005
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
3005
- Object.keys(d.geometry.morphAttributes).length > 0 && ki(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), ne(d, i), y.extensions && ge(n, d, y), t.assignFinalMaterial(d), c.push(d);
3006
+ Object.keys(d.geometry.morphAttributes).length > 0 && ji(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), ne(d, i), y.extensions && ge(n, d, y), t.assignFinalMaterial(d), c.push(d);
3006
3007
  }
3007
3008
  for (let m = 0, b = c.length; m < b; m++)
3008
3009
  t.associations.set(c[m], {
@@ -3032,7 +3033,7 @@ class Ui {
3032
3033
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
3033
3034
  return;
3034
3035
  }
3035
- return s.type === "perspective" ? t = new ts(rn.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new ns(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), ne(t, s), Promise.resolve(t);
3036
+ return s.type === "perspective" ? t = new ns(ln.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new ss(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), ne(t, s), Promise.resolve(t);
3036
3037
  }
3037
3038
  /**
3038
3039
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@@ -3056,7 +3057,7 @@ class Ui {
3056
3057
  } else
3057
3058
  console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[h]);
3058
3059
  }
3059
- return new ss(a, l);
3060
+ return new is(a, l);
3060
3061
  });
3061
3062
  }
3062
3063
  /**
@@ -3081,15 +3082,15 @@ class Ui {
3081
3082
  ]).then(function(c) {
3082
3083
  const p = c[0], m = c[1], b = c[2], f = c[3], y = c[4], d = [];
3083
3084
  for (let x = 0, S = p.length; x < S; x++) {
3084
- const A = p[x], v = m[x], I = b[x], ie = f[x], ee = y[x];
3085
- if (A === void 0) continue;
3086
- A.updateMatrix && A.updateMatrix();
3087
- const fe = s._createAnimationTracks(A, v, I, ie, ee);
3085
+ const R = p[x], v = m[x], I = b[x], ie = f[x], ee = y[x];
3086
+ if (R === void 0) continue;
3087
+ R.updateMatrix && R.updateMatrix();
3088
+ const fe = s._createAnimationTracks(R, v, I, ie, ee);
3088
3089
  if (fe)
3089
3090
  for (let $ = 0; $ < fe.length; $++)
3090
3091
  d.push(fe[$]);
3091
3092
  }
3092
- const _ = new is(i, void 0, d);
3093
+ const _ = new os(i, void 0, d);
3093
3094
  return ne(_, n), _;
3094
3095
  });
3095
3096
  }
@@ -3123,7 +3124,7 @@ class Ui {
3123
3124
  ]).then(function(h) {
3124
3125
  const u = h[0], c = h[1], p = h[2];
3125
3126
  p !== null && u.traverse(function(m) {
3126
- m.isSkinnedMesh && m.bind(p, Hi);
3127
+ m.isSkinnedMesh && m.bind(p, Ui);
3127
3128
  });
3128
3129
  for (let m = 0, b = c.length; m < b; m++)
3129
3130
  u.add(c[m]);
@@ -3151,7 +3152,7 @@ class Ui {
3151
3152
  a.push(h);
3152
3153
  }), this.nodeCache[e] = Promise.all(a).then(function(h) {
3153
3154
  let u;
3154
- if (i.isBone === !0 ? u = new os() : h.length > 1 ? u = new tt() : h.length === 1 ? u = h[0] : u = new Ue(), u !== h[0])
3155
+ if (i.isBone === !0 ? u = new rs() : h.length > 1 ? u = new tt() : h.length === 1 ? u = h[0] : u = new Ue(), u !== h[0])
3155
3156
  for (let c = 0, p = h.length; c < p; c++)
3156
3157
  u.add(h[c]);
3157
3158
  if (i.name && (u.userData.name = i.name, u.name = o), ne(u, i), i.extensions && ge(s, u, i), i.matrix !== void 0) {
@@ -3184,12 +3185,12 @@ class Ui {
3184
3185
  return Promise.all(a).then(function(l) {
3185
3186
  for (let u = 0, c = l.length; u < c; u++) {
3186
3187
  const p = l[u];
3187
- p.parent !== null ? i.add(ai(p)) : i.add(p);
3188
+ p.parent !== null ? i.add(li(p)) : i.add(p);
3188
3189
  }
3189
3190
  const h = (u) => {
3190
3191
  const c = /* @__PURE__ */ new Map();
3191
3192
  for (const [p, m] of n.associations)
3192
- (p instanceof je || p instanceof Lt) && c.set(p, m);
3193
+ (p instanceof je || p instanceof Ot) && c.set(p, m);
3193
3194
  return u.traverse((p) => {
3194
3195
  const m = n.associations.get(p);
3195
3196
  m != null && c.set(p, m);
@@ -3207,29 +3208,29 @@ class Ui {
3207
3208
  let u;
3208
3209
  switch (ce[i.path]) {
3209
3210
  case ce.weights:
3210
- u = Ot;
3211
+ u = Dt;
3211
3212
  break;
3212
3213
  case ce.rotation:
3213
- u = Ct;
3214
+ u = Nt;
3214
3215
  break;
3215
3216
  case ce.translation:
3216
3217
  case ce.scale:
3217
- u = It;
3218
+ u = Ct;
3218
3219
  break;
3219
3220
  default:
3220
3221
  switch (s.itemSize) {
3221
3222
  case 1:
3222
- u = Ot;
3223
+ u = Dt;
3223
3224
  break;
3224
3225
  case 2:
3225
3226
  case 3:
3226
3227
  default:
3227
- u = It;
3228
+ u = Ct;
3228
3229
  break;
3229
3230
  }
3230
3231
  break;
3231
3232
  }
3232
- const c = n.interpolation !== void 0 ? Ci[n.interpolation] : pn, p = this._getArrayFromAccessor(s);
3233
+ const c = n.interpolation !== void 0 ? Di[n.interpolation] : mn, p = this._getArrayFromAccessor(s);
3233
3234
  for (let m = 0, b = l.length; m < b; m++) {
3234
3235
  const f = new u(
3235
3236
  l[m] + "." + ce[i.path],
@@ -3244,7 +3245,7 @@ class Ui {
3244
3245
  _getArrayFromAccessor(e) {
3245
3246
  let t = e.array;
3246
3247
  if (e.normalized) {
3247
- const s = Tt(t.constructor), n = new Float32Array(t.length);
3248
+ const s = xt(t.constructor), n = new Float32Array(t.length);
3248
3249
  for (let i = 0, o = t.length; i < o; i++)
3249
3250
  n[i] = t[i] * s;
3250
3251
  t = n;
@@ -3253,13 +3254,13 @@ class Ui {
3253
3254
  }
3254
3255
  _createCubicSplineTrackInterpolant(e) {
3255
3256
  e.createInterpolant = function(s) {
3256
- const n = this instanceof Ct ? Oi : bn;
3257
+ const n = this instanceof Nt ? Ci : wn;
3257
3258
  return new n(this.times, this.values, this.getValueSize() / 3, s);
3258
3259
  }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
3259
3260
  }
3260
3261
  }
3261
- function zi(r, e, t) {
3262
- const s = e.attributes, n = new cs();
3262
+ function Gi(r, e, t) {
3263
+ const s = e.attributes, n = new hs();
3263
3264
  if (s.POSITION !== void 0) {
3264
3265
  const a = t.json.accessors[s.POSITION], l = a.min, h = a.max;
3265
3266
  if (l !== void 0 && h !== void 0) {
@@ -3267,7 +3268,7 @@ function zi(r, e, t) {
3267
3268
  new M(l[0], l[1], l[2]),
3268
3269
  new M(h[0], h[1], h[2])
3269
3270
  ), a.normalized) {
3270
- const u = Tt(ve[a.componentType]);
3271
+ const u = xt(ve[a.componentType]);
3271
3272
  n.min.multiplyScalar(u), n.max.multiplyScalar(u);
3272
3273
  }
3273
3274
  } else {
@@ -3285,7 +3286,7 @@ function zi(r, e, t) {
3285
3286
  const p = t.json.accessors[c.POSITION], m = p.min, b = p.max;
3286
3287
  if (m !== void 0 && b !== void 0) {
3287
3288
  if (l.setX(Math.max(Math.abs(m[0]), Math.abs(b[0]))), l.setY(Math.max(Math.abs(m[1]), Math.abs(b[1]))), l.setZ(Math.max(Math.abs(m[2]), Math.abs(b[2]))), p.normalized) {
3288
- const f = Tt(ve[p.componentType]);
3289
+ const f = xt(ve[p.componentType]);
3289
3290
  l.multiplyScalar(f);
3290
3291
  }
3291
3292
  a.max(l);
@@ -3296,10 +3297,10 @@ function zi(r, e, t) {
3296
3297
  n.expandByVector(a);
3297
3298
  }
3298
3299
  r.boundingBox = n;
3299
- const o = new hs();
3300
+ const o = new us();
3300
3301
  n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, r.boundingSphere = o;
3301
3302
  }
3302
- function Jt(r, e, t) {
3303
+ function tn(r, e, t) {
3303
3304
  const s = e.attributes, n = [];
3304
3305
  function i(o, a) {
3305
3306
  return t.getDependency("accessor", o).then(function(l) {
@@ -3307,7 +3308,7 @@ function Jt(r, e, t) {
3307
3308
  });
3308
3309
  }
3309
3310
  for (const o in s) {
3310
- const a = wt[o] || o.toLowerCase();
3311
+ const a = Tt[o] || o.toLowerCase();
3311
3312
  a in r.attributes || n.push(i(s[o], a));
3312
3313
  }
3313
3314
  if (e.indices !== void 0 && !r.index) {
@@ -3316,25 +3317,25 @@ function Jt(r, e, t) {
3316
3317
  });
3317
3318
  n.push(o);
3318
3319
  }
3319
- return Dt.workingColorSpace !== ae && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Dt.workingColorSpace}" not supported.`), ne(r, e), zi(r, e, t), Promise.all(n).then(function() {
3320
- return e.targets !== void 0 ? Ni(r, e.targets, t) : r;
3320
+ return kt.workingColorSpace !== ae && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${kt.workingColorSpace}" not supported.`), ne(r, e), Gi(r, e, t), Promise.all(n).then(function() {
3321
+ return e.targets !== void 0 ? ki(r, e.targets, t) : r;
3321
3322
  });
3322
3323
  }
3323
- function Gi() {
3324
+ function Xi() {
3324
3325
  const r = new F.BoxGeometry(1, 1, 1), e = new F.MeshStandardMaterial({ color: 43775 }), t = new F.Mesh(r, e);
3325
- return t.position.y = 0.5, t.userData.isMovable = !0, t.name = "正方体", vt(t, !0), t;
3326
+ return t.position.y = 0.5, t.userData.isMovable = !0, t.name = "正方体", At(t, !0), t;
3326
3327
  }
3327
- function Xi() {
3328
+ function Yi() {
3328
3329
  const r = new F.SphereGeometry(0.6, 32, 32), e = new F.MeshStandardMaterial({ color: 16746496 }), t = new F.Mesh(r, e);
3329
- return t.position.y = 0.6, t.userData.isMovable = !0, t.name = "球体", vt(t, !0), t;
3330
+ return t.position.y = 0.6, t.userData.isMovable = !0, t.name = "球体", At(t, !0), t;
3330
3331
  }
3331
- function Yi(r) {
3332
+ function Bi(r) {
3332
3333
  return new Promise((e, t) => {
3333
3334
  var o;
3334
3335
  const s = (o = r.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), n = URL.createObjectURL(r);
3335
3336
  let i;
3336
- if (s === "obj") i = new ri();
3337
- else if (s === "gltf" || s === "glb") i = new li();
3337
+ if (s === "obj") i = new ai();
3338
+ else if (s === "gltf" || s === "glb") i = new ci();
3338
3339
  else {
3339
3340
  t(new Error("不支持的文件格式,请使用 .obj, .gltf, .glb"));
3340
3341
  return;
@@ -3348,30 +3349,30 @@ function Yi(r) {
3348
3349
  c.userData.isMovable = !0, c.name || (c.name = c.type), c.type === "Mesh" && (c.frustumCulled = !0, (p = c.geometry) == null || p.computeVertexNormals());
3349
3350
  });
3350
3351
  const u = new F.Box3().setFromObject(l).getCenter(new F.Vector3());
3351
- l.position.sub(u), vt(l, !0), e(l);
3352
+ l.position.sub(u), At(l, !0), e(l);
3352
3353
  },
3353
3354
  void 0,
3354
3355
  (a) => t(a)
3355
3356
  );
3356
3357
  });
3357
3358
  }
3358
- function Bi(r) {
3359
+ function Ki(r) {
3359
3360
  switch (r) {
3360
3361
  case "box":
3361
- Gi();
3362
+ Xi();
3362
3363
  break;
3363
3364
  case "sphere":
3364
- Xi();
3365
+ Yi();
3365
3366
  break;
3366
3367
  }
3367
3368
  }
3368
- const Ki = {
3369
+ const Vi = {
3369
3370
  key: 1,
3370
3371
  class: "toggle-placeholder"
3371
- }, Vi = { class: "tree-icon" }, Zi = { class: "tree-name" }, Qi = {
3372
+ }, Zi = { class: "tree-icon" }, Qi = { class: "tree-name" }, qi = {
3372
3373
  key: 0,
3373
3374
  class: "tree-children"
3374
- }, qi = /* @__PURE__ */ Ge({
3375
+ }, Wi = /* @__PURE__ */ Ge({
3375
3376
  __name: "TreeItem",
3376
3377
  props: {
3377
3378
  node: {},
@@ -3380,7 +3381,7 @@ const Ki = {
3380
3381
  },
3381
3382
  emits: ["select", "delete"],
3382
3383
  setup(r, { emit: e }) {
3383
- const t = r, s = e, n = G(null), { expandedSet: i, toggleExpand: o } = Tn("treeExpand"), a = Ze(() => i.value.has(t.node.uuid)), l = Ze(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), h = Ze(() => (t.version, t.node.children.filter(
3384
+ const t = r, s = e, n = G(null), { expandedSet: i, toggleExpand: o } = xn("treeExpand"), a = Ze(() => i.value.has(t.node.uuid)), l = Ze(() => (t.version, t.node.children.some((f) => f.userData.isMovable === !0))), h = Ze(() => (t.version, t.node.children.filter(
3384
3385
  (f) => f.userData.isMovable === !0
3385
3386
  ))), u = Ze(
3386
3387
  () => {
@@ -3388,7 +3389,7 @@ const Ki = {
3388
3389
  return ((f = t.selectedObject) == null ? void 0 : f.uuid) === t.node.uuid;
3389
3390
  }
3390
3391
  );
3391
- xn(
3392
+ En(
3392
3393
  () => {
3393
3394
  u.value && n.value && n.value.scrollIntoView({
3394
3395
  block: "nearest",
@@ -3405,7 +3406,7 @@ const Ki = {
3405
3406
  f.stopPropagation(), s("delete", t.node);
3406
3407
  }, m = (f) => f.type === "Mesh" || f.type === "Sprite" ? "🟦" : f.type === "Light" ? "💡" : "📦", b = (f) => f.name || `${f.type} (${f.id})`;
3407
3408
  return (f, y) => {
3408
- const d = En("TreeItem", !0);
3409
+ const d = Mn("TreeItem", !0);
3409
3410
  return N(), U("div", {
3410
3411
  class: "tree-node",
3411
3412
  ref_key: "nodeRef",
@@ -3418,17 +3419,17 @@ const Ki = {
3418
3419
  l.value ? (N(), U("span", {
3419
3420
  key: 0,
3420
3421
  class: "toggle-icon",
3421
- onClick: y[0] || (y[0] = At((_) => Mn(o)(r.node.uuid), ["stop"]))
3422
- }, Ee(a.value ? "▼" : "▶"), 1)) : (N(), U("span", Ki)),
3423
- g("span", Vi, Ee(m(r.node)), 1),
3424
- g("span", Zi, Ee(b(r.node)), 1),
3422
+ onClick: y[0] || (y[0] = Lt((_) => vn(o)(r.node.uuid), ["stop"]))
3423
+ }, Ee(a.value ? "▼" : "▶"), 1)) : (N(), U("span", Vi)),
3424
+ g("span", Zi, Ee(m(r.node)), 1),
3425
+ g("span", Qi, Ee(b(r.node)), 1),
3425
3426
  g("button", {
3426
3427
  class: "tree-delete",
3427
- onClick: At(p, ["stop"])
3428
+ onClick: Lt(p, ["stop"])
3428
3429
  }, "×")
3429
3430
  ], 2),
3430
- a.value && l.value ? (N(), U("div", Qi, [
3431
- (N(!0), U(en, null, tn(h.value, (_) => (N(), ot(d, {
3431
+ a.value && l.value ? (N(), U("div", qi, [
3432
+ (N(!0), U(nn, null, sn(h.value, (_) => (N(), ot(d, {
3432
3433
  key: _.uuid,
3433
3434
  node: _,
3434
3435
  "selected-object": r.selectedObject,
@@ -3445,8 +3446,8 @@ const Ki = {
3445
3446
  for (const [s, n] of e)
3446
3447
  t[s] = n;
3447
3448
  return t;
3448
- }, Wi = /* @__PURE__ */ Xe(qi, [["__scopeId", "data-v-5ad9c842"]]);
3449
- function $i(r) {
3449
+ }, $i = /* @__PURE__ */ Xe(Wi, [["__scopeId", "data-v-5ad9c842"]]);
3450
+ function Ji(r) {
3450
3451
  const e = G(/* @__PURE__ */ new Set()), t = (n) => {
3451
3452
  const i = new Set(e.value);
3452
3453
  i.has(n) ? i.delete(n) : i.add(n), e.value = i;
@@ -3458,7 +3459,7 @@ function $i(r) {
3458
3459
  i.add(o.uuid), o = o.parent;
3459
3460
  e.value = i;
3460
3461
  };
3461
- return nn(
3462
+ return on(
3462
3463
  r,
3463
3464
  (n) => {
3464
3465
  n && s(n);
@@ -3466,28 +3467,28 @@ function $i(r) {
3466
3467
  { immediate: !0 }
3467
3468
  ), { expandedSet: e, toggleExpand: t };
3468
3469
  }
3469
- const Ji = {
3470
+ const eo = {
3470
3471
  key: 0,
3471
3472
  class: "property-panel"
3472
- }, eo = { class: "property-group tree-group" }, to = { class: "tree-container" }, no = {
3473
+ }, to = { class: "property-group tree-group" }, no = { class: "tree-container" }, so = {
3473
3474
  key: 0,
3474
3475
  class: "tree-empty"
3475
- }, so = {
3476
+ }, io = {
3476
3477
  key: 0,
3477
3478
  class: "tabs"
3478
- }, io = {
3479
+ }, oo = {
3479
3480
  key: 1,
3480
3481
  class: "tab-content"
3481
- }, oo = { class: "property-group" }, ro = { class: "row" }, ao = { class: "property-group" }, lo = { class: "row" }, co = { class: "property-group" }, ho = { class: "row" }, uo = {
3482
+ }, ro = { class: "property-group" }, ao = { class: "row" }, lo = { class: "property-group" }, co = { class: "row" }, ho = { class: "property-group" }, uo = { class: "row" }, po = {
3482
3483
  key: 0,
3483
3484
  class: "property-group material-group"
3484
- }, po = { class: "slider-row" }, fo = { class: "slider-value" }, mo = { class: "slider-row" }, go = { class: "slider-value" }, yo = { class: "slider-row" }, _o = { class: "slider-value" }, bo = {
3485
+ }, fo = { class: "slider-row" }, mo = { class: "slider-value" }, go = { class: "slider-row" }, yo = { class: "slider-value" }, _o = { class: "slider-row" }, bo = { class: "slider-value" }, wo = {
3485
3486
  key: 0,
3486
3487
  class: "material-hint"
3487
- }, wo = {
3488
+ }, To = {
3488
3489
  key: 1,
3489
3490
  class: "property-panel empty"
3490
- }, To = /* @__PURE__ */ Ge({
3491
+ }, xo = /* @__PURE__ */ Ge({
3491
3492
  __name: "PropertyPanel",
3492
3493
  props: {
3493
3494
  transform: {},
@@ -3496,11 +3497,11 @@ const Ji = {
3496
3497
  },
3497
3498
  emits: ["propertyChange", "treeSelect", "treeDelete"],
3498
3499
  setup(r, { emit: e }) {
3499
- const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a = vn(t, "selectedObject"), { expandedSet: l, toggleExpand: h } = $i(a);
3500
- Sn("treeExpand", { expandedSet: l, toggleExpand: h });
3500
+ const t = r, s = e, n = () => s("propertyChange"), i = G("transform"), o = G(0), a = Sn(t, "selectedObject"), { expandedSet: l, toggleExpand: h } = Ji(a);
3501
+ An("treeExpand", { expandedSet: l, toggleExpand: h });
3501
3502
  const u = (y) => {
3502
3503
  o.value++, s("treeDelete", y);
3503
- }, c = sn({
3504
+ }, c = rn({
3504
3505
  metalness: 0,
3505
3506
  roughness: 0.5,
3506
3507
  opacity: 1
@@ -3510,13 +3511,13 @@ const Ji = {
3510
3511
  return y.traverse((_) => {
3511
3512
  if (_.type === "Mesh" && !d) {
3512
3513
  const x = _, S = Array.isArray(x.material) ? x.material : [x.material];
3513
- for (const A of S)
3514
- if (A && (A.type === "MeshStandardMaterial" || A.type === "MeshPhongMaterial")) {
3515
- const v = A;
3514
+ for (const R of S)
3515
+ if (R && (R.type === "MeshStandardMaterial" || R.type === "MeshPhongMaterial")) {
3516
+ const v = R;
3516
3517
  d = {
3517
3518
  metalness: v.metalness ?? 0,
3518
3519
  roughness: v.roughness ?? 0.5,
3519
- opacity: A.opacity ?? 1
3520
+ opacity: R.opacity ?? 1
3520
3521
  };
3521
3522
  break;
3522
3523
  }
@@ -3527,8 +3528,8 @@ const Ji = {
3527
3528
  let _ = !1;
3528
3529
  return y.traverse((x) => {
3529
3530
  if (x.type === "Mesh") {
3530
- const S = x, A = Array.isArray(S.material) ? S.material : [S.material];
3531
- for (const v of A)
3531
+ const S = x, R = Array.isArray(S.material) ? S.material : [S.material];
3532
+ for (const v of R)
3532
3533
  v && (v.type === "MeshStandardMaterial" || v.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (v.metalness = d.metalness), d.roughness !== void 0 && (v.roughness = d.roughness), d.opacity !== void 0 && (v.opacity = d.opacity, v.transparent = d.opacity < 1), v.needsUpdate = !0, _ = !0);
3533
3534
  }
3534
3535
  }), _;
@@ -3543,7 +3544,7 @@ const Ji = {
3543
3544
  p.value = y;
3544
3545
  }
3545
3546
  }
3546
- return nn(
3547
+ return on(
3547
3548
  () => t.selectedObject,
3548
3549
  (y) => {
3549
3550
  if (y) {
@@ -3553,12 +3554,12 @@ const Ji = {
3553
3554
  c.metalness = 0, c.roughness = 0.5, c.opacity = 1, p.value = !1;
3554
3555
  },
3555
3556
  { immediate: !0 }
3556
- ), (y, d) => r.transform ? (N(), U("div", Ji, [
3557
+ ), (y, d) => r.transform ? (N(), U("div", eo, [
3557
3558
  d[32] || (d[32] = g("h3", null, "属性面板", -1)),
3558
- g("div", eo, [
3559
+ g("div", to, [
3559
3560
  d[15] || (d[15] = g("label", null, "场景物体", -1)),
3560
- g("div", to, [
3561
- (N(!0), U(en, null, tn(r.treeData, (_) => (N(), ot(Wi, {
3561
+ g("div", no, [
3562
+ (N(!0), U(nn, null, sn(r.treeData, (_) => (N(), ot($i, {
3562
3563
  key: _.uuid,
3563
3564
  node: _,
3564
3565
  "selected-object": r.selectedObject,
@@ -3566,14 +3567,14 @@ const Ji = {
3566
3567
  onSelect: d[0] || (d[0] = (x) => s("treeSelect", x)),
3567
3568
  onDelete: u
3568
3569
  }, null, 8, ["node", "selected-object", "version"]))), 128)),
3569
- r.treeData.length === 0 ? (N(), U("div", no, "暂无物体")) : de("", !0)
3570
+ r.treeData.length === 0 ? (N(), U("div", so, "暂无物体")) : de("", !0)
3570
3571
  ])
3571
3572
  ]),
3572
3573
  d[33] || (d[33] = g("div", { class: "property-group" }, [
3573
3574
  g("label", null, "全局属性"),
3574
3575
  g("div", { class: "row" })
3575
3576
  ], -1)),
3576
- r.selectedObject ? (N(), U("div", so, [
3577
+ r.selectedObject ? (N(), U("div", io, [
3577
3578
  g("button", {
3578
3579
  class: He(["tab-btn", { active: i.value === "transform" }]),
3579
3580
  onClick: d[1] || (d[1] = (_) => i.value = "transform")
@@ -3583,11 +3584,11 @@ const Ji = {
3583
3584
  onClick: d[2] || (d[2] = (_) => i.value = "info")
3584
3585
  }, " ℹ️ 信息 ", 2)
3585
3586
  ])) : de("", !0),
3586
- r.selectedObject ? (N(), U("div", io, [
3587
+ r.selectedObject ? (N(), U("div", oo, [
3587
3588
  D(g("div", null, [
3588
- g("div", oo, [
3589
+ g("div", ro, [
3589
3590
  d[19] || (d[19] = g("label", null, "位置", -1)),
3590
- g("div", ro, [
3591
+ g("div", ao, [
3591
3592
  d[16] || (d[16] = g("span", null, "X:", -1)),
3592
3593
  D(g("input", {
3593
3594
  type: "number",
@@ -3632,9 +3633,9 @@ const Ji = {
3632
3633
  ])
3633
3634
  ])
3634
3635
  ]),
3635
- g("div", ao, [
3636
+ g("div", lo, [
3636
3637
  d[23] || (d[23] = g("label", null, "旋转 (弧度)", -1)),
3637
- g("div", lo, [
3638
+ g("div", co, [
3638
3639
  d[20] || (d[20] = g("span", null, "X:", -1)),
3639
3640
  D(g("input", {
3640
3641
  type: "number",
@@ -3679,9 +3680,9 @@ const Ji = {
3679
3680
  ])
3680
3681
  ])
3681
3682
  ]),
3682
- g("div", co, [
3683
+ g("div", ho, [
3683
3684
  d[27] || (d[27] = g("label", null, "缩放", -1)),
3684
- g("div", ho, [
3685
+ g("div", uo, [
3685
3686
  d[24] || (d[24] = g("span", null, "X:", -1)),
3686
3687
  D(g("input", {
3687
3688
  type: "number",
@@ -3726,9 +3727,9 @@ const Ji = {
3726
3727
  ])
3727
3728
  ])
3728
3729
  ]),
3729
- r.selectedObject ? (N(), U("div", uo, [
3730
+ r.selectedObject ? (N(), U("div", po, [
3730
3731
  d[31] || (d[31] = g("label", null, "材质", -1)),
3731
- g("div", po, [
3732
+ g("div", fo, [
3732
3733
  d[28] || (d[28] = g("span", { class: "slider-label" }, "金属度", -1)),
3733
3734
  D(g("input", {
3734
3735
  type: "range",
@@ -3745,9 +3746,9 @@ const Ji = {
3745
3746
  { number: !0 }
3746
3747
  ]
3747
3748
  ]),
3748
- g("span", fo, Ee(c.metalness.toFixed(2)), 1)
3749
+ g("span", mo, Ee(c.metalness.toFixed(2)), 1)
3749
3750
  ]),
3750
- g("div", mo, [
3751
+ g("div", go, [
3751
3752
  d[29] || (d[29] = g("span", { class: "slider-label" }, "粗糙度", -1)),
3752
3753
  D(g("input", {
3753
3754
  type: "range",
@@ -3764,9 +3765,9 @@ const Ji = {
3764
3765
  { number: !0 }
3765
3766
  ]
3766
3767
  ]),
3767
- g("span", go, Ee(c.roughness.toFixed(2)), 1)
3768
+ g("span", yo, Ee(c.roughness.toFixed(2)), 1)
3768
3769
  ]),
3769
- g("div", yo, [
3770
+ g("div", _o, [
3770
3771
  d[30] || (d[30] = g("span", { class: "slider-label" }, "透明度", -1)),
3771
3772
  D(g("input", {
3772
3773
  type: "range",
@@ -3783,19 +3784,19 @@ const Ji = {
3783
3784
  { number: !0 }
3784
3785
  ]
3785
3786
  ]),
3786
- g("span", _o, Ee(c.opacity.toFixed(2)), 1)
3787
+ g("span", bo, Ee(c.opacity.toFixed(2)), 1)
3787
3788
  ]),
3788
- p.value ? de("", !0) : (N(), U("div", bo, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
3789
+ p.value ? de("", !0) : (N(), U("div", wo, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
3789
3790
  ])) : de("", !0)
3790
3791
  ], 512), [
3791
3792
  [he, i.value === "transform"]
3792
3793
  ])
3793
3794
  ])) : de("", !0)
3794
- ])) : (N(), U("div", wo, [...d[34] || (d[34] = [
3795
+ ])) : (N(), U("div", To, [...d[34] || (d[34] = [
3795
3796
  g("p", null, "未选中任何模型", -1)
3796
3797
  ])]));
3797
3798
  }
3798
- }), xo = /* @__PURE__ */ Xe(To, [["__scopeId", "data-v-d75c643f"]]), Eo = { class: "top-bar" }, Mo = { class: "left-section" }, vo = { class: "dropdown-menu" }, So = { class: "dropdown-menu sub-menu" }, Ro = { class: "dropdown-menu" }, Ao = { class: "dropdown-menu sub-menu" }, Po = { class: "dropdown-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = /* @__PURE__ */ Ge({
3799
+ }), Eo = /* @__PURE__ */ Xe(xo, [["__scopeId", "data-v-d75c643f"]]), Mo = { class: "top-bar" }, vo = { class: "left-section" }, So = { class: "dropdown-menu" }, Ao = { class: "dropdown-menu sub-menu" }, Ro = { class: "dropdown-menu" }, Po = { class: "dropdown-menu sub-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = { class: "dropdown-menu" }, Co = /* @__PURE__ */ Ge({
3799
3800
  __name: "TopBar",
3800
3801
  emits: ["addModel", "importModel"],
3801
3802
  setup(r, { emit: e }) {
@@ -3805,16 +3806,16 @@ const Ji = {
3805
3806
  }, p = ($) => {
3806
3807
  const E = $.target;
3807
3808
  E.files && E.files.length > 0 && (h("importModel", E.files[0]), E.value = "");
3808
- }, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"), A = () => console.log("切换网格"), v = () => console.log("打开帮助"), I = () => console.log("关于编辑器"), ie = () => console.log("打开项目"), ee = () => console.log("打开模型"), fe = () => console.log("打开场景");
3809
- return ($, E) => (N(), U("div", Eo, [
3810
- g("div", Mo, [
3809
+ }, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"), R = () => console.log("切换网格"), v = () => console.log("打开帮助"), I = () => console.log("关于编辑器"), ie = () => console.log("打开项目"), ee = () => console.log("打开模型"), fe = () => console.log("打开场景");
3810
+ return ($, E) => (N(), U("div", Mo, [
3811
+ g("div", vo, [
3811
3812
  g("div", {
3812
3813
  class: "dropdown-wrapper",
3813
3814
  onMouseenter: E[2] || (E[2] = (j) => t.value = !0),
3814
3815
  onMouseleave: E[3] || (E[3] = (j) => t.value = !1)
3815
3816
  }, [
3816
3817
  E[17] || (E[17] = g("button", { class: "menu-btn" }, "文件", -1)),
3817
- D(g("div", vo, [
3818
+ D(g("div", So, [
3818
3819
  g("div", {
3819
3820
  class: "menu-item",
3820
3821
  onClick: m
@@ -3825,7 +3826,7 @@ const Ji = {
3825
3826
  onMouseleave: E[1] || (E[1] = (j) => a.value = !1)
3826
3827
  }, [
3827
3828
  E[16] || (E[16] = g("span", null, "打开", -1)),
3828
- D(g("div", So, [
3829
+ D(g("div", Ao, [
3829
3830
  g("div", {
3830
3831
  class: "menu-item",
3831
3832
  onClick: ie
@@ -3871,7 +3872,7 @@ const Ji = {
3871
3872
  onMouseleave: E[7] || (E[7] = (j) => l.value = !1)
3872
3873
  }, [
3873
3874
  E[18] || (E[18] = g("span", null, "网格", -1)),
3874
- D(g("div", Ao, [
3875
+ D(g("div", Po, [
3875
3876
  g("div", {
3876
3877
  class: "menu-item",
3877
3878
  onClick: E[4] || (E[4] = (j) => h("addModel", "box"))
@@ -3906,7 +3907,7 @@ const Ji = {
3906
3907
  onMouseleave: E[11] || (E[11] = (j) => s.value = !1)
3907
3908
  }, [
3908
3909
  E[20] || (E[20] = g("button", { class: "menu-btn" }, "编辑", -1)),
3909
- D(g("div", Po, [
3910
+ D(g("div", Lo, [
3910
3911
  g("div", {
3911
3912
  class: "menu-item",
3912
3913
  onClick: y
@@ -3933,14 +3934,14 @@ const Ji = {
3933
3934
  onMouseleave: E[13] || (E[13] = (j) => n.value = !1)
3934
3935
  }, [
3935
3936
  E[21] || (E[21] = g("button", { class: "menu-btn" }, "视图", -1)),
3936
- D(g("div", Lo, [
3937
+ D(g("div", Io, [
3937
3938
  g("div", {
3938
3939
  class: "menu-item",
3939
3940
  onClick: S
3940
3941
  }, "重置相机"),
3941
3942
  g("div", {
3942
3943
  class: "menu-item",
3943
- onClick: A
3944
+ onClick: R
3944
3945
  }, "显示网格")
3945
3946
  ], 512), [
3946
3947
  [he, n.value]
@@ -3952,7 +3953,7 @@ const Ji = {
3952
3953
  onMouseleave: E[15] || (E[15] = (j) => i.value = !1)
3953
3954
  }, [
3954
3955
  E[22] || (E[22] = g("button", { class: "menu-btn" }, "帮助", -1)),
3955
- D(g("div", Io, [
3956
+ D(g("div", Oo, [
3956
3957
  g("div", {
3957
3958
  class: "menu-item",
3958
3959
  onClick: v
@@ -3979,10 +3980,10 @@ const Ji = {
3979
3980
  }, null, 544)
3980
3981
  ]));
3981
3982
  }
3982
- }), Co = /* @__PURE__ */ Xe(Oo, [["__scopeId", "data-v-6bb4762f"]]), Do = { class: "bottom-bar" }, No = /* @__PURE__ */ Ge({
3983
+ }), Do = /* @__PURE__ */ Xe(Co, [["__scopeId", "data-v-6bb4762f"]]), No = { class: "bottom-bar" }, ko = /* @__PURE__ */ Ge({
3983
3984
  __name: "BottomBar",
3984
3985
  setup(r) {
3985
- return (e, t) => (N(), U("div", Do, [...t[0] || (t[0] = [
3986
+ return (e, t) => (N(), U("div", No, [...t[0] || (t[0] = [
3986
3987
  g("div", { class: "status-left" }, [
3987
3988
  g("span", null, "就绪")
3988
3989
  ], -1),
@@ -3991,14 +3992,14 @@ const Ji = {
3991
3992
  ], -1)
3992
3993
  ])]));
3993
3994
  }
3994
- }), ko = /* @__PURE__ */ Xe(No, [["__scopeId", "data-v-3427bb27"]]), jo = { class: "app-layout" }, Fo = /* @__PURE__ */ Ge({
3995
+ }), jo = /* @__PURE__ */ Xe(ko, [["__scopeId", "data-v-3427bb27"]]), Fo = { class: "app-layout" }, Ho = /* @__PURE__ */ Ge({
3995
3996
  __name: "DrawingBoard",
3996
3997
  props: {
3997
3998
  mode: { default: "edit" },
3998
3999
  sceneData: { default: null }
3999
4000
  },
4000
4001
  setup(r) {
4001
- const e = r, t = G(null), s = sn({
4002
+ const e = r, t = G(null), s = rn({
4002
4003
  position: { x: 0, y: 0, z: 0 },
4003
4004
  rotation: { x: 0, y: 0, z: 0 },
4004
4005
  scale: { x: 1, y: 1, z: 1 }
@@ -4015,31 +4016,31 @@ const Ji = {
4015
4016
  s.rotation.z
4016
4017
  ), f.scale.set(s.scale.x, s.scale.y, s.scale.z);
4017
4018
  };
4018
- qs((f) => {
4019
+ Ws((f) => {
4019
4020
  t.value = f, f && n(f);
4020
- }), Ws((f) => {
4021
+ }), $s((f) => {
4021
4022
  n(f);
4022
4023
  });
4023
4024
  const o = () => {
4024
4025
  t.value && i(t.value);
4025
- }, a = (f) => Bi(f), l = async (f) => {
4026
+ }, a = (f) => Ki(f), l = async (f) => {
4026
4027
  try {
4027
- await Yi(f);
4028
+ await Bi(f);
4028
4029
  } catch (y) {
4029
4030
  console.error("导入失败:", y), alert("导入失败:" + y.message);
4030
4031
  }
4031
4032
  }, h = Rn([]);
4032
- $s((f) => {
4033
+ Js((f) => {
4033
4034
  h.value = f;
4034
4035
  });
4035
4036
  const u = () => {
4036
- const f = Js();
4037
+ const f = ei();
4037
4038
  f && (h.value = f);
4038
- }, c = (f) => Mt(f), p = (f) => Ks(f.uuid), m = G(null);
4039
- return An(() => {
4040
- m.value && Ns(m.value, e.mode, e.sceneData), u();
4041
- }), (f, y) => (N(), U("div", jo, [
4042
- r.mode === "edit" ? (N(), ot(Co, {
4039
+ }, c = (f) => vt(f), p = (f) => Vs(f.uuid), m = G(null);
4040
+ return Pn(() => {
4041
+ m.value && ks(m.value, e.mode, e.sceneData), u();
4042
+ }), (f, y) => (N(), U("div", Fo, [
4043
+ r.mode === "edit" ? (N(), ot(Do, {
4043
4044
  key: 0,
4044
4045
  onAddModel: a,
4045
4046
  onImportModel: l
@@ -4052,7 +4053,7 @@ const Ji = {
4052
4053
  ref_key: "containerRef",
4053
4054
  ref: m
4054
4055
  }, null, 2),
4055
- r.mode === "edit" ? (N(), ot(xo, {
4056
+ r.mode === "edit" ? (N(), ot(Eo, {
4056
4057
  key: 0,
4057
4058
  transform: s,
4058
4059
  "tree-data": h.value,
@@ -4062,34 +4063,34 @@ const Ji = {
4062
4063
  onTreeDelete: p
4063
4064
  }, null, 8, ["transform", "tree-data", "selected-object"])) : de("", !0)
4064
4065
  ], 2),
4065
- Pn(ko)
4066
+ Ln(jo)
4066
4067
  ]));
4067
4068
  }
4068
- }), Ko = /* @__PURE__ */ Xe(Fo, [["__scopeId", "data-v-0efddd2c"]]);
4069
+ }), Vo = /* @__PURE__ */ Xe(Ho, [["__scopeId", "data-v-0efddd2c"]]);
4069
4070
  export {
4070
- ko as BottomBar,
4071
- Ko as DrawingBoard,
4072
- xo as PropertyPanel,
4073
- Co as TopBar,
4074
- Wi as TreeItem,
4075
- Gi as addBox,
4076
- vt as addModel,
4077
- Bi as addModelByType,
4078
- Xi as addSphere,
4079
- Bo as exportSceneToJSON,
4080
- Xo as getCamera,
4081
- Yo as getRenderer,
4082
- Go as getScene,
4083
- Js as getSceneObjects,
4084
- Yi as importModelFromFile,
4085
- Ns as initEditor,
4086
- ei as loadSceneFromJSON,
4087
- $s as onSceneObjectsChangeCallback,
4088
- Bs as removeModel,
4089
- Ks as removeModelById,
4090
- Mt as selectObject,
4091
- qs as setSelectedObjectCallback,
4092
- Ws as setTransformChangeCallback,
4093
- $i as useTreeExpand
4071
+ jo as BottomBar,
4072
+ Vo as DrawingBoard,
4073
+ Eo as PropertyPanel,
4074
+ Do as TopBar,
4075
+ $i as TreeItem,
4076
+ Xi as addBox,
4077
+ At as addModel,
4078
+ Ki as addModelByType,
4079
+ Yi as addSphere,
4080
+ Ko as exportSceneToJSON,
4081
+ Yo as getCamera,
4082
+ Bo as getRenderer,
4083
+ Xo as getScene,
4084
+ ei as getSceneObjects,
4085
+ Bi as importModelFromFile,
4086
+ ks as initEditor,
4087
+ ti as loadSceneFromJSON,
4088
+ Js as onSceneObjectsChangeCallback,
4089
+ Ks as removeModel,
4090
+ Vs as removeModelById,
4091
+ vt as selectObject,
4092
+ Ws as setSelectedObjectCallback,
4093
+ $s as setTransformChangeCallback,
4094
+ Ji as useTreeExpand
4094
4095
  };
4095
4096
  //# sourceMappingURL=three-editor.es.js.map