endset_three_editor 0.4.2 → 0.4.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,11 +1,11 @@
1
1
  var _n = Object.defineProperty;
2
2
  var $n = (r, e, t) => e in r ? _n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var Re = (r, e, t) => $n(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { toRaw as xt, defineComponent as be, ref as j, inject as es, computed as Be, watchEffect as ts, resolveComponent as ns, openBlock as T, createElementBlock as R, createElementVNode as b, normalizeClass as se, withModifiers as jt, unref as ss, toDisplayString as ie, Fragment as ve, renderList as wt, createBlock as Ke, createCommentVNode as X, reactive as kt, watch as Me, withDirectives as E, vModelText as N, withKeys as Se, vModelCheckbox as is, toRef as os, provide as rs, createVNode as Dt, vShow as De, shallowRef as $t, onMounted as as, onBeforeUnmount as ls } from "vue";
4
+ import { toRaw as xt, defineComponent as be, ref as j, inject as es, computed as Be, watchEffect as ts, resolveComponent as ns, openBlock as T, createElementBlock as R, createElementVNode as b, normalizeClass as se, withModifiers as jt, unref as ss, toDisplayString as ie, Fragment as ve, renderList as wt, createBlock as Ke, createCommentVNode as X, reactive as kt, watch as Me, withDirectives as E, vModelText as N, withKeys as He, vModelCheckbox as is, toRef as os, provide as rs, createVNode as Dt, vShow as De, shallowRef as $t, onMounted as as, onBeforeUnmount as ls } from "vue";
5
5
  import * as P from "three";
6
- import { Controls as On, Vector3 as M, MOUSE as Ne, TOUCH as Le, Quaternion as K, Spherical as en, Vector2 as Y, Ray as cs, Plane as us, MathUtils as En, Raycaster as As, Object3D as ke, MeshBasicMaterial as Pe, LineBasicMaterial as Ze, CylinderGeometry as U, BoxGeometry as q, BufferGeometry as We, Float32BufferAttribute as pe, Mesh as v, OctahedronGeometry as lt, Line as ue, TorusGeometry as Ge, SphereGeometry as ds, Euler as hs, Matrix4 as me, PlaneGeometry as fs, DoubleSide as Rn, Loader as Yt, FileLoader as tt, Color as de, SRGBColorSpace as Ae, Group as ft, Material as Qe, PointsMaterial as Ue, MeshPhongMaterial as ps, LineSegments as Wt, Points as pt, TrianglesDrawMode as ms, TriangleFanDrawMode as zt, TriangleStripDrawMode as Hn, LoaderUtils as Je, MeshPhysicalMaterial as le, LinearSRGBColorSpace as ae, SpotLight as gs, PointLight as bs, DirectionalLight as Is, InstancedMesh as ys, InstancedBufferAttribute as Cs, TextureLoader as xs, ImageBitmapLoader as ws, BufferAttribute as _e, InterleavedBuffer as Sn, InterleavedBufferAttribute as Ln, LinearMipmapLinearFilter as Nn, NearestMipmapLinearFilter as vs, LinearMipmapNearestFilter as Ms, NearestMipmapNearestFilter as Ds, LinearFilter as Gt, NearestFilter as jn, RepeatWrapping as Ft, MirroredRepeatWrapping as Ps, ClampToEdgeWrapping as Ts, MeshStandardMaterial as kn, PropertyBinding as Os, SkinnedMesh as Es, LineLoop as Rs, PerspectiveCamera as Hs, OrthographicCamera as Ss, Skeleton as Ls, AnimationClip as Ns, Bone as js, InterpolateDiscrete as ks, InterpolateLinear as Wn, Texture as tn, VectorKeyframeTrack as nn, NumberKeyframeTrack as sn, QuaternionKeyframeTrack as on, ColorManagement as qt, FrontSide as Ws, Interpolant as zs, Box3 as Gs, Sphere as Fs } from "three";
6
+ import { Controls as On, Vector3 as M, MOUSE as Ne, TOUCH as Le, Quaternion as K, Spherical as en, Vector2 as Y, Ray as cs, Plane as us, MathUtils as En, Raycaster as As, Object3D as ke, MeshBasicMaterial as Pe, LineBasicMaterial as Ze, CylinderGeometry as U, BoxGeometry as q, BufferGeometry as We, Float32BufferAttribute as pe, Mesh as v, OctahedronGeometry as lt, Line as ue, TorusGeometry as Ge, SphereGeometry as ds, Euler as hs, Matrix4 as me, PlaneGeometry as fs, DoubleSide as Rn, Loader as Yt, FileLoader as tt, Color as de, SRGBColorSpace as Ae, Group as ft, Material as Qe, PointsMaterial as Ue, MeshPhongMaterial as ps, LineSegments as Wt, Points as pt, TrianglesDrawMode as ms, TriangleFanDrawMode as zt, TriangleStripDrawMode as Sn, LoaderUtils as Je, MeshPhysicalMaterial as le, LinearSRGBColorSpace as ae, SpotLight as gs, PointLight as bs, DirectionalLight as Is, InstancedMesh as ys, InstancedBufferAttribute as Cs, TextureLoader as xs, ImageBitmapLoader as ws, BufferAttribute as _e, InterleavedBuffer as Hn, InterleavedBufferAttribute as Ln, LinearMipmapLinearFilter as Nn, NearestMipmapLinearFilter as vs, LinearMipmapNearestFilter as Ms, NearestMipmapNearestFilter as Ds, LinearFilter as Gt, NearestFilter as jn, RepeatWrapping as Ft, MirroredRepeatWrapping as Ps, ClampToEdgeWrapping as Ts, MeshStandardMaterial as kn, PropertyBinding as Os, SkinnedMesh as Es, LineLoop as Rs, PerspectiveCamera as Ss, OrthographicCamera as Hs, Skeleton as Ls, AnimationClip as Ns, Bone as js, InterpolateDiscrete as ks, InterpolateLinear as Wn, Texture as tn, VectorKeyframeTrack as nn, NumberKeyframeTrack as sn, QuaternionKeyframeTrack as on, ColorManagement as qt, FrontSide as Ws, Interpolant as zs, Box3 as Gs, Sphere as Fs } from "three";
7
7
  import nt from "@tweenjs/tween.js";
8
- const rn = { type: "change" }, Kt = { type: "start" }, zn = { type: "end" }, ct = new cs(), an = new us(), qs = Math.cos(70 * En.DEG2RAD), G = new M(), V = 2 * Math.PI, S = {
8
+ const rn = { type: "change" }, Kt = { type: "start" }, zn = { type: "end" }, ct = new cs(), an = new us(), qs = Math.cos(70 * En.DEG2RAD), G = new M(), V = 2 * Math.PI, H = {
9
9
  NONE: -1,
10
10
  ROTATE: 0,
11
11
  DOLLY: 1,
@@ -23,7 +23,7 @@ class Xs extends On {
23
23
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
24
24
  */
25
25
  constructor(e, t = null) {
26
- super(e, t), this.state = S.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: Ne.ROTATE, MIDDLE: Ne.DOLLY, RIGHT: Ne.PAN }, this.touches = { ONE: Le.ROTATE, TWO: Le.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 en(), this._sphericalDelta = new en(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new Y(), this._rotateEnd = new Y(), this._rotateDelta = new Y(), this._panStart = new Y(), this._panEnd = new Y(), this._panDelta = new Y(), this._dollyStart = new Y(), this._dollyEnd = new Y(), this._dollyDelta = new Y(), this._dollyDirection = new M(), this._mouse = new Y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Us.bind(this), this._onPointerDown = Bs.bind(this), this._onPointerUp = Vs.bind(this), this._onContextMenu = $s.bind(this), this._onMouseWheel = Zs.bind(this), this._onKeyDown = Qs.bind(this), this._onTouchStart = Js.bind(this), this._onTouchMove = _s.bind(this), this._onMouseDown = Ys.bind(this), this._onMouseMove = Ks.bind(this), this._interceptControlDown = ei.bind(this), this._interceptControlUp = ti.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
26
+ super(e, t), this.state = H.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: Ne.ROTATE, MIDDLE: Ne.DOLLY, RIGHT: Ne.PAN }, this.touches = { ONE: Le.ROTATE, TWO: Le.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 en(), this._sphericalDelta = new en(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new Y(), this._rotateEnd = new Y(), this._rotateDelta = new Y(), this._panStart = new Y(), this._panEnd = new Y(), this._panDelta = new Y(), this._dollyStart = new Y(), this._dollyEnd = new Y(), this._dollyDelta = new Y(), this._dollyDirection = new M(), this._mouse = new Y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Us.bind(this), this._onPointerDown = Bs.bind(this), this._onPointerUp = Vs.bind(this), this._onContextMenu = $s.bind(this), this._onMouseWheel = Zs.bind(this), this._onKeyDown = Qs.bind(this), this._onTouchStart = Js.bind(this), this._onTouchMove = _s.bind(this), this._onMouseDown = Ys.bind(this), this._onMouseMove = Ks.bind(this), this._interceptControlDown = ei.bind(this), this._interceptControlUp = ti.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
27
27
  }
28
28
  /**
29
29
  * Defines the visual representation of the cursor.
@@ -96,7 +96,7 @@ class Xs extends On {
96
96
  * was called, or the initial state.
97
97
  */
98
98
  reset() {
99
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(rn), this.update(), this.state = S.NONE;
99
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(rn), this.update(), this.state = H.NONE;
100
100
  }
101
101
  /**
102
102
  * Programmatically pan the camera.
@@ -141,7 +141,7 @@ class Xs extends On {
141
141
  }
142
142
  update(e = null) {
143
143
  const t = this.object.position;
144
- G.copy(t).sub(this.target), G.applyQuaternion(this._quat), this._spherical.setFromVector3(G), this.autoRotate && this.state === S.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
144
+ G.copy(t).sub(this.target), G.applyQuaternion(this._quat), this._spherical.setFromVector3(G), this.autoRotate && this.state === H.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
145
145
  let s = this.minAzimuthAngle, n = this.maxAzimuthAngle;
146
146
  isFinite(s) && isFinite(n) && (s < -Math.PI ? s += V : s > Math.PI && (s -= V), n < -Math.PI ? n += V : n > Math.PI && (n -= V), s <= n ? this._spherical.theta = Math.max(s, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + n) / 2 ? Math.max(s, this._spherical.theta) : Math.min(n, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
147
147
  let i = !1;
@@ -373,7 +373,7 @@ function Us(r) {
373
373
  function Vs(r) {
374
374
  switch (this._removePointer(r), this._pointers.length) {
375
375
  case 0:
376
- this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(zn), this.state = S.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
376
+ this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(zn), this.state = H.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
377
377
  break;
378
378
  case 1:
379
379
  const e = this._pointers[0], t = this._pointerPositions[e];
@@ -399,49 +399,49 @@ function Ys(r) {
399
399
  switch (e) {
400
400
  case Ne.DOLLY:
401
401
  if (this.enableZoom === !1) return;
402
- this._handleMouseDownDolly(r), this.state = S.DOLLY;
402
+ this._handleMouseDownDolly(r), this.state = H.DOLLY;
403
403
  break;
404
404
  case Ne.ROTATE:
405
405
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
406
406
  if (this.enablePan === !1) return;
407
- this._handleMouseDownPan(r), this.state = S.PAN;
407
+ this._handleMouseDownPan(r), this.state = H.PAN;
408
408
  } else {
409
409
  if (this.enableRotate === !1) return;
410
- this._handleMouseDownRotate(r), this.state = S.ROTATE;
410
+ this._handleMouseDownRotate(r), this.state = H.ROTATE;
411
411
  }
412
412
  break;
413
413
  case Ne.PAN:
414
414
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
415
415
  if (this.enableRotate === !1) return;
416
- this._handleMouseDownRotate(r), this.state = S.ROTATE;
416
+ this._handleMouseDownRotate(r), this.state = H.ROTATE;
417
417
  } else {
418
418
  if (this.enablePan === !1) return;
419
- this._handleMouseDownPan(r), this.state = S.PAN;
419
+ this._handleMouseDownPan(r), this.state = H.PAN;
420
420
  }
421
421
  break;
422
422
  default:
423
- this.state = S.NONE;
423
+ this.state = H.NONE;
424
424
  }
425
- this.state !== S.NONE && this.dispatchEvent(Kt);
425
+ this.state !== H.NONE && this.dispatchEvent(Kt);
426
426
  }
427
427
  function Ks(r) {
428
428
  switch (this.state) {
429
- case S.ROTATE:
429
+ case H.ROTATE:
430
430
  if (this.enableRotate === !1) return;
431
431
  this._handleMouseMoveRotate(r);
432
432
  break;
433
- case S.DOLLY:
433
+ case H.DOLLY:
434
434
  if (this.enableZoom === !1) return;
435
435
  this._handleMouseMoveDolly(r);
436
436
  break;
437
- case S.PAN:
437
+ case H.PAN:
438
438
  if (this.enablePan === !1) return;
439
439
  this._handleMouseMovePan(r);
440
440
  break;
441
441
  }
442
442
  }
443
443
  function Zs(r) {
444
- this.enabled === !1 || this.enableZoom === !1 || this.state !== S.NONE || (r.preventDefault(), this.dispatchEvent(Kt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(zn));
444
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== H.NONE || (r.preventDefault(), this.dispatchEvent(Kt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(zn));
445
445
  }
446
446
  function Qs(r) {
447
447
  this.enabled !== !1 && this._handleKeyDown(r);
@@ -452,55 +452,55 @@ function Js(r) {
452
452
  switch (this.touches.ONE) {
453
453
  case Le.ROTATE:
454
454
  if (this.enableRotate === !1) return;
455
- this._handleTouchStartRotate(r), this.state = S.TOUCH_ROTATE;
455
+ this._handleTouchStartRotate(r), this.state = H.TOUCH_ROTATE;
456
456
  break;
457
457
  case Le.PAN:
458
458
  if (this.enablePan === !1) return;
459
- this._handleTouchStartPan(r), this.state = S.TOUCH_PAN;
459
+ this._handleTouchStartPan(r), this.state = H.TOUCH_PAN;
460
460
  break;
461
461
  default:
462
- this.state = S.NONE;
462
+ this.state = H.NONE;
463
463
  }
464
464
  break;
465
465
  case 2:
466
466
  switch (this.touches.TWO) {
467
467
  case Le.DOLLY_PAN:
468
468
  if (this.enableZoom === !1 && this.enablePan === !1) return;
469
- this._handleTouchStartDollyPan(r), this.state = S.TOUCH_DOLLY_PAN;
469
+ this._handleTouchStartDollyPan(r), this.state = H.TOUCH_DOLLY_PAN;
470
470
  break;
471
471
  case Le.DOLLY_ROTATE:
472
472
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
473
- this._handleTouchStartDollyRotate(r), this.state = S.TOUCH_DOLLY_ROTATE;
473
+ this._handleTouchStartDollyRotate(r), this.state = H.TOUCH_DOLLY_ROTATE;
474
474
  break;
475
475
  default:
476
- this.state = S.NONE;
476
+ this.state = H.NONE;
477
477
  }
478
478
  break;
479
479
  default:
480
- this.state = S.NONE;
480
+ this.state = H.NONE;
481
481
  }
482
- this.state !== S.NONE && this.dispatchEvent(Kt);
482
+ this.state !== H.NONE && this.dispatchEvent(Kt);
483
483
  }
484
484
  function _s(r) {
485
485
  switch (this._trackPointer(r), this.state) {
486
- case S.TOUCH_ROTATE:
486
+ case H.TOUCH_ROTATE:
487
487
  if (this.enableRotate === !1) return;
488
488
  this._handleTouchMoveRotate(r), this.update();
489
489
  break;
490
- case S.TOUCH_PAN:
490
+ case H.TOUCH_PAN:
491
491
  if (this.enablePan === !1) return;
492
492
  this._handleTouchMovePan(r), this.update();
493
493
  break;
494
- case S.TOUCH_DOLLY_PAN:
494
+ case H.TOUCH_DOLLY_PAN:
495
495
  if (this.enableZoom === !1 && this.enablePan === !1) return;
496
496
  this._handleTouchMoveDollyPan(r), this.update();
497
497
  break;
498
- case S.TOUCH_DOLLY_ROTATE:
498
+ case H.TOUCH_DOLLY_ROTATE:
499
499
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
500
500
  this._handleTouchMoveDollyRotate(r), this.update();
501
501
  break;
502
502
  default:
503
- this.state = S.NONE;
503
+ this.state = H.NONE;
504
504
  }
505
505
  }
506
506
  function $s(r) {
@@ -545,8 +545,8 @@ class ni extends On {
545
545
  }), o[C] = y, i[C] = y, n[C] = y;
546
546
  }
547
547
  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);
548
- const l = new M(), c = new M(), A = new K(), u = new K(), h = new M(), d = new K(), p = new M(), m = new M(), f = new M(), g = 0, x = new M();
549
- a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", A), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", d), a("pointStart", p), a("pointEnd", m), a("rotationAxis", f), a("rotationAngle", g), a("eye", x), 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 = si.bind(this), this._onPointerDown = oi.bind(this), this._onPointerHover = ii.bind(this), this._onPointerMove = ri.bind(this), this._onPointerUp = ai.bind(this), t !== null && this.connect(t);
548
+ const l = new M(), c = new M(), A = new K(), u = new K(), h = new M(), d = new K(), m = new M(), p = new M(), f = new M(), g = 0, x = new M();
549
+ a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", A), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", d), a("pointStart", m), a("pointEnd", p), a("rotationAxis", f), a("rotationAngle", g), a("eye", x), 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 = si.bind(this), this._onPointerDown = oi.bind(this), this._onPointerHover = ii.bind(this), this._onPointerMove = ri.bind(this), this._onPointerUp = ai.bind(this), t !== null && this.connect(t);
550
550
  }
551
551
  connect(e) {
552
552
  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";
@@ -802,8 +802,8 @@ class ci extends ke {
802
802
  h.color.setHex(16776960), h.opacity = 0.25;
803
803
  const d = e.clone();
804
804
  d.color.setHex(16776960);
805
- const p = e.clone();
806
- p.color.setHex(7895160), this.materialLib = {
805
+ const m = e.clone();
806
+ m.color.setHex(7895160), this.materialLib = {
807
807
  xAxis: i,
808
808
  yAxis: o,
809
809
  zAxis: a,
@@ -813,8 +813,8 @@ class ci extends ke {
813
813
  zAxisTransparent: A,
814
814
  activeTransparent: h
815
815
  };
816
- const m = new U(0, 0.04, 0.1, 12);
817
- m.translate(0, 0.05, 0);
816
+ const p = new U(0, 0.04, 0.1, 12);
817
+ p.translate(0, 0.05, 0);
818
818
  const f = new q(0.08, 0.08, 0.08);
819
819
  f.translate(0, 0.04, 0);
820
820
  const g = new We();
@@ -831,18 +831,18 @@ class ci extends ke {
831
831
  }
832
832
  const w = {
833
833
  X: [
834
- [new v(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
835
- [new v(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
834
+ [new v(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
835
+ [new v(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
836
836
  [new v(x, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
837
837
  ],
838
838
  Y: [
839
- [new v(m, o), [0, 0.5, 0]],
840
- [new v(m, o), [0, -0.5, 0], [Math.PI, 0, 0]],
839
+ [new v(p, o), [0, 0.5, 0]],
840
+ [new v(p, o), [0, -0.5, 0], [Math.PI, 0, 0]],
841
841
  [new v(x, o)]
842
842
  ],
843
843
  Z: [
844
- [new v(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
845
- [new v(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
844
+ [new v(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
845
+ [new v(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
846
846
  [new v(x, a), null, [Math.PI / 2, 0, 0]]
847
847
  ],
848
848
  XYZ: [
@@ -882,7 +882,7 @@ class ci extends ke {
882
882
  XZ: [
883
883
  [new v(new q(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
884
884
  ]
885
- }, H = {
885
+ }, S = {
886
886
  START: [
887
887
  [new v(new lt(0.01, 2), n), null, null, null, "helper"]
888
888
  ],
@@ -903,7 +903,7 @@ class ci extends ke {
903
903
  ]
904
904
  }, Z = {
905
905
  XYZE: [
906
- [new v(C(0.5, 1), p), null, [0, Math.PI / 2, 0]]
906
+ [new v(C(0.5, 1), m), null, [0, Math.PI / 2, 0]]
907
907
  ],
908
908
  X: [
909
909
  [new v(C(0.5, 0.5), i)]
@@ -1012,7 +1012,7 @@ class ci extends ke {
1012
1012
  }
1013
1013
  return it;
1014
1014
  }
1015
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ce(w)), this.add(this.gizmo.rotate = ce(Z)), this.add(this.gizmo.scale = ce(ye)), this.add(this.picker.translate = ce(D)), this.add(this.picker.rotate = ce(Q)), this.add(this.picker.scale = ce(Mt)), this.add(this.helper.translate = ce(H)), this.add(this.helper.rotate = ce(_)), this.add(this.helper.scale = ce(Qn)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1015
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ce(w)), this.add(this.gizmo.rotate = ce(Z)), this.add(this.gizmo.scale = ce(ye)), this.add(this.picker.translate = ce(D)), this.add(this.picker.rotate = ce(Q)), this.add(this.picker.scale = ce(Mt)), this.add(this.helper.translate = ce(S)), this.add(this.helper.rotate = ce(_)), this.add(this.helper.scale = ce(Qn)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1016
1016
  }
1017
1017
  // updateMatrixWorld will update transformations and appearance of individual handles
1018
1018
  updateMatrixWorld(e) {
@@ -1096,7 +1096,7 @@ class Ai extends ke {
1096
1096
  return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
1097
1097
  }
1098
1098
  }
1099
- const He = new M(), pn = new me(), mn = new me(), gn = new M(), bn = new M();
1099
+ const Se = new M(), pn = new me(), mn = new me(), gn = new M(), bn = new M();
1100
1100
  class di {
1101
1101
  /**
1102
1102
  * Constructs a new CSS2D renderer.
@@ -1114,51 +1114,51 @@ class di {
1114
1114
  width: s,
1115
1115
  height: n
1116
1116
  };
1117
- }, this.render = function(p, m) {
1118
- p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), pn.copy(m.matrixWorldInverse), mn.multiplyMatrices(m.projectionMatrix, pn), A(p, p, m), this.sortObjects && d(p);
1119
- }, this.setSize = function(p, m) {
1120
- s = p, n = m, i = s / 2, o = n / 2, l.style.width = p + "px", l.style.height = m + "px";
1117
+ }, this.render = function(m, p) {
1118
+ m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), p.parent === null && p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), pn.copy(p.matrixWorldInverse), mn.multiplyMatrices(p.projectionMatrix, pn), A(m, m, p), this.sortObjects && d(m);
1119
+ }, this.setSize = function(m, p) {
1120
+ s = m, n = p, i = s / 2, o = n / 2, l.style.width = m + "px", l.style.height = p + "px";
1121
1121
  };
1122
- function c(p) {
1123
- p.isCSS2DObject && (p.element.style.display = "none");
1124
- for (let m = 0, f = p.children.length; m < f; m++)
1125
- c(p.children[m]);
1122
+ function c(m) {
1123
+ m.isCSS2DObject && (m.element.style.display = "none");
1124
+ for (let p = 0, f = m.children.length; p < f; p++)
1125
+ c(m.children[p]);
1126
1126
  }
1127
- function A(p, m, f) {
1128
- if (p.visible === !1) {
1129
- c(p);
1127
+ function A(m, p, f) {
1128
+ if (m.visible === !1) {
1129
+ c(m);
1130
1130
  return;
1131
1131
  }
1132
- if (p.isCSS2DObject) {
1133
- He.setFromMatrixPosition(p.matrixWorld), He.applyMatrix4(mn);
1134
- const g = He.z >= -1 && He.z <= 1 && p.layers.test(f.layers) === !0, x = p.element;
1135
- x.style.display = g === !0 ? "" : "none", g === !0 && (p.onBeforeRender(t, m, f), x.style.transform = "translate(" + -100 * p.center.x + "%," + -100 * p.center.y + "%)translate(" + (He.x * i + i) + "px," + (-He.y * o + o) + "px)", x.parentNode !== l && l.appendChild(x), p.onAfterRender(t, m, f));
1132
+ if (m.isCSS2DObject) {
1133
+ Se.setFromMatrixPosition(m.matrixWorld), Se.applyMatrix4(mn);
1134
+ const g = Se.z >= -1 && Se.z <= 1 && m.layers.test(f.layers) === !0, x = m.element;
1135
+ x.style.display = g === !0 ? "" : "none", g === !0 && (m.onBeforeRender(t, p, f), x.style.transform = "translate(" + -100 * m.center.x + "%," + -100 * m.center.y + "%)translate(" + (Se.x * i + i) + "px," + (-Se.y * o + o) + "px)", x.parentNode !== l && l.appendChild(x), m.onAfterRender(t, p, f));
1136
1136
  const C = {
1137
- distanceToCameraSquared: u(f, p)
1137
+ distanceToCameraSquared: u(f, m)
1138
1138
  };
1139
- a.objects.set(p, C);
1139
+ a.objects.set(m, C);
1140
1140
  }
1141
- for (let g = 0, x = p.children.length; g < x; g++)
1142
- A(p.children[g], m, f);
1141
+ for (let g = 0, x = m.children.length; g < x; g++)
1142
+ A(m.children[g], p, f);
1143
1143
  }
1144
- function u(p, m) {
1145
- return gn.setFromMatrixPosition(p.matrixWorld), bn.setFromMatrixPosition(m.matrixWorld), gn.distanceToSquared(bn);
1144
+ function u(m, p) {
1145
+ return gn.setFromMatrixPosition(m.matrixWorld), bn.setFromMatrixPosition(p.matrixWorld), gn.distanceToSquared(bn);
1146
1146
  }
1147
- function h(p) {
1148
- const m = [];
1149
- return p.traverseVisible(function(f) {
1150
- f.isCSS2DObject && m.push(f);
1151
- }), m;
1147
+ function h(m) {
1148
+ const p = [];
1149
+ return m.traverseVisible(function(f) {
1150
+ f.isCSS2DObject && p.push(f);
1151
+ }), p;
1152
1152
  }
1153
- function d(p) {
1154
- const m = h(p).sort(function(g, x) {
1153
+ function d(m) {
1154
+ const p = h(m).sort(function(g, x) {
1155
1155
  if (g.renderOrder !== x.renderOrder)
1156
1156
  return x.renderOrder - g.renderOrder;
1157
1157
  const C = a.objects.get(g).distanceToCameraSquared, y = a.objects.get(x).distanceToCameraSquared;
1158
1158
  return C - y;
1159
- }), f = m.length;
1160
- for (let g = 0, x = m.length; g < x; g++)
1161
- m[g].element.style.zIndex = f - g;
1159
+ }), f = p.length;
1160
+ for (let g = 0, x = p.length; g < x; g++)
1161
+ p[g].element.style.zIndex = f - g;
1162
1162
  }
1163
1163
  }
1164
1164
  }
@@ -1587,7 +1587,7 @@ function Ei(r) {
1587
1587
  console.warn("[selectModelHandle] 传入的 objectId 为空");
1588
1588
  return;
1589
1589
  }
1590
- Si(r);
1590
+ Hi(r);
1591
1591
  let e = null;
1592
1592
  st.forEach((t) => {
1593
1593
  t.userData.id == r && (e = t), t.children && t.children.forEach((s) => {
@@ -1613,12 +1613,12 @@ function Ri(r) {
1613
1613
  });
1614
1614
  const i = s.intersectObjects(n);
1615
1615
  if (i.length > 0) {
1616
- let o = Hi(i[0].object);
1616
+ let o = Si(i[0].object);
1617
1617
  Qt(o);
1618
1618
  } else
1619
1619
  Jt();
1620
1620
  }
1621
- function Hi(r) {
1621
+ function Si(r) {
1622
1622
  if (r.type === "Line") {
1623
1623
  const e = r.parent;
1624
1624
  switch (e.type) {
@@ -1630,7 +1630,7 @@ function Hi(r) {
1630
1630
  }
1631
1631
  return r;
1632
1632
  }
1633
- function Si(r, e = 500) {
1633
+ function Hi(r, e = 500) {
1634
1634
  var d;
1635
1635
  if (!I.camera || !I.orbitControls) {
1636
1636
  console.warn(
@@ -1638,13 +1638,9 @@ function Si(r, e = 500) {
1638
1638
  );
1639
1639
  return;
1640
1640
  }
1641
- if (r == null || r === "") {
1642
- console.warn("[focusOnObject] 传入的 objectId 为空,无法聚焦");
1643
- return;
1644
- }
1645
1641
  let t = null;
1646
- if ((d = I.scene) == null || d.traverse((p) => {
1647
- p.userData.id == r && (t = p);
1642
+ if ((d = I.scene) == null || d.traverse((m) => {
1643
+ m.userData.id == r && (t = m);
1648
1644
  }), !t) {
1649
1645
  console.warn(
1650
1646
  `[focusOnObject] 在场景中未找到 userData.id 为 "${r}" 的物体。请确认:1) 物体已被正确添加到场景(addModel);2) 物体的 userData.id 与传入的 objectId 一致;3) 传入的 objectId 不为空`
@@ -1676,13 +1672,13 @@ function Si(r, e = 500) {
1676
1672
  tz: n.z
1677
1673
  },
1678
1674
  e
1679
- ).easing(nt.Easing.Quadratic.InOut).onUpdate((p) => {
1680
- I.camera.position.set(p.x, p.y, p.z), I.orbitControls.target.set(p.tx, p.ty, p.tz), I.orbitControls.update();
1675
+ ).easing(nt.Easing.Quadratic.InOut).onUpdate((m) => {
1676
+ I.camera.position.set(m.x, m.y, m.z), I.orbitControls.target.set(m.tx, m.ty, m.tz), I.orbitControls.update();
1681
1677
  }).start();
1682
- } catch (p) {
1678
+ } catch (m) {
1683
1679
  console.error(
1684
1680
  "[focusOnObject] TWEEN 动画创建失败,请检查 @tweenjs/tween.js 是否已正确安装且版本兼容(^23.1.3):",
1685
- p
1681
+ m
1686
1682
  );
1687
1683
  }
1688
1684
  }
@@ -1768,26 +1764,26 @@ async function Ki() {
1768
1764
  r.traverse((h) => {
1769
1765
  var d;
1770
1766
  if (h.userData.type === "lightHelper" && e.push(h), h.type === "DirectionalLight" && h.userData.helper && (t.set(h, h.userData.helper), h.userData.helper = void 0), h.name && h.name.startsWith("DataPanel_")) {
1771
- const p = h;
1772
- if (p.element) {
1773
- const m = p.element.querySelector(
1767
+ const m = h;
1768
+ if (m.element) {
1769
+ const p = m.element.querySelector(
1774
1770
  "[data-panel-title]"
1775
1771
  ), f = [];
1776
- p.element.querySelectorAll(
1772
+ m.element.querySelectorAll(
1777
1773
  ".css2d-data-panel-item"
1778
1774
  ).forEach((x) => {
1779
- var w, D, H;
1775
+ var w, D, S;
1780
1776
  const C = x.querySelector(".item-label"), y = x.querySelector(".item-value");
1781
1777
  if (C && y) {
1782
1778
  const Z = (C.textContent || "").trim(), _ = ((D = (w = y.childNodes[0]) == null ? void 0 : w.textContent) == null ? void 0 : D.trim()) || "", Q = y.querySelector(
1783
1779
  "span"
1784
- ), ye = Q ? (Q.textContent || "").trim() : void 0, Mt = ((H = x.getAttribute("data-item-code")) == null ? void 0 : H.trim()) || void 0;
1780
+ ), ye = Q ? (Q.textContent || "").trim() : void 0, Mt = ((S = x.getAttribute("data-item-code")) == null ? void 0 : S.trim()) || void 0;
1785
1781
  f.push({ label: Z, value: _, unit: ye, code: Mt });
1786
1782
  }
1787
1783
  }), h.parent && s.set(
1788
1784
  h.parent.userData.id ? h.parent.userData.id : h.parent.uuid,
1789
1785
  {
1790
- title: ((d = m == null ? void 0 : m.textContent) == null ? void 0 : d.trim()) || "",
1786
+ title: ((d = p == null ? void 0 : p.textContent) == null ? void 0 : d.trim()) || "",
1791
1787
  items: f
1792
1788
  }
1793
1789
  );
@@ -1823,17 +1819,32 @@ async function Ki() {
1823
1819
  function Zi(r, e = "edit", t) {
1824
1820
  var o, a, l;
1825
1821
  const s = typeof r == "string" ? JSON.parse(r) : r, i = new P.ObjectLoader().parse(s);
1826
- i.type === "Scene" ? I.scene = i : (o = I.scene) == null || o.add(i), t && ((a = I.scene) == null || a.traverse((c) => {
1827
- const A = c.userData.id || c.uuid, u = t[A];
1828
- if (u && c.userData.isMovable) {
1829
- Li(c);
1830
- const h = new Gn({
1831
- title: u.title,
1832
- items: u.items
1833
- });
1834
- h.attachTo(c), h.visible = !1, console.log("panel", h), Fn(c, h);
1835
- }
1836
- })), e === "edit" && ((l = I.scene) == null || l.traverse((c) => {
1822
+ if (i.type === "Scene" ? I.scene = i : (o = I.scene) == null || o.add(i), t) {
1823
+ const c = Math.min(window.innerWidth, 7e3), A = 1920, u = 200, h = Math.max(
1824
+ 150,
1825
+ Math.round(c / A * u)
1826
+ ), m = Math.max(
1827
+ 12,
1828
+ Math.min(
1829
+ 20,
1830
+ Math.round(h / u * 13)
1831
+ )
1832
+ );
1833
+ (a = I.scene) == null || a.traverse((p) => {
1834
+ const f = p.userData.id || p.uuid, g = t[f];
1835
+ if (g && p.userData.isMovable) {
1836
+ Li(p);
1837
+ const x = new Gn({
1838
+ title: g.title,
1839
+ items: g.items,
1840
+ width: `${h}px`,
1841
+ fontSize: `${m}px`
1842
+ });
1843
+ x.attachTo(p), x.visible = !1, Fn(p, x);
1844
+ }
1845
+ });
1846
+ }
1847
+ e === "edit" && ((l = I.scene) == null || l.traverse((c) => {
1837
1848
  var A;
1838
1849
  if (c.type === "DirectionalLight") {
1839
1850
  const u = c;
@@ -1991,13 +2002,13 @@ function to() {
1991
2002
  const A = this.vertices.length;
1992
2003
  let u = this.parseVertexIndex(e, A), h = this.parseVertexIndex(t, A), d = this.parseVertexIndex(s, A);
1993
2004
  if (this.addVertex(u, h, d), this.addColor(u, h, d), a !== void 0 && a !== "") {
1994
- const p = this.normals.length;
1995
- u = this.parseNormalIndex(a, p), h = this.parseNormalIndex(l, p), d = this.parseNormalIndex(c, p), this.addNormal(u, h, d);
2005
+ const m = this.normals.length;
2006
+ u = this.parseNormalIndex(a, m), h = this.parseNormalIndex(l, m), d = this.parseNormalIndex(c, m), this.addNormal(u, h, d);
1996
2007
  } else
1997
2008
  this.addFaceNormal(u, h, d);
1998
2009
  if (n !== void 0 && n !== "") {
1999
- const p = this.uvs.length;
2000
- u = this.parseUVIndex(n, p), h = this.parseUVIndex(i, p), d = this.parseUVIndex(o, p), this.addUV(u, h, d), this.object.geometry.hasUVIndices = !0;
2010
+ const m = this.uvs.length;
2011
+ u = this.parseUVIndex(n, m), h = this.parseUVIndex(i, m), d = this.parseUVIndex(o, m), this.addUV(u, h, d), this.object.geometry.hasUVIndices = !0;
2001
2012
  } else
2002
2013
  this.addDefaultUV();
2003
2014
  },
@@ -2108,24 +2119,24 @@ class no extends Yt {
2108
2119
  }
2109
2120
  } else if (A === "f") {
2110
2121
  const h = c.slice(1).trim().split(In), d = [];
2111
- for (let m = 0, f = h.length; m < f; m++) {
2112
- const g = h[m];
2122
+ for (let p = 0, f = h.length; p < f; p++) {
2123
+ const g = h[p];
2113
2124
  if (g.length > 0) {
2114
2125
  const x = g.split("/");
2115
2126
  d.push(x);
2116
2127
  }
2117
2128
  }
2118
- const p = d[0];
2119
- for (let m = 1, f = d.length - 1; m < f; m++) {
2120
- const g = d[m], x = d[m + 1];
2129
+ const m = d[0];
2130
+ for (let p = 1, f = d.length - 1; p < f; p++) {
2131
+ const g = d[p], x = d[p + 1];
2121
2132
  t.addFace(
2122
- p[0],
2133
+ m[0],
2123
2134
  g[0],
2124
2135
  x[0],
2125
- p[1],
2136
+ m[1],
2126
2137
  g[1],
2127
2138
  x[1],
2128
- p[2],
2139
+ m[2],
2129
2140
  g[2],
2130
2141
  x[2]
2131
2142
  );
@@ -2137,8 +2148,8 @@ class no extends Yt {
2137
2148
  if (c.indexOf("/") === -1)
2138
2149
  h = u;
2139
2150
  else
2140
- for (let p = 0, m = u.length; p < m; p++) {
2141
- const f = u[p].split("/");
2151
+ for (let m = 0, p = u.length; m < p; m++) {
2152
+ const f = u[m].split("/");
2142
2153
  f[0] !== "" && h.push(f[0]), f[1] !== "" && d.push(f[1]);
2143
2154
  }
2144
2155
  t.addLineGeometry(h, d);
@@ -2172,34 +2183,34 @@ class no extends Yt {
2172
2183
  if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
2173
2184
  for (let a = 0, l = t.objects.length; a < l; a++) {
2174
2185
  const c = t.objects[a], A = c.geometry, u = c.materials, h = A.type === "Line", d = A.type === "Points";
2175
- let p = !1;
2186
+ let m = !1;
2176
2187
  if (A.vertices.length === 0) continue;
2177
- const m = new We();
2178
- m.setAttribute("position", new pe(A.vertices, 3)), A.normals.length > 0 && m.setAttribute("normal", new pe(A.normals, 3)), A.colors.length > 0 && (p = !0, m.setAttribute("color", new pe(A.colors, 3))), A.hasUVIndices === !0 && m.setAttribute("uv", new pe(A.uvs, 2));
2188
+ const p = new We();
2189
+ p.setAttribute("position", new pe(A.vertices, 3)), A.normals.length > 0 && p.setAttribute("normal", new pe(A.normals, 3)), A.colors.length > 0 && (m = !0, p.setAttribute("color", new pe(A.colors, 3))), A.hasUVIndices === !0 && p.setAttribute("uv", new pe(A.uvs, 2));
2179
2190
  const f = [];
2180
2191
  for (let x = 0, C = u.length; x < C; x++) {
2181
- const y = u[x], w = y.name + "_" + y.smooth + "_" + p;
2192
+ const y = u[x], w = y.name + "_" + y.smooth + "_" + m;
2182
2193
  let D = t.materials[w];
2183
2194
  if (this.materials !== null) {
2184
2195
  if (D = this.materials.create(y.name), h && D && !(D instanceof Ze)) {
2185
- const H = new Ze();
2186
- Qe.prototype.copy.call(H, D), H.color.copy(D.color), D = H;
2196
+ const S = new Ze();
2197
+ Qe.prototype.copy.call(S, D), S.color.copy(D.color), D = S;
2187
2198
  } else if (d && D && !(D instanceof Ue)) {
2188
- const H = new Ue({ size: 10, sizeAttenuation: !1 });
2189
- Qe.prototype.copy.call(H, D), H.color.copy(D.color), H.map = D.map, D = H;
2199
+ const S = new Ue({ size: 10, sizeAttenuation: !1 });
2200
+ Qe.prototype.copy.call(S, D), S.color.copy(D.color), S.map = D.map, D = S;
2190
2201
  }
2191
2202
  }
2192
- D === void 0 && (h ? D = new Ze() : d ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = y.name, D.flatShading = !y.smooth, D.vertexColors = p, t.materials[w] = D), f.push(D);
2203
+ D === void 0 && (h ? D = new Ze() : d ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = y.name, D.flatShading = !y.smooth, D.vertexColors = m, t.materials[w] = D), f.push(D);
2193
2204
  }
2194
2205
  let g;
2195
2206
  if (f.length > 1) {
2196
2207
  for (let x = 0, C = u.length; x < C; x++) {
2197
2208
  const y = u[x];
2198
- m.addGroup(y.groupStart, y.groupCount, x);
2209
+ p.addGroup(y.groupStart, y.groupCount, x);
2199
2210
  }
2200
- h ? g = new Wt(m, f) : d ? g = new pt(m, f) : g = new v(m, f);
2211
+ h ? g = new Wt(p, f) : d ? g = new pt(p, f) : g = new v(p, f);
2201
2212
  } else
2202
- h ? g = new Wt(m, f[0]) : d ? g = new pt(m, f[0]) : g = new v(m, f[0]);
2213
+ h ? g = new Wt(p, f[0]) : d ? g = new pt(p, f[0]) : g = new v(p, f[0]);
2203
2214
  g.name = c.name, i.add(g);
2204
2215
  }
2205
2216
  else if (t.vertices.length > 0) {
@@ -2214,7 +2225,7 @@ class no extends Yt {
2214
2225
  function wn(r, e) {
2215
2226
  if (e === ms)
2216
2227
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
2217
- if (e === zt || e === Hn) {
2228
+ if (e === zt || e === Sn) {
2218
2229
  let t = r.getIndex();
2219
2230
  if (t === null) {
2220
2231
  const o = [], a = r.getAttribute("position");
@@ -2827,16 +2838,16 @@ class wo {
2827
2838
  a.push(this.parser.getDependency("accessor", o[c]).then((A) => (l[c] = A, l[c])));
2828
2839
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
2829
2840
  const A = c.pop(), u = A.isGroup ? A.children : [A], h = c[0].count, d = [];
2830
- for (const p of u) {
2831
- const m = new me(), f = new M(), g = new K(), x = new M(1, 1, 1), C = new ys(p.geometry, p.material, h);
2841
+ for (const m of u) {
2842
+ const p = new me(), f = new M(), g = new K(), x = new M(1, 1, 1), C = new ys(m.geometry, m.material, h);
2832
2843
  for (let y = 0; y < h; y++)
2833
- l.TRANSLATION && f.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), C.setMatrixAt(y, m.compose(f, g, x));
2844
+ l.TRANSLATION && f.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), C.setMatrixAt(y, p.compose(f, g, x));
2834
2845
  for (const y in l)
2835
2846
  if (y === "_COLOR_0") {
2836
2847
  const w = l[y];
2837
2848
  C.instanceColor = new Cs(w.array, w.itemSize, w.normalized);
2838
- } else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" && p.geometry.setAttribute(y, l[y]);
2839
- ke.prototype.copy.call(C, p), this.parser.assignFinalMaterial(C), d.push(C);
2849
+ } else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" && m.geometry.setAttribute(y, l[y]);
2850
+ ke.prototype.copy.call(C, m), this.parser.assignFinalMaterial(C), d.push(C);
2840
2851
  }
2841
2852
  return A.isGroup ? (A.clear(), A.add(...d), A) : d[0];
2842
2853
  }));
@@ -2896,9 +2907,9 @@ class Mo {
2896
2907
  return t.getDependency("bufferView", i).then(function(A) {
2897
2908
  return new Promise(function(u, h) {
2898
2909
  n.decodeDracoFile(A, function(d) {
2899
- for (const p in d.attributes) {
2900
- const m = d.attributes[p], f = l[p];
2901
- f !== void 0 && (m.normalized = f);
2910
+ for (const m in d.attributes) {
2911
+ const p = d.attributes[m], f = l[m];
2912
+ f !== void 0 && (p.normalized = f);
2902
2913
  }
2903
2914
  u(d);
2904
2915
  }, a, c, ae, h);
@@ -2930,10 +2941,10 @@ class Zn extends zs {
2930
2941
  return t;
2931
2942
  }
2932
2943
  interpolate_(e, t, s, n) {
2933
- const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, A = n - t, u = (s - t) / A, h = u * u, d = h * u, p = e * c, m = p - c, f = -2 * d + 3 * h, g = d - h, x = 1 - f, C = g - h + u;
2944
+ const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, A = n - t, u = (s - t) / A, h = u * u, d = h * u, m = e * c, p = m - c, f = -2 * d + 3 * h, g = d - h, x = 1 - f, C = g - h + u;
2934
2945
  for (let y = 0; y !== a; y++) {
2935
- const w = o[m + y + a], D = o[m + y + l] * A, H = o[p + y + a], Z = o[p + y] * A;
2936
- i[y] = x * w + C * D + f * H + g * Z;
2946
+ const w = o[p + y + a], D = o[p + y + l] * A, S = o[m + y + a], Z = o[m + y] * A;
2947
+ i[y] = x * w + C * D + f * S + g * Z;
2937
2948
  }
2938
2949
  return i;
2939
2950
  }
@@ -2971,7 +2982,7 @@ const te = {
2971
2982
  33071: Ts,
2972
2983
  33648: Ps,
2973
2984
  10497: Ft
2974
- }, Ht = {
2985
+ }, St = {
2975
2986
  SCALAR: 1,
2976
2987
  VEC2: 2,
2977
2988
  VEC3: 3,
@@ -3001,7 +3012,7 @@ const te = {
3001
3012
  // keyframe track will be initialized with a default interpolation type, then modified.
3002
3013
  LINEAR: Wn,
3003
3014
  STEP: ks
3004
- }, St = {
3015
+ }, Ht = {
3005
3016
  OPAQUE: "OPAQUE",
3006
3017
  MASK: "MASK",
3007
3018
  BLEND: "BLEND"
@@ -3024,7 +3035,7 @@ function xe(r, e, t) {
3024
3035
  function re(r, e) {
3025
3036
  e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
3026
3037
  }
3027
- function Ho(r, e, t) {
3038
+ function So(r, e, t) {
3028
3039
  let s = !1, n = !1, i = !1;
3029
3040
  for (let c = 0, A = e.length; c < A; c++) {
3030
3041
  const u = e[c];
@@ -3056,7 +3067,7 @@ function Ho(r, e, t) {
3056
3067
  return s && (r.morphAttributes.position = A), n && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = h), r.morphTargetsRelative = !0, r;
3057
3068
  });
3058
3069
  }
3059
- function So(r, e) {
3070
+ function Ho(r, e) {
3060
3071
  if (r.updateMorphTargets(), e.weights !== void 0)
3061
3072
  for (let t = 0, s = e.weights.length; t < s; t++)
3062
3073
  r.morphTargetInfluences[t] = e.weights[t];
@@ -3353,27 +3364,27 @@ class ko {
3353
3364
  loadAccessor(e) {
3354
3365
  const t = this, s = this.json, n = this.json.accessors[e];
3355
3366
  if (n.bufferView === void 0 && n.sparse === void 0) {
3356
- const o = Ht[n.type], a = je[n.componentType], l = n.normalized === !0, c = new a(n.count * o);
3367
+ const o = St[n.type], a = je[n.componentType], l = n.normalized === !0, c = new a(n.count * o);
3357
3368
  return Promise.resolve(new _e(c, o, l));
3358
3369
  }
3359
3370
  const i = [];
3360
3371
  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) {
3361
- const a = o[0], l = Ht[n.type], c = je[n.componentType], A = c.BYTES_PER_ELEMENT, u = A * l, h = n.byteOffset || 0, d = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, p = n.normalized === !0;
3362
- let m, f;
3372
+ const a = o[0], l = St[n.type], c = je[n.componentType], A = c.BYTES_PER_ELEMENT, u = A * l, h = n.byteOffset || 0, d = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, m = n.normalized === !0;
3373
+ let p, f;
3363
3374
  if (d && d !== u) {
3364
3375
  const g = Math.floor(h / d), x = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + g + ":" + n.count;
3365
3376
  let C = t.cache.get(x);
3366
- C || (m = new c(a, g * d, n.count * d / A), C = new Sn(m, d / A), t.cache.add(x, C)), f = new Ln(C, l, h % d / A, p);
3377
+ C || (p = new c(a, g * d, n.count * d / A), C = new Hn(p, d / A), t.cache.add(x, C)), f = new Ln(C, l, h % d / A, m);
3367
3378
  } else
3368
- a === null ? m = new c(n.count * l) : m = new c(a, h, n.count * l), f = new _e(m, l, p);
3379
+ a === null ? p = new c(n.count * l) : p = new c(a, h, n.count * l), f = new _e(p, l, m);
3369
3380
  if (n.sparse !== void 0) {
3370
- const g = Ht.SCALAR, x = je[n.sparse.indices.componentType], C = n.sparse.indices.byteOffset || 0, y = n.sparse.values.byteOffset || 0, w = new x(o[1], C, n.sparse.count * g), D = new c(o[2], y, n.sparse.count * l);
3381
+ const g = St.SCALAR, x = je[n.sparse.indices.componentType], C = n.sparse.indices.byteOffset || 0, y = n.sparse.values.byteOffset || 0, w = new x(o[1], C, n.sparse.count * g), D = new c(o[2], y, n.sparse.count * l);
3371
3382
  a !== null && (f = new _e(f.array.slice(), f.itemSize, f.normalized)), f.normalized = !1;
3372
- for (let H = 0, Z = w.length; H < Z; H++) {
3373
- const _ = w[H];
3374
- if (f.setX(_, D[H * l]), l >= 2 && f.setY(_, D[H * l + 1]), l >= 3 && f.setZ(_, D[H * l + 2]), l >= 4 && f.setW(_, D[H * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
3383
+ for (let S = 0, Z = w.length; S < Z; S++) {
3384
+ const _ = w[S];
3385
+ if (f.setX(_, D[S * l]), l >= 2 && f.setY(_, D[S * l + 1]), l >= 3 && f.setZ(_, D[S * l + 2]), l >= 4 && f.setW(_, D[S * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
3375
3386
  }
3376
- f.normalized = p;
3387
+ f.normalized = m;
3377
3388
  }
3378
3389
  return f;
3379
3390
  });
@@ -3423,11 +3434,11 @@ class ko {
3423
3434
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
3424
3435
  const A = Promise.resolve(l).then(function(u) {
3425
3436
  return new Promise(function(h, d) {
3426
- let p = h;
3427
- t.isImageBitmapLoader === !0 && (p = function(m) {
3428
- const f = new tn(m);
3437
+ let m = h;
3438
+ t.isImageBitmapLoader === !0 && (m = function(p) {
3439
+ const f = new tn(p);
3429
3440
  f.needsUpdate = !0, h(f);
3430
- }), t.load(Je.resolveURL(u, i.path), p, void 0, d);
3441
+ }), t.load(Je.resolveURL(u, i.path), m, void 0, d);
3431
3442
  });
3432
3443
  }).then(function(u) {
3433
3444
  return c === !0 && a.revokeObjectURL(l), re(u, o), u.userData.mimeType = o.mimeType || No(o.uri), u;
@@ -3521,8 +3532,8 @@ class ko {
3521
3532
  })));
3522
3533
  }
3523
3534
  i.doubleSided === !0 && (a.side = Rn);
3524
- const A = i.alphaMode || St.OPAQUE;
3525
- if (A === St.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, A === St.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Pe && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new Y(1, 1), i.normalTexture.scale !== void 0)) {
3535
+ const A = i.alphaMode || Ht.OPAQUE;
3536
+ if (A === Ht.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, A === Ht.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Pe && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new Y(1, 1), i.normalTexture.scale !== void 0)) {
3526
3537
  const u = i.normalTexture.scale;
3527
3538
  a.normalScale.set(u, u);
3528
3539
  }
@@ -3589,25 +3600,25 @@ class ko {
3589
3600
  }
3590
3601
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
3591
3602
  const c = l.slice(0, l.length - 1), A = l[l.length - 1], u = [];
3592
- for (let d = 0, p = A.length; d < p; d++) {
3593
- const m = A[d], f = o[d];
3603
+ for (let d = 0, m = A.length; d < m; d++) {
3604
+ const p = A[d], f = o[d];
3594
3605
  let g;
3595
3606
  const x = c[d];
3596
3607
  if (f.mode === te.TRIANGLES || f.mode === te.TRIANGLE_STRIP || f.mode === te.TRIANGLE_FAN || f.mode === void 0)
3597
- g = i.isSkinnedMesh === !0 ? new Es(m, x) : new v(m, x), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), f.mode === te.TRIANGLE_STRIP ? g.geometry = wn(g.geometry, Hn) : f.mode === te.TRIANGLE_FAN && (g.geometry = wn(g.geometry, zt));
3608
+ g = i.isSkinnedMesh === !0 ? new Es(p, x) : new v(p, x), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), f.mode === te.TRIANGLE_STRIP ? g.geometry = wn(g.geometry, Sn) : f.mode === te.TRIANGLE_FAN && (g.geometry = wn(g.geometry, zt));
3598
3609
  else if (f.mode === te.LINES)
3599
- g = new Wt(m, x);
3610
+ g = new Wt(p, x);
3600
3611
  else if (f.mode === te.LINE_STRIP)
3601
- g = new ue(m, x);
3612
+ g = new ue(p, x);
3602
3613
  else if (f.mode === te.LINE_LOOP)
3603
- g = new Rs(m, x);
3614
+ g = new Rs(p, x);
3604
3615
  else if (f.mode === te.POINTS)
3605
- g = new pt(m, x);
3616
+ g = new pt(p, x);
3606
3617
  else
3607
3618
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + f.mode);
3608
- Object.keys(g.geometry.morphAttributes).length > 0 && So(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i), f.extensions && xe(n, g, f), t.assignFinalMaterial(g), u.push(g);
3619
+ Object.keys(g.geometry.morphAttributes).length > 0 && Ho(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i), f.extensions && xe(n, g, f), t.assignFinalMaterial(g), u.push(g);
3609
3620
  }
3610
- for (let d = 0, p = u.length; d < p; d++)
3621
+ for (let d = 0, m = u.length; d < m; d++)
3611
3622
  t.associations.set(u[d], {
3612
3623
  meshes: e,
3613
3624
  primitives: d
@@ -3616,7 +3627,7 @@ class ko {
3616
3627
  return i.extensions && xe(n, u[0], i), u[0];
3617
3628
  const h = new ft();
3618
3629
  i.extensions && xe(n, h, i), t.associations.set(h, { meshes: e });
3619
- for (let d = 0, p = u.length; d < p; d++)
3630
+ for (let d = 0, m = u.length; d < m; d++)
3620
3631
  h.add(u[d]);
3621
3632
  return h;
3622
3633
  });
@@ -3635,7 +3646,7 @@ class ko {
3635
3646
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
3636
3647
  return;
3637
3648
  }
3638
- return s.type === "perspective" ? t = new Hs(En.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)), re(t, s), Promise.resolve(t);
3649
+ return s.type === "perspective" ? t = new Ss(En.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new Hs(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), re(t, s), Promise.resolve(t);
3639
3650
  }
3640
3651
  /**
3641
3652
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@@ -3672,8 +3683,8 @@ class ko {
3672
3683
  loadAnimation(e) {
3673
3684
  const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [], A = [];
3674
3685
  for (let u = 0, h = n.channels.length; u < h; u++) {
3675
- const d = n.channels[u], p = n.samplers[d.sampler], m = d.target, f = m.node, g = n.parameters !== void 0 ? n.parameters[p.input] : p.input, x = n.parameters !== void 0 ? n.parameters[p.output] : p.output;
3676
- m.node !== void 0 && (o.push(this.getDependency("node", f)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", x)), c.push(p), A.push(m));
3686
+ const d = n.channels[u], m = n.samplers[d.sampler], p = d.target, f = p.node, g = n.parameters !== void 0 ? n.parameters[m.input] : m.input, x = n.parameters !== void 0 ? n.parameters[m.output] : m.output;
3687
+ p.node !== void 0 && (o.push(this.getDependency("node", f)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", x)), c.push(m), A.push(p));
3677
3688
  }
3678
3689
  return Promise.all([
3679
3690
  Promise.all(o),
@@ -3682,12 +3693,12 @@ class ko {
3682
3693
  Promise.all(c),
3683
3694
  Promise.all(A)
3684
3695
  ]).then(function(u) {
3685
- const h = u[0], d = u[1], p = u[2], m = u[3], f = u[4], g = [];
3696
+ const h = u[0], d = u[1], m = u[2], p = u[3], f = u[4], g = [];
3686
3697
  for (let C = 0, y = h.length; C < y; C++) {
3687
- const w = h[C], D = d[C], H = p[C], Z = m[C], _ = f[C];
3698
+ const w = h[C], D = d[C], S = m[C], Z = p[C], _ = f[C];
3688
3699
  if (w === void 0) continue;
3689
3700
  w.updateMatrix && w.updateMatrix();
3690
- const Q = s._createAnimationTracks(w, D, H, Z, _);
3701
+ const Q = s._createAnimationTracks(w, D, S, Z, _);
3691
3702
  if (Q)
3692
3703
  for (let ye = 0; ye < Q.length; ye++)
3693
3704
  g.push(Q[ye]);
@@ -3728,11 +3739,11 @@ class ko {
3728
3739
  h !== null && A.traverse(function(d) {
3729
3740
  d.isSkinnedMesh && d.bind(h, jo);
3730
3741
  });
3731
- for (let d = 0, p = u.length; d < p; d++)
3742
+ for (let d = 0, m = u.length; d < m; d++)
3732
3743
  A.add(u[d]);
3733
3744
  if (A.userData.pivot !== void 0 && u.length > 0) {
3734
- const d = A.userData.pivot, p = u[0];
3735
- A.pivot = new M().fromArray(d), A.position.x -= d[0], A.position.y -= d[1], A.position.z -= d[2], p.position.set(0, 0, 0), delete A.userData.pivot;
3745
+ const d = A.userData.pivot, m = u[0];
3746
+ A.pivot = new M().fromArray(d), A.position.x -= d[0], A.position.y -= d[1], A.position.z -= d[2], m.position.set(0, 0, 0), delete A.userData.pivot;
3736
3747
  }
3737
3748
  return A;
3738
3749
  });
@@ -3833,14 +3844,14 @@ class ko {
3833
3844
  break;
3834
3845
  }
3835
3846
  const u = n.interpolation !== void 0 ? Eo[n.interpolation] : Wn, h = this._getArrayFromAccessor(s);
3836
- for (let d = 0, p = l.length; d < p; d++) {
3837
- const m = new A(
3847
+ for (let d = 0, m = l.length; d < m; d++) {
3848
+ const p = new A(
3838
3849
  l[d] + "." + fe[i.path],
3839
3850
  t.array,
3840
3851
  h,
3841
3852
  u
3842
3853
  );
3843
- n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(m), o.push(m);
3854
+ n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), o.push(p);
3844
3855
  }
3845
3856
  return o;
3846
3857
  }
@@ -3885,11 +3896,11 @@ function Wo(r, e, t) {
3885
3896
  for (let c = 0, A = i.length; c < A; c++) {
3886
3897
  const u = i[c];
3887
3898
  if (u.POSITION !== void 0) {
3888
- const h = t.json.accessors[u.POSITION], d = h.min, p = h.max;
3889
- if (d !== void 0 && p !== void 0) {
3890
- if (l.setX(Math.max(Math.abs(d[0]), Math.abs(p[0]))), l.setY(Math.max(Math.abs(d[1]), Math.abs(p[1]))), l.setZ(Math.max(Math.abs(d[2]), Math.abs(p[2]))), h.normalized) {
3891
- const m = Vt(je[h.componentType]);
3892
- l.multiplyScalar(m);
3899
+ const h = t.json.accessors[u.POSITION], d = h.min, m = h.max;
3900
+ if (d !== void 0 && m !== void 0) {
3901
+ if (l.setX(Math.max(Math.abs(d[0]), Math.abs(m[0]))), l.setY(Math.max(Math.abs(d[1]), Math.abs(m[1]))), l.setZ(Math.max(Math.abs(d[2]), Math.abs(m[2]))), h.normalized) {
3902
+ const p = Vt(je[h.componentType]);
3903
+ l.multiplyScalar(p);
3893
3904
  }
3894
3905
  a.max(l);
3895
3906
  } else
@@ -3920,7 +3931,7 @@ function Tn(r, e, t) {
3920
3931
  n.push(o);
3921
3932
  }
3922
3933
  return qt.workingColorSpace !== ae && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${qt.workingColorSpace}" not supported.`), re(r, e), Wo(r, e, t), Promise.all(n).then(function() {
3923
- return e.targets !== void 0 ? Ho(r, e.targets, t) : r;
3934
+ return e.targets !== void 0 ? So(r, e.targets, t) : r;
3924
3935
  });
3925
3936
  }
3926
3937
  const Nt = /* @__PURE__ */ new WeakMap();
@@ -4039,7 +4050,7 @@ class zo extends Yt {
4039
4050
  if (o === a)
4040
4051
  c = new _e(i, o);
4041
4052
  else {
4042
- const A = new Sn(i, a);
4053
+ const A = new Hn(i, a);
4043
4054
  c = new Ln(A, o, 0);
4044
4055
  }
4045
4056
  n === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(i instanceof Float32Array)), t.setAttribute(n, c);
@@ -4132,8 +4143,8 @@ function Go() {
4132
4143
  e.then((A) => {
4133
4144
  const u = A.draco, h = new u.Decoder();
4134
4145
  try {
4135
- const d = t(u, h, new Int8Array(l), c), p = d.attributes.map((m) => m.array.buffer);
4136
- d.index && p.push(d.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: d }, p);
4146
+ const d = t(u, h, new Int8Array(l), c), m = d.attributes.map((p) => p.array.buffer);
4147
+ d.index && m.push(d.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: d }, m);
4137
4148
  } catch (d) {
4138
4149
  console.error(d), self.postMessage({ type: "error", id: a.id, error: d.message });
4139
4150
  } finally {
@@ -4146,16 +4157,16 @@ function Go() {
4146
4157
  function t(o, a, l, c) {
4147
4158
  const A = c.attributeIDs, u = c.attributeTypes;
4148
4159
  let h, d;
4149
- const p = a.GetEncodedGeometryType(l);
4150
- if (p === o.TRIANGULAR_MESH)
4160
+ const m = a.GetEncodedGeometryType(l);
4161
+ if (m === o.TRIANGULAR_MESH)
4151
4162
  h = new o.Mesh(), d = a.DecodeArrayToMesh(l, l.byteLength, h);
4152
- else if (p === o.POINT_CLOUD)
4163
+ else if (m === o.POINT_CLOUD)
4153
4164
  h = new o.PointCloud(), d = a.DecodeArrayToPointCloud(l, l.byteLength, h);
4154
4165
  else
4155
4166
  throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
4156
4167
  if (!d.ok() || h.ptr === 0)
4157
4168
  throw new Error("THREE.DRACOLoader: Decoding failed: " + d.error_msg());
4158
- const m = { index: null, attributes: [] };
4169
+ const p = { index: null, attributes: [] };
4159
4170
  for (const f in A) {
4160
4171
  const g = self[u[f]];
4161
4172
  let x, C;
@@ -4166,9 +4177,9 @@ function Go() {
4166
4177
  x = a.GetAttribute(h, C);
4167
4178
  }
4168
4179
  const y = n(o, a, h, f, g, x);
4169
- f === "color" && (y.vertexColorSpace = c.vertexColorSpace), m.attributes.push(y);
4180
+ f === "color" && (y.vertexColorSpace = c.vertexColorSpace), p.attributes.push(y);
4170
4181
  }
4171
- return p === o.TRIANGULAR_MESH && (m.index = s(o, a, h)), o.destroy(h), m;
4182
+ return m === o.TRIANGULAR_MESH && (p.index = s(o, a, h)), o.destroy(h), p;
4172
4183
  }
4173
4184
  function s(o, a, l) {
4174
4185
  const A = l.num_faces() * 3, u = A * 4, h = o._malloc(u);
@@ -4177,19 +4188,19 @@ function Go() {
4177
4188
  return o._free(h), { array: d, itemSize: 1 };
4178
4189
  }
4179
4190
  function n(o, a, l, c, A, u) {
4180
- const h = l.num_points(), d = u.num_components(), p = i(o, A), m = d * A.BYTES_PER_ELEMENT, f = Math.ceil(m / 4) * 4, g = f / A.BYTES_PER_ELEMENT, x = h * m, C = h * f, y = o._malloc(x);
4181
- a.GetAttributeDataArrayForAllPoints(l, u, p, x, y);
4191
+ const h = l.num_points(), d = u.num_components(), m = i(o, A), p = d * A.BYTES_PER_ELEMENT, f = Math.ceil(p / 4) * 4, g = f / A.BYTES_PER_ELEMENT, x = h * p, C = h * f, y = o._malloc(x);
4192
+ a.GetAttributeDataArrayForAllPoints(l, u, m, x, y);
4182
4193
  const w = new A(o.HEAPF32.buffer, y, x / A.BYTES_PER_ELEMENT);
4183
4194
  let D;
4184
- if (m === f)
4195
+ if (p === f)
4185
4196
  D = w.slice();
4186
4197
  else {
4187
4198
  D = new A(C / A.BYTES_PER_ELEMENT);
4188
- let H = 0;
4199
+ let S = 0;
4189
4200
  for (let Z = 0, _ = w.length; Z < _; Z++) {
4190
4201
  for (let Q = 0; Q < d; Q++)
4191
- D[H + Q] = w[Z * d + Q];
4192
- H += g;
4202
+ D[S + Q] = w[Z * d + Q];
4203
+ S += g;
4193
4204
  }
4194
4205
  }
4195
4206
  return o._free(y), {
@@ -4250,7 +4261,7 @@ function Uo(r) {
4250
4261
  speedY: A = 5e-4
4251
4262
  } = r || {}, u = new P.PlaneGeometry(e, t), d = new P.TextureLoader().load(Fo, (f) => {
4252
4263
  f.wrapS = f.wrapT = P.RepeatWrapping, f.repeat.set(a, l), f.generateMipmaps = !1, f.minFilter = P.LinearFilter, f.magFilter = P.LinearFilter;
4253
- }), p = new P.MeshStandardMaterial({
4264
+ }), m = new P.MeshStandardMaterial({
4254
4265
  color: s,
4255
4266
  roughness: n,
4256
4267
  metalness: i,
@@ -4260,8 +4271,8 @@ function Uo(r) {
4260
4271
  // 双面渲染,避免从侧面或底部看到黑色
4261
4272
  transparent: !0,
4262
4273
  opacity: 0.6
4263
- }), m = new P.Mesh(u, p);
4264
- m.rotation.x = -Math.PI / 2, m.position.y = 0, m.name = "水面(标准材质)", m.userData.isWater = !0, m.userData.isMovable = !0, m.userData.waterSpeed = { x: c, y: A }, ze(m);
4274
+ }), p = new P.Mesh(u, m);
4275
+ p.rotation.x = -Math.PI / 2, p.position.y = 0, p.name = "水面(标准材质)", p.userData.isWater = !0, p.userData.isMovable = !0, p.userData.waterSpeed = { x: c, y: A }, ze(p);
4265
4276
  }
4266
4277
  function Vo(r) {
4267
4278
  return Et(!0), new Promise((e, t) => {
@@ -4324,16 +4335,28 @@ function Ko(r) {
4324
4335
  return console.warn("请先选中一个模型,再添加数据面板"), null;
4325
4336
  const t = Zt(e);
4326
4337
  t && (t.dispose(), hi(e));
4327
- const s = [
4338
+ const s = Math.min(window.innerWidth, 7e3), n = 1920, i = 200, o = Math.max(
4339
+ 150,
4340
+ // 最小宽度 150px(小屏设备)
4341
+ Math.round(s / n * i)
4342
+ ), l = Math.max(
4343
+ 12,
4344
+ Math.min(
4345
+ 20,
4346
+ Math.round(o / i * 13)
4347
+ )
4348
+ ), c = [
4328
4349
  { label: "温度", value: "30", unit: "℃" },
4329
4350
  { label: "湿度", value: "65", unit: "%" },
4330
4351
  { label: "压力", value: "101.3", unit: "kPa" },
4331
4352
  { label: "名称", value: e.name || "未命名" }
4332
- ], n = new Gn({
4353
+ ], A = new Gn({
4333
4354
  title: (r == null ? void 0 : r.title) || "数据面板",
4334
- items: (r == null ? void 0 : r.items) || s
4355
+ items: (r == null ? void 0 : r.items) || c,
4356
+ width: `${o}px`,
4357
+ fontSize: `${l}px`
4335
4358
  });
4336
- return n.attachTo(e), Fn(e, n), n;
4359
+ return A.attachTo(e), Fn(e, A), A;
4337
4360
  }
4338
4361
  const Zo = {
4339
4362
  key: 1,
@@ -4350,12 +4373,12 @@ const Zo = {
4350
4373
  },
4351
4374
  emits: ["select", "delete"],
4352
4375
  setup(r, { emit: e }) {
4353
- const t = r, s = e, n = j(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((m) => m.userData.isMovable === !0))), c = Be(() => (t.version, t.node.children.filter(
4354
- (m) => m.userData.isMovable === !0
4376
+ const t = r, s = e, n = j(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((p) => p.userData.isMovable === !0))), c = Be(() => (t.version, t.node.children.filter(
4377
+ (p) => p.userData.isMovable === !0
4355
4378
  ))), A = Be(
4356
4379
  () => {
4357
- var m;
4358
- return ((m = t.selectedObject) == null ? void 0 : m.uuid) === t.node.uuid;
4380
+ var p;
4381
+ return ((p = t.selectedObject) == null ? void 0 : p.uuid) === t.node.uuid;
4359
4382
  }
4360
4383
  );
4361
4384
  ts(
@@ -4369,12 +4392,12 @@ const Zo = {
4369
4392
  },
4370
4393
  { flush: "post" }
4371
4394
  );
4372
- const u = (m) => {
4373
- m.stopPropagation(), s("select", t.node);
4374
- }, h = (m) => {
4375
- m.stopPropagation(), s("delete", t.node);
4376
- }, d = (m) => m.type === "Mesh" || m.type === "Sprite" ? "🟦" : m.type === "Light" ? "💡" : "📦", p = (m) => m.name || `${m.type} (${m.id})`;
4377
- return (m, f) => {
4395
+ const u = (p) => {
4396
+ p.stopPropagation(), s("select", t.node);
4397
+ }, h = (p) => {
4398
+ p.stopPropagation(), s("delete", t.node);
4399
+ }, d = (p) => p.type === "Mesh" || p.type === "Sprite" ? "🟦" : p.type === "Light" ? "💡" : "📦", m = (p) => p.name || `${p.type} (${p.id})`;
4400
+ return (p, f) => {
4378
4401
  const g = ns("TreeItem", !0);
4379
4402
  return T(), R("div", {
4380
4403
  class: "tree-node",
@@ -4391,7 +4414,7 @@ const Zo = {
4391
4414
  onClick: f[0] || (f[0] = jt((x) => ss(o)(r.node.uuid), ["stop"]))
4392
4415
  }, ie(a.value ? "▼" : "▶"), 1)) : (T(), R("span", Zo)),
4393
4416
  b("span", Qo, ie(d(r.node)), 1),
4394
- b("span", Jo, ie(p(r.node)), 1),
4417
+ b("span", Jo, ie(m(r.node)), 1),
4395
4418
  b("button", {
4396
4419
  class: "tree-delete",
4397
4420
  onClick: jt(h, ["stop"])
@@ -4444,9 +4467,9 @@ const Zo = {
4444
4467
  }
4445
4468
  function c(h) {
4446
4469
  let d = null;
4447
- return h.traverse((p) => {
4448
- if (p.type === "Mesh" && !d) {
4449
- const m = p, f = Array.isArray(m.material) ? m.material : [m.material];
4470
+ return h.traverse((m) => {
4471
+ if (m.type === "Mesh" && !d) {
4472
+ const p = m, f = Array.isArray(p.material) ? p.material : [p.material];
4450
4473
  for (const g of f)
4451
4474
  if (g && (g.type === "MeshStandardMaterial" || g.type === "MeshPhongMaterial")) {
4452
4475
  const x = g;
@@ -4461,14 +4484,14 @@ const Zo = {
4461
4484
  }), d;
4462
4485
  }
4463
4486
  function A(h, d) {
4464
- let p = !1;
4465
- return h.traverse((m) => {
4466
- if (m.type === "Mesh") {
4467
- const f = m, g = Array.isArray(f.material) ? f.material : [f.material];
4487
+ let m = !1;
4488
+ return h.traverse((p) => {
4489
+ if (p.type === "Mesh") {
4490
+ const f = p, g = Array.isArray(f.material) ? f.material : [f.material];
4468
4491
  for (const x of g)
4469
- x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (x.metalness = d.metalness), d.roughness !== void 0 && (x.roughness = d.roughness), d.opacity !== void 0 && (x.opacity = d.opacity, x.transparent = d.opacity < 1), x.needsUpdate = !0, p = !0);
4492
+ x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (x.metalness = d.metalness), d.roughness !== void 0 && (x.roughness = d.roughness), d.opacity !== void 0 && (x.opacity = d.opacity, x.transparent = d.opacity < 1), x.needsUpdate = !0, m = !0);
4470
4493
  }
4471
- }), p;
4494
+ }), m;
4472
4495
  }
4473
4496
  function u() {
4474
4497
  if (t.selectedObject) {
@@ -4497,7 +4520,7 @@ const Zo = {
4497
4520
  d[14] || (d[14] = b("span", null, "X:", -1)),
4498
4521
  E(b("input", {
4499
4522
  type: "number",
4500
- "onUpdate:modelValue": d[0] || (d[0] = (p) => r.transform.position.x = p),
4523
+ "onUpdate:modelValue": d[0] || (d[0] = (m) => r.transform.position.x = m),
4501
4524
  step: "0.01",
4502
4525
  onInput: n
4503
4526
  }, null, 544), [
@@ -4511,7 +4534,7 @@ const Zo = {
4511
4534
  d[15] || (d[15] = b("span", null, "Y:", -1)),
4512
4535
  E(b("input", {
4513
4536
  type: "number",
4514
- "onUpdate:modelValue": d[1] || (d[1] = (p) => r.transform.position.y = p),
4537
+ "onUpdate:modelValue": d[1] || (d[1] = (m) => r.transform.position.y = m),
4515
4538
  step: "0.01",
4516
4539
  onInput: n
4517
4540
  }, null, 544), [
@@ -4525,7 +4548,7 @@ const Zo = {
4525
4548
  d[16] || (d[16] = b("span", null, "Z:", -1)),
4526
4549
  E(b("input", {
4527
4550
  type: "number",
4528
- "onUpdate:modelValue": d[2] || (d[2] = (p) => r.transform.position.z = p),
4551
+ "onUpdate:modelValue": d[2] || (d[2] = (m) => r.transform.position.z = m),
4529
4552
  step: "0.01",
4530
4553
  onInput: n
4531
4554
  }, null, 544), [
@@ -4544,7 +4567,7 @@ const Zo = {
4544
4567
  d[18] || (d[18] = b("span", null, "X:", -1)),
4545
4568
  E(b("input", {
4546
4569
  type: "number",
4547
- "onUpdate:modelValue": d[3] || (d[3] = (p) => r.transform.rotation.x = p),
4570
+ "onUpdate:modelValue": d[3] || (d[3] = (m) => r.transform.rotation.x = m),
4548
4571
  step: "0.01",
4549
4572
  onInput: n
4550
4573
  }, null, 544), [
@@ -4558,7 +4581,7 @@ const Zo = {
4558
4581
  d[19] || (d[19] = b("span", null, "Y:", -1)),
4559
4582
  E(b("input", {
4560
4583
  type: "number",
4561
- "onUpdate:modelValue": d[4] || (d[4] = (p) => r.transform.rotation.y = p),
4584
+ "onUpdate:modelValue": d[4] || (d[4] = (m) => r.transform.rotation.y = m),
4562
4585
  step: "0.01",
4563
4586
  onInput: n
4564
4587
  }, null, 544), [
@@ -4572,7 +4595,7 @@ const Zo = {
4572
4595
  d[20] || (d[20] = b("span", null, "Z:", -1)),
4573
4596
  E(b("input", {
4574
4597
  type: "number",
4575
- "onUpdate:modelValue": d[5] || (d[5] = (p) => r.transform.rotation.z = p),
4598
+ "onUpdate:modelValue": d[5] || (d[5] = (m) => r.transform.rotation.z = m),
4576
4599
  step: "0.01",
4577
4600
  onInput: n
4578
4601
  }, null, 544), [
@@ -4591,7 +4614,7 @@ const Zo = {
4591
4614
  d[22] || (d[22] = b("span", null, "X:", -1)),
4592
4615
  E(b("input", {
4593
4616
  type: "number",
4594
- "onUpdate:modelValue": d[6] || (d[6] = (p) => r.transform.scale.x = p),
4617
+ "onUpdate:modelValue": d[6] || (d[6] = (m) => r.transform.scale.x = m),
4595
4618
  step: "0.01",
4596
4619
  onInput: n
4597
4620
  }, null, 544), [
@@ -4605,7 +4628,7 @@ const Zo = {
4605
4628
  d[23] || (d[23] = b("span", null, "Y:", -1)),
4606
4629
  E(b("input", {
4607
4630
  type: "number",
4608
- "onUpdate:modelValue": d[7] || (d[7] = (p) => r.transform.scale.y = p),
4631
+ "onUpdate:modelValue": d[7] || (d[7] = (m) => r.transform.scale.y = m),
4609
4632
  step: "0.01",
4610
4633
  onInput: n
4611
4634
  }, null, 544), [
@@ -4619,7 +4642,7 @@ const Zo = {
4619
4642
  d[24] || (d[24] = b("span", null, "Z:", -1)),
4620
4643
  E(b("input", {
4621
4644
  type: "number",
4622
- "onUpdate:modelValue": d[8] || (d[8] = (p) => r.transform.scale.z = p),
4645
+ "onUpdate:modelValue": d[8] || (d[8] = (m) => r.transform.scale.z = m),
4623
4646
  step: "0.01",
4624
4647
  onInput: n
4625
4648
  }, null, 544), [
@@ -4641,7 +4664,7 @@ const Zo = {
4641
4664
  min: "0",
4642
4665
  max: "10",
4643
4666
  step: "0.1",
4644
- "onUpdate:modelValue": d[9] || (d[9] = (p) => a.intensity = p),
4667
+ "onUpdate:modelValue": d[9] || (d[9] = (m) => a.intensity = m),
4645
4668
  onInput: l
4646
4669
  }, null, 544), [
4647
4670
  [
@@ -4656,7 +4679,7 @@ const Zo = {
4656
4679
  min: "0",
4657
4680
  max: "100",
4658
4681
  step: "0.1",
4659
- "onUpdate:modelValue": d[10] || (d[10] = (p) => a.intensity = p),
4682
+ "onUpdate:modelValue": d[10] || (d[10] = (m) => a.intensity = m),
4660
4683
  class: "intensity-input",
4661
4684
  onInput: l
4662
4685
  }, null, 544), [
@@ -4678,7 +4701,7 @@ const Zo = {
4678
4701
  min: "0",
4679
4702
  max: "1",
4680
4703
  step: "0.01",
4681
- "onUpdate:modelValue": d[11] || (d[11] = (p) => i.metalness = p),
4704
+ "onUpdate:modelValue": d[11] || (d[11] = (m) => i.metalness = m),
4682
4705
  onInput: u
4683
4706
  }, null, 544), [
4684
4707
  [
@@ -4697,7 +4720,7 @@ const Zo = {
4697
4720
  min: "0",
4698
4721
  max: "1",
4699
4722
  step: "0.01",
4700
- "onUpdate:modelValue": d[12] || (d[12] = (p) => i.roughness = p),
4723
+ "onUpdate:modelValue": d[12] || (d[12] = (m) => i.roughness = m),
4701
4724
  onInput: u
4702
4725
  }, null, 544), [
4703
4726
  [
@@ -4716,7 +4739,7 @@ const Zo = {
4716
4739
  min: "0",
4717
4740
  max: "1",
4718
4741
  step: "0.01",
4719
- "onUpdate:modelValue": d[13] || (d[13] = (p) => i.opacity = p),
4742
+ "onUpdate:modelValue": d[13] || (d[13] = (m) => i.opacity = m),
4720
4743
  onInput: u
4721
4744
  }, null, 544), [
4722
4745
  [
@@ -4742,10 +4765,10 @@ const Zo = {
4742
4765
  }, Dr = { class: "ud-value-json-preview" }, Pr = ["onClick"], Tr = {
4743
4766
  key: 0,
4744
4767
  class: "ud-json-error"
4745
- }, Or = { class: "ud-json-actions" }, Er = ["onClick"], Rr = ["onClick"], Hr = {
4768
+ }, Or = { class: "ud-json-actions" }, Er = ["onClick"], Rr = ["onClick"], Sr = {
4746
4769
  key: 1,
4747
4770
  class: "userdata-empty"
4748
- }, Sr = /* @__PURE__ */ be({
4771
+ }, Hr = /* @__PURE__ */ be({
4749
4772
  __name: "UserDataTab",
4750
4773
  props: {
4751
4774
  selectedObject: {}
@@ -4802,7 +4825,7 @@ const Zo = {
4802
4825
  function d(C) {
4803
4826
  return C.length <= 28 ? C : C.substring(0, 28) + "…";
4804
4827
  }
4805
- function p(C) {
4828
+ function m(C) {
4806
4829
  n.value = C;
4807
4830
  const y = e.selectedObject;
4808
4831
  if (!y) return;
@@ -4812,9 +4835,9 @@ const Zo = {
4812
4835
  } catch {
4813
4836
  i.value = String(w);
4814
4837
  }
4815
- m();
4838
+ p();
4816
4839
  }
4817
- function m() {
4840
+ function p() {
4818
4841
  const C = i.value.trim();
4819
4842
  if (!C) {
4820
4843
  o.value = null;
@@ -4869,7 +4892,7 @@ const Zo = {
4869
4892
  "onUpdate:modelValue": y[0] || (y[0] = (w) => t.value = w),
4870
4893
  placeholder: "属性名",
4871
4894
  class: "ud-input",
4872
- onKeyup: Se(u, ["enter"])
4895
+ onKeyup: He(u, ["enter"])
4873
4896
  }, null, 544), [
4874
4897
  [N, t.value]
4875
4898
  ]),
@@ -4877,7 +4900,7 @@ const Zo = {
4877
4900
  "onUpdate:modelValue": y[1] || (y[1] = (w) => s.value = w),
4878
4901
  placeholder: "值",
4879
4902
  class: "ud-input ud-textarea",
4880
- onKeyup: Se(jt(u, ["prevent"]), ["enter"])
4903
+ onKeyup: He(jt(u, ["prevent"]), ["enter"])
4881
4904
  }, null, 40, xr), [
4882
4905
  [N, s.value]
4883
4906
  ]),
@@ -4902,15 +4925,15 @@ const Zo = {
4902
4925
  b("button", {
4903
4926
  class: "ud-btn edit-json-btn",
4904
4927
  title: "编辑对象",
4905
- onClick: (H) => p(w.key)
4928
+ onClick: (S) => m(w.key)
4906
4929
  }, " ✎ ", 8, Pr)
4907
4930
  ], 64)) : (T(), R(ve, { key: 1 }, [
4908
4931
  o.value ? (T(), R("div", Tr, " ⚠ " + ie(o.value), 1)) : X("", !0),
4909
4932
  E(b("textarea", {
4910
- "onUpdate:modelValue": y[2] || (y[2] = (H) => i.value = H),
4933
+ "onUpdate:modelValue": y[2] || (y[2] = (S) => i.value = S),
4911
4934
  class: se(["ud-json-textarea", { "has-error": o.value }]),
4912
4935
  rows: "3",
4913
- onInput: m
4936
+ onInput: p
4914
4937
  }, null, 34), [
4915
4938
  [N, i.value]
4916
4939
  ]),
@@ -4918,7 +4941,7 @@ const Zo = {
4918
4941
  b("button", {
4919
4942
  class: "ud-btn apply-btn",
4920
4943
  title: "应用修改",
4921
- onClick: (H) => f(w.key)
4944
+ onClick: (S) => f(w.key)
4922
4945
  }, " ✓ ", 8, Er),
4923
4946
  b("button", {
4924
4947
  class: "ud-btn cancel-btn",
@@ -4931,11 +4954,11 @@ const Zo = {
4931
4954
  key: 2,
4932
4955
  class: "ud-btn del-btn",
4933
4956
  title: "删除",
4934
- onClick: (H) => h(w.key)
4957
+ onClick: (S) => h(w.key)
4935
4958
  }, " ✕ ", 8, Rr)) : X("", !0)
4936
4959
  ], 64)) : X("", !0)
4937
4960
  ], 2))), 128))
4938
- ])) : (T(), R("div", Hr, "暂无自定义数据")),
4961
+ ])) : (T(), R("div", Sr, "暂无自定义数据")),
4939
4962
  b("button", {
4940
4963
  class: "get-camera-btn",
4941
4964
  onClick: x
@@ -4943,7 +4966,7 @@ const Zo = {
4943
4966
  ])
4944
4967
  ]));
4945
4968
  }
4946
- }), Lr = /* @__PURE__ */ Ie(Sr, [["__scopeId", "data-v-4e117415"]]), Nr = { class: "datapanel-tab" }, jr = { class: "property-group" }, kr = { class: "dp-section" }, Wr = { class: "dp-visibility-row" }, zr = { class: "dp-toggle" }, Gr = { class: "dp-visibility-text" }, Fr = { class: "dp-section" }, qr = { class: "dp-section" }, Xr = { class: "dp-list" }, Br = ["onUpdate:modelValue"], Ur = ["onUpdate:modelValue"], Vr = ["onUpdate:modelValue"], Yr = ["onUpdate:modelValue"], Kr = ["onClick"], Zr = { class: "dp-add-row" }, Qr = /* @__PURE__ */ be({
4969
+ }), Lr = /* @__PURE__ */ Ie(Hr, [["__scopeId", "data-v-4e117415"]]), Nr = { class: "datapanel-tab" }, jr = { class: "property-group" }, kr = { class: "dp-section" }, Wr = { class: "dp-visibility-row" }, zr = { class: "dp-toggle" }, Gr = { class: "dp-visibility-text" }, Fr = { class: "dp-section" }, qr = { class: "dp-section" }, Xr = { class: "dp-list" }, Br = ["onUpdate:modelValue"], Ur = ["onUpdate:modelValue"], Vr = ["onUpdate:modelValue"], Yr = ["onUpdate:modelValue"], Kr = ["onClick"], Zr = { class: "dp-add-row" }, Qr = /* @__PURE__ */ be({
4947
4970
  __name: "DataPanelTab",
4948
4971
  props: {
4949
4972
  selectedObject: {}
@@ -4952,20 +4975,20 @@ const Zo = {
4952
4975
  const e = r, t = j(""), s = j([]), n = j(!0), i = j(""), o = j(""), a = j(""), l = j("");
4953
4976
  let c = u(), A = !1;
4954
4977
  function u() {
4955
- const m = e.selectedObject;
4956
- return m ? Zt(xt(m)) : null;
4978
+ const p = e.selectedObject;
4979
+ return p ? Zt(xt(p)) : null;
4957
4980
  }
4958
- Me(n, (m) => {
4959
- A || !c || (c.visible = m);
4981
+ Me(n, (p) => {
4982
+ A || !c || (c.visible = p);
4960
4983
  });
4961
4984
  function h() {
4962
4985
  A || !c || (c.setTitle(t.value), c.setItems([...s.value]));
4963
4986
  }
4964
4987
  Me(t, () => h()), Me(s, () => h(), { deep: !0 });
4965
- function d(m) {
4966
- s.value = s.value.filter((f, g) => g !== m), h();
4988
+ function d(p) {
4989
+ s.value = s.value.filter((f, g) => g !== p), h();
4967
4990
  }
4968
- function p() {
4991
+ function m() {
4969
4992
  !i.value.trim() || !o.value.trim() || (s.value = [
4970
4993
  ...s.value,
4971
4994
  {
@@ -4984,7 +5007,7 @@ const Zo = {
4984
5007
  }, 0);
4985
5008
  },
4986
5009
  { immediate: !0 }
4987
- ), (m, f) => (T(), R("div", Nr, [
5010
+ ), (p, f) => (T(), R("div", Nr, [
4988
5011
  b("div", jr, [
4989
5012
  f[10] || (f[10] = b("label", null, "📊 数据面板", -1)),
4990
5013
  b("div", kr, [
@@ -5065,7 +5088,7 @@ const Zo = {
5065
5088
  class: "dp-input dp-input-sm",
5066
5089
  "onUpdate:modelValue": f[2] || (f[2] = (g) => i.value = g),
5067
5090
  placeholder: "标签",
5068
- onKeyup: Se(p, ["enter"])
5091
+ onKeyup: He(m, ["enter"])
5069
5092
  }, null, 544), [
5070
5093
  [N, i.value]
5071
5094
  ]),
@@ -5074,7 +5097,7 @@ const Zo = {
5074
5097
  class: "dp-input dp-input-sm",
5075
5098
  "onUpdate:modelValue": f[3] || (f[3] = (g) => o.value = g),
5076
5099
  placeholder: "值",
5077
- onKeyup: Se(p, ["enter"])
5100
+ onKeyup: He(m, ["enter"])
5078
5101
  }, null, 544), [
5079
5102
  [N, o.value]
5080
5103
  ]),
@@ -5083,7 +5106,7 @@ const Zo = {
5083
5106
  class: "dp-input dp-input-xs",
5084
5107
  "onUpdate:modelValue": f[4] || (f[4] = (g) => a.value = g),
5085
5108
  placeholder: "单位",
5086
- onKeyup: Se(p, ["enter"])
5109
+ onKeyup: He(m, ["enter"])
5087
5110
  }, null, 544), [
5088
5111
  [N, a.value]
5089
5112
  ]),
@@ -5092,13 +5115,13 @@ const Zo = {
5092
5115
  class: "dp-input dp-input-xs",
5093
5116
  "onUpdate:modelValue": f[5] || (f[5] = (g) => l.value = g),
5094
5117
  placeholder: "编码",
5095
- onKeyup: Se(p, ["enter"])
5118
+ onKeyup: He(m, ["enter"])
5096
5119
  }, null, 544), [
5097
5120
  [N, l.value]
5098
5121
  ]),
5099
5122
  b("button", {
5100
5123
  class: "dp-btn dp-btn-add",
5101
- onClick: p,
5124
+ onClick: m,
5102
5125
  title: "添加"
5103
5126
  }, "+")
5104
5127
  ])
@@ -5152,65 +5175,65 @@ const $r = {
5152
5175
  emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
5153
5176
  setup(r, { emit: e }) {
5154
5177
  const t = r, s = e, n = j("translate");
5155
- function i(p) {
5156
- n.value = p, s("transformModeChange", p);
5178
+ function i(m) {
5179
+ n.value = m, s("transformModeChange", m);
5157
5180
  }
5158
5181
  const o = () => s("propertyChange"), a = j("transform"), l = Be(() => {
5159
- var p;
5160
- return !!(t.selectedObject && ((p = t.selectedObject.userData) != null && p._hasDataPanel));
5182
+ var m;
5183
+ return !!(t.selectedObject && ((m = t.selectedObject.userData) != null && m._hasDataPanel));
5161
5184
  }), c = j(0), A = os(t, "selectedObject"), { expandedSet: u, toggleExpand: h } = _r(A);
5162
5185
  rs("treeExpand", { expandedSet: u, toggleExpand: h });
5163
- const d = (p) => {
5164
- c.value++, s("treeDelete", p);
5186
+ const d = (m) => {
5187
+ c.value++, s("treeDelete", m);
5165
5188
  };
5166
- return (p, m) => r.transform ? (T(), R("div", $r, [
5189
+ return (m, p) => r.transform ? (T(), R("div", $r, [
5167
5190
  b("div", ea, [
5168
- m[7] || (m[7] = b("label", null, "场景物体", -1)),
5191
+ p[7] || (p[7] = b("label", null, "场景物体", -1)),
5169
5192
  b("div", ta, [
5170
5193
  (T(!0), R(ve, null, wt(r.treeData, (f) => (T(), Ke(er, {
5171
5194
  key: f.uuid,
5172
5195
  node: f,
5173
5196
  "selected-object": r.selectedObject,
5174
5197
  version: c.value,
5175
- onSelect: m[0] || (m[0] = (g) => s("treeSelect", g)),
5198
+ onSelect: p[0] || (p[0] = (g) => s("treeSelect", g)),
5176
5199
  onDelete: d
5177
5200
  }, null, 8, ["node", "selected-object", "version"]))), 128)),
5178
5201
  r.treeData.length === 0 ? (T(), R("div", na, "暂无物体")) : X("", !0)
5179
5202
  ])
5180
5203
  ]),
5181
5204
  b("div", sa, [
5182
- m[8] || (m[8] = b("label", null, "全局属性", -1)),
5205
+ p[8] || (p[8] = b("label", null, "全局属性", -1)),
5183
5206
  b("div", ia, [
5184
5207
  b("button", {
5185
5208
  class: se(["mode-btn", { active: n.value === "translate" }]),
5186
5209
  title: "移动 (W)",
5187
- onClick: m[1] || (m[1] = (f) => i("translate"))
5210
+ onClick: p[1] || (p[1] = (f) => i("translate"))
5188
5211
  }, " ↕ 移动 ", 2),
5189
5212
  b("button", {
5190
5213
  class: se(["mode-btn", { active: n.value === "rotate" }]),
5191
5214
  title: "旋转 (E)",
5192
- onClick: m[2] || (m[2] = (f) => i("rotate"))
5215
+ onClick: p[2] || (p[2] = (f) => i("rotate"))
5193
5216
  }, " ↻ 旋转 ", 2),
5194
5217
  b("button", {
5195
5218
  class: se(["mode-btn", { active: n.value === "scale" }]),
5196
5219
  title: "缩放 (R)",
5197
- onClick: m[3] || (m[3] = (f) => i("scale"))
5220
+ onClick: p[3] || (p[3] = (f) => i("scale"))
5198
5221
  }, " ⤡ 缩放 ", 2)
5199
5222
  ])
5200
5223
  ]),
5201
5224
  r.selectedObject ? (T(), R("div", oa, [
5202
5225
  b("button", {
5203
5226
  class: se(["tab-btn", { active: a.value === "transform" }]),
5204
- onClick: m[4] || (m[4] = (f) => a.value = "transform")
5227
+ onClick: p[4] || (p[4] = (f) => a.value = "transform")
5205
5228
  }, " 🔄 变换 ", 2),
5206
5229
  b("button", {
5207
5230
  class: se(["tab-btn", { active: a.value === "userdata" }]),
5208
- onClick: m[5] || (m[5] = (f) => a.value = "userdata")
5231
+ onClick: p[5] || (p[5] = (f) => a.value = "userdata")
5209
5232
  }, " 📋 自定义数据 ", 2),
5210
5233
  l.value ? (T(), R("button", {
5211
5234
  key: 0,
5212
5235
  class: se(["tab-btn", { active: a.value === "datapanel" }]),
5213
- onClick: m[6] || (m[6] = (f) => a.value = "datapanel")
5236
+ onClick: p[6] || (p[6] = (f) => a.value = "datapanel")
5214
5237
  }, " 📊 数据面板 ", 2)) : X("", !0)
5215
5238
  ])) : X("", !0),
5216
5239
  r.selectedObject ? (T(), R("div", ra, [
@@ -5228,7 +5251,7 @@ const $r = {
5228
5251
  [De, a.value === "datapanel"]
5229
5252
  ])
5230
5253
  ])) : X("", !0)
5231
- ])) : (T(), R("div", aa, [...m[9] || (m[9] = [
5254
+ ])) : (T(), R("div", aa, [...p[9] || (p[9] = [
5232
5255
  b("p", null, "未选中任何模型", -1)
5233
5256
  ])]));
5234
5257
  }
@@ -5237,19 +5260,19 @@ const $r = {
5237
5260
  emits: ["addModel", "importModel"],
5238
5261
  setup(r, { emit: e }) {
5239
5262
  const t = j(!1), s = j(!1), n = j(!1), i = j(!1), o = e, a = j(null), l = () => {
5240
- var m;
5241
- return (m = a.value) == null ? void 0 : m.click();
5242
- }, c = (m) => {
5243
- const f = m.target;
5263
+ var p;
5264
+ return (p = a.value) == null ? void 0 : p.click();
5265
+ }, c = (p) => {
5266
+ const f = p.target;
5244
5267
  f.files && f.files.length > 0 && (o("importModel", f.files[0]), f.value = "");
5245
5268
  }, A = () => console.log("撤销"), u = () => console.log("删除物体"), h = async () => {
5246
- const m = Ki();
5247
- console.log(JSON.parse(await m));
5269
+ const p = Ki();
5270
+ console.log(JSON.parse(await p));
5248
5271
  }, d = () => {
5249
5272
  if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
5250
5273
  Ei(localStorage.getItem("test_id"));
5251
- }, p = () => qn();
5252
- return (m, f) => (T(), R("div", ua, [
5274
+ }, m = () => qn();
5275
+ return (p, f) => (T(), R("div", ua, [
5253
5276
  b("div", Aa, [
5254
5277
  b("div", {
5255
5278
  class: "dropdown-wrapper",
@@ -5333,7 +5356,7 @@ const $r = {
5333
5356
  }, "镜头拉近"),
5334
5357
  b("div", {
5335
5358
  class: "menu-item",
5336
- onClick: p
5359
+ onClick: m
5337
5360
  }, " 重置相机位置 ")
5338
5361
  ], 512), [
5339
5362
  [De, t.value]
@@ -5419,13 +5442,13 @@ const $r = {
5419
5442
  const u = () => {
5420
5443
  const g = Ui();
5421
5444
  g && (A.value = g);
5422
- }, h = (g) => Qt(g), d = (g) => Wi(g.uuid), p = (g) => {
5445
+ }, h = (g) => Qt(g), d = (g) => Wi(g.uuid), m = (g) => {
5423
5446
  Oi(g);
5424
- }, m = j(null), f = () => {
5425
- m.value && Ii(m.value, e.mode, e.sceneData), u();
5447
+ }, p = j(null), f = () => {
5448
+ p.value && Ii(p.value, e.mode, e.sceneData), u();
5426
5449
  };
5427
5450
  return as(() => {
5428
- f(), m.value && fi(m.value);
5451
+ f(), p.value && fi(p.value);
5429
5452
  }), ls(() => {
5430
5453
  console.log("endset_three_editor destroy"), Qi();
5431
5454
  }), (g, x) => (T(), R("div", Ca, [
@@ -5444,7 +5467,7 @@ const $r = {
5444
5467
  b("div", {
5445
5468
  class: se(`canvas canvas-mode-${r.mode}`),
5446
5469
  ref_key: "containerRef",
5447
- ref: m
5470
+ ref: p
5448
5471
  }, null, 2),
5449
5472
  r.mode === "edit" ? (T(), Ke(ca, {
5450
5473
  key: 0,
@@ -5454,17 +5477,17 @@ const $r = {
5454
5477
  onPropertyChange: a,
5455
5478
  onTreeSelect: h,
5456
5479
  onTreeDelete: d,
5457
- onTransformModeChange: p
5480
+ onTransformModeChange: m
5458
5481
  }, null, 8, ["transform", "tree-data", "selected-object"])) : X("", !0)
5459
5482
  ], 2),
5460
5483
  r.mode === "edit" ? (T(), Ke(ya, { key: 2 })) : X("", !0)
5461
5484
  ]));
5462
5485
  }
5463
- }), Ha = /* @__PURE__ */ Ie(wa, [["__scopeId", "data-v-ffa5f5c1"]]);
5486
+ }), Sa = /* @__PURE__ */ Ie(wa, [["__scopeId", "data-v-ffa5f5c1"]]);
5464
5487
  export {
5465
5488
  ya as BottomBar,
5466
5489
  Gn as DataPanel,
5467
- Ha as DrawingBoard,
5490
+ Sa as DrawingBoard,
5468
5491
  ca as PropertyPanel,
5469
5492
  ga as TopBar,
5470
5493
  er as TreeItem,
@@ -5479,7 +5502,7 @@ export {
5479
5502
  Qi as destroyEditor,
5480
5503
  gi as disposeCSS2DRenderer,
5481
5504
  Ki as exportSceneToJSON,
5482
- Si as focusOnObject,
5505
+ Hi as focusOnObject,
5483
5506
  Ta as getCSS2DRenderer,
5484
5507
  Yi as getCamera,
5485
5508
  Zt as getDataPanel,