@planara/core 2.3.2 → 2.5.0

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/index.es.js CHANGED
@@ -1,30 +1,30 @@
1
1
  import "reflect-metadata";
2
- import * as l from "three";
3
- import { Controls as yt, Vector3 as c, Quaternion as O, Raycaster as Ct, Object3D as Te, MeshBasicMaterial as bt, LineBasicMaterial as It, CylinderGeometry as S, BoxGeometry as M, BufferGeometry as Be, Float32BufferAttribute as Ke, Mesh as h, OctahedronGeometry as ue, Line as N, TorusGeometry as te, SphereGeometry as jt, Euler as Rt, Matrix4 as wt, PlaneGeometry as Ht, DoubleSide as kt, MOUSE as J, TOUCH as V, Spherical as Ve, Vector2 as L, Ray as Yt, Plane as Zt, MathUtils as Xt } from "three";
4
- import { FigureType as C, SelectMode as I, Figure as zt, DisplayMode as ae, ToolType as G, SceneMode as he } from "@planara/types";
5
- import { SymmetricAxesHelper as Nt, OrbitWithState as Ft } from "@planara/three";
6
- import { injectable as w, inject as u, injectAll as ve, container as Qt } from "tsyringe";
7
- import { EventEmitter as Ut } from "events";
8
- import { makeAutoObservable as Wt } from "mobx";
9
- const $t = {
10
- [C.Plane]: () => new l.PlaneGeometry(1, 1, 1, 1),
11
- [C.Cube]: () => new l.BoxGeometry(1, 1, 1, 1, 1, 1),
12
- [C.UVSphere]: () => new l.SphereGeometry(0.5, 32, 16),
13
- [C.Icosphere]: () => new l.IcosahedronGeometry(0.5, 0),
14
- [C.Cylinder]: () => new l.CylinderGeometry(0.5, 0.5, 1, 32, 1, !1),
15
- [C.Cone]: () => new l.ConeGeometry(0.5, 1, 32, 1, !1),
16
- [C.Torus]: () => new l.TorusGeometry(0.5, 0.2, 16, 64),
17
- [C.Circle]: () => new l.CircleGeometry(0.5, 32),
18
- [C.Sphere]: () => new l.SphereGeometry(0.5, 32, 16),
19
- [C.Custom]: function() {
2
+ import * as a from "three";
3
+ import { Controls as xe, Vector3 as E, MOUSE as T, TOUCH as D, Quaternion as me, Spherical as fe, Vector2 as v, Ray as Ie, Plane as He, MathUtils as ke } from "three";
4
+ import { FigureType as y, SelectMode as M, Figure as Ne, DisplayMode as R, ToolType as O, SceneMode as j } from "@planara/types";
5
+ import { SymmetricAxesHelper as Ye, OrbitWithState as Ue, CameraAxesGizmo as $e, ModelingTransformControls as ze } from "@planara/three";
6
+ import { injectable as u, inject as l, injectAll as k, container as Fe } from "tsyringe";
7
+ import { EventEmitter as We } from "events";
8
+ import { makeAutoObservable as Ze } from "mobx";
9
+ const Be = {
10
+ [y.Plane]: () => new a.PlaneGeometry(1, 1, 1, 1),
11
+ [y.Cube]: () => new a.BoxGeometry(1, 1, 1, 1, 1, 1),
12
+ [y.UVSphere]: () => new a.SphereGeometry(0.5, 32, 16),
13
+ [y.Icosphere]: () => new a.IcosahedronGeometry(0.5, 0),
14
+ [y.Cylinder]: () => new a.CylinderGeometry(0.5, 0.5, 1, 32, 1, !1),
15
+ [y.Cone]: () => new a.ConeGeometry(0.5, 1, 32, 1, !1),
16
+ [y.Torus]: () => new a.TorusGeometry(0.5, 0.2, 16, 64),
17
+ [y.Circle]: () => new a.CircleGeometry(0.5, 32),
18
+ [y.Sphere]: () => new a.SphereGeometry(0.5, 32, 16),
19
+ [y.Custom]: function() {
20
20
  throw new Error("Custom geometry is not generated here.");
21
21
  }
22
- }, vt = new l.MeshStandardMaterial({
22
+ }, Le = new a.MeshStandardMaterial({
23
23
  color: 12566463,
24
24
  metalness: 0,
25
25
  roughness: 0.6
26
26
  });
27
- class Mt {
27
+ class Ce {
28
28
  /** Корневой объект сцены */
29
29
  scene;
30
30
  /** Камера для сцены */
@@ -40,15 +40,15 @@ class Mt {
40
40
  * @param canvas - HTMLCanvasElement для рендеринга
41
41
  */
42
42
  constructor(e) {
43
- this.canvas = e, this.scene = new l.Scene(), this.scene.background = new l.Color(1710618), this.camera = new l.PerspectiveCamera(
43
+ this.canvas = e, this.scene = new a.Scene(), this.scene.background = new a.Color(1710618), this.camera = new a.PerspectiveCamera(
44
44
  45,
45
45
  e.clientWidth / e.clientHeight,
46
46
  0.1,
47
47
  1e3
48
- ), this.camera.position.set(1, 1, 7), this.renderer = new l.WebGLRenderer({ canvas: e, antialias: !0 }), this.renderer.setSize(e.clientWidth, e.clientHeight);
49
- const s = new l.AmbientLight(16777215, 0.5);
48
+ ), this.camera.position.set(1, 1, 7), this.renderer = new a.WebGLRenderer({ canvas: e, antialias: !0 }), this.renderer.setSize(e.clientWidth, e.clientHeight);
49
+ const s = new a.AmbientLight(16777215, 0.5);
50
50
  this.scene.add(s);
51
- const i = new l.DirectionalLight(16777215, 1);
51
+ const i = new a.DirectionalLight(16777215, 1);
52
52
  i.position.set(5, 10, 7), this.scene.add(i);
53
53
  }
54
54
  /**
@@ -79,9 +79,9 @@ class Mt {
79
79
  * @param figure - Данные фигуры: position, normal, uv
80
80
  */
81
81
  addFigure(e) {
82
- const s = new l.BufferGeometry();
83
- s.setAttribute("position", new l.Float32BufferAttribute(e.position, 3)), e.normal && s.setAttribute("normal", new l.Float32BufferAttribute(e.normal, 3)), e.uv && s.setAttribute("uv", new l.Float32BufferAttribute(e.uv, 2));
84
- const i = new l.Mesh(s, vt);
82
+ const s = new a.BufferGeometry();
83
+ s.setAttribute("position", new a.Float32BufferAttribute(e.position, 3)), e.normal && s.setAttribute("normal", new a.Float32BufferAttribute(e.normal, 3)), e.uv && s.setAttribute("uv", new a.Float32BufferAttribute(e.uv, 2));
84
+ const i = new a.Mesh(s, Le);
85
85
  return this.scene.add(i), this.meshes.push(i), i;
86
86
  }
87
87
  /**
@@ -172,582 +172,15 @@ class Mt {
172
172
  this.meshes && (this.meshes.length = 0, this.meshes = []), this.scene = null, this.camera = null, this.renderer?.dispose(), this.canvas = null;
173
173
  }
174
174
  }
175
- const W = new Ct(), v = new c(), F = new c(), m = new O(), Je = {
176
- X: new c(1, 0, 0),
177
- Y: new c(0, 1, 0),
178
- Z: new c(0, 0, 1)
179
- }, Me = { type: "change" }, et = { type: "mouseDown", mode: null }, tt = { type: "mouseUp", mode: null }, st = { type: "objectChange" };
180
- class Gt extends yt {
181
- /**
182
- * Constructs a new controls instance.
183
- *
184
- * @param {Camera} camera - The camera of the rendered scene.
185
- * @param {?HTMLElement} domElement - The HTML element used for event listeners.
186
- */
187
- constructor(e, s = null) {
188
- super(void 0, s);
189
- const i = new es(this);
190
- this._root = i;
191
- const o = new ts();
192
- this._gizmo = o, i.add(o);
193
- const r = new ss();
194
- this._plane = r, i.add(r);
195
- const n = this;
196
- function a(x, Q) {
197
- let B = Q;
198
- Object.defineProperty(n, x, {
199
- get: function() {
200
- return B !== void 0 ? B : Q;
201
- },
202
- set: function(U) {
203
- B !== U && (B = U, r[x] = U, o[x] = U, n.dispatchEvent({ type: x + "-changed", value: U }), n.dispatchEvent(Me));
204
- }
205
- }), n[x] = Q, r[x] = Q, o[x] = Q;
206
- }
207
- 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("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
208
- const d = new c(), g = new c(), b = new O(), H = new O(), T = new c(), q = new O(), le = new c(), k = new c(), Y = new c(), j = 0, Z = new c();
209
- a("worldPosition", d), a("worldPositionStart", g), a("worldQuaternion", b), a("worldQuaternionStart", H), a("cameraPosition", T), a("cameraQuaternion", q), a("pointStart", le), a("pointEnd", k), a("rotationAxis", Y), a("rotationAngle", j), a("eye", Z), this._offset = new c(), this._startNorm = new c(), this._endNorm = new c(), this._cameraScale = new c(), this._parentPosition = new c(), this._parentQuaternion = new O(), this._parentQuaternionInv = new O(), this._parentScale = new c(), this._worldScaleStart = new c(), this._worldQuaternionInv = new O(), this._worldScale = new c(), this._positionStart = new c(), this._quaternionStart = new O(), this._scaleStart = new c(), this._getPointer = qt.bind(this), this._onPointerDown = Kt.bind(this), this._onPointerHover = Bt.bind(this), this._onPointerMove = Vt.bind(this), this._onPointerUp = Jt.bind(this), s !== null && this.connect(s);
210
- }
211
- connect(e) {
212
- 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";
213
- }
214
- disconnect() {
215
- this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "auto";
216
- }
217
- /**
218
- * Returns the visual representation of the controls. Add the helper to your scene to
219
- * visually transform the attached 3D object.
220
- *
221
- * @return {TransformControlsRoot} The helper.
222
- */
223
- getHelper() {
224
- return this._root;
225
- }
226
- pointerHover(e) {
227
- if (this.object === void 0 || this.dragging === !0) return;
228
- e !== null && W.setFromCamera(e, this.camera);
229
- const s = Pe(this._gizmo.picker[this.mode], W);
230
- s ? this.axis = s.object.name : this.axis = null;
231
- }
232
- pointerDown(e) {
233
- if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
234
- e !== null && W.setFromCamera(e, this.camera);
235
- const s = Pe(this._plane, W, !0);
236
- s && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(s.point).sub(this.worldPositionStart)), this.dragging = !0, et.mode = this.mode, this.dispatchEvent(et);
237
- }
238
- }
239
- pointerMove(e) {
240
- const s = this.axis, i = this.mode, o = this.object;
241
- let r = this.space;
242
- if (i === "scale" ? r = "local" : (s === "E" || s === "XYZE" || s === "XYZ") && (r = "world"), o === void 0 || s === null || this.dragging === !1 || e !== null && e.button !== -1) return;
243
- e !== null && W.setFromCamera(e, this.camera);
244
- const n = Pe(this._plane, W, !0);
245
- if (n) {
246
- if (this.pointEnd.copy(n.point).sub(this.worldPositionStart), i === "translate")
247
- this._offset.copy(this.pointEnd).sub(this.pointStart), r === "local" && s !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), s.indexOf("X") === -1 && (this._offset.x = 0), s.indexOf("Y") === -1 && (this._offset.y = 0), s.indexOf("Z") === -1 && (this._offset.z = 0), r === "local" && s !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), o.position.copy(this._offset).add(this._positionStart), this.translationSnap && (r === "local" && (o.position.applyQuaternion(m.copy(this._quaternionStart).invert()), s.search("X") !== -1 && (o.position.x = Math.round(o.position.x / this.translationSnap) * this.translationSnap), s.search("Y") !== -1 && (o.position.y = Math.round(o.position.y / this.translationSnap) * this.translationSnap), s.search("Z") !== -1 && (o.position.z = Math.round(o.position.z / this.translationSnap) * this.translationSnap), o.position.applyQuaternion(this._quaternionStart)), r === "world" && (o.parent && o.position.add(v.setFromMatrixPosition(o.parent.matrixWorld)), s.search("X") !== -1 && (o.position.x = Math.round(o.position.x / this.translationSnap) * this.translationSnap), s.search("Y") !== -1 && (o.position.y = Math.round(o.position.y / this.translationSnap) * this.translationSnap), s.search("Z") !== -1 && (o.position.z = Math.round(o.position.z / this.translationSnap) * this.translationSnap), o.parent && o.position.sub(v.setFromMatrixPosition(o.parent.matrixWorld)))), o.position.x = Math.max(this.minX, Math.min(this.maxX, o.position.x)), o.position.y = Math.max(this.minY, Math.min(this.maxY, o.position.y)), o.position.z = Math.max(this.minZ, Math.min(this.maxZ, o.position.z));
248
- else if (i === "scale") {
249
- if (s.search("XYZ") !== -1) {
250
- let a = this.pointEnd.length() / this.pointStart.length();
251
- this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), F.set(a, a, a);
252
- } else
253
- v.copy(this.pointStart), F.copy(this.pointEnd), v.applyQuaternion(this._worldQuaternionInv), F.applyQuaternion(this._worldQuaternionInv), F.divide(v), s.search("X") === -1 && (F.x = 1), s.search("Y") === -1 && (F.y = 1), s.search("Z") === -1 && (F.z = 1);
254
- o.scale.copy(this._scaleStart).multiply(F), this.scaleSnap && (s.search("X") !== -1 && (o.scale.x = Math.round(o.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), s.search("Y") !== -1 && (o.scale.y = Math.round(o.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), s.search("Z") !== -1 && (o.scale.z = Math.round(o.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
255
- } else if (i === "rotate") {
256
- this._offset.copy(this.pointEnd).sub(this.pointStart);
257
- const a = 20 / this.worldPosition.distanceTo(v.setFromMatrixPosition(this.camera.matrixWorld));
258
- let d = !1;
259
- s === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(v.copy(this.rotationAxis).cross(this.eye)) * a) : (s === "X" || s === "Y" || s === "Z") && (this.rotationAxis.copy(Je[s]), v.copy(Je[s]), r === "local" && v.applyQuaternion(this.worldQuaternion), v.cross(this.eye), v.length() === 0 ? d = !0 : this.rotationAngle = this._offset.dot(v.normalize()) * a), (s === "E" || d) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), r === "local" && s !== "E" && s !== "XYZE" ? (o.quaternion.copy(this._quaternionStart), o.quaternion.multiply(m.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), o.quaternion.copy(m.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), o.quaternion.multiply(this._quaternionStart).normalize());
260
- }
261
- this.dispatchEvent(Me), this.dispatchEvent(st);
262
- }
263
- }
264
- pointerUp(e) {
265
- e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (tt.mode = this.mode, this.dispatchEvent(tt)), this.dragging = !1, this.axis = null);
266
- }
267
- dispose() {
268
- this.disconnect(), this._root.dispose();
269
- }
270
- /**
271
- * Sets the 3D object that should be transformed and ensures the controls UI is visible.
272
- *
273
- * @param {Object3D} object - The 3D object that should be transformed.
274
- * @return {TransformControls} A reference to this controls.
275
- */
276
- attach(e) {
277
- return this.object = e, this._root.visible = !0, this;
278
- }
279
- /**
280
- * Removes the current 3D object from the controls and makes the helper UI invisible.
281
- *
282
- * @return {TransformControls} A reference to this controls.
283
- */
284
- detach() {
285
- return this.object = void 0, this.axis = null, this._root.visible = !1, this;
286
- }
287
- /**
288
- * Resets the object's position, rotation and scale to when the current transform began.
289
- */
290
- reset() {
291
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Me), this.dispatchEvent(st), this.pointStart.copy(this.pointEnd));
292
- }
293
- /**
294
- * Returns the raycaster that is used for user interaction. This object is shared between all
295
- * instances of `TransformControls`.
296
- *
297
- * @returns {Raycaster} The internal raycaster.
298
- */
299
- getRaycaster() {
300
- return W;
301
- }
302
- /**
303
- * Returns the transformation mode.
304
- *
305
- * @returns {'translate'|'rotate'|'scale'} The transformation mode.
306
- */
307
- getMode() {
308
- return this.mode;
309
- }
310
- /**
311
- * Sets the given transformation mode.
312
- *
313
- * @param {'translate'|'rotate'|'scale'} mode - The transformation mode to set.
314
- */
315
- setMode(e) {
316
- this.mode = e;
317
- }
318
- /**
319
- * Sets the translation snap.
320
- *
321
- * @param {?number} translationSnap - The translation snap to set.
322
- */
323
- setTranslationSnap(e) {
324
- this.translationSnap = e;
325
- }
326
- /**
327
- * Sets the rotation snap.
328
- *
329
- * @param {?number} rotationSnap - The rotation snap to set.
330
- */
331
- setRotationSnap(e) {
332
- this.rotationSnap = e;
333
- }
334
- /**
335
- * Sets the scale snap.
336
- *
337
- * @param {?number} scaleSnap - The scale snap to set.
338
- */
339
- setScaleSnap(e) {
340
- this.scaleSnap = e;
341
- }
342
- /**
343
- * Sets the size of the helper UI.
344
- *
345
- * @param {number} size - The size to set.
346
- */
347
- setSize(e) {
348
- this.size = e;
349
- }
350
- /**
351
- * Sets the coordinate space in which transformations are applied.
352
- *
353
- * @param {'world'|'local'} space - The space to set.
354
- */
355
- setSpace(e) {
356
- this.space = e;
357
- }
358
- /**
359
- * Sets the colors of the control's gizmo.
360
- *
361
- * @param {number|Color|string} xAxis - The x-axis color.
362
- * @param {number|Color|string} yAxis - The y-axis color.
363
- * @param {number|Color|string} zAxis - The z-axis color.
364
- * @param {number|Color|string} active - The color for active elements.
365
- */
366
- setColors(e, s, i, o) {
367
- const r = this._gizmo.materialLib;
368
- r.xAxis.color.set(e), r.yAxis.color.set(s), r.zAxis.color.set(i), r.active.color.set(o), r.xAxisTransparent.color.set(e), r.yAxisTransparent.color.set(s), r.zAxisTransparent.color.set(i), r.activeTransparent.color.set(o), r.xAxis._color && r.xAxis._color.set(e), r.yAxis._color && r.yAxis._color.set(s), r.zAxis._color && r.zAxis._color.set(i), r.active._color && r.active._color.set(o), r.xAxisTransparent._color && r.xAxisTransparent._color.set(e), r.yAxisTransparent._color && r.yAxisTransparent._color.set(s), r.zAxisTransparent._color && r.zAxisTransparent._color.set(i), r.activeTransparent._color && r.activeTransparent._color.set(o);
369
- }
370
- }
371
- function qt(t) {
372
- if (this.domElement.ownerDocument.pointerLockElement)
373
- return {
374
- x: 0,
375
- y: 0,
376
- button: t.button
377
- };
378
- {
379
- const e = this.domElement.getBoundingClientRect();
380
- return {
381
- x: (t.clientX - e.left) / e.width * 2 - 1,
382
- y: -(t.clientY - e.top) / e.height * 2 + 1,
383
- button: t.button
384
- };
385
- }
386
- }
387
- function Bt(t) {
388
- if (this.enabled)
389
- switch (t.pointerType) {
390
- case "mouse":
391
- case "pen":
392
- this.pointerHover(this._getPointer(t));
393
- break;
394
- }
395
- }
396
- function Kt(t) {
397
- this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(t.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(t)), this.pointerDown(this._getPointer(t)));
398
- }
399
- function Vt(t) {
400
- this.enabled && this.pointerMove(this._getPointer(t));
401
- }
402
- function Jt(t) {
403
- this.enabled && (this.domElement.releasePointerCapture(t.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(t)));
404
- }
405
- function Pe(t, e, s) {
406
- const i = e.intersectObject(t, !0);
407
- for (let o = 0; o < i.length; o++)
408
- if (i[o].object.visible || s)
409
- return i[o];
410
- return !1;
411
- }
412
- const me = new Rt(), _ = new c(0, 1, 0), it = new c(0, 0, 0), ot = new wt(), fe = new O(), we = new O(), R = new c(), nt = new wt(), ne = new c(1, 0, 0), $ = new c(0, 1, 0), re = new c(0, 0, 1), ge = new c(), se = new c(), ie = new c();
413
- class es extends Te {
414
- constructor(e) {
415
- super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
416
- }
417
- // updateMatrixWorld updates key transformation variables
418
- updateMatrixWorld(e) {
419
- const s = this.controls;
420
- s.object !== void 0 && (s.object.updateMatrixWorld(), s.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : s.object.parent.matrixWorld.decompose(s._parentPosition, s._parentQuaternion, s._parentScale), s.object.matrixWorld.decompose(s.worldPosition, s.worldQuaternion, s._worldScale), s._parentQuaternionInv.copy(s._parentQuaternion).invert(), s._worldQuaternionInv.copy(s.worldQuaternion).invert()), s.camera.updateMatrixWorld(), s.camera.matrixWorld.decompose(s.cameraPosition, s.cameraQuaternion, s._cameraScale), s.camera.isOrthographicCamera ? s.camera.getWorldDirection(s.eye).negate() : s.eye.copy(s.cameraPosition).sub(s.worldPosition).normalize(), super.updateMatrixWorld(e);
421
- }
422
- dispose() {
423
- this.traverse(function(e) {
424
- e.geometry && e.geometry.dispose(), e.material && e.material.dispose();
425
- });
426
- }
427
- }
428
- class ts extends Te {
429
- constructor() {
430
- super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
431
- const e = new bt({
432
- depthTest: !1,
433
- depthWrite: !1,
434
- fog: !1,
435
- toneMapped: !1,
436
- transparent: !0
437
- }), s = new It({
438
- depthTest: !1,
439
- depthWrite: !1,
440
- fog: !1,
441
- toneMapped: !1,
442
- transparent: !0
443
- }), i = e.clone();
444
- i.opacity = 0.15;
445
- const o = s.clone();
446
- o.opacity = 0.5;
447
- const r = e.clone();
448
- r.color.setHex(16711680);
449
- const n = e.clone();
450
- n.color.setHex(65280);
451
- const a = e.clone();
452
- a.color.setHex(255);
453
- const d = e.clone();
454
- d.color.setHex(16711680), d.opacity = 0.5;
455
- const g = e.clone();
456
- g.color.setHex(65280), g.opacity = 0.5;
457
- const b = e.clone();
458
- b.color.setHex(255), b.opacity = 0.5;
459
- const H = e.clone();
460
- H.opacity = 0.25;
461
- const T = e.clone();
462
- T.color.setHex(16776960), T.opacity = 0.25;
463
- const q = e.clone();
464
- q.color.setHex(16776960);
465
- const le = e.clone();
466
- le.color.setHex(7895160), this.materialLib = {
467
- xAxis: r,
468
- yAxis: n,
469
- zAxis: a,
470
- active: q,
471
- xAxisTransparent: d,
472
- yAxisTransparent: g,
473
- zAxisTransparent: b,
474
- activeTransparent: T
475
- };
476
- const k = new S(0, 0.04, 0.1, 12);
477
- k.translate(0, 0.05, 0);
478
- const Y = new M(0.08, 0.08, 0.08);
479
- Y.translate(0, 0.04, 0);
480
- const j = new Be();
481
- j.setAttribute("position", new Ke([0, 0, 0, 1, 0, 0], 3));
482
- const Z = new S(75e-4, 75e-4, 0.5, 3);
483
- Z.translate(0, 0.25, 0);
484
- function x(D, ce) {
485
- const A = new te(D, 75e-4, 3, 64, ce * Math.PI * 2);
486
- return A.rotateY(Math.PI / 2), A.rotateX(Math.PI / 2), A;
487
- }
488
- function Q() {
489
- const D = new Be();
490
- return D.setAttribute("position", new Ke([0, 0, 0, 1, 1, 1], 3)), D;
491
- }
492
- const B = {
493
- X: [
494
- [new h(k, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
495
- [new h(k, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
496
- [new h(Z, r), [0, 0, 0], [0, 0, -Math.PI / 2]]
497
- ],
498
- Y: [
499
- [new h(k, n), [0, 0.5, 0]],
500
- [new h(k, n), [0, -0.5, 0], [Math.PI, 0, 0]],
501
- [new h(Z, n)]
502
- ],
503
- Z: [
504
- [new h(k, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
505
- [new h(k, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
506
- [new h(Z, a), null, [Math.PI / 2, 0, 0]]
507
- ],
508
- XYZ: [
509
- [new h(new ue(0.1, 0), H), [0, 0, 0]]
510
- ],
511
- XY: [
512
- [new h(new M(0.15, 0.15, 0.01), b), [0.15, 0.15, 0]]
513
- ],
514
- YZ: [
515
- [new h(new M(0.15, 0.15, 0.01), d), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
516
- ],
517
- XZ: [
518
- [new h(new M(0.15, 0.15, 0.01), g), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
519
- ]
520
- }, U = {
521
- X: [
522
- [new h(new S(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
523
- [new h(new S(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
524
- ],
525
- Y: [
526
- [new h(new S(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
527
- [new h(new S(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
528
- ],
529
- Z: [
530
- [new h(new S(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
531
- [new h(new S(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
532
- ],
533
- XYZ: [
534
- [new h(new ue(0.2, 0), i)]
535
- ],
536
- XY: [
537
- [new h(new M(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
538
- ],
539
- YZ: [
540
- [new h(new M(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
541
- ],
542
- XZ: [
543
- [new h(new M(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
544
- ]
545
- }, St = {
546
- START: [
547
- [new h(new ue(0.01, 2), o), null, null, null, "helper"]
548
- ],
549
- END: [
550
- [new h(new ue(0.01, 2), o), null, null, null, "helper"]
551
- ],
552
- DELTA: [
553
- [new N(Q(), o), null, null, null, "helper"]
554
- ],
555
- X: [
556
- [new N(j, o), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
557
- ],
558
- Y: [
559
- [new N(j, o), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
560
- ],
561
- Z: [
562
- [new N(j, o), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
563
- ]
564
- }, Et = {
565
- XYZE: [
566
- [new h(x(0.5, 1), le), null, [0, Math.PI / 2, 0]]
567
- ],
568
- X: [
569
- [new h(x(0.5, 0.5), r)]
570
- ],
571
- Y: [
572
- [new h(x(0.5, 0.5), n), null, [0, 0, -Math.PI / 2]]
573
- ],
574
- Z: [
575
- [new h(x(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
576
- ],
577
- E: [
578
- [new h(x(0.75, 1), T), null, [0, Math.PI / 2, 0]]
579
- ]
580
- }, Tt = {
581
- AXIS: [
582
- [new N(j, o), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
583
- ]
584
- }, xt = {
585
- XYZE: [
586
- [new h(new jt(0.25, 10, 8), i)]
587
- ],
588
- X: [
589
- [new h(new te(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
590
- ],
591
- Y: [
592
- [new h(new te(0.5, 0.1, 4, 24), i), [0, 0, 0], [Math.PI / 2, 0, 0]]
593
- ],
594
- Z: [
595
- [new h(new te(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, 0, -Math.PI / 2]]
596
- ],
597
- E: [
598
- [new h(new te(0.75, 0.1, 2, 24), i)]
599
- ]
600
- }, Dt = {
601
- X: [
602
- [new h(Y, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
603
- [new h(Z, r), [0, 0, 0], [0, 0, -Math.PI / 2]],
604
- [new h(Y, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
605
- ],
606
- Y: [
607
- [new h(Y, n), [0, 0.5, 0]],
608
- [new h(Z, n)],
609
- [new h(Y, n), [0, -0.5, 0], [0, 0, Math.PI]]
610
- ],
611
- Z: [
612
- [new h(Y, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
613
- [new h(Z, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
614
- [new h(Y, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
615
- ],
616
- XY: [
617
- [new h(new M(0.15, 0.15, 0.01), b), [0.15, 0.15, 0]]
618
- ],
619
- YZ: [
620
- [new h(new M(0.15, 0.15, 0.01), d), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
621
- ],
622
- XZ: [
623
- [new h(new M(0.15, 0.15, 0.01), g), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
624
- ],
625
- XYZ: [
626
- [new h(new M(0.1, 0.1, 0.1), H)]
627
- ]
628
- }, Ot = {
629
- X: [
630
- [new h(new S(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
631
- [new h(new S(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
632
- ],
633
- Y: [
634
- [new h(new S(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
635
- [new h(new S(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
636
- ],
637
- Z: [
638
- [new h(new S(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
639
- [new h(new S(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
640
- ],
641
- XY: [
642
- [new h(new M(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
643
- ],
644
- YZ: [
645
- [new h(new M(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
646
- ],
647
- XZ: [
648
- [new h(new M(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
649
- ],
650
- XYZ: [
651
- [new h(new M(0.2, 0.2, 0.2), i), [0, 0, 0]]
652
- ]
653
- }, At = {
654
- X: [
655
- [new N(j, o), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
656
- ],
657
- Y: [
658
- [new N(j, o), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
659
- ],
660
- Z: [
661
- [new N(j, o), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
662
- ]
663
- };
664
- function X(D) {
665
- const ce = new Te();
666
- for (const A in D)
667
- for (let K = D[A].length; K--; ) {
668
- const P = D[A][K][0].clone(), de = D[A][K][1], pe = D[A][K][2], _e = D[A][K][3], Lt = D[A][K][4];
669
- P.name = A, P.tag = Lt, de && P.position.set(de[0], de[1], de[2]), pe && P.rotation.set(pe[0], pe[1], pe[2]), _e && P.scale.set(_e[0], _e[1], _e[2]), P.updateMatrix();
670
- const qe = P.geometry.clone();
671
- qe.applyMatrix4(P.matrix), P.geometry = qe, P.renderOrder = 1 / 0, P.position.set(0, 0, 0), P.rotation.set(0, 0, 0), P.scale.set(1, 1, 1), ce.add(P);
672
- }
673
- return ce;
674
- }
675
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = X(B)), this.add(this.gizmo.rotate = X(Et)), this.add(this.gizmo.scale = X(Dt)), this.add(this.picker.translate = X(U)), this.add(this.picker.rotate = X(xt)), this.add(this.picker.scale = X(Ot)), this.add(this.helper.translate = X(St)), this.add(this.helper.rotate = X(Tt)), this.add(this.helper.scale = X(At)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
676
- }
677
- // updateMatrixWorld will update transformations and appearance of individual handles
678
- updateMatrixWorld(e) {
679
- const i = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : we;
680
- this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
681
- let o = [];
682
- o = o.concat(this.picker[this.mode].children), o = o.concat(this.gizmo[this.mode].children), o = o.concat(this.helper[this.mode].children);
683
- for (let r = 0; r < o.length; r++) {
684
- const n = o[r];
685
- n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
686
- let a;
687
- if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), n.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), n.tag === "helper") {
688
- n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (m.setFromEuler(me.set(0, 0, 0)), n.quaternion.copy(i).multiply(m), Math.abs(_.copy(ne).applyQuaternion(i).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (m.setFromEuler(me.set(0, 0, Math.PI / 2)), n.quaternion.copy(i).multiply(m), Math.abs(_.copy($).applyQuaternion(i).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (m.setFromEuler(me.set(0, Math.PI / 2, 0)), n.quaternion.copy(i).multiply(m), Math.abs(_.copy(re).applyQuaternion(i).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (m.setFromEuler(me.set(0, Math.PI / 2, 0)), _.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(ot.lookAt(it, _, $)), n.quaternion.multiply(m), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), v.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), v.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(v), n.visible = this.dragging) : (n.quaternion.copy(i), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
689
- continue;
690
- }
691
- n.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(_.copy(ne).applyQuaternion(i).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(_.copy($).applyQuaternion(i).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(_.copy(re).applyQuaternion(i).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(_.copy(re).applyQuaternion(i).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(_.copy(ne).applyQuaternion(i).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(_.copy($).applyQuaternion(i).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (fe.copy(i), _.copy(this.eye).applyQuaternion(m.copy(i).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(ot.lookAt(this.eye, it, $)), n.name === "X" && (m.setFromAxisAngle(ne, Math.atan2(-_.y, _.z)), m.multiplyQuaternions(fe, m), n.quaternion.copy(m)), n.name === "Y" && (m.setFromAxisAngle($, Math.atan2(_.x, _.z)), m.multiplyQuaternions(fe, m), n.quaternion.copy(m)), n.name === "Z" && (m.setFromAxisAngle(re, Math.atan2(_.y, _.x)), m.multiplyQuaternions(fe, m), n.quaternion.copy(m))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis ? (n.material.color.copy(this.materialLib.active.color), n.material.opacity = 1) : this.axis.split("").some(function(d) {
692
- return n.name === d;
693
- }) && (n.material.color.copy(this.materialLib.active.color), n.material.opacity = 1));
694
- }
695
- super.updateMatrixWorld(e);
696
- }
697
- }
698
- class ss extends h {
699
- constructor() {
700
- super(
701
- new Ht(1e5, 1e5, 2, 2),
702
- new bt({ visible: !1, wireframe: !0, side: kt, transparent: !0, opacity: 0.1, toneMapped: !1 })
703
- ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
704
- }
705
- updateMatrixWorld(e) {
706
- let s = this.space;
707
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (s = "local"), ge.copy(ne).applyQuaternion(s === "local" ? this.worldQuaternion : we), se.copy($).applyQuaternion(s === "local" ? this.worldQuaternion : we), ie.copy(re).applyQuaternion(s === "local" ? this.worldQuaternion : we), _.copy(se), this.mode) {
708
- case "translate":
709
- case "scale":
710
- switch (this.axis) {
711
- case "X":
712
- _.copy(this.eye).cross(ge), R.copy(ge).cross(_);
713
- break;
714
- case "Y":
715
- _.copy(this.eye).cross(se), R.copy(se).cross(_);
716
- break;
717
- case "Z":
718
- _.copy(this.eye).cross(ie), R.copy(ie).cross(_);
719
- break;
720
- case "XY":
721
- R.copy(ie);
722
- break;
723
- case "YZ":
724
- R.copy(ge);
725
- break;
726
- case "XZ":
727
- _.copy(ie), R.copy(se);
728
- break;
729
- case "XYZ":
730
- case "E":
731
- R.set(0, 0, 0);
732
- break;
733
- }
734
- break;
735
- case "rotate":
736
- default:
737
- R.set(0, 0, 0);
738
- }
739
- R.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (nt.lookAt(v.set(0, 0, 0), R, _), this.quaternion.setFromRotationMatrix(nt)), super.updateMatrixWorld(e);
740
- }
741
- }
742
- var is = Object.getOwnPropertyDescriptor, os = (t, e, s, i) => {
743
- for (var o = i > 1 ? void 0 : i ? is(e, s) : e, r = t.length - 1, n; r >= 0; r--)
744
- (n = t[r]) && (o = n(o) || o);
745
- return o;
175
+ var Xe = Object.getOwnPropertyDescriptor, Ve = (t, e, s, i) => {
176
+ for (var r = i > 1 ? void 0 : i ? Xe(e, s) : e, o = t.length - 1, n; o >= 0; o--)
177
+ (n = t[o]) && (r = n(r) || r);
178
+ return r;
746
179
  };
747
- let xe = class {
180
+ let $ = class {
748
181
  _emitter;
749
182
  constructor() {
750
- this._emitter = new Ut();
183
+ this._emitter = new We();
751
184
  }
752
185
  /** Публикация события */
753
186
  emit(t, e) {
@@ -762,23 +195,28 @@ let xe = class {
762
195
  this._emitter.off(t, e);
763
196
  }
764
197
  };
765
- xe = os([
766
- w()
767
- ], xe);
768
- var ee = /* @__PURE__ */ ((t) => (t.SelectHover = "select.hover", t.SelectClick = "select.click", t.ToolSelect = "tool.select", t))(ee || {});
769
- const ns = 0.03, rs = 10;
770
- var as = Object.getOwnPropertyDescriptor, hs = (t, e, s, i) => {
771
- for (var o = i > 1 ? void 0 : i ? as(e, s) : e, r = t.length - 1, n; r >= 0; r--)
772
- (n = t[r]) && (o = n(o) || o);
773
- return o;
774
- }, rt = (t, e) => (s, i) => e(s, i, t);
775
- let De = class extends Mt {
198
+ $ = Ve([
199
+ u()
200
+ ], $);
201
+ var L = /* @__PURE__ */ ((t) => (t.SelectHover = "select.hover", t.SelectClick = "select.click", t.ToolSelect = "tool.select", t))(L || {});
202
+ const Ke = 0.03, Ge = 10;
203
+ var qe = Object.getOwnPropertyDescriptor, Qe = (t, e, s, i) => {
204
+ for (var r = i > 1 ? void 0 : i ? qe(e, s) : e, o = t.length - 1, n; o >= 0; o--)
205
+ (n = t[o]) && (r = n(r) || r);
206
+ return r;
207
+ }, ge = (t, e) => (s, i) => e(s, i, t);
208
+ let z = class extends Ce {
776
209
  constructor(t, e) {
777
210
  super(t), this._canvas = t, this._bus = e;
778
- const s = new l.GridHelper(10, 10);
211
+ const s = new a.GridHelper(10, 10);
779
212
  s.position.y = -1e-3, this.scene.add(s);
780
- const i = new Nt(6);
781
- this.scene.add(i), this._orbit = new Ft(this.camera, this.renderer.domElement), this._orbit.enableDamping = !0, this._orbit.dampingFactor = 0.05, this._raycaster = new l.Raycaster(), this._mouse = new l.Vector2(), this.scene.add(new l.HemisphereLight(16777215, 4473924, 0.6)), this.camera.layers.enable(0), this.camera.layers.enable(1), this._transform = new Gt(this.camera, this.renderer.domElement), this._transformHelper = this._transform.getHelper(), this.scene.add(this._transformHelper), this._isEventListenersAdded || this._initMouseListeners();
213
+ const i = new Ye(6);
214
+ this.scene.add(i), this._orbit = new Ue(this.camera, this.renderer.domElement), this._orbit.enableDamping = !0, this._orbit.dampingFactor = 0.05, this._cameraGizmo = new $e(this.renderer, this.camera, {
215
+ size: 96,
216
+ // Размер квадрата
217
+ margin: 36
218
+ // Отступы по сторонам (снизу и справа)
219
+ }), this._raycaster = new a.Raycaster(), this._mouse = new a.Vector2(), this.scene.add(new a.HemisphereLight(16777215, 4473924, 0.6)), this.camera.layers.enable(0), this.camera.layers.enable(1), this._transform = new ze(this.camera, this.renderer.domElement), this._transformHelper = this._transform.getHelper(), this.scene.add(this._transformHelper), this._isEventListenersAdded || this._initMouseListeners();
782
220
  }
783
221
  /** Orbit-контроллер для управления камерой */
784
222
  _orbit;
@@ -796,6 +234,8 @@ let De = class extends Mt {
796
234
  * необходима для отправки только уникальных событий в event bus
797
235
  */
798
236
  _lastHovered = null;
237
+ /** Gizmo для управления отображением perspective camera */
238
+ _cameraGizmo;
799
239
  /**
800
240
  * Обновление состояния рендерера.
801
241
  */
@@ -806,9 +246,9 @@ let De = class extends Mt {
806
246
  addFigure(t) {
807
247
  const e = super.addFigure(t);
808
248
  e.layers.enable(0);
809
- const s = new l.EdgesGeometry(e.geometry), i = new l.LineSegments(
249
+ const s = new a.EdgesGeometry(e.geometry), i = new a.LineSegments(
810
250
  s,
811
- new l.LineBasicMaterial({ color: 8947848, linewidth: 1 })
251
+ new a.LineBasicMaterial({ color: 8947848, linewidth: 1 })
812
252
  );
813
253
  return i.layers.set(1), e.add(i), e;
814
254
  }
@@ -842,15 +282,15 @@ let De = class extends Mt {
842
282
  setRaycastMode(t) {
843
283
  const e = this._raycaster;
844
284
  switch (e.params.Line.threshold = 0, e.params.Points.threshold = 0, t) {
845
- case I.Mesh:
846
- case I.Face:
285
+ case M.Mesh:
286
+ case M.Face:
847
287
  e.layers.set(0);
848
288
  break;
849
- case I.Edge:
850
- e.layers.set(1), e.params.Line.threshold = ns;
289
+ case M.Edge:
290
+ e.layers.set(1), e.params.Line.threshold = Ke;
851
291
  break;
852
- case I.Vertex:
853
- e.layers.set(2), e.params.Points.threshold = rs;
292
+ case M.Vertex:
293
+ e.layers.set(2), e.params.Points.threshold = Ge;
854
294
  break;
855
295
  }
856
296
  }
@@ -859,6 +299,9 @@ let De = class extends Mt {
859
299
  this._orbit.enabled = !this._transform.dragging;
860
300
  }), this._isEventListenersAdded = !1), this._orbit?.dispose(), this._transform?.dispose(), this._transformHelper?.parent && this._transformHelper.parent.remove(this._transformHelper), this._lastHovered = null, super.dispose();
861
301
  }
302
+ render() {
303
+ super.render(), this._cameraGizmo.render(this.canvas.width, this.canvas.height);
304
+ }
862
305
  /** Инициализация обработчиков событий на hover/click */
863
306
  _initMouseListeners() {
864
307
  this.canvas.addEventListener("mousemove", this._handleMouseMove, !1), this.canvas.addEventListener("click", this._handleMouseClick, !1), this.canvas.addEventListener("pointerdown", (t) => this._transform.pointerDown(t)), this.canvas.addEventListener("pointermove", (t) => this._transform.pointerMove(t)), this.canvas.addEventListener("pointerup", (t) => this._transform.pointerUp(t)), this.canvas.addEventListener("pointerleave", () => this._transform.pointerHover(null)), this._transform.addEventListener("dragging-changed", () => {
@@ -867,27 +310,27 @@ let De = class extends Mt {
867
310
  }
868
311
  /** Обработчик события для hover */
869
312
  _handleMouseMove = (t) => {
870
- this._processRaycastEvent(t, ee.SelectHover, !0);
313
+ this._processRaycastEvent(t, L.SelectHover, !0);
871
314
  };
872
315
  /** Обработчик события на click */
873
316
  _handleMouseClick = (t) => {
874
- this._processRaycastEvent(t, ee.SelectClick, !1);
317
+ this._processRaycastEvent(t, L.SelectClick, !1);
875
318
  };
876
319
  /** Вспомогательный метод для получения модели, которую выбрали и отправки события в event bus */
877
320
  _processRaycastEvent(t, e, s) {
878
321
  if (this._orbit.isInteracting || this._transform.dragging) return;
879
322
  const i = this._canvas.getBoundingClientRect();
880
323
  this._mouse.x = (t.clientX - i.left) / i.width * 2 - 1, this._mouse.y = -((t.clientY - i.top) / i.height) * 2 + 1, this._raycaster.setFromCamera(this._mouse, this.camera);
881
- const r = this._raycaster.intersectObjects(this.meshes, !0)[0] ?? null, n = r?.object ?? null;
882
- s ? n !== this._lastHovered && (this.meshes.forEach((a) => a.userData.isHit = !1), n && (n.userData.isHit = !0), this._lastHovered = n, this._bus.emit(e, r ? { intersection: r } : null)) : this._bus.emit(e, r ? { intersection: r } : null);
324
+ const o = this._raycaster.intersectObjects(this.meshes, !0)[0] ?? null, n = o?.object ?? null;
325
+ s ? n !== this._lastHovered && (this.meshes.forEach((c) => c.userData.isHit = !1), n && (n.userData.isHit = !0), this._lastHovered = n, this._bus.emit(e, o ? { intersection: o } : null)) : this._bus.emit(e, o ? { intersection: o } : null);
883
326
  }
884
327
  };
885
- De = hs([
886
- w(),
887
- rt(0, u("Canvas")),
888
- rt(1, u("EventBus"))
889
- ], De);
890
- const at = { type: "change" }, Ue = { type: "start" }, Pt = { type: "end" }, ye = new Yt(), ht = new Zt(), ls = Math.cos(70 * Xt.DEG2RAD), y = new c(), E = 2 * Math.PI, p = {
328
+ z = Qe([
329
+ u(),
330
+ ge(0, l("Canvas")),
331
+ ge(1, l("EventBus"))
332
+ ], z);
333
+ const be = { type: "change" }, oe = { type: "start" }, Ae = { type: "end" }, I = new Ie(), ve = new He(), Je = Math.cos(70 * ke.DEG2RAD), _ = new E(), m = 2 * Math.PI, h = {
891
334
  NONE: -1,
892
335
  ROTATE: 0,
893
336
  DOLLY: 1,
@@ -896,8 +339,8 @@ const at = { type: "change" }, Ue = { type: "start" }, Pt = { type: "end" }, ye
896
339
  TOUCH_PAN: 4,
897
340
  TOUCH_DOLLY_PAN: 5,
898
341
  TOUCH_DOLLY_ROTATE: 6
899
- }, Se = 1e-6;
900
- class cs extends yt {
342
+ }, Y = 1e-6;
343
+ class et extends xe {
901
344
  /**
902
345
  * Constructs a new controls instance.
903
346
  *
@@ -905,7 +348,7 @@ class cs extends yt {
905
348
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
906
349
  */
907
350
  constructor(e, s = null) {
908
- super(e, s), this.state = p.NONE, this.target = new c(), this.cursor = new c(), 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: J.ROTATE, MIDDLE: J.DOLLY, RIGHT: J.PAN }, this.touches = { ONE: V.ROTATE, TWO: V.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new c(), this._lastQuaternion = new O(), this._lastTargetPosition = new c(), this._quat = new O().setFromUnitVectors(e.up, new c(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ve(), this._sphericalDelta = new Ve(), this._scale = 1, this._panOffset = new c(), this._rotateStart = new L(), this._rotateEnd = new L(), this._rotateDelta = new L(), this._panStart = new L(), this._panEnd = new L(), this._panDelta = new L(), this._dollyStart = new L(), this._dollyEnd = new L(), this._dollyDelta = new L(), this._dollyDirection = new c(), this._mouse = new L(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ps.bind(this), this._onPointerDown = ds.bind(this), this._onPointerUp = _s.bind(this), this._onContextMenu = ws.bind(this), this._onMouseWheel = fs.bind(this), this._onKeyDown = gs.bind(this), this._onTouchStart = ys.bind(this), this._onTouchMove = bs.bind(this), this._onMouseDown = us.bind(this), this._onMouseMove = ms.bind(this), this._interceptControlDown = vs.bind(this), this._interceptControlUp = Ms.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
351
+ super(e, s), this.state = h.NONE, 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: T.ROTATE, MIDDLE: T.DOLLY, RIGHT: T.PAN }, this.touches = { ONE: D.ROTATE, TWO: D.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 me(), this._lastTargetPosition = new E(), this._quat = new me().setFromUnitVectors(e.up, new E(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new fe(), this._sphericalDelta = new fe(), this._scale = 1, this._panOffset = new E(), this._rotateStart = new v(), this._rotateEnd = new v(), this._rotateDelta = new v(), this._panStart = new v(), this._panEnd = new v(), this._panDelta = new v(), this._dollyStart = new v(), this._dollyEnd = new v(), this._dollyDelta = new v(), this._dollyDirection = new E(), this._mouse = new v(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = st.bind(this), this._onPointerDown = tt.bind(this), this._onPointerUp = it.bind(this), this._onContextMenu = ct.bind(this), this._onMouseWheel = nt.bind(this), this._onKeyDown = at.bind(this), this._onTouchStart = ht.bind(this), this._onTouchMove = lt.bind(this), this._onMouseDown = rt.bind(this), this._onMouseMove = ot.bind(this), this._interceptControlDown = dt.bind(this), this._interceptControlUp = _t.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
909
352
  }
910
353
  connect(e) {
911
354
  super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -966,45 +409,45 @@ class cs extends yt {
966
409
  * was called, or the initial state.
967
410
  */
968
411
  reset() {
969
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(at), this.update(), this.state = p.NONE;
412
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(be), this.update(), this.state = h.NONE;
970
413
  }
971
414
  update(e = null) {
972
415
  const s = this.object.position;
973
- y.copy(s).sub(this.target), y.applyQuaternion(this._quat), this._spherical.setFromVector3(y), this.autoRotate && this.state === p.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);
974
- let i = this.minAzimuthAngle, o = this.maxAzimuthAngle;
975
- isFinite(i) && isFinite(o) && (i < -Math.PI ? i += E : i > Math.PI && (i -= E), o < -Math.PI ? o += E : o > Math.PI && (o -= E), i <= o ? this._spherical.theta = Math.max(i, Math.min(o, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + o) / 2 ? Math.max(i, 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);
976
- let r = !1;
416
+ _.copy(s).sub(this.target), _.applyQuaternion(this._quat), this._spherical.setFromVector3(_), 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);
417
+ let i = this.minAzimuthAngle, r = this.maxAzimuthAngle;
418
+ isFinite(i) && isFinite(r) && (i < -Math.PI ? i += m : i > Math.PI && (i -= m), r < -Math.PI ? r += m : r > Math.PI && (r -= m), i <= r ? this._spherical.theta = Math.max(i, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + r) / 2 ? Math.max(i, this._spherical.theta) : Math.min(r, 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);
419
+ let o = !1;
977
420
  if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
978
421
  this._spherical.radius = this._clampDistance(this._spherical.radius);
979
422
  else {
980
423
  const n = this._spherical.radius;
981
- this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), r = n != this._spherical.radius;
424
+ this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), o = n != this._spherical.radius;
982
425
  }
983
- if (y.setFromSpherical(this._spherical), y.applyQuaternion(this._quatInverse), s.copy(this.target).add(y), 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) {
426
+ if (_.setFromSpherical(this._spherical), _.applyQuaternion(this._quatInverse), s.copy(this.target).add(_), 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) {
984
427
  let n = null;
985
428
  if (this.object.isPerspectiveCamera) {
986
- const a = y.length();
987
- n = this._clampDistance(a * this._scale);
988
- const d = a - n;
989
- this.object.position.addScaledVector(this._dollyDirection, d), this.object.updateMatrixWorld(), r = !!d;
429
+ const c = _.length();
430
+ n = this._clampDistance(c * this._scale);
431
+ const p = c - n;
432
+ this.object.position.addScaledVector(this._dollyDirection, p), this.object.updateMatrixWorld(), o = !!p;
990
433
  } else if (this.object.isOrthographicCamera) {
991
- const a = new c(this._mouse.x, this._mouse.y, 0);
992
- a.unproject(this.object);
993
- const d = this.object.zoom;
994
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), r = d !== this.object.zoom;
995
- const g = new c(this._mouse.x, this._mouse.y, 0);
996
- g.unproject(this.object), this.object.position.sub(g).add(a), this.object.updateMatrixWorld(), n = y.length();
434
+ const c = new E(this._mouse.x, this._mouse.y, 0);
435
+ c.unproject(this.object);
436
+ const p = this.object.zoom;
437
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), o = p !== this.object.zoom;
438
+ const f = new E(this._mouse.x, this._mouse.y, 0);
439
+ f.unproject(this.object), this.object.position.sub(f).add(c), this.object.updateMatrixWorld(), n = _.length();
997
440
  } else
998
441
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
999
- n !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position) : (ye.origin.copy(this.object.position), ye.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(ye.direction)) < ls ? this.object.lookAt(this.target) : (ht.setFromNormalAndCoplanarPoint(this.object.up, this.target), ye.intersectPlane(ht, this.target))));
442
+ n !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position) : (I.origin.copy(this.object.position), I.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(I.direction)) < Je ? this.object.lookAt(this.target) : (ve.setFromNormalAndCoplanarPoint(this.object.up, this.target), I.intersectPlane(ve, this.target))));
1000
443
  } else if (this.object.isOrthographicCamera) {
1001
444
  const n = this.object.zoom;
1002
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), n !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
445
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), n !== this.object.zoom && (this.object.updateProjectionMatrix(), o = !0);
1003
446
  }
1004
- return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > Se || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Se || this._lastTargetPosition.distanceToSquared(this.target) > Se ? (this.dispatchEvent(at), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
447
+ return this._scale = 1, this._performCursorZoom = !1, o || this._lastPosition.distanceToSquared(this.object.position) > Y || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Y || this._lastTargetPosition.distanceToSquared(this.target) > Y ? (this.dispatchEvent(be), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
1005
448
  }
1006
449
  _getAutoRotationAngle(e) {
1007
- return e !== null ? E / 60 * this.autoRotateSpeed * e : E / 60 / 60 * this.autoRotateSpeed;
450
+ return e !== null ? m / 60 * this.autoRotateSpeed * e : m / 60 / 60 * this.autoRotateSpeed;
1008
451
  }
1009
452
  _getZoomScale(e) {
1010
453
  const s = Math.abs(e * 0.01);
@@ -1017,19 +460,19 @@ class cs extends yt {
1017
460
  this._sphericalDelta.phi -= e;
1018
461
  }
1019
462
  _panLeft(e, s) {
1020
- y.setFromMatrixColumn(s, 0), y.multiplyScalar(-e), this._panOffset.add(y);
463
+ _.setFromMatrixColumn(s, 0), _.multiplyScalar(-e), this._panOffset.add(_);
1021
464
  }
1022
465
  _panUp(e, s) {
1023
- this.screenSpacePanning === !0 ? y.setFromMatrixColumn(s, 1) : (y.setFromMatrixColumn(s, 0), y.crossVectors(this.object.up, y)), y.multiplyScalar(e), this._panOffset.add(y);
466
+ this.screenSpacePanning === !0 ? _.setFromMatrixColumn(s, 1) : (_.setFromMatrixColumn(s, 0), _.crossVectors(this.object.up, _)), _.multiplyScalar(e), this._panOffset.add(_);
1024
467
  }
1025
468
  // deltaX and deltaY are in pixels; right and down are positive
1026
469
  _pan(e, s) {
1027
470
  const i = this.domElement;
1028
471
  if (this.object.isPerspectiveCamera) {
1029
- const o = this.object.position;
1030
- y.copy(o).sub(this.target);
1031
- let r = y.length();
1032
- r *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * r / i.clientHeight, this.object.matrix), this._panUp(2 * s * r / i.clientHeight, this.object.matrix);
472
+ const r = this.object.position;
473
+ _.copy(r).sub(this.target);
474
+ let o = _.length();
475
+ o *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * o / i.clientHeight, this.object.matrix), this._panUp(2 * s * o / i.clientHeight, this.object.matrix);
1033
476
  } else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / i.clientWidth, this.object.matrix), this._panUp(s * (this.object.top - this.object.bottom) / this.object.zoom / i.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
1034
477
  }
1035
478
  _dollyOut(e) {
@@ -1042,8 +485,8 @@ class cs extends yt {
1042
485
  if (!this.zoomToCursor)
1043
486
  return;
1044
487
  this._performCursorZoom = !0;
1045
- const i = this.domElement.getBoundingClientRect(), o = e - i.left, r = s - i.top, n = i.width, a = i.height;
1046
- this._mouse.x = o / n * 2 - 1, this._mouse.y = -(r / a) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
488
+ const i = this.domElement.getBoundingClientRect(), r = e - i.left, o = s - i.top, n = i.width, c = i.height;
489
+ this._mouse.x = r / n * 2 - 1, this._mouse.y = -(o / c) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
1047
490
  }
1048
491
  _clampDistance(e) {
1049
492
  return Math.max(this.minDistance, Math.min(this.maxDistance, e));
@@ -1063,7 +506,7 @@ class cs extends yt {
1063
506
  _handleMouseMoveRotate(e) {
1064
507
  this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
1065
508
  const s = this.domElement;
1066
- this._rotateLeft(E * this._rotateDelta.x / s.clientHeight), this._rotateUp(E * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
509
+ this._rotateLeft(m * this._rotateDelta.x / s.clientHeight), this._rotateUp(m * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
1067
510
  }
1068
511
  _handleMouseMoveDolly(e) {
1069
512
  this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
@@ -1078,16 +521,16 @@ class cs extends yt {
1078
521
  let s = !1;
1079
522
  switch (e.code) {
1080
523
  case this.keys.UP:
1081
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(E * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), s = !0;
524
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), s = !0;
1082
525
  break;
1083
526
  case this.keys.BOTTOM:
1084
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-E * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), s = !0;
527
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), s = !0;
1085
528
  break;
1086
529
  case this.keys.LEFT:
1087
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(E * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), s = !0;
530
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), s = !0;
1088
531
  break;
1089
532
  case this.keys.RIGHT:
1090
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-E * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), s = !0;
533
+ e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-m * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), s = !0;
1091
534
  break;
1092
535
  }
1093
536
  s && (e.preventDefault(), this.update());
@@ -1096,21 +539,21 @@ class cs extends yt {
1096
539
  if (this._pointers.length === 1)
1097
540
  this._rotateStart.set(e.pageX, e.pageY);
1098
541
  else {
1099
- const s = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + s.x), o = 0.5 * (e.pageY + s.y);
1100
- this._rotateStart.set(i, o);
542
+ const s = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + s.x), r = 0.5 * (e.pageY + s.y);
543
+ this._rotateStart.set(i, r);
1101
544
  }
1102
545
  }
1103
546
  _handleTouchStartPan(e) {
1104
547
  if (this._pointers.length === 1)
1105
548
  this._panStart.set(e.pageX, e.pageY);
1106
549
  else {
1107
- const s = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + s.x), o = 0.5 * (e.pageY + s.y);
1108
- this._panStart.set(i, o);
550
+ const s = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + s.x), r = 0.5 * (e.pageY + s.y);
551
+ this._panStart.set(i, r);
1109
552
  }
1110
553
  }
1111
554
  _handleTouchStartDolly(e) {
1112
- const s = this._getSecondPointerPosition(e), i = e.pageX - s.x, o = e.pageY - s.y, r = Math.sqrt(i * i + o * o);
1113
- this._dollyStart.set(0, r);
555
+ const s = this._getSecondPointerPosition(e), i = e.pageX - s.x, r = e.pageY - s.y, o = Math.sqrt(i * i + r * r);
556
+ this._dollyStart.set(0, o);
1114
557
  }
1115
558
  _handleTouchStartDollyPan(e) {
1116
559
  this.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);
@@ -1122,27 +565,27 @@ class cs extends yt {
1122
565
  if (this._pointers.length == 1)
1123
566
  this._rotateEnd.set(e.pageX, e.pageY);
1124
567
  else {
1125
- const i = this._getSecondPointerPosition(e), o = 0.5 * (e.pageX + i.x), r = 0.5 * (e.pageY + i.y);
1126
- this._rotateEnd.set(o, r);
568
+ const i = this._getSecondPointerPosition(e), r = 0.5 * (e.pageX + i.x), o = 0.5 * (e.pageY + i.y);
569
+ this._rotateEnd.set(r, o);
1127
570
  }
1128
571
  this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
1129
572
  const s = this.domElement;
1130
- this._rotateLeft(E * this._rotateDelta.x / s.clientHeight), this._rotateUp(E * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd);
573
+ this._rotateLeft(m * this._rotateDelta.x / s.clientHeight), this._rotateUp(m * this._rotateDelta.y / s.clientHeight), this._rotateStart.copy(this._rotateEnd);
1131
574
  }
1132
575
  _handleTouchMovePan(e) {
1133
576
  if (this._pointers.length === 1)
1134
577
  this._panEnd.set(e.pageX, e.pageY);
1135
578
  else {
1136
- const s = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + s.x), o = 0.5 * (e.pageY + s.y);
1137
- this._panEnd.set(i, o);
579
+ const s = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + s.x), r = 0.5 * (e.pageY + s.y);
580
+ this._panEnd.set(i, r);
1138
581
  }
1139
582
  this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
1140
583
  }
1141
584
  _handleTouchMoveDolly(e) {
1142
- const s = this._getSecondPointerPosition(e), i = e.pageX - s.x, o = e.pageY - s.y, r = Math.sqrt(i * i + o * o);
1143
- this._dollyEnd.set(0, r), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
1144
- const n = (e.pageX + s.x) * 0.5, a = (e.pageY + s.y) * 0.5;
1145
- this._updateZoomParameters(n, a);
585
+ const s = this._getSecondPointerPosition(e), i = e.pageX - s.x, r = e.pageY - s.y, o = Math.sqrt(i * i + r * r);
586
+ this._dollyEnd.set(0, o), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
587
+ const n = (e.pageX + s.x) * 0.5, c = (e.pageY + s.y) * 0.5;
588
+ this._updateZoomParameters(n, c);
1146
589
  }
1147
590
  _handleTouchMoveDollyPan(e) {
1148
591
  this.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);
@@ -1169,7 +612,7 @@ class cs extends yt {
1169
612
  }
1170
613
  _trackPointer(e) {
1171
614
  let s = this._pointerPositions[e.pointerId];
1172
- s === void 0 && (s = new L(), this._pointerPositions[e.pointerId] = s), s.set(e.pageX, e.pageY);
615
+ s === void 0 && (s = new v(), this._pointerPositions[e.pointerId] = s), s.set(e.pageX, e.pageY);
1173
616
  }
1174
617
  _getSecondPointerPosition(e) {
1175
618
  const s = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
@@ -1193,16 +636,16 @@ class cs extends yt {
1193
636
  return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
1194
637
  }
1195
638
  }
1196
- function ds(t) {
639
+ function tt(t) {
1197
640
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(t.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(t) && (this._addPointer(t), t.pointerType === "touch" ? this._onTouchStart(t) : this._onMouseDown(t)));
1198
641
  }
1199
- function ps(t) {
642
+ function st(t) {
1200
643
  this.enabled !== !1 && (t.pointerType === "touch" ? this._onTouchMove(t) : this._onMouseMove(t));
1201
644
  }
1202
- function _s(t) {
645
+ function it(t) {
1203
646
  switch (this._removePointer(t), this._pointers.length) {
1204
647
  case 0:
1205
- this.domElement.releasePointerCapture(t.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Pt), this.state = p.NONE;
648
+ this.domElement.releasePointerCapture(t.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Ae), this.state = h.NONE;
1206
649
  break;
1207
650
  case 1:
1208
651
  const e = this._pointers[0], s = this._pointerPositions[e];
@@ -1210,7 +653,7 @@ function _s(t) {
1210
653
  break;
1211
654
  }
1212
655
  }
1213
- function us(t) {
656
+ function rt(t) {
1214
657
  let e;
1215
658
  switch (t.button) {
1216
659
  case 0:
@@ -1226,126 +669,126 @@ function us(t) {
1226
669
  e = -1;
1227
670
  }
1228
671
  switch (e) {
1229
- case J.DOLLY:
672
+ case T.DOLLY:
1230
673
  if (this.enableZoom === !1) return;
1231
- this._handleMouseDownDolly(t), this.state = p.DOLLY;
674
+ this._handleMouseDownDolly(t), this.state = h.DOLLY;
1232
675
  break;
1233
- case J.ROTATE:
676
+ case T.ROTATE:
1234
677
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
1235
678
  if (this.enablePan === !1) return;
1236
- this._handleMouseDownPan(t), this.state = p.PAN;
679
+ this._handleMouseDownPan(t), this.state = h.PAN;
1237
680
  } else {
1238
681
  if (this.enableRotate === !1) return;
1239
- this._handleMouseDownRotate(t), this.state = p.ROTATE;
682
+ this._handleMouseDownRotate(t), this.state = h.ROTATE;
1240
683
  }
1241
684
  break;
1242
- case J.PAN:
685
+ case T.PAN:
1243
686
  if (t.ctrlKey || t.metaKey || t.shiftKey) {
1244
687
  if (this.enableRotate === !1) return;
1245
- this._handleMouseDownRotate(t), this.state = p.ROTATE;
688
+ this._handleMouseDownRotate(t), this.state = h.ROTATE;
1246
689
  } else {
1247
690
  if (this.enablePan === !1) return;
1248
- this._handleMouseDownPan(t), this.state = p.PAN;
691
+ this._handleMouseDownPan(t), this.state = h.PAN;
1249
692
  }
1250
693
  break;
1251
694
  default:
1252
- this.state = p.NONE;
695
+ this.state = h.NONE;
1253
696
  }
1254
- this.state !== p.NONE && this.dispatchEvent(Ue);
697
+ this.state !== h.NONE && this.dispatchEvent(oe);
1255
698
  }
1256
- function ms(t) {
699
+ function ot(t) {
1257
700
  switch (this.state) {
1258
- case p.ROTATE:
701
+ case h.ROTATE:
1259
702
  if (this.enableRotate === !1) return;
1260
703
  this._handleMouseMoveRotate(t);
1261
704
  break;
1262
- case p.DOLLY:
705
+ case h.DOLLY:
1263
706
  if (this.enableZoom === !1) return;
1264
707
  this._handleMouseMoveDolly(t);
1265
708
  break;
1266
- case p.PAN:
709
+ case h.PAN:
1267
710
  if (this.enablePan === !1) return;
1268
711
  this._handleMouseMovePan(t);
1269
712
  break;
1270
713
  }
1271
714
  }
1272
- function fs(t) {
1273
- this.enabled === !1 || this.enableZoom === !1 || this.state !== p.NONE || (t.preventDefault(), this.dispatchEvent(Ue), this._handleMouseWheel(this._customWheelEvent(t)), this.dispatchEvent(Pt));
715
+ function nt(t) {
716
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== h.NONE || (t.preventDefault(), this.dispatchEvent(oe), this._handleMouseWheel(this._customWheelEvent(t)), this.dispatchEvent(Ae));
1274
717
  }
1275
- function gs(t) {
718
+ function at(t) {
1276
719
  this.enabled !== !1 && this._handleKeyDown(t);
1277
720
  }
1278
- function ys(t) {
721
+ function ht(t) {
1279
722
  switch (this._trackPointer(t), this._pointers.length) {
1280
723
  case 1:
1281
724
  switch (this.touches.ONE) {
1282
- case V.ROTATE:
725
+ case D.ROTATE:
1283
726
  if (this.enableRotate === !1) return;
1284
- this._handleTouchStartRotate(t), this.state = p.TOUCH_ROTATE;
727
+ this._handleTouchStartRotate(t), this.state = h.TOUCH_ROTATE;
1285
728
  break;
1286
- case V.PAN:
729
+ case D.PAN:
1287
730
  if (this.enablePan === !1) return;
1288
- this._handleTouchStartPan(t), this.state = p.TOUCH_PAN;
731
+ this._handleTouchStartPan(t), this.state = h.TOUCH_PAN;
1289
732
  break;
1290
733
  default:
1291
- this.state = p.NONE;
734
+ this.state = h.NONE;
1292
735
  }
1293
736
  break;
1294
737
  case 2:
1295
738
  switch (this.touches.TWO) {
1296
- case V.DOLLY_PAN:
739
+ case D.DOLLY_PAN:
1297
740
  if (this.enableZoom === !1 && this.enablePan === !1) return;
1298
- this._handleTouchStartDollyPan(t), this.state = p.TOUCH_DOLLY_PAN;
741
+ this._handleTouchStartDollyPan(t), this.state = h.TOUCH_DOLLY_PAN;
1299
742
  break;
1300
- case V.DOLLY_ROTATE:
743
+ case D.DOLLY_ROTATE:
1301
744
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
1302
- this._handleTouchStartDollyRotate(t), this.state = p.TOUCH_DOLLY_ROTATE;
745
+ this._handleTouchStartDollyRotate(t), this.state = h.TOUCH_DOLLY_ROTATE;
1303
746
  break;
1304
747
  default:
1305
- this.state = p.NONE;
748
+ this.state = h.NONE;
1306
749
  }
1307
750
  break;
1308
751
  default:
1309
- this.state = p.NONE;
752
+ this.state = h.NONE;
1310
753
  }
1311
- this.state !== p.NONE && this.dispatchEvent(Ue);
754
+ this.state !== h.NONE && this.dispatchEvent(oe);
1312
755
  }
1313
- function bs(t) {
756
+ function lt(t) {
1314
757
  switch (this._trackPointer(t), this.state) {
1315
- case p.TOUCH_ROTATE:
758
+ case h.TOUCH_ROTATE:
1316
759
  if (this.enableRotate === !1) return;
1317
760
  this._handleTouchMoveRotate(t), this.update();
1318
761
  break;
1319
- case p.TOUCH_PAN:
762
+ case h.TOUCH_PAN:
1320
763
  if (this.enablePan === !1) return;
1321
764
  this._handleTouchMovePan(t), this.update();
1322
765
  break;
1323
- case p.TOUCH_DOLLY_PAN:
766
+ case h.TOUCH_DOLLY_PAN:
1324
767
  if (this.enableZoom === !1 && this.enablePan === !1) return;
1325
768
  this._handleTouchMoveDollyPan(t), this.update();
1326
769
  break;
1327
- case p.TOUCH_DOLLY_ROTATE:
770
+ case h.TOUCH_DOLLY_ROTATE:
1328
771
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
1329
772
  this._handleTouchMoveDollyRotate(t), this.update();
1330
773
  break;
1331
774
  default:
1332
- this.state = p.NONE;
775
+ this.state = h.NONE;
1333
776
  }
1334
777
  }
1335
- function ws(t) {
778
+ function ct(t) {
1336
779
  this.enabled !== !1 && t.preventDefault();
1337
780
  }
1338
- function vs(t) {
781
+ function dt(t) {
1339
782
  t.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
1340
783
  }
1341
- function Ms(t) {
784
+ function _t(t) {
1342
785
  t.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
1343
786
  }
1344
- class fi extends Mt {
787
+ class ns extends Ce {
1345
788
  /** Orbit-контроллер для управления камерой */
1346
789
  _orbit;
1347
790
  constructor(e) {
1348
- super(e), this.camera.position.set(1, 1, 7), this.camera.lookAt(0, 0, 0), this._orbit = new cs(this.camera, this.canvas), this._orbit.target.set(0, 0, 0), this._orbit.minPolarAngle = Math.PI / 2, this._orbit.maxPolarAngle = Math.PI / 2, this._orbit.enableRotate = !0, this._orbit.enableZoom = !1, this._orbit.enablePan = !1;
791
+ super(e), this.camera.position.set(1, 1, 7), this.camera.lookAt(0, 0, 0), this._orbit = new et(this.camera, this.canvas), this._orbit.target.set(0, 0, 0), this._orbit.minPolarAngle = Math.PI / 2, this._orbit.maxPolarAngle = Math.PI / 2, this._orbit.enableRotate = !0, this._orbit.enableZoom = !1, this._orbit.enablePan = !1;
1349
792
  }
1350
793
  /**
1351
794
  * Обновление состояния рендерера.
@@ -1354,7 +797,7 @@ class fi extends Mt {
1354
797
  this._orbit?.update();
1355
798
  }
1356
799
  }
1357
- class gi {
800
+ class as {
1358
801
  /** Позиции вершин */
1359
802
  _positions = [];
1360
803
  /** Нормали вершин */
@@ -1372,31 +815,31 @@ class gi {
1372
815
  load(e) {
1373
816
  const s = e.split(`
1374
817
  `);
1375
- for (const o of s) {
1376
- if (!o.trim() || o.startsWith("#")) continue;
1377
- const r = o.trim().split(/\s+/);
1378
- switch (r[0]) {
818
+ for (const r of s) {
819
+ if (!r.trim() || r.startsWith("#")) continue;
820
+ const o = r.trim().split(/\s+/);
821
+ switch (o[0]) {
1379
822
  case "v":
1380
- this._tmpPositions.push(r.slice(1).map(Number));
823
+ this._tmpPositions.push(o.slice(1).map(Number));
1381
824
  break;
1382
825
  case "vn":
1383
- this._tmpNormals.push(r.slice(1).map(Number));
826
+ this._tmpNormals.push(o.slice(1).map(Number));
1384
827
  break;
1385
828
  case "vt":
1386
- this._tmpUVs.push(r.slice(1).map(Number));
829
+ this._tmpUVs.push(o.slice(1).map(Number));
1387
830
  break;
1388
831
  case "f":
1389
- this.processFaceLine(r);
832
+ this.processFaceLine(o);
1390
833
  break;
1391
834
  }
1392
835
  }
1393
836
  const i = {
1394
- type: C.Custom,
837
+ type: y.Custom,
1395
838
  position: this._positions,
1396
839
  ...this._normals.length > 0 && { normal: this._normals },
1397
840
  ...this._uvs.length > 0 && { uv: this._uvs }
1398
841
  };
1399
- return new zt(i);
842
+ return new Ne(i);
1400
843
  }
1401
844
  /**
1402
845
  * Обрабатывает строку face (f) и разворачивает индексы в массивы для рендеринга
@@ -1405,60 +848,60 @@ class gi {
1405
848
  for (let s = 1; s < e.length; s++) {
1406
849
  const i = e[s];
1407
850
  if (!i) continue;
1408
- const [o, r, n] = i.split("/"), a = o ? parseInt(o, 10) : void 0, d = r ? parseInt(r, 10) : void 0, g = n ? parseInt(n, 10) : void 0;
1409
- if (a !== void 0) {
1410
- const b = this._tmpPositions[a - 1];
1411
- b && this._positions.push(...b);
851
+ const [r, o, n] = i.split("/"), c = r ? parseInt(r, 10) : void 0, p = o ? parseInt(o, 10) : void 0, f = n ? parseInt(n, 10) : void 0;
852
+ if (c !== void 0) {
853
+ const g = this._tmpPositions[c - 1];
854
+ g && this._positions.push(...g);
1412
855
  }
1413
- if (d !== void 0) {
1414
- const b = this._tmpUVs[d - 1];
1415
- b && this._uvs.push(...b);
856
+ if (p !== void 0) {
857
+ const g = this._tmpUVs[p - 1];
858
+ g && this._uvs.push(...g);
1416
859
  }
1417
- if (g !== void 0) {
1418
- const b = this._tmpNormals[g - 1];
1419
- b && this._normals.push(...b);
860
+ if (f !== void 0) {
861
+ const g = this._tmpNormals[f - 1];
862
+ g && this._normals.push(...g);
1420
863
  }
1421
864
  }
1422
865
  }
1423
866
  }
1424
- var Ps = Object.getOwnPropertyDescriptor, Ss = (t, e, s, i) => {
1425
- for (var o = i > 1 ? void 0 : i ? Ps(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1426
- (n = t[r]) && (o = n(o) || o);
1427
- return o;
1428
- }, lt = (t, e) => (s, i) => e(s, i, t);
1429
- let Oe = class {
867
+ var pt = Object.getOwnPropertyDescriptor, ut = (t, e, s, i) => {
868
+ for (var r = i > 1 ? void 0 : i ? pt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
869
+ (n = t[o]) && (r = n(r) || r);
870
+ return r;
871
+ }, ye = (t, e) => (s, i) => e(s, i, t);
872
+ let F = class {
1430
873
  constructor(t, e) {
1431
874
  this._store = e, this._handlers = new Map(t.map((s) => [s.mode, s]));
1432
875
  }
1433
876
  /** Текущий режим отображения */
1434
- _currentMode = ae.Plane;
877
+ _currentMode = R.Plane;
1435
878
  /** Хендлеры, которые управляют отображением */
1436
879
  _handlers;
1437
880
  /** Установка режима отображения */
1438
881
  manage(t) {
1439
- t !== this._currentMode && (this._handlers.get(this._currentMode)?.rollback(), t !== ae.Plane && this._handlers.get(t)?.handle(), this._currentMode = t, this._store.setDisplayMode(this._currentMode));
882
+ t !== this._currentMode && (this._handlers.get(this._currentMode)?.rollback(), t !== R.Plane && this._handlers.get(t)?.handle(), this._currentMode = t, this._store.setDisplayMode(this._currentMode));
1440
883
  }
1441
884
  /** Освобождает ресурсы менеджера. */
1442
885
  dispose() {
1443
- this._handlers && this._handlers.clear(), this._currentMode = ae.Plane, this._store.setDisplayMode(this._currentMode);
886
+ this._handlers && this._handlers.clear(), this._currentMode = R.Plane, this._store.setDisplayMode(this._currentMode);
1444
887
  }
1445
888
  };
1446
- Oe = Ss([
1447
- w(),
1448
- lt(0, ve("IDisplayHandler")),
1449
- lt(1, u("IEditorStore"))
1450
- ], Oe);
1451
- var z = /* @__PURE__ */ ((t) => (t.Hover = "hover", t.Click = "click", t))(z || {}), Es = Object.getOwnPropertyDescriptor, Ts = (t, e, s, i) => {
1452
- for (var o = i > 1 ? void 0 : i ? Es(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1453
- (n = t[r]) && (o = n(o) || o);
1454
- return o;
1455
- }, Ee = (t, e) => (s, i) => e(s, i, t);
1456
- let Ae = class {
889
+ F = ut([
890
+ u(),
891
+ ye(0, k("IDisplayHandler")),
892
+ ye(1, l("IEditorStore"))
893
+ ], F);
894
+ var S = /* @__PURE__ */ ((t) => (t.Hover = "hover", t.Click = "click", t))(S || {}), mt = Object.getOwnPropertyDescriptor, ft = (t, e, s, i) => {
895
+ for (var r = i > 1 ? void 0 : i ? mt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
896
+ (n = t[o]) && (r = n(r) || r);
897
+ return r;
898
+ }, U = (t, e) => (s, i) => e(s, i, t);
899
+ let W = class {
1457
900
  constructor(t, e, s) {
1458
- this._eventBus = t, this._store = s, this._handlers = new Map(e.map((i) => [i.mode, i])), this._eventBus.on(ee.SelectHover, this._onHover), this._eventBus.on(ee.SelectClick, this._onClick);
901
+ this._eventBus = t, this._store = s, this._handlers = new Map(e.map((i) => [i.mode, i])), this._eventBus.on(L.SelectHover, this._onHover), this._eventBus.on(L.SelectClick, this._onClick);
1459
902
  }
1460
903
  /** Текущий режим выборки */
1461
- _currentMode = I.Mesh;
904
+ _currentMode = M.Mesh;
1462
905
  /** Хендлеры, которые управляют выборкой */
1463
906
  _handlers;
1464
907
  /** Переключает режим выбора */
@@ -1467,36 +910,36 @@ let Ae = class {
1467
910
  }
1468
911
  /** Обработчик события наведения на модель */
1469
912
  _onHover = (t) => {
1470
- this._handlers.get(this._currentMode)?.handle(t, z.Hover);
913
+ this._handlers.get(this._currentMode)?.handle(t, S.Hover);
1471
914
  };
1472
915
  /** Обработчик события клика на модель */
1473
916
  _onClick = (t) => {
1474
- this._handlers.get(this._currentMode)?.handle(t, z.Click);
917
+ this._handlers.get(this._currentMode)?.handle(t, S.Click);
1475
918
  };
1476
919
  /** Освобождает ресурсы менеджера. */
1477
920
  dispose() {
1478
- this._handlers && this._handlers.clear(), this._eventBus.off(ee.SelectHover, this._onHover), this._currentMode = I.Mesh, this._store.setSelectMode(this._currentMode);
921
+ this._handlers && this._handlers.clear(), this._eventBus.off(L.SelectHover, this._onHover), this._currentMode = M.Mesh, this._store.setSelectMode(this._currentMode);
1479
922
  }
1480
923
  };
1481
- Ae = Ts([
1482
- w(),
1483
- Ee(0, u("EventBus")),
1484
- Ee(1, ve("ISelectHandler")),
1485
- Ee(2, u("IEditorStore"))
1486
- ], Ae);
1487
- var xs = Object.getOwnPropertyDescriptor, Ds = (t, e, s, i) => {
1488
- for (var o = i > 1 ? void 0 : i ? xs(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1489
- (n = t[r]) && (o = n(o) || o);
1490
- return o;
1491
- }, ct = (t, e) => (s, i) => e(s, i, t);
1492
- let Le = class {
924
+ W = ft([
925
+ u(),
926
+ U(0, l("EventBus")),
927
+ U(1, k("ISelectHandler")),
928
+ U(2, l("IEditorStore"))
929
+ ], W);
930
+ var gt = Object.getOwnPropertyDescriptor, bt = (t, e, s, i) => {
931
+ for (var r = i > 1 ? void 0 : i ? gt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
932
+ (n = t[o]) && (r = n(r) || r);
933
+ return r;
934
+ }, Me = (t, e) => (s, i) => e(s, i, t);
935
+ let Z = class {
1493
936
  constructor(t, e) {
1494
937
  this._store = e, this._handlers = new Map(t.map((s) => [s.mode, s])), this._unsubSelected = this._store.onSelectedObjectChange(() => {
1495
938
  this._handlers.get(this._currentTool)?.handle();
1496
939
  });
1497
940
  }
1498
941
  /** Текущий выбранный инструмент */
1499
- _currentTool = G.Translate;
942
+ _currentTool = O.Translate;
1500
943
  /** Хендлеры, которые управляют инструментами */
1501
944
  _handlers;
1502
945
  _unsubSelected;
@@ -1505,22 +948,22 @@ let Le = class {
1505
948
  }
1506
949
  /** Освобождает ресурсы менеджера. */
1507
950
  dispose() {
1508
- this._unsubSelected?.(), this._handlers && this._handlers.clear(), this._currentTool = G.Translate, this._store.setToolType(this._currentTool);
951
+ this._unsubSelected?.(), this._handlers && this._handlers.clear(), this._currentTool = O.Translate, this._store.setToolType(this._currentTool);
1509
952
  }
1510
953
  };
1511
- Le = Ds([
1512
- w(),
1513
- ct(0, ve("IToolHandler")),
1514
- ct(1, u("IEditorStore"))
1515
- ], Le);
1516
- var Os = Object.getOwnPropertyDescriptor, As = (t, e, s, i) => {
1517
- for (var o = i > 1 ? void 0 : i ? Os(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1518
- (n = t[r]) && (o = n(o) || o);
1519
- return o;
1520
- }, Ls = (t, e) => (s, i) => e(s, i, t);
1521
- let Ce = class {
954
+ Z = bt([
955
+ u(),
956
+ Me(0, k("IToolHandler")),
957
+ Me(1, l("IEditorStore"))
958
+ ], Z);
959
+ var vt = Object.getOwnPropertyDescriptor, yt = (t, e, s, i) => {
960
+ for (var r = i > 1 ? void 0 : i ? vt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
961
+ (n = t[o]) && (r = n(r) || r);
962
+ return r;
963
+ }, Mt = (t, e) => (s, i) => e(s, i, t);
964
+ let B = class {
1522
965
  /** Текущий режим редактирования сцены */
1523
- _currentMode = he.AddFigure;
966
+ _currentMode = j.AddFigure;
1524
967
  /** Хендлеры, которые управляют отображением */
1525
968
  _handlers;
1526
969
  constructor(t) {
@@ -1528,35 +971,35 @@ let Ce = class {
1528
971
  }
1529
972
  /** Установка режима редактирования сцены */
1530
973
  manage(t, e) {
1531
- console.log("manage", t), t === he.AddFigure ? this._handlers.get(t)?.handle(e) : this._handlers.get(t)?.handle(), this._currentMode = t;
974
+ console.log("manage", t), t === j.AddFigure ? this._handlers.get(t)?.handle(e) : this._handlers.get(t)?.handle(), this._currentMode = t;
1532
975
  }
1533
976
  /** Освобождает ресурсы менеджера. */
1534
977
  dispose() {
1535
- this._handlers && this._handlers.clear(), this._currentMode = he.AddFigure;
978
+ this._handlers && this._handlers.clear(), this._currentMode = j.AddFigure;
1536
979
  }
1537
980
  };
1538
- Ce = As([
1539
- w(),
1540
- Ls(0, ve("ISceneHandler"))
1541
- ], Ce);
1542
- var Cs = Object.getOwnPropertyDescriptor, Is = (t, e, s, i) => {
1543
- for (var o = i > 1 ? void 0 : i ? Cs(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1544
- (n = t[r]) && (o = n(o) || o);
1545
- return o;
1546
- }, js = (t, e) => (s, i) => e(s, i, t);
1547
- let Ie = class {
981
+ B = yt([
982
+ u(),
983
+ Mt(0, k("ISceneHandler"))
984
+ ], B);
985
+ var Et = Object.getOwnPropertyDescriptor, wt = (t, e, s, i) => {
986
+ for (var r = i > 1 ? void 0 : i ? Et(e, s) : e, o = t.length - 1, n; o >= 0; o--)
987
+ (n = t[o]) && (r = n(r) || r);
988
+ return r;
989
+ }, St = (t, e) => (s, i) => e(s, i, t);
990
+ let X = class {
1548
991
  constructor(t) {
1549
992
  this._api = t;
1550
993
  }
1551
994
  /** Режим отображения. */
1552
- mode = ae.Wireframe;
995
+ mode = R.Wireframe;
1553
996
  /** Сохраняем предыдущие значения wireframe для отката. */
1554
997
  _prevWireframe = /* @__PURE__ */ new Map();
1555
998
  /** Сохраняем исходные цвета материалов для отката */
1556
999
  _prevColorMesh = /* @__PURE__ */ new Map();
1557
1000
  _prevColorLines = /* @__PURE__ */ new Map();
1558
1001
  /** Цвет ребер для wireframe-режима. */
1559
- _wireColor = new l.Color(65535);
1002
+ _wireColor = new a.Color(65535);
1560
1003
  /** Применяет wireframe-режим к сцене. */
1561
1004
  handle() {
1562
1005
  const t = this._api.getMeshes();
@@ -1565,13 +1008,13 @@ let Ie = class {
1565
1008
  for (const i of s) this._enableWireframeOnMaterial(i);
1566
1009
  e.traverse((i) => {
1567
1010
  if (i.isLineSegments) {
1568
- const o = i;
1569
- if (!this._prevColorLines.has(o.material)) {
1570
- const n = o.material;
1011
+ const r = i;
1012
+ if (!this._prevColorLines.has(r.material)) {
1013
+ const n = r.material;
1571
1014
  this._prevColorLines.set(n, n.color.clone());
1572
1015
  }
1573
- const r = o.material;
1574
- r.color.copy(this._wireColor), r.needsUpdate = !0;
1016
+ const o = r.material;
1017
+ o.color.copy(this._wireColor), o.needsUpdate = !0;
1575
1018
  }
1576
1019
  });
1577
1020
  }
@@ -1600,35 +1043,35 @@ let Ie = class {
1600
1043
  "wireframe" in e && !this._prevWireframe.has(t) && (this._prevWireframe.set(t, !!e.wireframe), e.wireframe = !0, t.needsUpdate = !0), e.color?.isColor && (this._prevColorMesh.has(t) || this._prevColorMesh.set(t, e.color.clone()), e.color.copy(this._wireColor));
1601
1044
  }
1602
1045
  };
1603
- Ie = Is([
1604
- w(),
1605
- js(0, u("RendererApi"))
1606
- ], Ie);
1607
- const We = 16776960, $e = 16755200, Rs = 2236962;
1608
- var Hs = Object.getOwnPropertyDescriptor, ks = (t, e, s, i) => {
1609
- for (var o = i > 1 ? void 0 : i ? Hs(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1610
- (n = t[r]) && (o = n(o) || o);
1611
- return o;
1612
- }, dt = (t, e) => (s, i) => e(s, i, t);
1613
- let je = class {
1046
+ X = wt([
1047
+ u(),
1048
+ St(0, l("RendererApi"))
1049
+ ], X);
1050
+ const ne = 16776960, ae = 16755200, Pt = 2236962;
1051
+ var Ot = Object.getOwnPropertyDescriptor, Dt = (t, e, s, i) => {
1052
+ for (var r = i > 1 ? void 0 : i ? Ot(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1053
+ (n = t[o]) && (r = n(r) || r);
1054
+ return r;
1055
+ }, Ee = (t, e) => (s, i) => e(s, i, t);
1056
+ let V = class {
1614
1057
  constructor(t, e) {
1615
1058
  this._api = t, this._store = e;
1616
1059
  }
1617
1060
  /** Режим, которым управляет хендлер, нужен только менеджеру */
1618
- mode = I.Mesh;
1061
+ mode = M.Mesh;
1619
1062
  /** Фигура, на которую навелись в данный момент */
1620
1063
  _hoveredMesh = null;
1621
1064
  /** Фигура, которую выбрали в данный момент */
1622
1065
  _selectedMesh = null;
1623
1066
  // Цвета, необходимые для переключения
1624
1067
  /** Цвет ребер для фигуры, на которую навелись */
1625
- _hoverColor = We;
1068
+ _hoverColor = ne;
1626
1069
  /** Цвет ребер для выделенной фигуры */
1627
- _selectColor = $e;
1070
+ _selectColor = ae;
1628
1071
  /** Исходные цвета материалов линий для отката */
1629
1072
  _origLineColors = /* @__PURE__ */ new WeakMap();
1630
1073
  handle(t, e) {
1631
- if (this._api.setRaycastMode(this.mode), e === z.Hover) {
1074
+ if (this._api.setRaycastMode(this.mode), e === S.Hover) {
1632
1075
  if (!t) {
1633
1076
  this._hoveredMesh && this._hoveredMesh !== this._selectedMesh && this._restoreEdgesColor(this._hoveredMesh), this._hoveredMesh = null;
1634
1077
  return;
@@ -1636,7 +1079,7 @@ let je = class {
1636
1079
  const s = t.intersection.object;
1637
1080
  this._hoveredMesh !== s && (this._hoveredMesh && this._hoveredMesh !== this._selectedMesh && this._restoreEdgesColor(this._hoveredMesh), s !== this._selectedMesh && this._paintEdges(s, this._hoverColor), this._hoveredMesh = s);
1638
1081
  }
1639
- if (e === z.Click) {
1082
+ if (e === S.Click) {
1640
1083
  if (!t) {
1641
1084
  this._selectedMesh && (this._restoreEdgesColor(this._selectedMesh), this._selectedMesh = null, this._store.setSelectedObject(null));
1642
1085
  return;
@@ -1659,8 +1102,8 @@ let je = class {
1659
1102
  t.children.forEach((s) => {
1660
1103
  const i = s;
1661
1104
  if (i.isLineSegments && i.material) {
1662
- const o = i.material;
1663
- this._origLineColors.has(i) || this._origLineColors.set(i, o.color.clone()), o.color.setHex(e), o.needsUpdate = !0;
1105
+ const r = i.material;
1106
+ this._origLineColors.has(i) || this._origLineColors.set(i, r.color.clone()), r.color.setHex(e), r.needsUpdate = !0;
1664
1107
  }
1665
1108
  });
1666
1109
  }
@@ -1674,42 +1117,42 @@ let je = class {
1674
1117
  if (s.isLineSegments && s.material) {
1675
1118
  const i = this._origLineColors.get(s);
1676
1119
  if (i) {
1677
- const o = s.material;
1678
- o.color.copy(i), o.needsUpdate = !0;
1120
+ const r = s.material;
1121
+ r.color.copy(i), r.needsUpdate = !0;
1679
1122
  }
1680
1123
  }
1681
1124
  });
1682
1125
  }
1683
1126
  };
1684
- je = ks([
1685
- w(),
1686
- dt(0, u("RendererApi")),
1687
- dt(1, u("IEditorStore"))
1688
- ], je);
1689
- var Ys = Object.getOwnPropertyDescriptor, Zs = (t, e, s, i) => {
1690
- for (var o = i > 1 ? void 0 : i ? Ys(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1691
- (n = t[r]) && (o = n(o) || o);
1692
- return o;
1693
- }, Xs = (t, e) => (s, i) => e(s, i, t);
1694
- let Re = class {
1127
+ V = Dt([
1128
+ u(),
1129
+ Ee(0, l("RendererApi")),
1130
+ Ee(1, l("IEditorStore"))
1131
+ ], V);
1132
+ var Tt = Object.getOwnPropertyDescriptor, Lt = (t, e, s, i) => {
1133
+ for (var r = i > 1 ? void 0 : i ? Tt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1134
+ (n = t[o]) && (r = n(r) || r);
1135
+ return r;
1136
+ }, Ct = (t, e) => (s, i) => e(s, i, t);
1137
+ let K = class {
1695
1138
  constructor(t) {
1696
1139
  this._api = t;
1697
1140
  }
1698
1141
  /** Режим, которым управляет хендлер, нужен только менеджеру */
1699
- mode = I.Face;
1142
+ mode = M.Face;
1700
1143
  /** Текущая наведённая грань */
1701
1144
  _hovered = null;
1702
1145
  /** Текущая выбранная грань */
1703
1146
  _selected = null;
1704
1147
  // Цвета, необходимые для переключения
1705
1148
  /** Цвет грани, на которую навелись */
1706
- _hoverColor = We;
1149
+ _hoverColor = ne;
1707
1150
  /** Цвет выделенной граней */
1708
- _selectColor = $e;
1151
+ _selectColor = ae;
1709
1152
  /** Изначальный цвет граней у модели, перед наложением эффектов*/
1710
1153
  _defaultColor = 2236962;
1711
1154
  handle(t, e) {
1712
- this._api.setRaycastMode(this.mode), e === z.Hover && console.log(t), e === z.Click && console.log(t);
1155
+ this._api.setRaycastMode(this.mode), e === S.Hover && console.log(t), e === S.Click && console.log(t);
1713
1156
  }
1714
1157
  rollback() {
1715
1158
  throw new Error("Method not implemented.");
@@ -1719,11 +1162,11 @@ let Re = class {
1719
1162
  throw new Error("Method not implemented.");
1720
1163
  }
1721
1164
  };
1722
- Re = Zs([
1723
- w(),
1724
- Xs(0, u("RendererApi"))
1725
- ], Re);
1726
- class Ge {
1165
+ K = Lt([
1166
+ u(),
1167
+ Ct(0, l("RendererApi"))
1168
+ ], K);
1169
+ class he {
1727
1170
  constructor(e, s) {
1728
1171
  this.api = e, this.store = s;
1729
1172
  }
@@ -1747,69 +1190,69 @@ class Ge {
1747
1190
  this.rollback();
1748
1191
  }
1749
1192
  }
1750
- var zs = Object.getOwnPropertyDescriptor, Ns = (t, e, s, i) => {
1751
- for (var o = i > 1 ? void 0 : i ? zs(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1752
- (n = t[r]) && (o = n(o) || o);
1753
- return o;
1754
- }, pt = (t, e) => (s, i) => e(s, i, t);
1755
- let He = class extends Ge {
1193
+ var At = Object.getOwnPropertyDescriptor, Rt = (t, e, s, i) => {
1194
+ for (var r = i > 1 ? void 0 : i ? At(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1195
+ (n = t[o]) && (r = n(r) || r);
1196
+ return r;
1197
+ }, we = (t, e) => (s, i) => e(s, i, t);
1198
+ let G = class extends he {
1756
1199
  /** Инструмент, которым управляет хендлер, нужен только менеджеру */
1757
- mode = G.Translate;
1200
+ mode = O.Translate;
1758
1201
  constructor(t, e) {
1759
1202
  super(t, e);
1760
1203
  }
1761
1204
  };
1762
- He = Ns([
1763
- w(),
1764
- pt(0, u("RendererApi")),
1765
- pt(1, u("IEditorStore"))
1766
- ], He);
1767
- var Fs = Object.getOwnPropertyDescriptor, Qs = (t, e, s, i) => {
1768
- for (var o = i > 1 ? void 0 : i ? Fs(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1769
- (n = t[r]) && (o = n(o) || o);
1770
- return o;
1771
- }, _t = (t, e) => (s, i) => e(s, i, t);
1772
- let ke = class extends Ge {
1205
+ G = Rt([
1206
+ u(),
1207
+ we(0, l("RendererApi")),
1208
+ we(1, l("IEditorStore"))
1209
+ ], G);
1210
+ var jt = Object.getOwnPropertyDescriptor, xt = (t, e, s, i) => {
1211
+ for (var r = i > 1 ? void 0 : i ? jt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1212
+ (n = t[o]) && (r = n(r) || r);
1213
+ return r;
1214
+ }, Se = (t, e) => (s, i) => e(s, i, t);
1215
+ let q = class extends he {
1773
1216
  /** Инструмент, которым управляет хендлер, нужен только менеджеру */
1774
- mode = G.Scale;
1217
+ mode = O.Scale;
1775
1218
  constructor(t, e) {
1776
1219
  super(t, e);
1777
1220
  }
1778
1221
  };
1779
- ke = Qs([
1780
- w(),
1781
- _t(0, u("RendererApi")),
1782
- _t(1, u("IEditorStore"))
1783
- ], ke);
1784
- var Us = Object.getOwnPropertyDescriptor, Ws = (t, e, s, i) => {
1785
- for (var o = i > 1 ? void 0 : i ? Us(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1786
- (n = t[r]) && (o = n(o) || o);
1787
- return o;
1788
- }, ut = (t, e) => (s, i) => e(s, i, t);
1789
- let Ye = class extends Ge {
1222
+ q = xt([
1223
+ u(),
1224
+ Se(0, l("RendererApi")),
1225
+ Se(1, l("IEditorStore"))
1226
+ ], q);
1227
+ var It = Object.getOwnPropertyDescriptor, Ht = (t, e, s, i) => {
1228
+ for (var r = i > 1 ? void 0 : i ? It(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1229
+ (n = t[o]) && (r = n(r) || r);
1230
+ return r;
1231
+ }, Pe = (t, e) => (s, i) => e(s, i, t);
1232
+ let Q = class extends he {
1790
1233
  /** Инструмент, которым управляет хендлер, нужен только менеджеру */
1791
- mode = G.Rotate;
1234
+ mode = O.Rotate;
1792
1235
  constructor(t, e) {
1793
1236
  super(t, e);
1794
1237
  }
1795
1238
  };
1796
- Ye = Ws([
1797
- w(),
1798
- ut(0, u("RendererApi")),
1799
- ut(1, u("IEditorStore"))
1800
- ], Ye);
1801
- const be = 31;
1802
- var $s = Object.getOwnPropertyDescriptor, Gs = (t, e, s, i) => {
1803
- for (var o = i > 1 ? void 0 : i ? $s(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1804
- (n = t[r]) && (o = n(o) || o);
1805
- return o;
1806
- }, mt = (t, e) => (s, i) => e(s, i, t);
1807
- let Ze = class {
1239
+ Q = Ht([
1240
+ u(),
1241
+ Pe(0, l("RendererApi")),
1242
+ Pe(1, l("IEditorStore"))
1243
+ ], Q);
1244
+ const H = 31;
1245
+ var kt = Object.getOwnPropertyDescriptor, Nt = (t, e, s, i) => {
1246
+ for (var r = i > 1 ? void 0 : i ? kt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1247
+ (n = t[o]) && (r = n(r) || r);
1248
+ return r;
1249
+ }, Oe = (t, e) => (s, i) => e(s, i, t);
1250
+ let J = class {
1808
1251
  constructor(t, e) {
1809
- this._api = t, this._store = e, this._api.enableCameraLayer(be), this._hoverLine = this._makeOverlayLine(this._hoverColor), this._selectLine = this._makeOverlayLine(this._selectColor), this._api.addObject(this._hoverLine, be), this._api.addObject(this._selectLine, be);
1252
+ this._api = t, this._store = e, this._api.enableCameraLayer(H), this._hoverLine = this._makeOverlayLine(this._hoverColor), this._selectLine = this._makeOverlayLine(this._selectColor), this._api.addObject(this._hoverLine, H), this._api.addObject(this._selectLine, H);
1810
1253
  }
1811
1254
  /** Режим, которым управляет хендлер, нужен только менеджеру */
1812
- mode = I.Edge;
1255
+ mode = M.Edge;
1813
1256
  /** Текущее наведённое ребро. */
1814
1257
  _hoverLine;
1815
1258
  /** Текущее выбранное ребро. */
@@ -1820,33 +1263,33 @@ let Ze = class {
1820
1263
  _selected = null;
1821
1264
  // Цвета, необходимые для переключения
1822
1265
  /** Цвет ребра, на которое навелись */
1823
- _hoverColor = We;
1266
+ _hoverColor = ne;
1824
1267
  /** Цвет выделенного ребра */
1825
- _selectColor = $e;
1268
+ _selectColor = ae;
1826
1269
  /** Обработка текущего режима выборки. */
1827
1270
  handle(t, e) {
1828
- if (this._api.setRaycastMode(this.mode), e === z.Hover) {
1271
+ if (this._api.setRaycastMode(this.mode), e === S.Hover) {
1829
1272
  if (!t) {
1830
1273
  this._hoverLine.visible = !1, this._hovered = null;
1831
1274
  return;
1832
1275
  }
1833
1276
  const s = t.intersection.object;
1834
1277
  if (!s?.isLineSegments) return;
1835
- const i = s, o = Math.floor((t.intersection.index ?? -1) / 2);
1836
- if (o < 0) return;
1837
- this._selected && this._same({ lines: i, seg: o }, this._selected) ? this._hoverLine.visible = !1 : (this._writeWorldSegment(this._hoverLine, i, o), this._hoverLine.visible = !0), this._hovered = { lines: i, seg: o };
1278
+ const i = s, r = Math.floor((t.intersection.index ?? -1) / 2);
1279
+ if (r < 0) return;
1280
+ this._selected && this._same({ lines: i, seg: r }, this._selected) ? this._hoverLine.visible = !1 : (this._writeWorldSegment(this._hoverLine, i, r), this._hoverLine.visible = !0), this._hovered = { lines: i, seg: r };
1838
1281
  return;
1839
1282
  }
1840
- if (e === z.Click) {
1283
+ if (e === S.Click) {
1841
1284
  if (!t) {
1842
1285
  this._selectLine.visible = !1, this._selected = null, this._store.setSelectedObject(null);
1843
1286
  return;
1844
1287
  }
1845
1288
  const s = t.intersection.object;
1846
1289
  if (!s?.isLineSegments) return;
1847
- const i = s, o = Math.floor((t.intersection.index ?? -1) / 2);
1848
- if (o < 0) return;
1849
- this._writeWorldSegment(this._selectLine, i, o), this._centerAndOrientLineOnSegment(this._selectLine, i, o), this._selectLine.visible = !0, this._store.setSelectedObject(this._selectLine), this._selected = { lines: i, seg: o }, this._hovered && this._same(this._hovered, this._selected) && (this._hoverLine.visible = !1);
1290
+ const i = s, r = Math.floor((t.intersection.index ?? -1) / 2);
1291
+ if (r < 0) return;
1292
+ this._writeWorldSegment(this._selectLine, i, r), this._centerAndOrientLineOnSegment(this._selectLine, i, r), this._selectLine.visible = !0, this._prepareEdgeMetadata(i, r), this._store.setSelectedObject(this._selectLine), this._selected = { lines: i, seg: r }, this._hovered && this._same(this._hovered, this._selected) && (this._hoverLine.visible = !1);
1850
1293
  }
1851
1294
  }
1852
1295
  /** Откат текущего режима выборки */
@@ -1857,77 +1300,114 @@ let Ze = class {
1857
1300
  dispose() {
1858
1301
  this.rollback(), this._api.removeObject(this._hoverLine), this._api.removeObject(this._selectLine), this._hoverLine.geometry.dispose(), this._hoverLine.material.dispose(), this._selectLine.geometry.dispose(), this._selectLine.material.dispose();
1859
1302
  }
1303
+ /** Инициализация буферных линий для режима (hover и click).
1304
+ * На весь режим будет использовано 2 глобальных линии на сцене,
1305
+ * использоваться они будут только для обозначения геометрии ребер конкретной фигуры.
1306
+ */
1860
1307
  _makeOverlayLine(t) {
1861
- const e = new l.BufferGeometry();
1862
- e.setAttribute("position", new l.Float32BufferAttribute(6, 3));
1863
- const s = new l.LineBasicMaterial({
1308
+ const e = new a.BufferGeometry();
1309
+ e.setAttribute("position", new a.Float32BufferAttribute(6, 3));
1310
+ const s = new a.LineBasicMaterial({
1864
1311
  color: t,
1865
1312
  depthTest: !1,
1866
1313
  depthWrite: !1,
1867
1314
  transparent: !0,
1868
1315
  opacity: 1
1869
- }), i = new l.Line(e, s);
1316
+ }), i = new a.Line(e, s);
1870
1317
  return i.renderOrder = 1e3, i.raycast = () => {
1871
- }, i.layers.set(be), i.visible = !1, i;
1318
+ }, i.layers.set(H), i.visible = !1, i;
1872
1319
  }
1873
1320
  /** Локальные точки сегмента переводим в target (который висит на сцене) */
1874
1321
  _writeWorldSegment(t, e, s) {
1875
- const i = e.geometry.getAttribute("position"), o = s * 2, r = o + 1, n = new l.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1322
+ const i = e.geometry.getAttribute("position"), r = s * 2, o = r + 1, n = new a.Vector3(i.getX(r), i.getY(r), i.getZ(r)).applyMatrix4(
1876
1323
  e.matrixWorld
1877
- ), a = new l.Vector3(i.getX(r), i.getY(r), i.getZ(r)).applyMatrix4(
1324
+ ), c = new a.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1878
1325
  e.matrixWorld
1879
- ), d = t.geometry.getAttribute("position");
1880
- d.setXYZ(0, n.x, n.y, n.z), d.setXYZ(1, a.x, a.y, a.z), d.needsUpdate = !0;
1326
+ ), p = t.geometry.getAttribute("position");
1327
+ p.setXYZ(0, n.x, n.y, n.z), p.setXYZ(1, c.x, c.y, c.z), p.needsUpdate = !0;
1881
1328
  }
1882
1329
  _same(t, e) {
1883
1330
  return !!t && !!e && t.lines === e.lines && t.seg === e.seg;
1884
1331
  }
1885
1332
  /** Центрует `THREE.Line` на сегменте и ориентирует её вдоль ребра */
1886
1333
  _centerAndOrientLineOnSegment(t, e, s) {
1887
- const i = e.geometry.getAttribute("position"), o = s * 2, r = o + 1, n = new l.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1334
+ const i = e.geometry.getAttribute("position"), r = s * 2, o = r + 1, n = new a.Vector3(i.getX(r), i.getY(r), i.getZ(r)).applyMatrix4(
1888
1335
  e.matrixWorld
1889
- ), a = new l.Vector3(i.getX(r), i.getY(r), i.getZ(r)).applyMatrix4(
1336
+ ), c = new a.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1890
1337
  e.matrixWorld
1891
- ), d = new l.Vector3().subVectors(a, n), g = d.length();
1892
- if (!isFinite(g) || g === 0) return;
1893
- const b = new l.Vector3().addVectors(n, a).multiplyScalar(0.5);
1894
- t.position.copy(b);
1895
- const H = t.geometry;
1896
- let T = H.getAttribute("position");
1897
- (!T || T.count < 2) && (H.setAttribute("position", new l.BufferAttribute(new Float32Array(6), 3)), T = H.getAttribute("position")), T.setXYZ(0, -g / 2, 0, 0), T.setXYZ(1, g / 2, 0, 0), T.needsUpdate = !0, d.normalize();
1898
- const q = new l.Quaternion().setFromUnitVectors(new l.Vector3(1, 0, 0), d);
1899
- t.quaternion.copy(q), t.updateMatrixWorld(!0);
1338
+ ), p = new a.Vector3().subVectors(c, n), f = p.length();
1339
+ if (!isFinite(f) || f === 0) return;
1340
+ const g = new a.Vector3().addVectors(n, c).multiplyScalar(0.5);
1341
+ t.position.copy(g);
1342
+ const x = t.geometry;
1343
+ let w = x.getAttribute("position");
1344
+ (!w || w.count < 2) && (x.setAttribute("position", new a.BufferAttribute(new Float32Array(6), 3)), w = x.getAttribute("position")), w.setXYZ(0, -f / 2, 0, 0), w.setXYZ(1, f / 2, 0, 0), w.needsUpdate = !0, p.normalize();
1345
+ const C = new a.Quaternion().setFromUnitVectors(new a.Vector3(1, 0, 0), p);
1346
+ t.quaternion.copy(C), t.updateMatrixWorld(!0);
1347
+ }
1348
+ /** Поиск родителя ребер (сама фигура) */
1349
+ _findParentMesh(t) {
1350
+ let e = t;
1351
+ for (; e; ) {
1352
+ if (e.isMesh) return e;
1353
+ e = e.parent;
1354
+ }
1355
+ return null;
1356
+ }
1357
+ /** Запись метаданных выбранного ребра для использования инструментов */
1358
+ _prepareEdgeMetadata(t, e) {
1359
+ const s = this._findParentMesh(t);
1360
+ if (!s) return;
1361
+ const i = t.geometry.getAttribute("position"), r = e * 2, o = r + 1, n = new a.Vector3(i.getX(r), i.getY(r), i.getZ(r)).applyMatrix4(
1362
+ t.matrixWorld
1363
+ ), c = new a.Vector3(i.getX(o), i.getY(o), i.getZ(o)).applyMatrix4(
1364
+ t.matrixWorld
1365
+ ), p = new a.Matrix4().copy(s.matrixWorld).invert(), f = n.clone().applyMatrix4(p), g = c.clone().applyMatrix4(p), w = s.geometry.getAttribute("position"), C = new a.Vector3(), P = 1e-6, le = [], ce = [];
1366
+ for (let b = 0; b < w.count; b++)
1367
+ C.fromBufferAttribute(w, b), C.distanceToSquared(f) < P * P ? le.push(b) : C.distanceToSquared(g) < P * P && ce.push(b);
1368
+ const de = new a.Matrix4().copy(t.matrixWorld).invert(), Re = n.clone().applyMatrix4(de), je = c.clone().applyMatrix4(de), _e = t.geometry.getAttribute("position"), N = new a.Vector3(), pe = [], ue = [];
1369
+ for (let b = 0; b < _e.count; b++)
1370
+ N.fromBufferAttribute(_e, b), N.distanceToSquared(Re) < P * P ? pe.push(b) : N.distanceToSquared(je) < P * P && ue.push(b);
1371
+ this._selectLine.userData.edgeInfo = {
1372
+ lines: t,
1373
+ seg: e,
1374
+ mesh: s,
1375
+ aIndices: le,
1376
+ bIndices: ce,
1377
+ aEdgeIndices: pe,
1378
+ bEdgeIndices: ue
1379
+ };
1900
1380
  }
1901
1381
  };
1902
- Ze = Gs([
1903
- w(),
1904
- mt(0, u("RendererApi")),
1905
- mt(1, u("IEditorStore"))
1906
- ], Ze);
1907
- var qs = Object.getOwnPropertyDescriptor, Bs = (t, e, s, i) => {
1908
- for (var o = i > 1 ? void 0 : i ? qs(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1909
- (n = t[r]) && (o = n(o) || o);
1910
- return o;
1911
- }, Ks = (t, e) => (s, i) => e(s, i, t);
1912
- let Xe = class {
1382
+ J = Nt([
1383
+ u(),
1384
+ Oe(0, l("RendererApi")),
1385
+ Oe(1, l("IEditorStore"))
1386
+ ], J);
1387
+ var Yt = Object.getOwnPropertyDescriptor, Ut = (t, e, s, i) => {
1388
+ for (var r = i > 1 ? void 0 : i ? Yt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1389
+ (n = t[o]) && (r = n(r) || r);
1390
+ return r;
1391
+ }, $t = (t, e) => (s, i) => e(s, i, t);
1392
+ let ee = class {
1913
1393
  constructor(t) {
1914
1394
  this._api = t;
1915
1395
  }
1916
1396
  /** Режим редактирования сцены */
1917
- mode = he.AddFigure;
1397
+ mode = j.AddFigure;
1918
1398
  /** Последняя добавленная фигура, нужно для отката через `ctrl + z`. */
1919
1399
  _lastAddedMesh = null;
1920
1400
  /** Добавление базовых фигур на сцену, которые приписаны в `FigureType`. */
1921
1401
  handle(t) {
1922
- const e = $t[t](), s = e.getAttribute("position");
1923
- s && s.setUsage && s.setUsage(l.DynamicDrawUsage);
1924
- const i = new l.Mesh(e, vt);
1402
+ const e = Be[t](), s = e.getAttribute("position");
1403
+ s && s.setUsage && s.setUsage(a.DynamicDrawUsage);
1404
+ const i = new a.Mesh(e, Le);
1925
1405
  i.layers.enable(0);
1926
- const o = new l.EdgesGeometry(i.geometry), r = new l.LineSegments(
1927
- o,
1928
- new l.LineBasicMaterial({ color: Rs, linewidth: 1 })
1406
+ const r = new a.EdgesGeometry(i.geometry), o = new a.LineSegments(
1407
+ r,
1408
+ new a.LineBasicMaterial({ color: Pt, linewidth: 1 })
1929
1409
  );
1930
- r.layers.set(1), i.add(r), this._api.addMesh(i), this._lastAddedMesh = i;
1410
+ o.layers.set(1), i.add(o), this._api.addMesh(i), this._lastAddedMesh = i;
1931
1411
  }
1932
1412
  /** Срабатывает только на `ctrl + z`. */
1933
1413
  rollback() {
@@ -1938,27 +1418,27 @@ let Xe = class {
1938
1418
  this._lastAddedMesh = null;
1939
1419
  }
1940
1420
  };
1941
- Xe = Bs([
1942
- w(),
1943
- Ks(0, u("RendererApi"))
1944
- ], Xe);
1945
- const Vs = (t) => !!t && t.isMesh;
1946
- var Js = Object.getOwnPropertyDescriptor, ei = (t, e, s, i) => {
1947
- for (var o = i > 1 ? void 0 : i ? Js(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1948
- (n = t[r]) && (o = n(o) || o);
1949
- return o;
1950
- }, ft = (t, e) => (s, i) => e(s, i, t);
1951
- let ze = class {
1421
+ ee = Ut([
1422
+ u(),
1423
+ $t(0, l("RendererApi"))
1424
+ ], ee);
1425
+ const zt = (t) => !!t && t.isMesh;
1426
+ var Ft = Object.getOwnPropertyDescriptor, Wt = (t, e, s, i) => {
1427
+ for (var r = i > 1 ? void 0 : i ? Ft(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1428
+ (n = t[o]) && (r = n(r) || r);
1429
+ return r;
1430
+ }, De = (t, e) => (s, i) => e(s, i, t);
1431
+ let te = class {
1952
1432
  constructor(t, e) {
1953
1433
  this._api = t, this._store = e;
1954
1434
  }
1955
1435
  /** Режим редактирования сцены */
1956
- mode = he.DeleteFigure;
1436
+ mode = j.DeleteFigure;
1957
1437
  /** Последняя удаленная фигура, сохраняем для отката через `ctrl + z` */
1958
1438
  _lastDeletedMesh = null;
1959
1439
  handle() {
1960
1440
  const t = this._store.getSelectedObject();
1961
- Vs(t) && (this._api.removeMesh(t), this._store.setSelectedObject(null), this._lastDeletedMesh = t);
1441
+ zt(t) && (this._api.removeMesh(t), this._store.setSelectedObject(null), this._lastDeletedMesh = t);
1962
1442
  }
1963
1443
  /** Срабатывает только на `ctrl + z`. */
1964
1444
  rollback() {
@@ -1969,17 +1449,17 @@ let ze = class {
1969
1449
  this._lastDeletedMesh = null;
1970
1450
  }
1971
1451
  };
1972
- ze = ei([
1973
- w(),
1974
- ft(0, u("RendererApi")),
1975
- ft(1, u("IEditorStore"))
1976
- ], ze);
1977
- var ti = Object.getOwnPropertyDescriptor, si = (t, e, s, i) => {
1978
- for (var o = i > 1 ? void 0 : i ? ti(e, s) : e, r = t.length - 1, n; r >= 0; r--)
1979
- (n = t[r]) && (o = n(o) || o);
1980
- return o;
1981
- }, ii = (t, e) => (s, i) => e(s, i, t);
1982
- let Ne = class {
1452
+ te = Wt([
1453
+ u(),
1454
+ De(0, l("RendererApi")),
1455
+ De(1, l("IEditorStore"))
1456
+ ], te);
1457
+ var Zt = Object.getOwnPropertyDescriptor, Bt = (t, e, s, i) => {
1458
+ for (var r = i > 1 ? void 0 : i ? Zt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1459
+ (n = t[o]) && (r = n(r) || r);
1460
+ return r;
1461
+ }, Xt = (t, e) => (s, i) => e(s, i, t);
1462
+ let se = class {
1983
1463
  constructor(t) {
1984
1464
  this._renderer = t;
1985
1465
  }
@@ -2034,18 +1514,18 @@ let Ne = class {
2034
1514
  this._renderer.enableCameraLayer(t);
2035
1515
  }
2036
1516
  };
2037
- Ne = si([
2038
- w(),
2039
- ii(0, u("EditorRenderer"))
2040
- ], Ne);
2041
- var oi = Object.getOwnPropertyDescriptor, ni = (t, e, s, i) => {
2042
- for (var o = i > 1 ? void 0 : i ? oi(e, s) : e, r = t.length - 1, n; r >= 0; r--)
2043
- (n = t[r]) && (o = n(o) || o);
2044
- return o;
2045
- }, oe = (t, e) => (s, i) => e(s, i, t);
2046
- let Fe = class {
2047
- constructor(t, e, s, i, o) {
2048
- this._displayManager = t, this._selectManager = e, this._toolManager = s, this._sceneManager = i, this._renderer = o, this.setSelectMode(I.Mesh), this.setToolMode(G.Translate);
1517
+ se = Bt([
1518
+ u(),
1519
+ Xt(0, l("EditorRenderer"))
1520
+ ], se);
1521
+ var Vt = Object.getOwnPropertyDescriptor, Kt = (t, e, s, i) => {
1522
+ for (var r = i > 1 ? void 0 : i ? Vt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1523
+ (n = t[o]) && (r = n(r) || r);
1524
+ return r;
1525
+ }, A = (t, e) => (s, i) => e(s, i, t);
1526
+ let ie = class {
1527
+ constructor(t, e, s, i, r) {
1528
+ this._displayManager = t, this._selectManager = e, this._toolManager = s, this._sceneManager = i, this._renderer = r, this.setSelectMode(M.Mesh), this.setToolMode(O.Translate);
2049
1529
  }
2050
1530
  setDisplayMode(t) {
2051
1531
  this._displayManager.manage(t);
@@ -2072,32 +1552,32 @@ let Fe = class {
2072
1552
  this._displayManager.dispose(), this._selectManager.dispose(), this._renderer.dispose();
2073
1553
  }
2074
1554
  };
2075
- Fe = ni([
2076
- w(),
2077
- oe(0, u("IDisplayManager")),
2078
- oe(1, u("ISelectManager")),
2079
- oe(2, u("IToolManager")),
2080
- oe(3, u("ISceneManager")),
2081
- oe(4, u("EditorRenderer"))
2082
- ], Fe);
2083
- var ri = Object.getOwnPropertyDescriptor, ai = (t, e, s, i) => {
2084
- for (var o = i > 1 ? void 0 : i ? ri(e, s) : e, r = t.length - 1, n; r >= 0; r--)
2085
- (n = t[r]) && (o = n(o) || o);
2086
- return o;
1555
+ ie = Kt([
1556
+ u(),
1557
+ A(0, l("IDisplayManager")),
1558
+ A(1, l("ISelectManager")),
1559
+ A(2, l("IToolManager")),
1560
+ A(3, l("ISceneManager")),
1561
+ A(4, l("EditorRenderer"))
1562
+ ], ie);
1563
+ var Gt = Object.getOwnPropertyDescriptor, qt = (t, e, s, i) => {
1564
+ for (var r = i > 1 ? void 0 : i ? Gt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1565
+ (n = t[o]) && (r = n(r) || r);
1566
+ return r;
2087
1567
  };
2088
- let Qe = class {
1568
+ let re = class {
2089
1569
  /** Текущий режим выборки. */
2090
- _selectMode = I.Mesh;
1570
+ _selectMode = M.Mesh;
2091
1571
  /** Текущий выбранный инструмент. */
2092
- _toolType = G.Translate;
1572
+ _toolType = O.Translate;
2093
1573
  /** Выбранный режим отображения. */
2094
- _displayMode = ae.Plane;
1574
+ _displayMode = R.Plane;
2095
1575
  /** Выбранный объект на сцене. */
2096
1576
  _selectedObject = null;
2097
1577
  /** Слушатели событий по изменению выбранного объекта. */
2098
1578
  _selectedListeners = /* @__PURE__ */ new Set();
2099
1579
  constructor() {
2100
- Wt(this, {}, { autoBind: !0 });
1580
+ Ze(this, {}, { autoBind: !0 });
2101
1581
  }
2102
1582
  /** @inheritdoc */
2103
1583
  getSelectMode() {
@@ -2139,24 +1619,24 @@ let Qe = class {
2139
1619
  return this._selectedListeners.add(t), () => this._selectedListeners.delete(t);
2140
1620
  }
2141
1621
  };
2142
- Qe = ai([
2143
- w()
2144
- ], Qe);
2145
- let gt = !1;
2146
- const f = Qt.createChildContainer();
2147
- function hi(t) {
2148
- return gt || (f.registerInstance("Canvas", t), f.registerSingleton("EventBus", xe), f.registerSingleton("EditorRenderer", De), f.registerSingleton("RendererApi", Ne), f.registerSingleton("IDisplayHandler", Ie), f.registerSingleton("ISelectHandler", je), f.registerSingleton("ISelectHandler", Re), f.registerSingleton("ISelectHandler", Ze), f.registerSingleton("IToolHandler", He), f.registerSingleton("IToolHandler", ke), f.registerSingleton("IToolHandler", Ye), f.registerSingleton("ISceneHandler", Xe), f.registerSingleton("ISceneHandler", ze), f.registerSingleton("IDisplayManager", Oe), f.registerSingleton("ISelectManager", Ae), f.registerSingleton("IToolManager", Le), f.registerSingleton("ISceneManager", Ce), f.registerSingleton("EditorHub", Fe), f.registerSingleton("IEditorStore", Qe), gt = !0), f;
1622
+ re = qt([
1623
+ u()
1624
+ ], re);
1625
+ let Te = !1;
1626
+ const d = Fe.createChildContainer();
1627
+ function Qt(t) {
1628
+ return Te || (d.registerInstance("Canvas", t), d.registerSingleton("EventBus", $), d.registerSingleton("EditorRenderer", z), d.registerSingleton("RendererApi", se), d.registerSingleton("IDisplayHandler", X), d.registerSingleton("ISelectHandler", V), d.registerSingleton("ISelectHandler", K), d.registerSingleton("ISelectHandler", J), d.registerSingleton("IToolHandler", G), d.registerSingleton("IToolHandler", q), d.registerSingleton("IToolHandler", Q), d.registerSingleton("ISceneHandler", ee), d.registerSingleton("ISceneHandler", te), d.registerSingleton("IDisplayManager", F), d.registerSingleton("ISelectManager", W), d.registerSingleton("IToolManager", Z), d.registerSingleton("ISceneManager", B), d.registerSingleton("EditorHub", ie), d.registerSingleton("IEditorStore", re), Te = !0), d;
2149
1629
  }
2150
- function yi(t) {
2151
- return hi(t).resolve("EditorHub");
1630
+ function hs(t) {
1631
+ return Qt(t).resolve("EditorHub");
2152
1632
  }
2153
1633
  export {
2154
- Fe as EditorHub,
2155
- De as EditorRenderer,
2156
- xe as EventBus,
2157
- ee as EventTopics,
2158
- gi as ObjLoader,
2159
- fi as PreviewRenderer,
2160
- Mt as Renderer,
2161
- yi as createAppHub
1634
+ ie as EditorHub,
1635
+ z as EditorRenderer,
1636
+ $ as EventBus,
1637
+ L as EventTopics,
1638
+ as as ObjLoader,
1639
+ ns as PreviewRenderer,
1640
+ Ce as Renderer,
1641
+ hs as createAppHub
2162
1642
  };