@gui-chat-plugin/present3d 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue.js CHANGED
@@ -1,9 +1,7 @@
1
- import { c as N, d as Z, s as ft, p as bt } from "./toThreeJS-EXFMlO7B.js";
2
- import { a as he, e as le } from "./toThreeJS-EXFMlO7B.js";
3
- import { defineComponent as tt, ref as R, computed as et, onMounted as it, nextTick as q, onUnmounted as st, watch as O, createElementBlock as K, openBlock as H, createElementVNode as _, createCommentVNode as gt, toDisplayString as k, createTextVNode as j, withDirectives as yt, vModelText as wt } from "vue";
4
- import * as g from "three";
5
- import { Controls as Pt, Vector3 as E, MOUSE as C, TOUCH as x, Quaternion as B, Spherical as Q, Vector2 as P, Ray as Et, Plane as St, MathUtils as Dt } from "three";
6
- const $ = { type: "change" }, F = { type: "start" }, ot = { type: "end" }, z = new Et(), J = new St(), Tt = Math.cos(70 * Dt.DEG2RAD), d = new E(), f = 2 * Math.PI, l = {
1
+ import { C as yt, V as w, M as x, T as O, Q as X, S as G, a as y, R as wt, P as Pt, b as Et, c as $, d as J, e as tt, W as et, A as it, D as st, G as Dt, p as z, f as Y, s as St, g as Tt } from "./index-B8W7aPbA.js";
2
+ import { h as pe, i as de } from "./index-B8W7aPbA.js";
3
+ import { defineComponent as ot, ref as M, computed as at, onMounted as nt, nextTick as q, onUnmounted as rt, watch as R, createElementBlock as Z, openBlock as K, createElementVNode as _, createCommentVNode as vt, toDisplayString as C, createTextVNode as k, withDirectives as Mt, vModelText as Rt } from "vue";
4
+ const B = { type: "change" }, F = { type: "start" }, ht = { type: "end" }, j = new wt(), Q = new Pt(), Ot = Math.cos(70 * Et.DEG2RAD), d = new w(), f = 2 * Math.PI, h = {
7
5
  NONE: -1,
8
6
  ROTATE: 0,
9
7
  DOLLY: 1,
@@ -12,75 +10,112 @@ const $ = { type: "change" }, F = { type: "start" }, ot = { type: "end" }, z = n
12
10
  TOUCH_PAN: 4,
13
11
  TOUCH_DOLLY_PAN: 5,
14
12
  TOUCH_DOLLY_ROTATE: 6
15
- }, Y = 1e-6;
16
- class vt extends Pt {
13
+ }, U = 1e-6;
14
+ class xt extends yt {
15
+ /**
16
+ * Constructs a new controls instance.
17
+ *
18
+ * @param {Object3D} object - The object that is managed by the controls.
19
+ * @param {?HTMLElement} domElement - The HTML element used for event listeners.
20
+ */
17
21
  constructor(t, e = null) {
18
- super(t, e), this.state = l.NONE, this.enabled = !0, this.target = new E(), this.cursor = new E(), 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: C.ROTATE, MIDDLE: C.DOLLY, RIGHT: C.PAN }, this.touches = { ONE: x.ROTATE, TWO: x.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new E(), this._lastQuaternion = new B(), this._lastTargetPosition = new E(), this._quat = new B().setFromUnitVectors(t.up, new E(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Q(), this._sphericalDelta = new Q(), this._scale = 1, this._panOffset = new E(), this._rotateStart = new P(), this._rotateEnd = new P(), this._rotateDelta = new P(), this._panStart = new P(), this._panEnd = new P(), this._panDelta = new P(), this._dollyStart = new P(), this._dollyEnd = new P(), this._dollyDelta = new P(), this._dollyDirection = new E(), this._mouse = new P(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Rt.bind(this), this._onPointerDown = Mt.bind(this), this._onPointerUp = Ot.bind(this), this._onContextMenu = zt.bind(this), this._onMouseWheel = Lt.bind(this), this._onKeyDown = At.bind(this), this._onTouchStart = kt.bind(this), this._onTouchMove = jt.bind(this), this._onMouseDown = xt.bind(this), this._onMouseMove = Ct.bind(this), this._interceptControlDown = Nt.bind(this), this._interceptControlUp = It.bind(this), this.domElement !== null && this.connect(), this.update();
22
+ super(t, e), this.state = h.NONE, this.target = new w(), this.cursor = new w(), 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: x.ROTATE, MIDDLE: x.DOLLY, RIGHT: x.PAN }, this.touches = { ONE: O.ROTATE, TWO: O.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new w(), this._lastQuaternion = new X(), this._lastTargetPosition = new w(), this._quat = new X().setFromUnitVectors(t.up, new w(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new G(), this._sphericalDelta = new G(), this._scale = 1, this._panOffset = new w(), 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 w(), this._mouse = new y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Lt.bind(this), this._onPointerDown = Ct.bind(this), this._onPointerUp = At.bind(this), this._onContextMenu = Yt.bind(this), this._onMouseWheel = zt.bind(this), this._onKeyDown = Nt.bind(this), this._onTouchStart = It.bind(this), this._onTouchMove = Ut.bind(this), this._onMouseDown = kt.bind(this), this._onMouseMove = jt.bind(this), this._interceptControlDown = Zt.bind(this), this._interceptControlUp = Kt.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
19
23
  }
20
- connect() {
21
- this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
24
+ connect(t) {
25
+ super.connect(t), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
22
26
  }
23
27
  disconnect() {
24
- this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
28
+ this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
25
29
  }
26
30
  dispose() {
27
31
  this.disconnect();
28
32
  }
33
+ /**
34
+ * Get the current vertical rotation, in radians.
35
+ *
36
+ * @return {number} The current vertical rotation, in radians.
37
+ */
29
38
  getPolarAngle() {
30
39
  return this._spherical.phi;
31
40
  }
41
+ /**
42
+ * Get the current horizontal rotation, in radians.
43
+ *
44
+ * @return {number} The current horizontal rotation, in radians.
45
+ */
32
46
  getAzimuthalAngle() {
33
47
  return this._spherical.theta;
34
48
  }
49
+ /**
50
+ * Returns the distance from the camera to the target.
51
+ *
52
+ * @return {number} The distance from the camera to the target.
53
+ */
35
54
  getDistance() {
36
55
  return this.object.position.distanceTo(this.target);
37
56
  }
57
+ /**
58
+ * Adds key event listeners to the given DOM element.
59
+ * `window` is a recommended argument for using this method.
60
+ *
61
+ * @param {HTMLElement} domElement - The DOM element
62
+ */
38
63
  listenToKeyEvents(t) {
39
64
  t.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = t;
40
65
  }
66
+ /**
67
+ * Removes the key event listener previously defined with `listenToKeyEvents()`.
68
+ */
41
69
  stopListenToKeyEvents() {
42
70
  this._domElementKeyEvents !== null && (this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = null);
43
71
  }
72
+ /**
73
+ * Save the current state of the controls. This can later be recovered with `reset()`.
74
+ */
44
75
  saveState() {
45
76
  this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
46
77
  }
78
+ /**
79
+ * Reset the controls to their state from either the last time the `saveState()`
80
+ * was called, or the initial state.
81
+ */
47
82
  reset() {
48
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent($), this.update(), this.state = l.NONE;
83
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(B), this.update(), this.state = h.NONE;
49
84
  }
50
85
  update(t = null) {
51
86
  const e = this.object.position;
52
- d.copy(e).sub(this.target), d.applyQuaternion(this._quat), this._spherical.setFromVector3(d), this.autoRotate && this.state === l.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), 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);
87
+ d.copy(e).sub(this.target), d.applyQuaternion(this._quat), this._spherical.setFromVector3(d), this.autoRotate && this.state === h.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), 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);
53
88
  let s = this.minAzimuthAngle, o = this.maxAzimuthAngle;
54
89
  isFinite(s) && isFinite(o) && (s < -Math.PI ? s += f : s > Math.PI && (s -= f), o < -Math.PI ? o += f : o > Math.PI && (o -= f), s <= o ? this._spherical.theta = Math.max(s, Math.min(o, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + o) / 2 ? Math.max(s, this._spherical.theta) : Math.min(o, 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);
55
90
  let n = !1;
56
91
  if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
57
92
  this._spherical.radius = this._clampDistance(this._spherical.radius);
58
93
  else {
59
- const c = this._spherical.radius;
60
- this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n = c != this._spherical.radius;
94
+ const l = this._spherical.radius;
95
+ this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n = l != this._spherical.radius;
61
96
  }
62
97
  if (d.setFromSpherical(this._spherical), d.applyQuaternion(this._quatInverse), e.copy(this.target).add(d), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
63
- let c = null;
98
+ let l = null;
64
99
  if (this.object.isPerspectiveCamera) {
65
100
  const p = d.length();
66
- c = this._clampDistance(p * this._scale);
67
- const u = p - c;
101
+ l = this._clampDistance(p * this._scale);
102
+ const u = p - l;
68
103
  this.object.position.addScaledVector(this._dollyDirection, u), this.object.updateMatrixWorld(), n = !!u;
69
104
  } else if (this.object.isOrthographicCamera) {
70
- const p = new E(this._mouse.x, this._mouse.y, 0);
105
+ const p = new w(this._mouse.x, this._mouse.y, 0);
71
106
  p.unproject(this.object);
72
107
  const u = this.object.zoom;
73
108
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), n = u !== this.object.zoom;
74
- const v = new E(this._mouse.x, this._mouse.y, 0);
75
- v.unproject(this.object), this.object.position.sub(v).add(p), this.object.updateMatrixWorld(), c = d.length();
109
+ const S = new w(this._mouse.x, this._mouse.y, 0);
110
+ S.unproject(this.object), this.object.position.sub(S).add(p), this.object.updateMatrixWorld(), l = d.length();
76
111
  } else
77
112
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
78
- c !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(c).add(this.object.position) : (z.origin.copy(this.object.position), z.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(z.direction)) < Tt ? this.object.lookAt(this.target) : (J.setFromNormalAndCoplanarPoint(this.object.up, this.target), z.intersectPlane(J, this.target))));
113
+ l !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(l).add(this.object.position) : (j.origin.copy(this.object.position), j.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(j.direction)) < Ot ? this.object.lookAt(this.target) : (Q.setFromNormalAndCoplanarPoint(this.object.up, this.target), j.intersectPlane(Q, this.target))));
79
114
  } else if (this.object.isOrthographicCamera) {
80
- const c = this.object.zoom;
81
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), c !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
115
+ const l = this.object.zoom;
116
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), l !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
82
117
  }
