bimatter-viewer-react 0.8.0 → 0.8.1

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/lib/index.js CHANGED
@@ -4,26 +4,26 @@ import u, { createContext as d, forwardRef as f, memo as p, useCallback as m, us
4
4
  import { Canvas as S, applyProps as C, extend as w, useFrame as T, useThree as E } from "@react-three/fiber";
5
5
  import { CameraControls as D, Stats as O } from "@react-three/drei";
6
6
  import "three";
7
- import { AlwaysDepth as k, BackSide as A, BasicDepthPacking as j, Box3 as M, BoxGeometry as ee, BufferAttribute as N, BufferGeometry as P, CanvasTexture as F, Color as I, ConeGeometry as te, DataTexture as ne, DepthStencilFormat as re, DepthTexture as ie, DoubleSide as L, DynamicDrawUsage as R, EventDispatcher as ae, Float32BufferAttribute as oe, FloatType as se, FrontSide as ce, Group as le, HalfFloatType as z, Line as ue, Line3 as de, LineBasicMaterial as fe, LineDashedMaterial as pe, LineSegments as me, LinearFilter as B, LinearSRGBColorSpace as he, Material as ge, MathUtils as _e, Matrix4 as V, Mesh as H, MeshBasicMaterial as ve, MeshLambertMaterial as ye, MeshNormalMaterial as be, NearestFilter as U, NoBlending as xe, NoColorSpace as Se, NoToneMapping as Ce, Object3D as we, OrthographicCamera as Te, PerspectiveCamera as Ee, Plane as De, REVISION as Oe, RGBAFormat as ke, RGFormat as Ae, Raycaster as je, RedFormat as Me, RepeatWrapping as Ne, SRGBColorSpace as Pe, Scene as Fe, ShaderMaterial as W, ShapeUtils as Ie, Sphere as Le, SphereGeometry as Re, Sprite as ze, SpriteMaterial as Be, Texture as Ve, Uint32BufferAttribute as He, Uniform as G, UnsignedByteType as Ue, UnsignedInt248Type as We, UnsignedIntType as Ge, Vector2 as K, Vector3 as q, WebGLRenderTarget as J } from "three";
8
- import { Fragment as Ke, jsx as Y, jsxs as qe } from "react/jsx-runtime";
9
- import { useStore as Je } from "zustand";
10
- import { createStore as Ye } from "zustand/vanilla";
11
- import { CONTAINED as Xe, INTERSECTED as Ze, MeshBVH as Qe, NOT_INTERSECTED as $e, acceleratedRaycast as et } from "three-mesh-bvh";
12
- import tt from "pako";
7
+ import { AlwaysDepth as k, BackSide as A, BasicDepthPacking as j, Box3 as M, BoxGeometry as ee, BufferAttribute as N, BufferGeometry as P, CanvasTexture as F, Color as I, ConeGeometry as te, DataTexture as ne, DepthStencilFormat as re, DepthTexture as ie, DoubleSide as L, DynamicDrawUsage as R, EventDispatcher as ae, Float32BufferAttribute as oe, FloatType as se, FrontSide as ce, Group as le, HalfFloatType as z, Line as ue, Line3 as de, LineBasicMaterial as fe, LineDashedMaterial as pe, LineSegments as me, LinearFilter as B, LinearSRGBColorSpace as he, Material as ge, MathUtils as _e, Matrix4 as V, Mesh as H, MeshBasicMaterial as ve, MeshLambertMaterial as ye, MeshNormalMaterial as be, NearestFilter as U, NoBlending as xe, NoColorSpace as Se, NoToneMapping as Ce, Object3D as we, OrthographicCamera as Te, PerspectiveCamera as Ee, Plane as De, REVISION as Oe, RGBAFormat as ke, RGFormat as Ae, RedFormat as je, RepeatWrapping as Me, SRGBColorSpace as Ne, Scene as Pe, ShaderMaterial as W, ShapeUtils as Fe, Sphere as Ie, SphereGeometry as Le, Sprite as Re, SpriteMaterial as ze, Texture as Be, Uint32BufferAttribute as Ve, Uniform as G, UnsignedByteType as He, UnsignedInt248Type as Ue, UnsignedIntType as We, Vector2 as K, Vector3 as q, WebGLRenderTarget as J } from "three";
8
+ import { Fragment as Ge, jsx as Y, jsxs as Ke } from "react/jsx-runtime";
9
+ import { useStore as qe } from "zustand";
10
+ import { createStore as Je } from "zustand/vanilla";
11
+ import { CONTAINED as Ye, INTERSECTED as Xe, MeshBVH as Ze, NOT_INTERSECTED as Qe, acceleratedRaycast as $e } from "three-mesh-bvh";
12
+ import et from "pako";
13
13
  //#region src/viewer/utils/ModelGrids/ModelGrids.tsx
14
- var nt = 10, rt = "#1d2733", it = 2, at = .05, ot = "\0", st = /* @__PURE__ */ new Map();
15
- function ct() {
14
+ var tt = 10, nt = "#1d2733", rt = 2, it = .05, at = "\0", ot = /* @__PURE__ */ new Map();
15
+ function st() {
16
16
  return typeof window > "u" ? 1 : Math.min(window.devicePixelRatio || 1, 2);
17
17
  }
18
- function lt(e, t, n, r) {
19
- let i = ct(), a = document.createElement("canvas"), o = a.getContext("2d");
18
+ function ct(e, t, n, r) {
19
+ let i = st(), a = document.createElement("canvas"), o = a.getContext("2d");
20
20
  if (!o) throw Error("Could not create grid label canvas context");
21
21
  let s = `400 ${r}px system-ui, "Segoe UI", sans-serif`, c = Math.ceil(r * .5), l = Math.ceil(r * .35);
22
22
  o.font = s;
23
23
  let u = o.measureText(t), d = u.actualBoundingBoxAscent || r * .8, f = u.actualBoundingBoxDescent || r * .2, p = Math.max(1, Math.ceil(u.width + c * 2)), m = Math.max(1, Math.ceil(d + f + l * 2));
24
24
  a.width = Math.ceil(p * i), a.height = Math.ceil(m * i), o.scale(i, i), o.clearRect(0, 0, p, m), o.font = s, o.fillStyle = n, o.textAlign = "left", o.textBaseline = "alphabetic", o.fillText(t, c, l + d);
25
25
  let h = new F(a);
26
- return h.colorSpace = Pe, h.generateMipmaps = !1, h.magFilter = B, h.minFilter = B, h.needsUpdate = !0, {
26
+ return h.colorSpace = Ne, h.generateMipmaps = !1, h.magFilter = B, h.minFilter = B, h.needsUpdate = !0, {
27
27
  disposeTimer: null,
28
28
  height: m,
29
29
  key: e,
@@ -32,49 +32,49 @@ function lt(e, t, n, r) {
32
32
  width: p
33
33
  };
34
34
  }
35
- function ut(e, t, n) {
35
+ function lt(e, t, n) {
36
36
  let r = [
37
37
  e,
38
38
  t,
39
39
  n
40
- ].join(ot), i = st.get(r);
41
- return i || (i = lt(r, e, t, n), st.set(r, i)), i;
40
+ ].join(at), i = ot.get(r);
41
+ return i || (i = ct(r, e, t, n), ot.set(r, i)), i;
42
42
  }
43
- function dt(e, t, n) {
44
- let r = y(() => ut(e, t, n), [
43
+ function ut(e, t, n) {
44
+ let r = y(() => lt(e, t, n), [
45
45
  t,
46
46
  n,
47
47
  e
48
48
  ]);
49
49
  return g(() => (r.disposeTimer &&= (clearTimeout(r.disposeTimer), null), r.refs++, () => {
50
50
  r.refs = Math.max(0, r.refs - 1), r.refs <= 0 && (r.disposeTimer = setTimeout(() => {
51
- r.refs > 0 || (r.texture.dispose(), st.delete(r.key), r.disposeTimer = null);
51
+ r.refs > 0 || (r.texture.dispose(), ot.delete(r.key), r.disposeTimer = null);
52
52
  }, 1e3));
53
53
  }), [r]), r;
54
54
  }
55
- function ft(e, t, n, r) {
55
+ function dt(e, t, n, r) {
56
56
  let i = Math.abs(n.projectionMatrix.elements[5]) || 1, a = t.height * 2 / (Math.max(1, r) * i), o = a * (t.width / t.height);
57
57
  e.scale.set(o, a, 1);
58
58
  }
59
- function pt(e, t) {
59
+ function ft(e, t) {
60
60
  let n = e[t];
61
61
  return n === void 0 ? 0 : Number.isFinite(n) ? n : null;
62
62
  }
63
- function mt(e, t) {
64
- return pt(e, t) ?? 0;
63
+ function pt(e, t) {
64
+ return ft(e, t) ?? 0;
65
65
  }
66
- function ht(e) {
67
- let t = pt(e, "x"), n = pt(e, "y"), r = pt(e, "z");
66
+ function mt(e) {
67
+ let t = ft(e, "x"), n = ft(e, "y"), r = ft(e, "z");
68
68
  return t === null || n === null || r === null ? null : new q(t, n, r);
69
69
  }
70
- function gt(e, t) {
70
+ function ht(e, t) {
71
71
  return [
72
- mt(e, "x"),
73
- t !== void 0 && Number.isFinite(t) ? t : mt(e, "y"),
74
- mt(e, "z")
72
+ pt(e, "x"),
73
+ t !== void 0 && Number.isFinite(t) ? t : pt(e, "y"),
74
+ pt(e, "z")
75
75
  ];
76
76
  }
77
- function _t(e) {
77
+ function gt(e) {
78
78
  let { h: t, l: n } = e.getHSL({
79
79
  h: 0,
80
80
  s: 0,
@@ -82,14 +82,14 @@ function _t(e) {
82
82
  });
83
83
  return t < .55 && n >= .5 || t >= .55 && n >= .75 ? "#000000" : "#ffffff";
84
84
  }
85
- function vt(e) {
85
+ function _t(e) {
86
86
  let t = E((e) => e.scene.background);
87
- return y(() => e || (t instanceof I ? _t(t) : rt), [t, e]);
87
+ return y(() => e || (t instanceof I ? gt(t) : nt), [t, e]);
88
88
  }
89
- function yt({ axis: e, grid: t, endSide: n, startSide: r }) {
89
+ function vt({ axis: e, grid: t, endSide: n, startSide: r }) {
90
90
  return Object.entries(e).flatMap(([e, i]) => {
91
91
  if (i.length < 2) return [];
92
- let a = ht(i[0]), o = ht(i[1]);
92
+ let a = mt(i[0]), o = mt(i[1]);
93
93
  return !a || !o ? [] : (a.y = 0, o.y = 0, [{
94
94
  endSide: n,
95
95
  loc: t.loc,
@@ -99,18 +99,18 @@ function yt({ axis: e, grid: t, endSide: n, startSide: r }) {
99
99
  }]);
100
100
  });
101
101
  }
102
- function bt({ flattenToFloor: e, grids: t, showBottom: n, showLeft: r, showRight: i, showTop: a }) {
102
+ function yt({ flattenToFloor: e, grids: t, showBottom: n, showLeft: r, showRight: i, showTop: a }) {
103
103
  let o = {
104
104
  bottom: n,
105
105
  left: r,
106
106
  right: i,
107
107
  top: a
108
- }, s = Object.values(t).flatMap((e) => [...yt({
108
+ }, s = Object.values(t).flatMap((e) => [...vt({
109
109
  axis: e.points.u,
110
110
  endSide: "right",
111
111
  grid: e,
112
112
  startSide: "left"
113
- }), ...yt({
113
+ }), ...vt({
114
114
  axis: e.points.v,
115
115
  endSide: "bottom",
116
116
  grid: e,
@@ -123,8 +123,8 @@ function bt({ flattenToFloor: e, grids: t, showBottom: n, showLeft: r, showRight
123
123
  e.startSide,
124
124
  e.endSide,
125
125
  e.name,
126
- mt(e.loc, "x"),
127
- mt(e.loc, "z"),
126
+ pt(e.loc, "x"),
127
+ pt(e.loc, "z"),
128
128
  e.points[0].x,
129
129
  e.points[0].z,
130
130
  e.points[1].x,
@@ -133,49 +133,49 @@ function bt({ flattenToFloor: e, grids: t, showBottom: n, showLeft: r, showRight
133
133
  c.has(t) || c.set(t, e);
134
134
  }), Array.from(c.values());
135
135
  }
136
- function xt(e, t) {
137
- return new q(...gt(e.loc, t));
136
+ function bt(e, t) {
137
+ return new q(...ht(e.loc, t));
138
138
  }
139
- function St({ cameraPosition: e, floorY: t, line: n, showBottom: r, showLeft: i, showRight: a, showTop: o }) {
139
+ function xt({ cameraPosition: e, floorY: t, line: n, showBottom: r, showLeft: i, showRight: a, showTop: o }) {
140
140
  let s = {
141
141
  bottom: r,
142
142
  left: i,
143
143
  right: a,
144
144
  top: o
145
- }, c = xt(n, t), l = n.points[0].clone().add(c), u = n.points[1].clone().add(c), d = l.distanceToSquared(e) > u.distanceToSquared(e) ? "start" : "end", f = d === "start" ? "end" : "start", p = (e) => s[e === "start" ? n.startSide : n.endSide];
145
+ }, c = bt(n, t), l = n.points[0].clone().add(c), u = n.points[1].clone().add(c), d = l.distanceToSquared(e) > u.distanceToSquared(e) ? "start" : "end", f = d === "start" ? "end" : "start", p = (e) => s[e === "start" ? n.startSide : n.endSide];
146
146
  return p(d) ? d : p(f) ? f : null;
147
147
  }
148
- function Ct({ endpoint: e, labelOffset: t, line: n }) {
148
+ function St({ endpoint: e, labelOffset: t, line: n }) {
149
149
  let r = e === "start" ? n.points[0].clone() : n.points[1].clone(), i = n.points[1].clone().sub(n.points[0]);
150
150
  return i.y = 0, i.lengthSq() === 0 && i.set(1, 0, 0), i.normalize().multiplyScalar(t), e === "start" && i.negate(), r.add(i);
151
151
  }
152
- function wt(e, t) {
152
+ function Ct(e, t) {
153
153
  let n = new q(), r = 0;
154
154
  return e.forEach((e) => {
155
- let i = xt(e, t);
155
+ let i = bt(e, t);
156
156
  e.points.forEach((e) => {
157
157
  n.add(e).add(i), r++;
158
158
  });
159
159
  }), r && n.divideScalar(r), n;
160
160
  }
161
- function Tt(e, t, n) {
161
+ function wt(e, t, n) {
162
162
  let r = 0;
163
163
  return e.forEach((e) => {
164
- let i = xt(e, n);
164
+ let i = bt(e, n);
165
165
  e.points.forEach((e) => {
166
166
  r = Math.max(r, e.clone().add(i).distanceTo(t));
167
167
  });
168
168
  }), r;
169
169
  }
170
- function Et({ color: e, fontSize: t, position: n, text: r }) {
170
+ function Tt({ color: e, fontSize: t, position: n, text: r }) {
171
171
  let { camera: i, size: a } = E(), o = b(null), s = b({
172
172
  projectionScale: 0,
173
173
  viewportHeight: 0
174
- }), c = dt(r, e, t), l = m((e, t) => {
174
+ }), c = ut(r, e, t), l = m((e, t) => {
175
175
  let n = Math.abs(e.projectionMatrix.elements[5]) || 1, r = s.current;
176
176
  if (r.projectionScale === n && r.viewportHeight === t) return;
177
177
  let i = o.current;
178
- i && (r.projectionScale = n, r.viewportHeight = t, ft(i, c, e, t));
178
+ i && (r.projectionScale = n, r.viewportHeight = t, dt(i, c, e, t));
179
179
  }, [c]);
180
180
  return g(() => {
181
181
  s.current.projectionScale = 0, l(i, a.height);
@@ -200,8 +200,8 @@ function Et({ color: e, fontSize: t, position: n, text: r }) {
200
200
  })
201
201
  });
202
202
  }
203
- function Dt({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset: i, line: a, showBottom: o, showLeft: s, showRight: c, showTop: l }) {
204
- let u = y(() => new P().setFromPoints(a.points), [a.points]), d = St({
203
+ function Et({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset: i, line: a, showBottom: o, showLeft: s, showRight: c, showTop: l }) {
204
+ let u = y(() => new P().setFromPoints(a.points), [a.points]), d = xt({
205
205
  cameraPosition: e,
206
206
  floorY: n,
207
207
  line: a,
@@ -209,19 +209,19 @@ function Dt({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset:
209
209
  showLeft: s,
210
210
  showRight: c,
211
211
  showTop: l
212
- }), f = d ? Ct({
212
+ }), f = d ? St({
213
213
  endpoint: d,
214
214
  labelOffset: i,
215
215
  line: a
216
216
  }) : null;
217
- return g(() => () => u.dispose(), [u]), /* @__PURE__ */ qe("lineSegments", {
217
+ return g(() => () => u.dispose(), [u]), /* @__PURE__ */ Ke("lineSegments", {
218
218
  geometry: u,
219
- position: gt(a.loc, n),
219
+ position: ht(a.loc, n),
220
220
  children: [/* @__PURE__ */ Y("lineBasicMaterial", {
221
221
  color: t,
222
222
  depthWrite: !1,
223
223
  linewidth: 2
224
- }), f && /* @__PURE__ */ Y(Et, {
224
+ }), f && /* @__PURE__ */ Y(Tt, {
225
225
  color: t,
226
226
  fontSize: r,
227
227
  position: f,
@@ -229,8 +229,8 @@ function Dt({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset:
229
229
  })]
230
230
  });
231
231
  }
232
- function Ot({ color: e, floorY: t, fontSize: n = nt, grids: r, labelOffset: i = it, showBottom: a = !0, showLeft: o = !0, showRight: s = !0, showTop: c = !0, visible: l = !0 }) {
233
- let u = E((e) => e.camera), d = b(null), f = b(new q()), [p, m] = x(() => new q()), h = vt(e), g = y(() => r ? bt({
232
+ function Dt({ color: e, floorY: t, fontSize: n = tt, grids: r, labelOffset: i = rt, showBottom: a = !0, showLeft: o = !0, showRight: s = !0, showTop: c = !0, visible: l = !0 }) {
233
+ let u = E((e) => e.camera), d = b(null), f = b(new q()), [p, m] = x(() => new q()), h = _t(e), g = y(() => r ? yt({
234
234
  flattenToFloor: t !== void 0,
235
235
  grids: r,
236
236
  showBottom: a,
@@ -244,7 +244,7 @@ function Ot({ color: e, floorY: t, fontSize: n = nt, grids: r, labelOffset: i =
244
244
  o,
245
245
  s,
246
246
  c
247
- ]), _ = y(() => wt(g, t), [t, g]), v = y(() => Math.max(i, Tt(g, _, t) * .015), [
247
+ ]), _ = y(() => Ct(g, t), [t, g]), v = y(() => Math.max(i, wt(g, _, t) * .015), [
248
248
  _,
249
249
  t,
250
250
  i,
@@ -254,11 +254,11 @@ function Ot({ color: e, floorY: t, fontSize: n = nt, grids: r, labelOffset: i =
254
254
  let e = d.current;
255
255
  if (!e) return;
256
256
  let t = f.current.copy(u.position);
257
- e.worldToLocal(t), !(t.distanceToSquared(p) < at) && m(t.clone());
257
+ e.worldToLocal(t), !(t.distanceToSquared(p) < it) && m(t.clone());
258
258
  }), !l || !g.length ? null : /* @__PURE__ */ Y("group", {
259
259
  ref: d,
260
260
  userData: { modelGrids: !0 },
261
- children: g.map((e) => /* @__PURE__ */ Y(Dt, {
261
+ children: g.map((e) => /* @__PURE__ */ Y(Et, {
262
262
  cameraPosition: p,
263
263
  color: h,
264
264
  floorY: t,
@@ -273,9 +273,9 @@ function Ot({ color: e, floorY: t, fontSize: n = nt, grids: r, labelOffset: i =
273
273
  e.startSide,
274
274
  e.endSide,
275
275
  e.name,
276
- mt(e.loc, "x"),
277
- t ?? mt(e.loc, "y"),
278
- mt(e.loc, "z"),
276
+ pt(e.loc, "x"),
277
+ t ?? pt(e.loc, "y"),
278
+ pt(e.loc, "z"),
279
279
  e.points[0].x,
280
280
  e.points[0].y,
281
281
  e.points[0].z,
@@ -287,20 +287,20 @@ function Ot({ color: e, floorY: t, fontSize: n = nt, grids: r, labelOffset: i =
287
287
  }
288
288
  //#endregion
289
289
  //#region src/viewer/store/ViewerStoreContext.ts
290
- var kt = d(null);
290
+ var Ot = d(null);
291
291
  //#endregion
292
292
  //#region src/viewer/store/useViewerStore.ts
293
293
  function X(e) {
294
- return Je(At(), e);
294
+ return qe(kt(), e);
295
295
  }
296
- function At() {
297
- let e = h(kt);
296
+ function kt() {
297
+ let e = h(Ot);
298
298
  if (!e) throw Error("useViewerStore must be used inside ViewerStoreProvider");
299
299
  return e;
300
300
  }
301
301
  //#endregion
302
302
  //#region src/viewer/store/ViewerStore.ts
303
- var jt = "rgb(17, 148, 189)", Mt = "rgb(104, 198, 227)", Nt = "#ffffff", Pt = 1.5, Ft = "#ffffff", It = 1.5, Lt = {
303
+ var At = "rgb(17, 148, 189)", jt = "rgb(104, 198, 227)", Mt = "#ffffff", Nt = 1.5, Pt = "#ffffff", Ft = 1.5, It = .4, Lt = {
304
304
  bottom: !0,
305
305
  left: !0,
306
306
  right: !0,
@@ -308,29 +308,30 @@ var jt = "rgb(17, 148, 189)", Mt = "rgb(104, 198, 227)", Nt = "#ffffff", Pt = 1.
308
308
  visible: !0
309
309
  };
310
310
  function Rt() {
311
- return Ye((e) => ({
311
+ return Je((e) => ({
312
312
  api: null,
313
313
  defaultHotkeysEnabled: !0,
314
314
  gridAxesVisibility: Lt,
315
315
  lighting: {
316
316
  ambient: {
317
- color: Nt,
318
- intensity: Pt
317
+ color: Mt,
318
+ intensity: Nt
319
319
  },
320
320
  directional: {
321
- color: Ft,
322
- intensity: It
321
+ color: Pt,
322
+ intensity: Ft
323
323
  }
324
324
  },
325
325
  modelNames: {},
326
326
  modelProps: {},
327
327
  modelStructure: {},
328
- preselectionColor: Mt,
328
+ performanceMovingFactor: It,
329
+ preselectionColor: jt,
329
330
  postproductionActivePassFilter: null,
330
331
  postproductionPassType: "N8AO",
331
332
  postproductionSaturation: 0,
332
333
  selected: {},
333
- selectionColor: jt,
334
+ selectionColor: At,
334
335
  selectionInteractionDisabled: !1,
335
336
  showNavCube: !0,
336
337
  showStats: !1,
@@ -406,6 +407,7 @@ function Rt() {
406
407
  setModelNames: (t) => e({ modelNames: t }),
407
408
  setModelProps: (t) => e({ modelProps: t }),
408
409
  setModelStructure: (t) => e({ modelStructure: t }),
410
+ setPerformanceMovingFactor: (t) => e({ performanceMovingFactor: Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : It }),
409
411
  setPreselectionColor: (t) => e({ preselectionColor: t }),
410
412
  setPostproductionActivePassFilter: (t) => e({ postproductionActivePassFilter: t }),
411
413
  setPostproductionPassType: (t) => e({ postproductionPassType: t }),
@@ -464,8 +466,8 @@ function Rt() {
464
466
  }
465
467
  var zt = 2;
466
468
  function Bt() {
467
- let e = new ne(new Uint8Array(256 * 4), 256, 1, ke, Ue);
468
- return e.magFilter = U, e.minFilter = U, e.generateMipmaps = !1, e.needsUpdate = !0, Ht(e, 1, new I(jt)), e;
469
+ let e = new ne(new Uint8Array(256 * 4), 256, 1, ke, He);
470
+ return e.magFilter = U, e.minFilter = U, e.generateMipmaps = !1, e.needsUpdate = !0, Ht(e, 1, new I(At)), e;
469
471
  }
470
472
  function Vt(e) {
471
473
  return `${e.r.toFixed(6)}:${e.g.toFixed(6)}:${e.b.toFixed(6)}`;
@@ -629,7 +631,7 @@ function en(e) {
629
631
  }
630
632
  //#endregion
631
633
  //#region src/viewer/SelectableMesh.tsx
632
- H.prototype.raycast = et;
634
+ H.prototype.raycast = $e;
633
635
  var tn = 1 / 1.5;
634
636
  function nn({ colorPaletteTexture: e, material: t, materialMode: n = "quality", preselectionColor: r, useDoubleSideMaterial: i = !1 }) {
635
637
  let a = new I(t.r, t.g, t.b);
@@ -688,11 +690,11 @@ var an = u.memo(function({ colorPaletteTexture: e, material: t, materialMode: n
688
690
  rn(p, d);
689
691
  }, [p, d]), g(() => {
690
692
  if (!l.current) return;
691
- let e = l.current.geometry, t = new Qe(e, { indirect: !0 });
693
+ let e = l.current.geometry, t = new Ze(e, { indirect: !0 });
692
694
  return Object.assign(e, { boundsTree: t }), s !== void 0 && u.current?.(s), () => {
693
695
  p.dispose(), Object.assign(e, { boundsTree: null });
694
696
  };
695
- }, [p, s]), /* @__PURE__ */ qe("mesh", {
697
+ }, [p, s]), /* @__PURE__ */ Ke("mesh", {
696
698
  frustumCulled: !0,
697
699
  matrix: a,
698
700
  matrixAutoUpdate: !1,
@@ -703,7 +705,7 @@ var an = u.memo(function({ colorPaletteTexture: e, material: t, materialMode: n
703
705
  let t = e.object;
704
706
  t.preselected &&= !1;
705
707
  },
706
- children: [/* @__PURE__ */ qe("bufferGeometry", { children: [
708
+ children: [/* @__PURE__ */ Ke("bufferGeometry", { children: [
707
709
  /* @__PURE__ */ Y("bufferAttribute", {
708
710
  attach: "attributes-position",
709
711
  args: [r.pos, 3]
@@ -791,11 +793,11 @@ var ln = u.memo(function({ colorPaletteTexture: e, material: t, materialMode: n
791
793
  p,
792
794
  m
793
795
  ]), g(() => {
794
- let e = new Qe(f, { indirect: !0 });
796
+ let e = new Ze(f, { indirect: !0 });
795
797
  return Object.assign(f, { boundsTree: e }), s !== void 0 && u.current?.(s), () => {
796
798
  Object.assign(f, { boundsTree: null }), f.dispose();
797
799
  };
798
- }, [f, s]), g(() => () => v.dispose(), [v]), /* @__PURE__ */ qe("mesh", {
800
+ }, [f, s]), g(() => () => v.dispose(), [v]), /* @__PURE__ */ Ke("mesh", {
799
801
  frustumCulled: !0,
800
802
  matrix: a,
801
803
  matrixAutoUpdate: !1,
@@ -896,9 +898,9 @@ function gn({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r
896
898
  let r = t.readyMeshKeys.size, i = g.current;
897
899
  p.current?.(r, i), r >= i && f.current?.(r);
898
900
  }, []);
899
- if (!r) return /* @__PURE__ */ Y(Ke, {});
901
+ if (!r) return /* @__PURE__ */ Y(Ge, {});
900
902
  let v = a ?? r.renderSettings?.materialMode ?? "quality", x = r.renderSettings?.useDoubleSideMaterial === !0, S = c ? ln : an;
901
- return /* @__PURE__ */ qe("group", {
903
+ return /* @__PURE__ */ Ke("group", {
902
904
  matrix: u.coordinationMatrix ?? un,
903
905
  matrixAutoUpdate: !1,
904
906
  userData: { modelID: n },
@@ -912,7 +914,7 @@ function gn({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r
912
914
  onReady: _,
913
915
  readyKey: `${i}:${t.key}`,
914
916
  useDoubleSideMaterial: x
915
- }, t.key)), /* @__PURE__ */ Y(Ot, {
917
+ }, t.key)), /* @__PURE__ */ Y(Dt, {
916
918
  floorY: u.floorY,
917
919
  grids: r.grids,
918
920
  showBottom: l.bottom,
@@ -1050,7 +1052,7 @@ function On(e, t) {
1050
1052
  }
1051
1053
  function kn(e) {
1052
1054
  let t = e.geometry;
1053
- Object.assign(t, { boundsTree: void 0 }), e.geometry.index?.count && Object.assign(t, { boundsTree: new Qe(e.geometry, { indirect: !0 }) });
1055
+ Object.assign(t, { boundsTree: void 0 }), e.geometry.index?.count && Object.assign(t, { boundsTree: new Ze(e.geometry, { indirect: !0 }) });
1054
1056
  }
1055
1057
  function An(e, t, n = !0) {
1056
1058
  e.mesh.geometry.setIndex(new N(t, 1)), n && kn(e.mesh);
@@ -1391,10 +1393,10 @@ var rr = class {
1391
1393
  let n = t.getSize(new q()).length();
1392
1394
  this.tolerance = Math.max(Hn, n * Un), this.closeGapTolerance = Math.max(this.tolerance * Gn, n * Wn);
1393
1395
  let r = Zn(this.plane), i = this.context.getEdgeSegmentsForPlane(this.plane), a = i ? this.getCapSegmentsFromEdgeSegments(i, r) : this.getCapSegments(r), o = this.getClosedContours(a), { elementIDs: s, modelIDs: c, positions: l } = this.triangulateContours(o, r);
1394
- if (e.setAttribute("position", new oe(l, 3)), e.setAttribute("ids", new He(s, 1)), e.setAttribute("modelID", new He(c, 1)), e.setAttribute("colorIndex", nr(s.length, this.context.getUseWebGPU())), s.length) {
1396
+ if (e.setAttribute("position", new oe(l, 3)), e.setAttribute("ids", new Ve(s, 1)), e.setAttribute("modelID", new Ve(c, 1)), e.setAttribute("colorIndex", nr(s.length, this.context.getUseWebGPU())), s.length) {
1395
1397
  let t = new Uint32Array(s.length);
1396
1398
  for (let e = 0; e < t.length; e++) t[e] = e;
1397
- e.setIndex(new He(t, 1));
1399
+ e.setIndex(new Ve(t, 1));
1398
1400
  }
1399
1401
  return l.length && (e.computeVertexNormals(), e.computeBoundingSphere()), e;
1400
1402
  }
@@ -1559,7 +1561,7 @@ var rr = class {
1559
1561
  triangulateContours(e, t) {
1560
1562
  let n = [], r = [], i = [];
1561
1563
  return e.forEach(({ elementID: e, modelID: a, points: o }) => {
1562
- Ie.triangulateShape(o, []).forEach(([s, c, l]) => {
1564
+ Fe.triangulateShape(o, []).forEach(([s, c, l]) => {
1563
1565
  this.pushContourVertex(i, n, r, o[s], t, e, a), this.pushContourVertex(i, n, r, o[c], t, e, a), this.pushContourVertex(i, n, r, o[l], t, e, a);
1564
1566
  });
1565
1567
  }), {
@@ -1697,7 +1699,7 @@ var dr = class {
1697
1699
  let a = n.getX(i);
1698
1700
  return a >= r.count ? null : r.getX(a);
1699
1701
  }
1700
- }, fr = "#0b2f5f", pr = "#0b2f5f", mr = 0, hr = "#1f7ae0", gr = .22, _r = .01, vr = .025, yr = .015, br = .02, xr = 1e-7, Sr = .25, Cr = .15, wr = .25, Tr = 1e-5, Er = .2, Dr = 1, Or = 1;
1702
+ }, fr = "#0b2f5f", pr = "#0b2f5f", mr = 0, hr = "#165eb0", gr = .3, _r = .01, vr = .025, yr = .015, br = .02, xr = 1e-7, Sr = .25, Cr = .15, wr = .25, Tr = 1e-5, Er = .2, Dr = 1, Or = 1;
1701
1703
  function kr(e, t) {
1702
1704
  let n = t.getBoundingClientRect();
1703
1705
  return new K((e.clientX - n.left) / n.width * 2 - 1, -((e.clientY - n.top) / n.height) * 2 + 1);
@@ -2376,7 +2378,8 @@ var Vr = class {
2376
2378
  }
2377
2379
  };
2378
2380
  function Hr(e, t, n, r = !1) {
2379
- let i = E((e) => e.camera), a = E((e) => e.gl), o = E((e) => e.raycaster), s = E((e) => e.scene), c = At(), l = y(() => new Vr({
2381
+ let i = E((e) => e.camera), a = E((e) => e.gl), o = E((e) => e.raycaster), s = E((e) => e.scene), c = kt(), l = b(null);
2382
+ l.current ||= new Vr({
2380
2383
  camera: i,
2381
2384
  cameraUtils: n,
2382
2385
  controlRef: t,
@@ -2387,19 +2390,10 @@ function Hr(e, t, n, r = !1) {
2387
2390
  scene: s,
2388
2391
  useWebGPU: r,
2389
2392
  viewerStore: c
2390
- }), [
2391
- i,
2392
- n,
2393
- t,
2394
- a,
2395
- e,
2396
- o,
2397
- s,
2398
- r,
2399
- c
2400
- ]);
2393
+ });
2394
+ let u = l.current;
2401
2395
  return g(() => {
2402
- l.setContext({
2396
+ u.setContext({
2403
2397
  camera: i,
2404
2398
  cameraUtils: n,
2405
2399
  controlRef: t,
@@ -2414,7 +2408,7 @@ function Hr(e, t, n, r = !1) {
2414
2408
  }, [
2415
2409
  i,
2416
2410
  n,
2417
- l,
2411
+ u,
2418
2412
  t,
2419
2413
  a,
2420
2414
  e,
@@ -2422,42 +2416,42 @@ function Hr(e, t, n, r = !1) {
2422
2416
  s,
2423
2417
  r,
2424
2418
  c
2425
- ]), g(() => () => l.dispose(), [l]), g(() => c.subscribe((e, t) => {
2426
- e.selected === t.selected && e.preselectionColor === t.preselectionColor && e.selectionColor === t.selectionColor || l.updateCapsVisualState();
2427
- }), [l, c]), g(() => {
2419
+ ]), g(() => () => u.dispose(), [u]), g(() => c.subscribe((e, t) => {
2420
+ e.selected === t.selected && e.preselectionColor === t.preselectionColor && e.selectionColor === t.selectionColor || u.updateCapsVisualState();
2421
+ }), [u, c]), g(() => {
2428
2422
  let e = a.domElement, n = t.current;
2429
- return e.addEventListener("pointerdown", l.setHelperHoverMoveStart), window.addEventListener("pointerup", l.setHelperHoverMoveEnd), window.addEventListener("pointercancel", l.setHelperHoverMoveEnd), n?.addEventListener("update", l.setHelperHoverMoving), () => {
2430
- e.removeEventListener("pointerdown", l.setHelperHoverMoveStart), window.removeEventListener("pointerup", l.setHelperHoverMoveEnd), window.removeEventListener("pointercancel", l.setHelperHoverMoveEnd), n?.removeEventListener("update", l.setHelperHoverMoving);
2423
+ return e.addEventListener("pointerdown", u.setHelperHoverMoveStart), window.addEventListener("pointerup", u.setHelperHoverMoveEnd), window.addEventListener("pointercancel", u.setHelperHoverMoveEnd), n?.addEventListener("update", u.setHelperHoverMoving), () => {
2424
+ e.removeEventListener("pointerdown", u.setHelperHoverMoveStart), window.removeEventListener("pointerup", u.setHelperHoverMoveEnd), window.removeEventListener("pointercancel", u.setHelperHoverMoveEnd), n?.removeEventListener("update", u.setHelperHoverMoving);
2431
2425
  };
2432
2426
  }, [
2433
- l,
2427
+ u,
2434
2428
  t,
2435
2429
  a
2436
2430
  ]), y(() => ({
2437
- createClippingRectangle: (e = !1) => l.createClippingRectangle(e),
2438
- createPlaneFromPointAndNormal: (e, t) => l.createPlaneFromPointAndNormal(e, t),
2439
- createPlane: (e) => l.createPlane(e),
2440
- deleteAllPlanes: () => l.deleteAllPlanes(),
2441
- getActive: () => l.getActive(),
2442
- getCapsActive: () => l.getCapsActive(),
2443
- getCapsColor: () => l.getCapsColor(),
2444
- getEdgesActive: () => l.getEdgesActive(),
2445
- getHelpersActive: () => l.getHelpersActive(),
2446
- getPlanes: () => l.getPlanes(),
2447
- setActive: (e) => l.setActive(e),
2448
- setCapsActive: (e) => l.setCapsActive(e),
2449
- setCapsCameraMotionActive: (e) => l.setCapsCameraMotionActive(e),
2450
- setCapsColor: (e) => l.setCapsColor(e),
2451
- setEdgesActive: (e) => l.setEdgesActive(e),
2452
- setHelpersActive: (e) => l.setHelpersActive(e),
2453
- syncWithModel: () => l.syncWithModel(),
2454
- toggle: () => l.toggle(),
2455
- updateEdges: () => l.updateEdges(),
2456
- updateMaterials: () => l.updateMaterials(),
2457
- getSelectableObjects: () => l.getSelectableObjects(),
2458
- getSnapPoints: (e, t) => l.getSnapPoints(e, t),
2459
- setCapsPreselection: (e) => l.setCapsPreselection(e)
2460
- }), [l]);
2431
+ createClippingRectangle: (e = !1) => u.createClippingRectangle(e),
2432
+ createPlaneFromPointAndNormal: (e, t) => u.createPlaneFromPointAndNormal(e, t),
2433
+ createPlane: (e) => u.createPlane(e),
2434
+ deleteAllPlanes: () => u.deleteAllPlanes(),
2435
+ getActive: () => u.getActive(),
2436
+ getCapsActive: () => u.getCapsActive(),
2437
+ getCapsColor: () => u.getCapsColor(),
2438
+ getEdgesActive: () => u.getEdgesActive(),
2439
+ getHelpersActive: () => u.getHelpersActive(),
2440
+ getPlanes: () => u.getPlanes(),
2441
+ setActive: (e) => u.setActive(e),
2442
+ setCapsActive: (e) => u.setCapsActive(e),
2443
+ setCapsCameraMotionActive: (e) => u.setCapsCameraMotionActive(e),
2444
+ setCapsColor: (e) => u.setCapsColor(e),
2445
+ setEdgesActive: (e) => u.setEdgesActive(e),
2446
+ setHelpersActive: (e) => u.setHelpersActive(e),
2447
+ syncWithModel: () => u.syncWithModel(),
2448
+ toggle: () => u.toggle(),
2449
+ updateEdges: () => u.updateEdges(),
2450
+ updateMaterials: () => u.updateMaterials(),
2451
+ getSelectableObjects: () => u.getSelectableObjects(),
2452
+ getSnapPoints: (e, t) => u.getSnapPoints(e, t),
2453
+ setCapsPreselection: (e) => u.setCapsPreselection(e)
2454
+ }), [u]);
2461
2455
  }
2462
2456
  //#endregion
2463
2457
  //#region src/viewer/Camera/useCameraUtils.ts
@@ -2543,7 +2537,7 @@ function $r(e) {
2543
2537
  let a = r.measureText(e), o = a.actualBoundingBoxAscent || Jr * .8, s = a.actualBoundingBoxDescent || Jr * .2, c = Math.max(1, Math.ceil(a.width + Yr * 2)), l = Math.max(1, Math.ceil(o + s + Xr * 2));
2544
2538
  n.width = Math.ceil(c * t), n.height = Math.ceil(l * t), r.scale(t, t), r.clearRect(0, 0, c, l), r.fillStyle = "rgba(255, 255, 255, 0.86)", r.strokeStyle = "rgba(29, 39, 51, 0.22)", r.lineWidth = 1, r.beginPath(), r.roundRect(.5, .5, c - 1, l - 1, 4), r.fill(), r.stroke(), r.font = i, r.fillStyle = "#111827", r.textAlign = "center", r.textBaseline = "middle", r.fillText(e, c / 2, l / 2);
2545
2539
  let u = new F(n);
2546
- return u.colorSpace = Pe, u.generateMipmaps = !1, u.magFilter = B, u.minFilter = B, u.needsUpdate = !0, {
2540
+ return u.colorSpace = Ne, u.generateMipmaps = !1, u.magFilter = B, u.minFilter = B, u.needsUpdate = !0, {
2547
2541
  height: l,
2548
2542
  texture: u,
2549
2543
  width: c
@@ -2625,7 +2619,7 @@ var ei = class e {
2625
2619
  n.position.copy(e), n.scale.copy(this.endpointBaseScale), n.lookAt(t), n.renderOrder = 4, this.endpointMeshes.push(n), this.root.add(n);
2626
2620
  }
2627
2621
  createLabelSprite() {
2628
- let e = new ze(new Be({
2622
+ let e = new Re(new ze({
2629
2623
  depthTest: !1,
2630
2624
  depthWrite: !1,
2631
2625
  transparent: !0
@@ -2929,11 +2923,11 @@ var si = class e {
2929
2923
  return n.translate(0, -e / 2, 0), n.rotateX(-Math.PI / 2), n;
2930
2924
  }
2931
2925
  static createPreviewGeometry() {
2932
- return new Re(.5, 16, 12);
2926
+ return new Le(.5, 16, 12);
2933
2927
  }
2934
2928
  };
2935
2929
  function ci(e, t, n, r, i) {
2936
- let a = E((e) => e.camera), o = E((e) => e.gl), s = E((e) => e.scene), c = E((e) => e.size), l = At(), u = y(() => new si({
2930
+ let a = E((e) => e.camera), o = E((e) => e.gl), s = E((e) => e.scene), c = E((e) => e.size), l = kt(), u = y(() => new si({
2937
2931
  camera: a,
2938
2932
  cameraUtils: n,
2939
2933
  controlRef: t,
@@ -3123,7 +3117,7 @@ function Ii(e, t, n, r, i = new K()) {
3123
3117
  function Li(e, t, n, r, i) {
3124
3118
  let a = Infinity, o = -Infinity, s = Infinity, c = -Infinity, l = 0;
3125
3119
  for (let u = 0; u < 2; u++) for (let d = 0; d < 2; d++) for (let f = 0; f < 2; f++) fi.set(u ? t.max.x : t.min.x, d ? t.max.y : t.min.y, f ? t.max.z : t.min.z), Ii(e, fi, r, i, pi), a = Math.min(a, pi.x), o = Math.max(o, pi.x), s = Math.min(s, pi.y), c = Math.max(c, pi.y), ki(pi, n) && (l += 1);
3126
- return o < n.minX || a > n.maxX || c < n.minY || s > n.maxY ? $e : l === 8 ? Xe : Ze;
3120
+ return o < n.minX || a > n.maxX || c < n.minY || s > n.maxY ? Qe : l === 8 ? Ye : Xe;
3127
3121
  }
3128
3122
  function Ri(e, t, n, r) {
3129
3123
  let i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
@@ -3335,7 +3329,7 @@ function aa(e) {
3335
3329
  };
3336
3330
  }
3337
3331
  function oa(e, t, n, r, i, a, o, s = 0) {
3338
- let c = b("end"), l = X((e) => e.selected), u = X((e) => e.setSelected), d = X((e) => e.addSelected), f = X((e) => e.removeSelected), p = X((e) => e.showStats), m = At(), h = b(null), _ = b(null), v = b(!1), y = b(!1), x = b("add"), S = b(null), C = b(!1), w = b(0), T = b(null), D = b(null), O = b(null), k = b({
3332
+ let c = b("end"), l = X((e) => e.selected), u = X((e) => e.setSelected), d = X((e) => e.addSelected), f = X((e) => e.removeSelected), p = X((e) => e.showStats), m = kt(), h = b(null), _ = b(null), v = b(!1), y = b(!1), x = b("add"), S = b(null), C = b(!1), w = b(0), T = b(null), D = b(null), O = b(null), k = b({
3339
3333
  meshesByModel: /* @__PURE__ */ new Map(),
3340
3334
  root: null,
3341
3335
  version: ""
@@ -3571,17 +3565,17 @@ function ha() {
3571
3565
  if (!t.current || !(e instanceof Ee) && !(e instanceof Te)) return;
3572
3566
  let i = new M().setFromObject(t.current);
3573
3567
  if (i.isEmpty()) return;
3574
- let a = i.getCenter(new q()), o = i.getBoundingSphere(new Le()), s = n.current, c = e instanceof Ee ? ma(e, o.radius) : Math.max(o.radius * da, la);
3568
+ let a = i.getCenter(new q()), o = i.getBoundingSphere(new Ie()), s = n.current, c = e instanceof Ee ? ma(e, o.radius) : Math.max(o.radius * da, la);
3575
3569
  e.up.set(0, 1, 0);
3576
3570
  let l = a.clone().addScaledVector(sa, c);
3577
- s ? (s.cancel(), s.updateCameraUp(), s.setFocalOffset(0, 0, 0, !1), s.setLookAt(l.x, l.y, l.z, a.x, a.y, a.z, !1), e instanceof Te && s.fitToSphere(new Le(a, o.radius * fa), !1), s.update(0), e.updateMatrixWorld(!0)) : (e.position.copy(l), e.lookAt(a)), e instanceof Te && (s || (e.zoom = 1, pa(e, o.radius * 2 * fa))), e.updateProjectionMatrix(), e.updateMatrixWorld(!0), r.current && (r.current.position.copy(a).addScaledVector(sa, c * .8), r.current.lookAt(a));
3571
+ s ? (s.cancel(), s.updateCameraUp(), s.setFocalOffset(0, 0, 0, !1), s.setLookAt(l.x, l.y, l.z, a.x, a.y, a.z, !1), e instanceof Te && s.fitToSphere(new Ie(a, o.radius * fa), !1), s.update(0), e.updateMatrixWorld(!0)) : (e.position.copy(l), e.lookAt(a)), e instanceof Te && (s || (e.zoom = 1, pa(e, o.radius * 2 * fa))), e.updateProjectionMatrix(), e.updateMatrixWorld(!0), r.current && (r.current.position.copy(a).addScaledVector(sa, c * .8), r.current.lookAt(a));
3578
3572
  }, [e]);
3579
3573
  }
3580
3574
  //#endregion
3581
3575
  //#region src/viewer/store/ViewerStoreProvider.tsx
3582
3576
  function ga({ children: e, store: t }) {
3583
3577
  let [n] = x(() => t ?? Rt());
3584
- return /* @__PURE__ */ Y(kt.Provider, {
3578
+ return /* @__PURE__ */ Y(Ot.Provider, {
3585
3579
  value: n,
3586
3580
  children: e
3587
3581
  });
@@ -4557,7 +4551,7 @@ var Fo = "BMT", Io = 1, Lo = {
4557
4551
  return this.deflateBytes(new Uint8Array(e.buffer, e.byteOffset, e.byteLength));
4558
4552
  }
4559
4553
  deflateBytes(e) {
4560
- return tt.deflate(e);
4554
+ return et.deflate(e);
4561
4555
  }
4562
4556
  encodeText(e) {
4563
4557
  return this.textEncoder.encode(e);
@@ -4963,6 +4957,7 @@ function as(e, t, n) {
4963
4957
  getShowNavCube: () => e.getState().showNavCube,
4964
4958
  getShowGridAxes: () => e.getState().gridAxesVisibility.visible,
4965
4959
  getShowStats: () => e.getState().showStats,
4960
+ getPerformanceMovingFactor: () => e.getState().performanceMovingFactor,
4966
4961
  getUserDevice: () => e.getState().userDevice,
4967
4962
  setDefaultHotkeysEnabled: (t) => {
4968
4963
  e.getState().setDefaultHotkeysEnabled(t);
@@ -4973,6 +4968,12 @@ function as(e, t, n) {
4973
4968
  setGridAxisVisibility: (t, n) => {
4974
4969
  e.getState().setGridAxisVisibility(t, n);
4975
4970
  },
4971
+ setPerformaneMovingFactor: (t) => {
4972
+ e.getState().setPerformanceMovingFactor(t);
4973
+ },
4974
+ setPerformanceMovingFactor: (t) => {
4975
+ e.getState().setPerformanceMovingFactor(t);
4976
+ },
4976
4977
  setShowNavCube: (t) => {
4977
4978
  e.getState().setShowNavCube(t);
4978
4979
  },
@@ -5021,9 +5022,9 @@ var os = class {
5021
5022
  }
5022
5023
  }, ss = class {
5023
5024
  decodeBuffer(e) {
5024
- return this.textDecoder.decode(tt.inflate(e));
5025
+ return this.textDecoder.decode(et.inflate(e));
5025
5026
  }
5026
- decoder = tt;
5027
+ decoder = et;
5027
5028
  textDecoder = new TextDecoder("utf-8");
5028
5029
  ChunkType = {
5029
5030
  PROP: 1,
@@ -5600,7 +5601,7 @@ var Qs = new class {
5600
5601
  }
5601
5602
  return i;
5602
5603
  }
5603
- }(), $s = .5, ec = .04, tc = .16, nc = tc, rc = $s * 2 - tc * 2, ic = $s - ec / 2, ac = $s - tc / 2, oc = $s - nc / 2, sc = .63, cc = "#dfe6ec", lc = 260, uc = 30, dc = .3, fc = 8, pc = new q(0, 1, 0), mc = 1e-8, hc = new M(), gc = new Le(), _c = [
5604
+ }(), $s = .5, ec = .04, tc = .16, nc = tc, rc = $s * 2 - tc * 2, ic = $s - ec / 2, ac = $s - tc / 2, oc = $s - nc / 2, sc = .63, cc = "#dfe6ec", lc = 260, uc = 30, dc = .3, fc = 8, pc = new q(0, 1, 0), mc = 1e-8, hc = new M(), gc = new Ie(), _c = [
5604
5605
  {
5605
5606
  direction: [
5606
5607
  0,
@@ -5862,14 +5863,14 @@ function Cc(e, t) {
5862
5863
  let a = r.measureText(e), o = a.actualBoundingBoxAscent || uc * .8, s = a.actualBoundingBoxDescent || uc * .2, c = Math.ceil(a.width + 36), l = Math.ceil(o + s + 20);
5863
5864
  n.width = c, n.height = l, r.clearRect(0, 0, c, l), r.font = i, r.fillStyle = t, r.textAlign = "center", r.textBaseline = "alphabetic", r.fillText(e, c / 2, 10 + o);
5864
5865
  let u = new F(n);
5865
- return u.colorSpace = Pe, u.generateMipmaps = !1, u.magFilter = B, u.minFilter = B, u.anisotropy = fc, u.needsUpdate = !0, {
5866
+ return u.colorSpace = Ne, u.generateMipmaps = !1, u.magFilter = B, u.minFilter = B, u.anisotropy = fc, u.needsUpdate = !0, {
5866
5867
  aspect: c / l,
5867
5868
  texture: u
5868
5869
  };
5869
5870
  }
5870
5871
  function wc({ color: e, label: t, position: n, rotation: r }) {
5871
5872
  let { aspect: i, texture: a } = y(() => Cc(t, e), [e, t]);
5872
- return g(() => () => a.dispose(), [a]), /* @__PURE__ */ qe("mesh", {
5873
+ return g(() => () => a.dispose(), [a]), /* @__PURE__ */ Ke("mesh", {
5873
5874
  position: n,
5874
5875
  renderOrder: 2,
5875
5876
  rotation: r,
@@ -5911,7 +5912,7 @@ function kc({ camera: e, controlRef: t, direction: n, modelRef: r, transitionRef
5911
5912
  }
5912
5913
  function Ac({ action: e, onPick: t }) {
5913
5914
  let [n, r] = x(!1);
5914
- return /* @__PURE__ */ qe("group", {
5915
+ return /* @__PURE__ */ Ke("group", {
5915
5916
  position: e.position,
5916
5917
  onClick: bc,
5917
5918
  onPointerDown: (n) => {
@@ -5923,7 +5924,7 @@ function Ac({ action: e, onPick: t }) {
5923
5924
  onPointerLeave: (e) => {
5924
5925
  bc(e), r(!1);
5925
5926
  },
5926
- children: [/* @__PURE__ */ qe("mesh", {
5927
+ children: [/* @__PURE__ */ Ke("mesh", {
5927
5928
  scale: e.scale,
5928
5929
  children: [/* @__PURE__ */ Y("boxGeometry", { args: [
5929
5930
  1,
@@ -6019,7 +6020,7 @@ var Mc = /* @__PURE__ */ (() => {
6019
6020
  static get fullscreenGeometry() {
6020
6021
  return Mc;
6021
6022
  }
6022
- constructor(e = "Pass", t = new Fe(), n = new Te()) {
6023
+ constructor(e = "Pass", t = new Pe(), n = new Te()) {
6023
6024
  this.name = e, this.renderer = null, this.scene = t, this.camera = n, this.screen = null, this.rtt = !0, this.needsSwap = !0, this.needsDepthBlit = !1, this.needsDepthTexture = !1, this.enabled = !0;
6024
6025
  }
6025
6026
  get renderToScreen() {
@@ -6047,7 +6048,7 @@ var Mc = /* @__PURE__ */ (() => {
6047
6048
  }
6048
6049
  set fullscreenMaterial(t) {
6049
6050
  let n = this.screen;
6050
- n === null ? (n = new H(e.fullscreenGeometry, t), n.frustumCulled = !1, this.scene === null && (this.scene = new Fe()), this.scene.add(n), this.screen = n) : n.material = t;
6051
+ n === null ? (n = new H(e.fullscreenGeometry, t), n.frustumCulled = !1, this.scene === null && (this.scene = new Pe()), this.scene.add(n), this.screen = n) : n.material = t;
6051
6052
  }
6052
6053
  getFullscreenMaterial() {
6053
6054
  return this.fullscreenMaterial;
@@ -6067,7 +6068,7 @@ var Mc = /* @__PURE__ */ (() => {
6067
6068
  dispose() {
6068
6069
  for (let t of Object.keys(this)) {
6069
6070
  let n = this[t];
6070
- (n instanceof J || n instanceof ge || n instanceof Ve || n instanceof e) && this[t].dispose();
6071
+ (n instanceof J || n instanceof ge || n instanceof Be || n instanceof e) && this[t].dispose();
6071
6072
  }
6072
6073
  this.fullscreenMaterial !== null && this.fullscreenMaterial.dispose();
6073
6074
  }
@@ -6171,7 +6172,7 @@ var Mc = /* @__PURE__ */ (() => {
6171
6172
  this.autoResize && this.renderTarget.setSize(e, t);
6172
6173
  }
6173
6174
  initialize(e, t, n) {
6174
- n !== void 0 && (this.renderTarget.texture.type = n, n === Ue ? e !== null && e.outputColorSpace === Pe && (this.renderTarget.texture.colorSpace = Pe) : this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1");
6175
+ n !== void 0 && (this.renderTarget.texture.type = n, n === He ? e !== null && e.outputColorSpace === Ne && (this.renderTarget.texture.colorSpace = Ne) : this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1");
6175
6176
  }
6176
6177
  }, zc = /* @__PURE__ */ new I(), Bc = class extends Nc {
6177
6178
  constructor(e = !0, t = !0, n = !1) {
@@ -6291,7 +6292,7 @@ var Mc = /* @__PURE__ */ (() => {
6291
6292
  setRenderer(e) {
6292
6293
  if (this.renderer = e, e !== null) {
6293
6294
  let t = e.getSize(new K()), n = e.getContext().getContextAttributes().alpha, r = this.inputBuffer.texture.type;
6294
- r === Ue && e.outputColorSpace === Pe && (this.inputBuffer.texture.colorSpace = Pe, this.outputBuffer.texture.colorSpace = Pe, this.inputBuffer.dispose(), this.outputBuffer.dispose()), e.autoClear = !1, this.setSize(t.width, t.height);
6295
+ r === He && e.outputColorSpace === Ne && (this.inputBuffer.texture.colorSpace = Ne, this.outputBuffer.texture.colorSpace = Ne, this.inputBuffer.dispose(), this.outputBuffer.dispose()), e.autoClear = !1, this.setSize(t.width, t.height);
6295
6296
  for (let t of this.passes) t.initialize(e, n, r);
6296
6297
  }
6297
6298
  }
@@ -6301,7 +6302,7 @@ var Mc = /* @__PURE__ */ (() => {
6301
6302
  }
6302
6303
  createDepthTexture() {
6303
6304
  let e = this.inputBuffer, t = new ie();
6304
- this.depthTexture = t, e.stencilBuffer ? (t.format = re, t.type = We) : t.type = se;
6305
+ this.depthTexture = t, e.stencilBuffer ? (t.format = re, t.type = Ue) : t.type = se;
6305
6306
  let n = t.clone();
6306
6307
  return n.name = "EffectComposer.StableDepth", this.depthRenderTarget = new J(e.width, e.height, {
6307
6308
  depthBuffer: !0,
@@ -6329,7 +6330,7 @@ var Mc = /* @__PURE__ */ (() => {
6329
6330
  depthBuffer: e,
6330
6331
  type: n
6331
6332
  }, s = new J(a.width, a.height, o);
6332
- return r > 0 && (s.samples = r), n === Ue && i !== null && i.outputColorSpace === Pe && (s.texture.colorSpace = Pe), s.texture.name = "EffectComposer.Buffer", s.texture.generateMipmaps = !1, s;
6333
+ return r > 0 && (s.samples = r), n === He && i !== null && i.outputColorSpace === Ne && (s.texture.colorSpace = Ne), s.texture.name = "EffectComposer.Buffer", s.texture.generateMipmaps = !1, s;
6333
6334
  }
6334
6335
  setMainScene(e) {
6335
6336
  for (let t of this.passes) t.mainScene = e;
@@ -6763,7 +6764,7 @@ var Mc = /* @__PURE__ */ (() => {
6763
6764
  dispose() {
6764
6765
  for (let e of Object.keys(this)) {
6765
6766
  let t = this[e];
6766
- (t instanceof J || t instanceof ge || t instanceof Ve || t instanceof Nc) && this[e].dispose();
6767
+ (t instanceof J || t instanceof ge || t instanceof Be || t instanceof Nc) && this[e].dispose();
6767
6768
  }
6768
6769
  }
6769
6770
  };
@@ -6814,16 +6815,16 @@ var tl = class extends Nc {
6814
6815
  t !== null && a !== void 0 && a[this.input] !== void 0 && (a[this.input].value = t.texture), e.setRenderTarget(this.renderToScreen ? null : n), e.render(this.scene, this.camera);
6815
6816
  }
6816
6817
  initialize(e, t, n) {
6817
- n !== void 0 && n !== Ue && (this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1");
6818
+ n !== void 0 && n !== He && (this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1");
6818
6819
  }
6819
6820
  };
6820
6821
  function nl(e, t, n) {
6821
6822
  let r = /* @__PURE__ */ new Map([
6822
- [Me, 1],
6823
+ [je, 1],
6823
6824
  [Ae, 2],
6824
6825
  [ke, 4]
6825
6826
  ]), i;
6826
- if (r.has(t) || console.error("Invalid noise texture format"), n === Ue) {
6827
+ if (r.has(t) || console.error("Invalid noise texture format"), n === He) {
6827
6828
  i = new Uint8Array(e * r.get(t));
6828
6829
  for (let e = 0, t = i.length; e < t; ++e) i[e] = Math.random() * 255 + .5;
6829
6830
  } else {
@@ -6833,7 +6834,7 @@ function nl(e, t, n) {
6833
6834
  return i;
6834
6835
  }
6835
6836
  var rl = class extends ne {
6836
- constructor(e, t, n = Me, r = Ue) {
6837
+ constructor(e, t, n = je, r = He) {
6837
6838
  super(nl(e * t, n, r), e, t, n, r), this.needsUpdate = !0;
6838
6839
  }
6839
6840
  }, il = class extends Nc {
@@ -7270,7 +7271,7 @@ var ll = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
7270
7271
  resolutionScale: S
7271
7272
  }), this.depthDownsamplingPass.enabled = a === null, this.ssaoPass = new tl(new dl(e));
7272
7273
  let O = new rl(_l, _l, ke);
7273
- O.wrapS = O.wrapT = Ne;
7274
+ O.wrapS = O.wrapT = Me;
7274
7275
  let k = this.ssaoMaterial;
7275
7276
  k.normalBuffer = t, k.noiseTexture = O, k.minRadiusScale = h, k.samples = r, k.radius = _, k.rings = i, k.fade = b, k.bias = y, k.distanceThreshold = d, k.distanceFalloff = f, k.proximityThreshold = p, k.proximityFalloff = m, s !== void 0 && (k.worldDistanceThreshold = s), c !== void 0 && (k.worldDistanceFalloff = c), l !== void 0 && (k.worldProximityThreshold = l), u !== void 0 && (k.worldProximityFalloff = u), a !== null && (this.ssaoMaterial.normalDepthBuffer = a, this.defines.set("NORMAL_DEPTH", "1")), this.depthAwareUpsampling = o, this.color = x;
7276
7277
  }
@@ -7520,7 +7521,7 @@ function wl(e, t, n) {
7520
7521
  Cl(e, h, n.defines), Cl(e, h, g), r = g.get("fragment"), i = g.get("vertex");
7521
7522
  let _ = t.blendMode;
7522
7523
  if (n.blendModes.set(_.blendFunction, _), a) {
7523
- t.inputColorSpace !== null && t.inputColorSpace !== n.colorSpace && (d += t.inputColorSpace === Pe ? "color0 = sRGBTransferOETF(color0);\n " : "color0 = sRGBToLinear(color0);\n "), t.outputColorSpace === Se ? t.inputColorSpace !== null && (n.colorSpace = t.inputColorSpace) : n.colorSpace = t.outputColorSpace, d += `${e}MainImage(color0, UV, `, (n.attributes & Kc.DEPTH) !== 0 && /MainImage *\([\w\s,]*?depth[\w\s,]*?\)/.test(r) && (d += "depth, ", n.readDepth = !0), d += "color1);\n ";
7524
+ t.inputColorSpace !== null && t.inputColorSpace !== n.colorSpace && (d += t.inputColorSpace === Ne ? "color0 = sRGBTransferOETF(color0);\n " : "color0 = sRGBToLinear(color0);\n "), t.outputColorSpace === Se ? t.inputColorSpace !== null && (n.colorSpace = t.inputColorSpace) : n.colorSpace = t.outputColorSpace, d += `${e}MainImage(color0, UV, `, (n.attributes & Kc.DEPTH) !== 0 && /MainImage *\([\w\s,]*?depth[\w\s,]*?\)/.test(r) && (d += "depth, ", n.readDepth = !0), d += "color1);\n ";
7524
7525
  let i = e + "BlendOpacity";
7525
7526
  n.uniforms.set(i, _.opacity), d += `color0 = blend${_.blendFunction}(color0, color1, ${i});
7526
7527
 
@@ -7567,7 +7568,7 @@ var Tl = class extends Nc {
7567
7568
  else wl("e" + t++, n, e);
7568
7569
  let n = e.shaderParts.get(Z.FRAGMENT_HEAD), r = e.shaderParts.get(Z.FRAGMENT_MAIN_IMAGE), i = e.shaderParts.get(Z.FRAGMENT_MAIN_UV), a = /\bblend\b/g;
7569
7570
  for (let t of e.blendModes.values()) n += t.getShaderCode().replace(a, `blend${t.blendFunction}`) + "\n";
7570
- (e.attributes & Kc.DEPTH) === 0 ? this.needsDepthTexture = !1 : (e.readDepth && (r = "float depth = readDepth(UV);\n\n " + r), this.needsDepthTexture = this.getDepthTexture() === null), e.colorSpace === Pe && (r += "color0 = sRGBToLinear(color0);\n "), e.uvTransformation ? (i = "vec2 transformedUv = vUv;\n" + i, e.defines.set("UV", "transformedUv")) : e.defines.set("UV", "vUv"), e.shaderParts.set(Z.FRAGMENT_HEAD, n), e.shaderParts.set(Z.FRAGMENT_MAIN_IMAGE, r), e.shaderParts.set(Z.FRAGMENT_MAIN_UV, i);
7571
+ (e.attributes & Kc.DEPTH) === 0 ? this.needsDepthTexture = !1 : (e.readDepth && (r = "float depth = readDepth(UV);\n\n " + r), this.needsDepthTexture = this.getDepthTexture() === null), e.colorSpace === Ne && (r += "color0 = sRGBToLinear(color0);\n "), e.uvTransformation ? (i = "vec2 transformedUv = vUv;\n" + i, e.defines.set("UV", "transformedUv")) : e.defines.set("UV", "vUv"), e.shaderParts.set(Z.FRAGMENT_HEAD, n), e.shaderParts.set(Z.FRAGMENT_MAIN_IMAGE, r), e.shaderParts.set(Z.FRAGMENT_MAIN_UV, i);
7571
7572
  for (let [t, n] of e.shaderParts) n !== null && e.shaderParts.set(t, n.trim().replace(/^#/, "\n#"));
7572
7573
  this.skipRendering = t === 0, this.needsSwap = !this.skipRendering, this.fullscreenMaterial.setShaderData(e);
7573
7574
  }
@@ -7595,7 +7596,7 @@ var Tl = class extends Nc {
7595
7596
  initialize(e, t, n) {
7596
7597
  this.renderer = e;
7597
7598
  for (let r of this.effects) r.initialize(e, t, n);
7598
- this.updateMaterial(), n !== void 0 && n !== Ue && (this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1");
7599
+ this.updateMaterial(), n !== void 0 && n !== He && (this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1");
7599
7600
  }
7600
7601
  dispose() {
7601
7602
  super.dispose();
@@ -8170,7 +8171,7 @@ new function e(t) {
8170
8171
  //#endregion
8171
8172
  //#region node_modules/@react-three/postprocessing/node_modules/maath/dist/easing-3be59c6d.esm.js
8172
8173
  var Rl = /* @__PURE__ */ new class extends P {
8173
- boundingSphere = new Le();
8174
+ boundingSphere = new Ie();
8174
8175
  constructor() {
8175
8176
  super(), this.setAttribute("position", new N(new Float32Array([
8176
8177
  -1,
@@ -8417,10 +8418,10 @@ var Jl = class extends Nc {
8417
8418
  opacity: 1,
8418
8419
  vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4(position, 1);\n }",
8419
8420
  fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform float frame;\n varying vec2 vUv;\n void main() {\n vec4 color = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(color.rgb, 1.0 / (frame + 1.0));\n }\n "
8420
- })), this.bluenoise = new ne(Gl, 128, 128), this.bluenoise.colorSpace = Se, this.bluenoise.wrapS = Ne, this.bluenoise.wrapT = Ne, this.bluenoise.minFilter = U, this.bluenoise.magFilter = U, this.bluenoise.needsUpdate = !0, this.lastTime = 0, this.timeRollingAverage = .99, this.needsDepthTexture = !0, this.needsSwap = !0, this._r = new K(), this._c = new I();
8421
+ })), this.bluenoise = new ne(Gl, 128, 128), this.bluenoise.colorSpace = Se, this.bluenoise.wrapS = Me, this.bluenoise.wrapT = Me, this.bluenoise.minFilter = U, this.bluenoise.magFilter = U, this.bluenoise.needsUpdate = !0, this.lastTime = 0, this.timeRollingAverage = .99, this.needsDepthTexture = !0, this.needsSwap = !0, this._r = new K(), this._c = new I();
8421
8422
  }
8422
8423
  configureHalfResTargets() {
8423
- this.firstFrame(), this.configuration.halfRes ? (this.depthDownsampleTarget = new Kl(this.width / 2, this.height / 2, 2), Oe <= 161 && (this.depthDownsampleTarget.textures = this.depthDownsampleTarget.texture), this.depthDownsampleTarget.textures[0].format = Me, this.depthDownsampleTarget.textures[0].type = se, this.depthDownsampleTarget.textures[0].minFilter = U, this.depthDownsampleTarget.textures[0].magFilter = U, this.depthDownsampleTarget.textures[0].depthBuffer = !1, this.depthDownsampleTarget.textures[1].format = ke, this.depthDownsampleTarget.textures[1].type = z, this.depthDownsampleTarget.textures[1].minFilter = U, this.depthDownsampleTarget.textures[1].magFilter = U, this.depthDownsampleTarget.textures[1].depthBuffer = !1, this.depthDownsampleQuad = new Bl(new W(Wl))) : (this.depthDownsampleTarget &&= (this.depthDownsampleTarget.dispose(), null), this.depthDownsampleQuad &&= (this.depthDownsampleQuad.dispose(), null));
8424
+ this.firstFrame(), this.configuration.halfRes ? (this.depthDownsampleTarget = new Kl(this.width / 2, this.height / 2, 2), Oe <= 161 && (this.depthDownsampleTarget.textures = this.depthDownsampleTarget.texture), this.depthDownsampleTarget.textures[0].format = je, this.depthDownsampleTarget.textures[0].type = se, this.depthDownsampleTarget.textures[0].minFilter = U, this.depthDownsampleTarget.textures[0].magFilter = U, this.depthDownsampleTarget.textures[0].depthBuffer = !1, this.depthDownsampleTarget.textures[1].format = ke, this.depthDownsampleTarget.textures[1].type = z, this.depthDownsampleTarget.textures[1].minFilter = U, this.depthDownsampleTarget.textures[1].magFilter = U, this.depthDownsampleTarget.textures[1].depthBuffer = !1, this.depthDownsampleQuad = new Bl(new W(Wl))) : (this.depthDownsampleTarget &&= (this.depthDownsampleTarget.dispose(), null), this.depthDownsampleQuad &&= (this.depthDownsampleQuad.dispose(), null));
8424
8425
  }
8425
8426
  detectTransparency() {
8426
8427
  if (this.autoDetectTransparency) {
@@ -8441,7 +8442,7 @@ var Jl = class extends Nc {
8441
8442
  magFilter: U,
8442
8443
  type: z,
8443
8444
  format: ke
8444
- }), this.transparencyRenderTargetDWTrue.depthTexture = new ie(this.width, this.height, Ge), this.depthCopyPass = new Bl(new W({
8445
+ }), this.transparencyRenderTargetDWTrue.depthTexture = new ie(this.width, this.height, We), this.depthCopyPass = new Bl(new W({
8445
8446
  uniforms: {
8446
8447
  depthTexture: { value: this.depthTexture },
8447
8448
  reverseDepthBuffer: { value: this.configuration.depthBufferType === $.Reverse }
@@ -8759,50 +8760,44 @@ var Jl = class extends Nc {
8759
8760
  }, uu = {
8760
8761
  antialias: !1,
8761
8762
  powerPreference: "high-performance"
8762
- }, du = .1, fu = .02, pu = 150, mu = .75, hu = .6, gu = .4, _u = 150, vu = 500, yu = 5e6, bu = 50, xu = .001, Su = .001, Cu = [
8763
- new K(0, 0),
8764
- new K(0, .3),
8765
- new K(0, -.3),
8766
- new K(.3, 0),
8767
- new K(-.3, 0)
8768
- ], wu = 1e3, Tu = 50, Eu = 30, Du = 240, Ou = 2, ku = 1.25, Au = .08, ju = new q(1, 1, 1).normalize(), Mu = new M(), Nu = new Le(), Pu = new q(), Fu = new q(), Iu = new q(), Lu = /* @__PURE__ */ new WeakMap();
8769
- function Ru({ alpha: e = !0, performanceMode: t }) {
8763
+ }, du = .1, fu = .02, pu = 150, mu = .75, hu = .6, gu = 150, _u = 500, vu = 5e6, yu = 50, bu = .001, xu = .001, Su = 1e3, Cu = 50, wu = 30, Tu = 240, Eu = 2, Du = 1.25, Ou = .08, ku = new q(1, 1, 1).normalize(), Au = new M(), ju = new Ie(), Mu = new q(), Nu = new q(), Pu = new q(), Fu = /* @__PURE__ */ new WeakMap();
8764
+ function Iu({ alpha: e = !0, performanceMode: t }) {
8770
8765
  return async ({ canvas: n }) => {
8771
8766
  let { WebGPURenderer: r } = await import("./three.webgpu-7Fqpf016.js").then((e) => e.c), i = new r({
8772
8767
  alpha: e,
8773
8768
  antialias: !t,
8774
8769
  canvas: n
8775
8770
  });
8776
- return await i.init?.(), zu(i, void 0, !0), i;
8771
+ return await i.init?.(), Lu(i, void 0, !0), i;
8777
8772
  };
8778
8773
  }
8779
- function zu(e, t, n = !1) {
8774
+ function Lu(e, t, n = !1) {
8780
8775
  if (typeof e.setSize != "function") return;
8781
8776
  let r = e.domElement, i = r.clientWidth || r.width, a = r.clientHeight || r.height;
8782
8777
  if (!i || !a) return;
8783
- let o = e.getPixelRatio?.(), s = t ?? o ?? 1, c = Math.max(1, Math.round(i * s)), l = Math.max(1, Math.round(a * s)), u = Lu.get(e), d = o === void 0 || Math.abs(o - s) < .001, f = Math.abs(r.width - c) <= 1 && Math.abs(r.height - l) <= 1, p = u && u.width === i && u.height === a && Math.abs(u.pixelRatio - s) < .001;
8778
+ let o = e.getPixelRatio?.(), s = t ?? o ?? 1, c = Math.max(1, Math.round(i * s)), l = Math.max(1, Math.round(a * s)), u = Fu.get(e), d = o === void 0 || Math.abs(o - s) < .001, f = Math.abs(r.width - c) <= 1 && Math.abs(r.height - l) <= 1, p = u && u.width === i && u.height === a && Math.abs(u.pixelRatio - s) < .001;
8784
8779
  if (!(!n && p && f && d)) {
8785
8780
  if (!n && f && d) {
8786
- Lu.set(e, {
8781
+ Fu.set(e, {
8787
8782
  height: a,
8788
8783
  pixelRatio: s,
8789
8784
  width: i
8790
8785
  });
8791
8786
  return;
8792
8787
  }
8793
- typeof e.setPixelRatio == "function" && !d && e.setPixelRatio(s), e.setSize(i, a, !1), Lu.set(e, {
8788
+ typeof e.setPixelRatio == "function" && !d && e.setPixelRatio(s), e.setSize(i, a, !1), Fu.set(e, {
8794
8789
  height: a,
8795
8790
  pixelRatio: s,
8796
8791
  width: i
8797
8792
  });
8798
8793
  }
8799
8794
  }
8800
- function Bu({ active: e }) {
8795
+ function Ru({ active: e }) {
8801
8796
  let t = E((e) => e.gl), n = E((e) => e.size), r = E((e) => e.viewport.dpr);
8802
8797
  return g(() => {
8803
8798
  if (!e) return;
8804
8799
  let n = null, i = null, a = () => {
8805
- zu(t, r);
8800
+ Lu(t, r);
8806
8801
  };
8807
8802
  return a(), n = requestAnimationFrame(() => {
8808
8803
  a(), i = requestAnimationFrame(a);
@@ -8817,7 +8812,7 @@ function Bu({ active: e }) {
8817
8812
  n.width
8818
8813
  ]), null;
8819
8814
  }
8820
- function Vu({ active: e, onReady: t }) {
8815
+ function zu({ active: e, onReady: t }) {
8821
8816
  return g(() => {
8822
8817
  if (!e) {
8823
8818
  t();
@@ -8835,7 +8830,7 @@ function Vu({ active: e, onReady: t }) {
8835
8830
  t
8836
8831
  ]), null;
8837
8832
  }
8838
- function Hu({ ambientColor: n, ambientIntensity: r, directionalColor: i, directionalIntensity: a, lightRef: o }) {
8833
+ function Bu({ ambientColor: n, ambientIntensity: r, directionalColor: i, directionalIntensity: a, lightRef: o }) {
8839
8834
  let s = y(() => new t(n, r), [n, r]), c = y(() => {
8840
8835
  let t = new e(i, a);
8841
8836
  return t.position.set(10, 10, 10), t;
@@ -8845,9 +8840,9 @@ function Hu({ ambientColor: n, ambientIntensity: r, directionalColor: i, directi
8845
8840
  return e.current = c, () => {
8846
8841
  e.current === c && (e.current = null);
8847
8842
  };
8848
- }, [c, o]), /* @__PURE__ */ qe(Ke, { children: [/* @__PURE__ */ Y("primitive", { object: s }), /* @__PURE__ */ Y("primitive", { object: c })] });
8843
+ }, [c, o]), /* @__PURE__ */ Ke(Ge, { children: [/* @__PURE__ */ Y("primitive", { object: s }), /* @__PURE__ */ Y("primitive", { object: c })] });
8849
8844
  }
8850
- function Uu(e = !1) {
8845
+ function Vu(e = !1) {
8851
8846
  return {
8852
8847
  active: e,
8853
8848
  finalFitDone: !1,
@@ -8855,31 +8850,23 @@ function Uu(e = !1) {
8855
8850
  userInteractedAfterFirstFit: !1
8856
8851
  };
8857
8852
  }
8858
- function Wu(e, t) {
8859
- let n = new je(), r = /* @__PURE__ */ new Set();
8860
- return n.firstHitOnly = !0, e.updateMatrixWorld(), Cu.forEach((i) => {
8861
- n.setFromCamera(i, e);
8862
- let a = n.intersectObjects(t, !1).find((e) => e.object instanceof H);
8863
- a?.object instanceof H && r.add(a.object);
8864
- }), r;
8865
- }
8866
- function Gu(e) {
8853
+ function Hu(e) {
8867
8854
  let t = [];
8868
8855
  return e?.traverse((e) => {
8869
8856
  e instanceof H && e.geometry.attributes.ids && t.push(e);
8870
8857
  }), t;
8871
8858
  }
8872
- function Ku(e) {
8859
+ function Uu(e) {
8873
8860
  let t = e.geometry.index?.count;
8874
8861
  return t === void 0 ? (e.geometry.attributes.position?.count ?? 0) / 3 : t / 3;
8875
8862
  }
8876
- function qu(e) {
8877
- return e.reduce((e, t) => e + Ku(t), 0);
8863
+ function Wu(e) {
8864
+ return e.reduce((e, t) => e + Uu(t), 0);
8878
8865
  }
8879
- function Ju(e) {
8880
- return qu(e) > yu;
8866
+ function Gu(e) {
8867
+ return Wu(e) > vu;
8881
8868
  }
8882
- function Yu(e, t) {
8869
+ function Ku(e, t) {
8883
8870
  if (t <= 0 || !e.length) return [];
8884
8871
  let n = [...e];
8885
8872
  for (let e = n.length - 1; e > 0 && n.length - e <= t; e--) {
@@ -8888,41 +8875,40 @@ function Yu(e, t) {
8888
8875
  }
8889
8876
  return n.slice(-t);
8890
8877
  }
8891
- function Xu(e, t) {
8892
- let n = Gu(e);
8893
- if (!Ju(n)) return null;
8878
+ function qu(e, t) {
8879
+ if (t <= 0) return null;
8880
+ let n = Hu(e);
8881
+ if (!Gu(n)) return null;
8894
8882
  let r = n.filter((e) => e.visible);
8895
8883
  if (r.length < 2) return null;
8896
- let i = Wu(t, r);
8897
- if (!i.size) return null;
8898
- let a = r.filter((e) => !i.has(e)), o = Math.round(a.length * gu);
8899
- if (!o) return null;
8900
- let s = [], c = [];
8901
- a.forEach((e) => {
8884
+ let i = Math.min(r.length, Math.round(r.length * t));
8885
+ if (!i) return null;
8886
+ let a = [], o = [];
8887
+ r.forEach((e) => {
8902
8888
  if (e.userData.isSelected) {
8903
- s.push(e);
8889
+ a.push(e);
8904
8890
  return;
8905
8891
  }
8906
- c.push(e);
8892
+ o.push(e);
8907
8893
  });
8908
- let l = [...Yu(c, o)], u = o - l.length;
8909
- return u > 0 && l.push(...Yu(s, u)), l.length ? {
8910
- hiddenMeshes: l,
8894
+ let s = [...Ku(o, i)], c = i - s.length;
8895
+ return c > 0 && s.push(...Ku(a, c)), s.length ? {
8896
+ hiddenMeshes: s,
8911
8897
  root: e
8912
8898
  } : null;
8913
8899
  }
8914
- function Zu(e) {
8900
+ function Ju(e) {
8915
8901
  let t = /* @__PURE__ */ new Map(), n = 0;
8916
8902
  return e.hiddenMeshes.forEach((e) => {
8917
8903
  e.parent && (t.set(e, e.visible), e.visible && (e.visible = !1, n++));
8918
8904
  }), n ? t : null;
8919
8905
  }
8920
- function Qu(e) {
8906
+ function Yu(e) {
8921
8907
  e?.forEach((e, t) => {
8922
8908
  t.visible = e;
8923
8909
  });
8924
8910
  }
8925
- function $u(e, t, n) {
8911
+ function Xu(e, t, n) {
8926
8912
  let r = e?.[t.modelID] ?? {
8927
8913
  data: {},
8928
8914
  name: t.modelName,
@@ -8945,11 +8931,11 @@ function $u(e, t, n) {
8945
8931
  }
8946
8932
  };
8947
8933
  }
8948
- function ed(e) {
8934
+ function Zu(e) {
8949
8935
  let t = {};
8950
8936
  return e.materialMode !== void 0 && (t.materialMode = e.materialMode), e.uploadMode !== void 0 && (t.uploadMode = e.uploadMode), e.useDoubleSideMaterial !== void 0 && (t.useDoubleSideMaterial = e.useDoubleSideMaterial), Object.keys(t).length ? t : void 0;
8951
8937
  }
8952
- function td(e, t) {
8938
+ function Qu(e, t) {
8953
8939
  let n = { ...e ?? {} };
8954
8940
  return Object.entries(t).forEach(([t, r]) => {
8955
8941
  let i = Number(t);
@@ -8962,73 +8948,73 @@ function td(e, t) {
8962
8948
  };
8963
8949
  }), n;
8964
8950
  }
8965
- function nd(e, t) {
8951
+ function $u(e, t) {
8966
8952
  return Array.isArray(e) ? [Math.min(e[0], t), Math.min(e[1], t)] : typeof e == "number" ? Math.min(e, t) : t;
8967
8953
  }
8968
- function rd(e) {
8969
- return Array.isArray(e) ? [Math.max(e[0], Ou), Math.max(e[1], Ou)] : typeof e == "number" ? Math.max(e, Ou) : Ou;
8954
+ function ed(e) {
8955
+ return Array.isArray(e) ? [Math.max(e[0], Eu), Math.max(e[1], Eu)] : typeof e == "number" ? Math.max(e, Eu) : Eu;
8970
8956
  }
8971
- function id() {
8957
+ function td() {
8972
8958
  let e = navigator, t = navigator.userAgent.toLowerCase(), n = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, r = window.matchMedia?.("(pointer: coarse)").matches ?? !1;
8973
8959
  return e.userAgentData?.mobile || n || /android|iphone|ipad|ipod|mobile|tablet/.test(t) || navigator.maxTouchPoints > 1 && r ? "mobile" : "pc";
8974
8960
  }
8975
- function ad(e) {
8976
- let t = od(e);
8961
+ function nd(e) {
8962
+ let t = rd(e);
8977
8963
  return t ? Math.max(t.radius * fu, du) : du;
8978
8964
  }
8979
- function od(e) {
8980
- if (!e || (Mu.setFromObject(e), Mu.isEmpty())) return null;
8981
- let t = Mu.getBoundingSphere(Nu);
8965
+ function rd(e) {
8966
+ if (!e || (Au.setFromObject(e), Au.isEmpty())) return null;
8967
+ let t = Au.getBoundingSphere(ju);
8982
8968
  return !Number.isFinite(t.radius) || t.radius <= 0 ? null : t;
8983
8969
  }
8984
- function sd(e) {
8970
+ function id(e) {
8985
8971
  return e.type === "Group" && typeof e.userData.modelID == "number";
8986
8972
  }
8987
- function cd(e) {
8988
- return e?.children.filter(sd) ?? [];
8973
+ function ad(e) {
8974
+ return e?.children.filter(id) ?? [];
8989
8975
  }
8990
- function ld(e, t) {
8991
- return cd(e).find((e) => e.userData.modelID === t) ?? null;
8976
+ function od(e, t) {
8977
+ return ad(e).find((e) => e.userData.modelID === t) ?? null;
8992
8978
  }
8993
- function ud(e) {
8979
+ function sd(e) {
8994
8980
  return e instanceof Te ? "orthographic" : "perspective";
8995
8981
  }
8996
- function dd(e) {
8982
+ function cd(e) {
8997
8983
  return e instanceof Ee || e instanceof Te;
8998
8984
  }
8999
- function fd(e) {
8985
+ function ld(e) {
9000
8986
  return e.height > 0 ? e.width / e.height : 1;
9001
8987
  }
9002
- function pd(e) {
9003
- return Math.max(Su, (e.top - e.bottom) / Math.max(e.zoom, 1e-4));
8988
+ function ud(e) {
8989
+ return Math.max(xu, (e.top - e.bottom) / Math.max(e.zoom, 1e-4));
9004
8990
  }
9005
- function md(e, t, n) {
9006
- let r = Math.max(Su, n) * Math.max(e.zoom, 1e-4), i = r * t;
8991
+ function dd(e, t, n) {
8992
+ let r = Math.max(xu, n) * Math.max(e.zoom, 1e-4), i = r * t;
9007
8993
  e.left = -i / 2, e.right = i / 2, e.top = r / 2, e.bottom = -r / 2, e.updateProjectionMatrix();
9008
8994
  }
9009
- function hd(e, t) {
9010
- if (e instanceof Te) return pd(e);
8995
+ function fd(e, t) {
8996
+ if (e instanceof Te) return ud(e);
9011
8997
  if (e instanceof Ee) {
9012
- let n = Math.max(xu, e.position.distanceTo(t));
8998
+ let n = Math.max(bu, e.position.distanceTo(t));
9013
8999
  return 2 * Math.tan(_e.degToRad(e.fov) / 2) * n;
9014
9000
  }
9015
9001
  return 1;
9016
9002
  }
9017
- function gd(e, t) {
9018
- let n = fd(t);
9003
+ function pd(e, t) {
9004
+ let n = ld(t);
9019
9005
  if (e instanceof Ee) {
9020
9006
  e.aspect = n, e.updateProjectionMatrix();
9021
9007
  return;
9022
9008
  }
9023
- e instanceof Te && md(e, n, pd(e));
9009
+ e instanceof Te && dd(e, n, ud(e));
9024
9010
  }
9025
- function _d(e, t) {
9026
- let n = od(t);
9011
+ function md(e, t) {
9012
+ let n = rd(t);
9027
9013
  if (!n) return;
9028
- let r = Math.max(wu, n.radius * Tu, e.near + 1);
9014
+ let r = Math.max(Su, n.radius * Cu, e.near + 1);
9029
9015
  Math.abs(e.far - r) < 1 || (e.far = r, e.updateProjectionMatrix());
9030
9016
  }
9031
- function vd(e, t) {
9017
+ function hd(e, t) {
9032
9018
  let n = new M();
9033
9019
  return Object.entries(e).forEach(([e, r]) => {
9034
9020
  let i = Number(e), a = t.elementBounds.get(i);
@@ -9038,34 +9024,37 @@ function vd(e, t) {
9038
9024
  });
9039
9025
  }), n.isEmpty() ? null : n;
9040
9026
  }
9041
- function yd(e) {
9042
- let t = e.getSize(Iu), n = Math.max(t.x, t.y, t.z);
9043
- return Number.isFinite(n) && n > 0 ? n * Au : du;
9044
- }
9045
- function bd(e, t, n) {
9046
- let r = Math.max(du, (Number.isFinite(n) ? n : du) * ku), i = t.position.distanceTo(e);
9047
- return Number.isFinite(i) && i >= r ? e : (Pu.copy(e).sub(t.position), (!Number.isFinite(Pu.x + Pu.y + Pu.z) || Pu.lengthSq() === 0) && t.getWorldDirection(Pu), Pu.lengthSq() === 0 && Pu.set(0, 0, -1), Pu.normalize(), Fu.copy(t.position).addScaledVector(Pu, r));
9048
- }
9049
- function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadGeneration: i, lightRef: a, materialMode: o, modelRef: s, modelsData: c, modelsLoading: l, onReady: u, onCameraDprModeChange: d, publicApi: f, setSceneApi: p, usePerformanceMoving: h, useWebGPU: _ }) {
9050
- let S = E((e) => e.camera), C = E((e) => e.gl), w = E((e) => e.invalidate), T = E((e) => e.scene), k = E((e) => e.set), A = E((e) => e.size), j = Dn(s), M = Vn(j), { colorPaletteTexture: ee, colorUtils: N } = en(j), P = qr(s), F = Hr(s, n, P, _), I = ci(s, n, P, F.getSelectableObjects, F.getSnapPoints), te = y(() => new Vo(), []), ne = M.buildIndex, re = j.resetIndex, ie = N.applyStoredColors, L = ha(), R = b(null), ae = b(null), oe = b(null), se = b(null), ce = b(null), le = b(null), z = b(null), ue = b(Uu()), de = b([]), fe = b(/* @__PURE__ */ new Map()), pe = b(l), me = b(null), B = b(l), he = b(!1), ge = b(i), V = b(/* @__PURE__ */ new Map()), [H, ve] = x(0), [ye, be] = x(0), U = X((e) => e.showStats), xe = X((e) => e.lighting);
9051
- ge.current !== i && (ge.current = i, V.current.clear(), ue.current = Uu());
9052
- let Se = m((e, t, n) => {
9053
- let r = V.current.get(e) ?? 0;
9054
- V.current.set(e, t), n > 0 && t >= n && r < n && ve((e) => e + 1);
9055
- }, []), Ce = m((e) => {
9027
+ function gd(e) {
9028
+ let t = e.getSize(Pu), n = Math.max(t.x, t.y, t.z);
9029
+ return Number.isFinite(n) && n > 0 ? n * Ou : du;
9030
+ }
9031
+ function _d(e, t, n) {
9032
+ let r = Math.max(du, (Number.isFinite(n) ? n : du) * Du), i = t.position.distanceTo(e);
9033
+ return Number.isFinite(i) && i >= r ? e : (Mu.copy(e).sub(t.position), (!Number.isFinite(Mu.x + Mu.y + Mu.z) || Mu.lengthSq() === 0) && t.getWorldDirection(Mu), Mu.lengthSq() === 0 && Mu.set(0, 0, -1), Mu.normalize(), Nu.copy(t.position).addScaledVector(Mu, r));
9034
+ }
9035
+ function vd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadGeneration: i, lightRef: a, materialMode: o, modelRef: s, modelsData: c, modelsLoading: l, onReady: u, onCameraDprModeChange: d, publicApi: f, setSceneApi: p, usePerformanceMoving: h, useWebGPU: _ }) {
9036
+ let S = E((e) => e.camera), C = E((e) => e.gl), w = E((e) => e.invalidate), T = E((e) => e.scene), k = E((e) => e.set), A = E((e) => e.size), j = Dn(s), M = Vn(j), { colorPaletteTexture: ee, colorUtils: N } = en(j), P = qr(s), F = Hr(s, n, P, _), I = ci(s, n, P, F.getSelectableObjects, F.getSnapPoints), te = y(() => new Vo(), []), ne = M.buildIndex, re = j.resetIndex, ie = N.applyStoredColors, L = ha(), R = b(null), ae = b(null), oe = b(null), se = b(null), ce = b(null), le = b(null), z = b(null), ue = b(Vu()), de = b([]), fe = b(/* @__PURE__ */ new Map()), pe = b(l), me = b(null), B = b(null), he = b(l), ge = b(!1), V = b(i), H = b(/* @__PURE__ */ new Map()), [ve, ye] = x(0), [be, U] = x(0), xe = X((e) => e.showStats), Se = X((e) => e.lighting), Ce = X((e) => e.performanceMovingFactor);
9037
+ V.current !== i && (V.current = i, H.current.clear(), ue.current = Vu(), me.current = null);
9038
+ let we = m((e, t, n) => {
9039
+ let r = H.current.get(e) ?? 0;
9040
+ H.current.set(e, t), n > 0 && t >= n && r < n && ye((e) => e + 1);
9041
+ }, []), De = m((e) => {
9056
9042
  if (s.current = e, !e) return;
9057
9043
  let t = e;
9058
9044
  t.isClippingGroup = _, t.enabled = !1, t.clipIntersection = !1, t.clipShadows = !1, t.clippingPlanes = [];
9059
- }, [s, _]), we = m((e) => {
9060
- let t = me.current;
9061
- return !t || e.camera.uuid !== t.cameraUuid ? !1 : (me.current = null, e.cancel(), e.updateCameraUp(), e.zoomTo(t.zoom, !1), e.setFocalOffset(0, 0, 0, !1), e.setLookAt(t.position.x, t.position.y, t.position.z, t.target.x, t.target.y, t.target.z, !1), e.update(0), w(), !0);
9062
- }, [w]), De = m((e) => {
9045
+ }, [s, _]), Oe = m((e) => {
9046
+ let t = B.current;
9047
+ if (!t || e.camera.uuid !== t.cameraUuid) return !1;
9048
+ B.current = null, e.cancel(), e.updateCameraUp();
9049
+ let n = e;
9050
+ return e.zoomTo(t.zoom, !1), e.setFocalOffset(0, 0, 0, !1), e.setLookAt(t.position.x, t.position.y, t.position.z, t.target.x, t.target.y, t.target.z, !1), e.dollyToCursor = !0, e.infinityDolly = e.camera instanceof Ee, e.minDistance = nd(s.current), e.stop(), e.update(0), n.saveState?.(), w(), !0;
9051
+ }, [w, s]), ke = m((e) => {
9063
9052
  let t = n;
9064
- t.current !== e && (t.current = e, e && (e.minDistance = ad(s.current), we(e)), be((e) => e + 1));
9053
+ t.current !== e && (t.current = e, e && (e.minDistance = nd(s.current), Oe(e)), U((e) => e + 1));
9065
9054
  }, [
9066
9055
  n,
9067
9056
  s,
9068
- we
9057
+ Oe
9069
9058
  ]);
9070
9059
  g(() => {
9071
9060
  s.current && F.updateMaterials();
@@ -9074,7 +9063,7 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9074
9063
  s,
9075
9064
  _
9076
9065
  ]), g(() => {
9077
- gd(S, A), w();
9066
+ pd(S, A), w();
9078
9067
  }, [
9079
9068
  S,
9080
9069
  w,
@@ -9082,101 +9071,102 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9082
9071
  A.width
9083
9072
  ]), v(() => {
9084
9073
  let e = n.current;
9085
- e && we(e);
9074
+ e && Oe(e);
9086
9075
  }, [
9087
9076
  S,
9088
9077
  n,
9089
- ye,
9090
- we
9078
+ be,
9079
+ Oe
9091
9080
  ]);
9092
- let Oe = y(() => {
9081
+ let Ae = y(() => {
9093
9082
  let e = Object.keys(c).sort((e, t) => Number(e) - Number(t));
9094
9083
  for (let t of e) {
9095
9084
  let e = mn(c[Number(t)]);
9096
9085
  if (e) return e;
9097
9086
  }
9098
9087
  return null;
9099
- }, [c]), ke = y(() => fn(Oe ?? void 0), [Oe]), Ae = y(() => Object.entries(c).map(([e, t]) => [Number(e), t]), [c]), je = y(() => Ae.map(([e]) => e), [Ae]), Me = y(() => new Map(Ae.map(([e, t]) => [e, Object.keys(t.data).length])), [Ae]);
9100
- de.current = je, fe.current = Me, pe.current = l, g(() => {
9101
- let e = new Set(je);
9102
- V.current.forEach((t, n) => {
9103
- e.has(n) || V.current.delete(n);
9088
+ }, [c]), je = y(() => fn(Ae ?? void 0), [Ae]), Me = y(() => Object.entries(c).map(([e, t]) => [Number(e), t]), [c]), Ne = y(() => Me.map(([e]) => e), [Me]), Pe = y(() => new Map(Me.map(([e, t]) => [e, Object.keys(t.data).length])), [Me]);
9089
+ de.current = Ne, fe.current = Pe, pe.current = l, g(() => {
9090
+ let e = new Set(Ne);
9091
+ H.current.forEach((t, n) => {
9092
+ e.has(n) || H.current.delete(n);
9104
9093
  });
9105
- }, [je]);
9106
- let Ne = o !== "performance", Pe = m(() => {
9107
- n.current && (n.current.minDistance = ad(s.current));
9108
- }, [n, s]), Fe = m((e, t = !1) => {
9094
+ }, [Ne]);
9095
+ let W = o !== "performance", Fe = m(() => {
9096
+ n.current && (n.current.minDistance = nd(s.current));
9097
+ }, [n, s]), Ie = m((e, t = !1) => {
9109
9098
  let r = n.current;
9110
9099
  if (!r) return !1;
9111
- let i = t ? bd(e, S, r.minDistance) : e;
9100
+ let i = t ? _d(e, S, r.minDistance) : e;
9112
9101
  return r.cancel(), r.setOrbitPoint(i.x, i.y, i.z), !0;
9113
- }, [S, n]), W = m((e) => {
9114
- R.current = e.clone(), Fe(e, !0);
9115
- }, [Fe]), Ie = m(() => {
9102
+ }, [S, n]), Le = m((e) => {
9103
+ R.current = e.clone(), Ie(e, !0);
9104
+ }, [Ie]), Re = m(() => {
9116
9105
  R.current = null, L(s, n, a);
9117
9106
  }, [
9118
9107
  n,
9119
9108
  L,
9120
9109
  a,
9121
9110
  s
9122
- ]), Le = m((e) => {
9123
- if (!dd(S) || ud(S) === e) return;
9111
+ ]), ze = m((e) => {
9112
+ if (!cd(S) || sd(S) === e) return;
9124
9113
  let r = n.current, i = new q(), a = new q();
9125
9114
  r ? (r.getTarget(i, !0), r.getPosition(a, !0)) : (S.getWorldDirection(i), a.copy(S.position), i.add(a));
9126
9115
  let o = a.clone().sub(i);
9127
- o.lengthSq() < xu * xu && S.getWorldDirection(o).multiplyScalar(-1), o.lengthSq() < xu * xu && o.copy(ju), o.normalize();
9128
- let s = fd(A), c = hd(S, i), l = S.near, u = S.far, d = e === "orthographic" ? new Te(-s * c * .5, s * c * .5, c * .5, -c * .5, l, u) : new Ee(bu, s, l, u);
9129
- if (d instanceof Ee) {
9116
+ o.lengthSq() < bu * bu && S.getWorldDirection(o).multiplyScalar(-1), o.lengthSq() < bu * bu && o.copy(ku), o.normalize();
9117
+ let s = ld(A), c = fd(S, i), l = S.near, u = S.far, d = e === "orthographic" ? new Te(-s * c * .5, s * c * .5, c * .5, -c * .5, l, u) : new Ee(yu, s, l, u);
9118
+ if (d.manual = !0, d instanceof Ee) {
9130
9119
  let e = c / (2 * Math.tan(_e.degToRad(d.fov) * .5));
9131
9120
  a.copy(i).addScaledVector(o, e);
9132
9121
  }
9133
- d.position.copy(a), d.up.copy(S.up), d.layers.mask = S.layers.mask, d.lookAt(i), d.updateMatrixWorld(!0), gd(d, A), me.current = {
9122
+ d.position.copy(a), d.up.copy(S.up), d.layers.mask = S.layers.mask, d.lookAt(i), d.updateMatrixWorld(!0), pd(d, A), B.current = {
9134
9123
  cameraUuid: d.uuid,
9135
9124
  position: a.clone(),
9136
9125
  target: i.clone(),
9137
9126
  zoom: d.zoom
9138
- }, r?.cancel(), t.current = d, k({ camera: d }), w();
9127
+ }, r?.cancel(), me.current = d.uuid, t.current = d, k({ camera: d }), w();
9139
9128
  }, [
9140
9129
  S,
9141
9130
  t,
9142
9131
  n,
9143
9132
  w,
9133
+ s,
9144
9134
  k,
9145
9135
  A.height,
9146
9136
  A.width
9147
- ]), Re = m(() => {
9148
- let e = ud(S) === "perspective" ? "orthographic" : "perspective";
9149
- return Le(e), e;
9150
- }, [S, Le]), ze = m(() => {
9137
+ ]), Be = m(() => {
9138
+ let e = sd(S) === "perspective" ? "orthographic" : "perspective";
9139
+ return ze(e), e;
9140
+ }, [S, ze]), Ve = m(() => {
9151
9141
  if (pe.current) return !0;
9152
9142
  let e = de.current;
9153
9143
  return e.length ? !e.every((e) => {
9154
9144
  let t = fe.current.get(e) ?? 0;
9155
- return t <= 0 ? !0 : (V.current.get(e) ?? 0) >= t;
9145
+ return t <= 0 ? !0 : (H.current.get(e) ?? 0) >= t;
9156
9146
  }) : !1;
9157
- }, []), Be = m((t) => {
9147
+ }, []), G = m((t) => {
9158
9148
  if (!t) return !1;
9159
- let n = ze();
9160
- if (!e || !r) return n || (ue.current = Uu()), !1;
9149
+ let n = Ve();
9150
+ if (!e || !r) return n || (ue.current = Vu()), !1;
9161
9151
  let i = ue.current;
9162
9152
  if (n) {
9163
- i.active || (ue.current = Uu(!0));
9153
+ i.active || (ue.current = Vu(!0));
9164
9154
  let e = ue.current;
9165
9155
  return e.firstFitDone ? !1 : (e.firstFitDone = !0, !0);
9166
9156
  }
9167
- return i.active ? i.finalFitDone ? !1 : i.firstFitDone && i.userInteractedAfterFirstFit ? (ue.current = Uu(), !1) : (i.finalFitDone = !0, !0) : !0;
9157
+ return i.active ? i.finalFitDone ? !1 : i.firstFitDone && i.userInteractedAfterFirstFit ? (ue.current = Vu(), !1) : (i.finalFitDone = !0, !0) : !0;
9168
9158
  }, [
9169
9159
  e,
9170
9160
  r,
9171
- ze
9172
- ]), Ve = m((e, t = !1) => {
9161
+ Ve
9162
+ ]), He = m((e, t = !1) => {
9173
9163
  let r = n.current;
9174
9164
  if (!r) return;
9175
- let i = vd(e, j.buildIndex());
9165
+ let i = hd(e, j.buildIndex());
9176
9166
  if (!i) return;
9177
9167
  let a = i.getCenter(new q());
9178
9168
  if (R.current = a.clone(), r.cancel(), t) {
9179
- let e = yd(i);
9169
+ let e = gd(i);
9180
9170
  r.fitToBox(i, !0, {
9181
9171
  paddingBottom: e,
9182
9172
  paddingLeft: e,
@@ -9184,16 +9174,16 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9184
9174
  paddingTop: e
9185
9175
  }).then(() => {
9186
9176
  let e = R.current;
9187
- e && Fe(e, !0);
9177
+ e && Ie(e, !0);
9188
9178
  });
9189
9179
  return;
9190
9180
  }
9191
- Fe(a, !0);
9181
+ Ie(a, !0);
9192
9182
  }, [
9193
- Fe,
9183
+ Ie,
9194
9184
  n,
9195
9185
  j
9196
- ]), He = y(() => {
9186
+ ]), Ue = y(() => {
9197
9187
  let e = (e) => ({
9198
9188
  ...e,
9199
9189
  activeViewRoot: s.current
@@ -9214,7 +9204,7 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9214
9204
  let e = oe.current;
9215
9205
  e !== null && (oe.current = null, F.setEdgesActive(e));
9216
9206
  }, r = () => {
9217
- z.current && (Qu(z.current), z.current = null, w());
9207
+ z.current && (Yu(z.current), z.current = null, w());
9218
9208
  };
9219
9209
  if (!h) {
9220
9210
  e(), r(), t(), F.setCapsCameraMotionActive(!1), d("sleep");
@@ -9235,7 +9225,7 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9235
9225
  }, [
9236
9226
  F,
9237
9227
  n,
9238
- ye,
9228
+ be,
9239
9229
  w,
9240
9230
  d,
9241
9231
  h
@@ -9245,11 +9235,11 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9245
9235
  }, t = () => {
9246
9236
  ce.current !== null && (window.clearTimeout(ce.current), ce.current = null);
9247
9237
  }, r = (n = !1) => {
9248
- e(), z.current && (Qu(z.current), z.current = null, w()), n && (t(), le.current = null);
9238
+ e(), z.current && (Yu(z.current), z.current = null, w()), n && (t(), le.current = null);
9249
9239
  }, i = () => {
9250
9240
  t(), ce.current = window.setTimeout(() => {
9251
9241
  ce.current = null, le.current = null;
9252
- }, vu);
9242
+ }, _u);
9253
9243
  };
9254
9244
  if (!h) {
9255
9245
  r(!0);
@@ -9259,28 +9249,28 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9259
9249
  if (!a) return;
9260
9250
  let o = () => {
9261
9251
  if (se.current = null, z.current) return;
9262
- s.current?.updateMatrixWorld(!0), (!le.current || le.current.root !== s.current) && (le.current = Xu(s.current, S));
9252
+ s.current?.updateMatrixWorld(!0), (!le.current || le.current.root !== s.current) && (le.current = qu(s.current, Ce));
9263
9253
  let e = le.current;
9264
9254
  if (!e) return;
9265
- let t = Zu(e);
9255
+ let t = Ju(e);
9266
9256
  t && (z.current = t, w());
9267
9257
  }, c = () => {
9268
- t(), !z.current && se.current === null && (se.current = window.setTimeout(o, _u));
9258
+ t(), !z.current && se.current === null && (se.current = window.setTimeout(o, gu));
9269
9259
  }, l = () => {
9270
9260
  r(), i();
9271
9261
  };
9272
- return a.addEventListener("wake", c), a.addEventListener("controlstart", c), a.addEventListener("sleep", l), () => {
9273
- a.removeEventListener("wake", c), a.removeEventListener("controlstart", c), a.removeEventListener("sleep", l), r(!0);
9262
+ return a.addEventListener("control", c), a.addEventListener("sleep", l), () => {
9263
+ a.removeEventListener("control", c), a.removeEventListener("sleep", l), r(!0);
9274
9264
  };
9275
9265
  }, [
9276
- S,
9277
9266
  n,
9278
- ye,
9267
+ be,
9279
9268
  w,
9280
9269
  s,
9270
+ Ce,
9281
9271
  h
9282
9272
  ]), g(() => {
9283
- l && !B.current && (ue.current = Uu(!0)), B.current = l;
9273
+ l && !he.current && (ue.current = Vu(!0)), he.current = l;
9284
9274
  }, [l]), g(() => {
9285
9275
  let e = n.current, t = C.domElement, r = () => {
9286
9276
  let e = ue.current;
@@ -9291,19 +9281,19 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9291
9281
  };
9292
9282
  }, [
9293
9283
  n,
9294
- ye,
9284
+ be,
9295
9285
  C
9296
9286
  ]);
9297
- let G = m(() => !ze(), [ze]);
9298
- return oa(s, n, P, W, F.getSelectableObjects, F.setCapsPreselection, G, ye), ui(), g(() => {
9287
+ let We = m(() => !Ve(), [Ve]);
9288
+ return oa(s, n, P, Le, F.getSelectableObjects, F.setCapsPreselection, We, be), ui(), g(() => {
9299
9289
  let e = C.domElement, t = (e) => {
9300
9290
  let t = R.current;
9301
- t && e.button === 0 && (e.ctrlKey || e.metaKey || e.shiftKey || Fe(t, !0));
9291
+ t && e.button === 0 && (e.ctrlKey || e.metaKey || e.shiftKey || Ie(t, !0));
9302
9292
  };
9303
9293
  return e.addEventListener("pointerdown", t, !0), () => {
9304
9294
  e.removeEventListener("pointerdown", t, !0);
9305
9295
  };
9306
- }, [Fe, C]), g(() => (P.setClippingSource(F), () => {
9296
+ }, [Ie, C]), g(() => (P.setClippingSource(F), () => {
9307
9297
  P.setClippingSource(null);
9308
9298
  }), [P, F]), g(() => (t.current = S, () => {
9309
9299
  t.current === S && (t.current = null);
@@ -9312,15 +9302,15 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9312
9302
  let t = null, n = !1, r = (e) => {
9313
9303
  t = requestAnimationFrame(e);
9314
9304
  }, i = () => {
9315
- let e = ze();
9305
+ let e = Ve();
9316
9306
  if (!e) {
9317
9307
  let e = ue.current;
9318
9308
  if (e.active && e.firstFitDone && e.userInteractedAfterFirstFit) {
9319
- ue.current = Uu();
9309
+ ue.current = Vu();
9320
9310
  return;
9321
9311
  }
9322
9312
  }
9323
- Ie(), e || (ue.current = Uu());
9313
+ Re(), e || (ue.current = Vu());
9324
9314
  }, a = () => {
9325
9315
  if (e) {
9326
9316
  if (!_) {
@@ -9341,15 +9331,15 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9341
9331
  }
9342
9332
  }, o = (e) => {
9343
9333
  if (n || !s.current) return;
9344
- s.current.updateMatrixWorld(!0), (S instanceof Ee || S instanceof Te) && _d(S, s.current), Pe(), re();
9334
+ s.current.updateMatrixWorld(!0), (S instanceof Ee || S instanceof Te) && md(S, s.current), Fe(), re();
9345
9335
  let r = ne();
9346
9336
  if (!r.records.size && e > 0) {
9347
9337
  t = requestAnimationFrame(() => o(e - 1));
9348
9338
  return;
9349
9339
  }
9350
- ie(), F.syncWithModel(), I.syncWithModel(), Be(r.records.size > 0) && a();
9340
+ ie(), F.syncWithModel(), I.syncWithModel(), me.current !== S.uuid && G(r.records.size > 0) && a();
9351
9341
  };
9352
- return r(() => o(_ ? Du : Eu)), () => {
9342
+ return r(() => o(_ ? Tu : wu)), () => {
9353
9343
  n = !0, t !== null && cancelAnimationFrame(t);
9354
9344
  };
9355
9345
  }, [
@@ -9360,17 +9350,17 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9360
9350
  F,
9361
9351
  n,
9362
9352
  I,
9363
- Ie,
9364
- ze,
9353
+ Re,
9354
+ Ve,
9365
9355
  a,
9366
9356
  C,
9367
9357
  s,
9368
9358
  c,
9369
- H,
9359
+ ve,
9370
9360
  re,
9371
9361
  T,
9372
- Be,
9373
- Pe,
9362
+ G,
9363
+ Fe,
9374
9364
  _
9375
9365
  ]), g(() => {
9376
9366
  let e = () => {
@@ -9380,11 +9370,11 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9380
9370
  };
9381
9371
  return p({
9382
9372
  camera: {
9383
- fitCamera: Ie,
9373
+ fitCamera: Re,
9384
9374
  getIntersection: P.getIntersection,
9385
- getProjection: () => ud(S),
9386
- setProjection: Le,
9387
- toggleProjection: Re
9375
+ getProjection: () => sd(S),
9376
+ setProjection: ze,
9377
+ toggleProjection: Be
9388
9378
  },
9389
9379
  clipping: {
9390
9380
  createClippingRectangle: F.createClippingRectangle,
@@ -9414,7 +9404,7 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9414
9404
  rebuildModelByColors: N.rebuildModelByColors,
9415
9405
  setColor: N.setColor
9416
9406
  },
9417
- converter: He,
9407
+ converter: Ue,
9418
9408
  dimensions: {
9419
9409
  cancelDrawing: I.cancelDrawing,
9420
9410
  changeAxes: I.changeAxes,
@@ -9435,8 +9425,8 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9435
9425
  geometryUtils: {
9436
9426
  getAllIds: M.getAllIds,
9437
9427
  getIfcSpacesVisibility: M.getIfcSpacesVisibility,
9438
- getModelGeometry: (e) => ld(s.current, e),
9439
- getModelsGeometry: () => cd(s.current),
9428
+ getModelGeometry: (e) => od(s.current, e),
9429
+ getModelsGeometry: () => ad(s.current),
9440
9430
  hideByIds: (e) => t(() => M.hideByIds(e)),
9441
9431
  hideSelected: () => t(M.hideSelected),
9442
9432
  isolateByIds: (e) => t(() => M.isolateByIds(e)),
@@ -9447,36 +9437,36 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9447
9437
  showByIds: (e) => t(() => M.showByIds(e)),
9448
9438
  toggleIIfcSpacesVisibility: () => t(M.toggleIIfcSpacesVisibility)
9449
9439
  },
9450
- selector: { setTargetToSelection: Ve }
9451
- }), he.current || (he.current = !0, u?.(f)), () => p(null);
9440
+ selector: { setTargetToSelection: He }
9441
+ }), ge.current || (ge.current = !0, u?.(f)), () => p(null);
9452
9442
  }, [
9453
9443
  S,
9454
9444
  F,
9455
9445
  P,
9456
9446
  N,
9457
9447
  n,
9458
- He,
9448
+ Ue,
9459
9449
  I,
9460
- Ie,
9450
+ Re,
9461
9451
  M,
9462
9452
  a,
9463
9453
  s,
9464
9454
  u,
9465
9455
  f,
9466
- Le,
9456
+ ze,
9467
9457
  p,
9468
- Ve,
9469
- Re
9470
- ]), /* @__PURE__ */ qe(Ke, { children: [
9471
- Ne && (_ ? /* @__PURE__ */ Y(Hu, {
9472
- ambientColor: xe.ambient.color,
9473
- ambientIntensity: xe.ambient.intensity,
9474
- directionalColor: xe.directional.color,
9475
- directionalIntensity: xe.directional.intensity,
9458
+ He,
9459
+ Be
9460
+ ]), /* @__PURE__ */ Ke(Ge, { children: [
9461
+ W && (_ ? /* @__PURE__ */ Y(Bu, {
9462
+ ambientColor: Se.ambient.color,
9463
+ ambientIntensity: Se.ambient.intensity,
9464
+ directionalColor: Se.directional.color,
9465
+ directionalIntensity: Se.directional.intensity,
9476
9466
  lightRef: a
9477
- }) : /* @__PURE__ */ qe(Ke, { children: [/* @__PURE__ */ Y("ambientLight", {
9478
- intensity: xe.ambient.intensity,
9479
- color: xe.ambient.color
9467
+ }) : /* @__PURE__ */ Ke(Ge, { children: [/* @__PURE__ */ Y("ambientLight", {
9468
+ intensity: Se.ambient.intensity,
9469
+ color: Se.ambient.color
9480
9470
  }), /* @__PURE__ */ Y("directionalLight", {
9481
9471
  ref: a,
9482
9472
  position: [
@@ -9484,36 +9474,36 @@ function xd({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
9484
9474
  10,
9485
9475
  10
9486
9476
  ],
9487
- color: xe.directional.color,
9488
- intensity: xe.directional.intensity
9477
+ color: Se.directional.color,
9478
+ intensity: Se.directional.intensity
9489
9479
  })] })),
9490
- U && /* @__PURE__ */ Y(O, {}),
9480
+ xe && /* @__PURE__ */ Y(O, {}),
9491
9481
  /* @__PURE__ */ Y("group", {
9492
- ref: Ce,
9493
- children: Ae.map(([e, t]) => /* @__PURE__ */ Y(_n, {
9482
+ ref: De,
9483
+ children: Me.map(([e, t]) => /* @__PURE__ */ Y(_n, {
9494
9484
  colorPaletteTexture: ee,
9495
- coordinationMatrix: ke,
9485
+ coordinationMatrix: je,
9496
9486
  data: t,
9497
9487
  loadGeneration: i,
9498
9488
  materialMode: o,
9499
9489
  modelID: e,
9500
- onUploadComplete: (t) => Se(e, t, Me.get(e) ?? t),
9501
- onUploadProgress: (t, n) => Se(e, t, n),
9490
+ onUploadComplete: (t) => we(e, t, Pe.get(e) ?? t),
9491
+ onUploadProgress: (t, n) => we(e, t, n),
9502
9492
  useWebGPU: _
9503
9493
  }, e))
9504
9494
  }),
9505
9495
  /* @__PURE__ */ Y(D, {
9506
- camera: dd(S) ? S : void 0,
9496
+ camera: cd(S) ? S : void 0,
9507
9497
  dollyToCursor: !0,
9508
- infinityDolly: !0,
9498
+ infinityDolly: S instanceof Ee,
9509
9499
  minDistance: du,
9510
- ref: De,
9500
+ ref: ke,
9511
9501
  draggingSmoothTime: .03,
9512
9502
  smoothTime: .05
9513
- })
9503
+ }, S.uuid)
9514
9504
  ] });
9515
9505
  }
9516
- function Sd({ pipelineRef: e }) {
9506
+ function yd({ pipelineRef: e }) {
9517
9507
  let t = E((e) => e.camera), n = E((e) => e.gl), r = E((e) => e.scene);
9518
9508
  return T(() => {
9519
9509
  let i = e.current;
@@ -9524,10 +9514,10 @@ function Sd({ pipelineRef: e }) {
9524
9514
  n.render(r, t);
9525
9515
  }, 1), null;
9526
9516
  }
9527
- function Cd(e) {
9517
+ function bd(e) {
9528
9518
  return e === "N8AO" || e === "SSAO";
9529
9519
  }
9530
- function wd({ setActivePassFilter: e, type: t }) {
9520
+ function xd({ setActivePassFilter: e, type: t }) {
9531
9521
  let n = b(null), r = b(null), i = m(() => {
9532
9522
  r.current !== null && (window.cancelAnimationFrame(r.current), r.current = null);
9533
9523
  }, []), a = m(() => {
@@ -9562,8 +9552,8 @@ function wd({ setActivePassFilter: e, type: t }) {
9562
9552
  case "SSAO": return /* @__PURE__ */ Y(tu, { ref: o });
9563
9553
  }
9564
9554
  }
9565
- function Td({ enabled: e }) {
9566
- let t = X((e) => e.postproductionPassType), n = X((e) => e.postproductionSaturation), r = X((e) => e.setPostproductionActivePassFilter), i = Cd(t), a = n !== 0;
9555
+ function Sd({ enabled: e }) {
9556
+ let t = X((e) => e.postproductionPassType), n = X((e) => e.postproductionSaturation), r = X((e) => e.setPostproductionActivePassFilter), i = bd(t), a = n !== 0;
9567
9557
  return g(() => {
9568
9558
  if (!e) {
9569
9559
  r(null);
@@ -9574,16 +9564,16 @@ function Td({ enabled: e }) {
9574
9564
  e,
9575
9565
  i,
9576
9566
  r
9577
- ]), !e || !i && !a ? null : /* @__PURE__ */ qe(Zl, {
9567
+ ]), !e || !i && !a ? null : /* @__PURE__ */ Ke(Zl, {
9578
9568
  enableNormalPass: t === "SSAO",
9579
- children: [i ? /* @__PURE__ */ Y(wd, {
9569
+ children: [i ? /* @__PURE__ */ Y(xd, {
9580
9570
  setActivePassFilter: r,
9581
9571
  type: t
9582
- }) : /* @__PURE__ */ Y(Ke, {}), a ? /* @__PURE__ */ Y(eu, { saturation: n }) : /* @__PURE__ */ Y(Ke, {})]
9572
+ }) : /* @__PURE__ */ Y(Ge, {}), a ? /* @__PURE__ */ Y(eu, { saturation: n }) : /* @__PURE__ */ Y(Ge, {})]
9583
9573
  });
9584
9574
  }
9585
- function Ed({ enabled: e }) {
9586
- let t = E((e) => e.camera), n = E((e) => e.gl), r = E((e) => e.invalidate), i = E((e) => e.scene), a = X((e) => e.postproductionPassType), o = X((e) => e.postproductionSaturation), s = X((e) => e.setPostproductionActivePassFilter), c = Cd(a), l = o !== 0, u = e && (c || l), d = b(null), [f, p] = x(null);
9575
+ function Cd({ enabled: e }) {
9576
+ let t = E((e) => e.camera), n = E((e) => e.gl), r = E((e) => e.invalidate), i = E((e) => e.scene), a = X((e) => e.postproductionPassType), o = X((e) => e.postproductionSaturation), s = X((e) => e.setPostproductionActivePassFilter), c = bd(a), l = o !== 0, u = e && (c || l), d = b(null), [f, p] = x(null);
9587
9577
  return g(() => {
9588
9578
  u || s(null);
9589
9579
  }, [u, s]), g(() => {
@@ -9648,9 +9638,9 @@ function Ed({ enabled: e }) {
9648
9638
  o,
9649
9639
  i,
9650
9640
  s
9651
- ]), u ? /* @__PURE__ */ Y(Sd, { pipelineRef: d }) : null;
9641
+ ]), u ? /* @__PURE__ */ Y(yd, { pipelineRef: d }) : null;
9652
9642
  }
9653
- function Dd({ autoFitCamera: e = !0, camera: t = {
9643
+ function wd({ autoFitCamera: e = !0, camera: t = {
9654
9644
  position: [
9655
9645
  10,
9656
9646
  10,
@@ -9661,7 +9651,7 @@ function Dd({ autoFitCamera: e = !0, camera: t = {
9661
9651
  let C = b(null), w = b(null), T = b(null), E = b(null), [D, O] = x(), [k, A] = x(!1), [j, M] = x(!0), [ee, N] = x(null), P = b(void 0), F = b(!1), I = b(null), te = b(null), ne = b({
9662
9652
  lastProgress: 0,
9663
9653
  requestID: 0
9664
- }), re = b(0), ie = b(!v), L = b(/* @__PURE__ */ new Set()), R = At(), ae = X((e) => e.setModelNames), oe = X((e) => e.setModelProps), se = X((e) => e.setModelStructure), ce = X((e) => e.setShowNavCube), le = X((e) => e.setShowStats), z = X((e) => e.setUserDevice), ue = X((e) => e.showNavCube), de = k, fe = de ? D ?? o : o ?? D, pe = r ?? j, me = l ? nd(n, 1) : n, B = nd(me, l ? hu : mu), he = s ?? (l ? "performance" : void 0), [ge, _e] = x("sleep"), V = rd(me), H = y(() => v ? Ru({ performanceMode: l }) : l ? uu : void 0, [l, v]), ve = l ? lu : cu, ye = m(() => {
9654
+ }), re = b(0), ie = b(!v), L = b(/* @__PURE__ */ new Set()), R = kt(), ae = X((e) => e.setModelNames), oe = X((e) => e.setModelProps), se = X((e) => e.setModelStructure), ce = X((e) => e.setShowNavCube), le = X((e) => e.setShowStats), z = X((e) => e.setUserDevice), ue = X((e) => e.showNavCube), de = k, fe = de ? D ?? o : o ?? D, pe = r ?? j, me = l ? $u(n, 1) : n, B = $u(me, l ? hu : mu), he = s ?? (l ? "performance" : void 0), [ge, _e] = x("sleep"), V = ed(me), H = y(() => v ? Iu({ performanceMode: l }) : l ? uu : void 0, [l, v]), ve = l ? lu : cu, ye = m(() => {
9665
9655
  ie.current = !0, L.current.forEach((e) => e()), L.current.clear();
9666
9656
  }, []), be = m(() => ie.current ? Promise.resolve() : new Promise((e) => {
9667
9657
  let t = window.setTimeout(() => {
@@ -9699,9 +9689,9 @@ function Dd({ autoFitCamera: e = !0, camera: t = {
9699
9689
  return t?.(r), r;
9700
9690
  });
9701
9691
  }, []), Ce = m((e, t, n) => {
9702
- Se((t) => $u(t, e, n), t);
9692
+ Se((t) => Xu(t, e, n), t);
9703
9693
  }, [Se]), we = m(async (e, t = {}) => {
9704
- let { clearViewer: n = !1, fitToView: r = !0, onChunk: i, onModelLoadingChange: a, onModelProgress: o, onModelsDataChange: s, onProgress: c, ...l } = t, u = re.current + 1, d = ed(l);
9694
+ let { clearViewer: n = !1, fitToView: r = !0, onChunk: i, onModelLoadingChange: a, onModelProgress: o, onModelsDataChange: s, onProgress: c, ...l } = t, u = re.current + 1, d = Zu(l);
9705
9695
  re.current = u, N(null), I.current = null, te.current = null, ne.current = {
9706
9696
  lastProgress: 0,
9707
9697
  onModelProgress: o,
@@ -9724,7 +9714,7 @@ function Dd({ autoFitCamera: e = !0, camera: t = {
9724
9714
  onProgress: f
9725
9715
  } : { onProgress: f }
9726
9716
  });
9727
- return re.current === u && Se((e) => t ? td(e, r) : {
9717
+ return re.current === u && Se((e) => t ? Qu(e, r) : {
9728
9718
  ...e ?? {},
9729
9719
  ...r
9730
9720
  }, s), r;
@@ -9746,7 +9736,7 @@ function Dd({ autoFitCamera: e = !0, camera: t = {
9746
9736
  reset: xe
9747
9737
  }), [we, xe]);
9748
9738
  return g(() => (d(Te), () => d(null)), [Te, d]), g(() => {
9749
- z(id());
9739
+ z(td());
9750
9740
  }, [z]), g(() => {
9751
9741
  le(!!h);
9752
9742
  }, [le, h]), g(() => {
@@ -9775,21 +9765,21 @@ function Dd({ autoFitCamera: e = !0, camera: t = {
9775
9765
  we,
9776
9766
  a,
9777
9767
  i
9778
- ]), fe ? /* @__PURE__ */ qe("div", {
9768
+ ]), fe ? /* @__PURE__ */ Ke("div", {
9779
9769
  style: ou,
9780
9770
  children: [/* @__PURE__ */ Y(S, {
9781
9771
  camera: t,
9782
9772
  dpr: _ && ge === "move" ? B : me,
9783
9773
  gl: H,
9784
- children: /* @__PURE__ */ qe(ga, {
9774
+ children: /* @__PURE__ */ Ke(ga, {
9785
9775
  store: R,
9786
9776
  children: [
9787
- /* @__PURE__ */ Y(Vu, {
9777
+ /* @__PURE__ */ Y(zu, {
9788
9778
  active: v,
9789
9779
  onReady: ye
9790
9780
  }),
9791
- /* @__PURE__ */ Y(Bu, { active: v }),
9792
- /* @__PURE__ */ Y(xd, {
9781
+ /* @__PURE__ */ Y(Ru, { active: v }),
9782
+ /* @__PURE__ */ Y(vd, {
9793
9783
  autoFitCamera: e,
9794
9784
  cameraRef: C,
9795
9785
  controlRef: w,
@@ -9807,8 +9797,8 @@ function Dd({ autoFitCamera: e = !0, camera: t = {
9807
9797
  usePerformanceMoving: _,
9808
9798
  useWebGPU: v
9809
9799
  }),
9810
- /* @__PURE__ */ Y(Td, { enabled: !v }),
9811
- /* @__PURE__ */ Y(Ed, { enabled: v })
9800
+ /* @__PURE__ */ Y(Sd, { enabled: !v }),
9801
+ /* @__PURE__ */ Y(Cd, { enabled: v })
9812
9802
  ]
9813
9803
  })
9814
9804
  }, v ? "viewer-webgpu" : "viewer-webgl"), ue && /* @__PURE__ */ Y("div", {
@@ -9826,9 +9816,9 @@ function Dd({ autoFitCamera: e = !0, camera: t = {
9826
9816
  })
9827
9817
  }, "nav-cube-webgl")
9828
9818
  })]
9829
- }) : /* @__PURE__ */ Y(Ke, {});
9819
+ }) : /* @__PURE__ */ Y(Ge, {});
9830
9820
  }
9831
- var Od = f(function(e, t) {
9821
+ var Td = f(function(e, t) {
9832
9822
  let [n] = x(Rt), r = b(!1), i = b(!1), a = y(() => new ru(), []), { defaultSelected: o, onSelectedChange: s, selected: c } = e, l = m((e) => {
9833
9823
  a.set(e);
9834
9824
  }, [a]), u = y(() => new iu(), []), d = m((e) => {
@@ -9854,7 +9844,7 @@ var Od = f(function(e, t) {
9854
9844
  });
9855
9845
  }, [s, n]), /* @__PURE__ */ Y(ga, {
9856
9846
  store: n,
9857
- children: /* @__PURE__ */ Y(Dd, {
9847
+ children: /* @__PURE__ */ Y(wd, {
9858
9848
  ...e,
9859
9849
  publicApi: f,
9860
9850
  setModelsApi: d,
@@ -9862,6 +9852,6 @@ var Od = f(function(e, t) {
9862
9852
  })
9863
9853
  });
9864
9854
  });
9865
- Od.displayName = "Viewer";
9855
+ Td.displayName = "Viewer";
9866
9856
  //#endregion
9867
- export { ss as BMTLoader, Vo as BmtConverter, Uo as ConvertIfcFileToBmt, Wo as ConvertToBmt, ei as DimensionLine, si as DimensionsUtils, ns as FilteredElementsCollector, Ot as ModelGrids, jc as NavigationCube, Od as Viewer, ga as ViewerStoreProvider, Ho as bmtConverter, Ms as convertIfcFilesToBmtInWorker, Ns as createBmtConverterWorker, _s as createBmtWorker, Gs as createIfcWorker, Rt as createViewerStore, ao as exportExcel, no as exportModelPropertiesToExcel, gs as loadBmtModelsInWorker, Ws as loadIfcModelsInWorker, Qs as loader, ci as useDimensionsUtils, X as useViewerStore, At as useViewerStoreApi };
9857
+ export { ss as BMTLoader, Vo as BmtConverter, Uo as ConvertIfcFileToBmt, Wo as ConvertToBmt, ei as DimensionLine, si as DimensionsUtils, ns as FilteredElementsCollector, Dt as ModelGrids, jc as NavigationCube, Td as Viewer, ga as ViewerStoreProvider, Ho as bmtConverter, Ms as convertIfcFilesToBmtInWorker, Ns as createBmtConverterWorker, _s as createBmtWorker, Gs as createIfcWorker, Rt as createViewerStore, ao as exportExcel, no as exportModelPropertiesToExcel, gs as loadBmtModelsInWorker, Ws as loadIfcModelsInWorker, Qs as loader, ci as useDimensionsUtils, X as useViewerStore, kt as useViewerStoreApi };