83
- return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > Y || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Y || this._lastTargetPosition.distanceToSquared(this.target) > Y ? (this.dispatchEvent($), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
118
+ return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > U || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > U || this._lastTargetPosition.distanceToSquared(this.target) > U ? (this.dispatchEvent(B), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
84
119
  }
85
120
  _getAutoRotationAngle(t) {
86
121
  return t !== null ? f / 60 * this.autoRotateSpeed * t : f / 60 / 60 * this.autoRotateSpeed;
@@ -121,8 +156,8 @@ class vt extends Pt {
121
156
  if (!this.zoomToCursor)
122
157
  return;
123
158
  this._performCursorZoom = !0;
124
- const s = this.domElement.getBoundingClientRect(), o = t - s.left, n = e - s.top, c = s.width, p = s.height;
125
- this._mouse.x = o / c * 2 - 1, this._mouse.y = -(n / p) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
159
+ const s = this.domElement.getBoundingClientRect(), o = t - s.left, n = e - s.top, l = s.width, p = s.height;
160
+ this._mouse.x = o / l * 2 - 1, this._mouse.y = -(n / p) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
126
161
  }
127
162
  _clampDistance(t) {
128
163
  return Math.max(this.minDistance, Math.min(this.maxDistance, t));
@@ -220,8 +255,8 @@ class vt extends Pt {
220
255
  _handleTouchMoveDolly(t) {
221
256
  const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, o = t.pageY - e.y, n = Math.sqrt(s * s + o * o);
222
257
  this._dollyEnd.set(0, n), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
223
- const c = (t.pageX + e.x) * 0.5, p = (t.pageY + e.y) * 0.5;
224
- this._updateZoomParameters(c, p);
258
+ const l = (t.pageX + e.x) * 0.5, p = (t.pageY + e.y) * 0.5;
259
+ this._updateZoomParameters(l, p);
225
260
  }
226
261
  _handleTouchMoveDollyPan(t) {
227
262
  this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
@@ -248,7 +283,7 @@ class vt extends Pt {
248
283
  }
249
284
  _trackPointer(t) {
250
285
  let e = this._pointerPositions[t.pointerId];
251
- e === void 0 && (e = new P(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
286
+ e === void 0 && (e = new y(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
252
287
  }
253
288
  _getSecondPointerPosition(t) {
254
289
  const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
@@ -272,16 +307,16 @@ class vt extends Pt {
272
307
  return t.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
273
308
  }
274
309
  }
275
- function Mt(i) {
276
- this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
310
+ function Ct(i) {
311
+ this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
277
312
  }
278
- function Rt(i) {
313
+ function Lt(i) {
279
314
  this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
280
315
  }
281
- function Ot(i) {
316
+ function At(i) {
282
317
  switch (this._removePointer(i), this._pointers.length) {
283
318
  case 0:
284
- this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ot), this.state = l.NONE;
319
+ this.domElement.releasePointerCapture(i.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ht), this.state = h.NONE;
285
320
  break;
286
321
  case 1:
287
322
  const t = this._pointers[0], e = this._pointerPositions[t];
@@ -289,7 +324,7 @@ function Ot(i) {
289
324
  break;
290
325
  }
291
326
  }
292
- function xt(i) {
327
+ function kt(i) {
293
328
  let t;
294
329
  switch (i.button) {
295
330
  case 0:
@@ -305,199 +340,190 @@ function xt(i) {
305
340
  t = -1;
306
341
  }
307
342
  switch (t) {
308
- case C.DOLLY:
343
+ case x.DOLLY:
309
344
  if (this.enableZoom === !1) return;
310
- this._handleMouseDownDolly(i), this.state = l.DOLLY;
345
+ this._handleMouseDownDolly(i), this.state = h.DOLLY;
311
346
  break;
312
- case C.ROTATE:
347
+ case x.ROTATE:
313
348
  if (i.ctrlKey || i.metaKey || i.shiftKey) {
314
349
  if (this.enablePan === !1) return;
315
- this._handleMouseDownPan(i), this.state = l.PAN;
350
+ this._handleMouseDownPan(i), this.state = h.PAN;
316
351
  } else {
317
352
  if (this.enableRotate === !1) return;
318
- this._handleMouseDownRotate(i), this.state = l.ROTATE;
353
+ this._handleMouseDownRotate(i), this.state = h.ROTATE;
319
354
  }
320
355
  break;
321
- case C.PAN:
356
+ case x.PAN:
322
357
  if (i.ctrlKey || i.metaKey || i.shiftKey) {
323
358
  if (this.enableRotate === !1) return;
324
- this._handleMouseDownRotate(i), this.state = l.ROTATE;
359
+ this._handleMouseDownRotate(i), this.state = h.ROTATE;
325
360
  } else {
326
361
  if (this.enablePan === !1) return;
327
- this._handleMouseDownPan(i), this.state = l.PAN;
362
+ this._handleMouseDownPan(i), this.state = h.PAN;
328
363
  }
329
364
  break;
330
365
  default:
331
- this.state = l.NONE;
366
+ this.state = h.NONE;
332
367
  }
333
- this.state !== l.NONE && this.dispatchEvent(F);
368
+ this.state !== h.NONE && this.dispatchEvent(F);
334
369
  }
335
- function Ct(i) {
370
+ function jt(i) {
336
371
  switch (this.state) {
337
- case l.ROTATE:
372
+ case h.ROTATE:
338
373
  if (this.enableRotate === !1) return;
339
374
  this._handleMouseMoveRotate(i);
340
375
  break;
341
- case l.DOLLY:
376
+ case h.DOLLY:
342
377
  if (this.enableZoom === !1) return;
343
378
  this._handleMouseMoveDolly(i);
344
379
  break;
345
- case l.PAN:
380
+ case h.PAN:
346
381
  if (this.enablePan === !1) return;
347
382
  this._handleMouseMovePan(i);
348
383
  break;
349
384
  }
350
385
  }
351
- function Lt(i) {
352
- this.enabled === !1 || this.enableZoom === !1 || this.state !== l.NONE || (i.preventDefault(), this.dispatchEvent(F), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ot));
386
+ function zt(i) {
387
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== h.NONE || (i.preventDefault(), this.dispatchEvent(F), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ht));
353
388
  }
354
- function At(i) {
389
+ function Nt(i) {
355
390
  this.enabled !== !1 && this._handleKeyDown(i);
356
391
  }
357
- function kt(i) {
392
+ function It(i) {
358
393
  switch (this._trackPointer(i), this._pointers.length) {
359
394
  case 1:
360
395
  switch (this.touches.ONE) {
361
- case x.ROTATE:
396
+ case O.ROTATE:
362
397
  if (this.enableRotate === !1) return;
363
- this._handleTouchStartRotate(i), this.state = l.TOUCH_ROTATE;
398
+ this._handleTouchStartRotate(i), this.state = h.TOUCH_ROTATE;
364
399
  break;
365
- case x.PAN:
400
+ case O.PAN:
366
401
  if (this.enablePan === !1) return;
367
- this._handleTouchStartPan(i), this.state = l.TOUCH_PAN;
402
+ this._handleTouchStartPan(i), this.state = h.TOUCH_PAN;
368
403
  break;
369
404
  default:
370
- this.state = l.NONE;
405
+ this.state = h.NONE;
371
406
  }
372
407
  break;
373
408
  case 2:
374
409
  switch (this.touches.TWO) {
375
- case x.DOLLY_PAN:
410
+ case O.DOLLY_PAN:
376
411
  if (this.enableZoom === !1 && this.enablePan === !1) return;
377
- this._handleTouchStartDollyPan(i), this.state = l.TOUCH_DOLLY_PAN;
412
+ this._handleTouchStartDollyPan(i), this.state = h.TOUCH_DOLLY_PAN;
378
413
  break;
379
- case x.DOLLY_ROTATE:
414
+ case O.DOLLY_ROTATE:
380
415
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
381
- this._handleTouchStartDollyRotate(i), this.state = l.TOUCH_DOLLY_ROTATE;
416
+ this._handleTouchStartDollyRotate(i), this.state = h.TOUCH_DOLLY_ROTATE;
382
417
  break;
383
418
  default:
384
- this.state = l.NONE;
419
+ this.state = h.NONE;
385
420
  }
386
421
  break;
387
422
  default:
388
- this.state = l.NONE;
423
+ this.state = h.NONE;
389
424
  }
390
- this.state !== l.NONE && this.dispatchEvent(F);
425
+ this.state !== h.NONE && this.dispatchEvent(F);
391
426
  }
392
- function jt(i) {
427
+ function Ut(i) {
393
428
  switch (this._trackPointer(i), this.state) {
394
- case l.TOUCH_ROTATE:
429
+ case h.TOUCH_ROTATE:
395
430
  if (this.enableRotate === !1) return;
396
431
  this._handleTouchMoveRotate(i), this.update();
397
432
  break;
398
- case l.TOUCH_PAN:
433
+ case h.TOUCH_PAN:
399
434
  if (this.enablePan === !1) return;
400
435
  this._handleTouchMovePan(i), this.update();
401
436
  break;
402
- case l.TOUCH_DOLLY_PAN:
437
+ case h.TOUCH_DOLLY_PAN:
403
438
  if (this.enableZoom === !1 && this.enablePan === !1) return;
404
439
  this._handleTouchMoveDollyPan(i), this.update();
405
440
  break;
406
- case l.TOUCH_DOLLY_ROTATE:
441
+ case h.TOUCH_DOLLY_ROTATE:
407
442
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
408
443
  this._handleTouchMoveDollyRotate(i), this.update();
409
444
  break;
410
445
  default:
411
- this.state = l.NONE;
446
+ this.state = h.NONE;
412
447
  }
413
448
  }
414
- function zt(i) {
449
+ function Yt(i) {
415
450
  this.enabled !== !1 && i.preventDefault();
416
451
  }
417
- function Nt(i) {
452
+ function Zt(i) {
418
453
  i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
419
454
  }
420
- function It(i) {
455
+ function Kt(i) {
421
456
  i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
422
457
  }
423
- const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { class: "controls" }, Kt = { class: "material-icons" }, Ht = { class: "material-icons" }, Ft = {
458
+ const Ft = { class: "present3d-container" }, Ht = { class: "header" }, Vt = { class: "controls" }, Wt = { class: "material-icons" }, Xt = { class: "material-icons" }, Gt = {
424
459
  key: 0,
425
460
  class: "error"
426
- }, Wt = { class: "script-source" }, Vt = ["disabled"], Xt = /* @__PURE__ */ tt({
461
+ }, qt = { class: "script-source" }, Bt = ["disabled"], Qt = /* @__PURE__ */ ot({
427
462
  __name: "View",
428
463
  props: {
429
464
  selectedResult: {}
430
465
  },
431
466
  emits: ["updateResult"],
432
467
  setup(i, { emit: t }) {
433
- var G;
434
- const e = i, s = t, o = R(((G = e.selectedResult.data) == null ? void 0 : G.script) ?? ""), n = R(null), c = R(null), p = R(!1), u = R(!0), v = et(() => {
435
- var a;
436
- return o.value !== ((a = e.selectedResult.data) == null ? void 0 : a.script);
437
- });
438
- let y, m, w, r, b, S, L = [], D = null, M = null;
439
- it(() => {
440
- nt(), U(), W(), q(() => {
468
+ const e = i, s = t, o = M(e.selectedResult.data?.script ?? ""), n = M(null), l = M(null), p = M(!1), u = M(!0), S = at(() => o.value !== e.selectedResult.data?.script);
469
+ let b, m, g, r, P, E, T = [], D = null, L = null;
470
+ nt(() => {
471
+ ct(), I(), H(), q(() => {
441
472
  V();
442
473
  });
443
- }), st(() => {
444
- dt();
445
- }), O(
446
- () => {
447
- var a;
448
- return (a = e.selectedResult.data) == null ? void 0 : a.script;
449
- },
474
+ }), rt(() => {
475
+ ft();
476
+ }), R(
477
+ () => e.selectedResult.data?.script,
450
478
  () => {
451
- U();
479
+ I();
452
480
  }
453
- ), O(p, () => {
454
- U();
455
- }), O(u, (a) => {
456
- S && (S.visible = a);
481
+ ), R(p, () => {
482
+ I();
483
+ }), R(u, (a) => {
484
+ E && (E.visible = a);
457
485
  });
458
- function nt() {
486
+ function ct() {
459
487
  if (!n.value) return;
460
- y = new g.Scene(), y.background = new g.Color(1710618);
461
- const a = n.value.clientWidth, h = n.value.clientHeight;
462
- m = new g.PerspectiveCamera(50, a / h, 0.1, 1e3), m.position.set(5, 5, 10), m.lookAt(0, 0, 0), w = new g.WebGLRenderer({ antialias: !0 }), w.setSize(a, h), w.setPixelRatio(window.devicePixelRatio), n.value.appendChild(w.domElement), r = new vt(m, w.domElement), r.enableDamping = !0, r.dampingFactor = 0.05, r.addEventListener("change", X);
463
- const T = new g.AmbientLight(16777215, 0.6);
464
- y.add(T);
465
- const A = new g.DirectionalLight(16777215, 0.8);
466
- A.position.set(10, 10, 10), y.add(A), S = new g.GridHelper(20, 20, 4473924, 2236962), S.visible = u.value, y.add(S), window.addEventListener("resize", I), M = new ResizeObserver(() => {
467
- I();
468
- }), M.observe(n.value);
488
+ b = new $(), b.background = new J(1710618);
489
+ const a = n.value.clientWidth, c = n.value.clientHeight;
490
+ m = new tt(50, a / c, 0.1, 1e3), m.position.set(5, 5, 10), m.lookAt(0, 0, 0), g = new et({ antialias: !0 }), g.setSize(a, c), g.setPixelRatio(window.devicePixelRatio), n.value.appendChild(g.domElement), r = new xt(m, g.domElement), r.enableDamping = !0, r.dampingFactor = 0.05, r.addEventListener("change", W);
491
+ const v = new it(16777215, 0.6);
492
+ b.add(v);
493
+ const A = new st(16777215, 0.8);
494
+ A.position.set(10, 10, 10), b.add(A), E = new Dt(20, 20, 4473924, 2236962), E.visible = u.value, b.add(E), window.addEventListener("resize", N), L = new ResizeObserver(() => {
495
+ N();
496
+ }), L.observe(n.value);
469
497
  }
470
- function I() {
498
+ function N() {
471
499
  if (!n.value) return;
472
- const a = n.value.clientWidth, h = n.value.clientHeight;
473
- m.aspect = a / h, m.updateProjectionMatrix(), w.setSize(a, h);
500
+ const a = n.value.clientWidth, c = n.value.clientHeight;
501
+ m.aspect = a / c, m.updateProjectionMatrix(), g.setSize(a, c);
474
502
  }
475
- function U() {
476
- var a;
503
+ function I() {
477
504
  try {
478
- L.forEach((_t) => y.remove(_t)), L = [];
479
- const h = (a = e.selectedResult.data) == null ? void 0 : a.script;
480
- if (!h) return;
481
- const T = N(h), A = Z(T, { wireframe: p.value });
482
- y.add(A), L.push(A), c.value = null;
483
- } catch (h) {
484
- c.value = h instanceof Error ? h.message : "Unknown error", console.error("ShapeScript parse error:", h);
505
+ T.forEach((A) => b.remove(A)), T = [];
506
+ const a = e.selectedResult.data?.script;
507
+ if (!a) return;
508
+ const c = z(a), v = Y(c, { wireframe: p.value });
509
+ b.add(v), T.push(v), l.value = null;
510
+ } catch (a) {
511
+ l.value = a instanceof Error ? a.message : "Unknown error", console.error("ShapeScript parse error:", a);
485
512
  }
486
513
  }
487
- function W() {
488
- b = requestAnimationFrame(W), r.update(), w.render(y, m);
514
+ function H() {
515
+ P = requestAnimationFrame(H), r.update(), g.render(b, m);
489
516
  }
490
- function rt() {
517
+ function pt() {
491
518
  m.position.set(5, 5, 10), m.lookAt(0, 0, 0), r.reset();
492
519
  }
493
520
  function V() {
494
- var h, T;
495
- if (!m || !r || !((T = (h = e.selectedResult) == null ? void 0 : h.viewState) != null && T.cameraState))
521
+ if (!m || !r || !e.selectedResult?.viewState?.cameraState)
496
522
  return;
497
523
  const a = e.selectedResult.viewState.cameraState;
498
524
  a.position && m.position.set(a.position.x, a.position.y, a.position.z), a.target && r.target.set(a.target.x, a.target.y, a.target.z), m.updateProjectionMatrix(), r.update();
499
525
  }
500
- function ht() {
526
+ function dt() {
501
527
  return {
502
528
  position: {
503
529
  x: m.position.x,
@@ -511,34 +537,34 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
511
537
  }
512
538
  };
513
539
  }
514
- function X() {
540
+ function W() {
515
541
  D !== null && clearTimeout(D), D = window.setTimeout(() => {
516
- lt();
542
+ ut();
517
543
  }, 500);
518
544
  }
519
- function lt() {
545
+ function ut() {
520
546
  const a = {
521
547
  ...e.selectedResult,
522
548
  viewState: {
523
- cameraState: ht()
549
+ cameraState: dt()
524
550
  }
525
551
  };
526
552
  s("updateResult", a);
527
553
  }
528
- function ct() {
554
+ function mt() {
529
555
  p.value = !p.value;
530
556
  }
531
- function pt() {
557
+ function _t() {
532
558
  u.value = !u.value;
533
559
  }
534
- function dt() {
535
- D !== null && clearTimeout(D), b && cancelAnimationFrame(b), w && w.dispose(), r && (r.removeEventListener("change", X), r.dispose()), M && M.disconnect(), window.removeEventListener("resize", I);
560
+ function ft() {
561
+ D !== null && clearTimeout(D), P && cancelAnimationFrame(P), g && g.dispose(), r && (r.removeEventListener("change", W), r.dispose()), L && L.disconnect(), window.removeEventListener("resize", N);
536
562
  }
537
- function ut() {
563
+ function bt() {
538
564
  }
539
- function mt() {
565
+ function gt() {
540
566
  try {
541
- N(o.value);
567
+ z(o.value);
542
568
  const a = {
543
569
  ...e.selectedResult,
544
570
  data: {
@@ -547,150 +573,142 @@ const Ut = { class: "present3d-container" }, Yt = { class: "header" }, Zt = { cl
547
573
  };
548
574
  s("updateResult", a);
549
575
  } catch (a) {
550
- c.value = a instanceof Error ? a.message : "Invalid ShapeScript", console.error("Script validation failed:", a);
576
+ l.value = a instanceof Error ? a.message : "Invalid ShapeScript", console.error("Script validation failed:", a);
551
577
  }
552
578
  }
553
- return O(
554
- () => {
555
- var a;
556
- return (a = e.selectedResult.data) == null ? void 0 : a.script;
557
- },
579
+ return R(
580
+ () => e.selectedResult.data?.script,
558
581
  (a) => {
559
582
  a && (o.value = a);
560
583
  }
561
- ), O(
584
+ ), R(
562
585
  () => e.selectedResult,
563
586
  () => {
564
587
  q(() => {
565
588
  V();
566
589
  });
567
590
  }
568
- ), (a, h) => (H(), K("div", Ut, [
569
- _("div", Yt, [
570
- _("h1", null, k(i.selectedResult.title || "3D Visualization"), 1),
571
- _("div", Zt, [
591
+ ), (a, c) => (K(), Z("div", Ft, [
592
+ _("div", Ht, [
593
+ _("h1", null, C(i.selectedResult.title || "3D Visualization"), 1),
594
+ _("div", Vt, [
572
595
  _("button", {
573
- onClick: rt,
596
+ onClick: pt,
574
597
  class: "control-btn"
575
- }, [...h[1] || (h[1] = [
598
+ }, [...c[1] || (c[1] = [
576
599
  _("span", { class: "material-icons" }, "refresh", -1),
577
- j(" Reset Camera ", -1)
600
+ k(" Reset Camera ", -1)
578
601
  ])]),
579
602
  _("button", {
580
- onClick: ct,
603
+ onClick: mt,
581
604
  class: "control-btn"
582
605
  }, [
583
- _("span", Kt, k(p.value ? "grid_off" : "grid_on"), 1),
584
- h[2] || (h[2] = j(" Wireframe ", -1))
606
+ _("span", Wt, C(p.value ? "grid_off" : "grid_on"), 1),
607
+ c[2] || (c[2] = k(" Wireframe ", -1))
585
608
  ]),
586
609
  _("button", {
587
- onClick: pt,
610
+ onClick: _t,
588
611
  class: "control-btn"
589
612
  }, [
590
- _("span", Ht, k(u.value ? "visibility_off" : "visibility"), 1),
591
- h[3] || (h[3] = j(" Grid ", -1))
613
+ _("span", Xt, C(u.value ? "visibility_off" : "visibility"), 1),
614
+ c[3] || (c[3] = k(" Grid ", -1))
592
615
  ])
593
616
  ])
594
617
  ]),
595
- c.value ? (H(), K("div", Ft, [
596
- h[4] || (h[4] = _("strong", null, "Parse Error:", -1)),
597
- j(" " + k(c.value), 1)
598
- ])) : gt("", !0),
618
+ l.value ? (K(), Z("div", Gt, [
619
+ c[4] || (c[4] = _("strong", null, "Parse Error:", -1)),
620
+ k(" " + C(l.value), 1)
621
+ ])) : vt("", !0),
599
622
  _("div", {
600
623
  class: "viewport",
601
624
  ref_key: "viewport",
602
625
  ref: n
603
626
  }, null, 512),
604
- _("details", Wt, [
605
- h[5] || (h[5] = _("summary", null, "Edit ShapeScript Source", -1)),
606
- yt(_("textarea", {
607
- "onUpdate:modelValue": h[0] || (h[0] = (T) => o.value = T),
608
- onInput: ut,
627
+ _("details", qt, [
628
+ c[5] || (c[5] = _("summary", null, "Edit ShapeScript Source", -1)),
629
+ Mt(_("textarea", {
630
+ "onUpdate:modelValue": c[0] || (c[0] = (v) => o.value = v),
631
+ onInput: bt,
609
632
  class: "script-editor",
610
633
  spellcheck: "false"
611
634
  }, null, 544), [
612
- [wt, o.value]
635
+ [Rt, o.value]
613
636
  ]),
614
637
  _("button", {
615
- onClick: mt,
638
+ onClick: gt,
616
639
  class: "apply-btn",
617
- disabled: !v.value
618
- }, " Apply Changes ", 8, Vt)
640
+ disabled: !S.value
641
+ }, " Apply Changes ", 8, Bt)
619
642
  ])
620
643
  ]));
621
644
  }
622
- }), at = (i, t) => {
645
+ }), lt = (i, t) => {
623
646
  const e = i.__vccOpts || i;
624
647
  for (const [s, o] of t)
625
648
  e[s] = o;
626
649
  return e;
627
- }, Gt = /* @__PURE__ */ at(Xt, [["__scopeId", "data-v-daa337a0"]]), qt = { class: "preview-container" }, Bt = { class: "preview-title" }, Qt = /* @__PURE__ */ tt({
650
+ }, $t = /* @__PURE__ */ lt(Qt, [["__scopeId", "data-v-daa337a0"]]), Jt = { class: "preview-container" }, te = { class: "preview-title" }, ee = /* @__PURE__ */ ot({
628
651
  __name: "Preview",
629
652
  props: {
630
653
  result: {}
631
654
  },
632
655
  setup(i) {
633
- const t = i, e = et(() => t.result.title || "3D Visualization"), s = R(null);
634
- let o, n, c, p, u = null;
635
- it(() => {
636
- v();
637
- }), st(() => {
638
- w();
639
- }), O(
640
- () => {
641
- var r;
642
- return (r = t.result.data) == null ? void 0 : r.script;
643
- },
656
+ const t = i, e = at(() => t.result.title || "3D Visualization"), s = M(null);
657
+ let o, n, l, p, u = null;
658
+ nt(() => {
659
+ S();
660
+ }), rt(() => {
661
+ g();
662
+ }), R(
663
+ () => t.result.data?.script,
644
664
  () => {
645
665
  m();
646
666
  }
647
667
  );
648
- function v() {
649
- var r;
668
+ function S() {
650
669
  if (s.value)
651
670
  try {
652
- o = new g.Scene(), o.background = new g.Color(2763322);
653
- const b = s.value.clientWidth || 200, S = s.value.clientHeight || 150;
654
- n = new g.PerspectiveCamera(50, b / S, 0.1, 1e3), n.position.set(4, 4, 8), n.lookAt(0, 0, 0), c = new g.WebGLRenderer({ antialias: !0, alpha: !1 }), c.setSize(b, S), c.setPixelRatio(Math.min(window.devicePixelRatio, 2)), s.value.appendChild(c.domElement);
655
- const L = new g.AmbientLight(16777215, 0.6);
656
- o.add(L);
657
- const D = new g.DirectionalLight(16777215, 0.8);
658
- if (D.position.set(5, 5, 5), o.add(D), !((r = t.result.data) != null && r.script)) return;
659
- const M = N(t.result.data.script);
660
- u = Z(M, { wireframe: !1 }), o.add(u), y();
661
- } catch (b) {
662
- console.error("Preview render error:", b);
671
+ o = new $(), o.background = new J(2763322);
672
+ const r = s.value.clientWidth || 200, P = s.value.clientHeight || 150;
673
+ n = new tt(50, r / P, 0.1, 1e3), n.position.set(4, 4, 8), n.lookAt(0, 0, 0), l = new et({ antialias: !0, alpha: !1 }), l.setSize(r, P), l.setPixelRatio(Math.min(window.devicePixelRatio, 2)), s.value.appendChild(l.domElement);
674
+ const E = new it(16777215, 0.6);
675
+ o.add(E);
676
+ const T = new st(16777215, 0.8);
677
+ if (T.position.set(5, 5, 5), o.add(T), !t.result.data?.script) return;
678
+ const D = z(t.result.data.script);
679
+ u = Y(D, { wireframe: !1 }), o.add(u), b();
680
+ } catch (r) {
681
+ console.error("Preview render error:", r);
663
682
  }
664
683
  }
665
- function y() {
666
- p = requestAnimationFrame(y);
684
+ function b() {
685
+ p = requestAnimationFrame(b);
667
686
  const r = Date.now() * 5e-4;
668
- n.position.x = Math.cos(r) * 8, n.position.z = Math.sin(r) * 8, n.lookAt(0, 0, 0), c.render(o, n);
687
+ n.position.x = Math.cos(r) * 8, n.position.z = Math.sin(r) * 8, n.lookAt(0, 0, 0), l.render(o, n);
669
688
  }
670
689
  function m() {
671
- var r;
672
- if (!(!o || !((r = t.result.data) != null && r.script)))
690
+ if (!(!o || !t.result.data?.script))
673
691
  try {
674
692
  u && o.remove(u);
675
- const b = N(t.result.data.script);
676
- u = Z(b, { wireframe: !1 }), o.add(u);
677
- } catch (b) {
678
- console.error("Preview reload error:", b);
693
+ const r = z(t.result.data.script);
694
+ u = Y(r, { wireframe: !1 }), o.add(u);
695
+ } catch (r) {
696
+ console.error("Preview reload error:", r);
679
697
  }
680
698
  }
681
- function w() {
682
- p && cancelAnimationFrame(p), c && c.dispose();
699
+ function g() {
700
+ p && cancelAnimationFrame(p), l && l.dispose();
683
701
  }
684
- return (r, b) => (H(), K("div", qt, [
702
+ return (r, P) => (K(), Z("div", Jt, [
685
703
  _("div", {
686
704
  ref_key: "previewViewport",
687
705
  ref: s,
688
706
  class: "preview-viewport"
689
707
  }, null, 512),
690
- _("div", Bt, k(e.value), 1)
708
+ _("div", te, C(e.value), 1)
691
709
  ]));
692
710
  }
693
- }), $t = /* @__PURE__ */ at(Qt, [["__scopeId", "data-v-75941188"]]), Jt = "present3D", te = `Use the ${Jt} tool to create interactive 3D visualizations when the user requests:
711
+ }), ie = /* @__PURE__ */ lt(ee, [["__scopeId", "data-v-75941188"]]), se = "present3D", oe = `Use the ${se} tool to create interactive 3D visualizations when the user requests:
694
712
  - 3D models or shapes
695
713
  - Mathematical visualizations (surfaces, functions, geometric patterns)
696
714
  - Molecular or atomic structures
@@ -771,24 +789,24 @@ Shapes: cube, sphere, cylinder, cone, torus
771
789
  CSG: union, difference, intersection, xor, stencil
772
790
  Properties: position, rotation, size, color, opacity
773
791
 
774
- Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`, ee = {
775
- ...bt,
776
- viewComponent: Gt,
777
- previewComponent: $t,
778
- samples: ft,
779
- systemPrompt: te
780
- }, ae = { plugin: ee };
792
+ Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`, ae = {
793
+ ...Tt,
794
+ viewComponent: $t,
795
+ previewComponent: ie,
796
+ samples: St,
797
+ systemPrompt: oe
798
+ }, he = { plugin: ae };
781
799
  export {
782
- $t as Preview,
783
- te as SYSTEM_PROMPT,
784
- he as TOOL_DEFINITION,
785
- Jt as TOOL_NAME,
786
- Gt as View,
787
- Z as astToThreeJS,
788
- ae as default,
789
- le as executePresent3D,
790
- N as parseShapeScript,
791
- ee as plugin,
792
- bt as pluginCore,
793
- ft as samples
800
+ ie as Preview,
801
+ oe as SYSTEM_PROMPT,
802
+ pe as TOOL_DEFINITION,
803
+ se as TOOL_NAME,
804
+ $t as View,
805
+ Y as astToThreeJS,
806
+ he as default,
807
+ de as executePresent3D,
808
+ z as parseShapeScript,
809
+ ae as plugin,
810
+ Tt as pluginCore,
811
+ St as samples
794
812
  };