shop-components 0.3.3 → 0.3.5

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.
@@ -9,7 +9,7 @@ var U = (n, e, t) => (Qs(n, e, "read from private field"), t ? t.call(n) : e.get
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  e instanceof WeakSet ? e.add(n) : e.set(n, t);
11
11
  }, Ae = (n, e, t, i) => (Qs(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t);
12
- import { BufferAttribute as oe, BufferGeometry as se, Matrix4 as Q, Matrix3 as $r, Vector3 as b, Vector4 as Xe, MeshBasicMaterial as Pt, Mesh as j, ShaderMaterial as si, NoBlending as ti, WebGLRenderTarget as Le, FloatType as le, RGBAFormat as J, NearestFilter as K, Vector2 as F, PerspectiveCamera as Bi, DataUtils as De, DataTexture as ke, HalfFloatType as xe, LinearFilter as ye, RepeatWrapping as Ze, RedFormat as hs, ClampToEdgeWrapping as Oe, Source as kn, Quaternion as Fn, DataArrayTexture as Bn, DoubleSide as ri, BackSide as en, FrontSide as fs, Color as Z, WebGLArrayRenderTarget as On, UnsignedByteType as ks, NoToneMapping as zn, RGFormat as Un, NormalBlending as tn, Spherical as Hn, EquirectangularReflectionMapping as Fs, LinearMipMapLinearFilter as Nn, Clock as Oi, Scene as ds, AdditiveBlending as Wn, Box3 as Y, Sphere as zi, CompressedTexture as Vn, Texture as Ve, InterleavedBuffer as Gn, InterleavedBufferAttribute as qn, TextureLoader as sn, MeshStandardMaterial as jn, Group as he, LineSegments as ps, LineBasicMaterial as Zs, Object3D as Rt, LineDashedMaterial as ms, RingGeometry as Xs, BoxGeometry as Yn, EdgesGeometry as Qn, SRGBColorSpace as wt, AnimationMixer as Zn, LoopOnce as Xn, Plane as Bs, Line3 as Fe, Triangle as Yt, MathUtils as Ge, DirectionalLight as Kn, NoColorSpace as Ks, PlaneGeometry as Di, MeshLambertMaterial as Jn, DirectionalLightHelper as $n, PlaneHelper as eo, UniformsUtils as to, WebGLRenderer as io, OrthographicCamera as gs, Raycaster as so, MeshPhysicalMaterial as ro, PointLight as no, ACESFilmicToneMapping as oo, ShaderChunk as Js, Euler as ao } from "three";
12
+ import { BufferAttribute as le, BufferGeometry as ne, Matrix4 as Q, Matrix3 as $r, Vector3 as b, Vector4 as Xe, MeshBasicMaterial as Pt, Mesh as j, ShaderMaterial as si, NoBlending as ti, WebGLRenderTarget as Le, FloatType as ue, RGBAFormat as J, NearestFilter as K, Vector2 as F, PerspectiveCamera as Bi, DataUtils as De, DataTexture as ke, HalfFloatType as xe, LinearFilter as ye, RepeatWrapping as Ze, RedFormat as hs, ClampToEdgeWrapping as Oe, Source as kn, Quaternion as Fn, DataArrayTexture as Bn, DoubleSide as ri, BackSide as en, FrontSide as fs, Color as Z, WebGLArrayRenderTarget as On, UnsignedByteType as ks, NoToneMapping as zn, RGFormat as Un, NormalBlending as tn, Spherical as Hn, EquirectangularReflectionMapping as Fs, LinearMipMapLinearFilter as Nn, Clock as Oi, Scene as ds, AdditiveBlending as Wn, Box3 as Y, Sphere as zi, CompressedTexture as Vn, Texture as Ve, InterleavedBuffer as Gn, InterleavedBufferAttribute as qn, TextureLoader as sn, MeshStandardMaterial as jn, Group as he, LineSegments as ps, LineBasicMaterial as Zs, Object3D as Rt, LineDashedMaterial as ms, RingGeometry as Xs, BoxGeometry as Yn, EdgesGeometry as Qn, SRGBColorSpace as wt, AnimationMixer as Zn, LoopOnce as Xn, Plane as Bs, Line3 as Fe, Triangle as Yt, MathUtils as Ge, DirectionalLight as Kn, NoColorSpace as Ks, PlaneGeometry as Di, MeshLambertMaterial as Jn, DirectionalLightHelper as $n, PlaneHelper as eo, UniformsUtils as to, WebGLRenderer as io, OrthographicCamera as gs, Raycaster as so, MeshPhysicalMaterial as ro, PointLight as no, ACESFilmicToneMapping as oo, ShaderChunk as Js, Euler as ao } from "three";
13
13
  import { HDRLoader as lo } from "three/examples/jsm/loaders/HDRLoader.js";
14
14
  import { RenderPass as $s } from "three/examples/jsm/postprocessing/RenderPass";
15
15
  import { OutlinePass as er } from "three/examples/jsm/postprocessing/OutlinePass";
@@ -50,7 +50,7 @@ function rn(n, e, t = 0) {
50
50
  }
51
51
  function Qt(n, e = null) {
52
52
  const t = n.array.constructor, i = n.normalized, s = n.itemSize, a = e === null ? n.count : e;
53
- return new oe(new t(s * a), s, i);
53
+ return new le(new t(s * a), s, i);
54
54
  }
55
55
  function yt(n, e) {
56
56
  if (!n && !e)
@@ -96,7 +96,7 @@ function Bo(n, e, t) {
96
96
  for (const s in i)
97
97
  i[s].count !== t && n.deleteAttribute(s);
98
98
  }
99
- function Oo(n, e = {}, t = new se()) {
99
+ function Oo(n, e = {}, t = new ne()) {
100
100
  const {
101
101
  useGroups: i = !1,
102
102
  forceUpdate: s = !1,
@@ -115,7 +115,7 @@ function Oo(n, e = {}, t = new se()) {
115
115
  }
116
116
  if (c) {
117
117
  let r = !1;
118
- if (t.index || (t.setIndex(new oe(new Uint32Array(u), 1, !1)), r = !0), r || o) {
118
+ if (t.index || (t.setIndex(new le(new Uint32Array(u), 1, !1)), r = !0), r || o) {
119
119
  let l = 0, h = 0;
120
120
  const m = t.getIndex();
121
121
  for (let v = 0, p = n.length; v < p; v++) {
@@ -150,7 +150,7 @@ function zo(n, e, t) {
150
150
  let u = n.getAttribute("materialIndex");
151
151
  if (!u || u.count !== a) {
152
152
  let d;
153
- t.length <= 255 ? d = new Uint8Array(a) : d = new Uint16Array(a), u = new oe(d, 1, !1), n.deleteAttribute("materialIndex"), n.setAttribute("materialIndex", u);
153
+ t.length <= 255 ? d = new Uint8Array(a) : d = new Uint16Array(a), u = new le(d, 1, !1), n.deleteAttribute("materialIndex"), n.setAttribute("materialIndex", u);
154
154
  }
155
155
  const f = u.array;
156
156
  for (let d = 0; d < c.length; d++) {
@@ -170,22 +170,22 @@ function Uo(n, e) {
170
170
  }
171
171
  if (!n.attributes.normal && e && e.includes("normal") && n.computeVertexNormals(), !n.attributes.uv && e && e.includes("uv")) {
172
172
  const t = n.attributes.position.count;
173
- n.setAttribute("uv", new oe(new Float32Array(t * 2), 2, !1));
173
+ n.setAttribute("uv", new le(new Float32Array(t * 2), 2, !1));
174
174
  }
175
175
  if (!n.attributes.uv2 && e && e.includes("uv2")) {
176
176
  const t = n.attributes.position.count;
177
- n.setAttribute("uv2", new oe(new Float32Array(t * 2), 2, !1));
177
+ n.setAttribute("uv2", new le(new Float32Array(t * 2), 2, !1));
178
178
  }
179
179
  if (!n.attributes.tangent && e && e.includes("tangent"))
180
180
  if (n.attributes.uv && n.attributes.normal)
181
181
  n.computeTangents();
182
182
  else {
183
183
  const t = n.attributes.position.count;
184
- n.setAttribute("tangent", new oe(new Float32Array(t * 4), 4, !1));
184
+ n.setAttribute("tangent", new le(new Float32Array(t * 4), 4, !1));
185
185
  }
186
186
  if (!n.attributes.color && e && e.includes("color")) {
187
187
  const t = n.attributes.position.count, i = new Float32Array(t * 4);
188
- i.fill(1), n.setAttribute("color", new oe(i, 4));
188
+ i.fill(1), n.setAttribute("color", new le(i, 4));
189
189
  }
190
190
  }
191
191
  function zs(n) {
@@ -271,7 +271,7 @@ function Wo(n) {
271
271
  }
272
272
  return n;
273
273
  }
274
- function Vo(n, e = {}, t = new se()) {
274
+ function Vo(n, e = {}, t = new ne()) {
275
275
  e = {
276
276
  applyWorldTransforms: !0,
277
277
  attributes: [],
@@ -291,7 +291,7 @@ function Vo(n, e = {}, t = new se()) {
291
291
  }
292
292
  return n.matrixWorld.determinant() < 0 && Wo(t), t;
293
293
  }
294
- class Go extends se {
294
+ class Go extends ne {
295
295
  constructor() {
296
296
  super(), this.version = 0, this.hash = null, this._diff = new Ho();
297
297
  }
@@ -333,7 +333,7 @@ function Yo(n, e, t) {
333
333
  for (const s in i)
334
334
  e.deleteAttribute(s);
335
335
  for (const s in t.attributes)
336
- e.setAttribute(t.attributes[s], new oe(new Float32Array(0), 4, !1));
336
+ e.setAttribute(t.attributes[s], new le(new Float32Array(0), 4, !1));
337
337
  } else
338
338
  Oo(n, t, e);
339
339
  for (const i in e.attributes)
@@ -345,8 +345,8 @@ class Qo {
345
345
  }
346
346
  _getDummyMesh() {
347
347
  if (!this._dummyMesh) {
348
- const e = new Pt(), t = new se();
349
- t.setAttribute("position", new oe(new Float32Array(9), 3)), this._dummyMesh = new j(t, e);
348
+ const e = new Pt(), t = new ne();
349
+ t.setAttribute("position", new le(new Float32Array(9), 3)), this._dummyMesh = new j(t, e);
350
350
  }
351
351
  return this._dummyMesh;
352
352
  }
@@ -374,7 +374,7 @@ class Qo {
374
374
  setObjects(e) {
375
375
  Array.isArray(e) ? this.objects = [...e] : this.objects = [e];
376
376
  }
377
- generate(e = new se()) {
377
+ generate(e = new ne()) {
378
378
  const { useGroups: t, overwriteIndex: i, _intermediateGeometry: s, _geometryMergeSets: a } = this, o = this._getMeshes(), c = [], u = [], f = a.get(e) || [];
379
379
  this._updateIntermediateGeometries();
380
380
  let d = !1;
@@ -422,7 +422,7 @@ class Ko {
422
422
  return !!this.bvh;
423
423
  }
424
424
  constructor(e) {
425
- this.bvhOptions = {}, this.attributes = ["position", "normal", "tangent", "color", "uv", "uv2"], this.generateBVH = !0, this.bvh = null, this.geometry = new se(), this.staticGeometryGenerator = new Qo(e), this._bvhWorker = null, this._pendingGenerate = null, this._buildAsync = !1;
425
+ this.bvhOptions = {}, this.attributes = ["position", "normal", "tangent", "color", "uv", "uv2"], this.generateBVH = !0, this.bvh = null, this.geometry = new ne(), this.staticGeometryGenerator = new Qo(e), this._bvhWorker = null, this._pendingGenerate = null, this._buildAsync = !1;
426
426
  }
427
427
  setObjects(e) {
428
428
  this.staticGeometryGenerator.setObjects(e);
@@ -821,7 +821,7 @@ class ta extends Us {
821
821
  class ia {
822
822
  generate(e, t = 256) {
823
823
  const i = new Le(t, t, {
824
- type: le,
824
+ type: ue,
825
825
  format: J,
826
826
  minFilter: K,
827
827
  magFilter: K,
@@ -882,7 +882,7 @@ function oa(n, e = xe) {
882
882
  a instanceof Int8Array || a instanceof Int16Array || a instanceof Int32Array ? c = 2 ** (8 * a.BYTES_PER_ELEMENT - 1) - 1 : c = 2 ** (8 * a.BYTES_PER_ELEMENT) - 1;
883
883
  for (let u = 0, f = a.length; u < f; u++) {
884
884
  let d = a[u];
885
- t.type === xe && (d = De.fromHalfFloat(a[u])), t.type !== le && t.type !== xe && (d /= c), e === xe && (o[u] = De.toHalfFloat(d));
885
+ t.type === xe && (d = De.fromHalfFloat(a[u])), t.type !== ue && t.type !== xe && (d /= c), e === xe && (o[u] = De.toHalfFloat(d));
886
886
  }
887
887
  t.image.data = o, t.type = e;
888
888
  }
@@ -918,8 +918,8 @@ class aa {
918
918
  for (let p = 0; p < s; p++) {
919
919
  let g = 0;
920
920
  for (let _ = 0; _ < i; _++) {
921
- const y = p * i + _, x = De.fromHalfFloat(a[4 * y + 0]), w = De.fromHalfFloat(a[4 * y + 1]), A = De.fromHalfFloat(a[4 * y + 2]), S = na(x, w, A);
922
- g += S, d += S, o[y] = S, c[y] = g;
921
+ const y = p * i + _, x = De.fromHalfFloat(a[4 * y + 0]), w = De.fromHalfFloat(a[4 * y + 1]), A = De.fromHalfFloat(a[4 * y + 2]), T = na(x, w, A);
922
+ g += T, d += T, o[y] = T, c[y] = g;
923
923
  }
924
924
  if (g !== 0)
925
925
  for (let _ = p * i, y = p * i + i; _ < y; _++)
@@ -944,11 +944,11 @@ class aa {
944
944
  m.image = { width: s, height: 1, data: l }, m.needsUpdate = !0, v.image = { width: i, height: s, data: h }, v.needsUpdate = !0, this.totalSum = d, this.map = t;
945
945
  }
946
946
  }
947
- const Qi = 6, la = 0, ca = 1, ua = 2, ha = 3, fa = 4, ge = new b(), ee = new b(), ur = new Q(), ot = new Fn(), hr = new b(), at = new b(), da = new b(0, 1, 0);
947
+ const Qi = 6, la = 0, ca = 1, ua = 2, ha = 3, fa = 4, ge = new b(), ie = new b(), ur = new Q(), ot = new Fn(), hr = new b(), at = new b(), da = new b(0, 1, 0);
948
948
  class pa {
949
949
  constructor() {
950
950
  const e = new ke(new Float32Array(4), 1, 1);
951
- e.format = J, e.type = le, e.wrapS = Oe, e.wrapT = Oe, e.generateMipmaps = !1, e.minFilter = K, e.magFilter = K, this.tex = e, this.count = 0;
951
+ e.format = J, e.type = ue, e.wrapS = Oe, e.wrapT = Oe, e.generateMipmaps = !1, e.minFilter = K, e.magFilter = K, this.tex = e, this.count = 0;
952
952
  }
953
953
  updateFrom(e, t = []) {
954
954
  const i = this.tex, s = Math.max(e.length * Qi, 1), a = Math.ceil(Math.sqrt(s));
@@ -959,18 +959,18 @@ class pa {
959
959
  let l = 0;
960
960
  for (let m = 0; m < Qi * 4; m++)
961
961
  o[r + m] = 0;
962
- d.getWorldPosition(ee), o[r + l++] = ee.x, o[r + l++] = ee.y, o[r + l++] = ee.z;
962
+ d.getWorldPosition(ie), o[r + l++] = ie.x, o[r + l++] = ie.y, o[r + l++] = ie.z;
963
963
  let h = la;
964
964
  if (d.isRectAreaLight && d.isCircular ? h = ca : d.isSpotLight ? h = ua : d.isDirectionalLight ? h = ha : d.isPointLight && (h = fa), o[r + l++] = h, o[r + l++] = d.color.r, o[r + l++] = d.color.g, o[r + l++] = d.color.b, o[r + l++] = d.intensity, d.getWorldQuaternion(ot), d.isRectAreaLight)
965
- ge.set(d.width, 0, 0).applyQuaternion(ot), o[r + l++] = ge.x, o[r + l++] = ge.y, o[r + l++] = ge.z, l++, ee.set(0, d.height, 0).applyQuaternion(ot), o[r + l++] = ee.x, o[r + l++] = ee.y, o[r + l++] = ee.z, o[r + l++] = ge.cross(ee).length() * (d.isCircular ? Math.PI / 4 : 1);
965
+ ge.set(d.width, 0, 0).applyQuaternion(ot), o[r + l++] = ge.x, o[r + l++] = ge.y, o[r + l++] = ge.z, l++, ie.set(0, d.height, 0).applyQuaternion(ot), o[r + l++] = ie.x, o[r + l++] = ie.y, o[r + l++] = ie.z, o[r + l++] = ge.cross(ie).length() * (d.isCircular ? Math.PI / 4 : 1);
966
966
  else if (d.isSpotLight) {
967
967
  const m = d.radius || 0;
968
- hr.setFromMatrixPosition(d.matrixWorld), at.setFromMatrixPosition(d.target.matrixWorld), ur.lookAt(hr, at, da), ot.setFromRotationMatrix(ur), ge.set(1, 0, 0).applyQuaternion(ot), o[r + l++] = ge.x, o[r + l++] = ge.y, o[r + l++] = ge.z, l++, ee.set(0, 1, 0).applyQuaternion(ot), o[r + l++] = ee.x, o[r + l++] = ee.y, o[r + l++] = ee.z, o[r + l++] = Math.PI * m * m, o[r + l++] = m, o[r + l++] = d.decay, o[r + l++] = d.distance, o[r + l++] = Math.cos(d.angle), o[r + l++] = Math.cos(d.angle * (1 - d.penumbra)), o[r + l++] = d.iesMap ? t.indexOf(d.iesMap) : -1;
968
+ hr.setFromMatrixPosition(d.matrixWorld), at.setFromMatrixPosition(d.target.matrixWorld), ur.lookAt(hr, at, da), ot.setFromRotationMatrix(ur), ge.set(1, 0, 0).applyQuaternion(ot), o[r + l++] = ge.x, o[r + l++] = ge.y, o[r + l++] = ge.z, l++, ie.set(0, 1, 0).applyQuaternion(ot), o[r + l++] = ie.x, o[r + l++] = ie.y, o[r + l++] = ie.z, o[r + l++] = Math.PI * m * m, o[r + l++] = m, o[r + l++] = d.decay, o[r + l++] = d.distance, o[r + l++] = Math.cos(d.angle), o[r + l++] = Math.cos(d.angle * (1 - d.penumbra)), o[r + l++] = d.iesMap ? t.indexOf(d.iesMap) : -1;
969
969
  } else if (d.isPointLight) {
970
970
  const m = ge.setFromMatrixPosition(d.matrixWorld);
971
971
  o[r + l++] = m.x, o[r + l++] = m.y, o[r + l++] = m.z, l++, l += 4, l += 1, o[r + l++] = d.decay, o[r + l++] = d.distance;
972
972
  } else if (d.isDirectionalLight) {
973
- const m = ge.setFromMatrixPosition(d.matrixWorld), v = ee.setFromMatrixPosition(d.target.matrixWorld);
973
+ const m = ge.setFromMatrixPosition(d.matrixWorld), v = ie.setFromMatrixPosition(d.target.matrixWorld);
974
974
  at.subVectors(m, v).normalize(), o[r + l++] = at.x, o[r + l++] = at.y, o[r + l++] = at.z;
975
975
  }
976
976
  }
@@ -1004,7 +1004,7 @@ function fr(n, e, t, i, s) {
1004
1004
  }
1005
1005
  class ma extends Bn {
1006
1006
  constructor() {
1007
- super(), this._textures = [], this.type = le, this.format = J, this.internalFormat = "RGBA32F";
1007
+ super(), this._textures = [], this.type = ue, this.format = J, this.internalFormat = "RGBA32F";
1008
1008
  }
1009
1009
  updateAttribute(e, t) {
1010
1010
  const i = this._textures[e];
@@ -1111,7 +1111,7 @@ class wa {
1111
1111
  }
1112
1112
  class ba extends ke {
1113
1113
  constructor() {
1114
- super(new Float32Array(4), 1, 1), this.format = J, this.type = le, this.wrapS = Oe, this.wrapT = Oe, this.minFilter = K, this.magFilter = K, this.generateMipmaps = !1, this.features = new wa();
1114
+ super(new Float32Array(4), 1, 1), this.format = J, this.type = ue, this.wrapS = Oe, this.wrapT = Oe, this.minFilter = K, this.magFilter = K, this.generateMipmaps = !1, this.features = new wa();
1115
1115
  }
1116
1116
  updateFrom(e, t) {
1117
1117
  function i(m, v, p = -1) {
@@ -1322,7 +1322,7 @@ class Pa {
1322
1322
  }
1323
1323
  class Ra extends ke {
1324
1324
  constructor(e = 1, t = 1, i = 8) {
1325
- super(new Float32Array(1), 1, 1, J, le), this.minFilter = K, this.magFilter = K, this.strata = i, this.sampler = null, this.generator = new Pa(), this.stableNoise = !1, this.random = () => this.stableNoise ? this.generator.nextFloat() : Math.random(), this.init(e, t, i);
1325
+ super(new Float32Array(1), 1, 1, J, ue), this.minFilter = K, this.magFilter = K, this.strata = i, this.sampler = null, this.generator = new Pa(), this.stableNoise = !1, this.random = () => this.stableNoise ? this.generator.nextFloat() : Math.random(), this.init(e, t, i);
1326
1326
  }
1327
1327
  init(e = this.image.height, t = this.image.width, i = this.strata) {
1328
1328
  const { image: s } = this;
@@ -1487,7 +1487,7 @@ function Fa(n) {
1487
1487
  }
1488
1488
  class Ba extends ke {
1489
1489
  constructor(e = 64, t = 1) {
1490
- super(new Float32Array(4), 1, 1, J, le), this.minFilter = K, this.magFilter = K, this.size = e, this.channels = t, this.update();
1490
+ super(new Float32Array(4), 1, 1, J, ue), this.minFilter = K, this.magFilter = K, this.size = e, this.channels = t, this.update();
1491
1491
  }
1492
1492
  update() {
1493
1493
  const e = this.channels, t = this.size, i = new La();
@@ -5008,28 +5008,28 @@ function* cl() {
5008
5008
  c ? (r.opacity = this._opacityFactor / (this.samples + 1), u.blending = ti, u.opacity = 1) : (u.opacity = this._opacityFactor / (this.samples + 1), u.blending = tn);
5009
5009
  const [m, v, p, g] = o, _ = i.width, y = i.height;
5010
5010
  u.resolution.set(_ * p, y * g), u.sobolTexture = a.texture, u.stratifiedTexture.init(20, u.bounces + u.transmissiveBounces + 5), u.stratifiedTexture.next(), u.seed++;
5011
- const x = this.tiles.x || 1, w = this.tiles.y || 1, A = x * w, S = Math.ceil(_ * p), I = Math.ceil(y * g), M = Math.floor(m * _), R = Math.floor(v * y), P = Math.ceil(S / x), T = Math.ceil(I / w);
5012
- for (let C = 0; C < w; C++)
5013
- for (let D = 0; D < x; D++) {
5011
+ const x = this.tiles.x || 1, w = this.tiles.y || 1, A = x * w, T = Math.ceil(_ * p), I = Math.ceil(y * g), C = Math.floor(m * _), R = Math.floor(v * y), D = Math.ceil(T / x), S = Math.ceil(I / w);
5012
+ for (let M = 0; M < w; M++)
5013
+ for (let P = 0; P < x; P++) {
5014
5014
  const L = n.getRenderTarget(), k = n.autoClear, z = n.getScissorTest();
5015
5015
  n.getScissor(f), n.getViewport(d);
5016
- let W = D, G = C;
5016
+ let W = P, G = M;
5017
5017
  if (!this.stableTiles) {
5018
- const ue = this._currentTile % (x * w);
5019
- W = ue % x, G = ~~(ue / x), this._currentTile = ue + 1;
5018
+ const ee = this._currentTile % (x * w);
5019
+ W = ee % x, G = ~~(ee / x), this._currentTile = ee + 1;
5020
5020
  }
5021
- const ce = w - G - 1;
5021
+ const $ = w - G - 1;
5022
5022
  i.scissor.set(
5023
- M + W * P,
5024
- R + ce * T,
5025
- Math.min(P, S - W * P),
5026
- Math.min(T, I - ce * T)
5023
+ C + W * D,
5024
+ R + $ * S,
5025
+ Math.min(D, T - W * D),
5026
+ Math.min(S, I - $ * S)
5027
5027
  ), i.viewport.set(
5028
- M,
5028
+ C,
5029
5029
  R,
5030
- S,
5030
+ T,
5031
5031
  I
5032
- ), n.setRenderTarget(i), n.setScissorTest(!0), n.autoClear = !1, e.render(n), n.setViewport(d), n.setScissor(f), n.setScissorTest(z), n.setRenderTarget(L), n.autoClear = k, c && (r.target1 = l.texture, r.target2 = i.texture, n.setRenderTarget(h), t.render(n), n.setRenderTarget(L)), this.samples += 1 / A, D === x - 1 && C === w - 1 && (this.samples = Math.round(this.samples)), yield;
5032
+ ), n.setRenderTarget(i), n.setScissorTest(!0), n.autoClear = !1, e.render(n), n.setViewport(d), n.setScissor(f), n.setScissorTest(z), n.setRenderTarget(L), n.autoClear = k, c && (r.target1 = l.texture, r.target2 = i.texture, n.setRenderTarget(h), t.render(n), n.setRenderTarget(L)), this.samples += 1 / A, P === x - 1 && M === w - 1 && (this.samples = Math.round(this.samples)), yield;
5033
5033
  }
5034
5034
  [l, h] = [h, l];
5035
5035
  }
@@ -5057,19 +5057,19 @@ class yr {
5057
5057
  constructor(e) {
5058
5058
  this.camera = null, this.tiles = new F(3, 3), this.stableNoise = !1, this.stableTiles = !0, this.samples = 0, this._subframe = new Xe(0, 0, 1, 1), this._opacityFactor = 1, this._renderer = e, this._alpha = !1, this._fsQuad = new Ct(new ll()), this._blendQuad = new Ct(new Jo()), this._task = null, this._currentTile = 0, this._compilePromise = null, this._sobolTarget = new ia().generate(e), this._primaryTarget = new Le(1, 1, {
5059
5059
  format: J,
5060
- type: le,
5060
+ type: ue,
5061
5061
  magFilter: K,
5062
5062
  minFilter: K
5063
5063
  }), this._blendTargets = [
5064
5064
  new Le(1, 1, {
5065
5065
  format: J,
5066
- type: le,
5066
+ type: ue,
5067
5067
  magFilter: K,
5068
5068
  minFilter: K
5069
5069
  }),
5070
5070
  new Le(1, 1, {
5071
5071
  format: J,
5072
- type: le,
5072
+ type: ue,
5073
5073
  magFilter: K,
5074
5074
  minFilter: K
5075
5075
  })
@@ -5114,7 +5114,7 @@ class ul extends ke {
5114
5114
  e,
5115
5115
  t,
5116
5116
  J,
5117
- le,
5117
+ ue,
5118
5118
  Fs,
5119
5119
  Ze,
5120
5120
  Oe,
@@ -5289,7 +5289,7 @@ class br {
5289
5289
  const s = e.images[0], a = this._renderer, o = this._quad;
5290
5290
  t === null && (t = 4 * s.height), i === null && (i = 2 * s.height);
5291
5291
  const c = new Le(t, i, {
5292
- type: le,
5292
+ type: ue,
5293
5293
  colorSpace: s.colorSpace
5294
5294
  }), u = s.height, f = Math.log2(u) - 2, d = 1 / u, r = 1 / (3 * Math.max(Math.pow(2, f), 7 * 16));
5295
5295
  o.material.defines.CUBEUV_MAX_MIP = `${f}.0`, o.material.defines.CUBEUV_TEXEL_WIDTH = r, o.material.defines.CUBEUV_TEXEL_HEIGHT = d, o.material.uniforms.envMap.value = e, o.material.uniforms.flipEnvMap.value = e.isRenderTargetTexture ? 1 : -1, o.material.needsUpdate = !0;
@@ -5496,21 +5496,21 @@ const yl = () => ({
5496
5496
  ktx2TranscoderPath: Ui
5497
5497
  });
5498
5498
  function xl(n) {
5499
- we = n, ne && ne[ys] != we ? (console.debug("Updating Draco decoder path to " + n), ne[ys] = we, ne.setDecoderPath(we), ne.preload()) : console.debug("Setting Draco decoder path to " + n);
5499
+ we = n, ae && ae[ys] != we ? (console.debug("Updating Draco decoder path to " + n), ae[ys] = we, ae.setDecoderPath(we), ae.preload()) : console.debug("Setting Draco decoder path to " + n);
5500
5500
  }
5501
5501
  function wl(n) {
5502
5502
  Ui = n;
5503
5503
  }
5504
5504
  function Ns(n) {
5505
- return fn(), { dracoLoader: ne, meshoptDecoder: Ei };
5505
+ return fn(), { dracoLoader: ae, meshoptDecoder: Ei };
5506
5506
  }
5507
5507
  function hn(n) {
5508
- n.dracoLoader || n.setDRACOLoader(ne), n.meshoptDecoder || n.setMeshoptDecoder(Ei);
5508
+ n.dracoLoader || n.setDRACOLoader(ae), n.meshoptDecoder || n.setMeshoptDecoder(Ei);
5509
5509
  }
5510
5510
  const ys = Symbol("dracoDecoderPath");
5511
- let ne, Ei;
5511
+ let ae, Ei;
5512
5512
  function fn() {
5513
- ne || (ne = new yo(), ne[ys] = we, ne.setDecoderPath(we), ne.setDecoderConfig({ type: "js" }), ne.preload()), Ei || (Ei = _o);
5513
+ ae || (ae = new yo(), ae[ys] = we, ae.setDecoderPath(we), ae.setDecoderConfig({ type: "js" }), ae.preload()), Ei || (Ei = _o);
5514
5514
  }
5515
5515
  const xs = /* @__PURE__ */ new WeakMap();
5516
5516
  function dn(n, e) {
@@ -5594,7 +5594,7 @@ class Tl {
5594
5594
  }
5595
5595
  const Sl = typeof window > "u" && typeof document > "u", ws = Symbol("needle:raycast-mesh");
5596
5596
  function ni(n) {
5597
- return (n == null ? void 0 : n[ws]) instanceof se ? n[ws] : null;
5597
+ return (n == null ? void 0 : n[ws]) instanceof ne ? n[ws] : null;
5598
5598
  }
5599
5599
  function Ml(n, e) {
5600
5600
  if ((n.type === "Mesh" || n.type === "SkinnedMesh") && !ni(n)) {
@@ -5620,7 +5620,7 @@ function Cl(n = !0) {
5620
5620
  }
5621
5621
  let Bt = null;
5622
5622
  function Il(n) {
5623
- const e = new se();
5623
+ const e = new ne();
5624
5624
  for (const t in n.attributes)
5625
5625
  e.setAttribute(t, n.getAttribute(t));
5626
5626
  return e.setIndex(n.getIndex()), e;
@@ -5713,7 +5713,7 @@ class Ws {
5713
5713
  function El(n) {
5714
5714
  var e, t, i, s, a, o, c, u, f, d, r, l, h, m, v, p;
5715
5715
  for (const g of n.geometries) {
5716
- const _ = g.geometry, y = new se();
5716
+ const _ = g.geometry, y = new ne();
5717
5717
  if (y.name = _.name || "", _.index) {
5718
5718
  const x = _.index;
5719
5719
  y.setIndex(Xi(x));
@@ -5724,7 +5724,7 @@ function El(n) {
5724
5724
  }
5725
5725
  if (_.morphAttributes)
5726
5726
  for (const x in _.morphAttributes) {
5727
- const A = _.morphAttributes[x].map((S) => Xi(S));
5727
+ const A = _.morphAttributes[x].map((T) => Xi(T));
5728
5728
  y.morphAttributes[x] = A;
5729
5729
  }
5730
5730
  if (y.morphTargetsRelative = _.morphTargetsRelative ?? !1, y.boundingBox = new Y(), y.boundingBox.min = new b(
@@ -5793,7 +5793,7 @@ function Xi(n) {
5793
5793
  const t = n.data, i = t.array, s = new Gn(i, t.stride);
5794
5794
  e = new qn(s, n.itemSize, i.byteOffset, n.normalized), e.offset = n.offset;
5795
5795
  } else
5796
- "isBufferAttribute" in n && n.isBufferAttribute && (e = new oe(n.array, n.itemSize, n.normalized), e.usage = n.usage, e.gpuType = n.gpuType, e.updateRanges = n.updateRanges);
5796
+ "isBufferAttribute" in n && n.isBufferAttribute && (e = new le(n.array, n.itemSize, n.normalized), e.usage = n.usage, e.gpuType = n.gpuType, e.updateRanges = n.updateRanges);
5797
5797
  return e;
5798
5798
  }
5799
5799
  const Ll = nt("gltf-progressive-worker"), kl = nt("gltf-progressive-reduce-mipmaps"), Ki = Symbol("needle-progressive-texture"), Ie = "NEEDLE_progressive", B = class B {
@@ -6101,88 +6101,88 @@ const Ll = nt("gltf-progressive-worker"), kl = nt("gltf-progressive-reduce-mipma
6101
6101
  i && console.log(`LOD ${t} was already loading/loaded: ${m}`);
6102
6102
  let x = await p.catch((A) => (console.error(`Error loading LOD ${t} from ${h}
6103
6103
  `, A), null)), w = !1;
6104
- if (x == null || (x instanceof Ve && e instanceof Ve ? (f = x.image) != null && f.data || (d = x.source) != null && d.data ? x = this.copySettings(e, x) : (w = !0, this.previouslyLoaded.delete(m)) : x instanceof se && e instanceof se && ((r = x.attributes.position) != null && r.array || (w = !0, this.previouslyLoaded.delete(m)))), !w)
6104
+ if (x == null || (x instanceof Ve && e instanceof Ve ? (f = x.image) != null && f.data || (d = x.source) != null && d.data ? x = this.copySettings(e, x) : (w = !0, this.previouslyLoaded.delete(m)) : x instanceof ne && e instanceof ne && ((r = x.attributes.position) != null && r.array || (w = !0, this.previouslyLoaded.delete(m)))), !w)
6105
6105
  return x;
6106
6106
  }
6107
6107
  if (!v.use)
6108
6108
  return O && console.log(`LOD ${t} was aborted: ${h}`), null;
6109
6109
  const g = o, _ = new Promise(async (x, w) => {
6110
6110
  if (Ll) {
6111
- const T = await (await Dl({})).load(h);
6112
- if (T.textures.length > 0)
6113
- for (const C of T.textures) {
6114
- let D = C.texture;
6115
- return B.assignLODInformation(s.url, D, a, t, void 0), e instanceof Ve && (D = this.copySettings(e, D)), D && (D.guid = g.guid), x(D);
6111
+ const S = await (await Dl({})).load(h);
6112
+ if (S.textures.length > 0)
6113
+ for (const M of S.textures) {
6114
+ let P = M.texture;
6115
+ return B.assignLODInformation(s.url, P, a, t, void 0), e instanceof Ve && (P = this.copySettings(e, P)), P && (P.guid = g.guid), x(P);
6116
6116
  }
6117
- if (T.geometries.length > 0) {
6118
- const C = new Array();
6119
- for (const D of T.geometries) {
6120
- const L = D.geometry;
6121
- B.assignLODInformation(s.url, L, a, t, D.primitiveIndex), C.push(L);
6117
+ if (S.geometries.length > 0) {
6118
+ const M = new Array();
6119
+ for (const P of S.geometries) {
6120
+ const L = P.geometry;
6121
+ B.assignLODInformation(s.url, L, a, t, P.primitiveIndex), M.push(L);
6122
6122
  }
6123
- return x(C);
6123
+ return x(M);
6124
6124
  }
6125
6125
  return x(null);
6126
6126
  }
6127
6127
  const A = new Os();
6128
- hn(A), O && (await new Promise((P) => setTimeout(P, 1e3)), i && console.warn("Start loading (delayed) " + h, g.guid));
6129
- let S = h;
6128
+ hn(A), O && (await new Promise((D) => setTimeout(D, 1e3)), i && console.warn("Start loading (delayed) " + h, g.guid));
6129
+ let T = h;
6130
6130
  if (g && Array.isArray(g.lods)) {
6131
- const P = g.lods[t];
6132
- P.hash && (S += "?v=" + P.hash);
6131
+ const D = g.lods[t];
6132
+ D.hash && (T += "?v=" + D.hash);
6133
6133
  }
6134
- const I = await A.loadAsync(S).catch((P) => (console.error(`Error loading LOD ${t} from ${h}
6135
- `, P), x(null)));
6134
+ const I = await A.loadAsync(T).catch((D) => (console.error(`Error loading LOD ${t} from ${h}
6135
+ `, D), x(null)));
6136
6136
  if (!I)
6137
6137
  return x(null);
6138
- const M = I.parser;
6138
+ const C = I.parser;
6139
6139
  i && console.log("Loading finished " + h, g.guid);
6140
6140
  let R = 0;
6141
6141
  if (I.parser.json.textures) {
6142
- let P = !1;
6143
- for (const T of I.parser.json.textures) {
6144
- if (T != null && T.extensions) {
6145
- const C = T == null ? void 0 : T.extensions[Ie];
6146
- if (C != null && C.guid && C.guid === g.guid) {
6147
- P = !0;
6142
+ let D = !1;
6143
+ for (const S of I.parser.json.textures) {
6144
+ if (S != null && S.extensions) {
6145
+ const M = S == null ? void 0 : S.extensions[Ie];
6146
+ if (M != null && M.guid && M.guid === g.guid) {
6147
+ D = !0;
6148
6148
  break;
6149
6149
  }
6150
6150
  }
6151
6151
  R++;
6152
6152
  }
6153
- if (P) {
6154
- let T = await M.getDependency("texture", R);
6155
- return T && B.assignLODInformation(s.url, T, a, t, void 0), i && console.log('change "' + e.name + '" → "' + T.name + '"', h, R, T, m), e instanceof Ve && (T = this.copySettings(e, T)), T && (T.guid = g.guid), x(T);
6153
+ if (D) {
6154
+ let S = await C.getDependency("texture", R);
6155
+ return S && B.assignLODInformation(s.url, S, a, t, void 0), i && console.log('change "' + e.name + '" → "' + S.name + '"', h, R, S, m), e instanceof Ve && (S = this.copySettings(e, S)), S && (S.guid = g.guid), x(S);
6156
6156
  } else
6157
6157
  O && console.warn("Could not find texture with guid", g.guid, I.parser.json);
6158
6158
  }
6159
6159
  if (R = 0, I.parser.json.meshes) {
6160
- let P = !1;
6161
- for (const T of I.parser.json.meshes) {
6162
- if (T != null && T.extensions) {
6163
- const C = T == null ? void 0 : T.extensions[Ie];
6164
- if (C != null && C.guid && C.guid === g.guid) {
6165
- P = !0;
6160
+ let D = !1;
6161
+ for (const S of I.parser.json.meshes) {
6162
+ if (S != null && S.extensions) {
6163
+ const M = S == null ? void 0 : S.extensions[Ie];
6164
+ if (M != null && M.guid && M.guid === g.guid) {
6165
+ D = !0;
6166
6166
  break;
6167
6167
  }
6168
6168
  }
6169
6169
  R++;
6170
6170
  }
6171
- if (P) {
6172
- const T = await M.getDependency("mesh", R);
6173
- if (i && console.log(`Loaded Mesh "${T.name}"`, h, R, T, m), T.isMesh === !0) {
6174
- const C = T.geometry;
6175
- return B.assignLODInformation(s.url, C, a, t, 0), x(C);
6171
+ if (D) {
6172
+ const S = await C.getDependency("mesh", R);
6173
+ if (i && console.log(`Loaded Mesh "${S.name}"`, h, R, S, m), S.isMesh === !0) {
6174
+ const M = S.geometry;
6175
+ return B.assignLODInformation(s.url, M, a, t, 0), x(M);
6176
6176
  } else {
6177
- const C = new Array();
6178
- for (let D = 0; D < T.children.length; D++) {
6179
- const L = T.children[D];
6177
+ const M = new Array();
6178
+ for (let P = 0; P < S.children.length; P++) {
6179
+ const L = S.children[P];
6180
6180
  if (L.isMesh === !0) {
6181
6181
  const k = L.geometry;
6182
- B.assignLODInformation(s.url, k, a, t, D), C.push(k);
6182
+ B.assignLODInformation(s.url, k, a, t, P), M.push(k);
6183
6183
  }
6184
6184
  }
6185
- return x(C);
6185
+ return x(M);
6186
6186
  }
6187
6187
  } else
6188
6188
  O && console.warn("Could not find mesh with guid", g.guid, I.parser.json);
@@ -6342,8 +6342,8 @@ E(Ci, "addPromise", (e, t, i, s) => {
6342
6342
  a.add(e, t, i);
6343
6343
  });
6344
6344
  });
6345
- const ve = nt("debugprogressive"), Bl = nt("noprogressive"), Ji = Symbol("Needle:LODSManager"), $i = Symbol("Needle:LODState"), Ne = Symbol("Needle:CurrentLOD"), te = { mesh_lod: -1, texture_lod: -1 };
6346
- var re, Pe, ki, Ye, Mt, Fi, Re;
6345
+ const ve = nt("debugprogressive"), Bl = nt("noprogressive"), Ji = Symbol("Needle:LODSManager"), $i = Symbol("Needle:LODState"), Ne = Symbol("Needle:CurrentLOD"), se = { mesh_lod: -1, texture_lod: -1 };
6346
+ var oe, Pe, ki, Ye, Mt, Fi, Re;
6347
6347
  const H = class H {
6348
6348
  // readonly plugins: NEEDLE_progressive_plugin[] = [];
6349
6349
  constructor(e, t) {
@@ -6371,7 +6371,7 @@ const H = class H {
6371
6371
  * @default "auto"
6372
6372
  */
6373
6373
  E(this, "updateInterval", "auto");
6374
- He(this, re, 1);
6374
+ He(this, oe, 1);
6375
6375
  /**
6376
6376
  * If set to true, the LODsManager will not update the LODs.
6377
6377
  * @default false
@@ -6473,7 +6473,7 @@ const H = class H {
6473
6473
  const t = this;
6474
6474
  Ns(this.renderer), this.renderer.render = function(i, s) {
6475
6475
  const a = t.renderer.getRenderTarget();
6476
- (a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Ae(t, Ye, U(t, Ye) + 1), Ae(t, Mt, U(t, ki).getDelta()), Ae(t, Fi, U(t, Fi) + U(t, Mt)), t._fpsBuffer.shift(), t._fpsBuffer.push(1 / U(t, Mt)), Ae(t, Re, t._fpsBuffer.reduce((c, u) => c + u) / t._fpsBuffer.length), ve && U(t, Ye) % 200 === 0 && console.log("FPS", Math.round(U(t, Re)), "Interval:", U(t, re)));
6476
+ (a == null || "isXRRenderTarget" in a && a.isXRRenderTarget) && (e = 0, Ae(t, Ye, U(t, Ye) + 1), Ae(t, Mt, U(t, ki).getDelta()), Ae(t, Fi, U(t, Fi) + U(t, Mt)), t._fpsBuffer.shift(), t._fpsBuffer.push(1 / U(t, Mt)), Ae(t, Re, t._fpsBuffer.reduce((c, u) => c + u) / t._fpsBuffer.length), ve && U(t, Ye) % 200 === 0 && console.log("FPS", Math.round(U(t, Re)), "Interval:", U(t, oe)));
6477
6477
  const o = e++;
6478
6478
  U(t, Pe).call(this, i, s), t.onAfterRender(i, s, o);
6479
6479
  };
@@ -6494,7 +6494,7 @@ const H = class H {
6494
6494
  (c.name === "EffectMaterial" || c.name === "CopyShader") && (o = !1);
6495
6495
  }
6496
6496
  if ((t.parent && t.parent.type === "CubeCamera" || i >= 1 && t.type === "OrthographicCamera") && (o = !1), o) {
6497
- if (Bl || (this.updateInterval === "auto" ? U(this, Re) < 40 && U(this, re) < 10 ? (Ae(this, re, U(this, re) + 1), ve && console.warn("↓ Reducing LOD updates", U(this, re), U(this, Re).toFixed(0))) : U(this, Re) >= 60 && U(this, re) > 1 && (Ae(this, re, U(this, re) - 1), ve && console.warn("↑ Increasing LOD updates", U(this, re), U(this, Re).toFixed(0))) : Ae(this, re, this.updateInterval), U(this, re) > 0 && U(this, Ye) % U(this, re) != 0))
6497
+ if (Bl || (this.updateInterval === "auto" ? U(this, Re) < 40 && U(this, oe) < 10 ? (Ae(this, oe, U(this, oe) + 1), ve && console.warn("↓ Reducing LOD updates", U(this, oe), U(this, Re).toFixed(0))) : U(this, Re) >= 60 && U(this, oe) > 1 && (Ae(this, oe, U(this, oe) - 1), ve && console.warn("↑ Increasing LOD updates", U(this, oe), U(this, Re).toFixed(0))) : Ae(this, oe, this.updateInterval), U(this, oe) > 0 && U(this, Ye) % U(this, oe) != 0))
6498
6498
  return;
6499
6499
  this.internalUpdate(e, t), this._postprocessPromiseGroups();
6500
6500
  }
@@ -6550,10 +6550,10 @@ const H = class H {
6550
6550
  for (const f of qe)
6551
6551
  (c = f.onBeforeUpdateLOD) == null || c.call(f, this.renderer, e, t, i);
6552
6552
  const o = this.overrideLodLevel !== void 0 ? this.overrideLodLevel : st;
6553
- o >= 0 ? (te.mesh_lod = o, te.texture_lod = o) : (this.calculateLodLevel(t, i, a, s, te), te.mesh_lod = Math.round(te.mesh_lod), te.texture_lod = Math.round(te.texture_lod)), te.mesh_lod >= 0 && this.loadProgressiveMeshes(i, te.mesh_lod), i.material && te.texture_lod >= 0 && this.loadProgressiveTextures(i.material, te.texture_lod, o), O && i.material && !i.isGizmo && mn(i.material);
6553
+ o >= 0 ? (se.mesh_lod = o, se.texture_lod = o) : (this.calculateLodLevel(t, i, a, s, se), se.mesh_lod = Math.round(se.mesh_lod), se.texture_lod = Math.round(se.texture_lod)), se.mesh_lod >= 0 && this.loadProgressiveMeshes(i, se.mesh_lod), i.material && se.texture_lod >= 0 && this.loadProgressiveTextures(i.material, se.texture_lod, o), O && i.material && !i.isGizmo && mn(i.material);
6554
6554
  for (const f of qe)
6555
- (u = f.onAfterUpdatedLOD) == null || u.call(f, this.renderer, e, t, i, te);
6556
- a.lastLodLevel_Mesh = te.mesh_lod, a.lastLodLevel_Texture = te.texture_lod;
6555
+ (u = f.onAfterUpdatedLOD) == null || u.call(f, this.renderer, e, t, i, se);
6556
+ a.lastLodLevel_Mesh = se.mesh_lod, a.lastLodLevel_Texture = se.texture_lod;
6557
6557
  }
6558
6558
  /** Load progressive textures for the given material
6559
6559
  * @param material the material to load the textures for
@@ -6632,8 +6632,8 @@ const H = class H {
6632
6632
  }
6633
6633
  const w = x[H.$skinnedMeshBoundsOffset];
6634
6634
  if ((i.frames + w) % this.skinnedMeshAutoUpdateBoundsInterval === 0) {
6635
- const A = ni(x), S = x.geometry;
6636
- A && (x.geometry = A), x.computeBoundingBox(), x.geometry = S;
6635
+ const A = ni(x), T = x.geometry;
6636
+ A && (x.geometry = A), x.computeBoundingBox(), x.geometry = T;
6637
6637
  }
6638
6638
  }
6639
6639
  v = x.boundingBox;
@@ -6642,8 +6642,8 @@ const H = class H {
6642
6642
  const x = e;
6643
6643
  if (t.geometry.attributes.color && t.geometry.attributes.color.count < 100 && t.geometry.boundingSphere) {
6644
6644
  this._sphere.copy(t.geometry.boundingSphere), this._sphere.applyMatrix4(t.matrixWorld);
6645
- const C = e.getWorldPosition(this._tempWorldPosition);
6646
- if (this._sphere.containsPoint(C)) {
6645
+ const M = e.getWorldPosition(this._tempWorldPosition);
6646
+ if (this._sphere.containsPoint(M)) {
6647
6647
  a.mesh_lod = 0, a.texture_lod = 0;
6648
6648
  return;
6649
6649
  }
@@ -6653,37 +6653,37 @@ const H = class H {
6653
6653
  return;
6654
6654
  }
6655
6655
  if (this._tempBox.applyMatrix4(this.projectionScreenMatrix), this.renderer.xr.enabled && x.isPerspectiveCamera && x.fov > 70) {
6656
- const C = this._tempBox.min, D = this._tempBox.max;
6657
- let L = C.x, k = C.y, z = D.x, W = D.y;
6658
- const G = 2, ce = 1.5, ue = (C.x + D.x) * 0.5, Me = (C.y + D.y) * 0.5;
6659
- L = (L - ue) * G + ue, k = (k - Me) * G + Me, z = (z - ue) * G + ue, W = (W - Me) * G + Me;
6660
- const Lt = L < 0 && z > 0 ? 0 : Math.min(Math.abs(C.x), Math.abs(D.x)), Vi = k < 0 && W > 0 ? 0 : Math.min(Math.abs(C.y), Math.abs(D.y)), kt = Math.max(Lt, Vi);
6661
- i.lastCentrality = (ce - kt) * (ce - kt) * (ce - kt);
6656
+ const M = this._tempBox.min, P = this._tempBox.max;
6657
+ let L = M.x, k = M.y, z = P.x, W = P.y;
6658
+ const G = 2, $ = 1.5, ee = (M.x + P.x) * 0.5, Me = (M.y + P.y) * 0.5;
6659
+ L = (L - ee) * G + ee, k = (k - Me) * G + Me, z = (z - ee) * G + ee, W = (W - Me) * G + Me;
6660
+ const Lt = L < 0 && z > 0 ? 0 : Math.min(Math.abs(M.x), Math.abs(P.x)), Vi = k < 0 && W > 0 ? 0 : Math.min(Math.abs(M.y), Math.abs(P.y)), kt = Math.max(Lt, Vi);
6661
+ i.lastCentrality = ($ - kt) * ($ - kt) * ($ - kt);
6662
6662
  } else
6663
6663
  i.lastCentrality = 1;
6664
6664
  const w = this._tempBox.getSize(this._tempBoxSize);
6665
6665
  w.multiplyScalar(0.5), screen.availHeight > 0 && m > 0 && w.multiplyScalar(m / screen.availHeight), e.isPerspectiveCamera ? w.x *= e.aspect : e.isOrthographicCamera;
6666
- const A = e.matrixWorldInverse, S = this._tempBox2;
6667
- S.copy(v), S.applyMatrix4(t.matrixWorld), S.applyMatrix4(A);
6668
- const I = S.getSize(this._tempBox2Size), M = Math.max(I.x, I.y);
6669
- if (Math.max(w.x, w.y) != 0 && M != 0 && (w.z = I.z / Math.max(I.x, I.y) * Math.max(w.x, w.y)), i.lastScreenCoverage = Math.max(w.x, w.y, w.z), i.lastScreenspaceVolume.copy(w), i.lastScreenCoverage *= i.lastCentrality, ve && H.debugDrawLine) {
6670
- const C = this.tempMatrix.copy(this.projectionScreenMatrix);
6671
- C.invert();
6672
- const D = H.corner0, L = H.corner1, k = H.corner2, z = H.corner3;
6673
- D.copy(this._tempBox.min), L.copy(this._tempBox.max), L.x = D.x, k.copy(this._tempBox.max), k.y = D.y, z.copy(this._tempBox.max);
6674
- const W = (D.z + z.z) * 0.5;
6675
- D.z = L.z = k.z = z.z = W, D.applyMatrix4(C), L.applyMatrix4(C), k.applyMatrix4(C), z.applyMatrix4(C), H.debugDrawLine(D, L, 255), H.debugDrawLine(D, k, 255), H.debugDrawLine(L, z, 255), H.debugDrawLine(k, z, 255);
6666
+ const A = e.matrixWorldInverse, T = this._tempBox2;
6667
+ T.copy(v), T.applyMatrix4(t.matrixWorld), T.applyMatrix4(A);
6668
+ const I = T.getSize(this._tempBox2Size), C = Math.max(I.x, I.y);
6669
+ if (Math.max(w.x, w.y) != 0 && C != 0 && (w.z = I.z / Math.max(I.x, I.y) * Math.max(w.x, w.y)), i.lastScreenCoverage = Math.max(w.x, w.y, w.z), i.lastScreenspaceVolume.copy(w), i.lastScreenCoverage *= i.lastCentrality, ve && H.debugDrawLine) {
6670
+ const M = this.tempMatrix.copy(this.projectionScreenMatrix);
6671
+ M.invert();
6672
+ const P = H.corner0, L = H.corner1, k = H.corner2, z = H.corner3;
6673
+ P.copy(this._tempBox.min), L.copy(this._tempBox.max), L.x = P.x, k.copy(this._tempBox.max), k.y = P.y, z.copy(this._tempBox.max);
6674
+ const W = (P.z + z.z) * 0.5;
6675
+ P.z = L.z = k.z = z.z = W, P.applyMatrix4(M), L.applyMatrix4(M), k.applyMatrix4(M), z.applyMatrix4(M), H.debugDrawLine(P, L, 255), H.debugDrawLine(P, k, 255), H.debugDrawLine(L, z, 255), H.debugDrawLine(k, z, 255);
6676
6676
  }
6677
- let P = 999;
6677
+ let D = 999;
6678
6678
  if (f && i.lastScreenCoverage > 0)
6679
- for (let C = 0; C < f.length; C++) {
6680
- const D = f[C], k = (((g = D.densities) == null ? void 0 : g[d]) || D.density || 1e-5) / i.lastScreenCoverage;
6681
- if (d > 0 && Ar() && !D.densities && !globalThis["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] && (window["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] = !0, console.warn("[Needle Progressive] Detected usage of mesh without primitive densities. This might cause incorrect LOD level selection: Consider re-optimizing your model by updating your Needle Integration, Needle glTF Pipeline or running optimization again on Needle Cloud.")), k < s) {
6682
- P = C;
6679
+ for (let M = 0; M < f.length; M++) {
6680
+ const P = f[M], k = (((g = P.densities) == null ? void 0 : g[d]) || P.density || 1e-5) / i.lastScreenCoverage;
6681
+ if (d > 0 && Ar() && !P.densities && !globalThis["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] && (window["NEEDLE:MISSING_LOD_PRIMITIVE_DENSITIES"] = !0, console.warn("[Needle Progressive] Detected usage of mesh without primitive densities. This might cause incorrect LOD level selection: Consider re-optimizing your model by updating your Needle Integration, Needle glTF Pipeline or running optimization again on Needle Cloud.")), k < s) {
6682
+ D = M;
6683
6683
  break;
6684
6684
  }
6685
6685
  }
6686
- P < c && (c = P, u = !0);
6686
+ D < c && (c = D, u = !0);
6687
6687
  }
6688
6688
  if (u ? a.mesh_lod = c : a.mesh_lod = i.lastLodLevel_Mesh, ve && a.mesh_lod != i.lastLodLevel_Mesh) {
6689
6689
  const w = f == null ? void 0 : f[a.mesh_lod];
@@ -6701,13 +6701,13 @@ const H = class H {
6701
6701
  let A = i.lastScreenCoverage * 4;
6702
6702
  ((y = this.context) == null ? void 0 : y.engine) === "model-viewer" && (A *= 1.5);
6703
6703
  const I = m / window.devicePixelRatio * A;
6704
- let M = !1;
6704
+ let C = !1;
6705
6705
  for (let R = l.lods.length - 1; R >= 0; R--) {
6706
- const P = l.lods[R];
6707
- if (!(x && P.max_height >= 2048) && !(pn() && P.max_height > 4096) && (P.max_height > I || !M && R === 0)) {
6708
- if (M = !0, a.texture_lod = R, ve && a.texture_lod < i.lastLodLevel_Texture) {
6709
- const T = P.max_height;
6710
- console.log(`Texture LOD changed: ${i.lastLodLevel_Texture} → ${a.texture_lod} = ${T}px
6706
+ const D = l.lods[R];
6707
+ if (!(x && D.max_height >= 2048) && !(pn() && D.max_height > 4096) && (D.max_height > I || !C && R === 0)) {
6708
+ if (C = !0, a.texture_lod = R, ve && a.texture_lod < i.lastLodLevel_Texture) {
6709
+ const S = D.max_height;
6710
+ console.log(`Texture LOD changed: ${i.lastLodLevel_Texture} → ${a.texture_lod} = ${S}px
6711
6711
  Screensize: ${I.toFixed(0)}px, Coverage: ${(100 * i.lastScreenCoverage).toFixed(2)}%, Volume ${w.toFixed(1)}
6712
6712
  ${t.name}`);
6713
6713
  }
@@ -6719,7 +6719,7 @@ ${t.name}`);
6719
6719
  a.texture_lod = 0;
6720
6720
  }
6721
6721
  };
6722
- re = new WeakMap(), Pe = new WeakMap(), ki = new WeakMap(), Ye = new WeakMap(), Mt = new WeakMap(), Fi = new WeakMap(), Re = new WeakMap(), /**
6722
+ oe = new WeakMap(), Pe = new WeakMap(), ki = new WeakMap(), Ye = new WeakMap(), Mt = new WeakMap(), Fi = new WeakMap(), Re = new WeakMap(), /**
6723
6723
  * Assign a function to draw debug lines for the LODs. This function will be called with the start and end position of the line and the color of the line when the `debugprogressive` query parameter is set.
6724
6724
  */
6725
6725
  E(H, "debugDrawLine"), E(H, "corner0", new b()), E(H, "corner1", new b()), E(H, "corner2", new b()), E(H, "corner3", new b()), E(H, "_tempPtInside", new b()), E(H, "skinnedMeshBoundsFrameOffsetCounter", 0), E(H, "$skinnedMeshBoundsOffset", Symbol("gltf-progressive-skinnedMeshBoundsOffset"));
@@ -7846,55 +7846,55 @@ var wn = {};
7846
7846
  if (m && !g._paused)
7847
7847
  return l || h._loadQueue("play"), g._id;
7848
7848
  h._webAudio && t._autoResume();
7849
- var y = Math.max(0, g._seek > 0 ? g._seek : h._sprite[r][0] / 1e3), x = Math.max(0, (h._sprite[r][0] + h._sprite[r][1]) / 1e3 - y), w = x * 1e3 / Math.abs(g._rate), A = h._sprite[r][0] / 1e3, S = (h._sprite[r][0] + h._sprite[r][1]) / 1e3;
7849
+ var y = Math.max(0, g._seek > 0 ? g._seek : h._sprite[r][0] / 1e3), x = Math.max(0, (h._sprite[r][0] + h._sprite[r][1]) / 1e3 - y), w = x * 1e3 / Math.abs(g._rate), A = h._sprite[r][0] / 1e3, T = (h._sprite[r][0] + h._sprite[r][1]) / 1e3;
7850
7850
  g._sprite = r, g._ended = !1;
7851
7851
  var I = function() {
7852
- g._paused = !1, g._seek = y, g._start = A, g._stop = S, g._loop = !!(g._loop || h._sprite[r][2]);
7852
+ g._paused = !1, g._seek = y, g._start = A, g._stop = T, g._loop = !!(g._loop || h._sprite[r][2]);
7853
7853
  };
7854
- if (y >= S) {
7854
+ if (y >= T) {
7855
7855
  h._ended(g);
7856
7856
  return;
7857
7857
  }
7858
- var M = g._node;
7858
+ var C = g._node;
7859
7859
  if (h._webAudio) {
7860
7860
  var R = function() {
7861
7861
  h._playLock = !1, I(), h._refreshBuffer(g);
7862
- var D = g._muted || h._muted ? 0 : g._volume;
7863
- M.gain.setValueAtTime(D, t.ctx.currentTime), g._playStart = t.ctx.currentTime, typeof M.bufferSource.start > "u" ? g._loop ? M.bufferSource.noteGrainOn(0, y, 86400) : M.bufferSource.noteGrainOn(0, y, x) : g._loop ? M.bufferSource.start(0, y, 86400) : M.bufferSource.start(0, y, x), w !== 1 / 0 && (h._endTimers[g._id] = setTimeout(h._ended.bind(h, g), w)), l || setTimeout(function() {
7862
+ var P = g._muted || h._muted ? 0 : g._volume;
7863
+ C.gain.setValueAtTime(P, t.ctx.currentTime), g._playStart = t.ctx.currentTime, typeof C.bufferSource.start > "u" ? g._loop ? C.bufferSource.noteGrainOn(0, y, 86400) : C.bufferSource.noteGrainOn(0, y, x) : g._loop ? C.bufferSource.start(0, y, 86400) : C.bufferSource.start(0, y, x), w !== 1 / 0 && (h._endTimers[g._id] = setTimeout(h._ended.bind(h, g), w)), l || setTimeout(function() {
7864
7864
  h._emit("play", g._id), h._loadQueue();
7865
7865
  }, 0);
7866
7866
  };
7867
7867
  t.state === "running" && t.ctx.state !== "interrupted" ? R() : (h._playLock = !0, h.once("resume", R), h._clearTimer(g._id));
7868
7868
  } else {
7869
- var P = function() {
7870
- M.currentTime = y, M.muted = g._muted || h._muted || t._muted || M.muted, M.volume = g._volume * t.volume(), M.playbackRate = g._rate;
7869
+ var D = function() {
7870
+ C.currentTime = y, C.muted = g._muted || h._muted || t._muted || C.muted, C.volume = g._volume * t.volume(), C.playbackRate = g._rate;
7871
7871
  try {
7872
- var D = M.play();
7873
- if (D && typeof Promise < "u" && (D instanceof Promise || typeof D.then == "function") ? (h._playLock = !0, I(), D.then(function() {
7874
- h._playLock = !1, M._unlocked = !0, l ? h._loadQueue() : h._emit("play", g._id);
7872
+ var P = C.play();
7873
+ if (P && typeof Promise < "u" && (P instanceof Promise || typeof P.then == "function") ? (h._playLock = !0, I(), P.then(function() {
7874
+ h._playLock = !1, C._unlocked = !0, l ? h._loadQueue() : h._emit("play", g._id);
7875
7875
  }).catch(function() {
7876
7876
  h._playLock = !1, h._emit("playerror", g._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."), g._ended = !0, g._paused = !0;
7877
- })) : l || (h._playLock = !1, I(), h._emit("play", g._id)), M.playbackRate = g._rate, M.paused) {
7877
+ })) : l || (h._playLock = !1, I(), h._emit("play", g._id)), C.playbackRate = g._rate, C.paused) {
7878
7878
  h._emit("playerror", g._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");
7879
7879
  return;
7880
7880
  }
7881
7881
  r !== "__default" || g._loop ? h._endTimers[g._id] = setTimeout(h._ended.bind(h, g), w) : (h._endTimers[g._id] = function() {
7882
- h._ended(g), M.removeEventListener("ended", h._endTimers[g._id], !1);
7883
- }, M.addEventListener("ended", h._endTimers[g._id], !1));
7882
+ h._ended(g), C.removeEventListener("ended", h._endTimers[g._id], !1);
7883
+ }, C.addEventListener("ended", h._endTimers[g._id], !1));
7884
7884
  } catch (L) {
7885
7885
  h._emit("playerror", g._id, L);
7886
7886
  }
7887
7887
  };
7888
- M.src === "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" && (M.src = h._src, M.load());
7889
- var T = window && window.ejecta || !M.readyState && t._navigator.isCocoonJS;
7890
- if (M.readyState >= 3 || T)
7891
- P();
7888
+ C.src === "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" && (C.src = h._src, C.load());
7889
+ var S = window && window.ejecta || !C.readyState && t._navigator.isCocoonJS;
7890
+ if (C.readyState >= 3 || S)
7891
+ D();
7892
7892
  else {
7893
7893
  h._playLock = !0, h._state = "loading";
7894
- var C = function() {
7895
- h._state = "loaded", P(), M.removeEventListener(t._canPlayEvent, C, !1);
7894
+ var M = function() {
7895
+ h._state = "loaded", D(), C.removeEventListener(t._canPlayEvent, M, !1);
7896
7896
  };
7897
- M.addEventListener(t._canPlayEvent, C, !1), h._clearTimer(g._id);
7897
+ C.addEventListener(t._canPlayEvent, M, !1), h._clearTimer(g._id);
7898
7898
  }
7899
7899
  }
7900
7900
  return g._id;
@@ -8050,8 +8050,8 @@ var wn = {};
8050
8050
  _startFadeInterval: function(r, l, h, m, v, p) {
8051
8051
  var g = this, _ = l, y = h - l, x = Math.abs(y / 0.01), w = Math.max(4, x > 0 ? m / x : m), A = Date.now();
8052
8052
  r._fadeTo = h, r._interval = setInterval(function() {
8053
- var S = (Date.now() - A) / m;
8054
- A = Date.now(), _ += y * S, _ = Math.round(_ * 100) / 100, y < 0 ? _ = Math.max(h, _) : _ = Math.min(h, _), g._webAudio ? r._volume = _ : g.volume(_, r._id, !0), p && (g._volume = _), (h < l && _ <= h || h > l && _ >= h) && (clearInterval(r._interval), r._interval = null, r._fadeTo = null, g.volume(h, r._id), g._emit("fade", r._id));
8053
+ var T = (Date.now() - A) / m;
8054
+ A = Date.now(), _ += y * T, _ = Math.round(_ * 100) / 100, y < 0 ? _ = Math.max(h, _) : _ = Math.min(h, _), g._webAudio ? r._volume = _ : g.volume(_, r._id, !0), p && (g._volume = _), (h < l && _ <= h || h > l && _ >= h) && (clearInterval(r._interval), r._interval = null, r._fadeTo = null, g.volume(h, r._id), g._emit("fade", r._id));
8055
8055
  }, w);
8056
8056
  },
8057
8057
  /**
@@ -8766,12 +8766,12 @@ function ic(n) {
8766
8766
  _.includes("width") && (t = !0), _.includes("length") && (e = !0), _.includes("height") && (i = !0);
8767
8767
  for (let y = 0; y < v.count; y++) {
8768
8768
  let x = v.getX(y), w = v.getY(y), A = v.getZ(y);
8769
- r = Math.max(w, r), p && g && p.forEach((I, M) => {
8770
- const R = g && g[M] || 0;
8769
+ r = Math.max(w, r), p && g && p.forEach((I, C) => {
8770
+ const R = g && g[C] || 0;
8771
8771
  x += I.getX(y) * R, w += I.getY(y) * R, A += I.getZ(y) * R;
8772
8772
  }), x < s && (s = x), w < a && (a = w), A < o && (o = A), x > c && (c = x), w > u && (u = w), A > f && (f = A);
8773
- const S = Math.sqrt(x * x + w * w);
8774
- S > d && (d = S);
8773
+ const T = Math.sqrt(x * x + w * w);
8774
+ T > d && (d = T);
8775
8775
  }
8776
8776
  }
8777
8777
  }), { box: new Y(new b(s, a, o), new b(c, u, f)), maxRadius: d, height: r, hasWidth: t, hasLength: e, hasHeight: i };
@@ -8913,7 +8913,7 @@ class As {
8913
8913
  [...this.cache.values()];
8914
8914
  }
8915
8915
  }
8916
- const lc = `*{box-sizing:border-box}.slot-item-container.is-mobile .main{pointer-events:none;border-width:1px;opacity:.8}.slot-item-container.is-mobile .main.focus{width:18px!important;height:18px!important;border-width:2px;opacity:1}.slot-item-container.is-mobile .main.filled{opacity:1;border-width:1px;width:14px!important;height:14px!important;background-image:none;border-radius:50%}.slot-item-container.is-mobile .main.to-be-installed{opacity:1;pointer-events:auto;width:38px!important;height:38px!important;border-color:#000;border-width:1px;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cg%3e%3cg%3e%3cpath%20d='M20,10.75L0,10.75L0,9.25L20,9.25L20,10.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%20transform='matrix(0,1,1,0,10,-10)'%3e%3cpath%20d='M30,0.75L10,0.75L10,-0.75L30,-0.75L30,0.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:20px auto;background-repeat:no-repeat;background-position:center;background-color:#fff9}.slot-item-container.is-mobile .main.to-be-installed+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container.is-mobile .main.to-be-installed.filled{opacity:1;border-width:2px;width:18px!important;height:18px!important;background-image:none;border-radius:50%;border-color:#00ff95}.slot-item-container.is-mobile .main.to-be-installed.to-be-replaced{opacity:1;border-width:1px;pointer-events:auto;width:38px!important;height:38px!important;border-radius:50%;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_014299'%3e%3crect%20x='0'%20y='0'%20width='40'%20height='40'%20rx='20'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_014299)'%3e%3cg%3e%3cg%3e%3cpath%20d='M31.695414,17L26.009501,10.74549544L24.899591,11.75450456L28.304586,15.5L8.75,15.5L8.75,17L31.695414,17Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.3045862,23L13.9904997,29.2545042L15.10041,28.2454953L11.6954139,24.5L31.25,24.5L31.25,23L8.3045862,23Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:38px auto;border-color:#000}.slot-item-container.is-mobile .info{left:100%;margin-top:0;margin-left:4px}.slot-item-container.is-mobile .info .name-wrapper{margin-top:0;border-radius:0;background:#000;color:#fff}.slot-item-container.is-mobile .info>img{display:none}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:22px;height:22px;background:#fff0;border:2px solid #fff;border-radius:0;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:44px;height:44px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95;border-radius:50%}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.focus{border-color:#000}.slot-item-container .main.focus+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#fff;padding:2px 8px;background:#000}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{display:inline-block;min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #eee;font-size:12px;color:#eee;border-radius:2px;-webkit-backdrop-filter:none;backdrop-filter:none;background:#00050a80}.slot-item-container .functions-wrapper>.functions .btn-add.btn-not-allowed{cursor:not-allowed}.slot-item-container .functions-wrapper>.functions .function{display:flex;justify-content:space-between;white-space:nowrap;margin-bottom:6px;padding:0 8px;font-size:12px;color:#fff}.slot-item-container .functions-wrapper>.functions .function span{margin-right:4px}.slot-item-container .functions-wrapper>.functions .function .btn-remove{pointer-events:none;opacity:0;cursor:pointer;align-self:center;margin-right:0;height:14px;width:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACnSURBVEiJxZaxFcMgDETPTuUtWCWTM4pZAq5RojRpnOfEyEKxSnh3HySeBEhNjZJJTRgUG89GyZWilbKOgJCaKmWtFG2UvFnwQr56jYAcengg3dozELPGIjh96x6hu26/DIa9vD0jq/nUA3nikQEkAOW9nACUGbf7skxlX2mIj1Ob0jK76QdxbYpGFNlk3rPnNndDQltFaLMLbdehAyd8ZP5l6Ed+W17xG7oN9QkytAAAAABJRU5ErkJggg==) center no-repeat;background-size:10px 10px}.slot-item-container .functions-wrapper>.functions .function:hover .btn-remove{pointer-events:auto;opacity:1;transform:scale(1.2)}.slot-item-container .device-name{position:relative;margin:2px 0;display:flex;min-width:120px;align-items:center;align-content:center;justify-content:space-between;white-space:nowrap;height:30px;padding:0 8px;font-size:14px;font-weight:700;color:#000;background:#fff}.slot-item-container .device-name .device-logo{margin-left:-8px;margin-right:4px;width:30px;height:30px;object-fit:contain}.slot-item-container .device-name span{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:250px}.slot-item-container .device-name .btn-close{margin-left:8px;cursor:pointer;height:20px;width:20px;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_017509'%3e%3crect%20x='0'%20y='0'%20width='20'%20height='20'%20rx='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_017509)'%3e%3cg%3e%3cpath%20d='M4.375,16.875L4.375,4.375L15.625,4.375L15.625,16.875L4.375,16.875ZM14.375,5.625L5.625,5.625L5.625,15.625L14.375,15.625L14.375,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.125,12.1875L8.125,8.125L9.375,8.125L9.375,12.1875L8.125,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M10.625,12.1875L10.625,8.125L11.875,8.125L11.875,12.1875L10.625,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M16.875,5.625L3.125,5.625L3.125,4.375L16.875,4.375L16.875,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M6.4446528999999995,5.625L13.545177899999999,5.625L11.8665838,2.5L8.15767372,2.5L6.4446528999999995,5.625ZM11.4548223,4.3749999L8.5553472,4.3749999L8.8979512,3.75L11.1191032,3.75L11.4548223,4.3749999Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e") center no-repeat;background-size:100% auto}.slot-item-container .device-name.empty{color:#000c;font-weight:400}.slot-item-container .device-name.empty .btn-close{display:none}.slot-item-container .device-name.empty:before{height:0}.slot-item-container .all-functions{opacity:0;pointer-events:none;min-width:80px;position:absolute;left:-10px;margin-left:100%;bottom:0;padding:6px 0;background:#fff;transition:all .3s}.slot-item-container .all-functions.show{opacity:1;pointer-events:auto;left:16px}.slot-item-container .all-functions label{margin-left:8px;margin-bottom:20px;color:#444e69;font-size:14px}.slot-item-container .all-functions .btn-close{cursor:pointer;position:absolute;right:7px;top:7px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .all-functions .functions{display:inline-block;max-height:200px;overflow-x:hidden;overflow-y:auto}.slot-item-container .all-functions .functions::-webkit-scrollbar{width:4px}.slot-item-container .all-functions .functions::-webkit-scrollbar-track{background-color:#fff}.slot-item-container .all-functions .functions::-webkit-scrollbar-thumb{background:#787878;border-radius:25px}.slot-item-container .all-functions .function{display:flex;justify-content:space-between;white-space:nowrap;padding:5px 10px;font-size:12px;color:#787878}.slot-item-container .all-functions .function span{display:flex;align-content:center;align-items:center;margin-right:4px}.slot-item-container .all-functions .function:hover{background:#444e6933}.slot-item-container .all-functions .btn-add{cursor:pointer;width:16px;font-size:16px;text-align:center;font-style:normal}.slot-item-container .info{overflow:hidden;margin-left:-2px;margin-top:-19px;position:absolute;left:100%;top:50%;transform:translateY(-50%);width:0;display:flex;align-items:flex-start;transition:all .3s}.slot-item-container .info>img{flex:0 0 auto;width:53px;height:29px}`, cc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC", Dr = { name: "", isMobile: !1 }, uc = {
8916
+ const lc = `*{box-sizing:border-box}.slot-item-container.is-mobile .main{pointer-events:none;border-width:1px;opacity:.8}.slot-item-container.is-mobile .main.focus{width:18px!important;height:18px!important;border-width:2px;opacity:1}.slot-item-container.is-mobile .main.filled{opacity:1;border-width:1px;width:14px!important;height:14px!important;background-image:none;border-radius:50%}.slot-item-container.is-mobile .main.to-be-installed{opacity:1;pointer-events:auto;width:38px!important;height:38px!important;border-color:#000;border-width:1px;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cg%3e%3cg%3e%3cpath%20d='M20,10.75L0,10.75L0,9.25L20,9.25L20,10.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%20transform='matrix(0,1,1,0,10,-10)'%3e%3cpath%20d='M30,0.75L10,0.75L10,-0.75L30,-0.75L30,0.75Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:20px auto;background-repeat:no-repeat;background-position:center;background-color:#fff9}.slot-item-container.is-mobile .main.to-be-installed+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container.is-mobile .main.to-be-installed.filled{opacity:1;border-width:2px;width:18px!important;height:18px!important;background-image:none;border-radius:50%;border-color:#00ff95}.slot-item-container.is-mobile .main.to-be-installed.to-be-replaced{opacity:1;border-width:1px;pointer-events:auto;width:38px!important;height:38px!important;border-radius:50%;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_014299'%3e%3crect%20x='0'%20y='0'%20width='40'%20height='40'%20rx='20'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_014299)'%3e%3cg%3e%3cg%3e%3cpath%20d='M31.695414,17L26.009501,10.74549544L24.899591,11.75450456L28.304586,15.5L8.75,15.5L8.75,17L31.695414,17Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.3045862,23L13.9904997,29.2545042L15.10041,28.2454953L11.6954139,24.5L31.25,24.5L31.25,23L8.3045862,23Z'%20fill-rule='evenodd'%20fill='%23000000'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:38px auto;border-color:#000}.slot-item-container.is-mobile .info{left:100%;margin-top:0;margin-left:4px}.slot-item-container.is-mobile .info .name-wrapper{margin-top:0;border-radius:0;background:#000;color:#fff}.slot-item-container.is-mobile .info>img{display:none}.slot-item-container .main{pointer-events:auto;cursor:pointer;font-size:12px;color:#fff;width:22px;height:22px;background:#fff0;border:1.5px solid #fff;border-radius:0;transition:background .2s,width .14s,height .14s,border .14s}.slot-item-container .main.disable{cursor:not-allowed}.slot-item-container .main.drag-over{border-color:red}.slot-item-container .main.can-install{position:relative;width:44px;height:44px;background:#0066ff1a;border-color:#06f}.slot-item-container .main.filled{border-color:#00ff95;border-radius:50%}.slot-item-container .main.selected{border-width:4px}.slot-item-container .main.selected+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.focus{border-color:#000}.slot-item-container .main.focus+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .main.has-error{border-color:red}.slot-item-container .main.hidden{display:none}.slot-item-container .main.hidden+.info{display:none}.slot-item-container .main:after{pointer-events:none;content:attr(data-name);transition:all .2s .3s;opacity:0;position:absolute;left:50%;bottom:100%;transform:translate3d(-50%,5px,0);white-space:nowrap;font-size:12px;color:#000;padding:2px 8px;border-radius:2px;background:#fff}.slot-item-container .main:hover{background:#ffffff80}.slot-item-container .main:hover+.info{pointer-events:auto;overflow:visible;width:auto}.slot-item-container .name{position:relative}.slot-item-container .name-wrapper{margin-top:-10px;white-space:nowrap;font-size:12px;color:#fff;padding:2px 8px;background:#000}.slot-item-container .functions-wrapper{z-index:20000;position:absolute;left:0;top:100%}.slot-item-container .functions-wrapper>.functions{display:inline-block;min-width:100px;padding:6px 0;border-left:1px solid #00ff95;border-radius:0 2px 2px 0;background:#0003;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.slot-item-container .functions-wrapper>.functions .btn-add{cursor:pointer;padding:2px 0;margin:0 8px;display:flex;justify-content:center;align-content:center;align-items:center;border:1px dashed #eee;font-size:12px;color:#eee;border-radius:2px;-webkit-backdrop-filter:none;backdrop-filter:none;background:#00050a80}.slot-item-container .functions-wrapper>.functions .btn-add.btn-not-allowed{cursor:not-allowed}.slot-item-container .functions-wrapper>.functions .function{display:flex;justify-content:space-between;white-space:nowrap;margin-bottom:6px;padding:0 8px;font-size:12px;color:#fff}.slot-item-container .functions-wrapper>.functions .function span{margin-right:4px}.slot-item-container .functions-wrapper>.functions .function .btn-remove{pointer-events:none;opacity:0;cursor:pointer;align-self:center;margin-right:0;height:14px;width:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACnSURBVEiJxZaxFcMgDETPTuUtWCWTM4pZAq5RojRpnOfEyEKxSnh3HySeBEhNjZJJTRgUG89GyZWilbKOgJCaKmWtFG2UvFnwQr56jYAcengg3dozELPGIjh96x6hu26/DIa9vD0jq/nUA3nikQEkAOW9nACUGbf7skxlX2mIj1Ob0jK76QdxbYpGFNlk3rPnNndDQltFaLMLbdehAyd8ZP5l6Ed+W17xG7oN9QkytAAAAABJRU5ErkJggg==) center no-repeat;background-size:10px 10px}.slot-item-container .functions-wrapper>.functions .function:hover .btn-remove{pointer-events:auto;opacity:1;transform:scale(1.2)}.slot-item-container .device-name{position:relative;margin:2px 0;display:flex;min-width:120px;align-items:center;align-content:center;justify-content:space-between;white-space:nowrap;height:30px;padding:0 8px;font-size:14px;font-weight:700;color:#000;background:#fff}.slot-item-container .device-name .device-logo{margin-left:-8px;margin-right:4px;width:30px;height:30px;object-fit:contain}.slot-item-container .device-name span{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:250px}.slot-item-container .device-name .btn-close{margin-left:8px;cursor:pointer;height:20px;width:20px;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cdefs%3e%3cclipPath%20id='master_svg0_504_017509'%3e%3crect%20x='0'%20y='0'%20width='20'%20height='20'%20rx='0'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23master_svg0_504_017509)'%3e%3cg%3e%3cpath%20d='M4.375,16.875L4.375,4.375L15.625,4.375L15.625,16.875L4.375,16.875ZM14.375,5.625L5.625,5.625L5.625,15.625L14.375,15.625L14.375,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M8.125,12.1875L8.125,8.125L9.375,8.125L9.375,12.1875L8.125,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M10.625,12.1875L10.625,8.125L11.875,8.125L11.875,12.1875L10.625,12.1875Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M16.875,5.625L3.125,5.625L3.125,4.375L16.875,4.375L16.875,5.625Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M6.4446528999999995,5.625L13.545177899999999,5.625L11.8665838,2.5L8.15767372,2.5L6.4446528999999995,5.625ZM11.4548223,4.3749999L8.5553472,4.3749999L8.8979512,3.75L11.1191032,3.75L11.4548223,4.3749999Z'%20fill-rule='evenodd'%20fill='%23999999'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e") center no-repeat;background-size:100% auto}.slot-item-container .device-name.empty{color:#000c;font-weight:400}.slot-item-container .device-name.empty .btn-close{display:none}.slot-item-container .device-name.empty:before{height:0}.slot-item-container .all-functions{opacity:0;pointer-events:none;min-width:80px;position:absolute;left:-10px;margin-left:100%;bottom:0;padding:6px 0;background:#fff;transition:all .3s}.slot-item-container .all-functions.show{opacity:1;pointer-events:auto;left:16px}.slot-item-container .all-functions label{margin-left:8px;margin-bottom:20px;color:#444e69;font-size:14px}.slot-item-container .all-functions .btn-close{cursor:pointer;position:absolute;right:7px;top:7px;height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAB4SURBVDiNpZPLEYAgDAUXe6MuoK4UpwdBwQkQJDcyb9+QnxORCOC9jyxE4Y78DiWxAIcmISKnxaSrtZhMNSOB+ZeacAS7ngl3k1JOBSBpk1INPib0YHjH+Du2S1DhlSZOYbPJ1iLtrLKrG2a9yJopYzTD8Jx+ArgAylOzjm1WpDwAAAAASUVORK5CYII=) center no-repeat;background-size:10px 10px}.slot-item-container .all-functions .functions{display:inline-block;max-height:200px;overflow-x:hidden;overflow-y:auto}.slot-item-container .all-functions .functions::-webkit-scrollbar{width:4px}.slot-item-container .all-functions .functions::-webkit-scrollbar-track{background-color:#fff}.slot-item-container .all-functions .functions::-webkit-scrollbar-thumb{background:#787878;border-radius:25px}.slot-item-container .all-functions .function{display:flex;justify-content:space-between;white-space:nowrap;padding:5px 10px;font-size:12px;color:#787878}.slot-item-container .all-functions .function span{display:flex;align-content:center;align-items:center;margin-right:4px}.slot-item-container .all-functions .function:hover{background:#444e6933}.slot-item-container .all-functions .btn-add{cursor:pointer;width:16px;font-size:16px;text-align:center;font-style:normal}.slot-item-container .info{overflow:hidden;margin-left:-2px;margin-top:-19px;position:absolute;left:100%;top:50%;transform:translateY(-50%);width:0;display:flex;align-items:flex-start;transition:all .3s}.slot-item-container .info>img{flex:0 0 auto;width:53px;height:29px}`, cc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAA7CAYAAAB8MXT7AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGTSURBVHic7dxLbQNBEIThnigADGEhxAwcBoZgCIZgBoZgCIZgCIaQMIgZVC4daw/xXPLoqdX/3fbW0milUtfutMCdpCkiLhEx1U6CLkkvkt4k7atnQYekfR7US/Us6JB0yIOaqmfBA5JWks6SrhzUwCRN+TYdq2dBx+ygDtWzoEPSNg9qVz0LOmZBgsQ3sqUkvufqAf6SpFVEnCPiFhHr1tqteCR8hyBhYrY6OlTPgo5cHX1I2lbPgo6lBInFk3Rc+uroqXqAn8ogcc3H19bae+U8eIDEZ0LSJoMEZeHIWB2ZIPEZoCw0QVlogsRnYlYWsjoaGUHCRK6OOKiRfa2OMvWtqufBAwQJE5SFJmZl4aZ6FnSQ+Azk6mjxZeFv+/fycfbDWrTW1pSFgyLxmcjVEWXh6CgLTZD4DMzKwguro4ERJEywOjIhaUdZaIAgYYKy0ABloQkSnwlxKZUHcSmVBxKfgVwdnSgLB8d35iZIfCYoC01QFpog8Y3rftFWrotO+cilVKMiSJigLDSS30hQFhr4BEcKZN0LNhDxAAAAAElFTkSuQmCC", Dr = { name: "", isMobile: !1 }, uc = {
8917
8917
  "&": "&amp;",
8918
8918
  "<": "&lt;",
8919
8919
  ">": "&gt;",
@@ -8984,8 +8984,9 @@ class bn extends HTMLElement {
8984
8984
  return this._canInstall;
8985
8985
  }
8986
8986
  set canInstall(e) {
8987
- const t = !!e;
8988
- this._canInstall !== t && (this._canInstall = t, this.scheduleRender());
8987
+ var s;
8988
+ const t = !!e, i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".main");
8989
+ i && (e ? i.classList.add("can-install") : i.classList.remove("can-install")), this._canInstall !== t && (this._canInstall = t, this.scheduleRender());
8989
8990
  }
8990
8991
  get hide() {
8991
8992
  return this._hide;
@@ -9036,7 +9037,12 @@ class bn extends HTMLElement {
9036
9037
  return this._allFunctions.some((e) => !this._functions.includes(e));
9037
9038
  }
9038
9039
  setSize(e = 12) {
9039
- const t = Number.isFinite(e) ? Number(e) : 12;
9040
+ var s;
9041
+ const t = Number.isFinite(e) ? Number(e) : 12, i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".main");
9042
+ if (i) {
9043
+ i.style.width = i.style.height = `${e}px`;
9044
+ return;
9045
+ }
9040
9046
  this._size !== t && (this._size = t, this.scheduleRender());
9041
9047
  }
9042
9048
  removeDevice() {
@@ -9417,13 +9423,13 @@ class hc extends Be {
9417
9423
  class Ii extends he {
9418
9424
  constructor(e, t = !0, i = !0) {
9419
9425
  super(), this._startWith = e, this._showText = t, this.useStartEnd = i, this._line2Length = 0.01, this._line = new ps(
9420
- new se(),
9426
+ new ne(),
9421
9427
  new Zs({
9422
9428
  color: "#666",
9423
9429
  linewidth: 2
9424
9430
  })
9425
9431
  ), this._line2 = new ps(
9426
- new se(),
9432
+ new ne(),
9427
9433
  new Zs({
9428
9434
  color: "#666",
9429
9435
  linewidth: 2
@@ -9448,7 +9454,7 @@ class Ii extends he {
9448
9454
  let o;
9449
9455
  Math.abs(a.z) > Math.abs(a.x) && Math.abs(a.z) > Math.abs(a.y) ? o = new b(-a.y, a.x, 0) : Math.abs(a.y) > Math.abs(a.x) ? o = new b(1, 0, 0) : o = new b(0, 1, 0), o.length() < 1e-3 && (Math.abs(a.x) < 0.9 ? o = new b(1, 0, 0) : o = new b(0, 1, 0)), o.normalize();
9450
9456
  const c = new b().addVectors(e, o.clone().multiplyScalar(s)), u = new b().addVectors(e, o.clone().multiplyScalar(-s)), f = new b().addVectors(t, o.clone().multiplyScalar(s)), d = new b().addVectors(t, o.clone().multiplyScalar(-s));
9451
- (m = this._line2.geometry) == null || m.dispose(), this._line2.geometry = new se(), this._line2.geometry.setFromPoints([
9457
+ (m = this._line2.geometry) == null || m.dispose(), this._line2.geometry = new ne(), this._line2.geometry.setFromPoints([
9452
9458
  c,
9453
9459
  u,
9454
9460
  // First line segment at start
@@ -10324,7 +10330,7 @@ function Sc(n, e = ArrayBuffer) {
10324
10330
  function Mc(n, e) {
10325
10331
  if (!n.index) {
10326
10332
  const t = n.attributes.position.count, i = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = Sc(t, i);
10327
- n.setIndex(new oe(s, 1));
10333
+ n.setIndex(new le(s, 1));
10328
10334
  for (let a = 0; a < t; a++)
10329
10335
  s[a] = a;
10330
10336
  }
@@ -10367,10 +10373,10 @@ function is(n, e, t, i, s) {
10367
10373
  for (let g = e * 6, _ = (e + t) * 6; g < _; g += 6) {
10368
10374
  const y = n[g + 0], x = n[g + 1], w = y - x, A = y + x;
10369
10375
  w < a && (a = w), A > u && (u = A), y < r && (r = y), y > m && (m = y);
10370
- const S = n[g + 2], I = n[g + 3], M = S - I, R = S + I;
10371
- M < o && (o = M), R > f && (f = R), S < l && (l = S), S > v && (v = S);
10372
- const P = n[g + 4], T = n[g + 5], C = P - T, D = P + T;
10373
- C < c && (c = C), D > d && (d = D), P < h && (h = P), P > p && (p = P);
10376
+ const T = n[g + 2], I = n[g + 3], C = T - I, R = T + I;
10377
+ C < o && (o = C), R > f && (f = R), T < l && (l = T), T > v && (v = T);
10378
+ const D = n[g + 4], S = n[g + 5], M = D - S, P = D + S;
10379
+ M < c && (c = M), P > d && (d = P), D < h && (h = D), D > p && (p = D);
10374
10380
  }
10375
10381
  i[0] = a, i[1] = o, i[2] = c, i[3] = u, i[4] = f, i[5] = d, s[0] = r, s[1] = l, s[2] = h, s[3] = m, s[4] = v, s[5] = p;
10376
10382
  }
@@ -10389,12 +10395,12 @@ function Ic(n, e = null, t = null, i = null) {
10389
10395
  for (let y = 0; y < 3; y++) {
10390
10396
  let x, w, A;
10391
10397
  c ? (x = s[l[y]](p), w = s[l[y]](g), A = s[l[y]](_)) : (x = f[p + y], w = f[g + y], A = f[_ + y]);
10392
- let S = x;
10393
- w < S && (S = w), A < S && (S = A);
10398
+ let T = x;
10399
+ w < T && (T = w), A < T && (T = A);
10394
10400
  let I = x;
10395
10401
  w > I && (I = w), A > I && (I = A);
10396
- const M = (I - S) / 2, R = y * 2;
10397
- u[v + R + 0] = S + M, u[v + R + 1] = M + (Math.abs(S) + M) * Ac;
10402
+ const C = (I - T) / 2, R = y * 2;
10403
+ u[v + R + 0] = T + C, u[v + R + 1] = C + (Math.abs(T) + C) * Ac;
10398
10404
  }
10399
10405
  }
10400
10406
  return u;
@@ -10458,11 +10464,11 @@ function Rc(n, e, t, i, s, a) {
10458
10464
  w.candidate = t[x + 2 * l], w.count = 0;
10459
10465
  const {
10460
10466
  bounds: A,
10461
- leftCacheBounds: S,
10467
+ leftCacheBounds: T,
10462
10468
  rightCacheBounds: I
10463
10469
  } = w;
10464
- for (let M = 0; M < 3; M++)
10465
- I[M] = 1 / 0, I[M + 3] = -1 / 0, S[M] = 1 / 0, S[M + 3] = -1 / 0, A[M] = 1 / 0, A[M + 3] = -1 / 0;
10470
+ for (let C = 0; C < 3; C++)
10471
+ I[C] = 1 / 0, I[C + 3] = -1 / 0, T[C] = 1 / 0, T[C + 3] = -1 / 0, A[C] = 1 / 0, A[C + 3] = -1 / 0;
10466
10472
  di(x, t, A);
10467
10473
  }
10468
10474
  g.sort(Pc);
@@ -10475,18 +10481,18 @@ function Rc(n, e, t, i, s, a) {
10475
10481
  for (let x = d; x < r; x += 6) {
10476
10482
  const w = t[x + 2 * l];
10477
10483
  for (let A = 0; A < y; A++) {
10478
- const S = g[A];
10479
- w >= S.candidate ? di(x, t, S.rightCacheBounds) : (di(x, t, S.leftCacheBounds), S.count++);
10484
+ const T = g[A];
10485
+ w >= T.candidate ? di(x, t, T.rightCacheBounds) : (di(x, t, T.leftCacheBounds), T.count++);
10480
10486
  }
10481
10487
  }
10482
10488
  for (let x = 0; x < y; x++) {
10483
- const w = g[x], A = w.count, S = s - w.count, I = w.leftCacheBounds, M = w.rightCacheBounds;
10489
+ const w = g[x], A = w.count, T = s - w.count, I = w.leftCacheBounds, C = w.rightCacheBounds;
10484
10490
  let R = 0;
10485
10491
  A !== 0 && (R = Nt(I) / u);
10486
- let P = 0;
10487
- S !== 0 && (P = Nt(M) / u);
10488
- const T = Ur + es * (R * A + P * S);
10489
- T < f && (o = l, f = T, c = w.candidate);
10492
+ let D = 0;
10493
+ T !== 0 && (D = Nt(C) / u);
10494
+ const S = Ur + es * (R * A + D * T);
10495
+ S < f && (o = l, f = S, c = w.candidate);
10490
10496
  }
10491
10497
  } else {
10492
10498
  for (let y = 0; y < Ce; y++) {
@@ -10499,8 +10505,8 @@ function Rc(n, e, t, i, s, a) {
10499
10505
  for (let y = d; y < r; y += 6) {
10500
10506
  let A = ~~((t[y + 2 * l] - h) / p);
10501
10507
  A >= Ce && (A = Ce - 1);
10502
- const S = We[A];
10503
- S.count++, di(y, t, S.bounds);
10508
+ const T = We[A];
10509
+ T.count++, di(y, t, T.bounds);
10504
10510
  }
10505
10511
  const g = We[Ce - 1];
10506
10512
  Nr(g.bounds, g.rightCacheBounds);
@@ -10512,12 +10518,12 @@ function Rc(n, e, t, i, s, a) {
10512
10518
  for (let y = 0; y < Ce - 1; y++) {
10513
10519
  const x = We[y], w = x.count, A = x.bounds, I = We[y + 1].rightCacheBounds;
10514
10520
  w !== 0 && (_ === 0 ? Nr(A, pi) : Wr(A, pi, pi)), _ += w;
10515
- let M = 0, R = 0;
10516
- _ !== 0 && (M = Nt(pi) / u);
10517
- const P = s - _;
10518
- P !== 0 && (R = Nt(I) / u);
10519
- const T = Ur + es * (M * _ + R * P);
10520
- T < f && (o = l, f = T, c = x.candidate);
10521
+ let C = 0, R = 0;
10522
+ _ !== 0 && (C = Nt(pi) / u);
10523
+ const D = s - _;
10524
+ D !== 0 && (R = Nt(I) / u);
10525
+ const S = Ur + es * (C * _ + R * D);
10526
+ S < f && (o = l, f = S, c = x.candidate);
10521
10527
  }
10522
10528
  }
10523
10529
  }
@@ -10578,10 +10584,10 @@ function Lc(n, e, t, i, s, a) {
10578
10584
  return o;
10579
10585
  }
10580
10586
  }
10581
- function ie(n, e) {
10587
+ function re(n, e) {
10582
10588
  return e[n + 15] === 65535;
10583
10589
  }
10584
- function ae(n, e) {
10590
+ function ce(n, e) {
10585
10591
  return e[n + 6];
10586
10592
  }
10587
10593
  function fe(n, e) {
@@ -10614,7 +10620,7 @@ function Ss(n, e) {
10614
10620
  Rn.set(new Uint8Array(o), n);
10615
10621
  for (let c = n, u = n + o.byteLength; c < u; c += $t) {
10616
10622
  const f = c / 2;
10617
- ie(f, Pi) || (Zt[c / 4 + 6] += t);
10623
+ re(f, Pi) || (Zt[c / 4 + 6] += t);
10618
10624
  }
10619
10625
  return n + o.byteLength;
10620
10626
  } else {
@@ -10650,21 +10656,21 @@ function Oc(n, e, t, i, s) {
10650
10656
  function y(w) {
10651
10657
  f && f(w / v);
10652
10658
  }
10653
- function x(w, A, S, I = null, M = 0) {
10654
- if (!g && M >= a && (g = !0, o && (console.warn(`MeshBVH: Max depth of ${a} reached when generating BVH. Consider increasing maxDepth.`), console.warn(l))), S <= c || M >= a)
10655
- return y(A + S), w.offset = A, w.count = S, w;
10656
- const R = Rc(w.boundingData, I, e, A, S, u);
10659
+ function x(w, A, T, I = null, C = 0) {
10660
+ if (!g && C >= a && (g = !0, o && (console.warn(`MeshBVH: Max depth of ${a} reached when generating BVH. Consider increasing maxDepth.`), console.warn(l))), T <= c || C >= a)
10661
+ return y(A + T), w.offset = A, w.count = T, w;
10662
+ const R = Rc(w.boundingData, I, e, A, T, u);
10657
10663
  if (R.axis === -1)
10658
- return y(A + S), w.offset = A, w.count = S, w;
10659
- const P = m(r, h, e, A, S, R);
10660
- if (P === A || P === A + S)
10661
- y(A + S), w.offset = A, w.count = S;
10664
+ return y(A + T), w.offset = A, w.count = T, w;
10665
+ const D = m(r, h, e, A, T, R);
10666
+ if (D === A || D === A + T)
10667
+ y(A + T), w.offset = A, w.count = T;
10662
10668
  else {
10663
10669
  w.splitAxis = R.axis;
10664
- const T = new ss(), C = A, D = P - A;
10665
- w.left = T, is(e, C, D, T.boundingData, p), x(T, C, D, p, M + 1);
10666
- const L = new ss(), k = P, z = S - D;
10667
- w.right = L, is(e, k, z, L.boundingData, p), x(L, k, z, p, M + 1);
10670
+ const S = new ss(), M = A, P = D - A;
10671
+ w.left = S, is(e, M, P, S.boundingData, p), x(S, M, P, p, C + 1);
10672
+ const L = new ss(), k = D, z = T - P;
10673
+ w.right = L, is(e, k, z, L.boundingData, p), x(L, k, z, p, C + 1);
10668
10674
  }
10669
10675
  return w;
10670
10676
  }
@@ -10811,15 +10817,15 @@ be.prototype.intersectsTriangle = function() {
10811
10817
  const _ = v.points;
10812
10818
  let y = 0, x = -1;
10813
10819
  for (let w = 0; w < 3; w++) {
10814
- const { start: A, end: S } = d;
10815
- A.copy(_[w]), S.copy(_[(w + 1) % 3]), d.delta(o);
10820
+ const { start: A, end: T } = d;
10821
+ A.copy(_[w]), T.copy(_[(w + 1) % 3]), d.delta(o);
10816
10822
  const I = rs(p.distanceToPoint(A));
10817
10823
  if (rs(p.normal.dot(o)) && I) {
10818
10824
  g.copy(d), y = 2;
10819
10825
  break;
10820
10826
  }
10821
- const M = p.intersectLine(d, h);
10822
- if (!M && I && h.copy(A), (M || I) && !rs(h.distanceTo(S))) {
10827
+ const C = p.intersectLine(d, h);
10828
+ if (!C && I && h.copy(A), (C || I) && !rs(h.distanceTo(T))) {
10823
10829
  if (y <= 1)
10824
10830
  (y === 1 ? g.start : g.end).copy(h), I && (x = y);
10825
10831
  else if (y >= 2) {
@@ -10838,23 +10844,23 @@ be.prototype.intersectsTriangle = function() {
10838
10844
  if (Math.abs(y.normal.dot(x.normal)) > 1 - 1e-10) {
10839
10845
  const w = this.satBounds, A = this.satAxes;
10840
10846
  t[0] = p.a, t[1] = p.b, t[2] = p.c;
10841
- for (let M = 0; M < 4; M++) {
10842
- const R = w[M], P = A[M];
10843
- if (i.setFromPoints(P, t), R.isSeparated(i))
10847
+ for (let C = 0; C < 4; C++) {
10848
+ const R = w[C], D = A[C];
10849
+ if (i.setFromPoints(D, t), R.isSeparated(i))
10844
10850
  return !1;
10845
10851
  }
10846
- const S = p.satBounds, I = p.satAxes;
10852
+ const T = p.satBounds, I = p.satAxes;
10847
10853
  e[0] = this.a, e[1] = this.b, e[2] = this.c;
10848
- for (let M = 0; M < 4; M++) {
10849
- const R = S[M], P = I[M];
10850
- if (i.setFromPoints(P, e), R.isSeparated(i))
10854
+ for (let C = 0; C < 4; C++) {
10855
+ const R = T[C], D = I[C];
10856
+ if (i.setFromPoints(D, e), R.isSeparated(i))
10851
10857
  return !1;
10852
10858
  }
10853
- for (let M = 0; M < 4; M++) {
10854
- const R = A[M];
10855
- for (let P = 0; P < 4; P++) {
10856
- const T = I[P];
10857
- if (a.crossVectors(R, T), i.setFromPoints(a, e), s.setFromPoints(a, t), i.isSeparated(s))
10859
+ for (let C = 0; C < 4; C++) {
10860
+ const R = A[C];
10861
+ for (let D = 0; D < 4; D++) {
10862
+ const S = I[D];
10863
+ if (a.crossVectors(R, S), i.setFromPoints(a, e), s.setFromPoints(a, t), i.isSeparated(s))
10858
10864
  return !1;
10859
10865
  }
10860
10866
  }
@@ -10871,11 +10877,11 @@ be.prototype.intersectsTriangle = function() {
10871
10877
  if (A !== 2)
10872
10878
  return !1;
10873
10879
  if (r.delta(c), l.delta(u), c.dot(u) < 0) {
10874
- let C = l.start;
10875
- l.start = l.end, l.end = C;
10880
+ let M = l.start;
10881
+ l.start = l.end, l.end = M;
10876
10882
  }
10877
- const S = r.start.dot(c), I = r.end.dot(c), M = l.start.dot(c), R = l.end.dot(c), P = I < M, T = S < R;
10878
- return S !== R && M !== I && P === T ? !1 : (g && (f.subVectors(r.start, l.start), f.dot(c) > 0 ? g.start.copy(r.start) : g.start.copy(l.start), f.subVectors(r.end, l.end), f.dot(c) < 0 ? g.end.copy(r.end) : g.end.copy(l.end)), !0);
10883
+ const T = r.start.dot(c), I = r.end.dot(c), C = l.start.dot(c), R = l.end.dot(c), D = I < C, S = T < R;
10884
+ return T !== R && C !== I && D === S ? !1 : (g && (f.subVectors(r.start, l.start), f.dot(c) > 0 ? g.start.copy(r.start) : g.start.copy(l.start), f.subVectors(r.end, l.end), f.dot(c) < 0 ? g.end.copy(r.end) : g.end.copy(l.end)), !0);
10879
10885
  }
10880
10886
  };
10881
10887
  }();
@@ -10912,7 +10918,7 @@ be.prototype.distanceToTriangle = function() {
10912
10918
  return Math.sqrt(d);
10913
10919
  };
10914
10920
  }();
10915
- class $ {
10921
+ class te {
10916
10922
  constructor(e, t, i) {
10917
10923
  this.isOrientedBox = !0, this.min = new b(), this.max = new b(), this.matrix = new Q(), this.invMatrix = new Q(), this.points = new Array(8).fill().map(() => new b()), this.satAxes = new Array(3).fill().map(() => new b()), this.satBounds = new Array(3).fill().map(() => new Ue()), this.alignedSatBounds = new Array(3).fill().map(() => new Ue()), this.needsUpdate = !1, e && this.min.copy(e), t && this.max.copy(t), i && this.matrix.copy(i);
10918
10924
  }
@@ -10923,7 +10929,7 @@ class $ {
10923
10929
  this.min.copy(e.min), this.max.copy(e.max), this.matrix.copy(e.matrix), this.needsUpdate = !0;
10924
10930
  }
10925
10931
  }
10926
- $.prototype.update = /* @__PURE__ */ function() {
10932
+ te.prototype.update = /* @__PURE__ */ function() {
10927
10933
  return function() {
10928
10934
  const e = this.matrix, t = this.min, i = this.max, s = this.points;
10929
10935
  for (let f = 0; f <= 1; f++)
@@ -10941,7 +10947,7 @@ $.prototype.update = /* @__PURE__ */ function() {
10941
10947
  u[0].setFromPointsField(s, "x"), u[1].setFromPointsField(s, "y"), u[2].setFromPointsField(s, "z"), this.invMatrix.copy(this.matrix).invert(), this.needsUpdate = !1;
10942
10948
  };
10943
10949
  }();
10944
- $.prototype.intersectsBox = function() {
10950
+ te.prototype.intersectsBox = function() {
10945
10951
  const n = new Ue();
10946
10952
  return function(t) {
10947
10953
  this.needsUpdate && this.update();
@@ -10956,7 +10962,7 @@ $.prototype.intersectsBox = function() {
10956
10962
  return !0;
10957
10963
  };
10958
10964
  }();
10959
- $.prototype.intersectsTriangle = function() {
10965
+ te.prototype.intersectsTriangle = function() {
10960
10966
  const n = new be(), e = new Array(3), t = new Ue(), i = new Ue(), s = new b();
10961
10967
  return function(o) {
10962
10968
  this.needsUpdate && this.update(), o.isExtendedTriangle ? o.needsUpdate && o.update() : (n.copy(o), n.update(), o = n);
@@ -10984,18 +10990,18 @@ $.prototype.intersectsTriangle = function() {
10984
10990
  return !0;
10985
10991
  };
10986
10992
  }();
10987
- $.prototype.closestPointToPoint = /* @__PURE__ */ function() {
10993
+ te.prototype.closestPointToPoint = /* @__PURE__ */ function() {
10988
10994
  return function(e, t) {
10989
10995
  return this.needsUpdate && this.update(), t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min, this.max).applyMatrix4(this.matrix), t;
10990
10996
  };
10991
10997
  }();
10992
- $.prototype.distanceToPoint = function() {
10998
+ te.prototype.distanceToPoint = function() {
10993
10999
  const n = new b();
10994
11000
  return function(t) {
10995
11001
  return this.closestPointToPoint(t, n), t.distanceTo(n);
10996
11002
  };
10997
11003
  }();
10998
- $.prototype.distanceToBox = function() {
11004
+ te.prototype.distanceToBox = function() {
10999
11005
  const n = ["x", "y", "z"], e = new Array(12).fill().map(() => new Fe()), t = new Array(12).fill().map(() => new Fe()), i = new b(), s = new b();
11000
11006
  return function(o, c = 0, u = null, f = null) {
11001
11007
  if (this.needsUpdate && this.update(), this.intersectsBox(o))
@@ -11013,10 +11019,10 @@ $.prototype.distanceToBox = function() {
11013
11019
  for (let p = 0; p < 3; p++)
11014
11020
  for (let g = 0; g <= 1; g++)
11015
11021
  for (let _ = 0; _ <= 1; _++) {
11016
- const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | _ << x, A = 1 << p | g << y | _ << x, S = h[w], I = h[A];
11017
- e[v].set(S, I);
11018
- const R = n[p], P = n[y], T = n[x], C = t[v], D = C.start, L = C.end;
11019
- D[R] = r[R], D[P] = g ? r[P] : l[P], D[T] = _ ? r[T] : l[P], L[R] = l[R], L[P] = g ? r[P] : l[P], L[T] = _ ? r[T] : l[P], v++;
11022
+ const y = (p + 1) % 3, x = (p + 2) % 3, w = g << y | _ << x, A = 1 << p | g << y | _ << x, T = h[w], I = h[A];
11023
+ e[v].set(T, I);
11024
+ const R = n[p], D = n[y], S = n[x], M = t[v], P = M.start, L = M.end;
11025
+ P[R] = r[R], P[D] = g ? r[D] : l[D], P[S] = _ ? r[S] : l[D], L[R] = l[R], L[D] = g ? r[D] : l[D], L[S] = _ ? r[S] : l[D], v++;
11020
11026
  }
11021
11027
  for (let p = 0; p <= 1; p++)
11022
11028
  for (let g = 0; g <= 1; g++)
@@ -11082,36 +11088,36 @@ function Gc(n, e, t, i, s, a) {
11082
11088
  function Ms(n, e, t, i, s = null, a = 0, o = 0) {
11083
11089
  const { float32Array: c, uint16Array: u, uint32Array: f } = N;
11084
11090
  let d = n * 2;
11085
- if (ie(d, u)) {
11086
- const l = ae(n, f), h = fe(d, u);
11091
+ if (re(d, u)) {
11092
+ const l = ce(n, f), h = fe(d, u);
11087
11093
  return V(n, c, Qe), i(l, h, !1, o, a + n, Qe);
11088
11094
  } else {
11089
- let R = function(T) {
11090
- const { uint16Array: C, uint32Array: D } = N;
11091
- let L = T * 2;
11092
- for (; !ie(L, C); )
11093
- T = de(T), L = T * 2;
11094
- return ae(T, D);
11095
- }, P = function(T) {
11096
- const { uint16Array: C, uint32Array: D } = N;
11097
- let L = T * 2;
11098
- for (; !ie(L, C); )
11099
- T = pe(T, D), L = T * 2;
11100
- return ae(T, D) + fe(L, C);
11095
+ let R = function(S) {
11096
+ const { uint16Array: M, uint32Array: P } = N;
11097
+ let L = S * 2;
11098
+ for (; !re(L, M); )
11099
+ S = de(S), L = S * 2;
11100
+ return ce(S, P);
11101
+ }, D = function(S) {
11102
+ const { uint16Array: M, uint32Array: P } = N;
11103
+ let L = S * 2;
11104
+ for (; !re(L, M); )
11105
+ S = pe(S, P), L = S * 2;
11106
+ return ce(S, P) + fe(L, M);
11101
11107
  };
11102
11108
  const l = de(n), h = pe(n, f);
11103
11109
  let m = l, v = h, p, g, _, y;
11104
11110
  if (s && (_ = Qe, y = At, V(m, c, _), V(v, c, y), p = s(_), g = s(y), g < p)) {
11105
11111
  m = h, v = l;
11106
- const T = p;
11107
- p = g, g = T, _ = y;
11112
+ const S = p;
11113
+ p = g, g = S, _ = y;
11108
11114
  }
11109
11115
  _ || (_ = Qe, V(m, c, _));
11110
- const x = ie(m * 2, u), w = t(_, x, p, o + 1, a + m);
11116
+ const x = re(m * 2, u), w = t(_, x, p, o + 1, a + m);
11111
11117
  let A;
11112
11118
  if (w === zr) {
11113
- const T = R(m), D = P(m) - T;
11114
- A = i(T, D, !0, o + 1, a + m, _);
11119
+ const S = R(m), P = D(m) - S;
11120
+ A = i(S, P, !0, o + 1, a + m, _);
11115
11121
  } else
11116
11122
  A = w && Ms(
11117
11123
  m,
@@ -11125,13 +11131,13 @@ function Ms(n, e, t, i, s = null, a = 0, o = 0) {
11125
11131
  if (A)
11126
11132
  return !0;
11127
11133
  y = At, V(v, c, y);
11128
- const S = ie(v * 2, u), I = t(y, S, g, o + 1, a + v);
11129
- let M;
11134
+ const T = re(v * 2, u), I = t(y, T, g, o + 1, a + v);
11135
+ let C;
11130
11136
  if (I === zr) {
11131
- const T = R(v), D = P(v) - T;
11132
- M = i(T, D, !0, o + 1, a + v, y);
11137
+ const S = R(v), P = D(v) - S;
11138
+ C = i(S, P, !0, o + 1, a + v, y);
11133
11139
  } else
11134
- M = I && Ms(
11140
+ C = I && Ms(
11135
11141
  v,
11136
11142
  e,
11137
11143
  t,
@@ -11140,7 +11146,7 @@ function Ms(n, e, t, i, s = null, a = 0, o = 0) {
11140
11146
  a,
11141
11147
  o + 1
11142
11148
  );
11143
- return !!M;
11149
+ return !!C;
11144
11150
  }
11145
11151
  }
11146
11152
  const Wt = /* @__PURE__ */ new b(), ns = /* @__PURE__ */ new b();
@@ -11236,29 +11242,29 @@ function Kc(n, e = null) {
11236
11242
  const v = l * 2;
11237
11243
  if (c[v + 15] === Ni) {
11238
11244
  const g = o[l + 6], _ = c[v + 14];
11239
- let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, S = -1 / 0, I = -1 / 0;
11240
- for (let M = 3 * g, R = 3 * (g + _); M < R; M++) {
11241
- let P = i[M];
11242
- const T = s.getX(P), C = s.getY(P), D = s.getZ(P);
11243
- T < y && (y = T), T > A && (A = T), C < x && (x = C), C > S && (S = C), D < w && (w = D), D > I && (I = D);
11245
+ let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, T = -1 / 0, I = -1 / 0;
11246
+ for (let C = 3 * g, R = 3 * (g + _); C < R; C++) {
11247
+ let D = i[C];
11248
+ const S = s.getX(D), M = s.getY(D), P = s.getZ(D);
11249
+ S < y && (y = S), S > A && (A = S), M < x && (x = M), M > T && (T = M), P < w && (w = P), P > I && (I = P);
11244
11250
  }
11245
- return u[l + 0] !== y || u[l + 1] !== x || u[l + 2] !== w || u[l + 3] !== A || u[l + 4] !== S || u[l + 5] !== I ? (u[l + 0] = y, u[l + 1] = x, u[l + 2] = w, u[l + 3] = A, u[l + 4] = S, u[l + 5] = I, !0) : !1;
11251
+ return u[l + 0] !== y || u[l + 1] !== x || u[l + 2] !== w || u[l + 3] !== A || u[l + 4] !== T || u[l + 5] !== I ? (u[l + 0] = y, u[l + 1] = x, u[l + 2] = w, u[l + 3] = A, u[l + 4] = T, u[l + 5] = I, !0) : !1;
11246
11252
  } else {
11247
11253
  const g = l + 8, _ = o[l + 6], y = g + h, x = _ + h;
11248
- let w = m, A = !1, S = !1;
11249
- e ? w || (A = e.has(y), S = e.has(x), w = !A && !S) : (A = !0, S = !0);
11250
- const I = w || A, M = w || S;
11254
+ let w = m, A = !1, T = !1;
11255
+ e ? w || (A = e.has(y), T = e.has(x), w = !A && !T) : (A = !0, T = !0);
11256
+ const I = w || A, C = w || T;
11251
11257
  let R = !1;
11252
11258
  I && (R = r(g, h, w));
11253
- let P = !1;
11254
- M && (P = r(_, h, w));
11255
- const T = R || P;
11256
- if (T)
11257
- for (let C = 0; C < 3; C++) {
11258
- const D = g + C, L = _ + C, k = u[D], z = u[D + 3], W = u[L], G = u[L + 3];
11259
- u[l + C] = k < W ? k : W, u[l + C + 3] = z > G ? z : G;
11259
+ let D = !1;
11260
+ C && (D = r(_, h, w));
11261
+ const S = R || D;
11262
+ if (S)
11263
+ for (let M = 0; M < 3; M++) {
11264
+ const P = g + M, L = _ + M, k = u[P], z = u[P + 3], W = u[L], G = u[L + 3];
11265
+ u[l + M] = k < W ? k : W, u[l + M + 3] = z > G ? z : G;
11260
11266
  }
11261
- return T;
11267
+ return S;
11262
11268
  }
11263
11269
  }
11264
11270
  }
@@ -11298,8 +11304,8 @@ function tu(n, e, t, i, s, a, o) {
11298
11304
  }
11299
11305
  function Cs(n, e, t, i, s, a, o) {
11300
11306
  const { float32Array: c, uint16Array: u, uint32Array: f } = N, d = n * 2;
11301
- if (ie(d, u)) {
11302
- const l = ae(n, f), h = fe(d, u);
11307
+ if (re(d, u)) {
11308
+ const l = ce(n, f), h = fe(d, u);
11303
11309
  Qc(e, t, i, l, h, s, a, o);
11304
11310
  } else {
11305
11311
  const l = de(n);
@@ -11317,8 +11323,8 @@ function su(n, e, t, i, s, a) {
11317
11323
  function Is(n, e, t, i, s, a) {
11318
11324
  const { float32Array: o, uint16Array: c, uint32Array: u } = N;
11319
11325
  let f = n * 2;
11320
- if (ie(f, c)) {
11321
- const r = ae(n, u), l = fe(f, c);
11326
+ if (re(f, c)) {
11327
+ const r = ce(n, u), l = fe(f, c);
11322
11328
  return Zc(e, t, i, r, l, s, a);
11323
11329
  } else {
11324
11330
  const r = In(n, u), l = iu[r], m = i.direction[l] >= 0;
@@ -11337,7 +11343,7 @@ function Is(n, e, t, i, s, a) {
11337
11343
  return _ && x ? _.distance <= x.distance ? _ : x : _ || x || null;
11338
11344
  }
11339
11345
  }
11340
- const xi = /* @__PURE__ */ new Y(), dt = /* @__PURE__ */ new be(), pt = /* @__PURE__ */ new be(), Vt = /* @__PURE__ */ new Q(), jr = /* @__PURE__ */ new $(), wi = /* @__PURE__ */ new $();
11346
+ const xi = /* @__PURE__ */ new Y(), dt = /* @__PURE__ */ new be(), pt = /* @__PURE__ */ new be(), Vt = /* @__PURE__ */ new Q(), jr = /* @__PURE__ */ new te(), wi = /* @__PURE__ */ new te();
11341
11347
  function ru(n, e, t, i) {
11342
11348
  N.setBuffer(n._roots[e]);
11343
11349
  const s = Ps(0, n, t, i);
@@ -11346,8 +11352,8 @@ function ru(n, e, t, i) {
11346
11352
  function Ps(n, e, t, i, s = null) {
11347
11353
  const { float32Array: a, uint16Array: o, uint32Array: c } = N;
11348
11354
  let u = n * 2;
11349
- if (s === null && (t.boundingBox || t.computeBoundingBox(), jr.set(t.boundingBox.min, t.boundingBox.max, i), s = jr), ie(u, o)) {
11350
- const d = e.geometry, r = d.index, l = d.attributes.position, h = t.index, m = t.attributes.position, v = ae(n, c), p = fe(u, o);
11355
+ if (s === null && (t.boundingBox || t.computeBoundingBox(), jr.set(t.boundingBox.min, t.boundingBox.max, i), s = jr), re(u, o)) {
11356
+ const d = e.geometry, r = d.index, l = d.attributes.position, h = t.index, m = t.attributes.position, v = ce(n, c), p = fe(u, o);
11351
11357
  if (Vt.copy(i).invert(), t.boundsTree)
11352
11358
  return V(n, a, wi), wi.matrix.copy(Vt), wi.needsUpdate = !0, t.boundsTree.shapecast({
11353
11359
  intersectsBounds: (_) => wi.intersectsBox(_),
@@ -11370,7 +11376,7 @@ function Ps(n, e, t, i, s = null) {
11370
11376
  return V(d, a, xi), !!(s.intersectsBox(xi) && Ps(d, e, t, i, s) || (V(r, a, xi), s.intersectsBox(xi) && Ps(r, e, t, i, s)));
11371
11377
  }
11372
11378
  }
11373
- const bi = /* @__PURE__ */ new Q(), os = /* @__PURE__ */ new $(), Gt = /* @__PURE__ */ new $(), nu = /* @__PURE__ */ new b(), ou = /* @__PURE__ */ new b(), au = /* @__PURE__ */ new b(), lu = /* @__PURE__ */ new b();
11379
+ const bi = /* @__PURE__ */ new Q(), os = /* @__PURE__ */ new te(), Gt = /* @__PURE__ */ new te(), nu = /* @__PURE__ */ new b(), ou = /* @__PURE__ */ new b(), au = /* @__PURE__ */ new b(), lu = /* @__PURE__ */ new b();
11374
11380
  function cu(n, e, t, i = {}, s = {}, a = 0, o = 1 / 0) {
11375
11381
  e.boundingBox || e.computeBoundingBox(), os.set(e.boundingBox.min, e.boundingBox.max, t), os.needsUpdate = !0;
11376
11382
  const c = n.geometry, u = c.attributes.position, f = c.index, d = e.attributes.position, r = e.index, l = me.getPrimitive(), h = me.getPrimitive();
@@ -11380,32 +11386,32 @@ function cu(n, e, t, i = {}, s = {}, a = 0, o = 1 / 0) {
11380
11386
  return bi.copy(t).invert(), Gt.matrix.copy(bi), n.shapecast(
11381
11387
  {
11382
11388
  boundsTraverseOrder: (w) => os.distanceToBox(w),
11383
- intersectsBounds: (w, A, S) => S < _ && S < o ? (A && (Gt.min.copy(w.min), Gt.max.copy(w.max), Gt.needsUpdate = !0), !0) : !1,
11389
+ intersectsBounds: (w, A, T) => T < _ && T < o ? (A && (Gt.min.copy(w.min), Gt.max.copy(w.max), Gt.needsUpdate = !0), !0) : !1,
11384
11390
  intersectsRange: (w, A) => {
11385
11391
  if (e.boundsTree)
11386
11392
  return e.boundsTree.shapecast({
11387
11393
  boundsTraverseOrder: (I) => Gt.distanceToBox(I),
11388
- intersectsBounds: (I, M, R) => R < _ && R < o,
11389
- intersectsRange: (I, M) => {
11390
- for (let R = I, P = I + M; R < P; R++) {
11394
+ intersectsBounds: (I, C, R) => R < _ && R < o,
11395
+ intersectsRange: (I, C) => {
11396
+ for (let R = I, D = I + C; R < D; R++) {
11391
11397
  q(h, 3 * R, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
11392
- for (let T = w, C = w + A; T < C; T++) {
11393
- q(l, 3 * T, f, u), l.needsUpdate = !0;
11394
- const D = l.distanceToTriangle(h, m, p);
11395
- if (D < _ && (v.copy(m), g && g.copy(p), _ = D, y = T, x = R), D < a)
11398
+ for (let S = w, M = w + A; S < M; S++) {
11399
+ q(l, 3 * S, f, u), l.needsUpdate = !0;
11400
+ const P = l.distanceToTriangle(h, m, p);
11401
+ if (P < _ && (v.copy(m), g && g.copy(p), _ = P, y = S, x = R), P < a)
11396
11402
  return !0;
11397
11403
  }
11398
11404
  }
11399
11405
  }
11400
11406
  });
11401
11407
  {
11402
- const S = Et(e);
11403
- for (let I = 0, M = S; I < M; I++) {
11408
+ const T = Et(e);
11409
+ for (let I = 0, C = T; I < C; I++) {
11404
11410
  q(h, 3 * I, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
11405
- for (let R = w, P = w + A; R < P; R++) {
11411
+ for (let R = w, D = w + A; R < D; R++) {
11406
11412
  q(l, 3 * R, f, u), l.needsUpdate = !0;
11407
- const T = l.distanceToTriangle(h, m, p);
11408
- if (T < _ && (v.copy(m), g && g.copy(p), _ = T, y = R, x = I), T < a)
11413
+ const S = l.distanceToTriangle(h, m, p);
11414
+ if (S < _ && (v.copy(m), g && g.copy(p), _ = S, y = R, x = I), S < a)
11409
11415
  return !0;
11410
11416
  }
11411
11417
  }
@@ -11425,33 +11431,33 @@ function uu(n, e = null) {
11425
11431
  const v = l * 2;
11426
11432
  if (c[v + 15] === Ni) {
11427
11433
  const g = o[l + 6], _ = c[v + 14];
11428
- let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, S = -1 / 0, I = -1 / 0;
11429
- for (let M = g, R = g + _; M < R; M++) {
11430
- const P = 3 * n.resolveTriangleIndex(M);
11431
- for (let T = 0; T < 3; T++) {
11432
- let C = P + T;
11433
- C = i ? i[C] : C;
11434
- const D = s.getX(C), L = s.getY(C), k = s.getZ(C);
11435
- D < y && (y = D), D > A && (A = D), L < x && (x = L), L > S && (S = L), k < w && (w = k), k > I && (I = k);
11434
+ let y = 1 / 0, x = 1 / 0, w = 1 / 0, A = -1 / 0, T = -1 / 0, I = -1 / 0;
11435
+ for (let C = g, R = g + _; C < R; C++) {
11436
+ const D = 3 * n.resolveTriangleIndex(C);
11437
+ for (let S = 0; S < 3; S++) {
11438
+ let M = D + S;
11439
+ M = i ? i[M] : M;
11440
+ const P = s.getX(M), L = s.getY(M), k = s.getZ(M);
11441
+ P < y && (y = P), P > A && (A = P), L < x && (x = L), L > T && (T = L), k < w && (w = k), k > I && (I = k);
11436
11442
  }
11437
11443
  }
11438
- return u[l + 0] !== y || u[l + 1] !== x || u[l + 2] !== w || u[l + 3] !== A || u[l + 4] !== S || u[l + 5] !== I ? (u[l + 0] = y, u[l + 1] = x, u[l + 2] = w, u[l + 3] = A, u[l + 4] = S, u[l + 5] = I, !0) : !1;
11444
+ return u[l + 0] !== y || u[l + 1] !== x || u[l + 2] !== w || u[l + 3] !== A || u[l + 4] !== T || u[l + 5] !== I ? (u[l + 0] = y, u[l + 1] = x, u[l + 2] = w, u[l + 3] = A, u[l + 4] = T, u[l + 5] = I, !0) : !1;
11439
11445
  } else {
11440
11446
  const g = l + 8, _ = o[l + 6], y = g + h, x = _ + h;
11441
- let w = m, A = !1, S = !1;
11442
- e ? w || (A = e.has(y), S = e.has(x), w = !A && !S) : (A = !0, S = !0);
11443
- const I = w || A, M = w || S;
11447
+ let w = m, A = !1, T = !1;
11448
+ e ? w || (A = e.has(y), T = e.has(x), w = !A && !T) : (A = !0, T = !0);
11449
+ const I = w || A, C = w || T;
11444
11450
  let R = !1;
11445
11451
  I && (R = r(g, h, w));
11446
- let P = !1;
11447
- M && (P = r(_, h, w));
11448
- const T = R || P;
11449
- if (T)
11450
- for (let C = 0; C < 3; C++) {
11451
- const D = g + C, L = _ + C, k = u[D], z = u[D + 3], W = u[L], G = u[L + 3];
11452
- u[l + C] = k < W ? k : W, u[l + C + 3] = z > G ? z : G;
11452
+ let D = !1;
11453
+ C && (D = r(_, h, w));
11454
+ const S = R || D;
11455
+ if (S)
11456
+ for (let M = 0; M < 3; M++) {
11457
+ const P = g + M, L = _ + M, k = u[P], z = u[P + 3], W = u[L], G = u[L + 3];
11458
+ u[l + M] = k < W ? k : W, u[l + M + 3] = z > G ? z : G;
11453
11459
  }
11454
- return T;
11460
+ return S;
11455
11461
  }
11456
11462
  }
11457
11463
  }
@@ -11460,8 +11466,8 @@ function hu(n, e, t, i, s, a, o) {
11460
11466
  }
11461
11467
  function Rs(n, e, t, i, s, a, o) {
11462
11468
  const { float32Array: c, uint16Array: u, uint32Array: f } = N, d = n * 2;
11463
- if (ie(d, u)) {
11464
- const l = ae(n, f), h = fe(d, u);
11469
+ if (re(d, u)) {
11470
+ const l = ce(n, f), h = fe(d, u);
11465
11471
  Jc(e, t, i, l, h, s, a, o);
11466
11472
  } else {
11467
11473
  const l = de(n);
@@ -11479,8 +11485,8 @@ function du(n, e, t, i, s, a) {
11479
11485
  function Ds(n, e, t, i, s, a) {
11480
11486
  const { float32Array: o, uint16Array: c, uint32Array: u } = N;
11481
11487
  let f = n * 2;
11482
- if (ie(f, c)) {
11483
- const r = ae(n, u), l = fe(f, c);
11488
+ if (re(f, c)) {
11489
+ const r = ce(n, u), l = fe(f, c);
11484
11490
  return $c(e, t, i, r, l, s, a);
11485
11491
  } else {
11486
11492
  const r = In(n, u), l = fu[r], m = i.direction[l] >= 0;
@@ -11499,7 +11505,7 @@ function Ds(n, e, t, i, s, a) {
11499
11505
  return _ && x ? _.distance <= x.distance ? _ : x : _ || x || null;
11500
11506
  }
11501
11507
  }
11502
- const Ai = /* @__PURE__ */ new Y(), mt = /* @__PURE__ */ new be(), gt = /* @__PURE__ */ new be(), qt = /* @__PURE__ */ new Q(), Yr = /* @__PURE__ */ new $(), Ti = /* @__PURE__ */ new $();
11508
+ const Ai = /* @__PURE__ */ new Y(), mt = /* @__PURE__ */ new be(), gt = /* @__PURE__ */ new be(), qt = /* @__PURE__ */ new Q(), Yr = /* @__PURE__ */ new te(), Ti = /* @__PURE__ */ new te();
11503
11509
  function pu(n, e, t, i) {
11504
11510
  N.setBuffer(n._roots[e]);
11505
11511
  const s = Es(0, n, t, i);
@@ -11508,8 +11514,8 @@ function pu(n, e, t, i) {
11508
11514
  function Es(n, e, t, i, s = null) {
11509
11515
  const { float32Array: a, uint16Array: o, uint32Array: c } = N;
11510
11516
  let u = n * 2;
11511
- if (s === null && (t.boundingBox || t.computeBoundingBox(), Yr.set(t.boundingBox.min, t.boundingBox.max, i), s = Yr), ie(u, o)) {
11512
- const d = e.geometry, r = d.index, l = d.attributes.position, h = t.index, m = t.attributes.position, v = ae(n, c), p = fe(u, o);
11517
+ if (s === null && (t.boundingBox || t.computeBoundingBox(), Yr.set(t.boundingBox.min, t.boundingBox.max, i), s = Yr), re(u, o)) {
11518
+ const d = e.geometry, r = d.index, l = d.attributes.position, h = t.index, m = t.attributes.position, v = ce(n, c), p = fe(u, o);
11513
11519
  if (qt.copy(i).invert(), t.boundsTree)
11514
11520
  return V(n, a, Ti), Ti.matrix.copy(qt), Ti.needsUpdate = !0, t.boundsTree.shapecast({
11515
11521
  intersectsBounds: (_) => Ti.intersectsBox(_),
@@ -11533,7 +11539,7 @@ function Es(n, e, t, i, s = null) {
11533
11539
  return V(d, a, Ai), !!(s.intersectsBox(Ai) && Es(d, e, t, i, s) || (V(r, a, Ai), s.intersectsBox(Ai) && Es(r, e, t, i, s)));
11534
11540
  }
11535
11541
  }
11536
- const Si = /* @__PURE__ */ new Q(), as = /* @__PURE__ */ new $(), jt = /* @__PURE__ */ new $(), mu = /* @__PURE__ */ new b(), gu = /* @__PURE__ */ new b(), vu = /* @__PURE__ */ new b(), _u = /* @__PURE__ */ new b();
11542
+ const Si = /* @__PURE__ */ new Q(), as = /* @__PURE__ */ new te(), jt = /* @__PURE__ */ new te(), mu = /* @__PURE__ */ new b(), gu = /* @__PURE__ */ new b(), vu = /* @__PURE__ */ new b(), _u = /* @__PURE__ */ new b();
11537
11543
  function yu(n, e, t, i = {}, s = {}, a = 0, o = 1 / 0) {
11538
11544
  e.boundingBox || e.computeBoundingBox(), as.set(e.boundingBox.min, e.boundingBox.max, t), as.needsUpdate = !0;
11539
11545
  const c = n.geometry, u = c.attributes.position, f = c.index, d = e.attributes.position, r = e.index, l = me.getPrimitive(), h = me.getPrimitive();
@@ -11543,36 +11549,36 @@ function yu(n, e, t, i = {}, s = {}, a = 0, o = 1 / 0) {
11543
11549
  return Si.copy(t).invert(), jt.matrix.copy(Si), n.shapecast(
11544
11550
  {
11545
11551
  boundsTraverseOrder: (w) => as.distanceToBox(w),
11546
- intersectsBounds: (w, A, S) => S < _ && S < o ? (A && (jt.min.copy(w.min), jt.max.copy(w.max), jt.needsUpdate = !0), !0) : !1,
11552
+ intersectsBounds: (w, A, T) => T < _ && T < o ? (A && (jt.min.copy(w.min), jt.max.copy(w.max), jt.needsUpdate = !0), !0) : !1,
11547
11553
  intersectsRange: (w, A) => {
11548
11554
  if (e.boundsTree) {
11549
- const S = e.boundsTree;
11550
- return S.shapecast({
11555
+ const T = e.boundsTree;
11556
+ return T.shapecast({
11551
11557
  boundsTraverseOrder: (I) => jt.distanceToBox(I),
11552
- intersectsBounds: (I, M, R) => R < _ && R < o,
11553
- intersectsRange: (I, M) => {
11554
- for (let R = I, P = I + M; R < P; R++) {
11555
- const T = S.resolveTriangleIndex(R);
11556
- q(h, 3 * T, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
11557
- for (let C = w, D = w + A; C < D; C++) {
11558
- const L = n.resolveTriangleIndex(C);
11558
+ intersectsBounds: (I, C, R) => R < _ && R < o,
11559
+ intersectsRange: (I, C) => {
11560
+ for (let R = I, D = I + C; R < D; R++) {
11561
+ const S = T.resolveTriangleIndex(R);
11562
+ q(h, 3 * S, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
11563
+ for (let M = w, P = w + A; M < P; M++) {
11564
+ const L = n.resolveTriangleIndex(M);
11559
11565
  q(l, 3 * L, f, u), l.needsUpdate = !0;
11560
11566
  const k = l.distanceToTriangle(h, m, p);
11561
- if (k < _ && (v.copy(m), g && g.copy(p), _ = k, y = C, x = R), k < a)
11567
+ if (k < _ && (v.copy(m), g && g.copy(p), _ = k, y = M, x = R), k < a)
11562
11568
  return !0;
11563
11569
  }
11564
11570
  }
11565
11571
  }
11566
11572
  });
11567
11573
  } else {
11568
- const S = Et(e);
11569
- for (let I = 0, M = S; I < M; I++) {
11574
+ const T = Et(e);
11575
+ for (let I = 0, C = T; I < C; I++) {
11570
11576
  q(h, 3 * I, r, d), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
11571
- for (let R = w, P = w + A; R < P; R++) {
11572
- const T = n.resolveTriangleIndex(R);
11573
- q(l, 3 * T, f, u), l.needsUpdate = !0;
11574
- const C = l.distanceToTriangle(h, m, p);
11575
- if (C < _ && (v.copy(m), g && g.copy(p), _ = C, y = R, x = I), C < a)
11577
+ for (let R = w, D = w + A; R < D; R++) {
11578
+ const S = n.resolveTriangleIndex(R);
11579
+ q(l, 3 * S, f, u), l.needsUpdate = !0;
11580
+ const M = l.distanceToTriangle(h, m, p);
11581
+ if (M < _ && (v.copy(m), g && g.copy(p), _ = M, y = R, x = I), M < a)
11576
11582
  return !0;
11577
11583
  }
11578
11584
  }
@@ -11618,22 +11624,22 @@ function wu(n, e, t, i) {
11618
11624
  function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11619
11625
  let r, l;
11620
11626
  d ? (r = Li, l = ei) : (r = ei, l = Li);
11621
- const h = r.float32Array, m = r.uint32Array, v = r.uint16Array, p = l.float32Array, g = l.uint32Array, _ = l.uint16Array, y = n * 2, x = e * 2, w = ie(y, v), A = ie(x, _);
11622
- let S = !1;
11627
+ const h = r.float32Array, m = r.uint32Array, v = r.uint16Array, p = l.float32Array, g = l.uint32Array, _ = l.uint16Array, y = n * 2, x = e * 2, w = re(y, v), A = re(x, _);
11628
+ let T = !1;
11623
11629
  if (A && w)
11624
- d ? S = s(
11625
- ae(e, g),
11630
+ d ? T = s(
11631
+ ce(e, g),
11626
11632
  fe(e * 2, _),
11627
- ae(n, m),
11633
+ ce(n, m),
11628
11634
  fe(n * 2, v),
11629
11635
  u,
11630
11636
  o + e,
11631
11637
  c,
11632
11638
  a + n
11633
- ) : S = s(
11634
- ae(n, m),
11639
+ ) : T = s(
11640
+ ce(n, m),
11635
11641
  fe(n * 2, v),
11636
- ae(e, g),
11642
+ ce(e, g),
11637
11643
  fe(e * 2, _),
11638
11644
  c,
11639
11645
  a + n,
@@ -11643,12 +11649,12 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11643
11649
  else if (A) {
11644
11650
  const I = je.getPrimitive();
11645
11651
  V(e, p, I), I.applyMatrix4(t);
11646
- const M = de(n), R = pe(n, m);
11647
- V(M, h, vt), V(R, h, _t);
11648
- const P = I.intersectsBox(vt), T = I.intersectsBox(_t);
11649
- S = P && _e(
11652
+ const C = de(n), R = pe(n, m);
11653
+ V(C, h, vt), V(R, h, _t);
11654
+ const D = I.intersectsBox(vt), S = I.intersectsBox(_t);
11655
+ T = D && _e(
11650
11656
  e,
11651
- M,
11657
+ C,
11652
11658
  i,
11653
11659
  t,
11654
11660
  s,
@@ -11658,7 +11664,7 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11658
11664
  c + 1,
11659
11665
  I,
11660
11666
  !d
11661
- ) || T && _e(
11667
+ ) || S && _e(
11662
11668
  e,
11663
11669
  R,
11664
11670
  i,
@@ -11672,11 +11678,11 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11672
11678
  !d
11673
11679
  ), je.releasePrimitive(I);
11674
11680
  } else {
11675
- const I = de(e), M = pe(e, g);
11676
- V(I, p, ls), V(M, p, cs);
11677
- const R = f.intersectsBox(ls), P = f.intersectsBox(cs);
11678
- if (R && P)
11679
- S = _e(
11681
+ const I = de(e), C = pe(e, g);
11682
+ V(I, p, ls), V(C, p, cs);
11683
+ const R = f.intersectsBox(ls), D = f.intersectsBox(cs);
11684
+ if (R && D)
11685
+ T = _e(
11680
11686
  n,
11681
11687
  I,
11682
11688
  t,
@@ -11690,7 +11696,7 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11690
11696
  d
11691
11697
  ) || _e(
11692
11698
  n,
11693
- M,
11699
+ C,
11694
11700
  t,
11695
11701
  i,
11696
11702
  s,
@@ -11703,7 +11709,7 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11703
11709
  );
11704
11710
  else if (R)
11705
11711
  if (w)
11706
- S = _e(
11712
+ T = _e(
11707
11713
  n,
11708
11714
  I,
11709
11715
  t,
@@ -11717,14 +11723,14 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11717
11723
  d
11718
11724
  );
11719
11725
  else {
11720
- const T = je.getPrimitive();
11721
- T.copy(ls).applyMatrix4(t);
11722
- const C = de(n), D = pe(n, m);
11723
- V(C, h, vt), V(D, h, _t);
11724
- const L = T.intersectsBox(vt), k = T.intersectsBox(_t);
11725
- S = L && _e(
11726
+ const S = je.getPrimitive();
11727
+ S.copy(ls).applyMatrix4(t);
11728
+ const M = de(n), P = pe(n, m);
11729
+ V(M, h, vt), V(P, h, _t);
11730
+ const L = S.intersectsBox(vt), k = S.intersectsBox(_t);
11731
+ T = L && _e(
11726
11732
  I,
11727
- C,
11733
+ M,
11728
11734
  i,
11729
11735
  t,
11730
11736
  s,
@@ -11732,11 +11738,11 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11732
11738
  a,
11733
11739
  u,
11734
11740
  c + 1,
11735
- T,
11741
+ S,
11736
11742
  !d
11737
11743
  ) || k && _e(
11738
11744
  I,
11739
- D,
11745
+ P,
11740
11746
  i,
11741
11747
  t,
11742
11748
  s,
@@ -11744,15 +11750,15 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11744
11750
  a,
11745
11751
  u,
11746
11752
  c + 1,
11747
- T,
11753
+ S,
11748
11754
  !d
11749
- ), je.releasePrimitive(T);
11755
+ ), je.releasePrimitive(S);
11750
11756
  }
11751
- else if (P)
11757
+ else if (D)
11752
11758
  if (w)
11753
- S = _e(
11759
+ T = _e(
11754
11760
  n,
11755
- M,
11761
+ C,
11756
11762
  t,
11757
11763
  i,
11758
11764
  s,
@@ -11764,14 +11770,14 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11764
11770
  d
11765
11771
  );
11766
11772
  else {
11767
- const T = je.getPrimitive();
11768
- T.copy(cs).applyMatrix4(t);
11769
- const C = de(n), D = pe(n, m);
11770
- V(C, h, vt), V(D, h, _t);
11771
- const L = T.intersectsBox(vt), k = T.intersectsBox(_t);
11772
- S = L && _e(
11773
- M,
11773
+ const S = je.getPrimitive();
11774
+ S.copy(cs).applyMatrix4(t);
11775
+ const M = de(n), P = pe(n, m);
11776
+ V(M, h, vt), V(P, h, _t);
11777
+ const L = S.intersectsBox(vt), k = S.intersectsBox(_t);
11778
+ T = L && _e(
11774
11779
  C,
11780
+ M,
11775
11781
  i,
11776
11782
  t,
11777
11783
  s,
@@ -11779,11 +11785,11 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11779
11785
  a,
11780
11786
  u,
11781
11787
  c + 1,
11782
- T,
11788
+ S,
11783
11789
  !d
11784
11790
  ) || k && _e(
11785
- M,
11786
- D,
11791
+ C,
11792
+ P,
11787
11793
  i,
11788
11794
  t,
11789
11795
  s,
@@ -11791,14 +11797,14 @@ function _e(n, e, t, i, s, a = 0, o = 0, c = 0, u = 0, f = null, d = !1) {
11791
11797
  a,
11792
11798
  u,
11793
11799
  c + 1,
11794
- T,
11800
+ S,
11795
11801
  !d
11796
- ), je.releasePrimitive(T);
11802
+ ), je.releasePrimitive(S);
11797
11803
  }
11798
11804
  }
11799
- return S;
11805
+ return T;
11800
11806
  }
11801
- const Mi = /* @__PURE__ */ new $(), Qr = /* @__PURE__ */ new Y(), bu = {
11807
+ const Mi = /* @__PURE__ */ new te(), Qr = /* @__PURE__ */ new Y(), bu = {
11802
11808
  strategy: Sn,
11803
11809
  maxDepth: 40,
11804
11810
  maxLeafTris: 10,
@@ -11836,7 +11842,7 @@ class Ys {
11836
11842
  if (c._roots = a, c._indirectBuffer = o || null, i.setIndex) {
11837
11843
  const u = t.getIndex();
11838
11844
  if (u === null) {
11839
- const f = new oe(e.index, 1, !1);
11845
+ const f = new le(e.index, 1, !1);
11840
11846
  t.setIndex(f);
11841
11847
  } else
11842
11848
  u.array !== s && (u.array.set(s), u.needsUpdate = !0);
@@ -11949,18 +11955,18 @@ class Ys {
11949
11955
  };
11950
11956
  if (a) {
11951
11957
  const m = (v, p, g, _, y, x, w, A) => {
11952
- for (let S = g, I = g + _; S < I; S++) {
11953
- h(S), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
11954
- for (let M = v, R = v + p; M < R; M++)
11955
- if (f(M), o.needsUpdate = !0, a(o, d, M, S, y, x, w, A))
11958
+ for (let T = g, I = g + _; T < I; T++) {
11959
+ h(T), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
11960
+ for (let C = v, R = v + p; C < R; C++)
11961
+ if (f(C), o.needsUpdate = !0, a(o, d, C, T, y, x, w, A))
11956
11962
  return !0;
11957
11963
  }
11958
11964
  return !1;
11959
11965
  };
11960
11966
  if (s) {
11961
11967
  const v = s;
11962
- s = function(p, g, _, y, x, w, A, S) {
11963
- return v(p, g, _, y, x, w, A, S) ? !0 : m(p, g, _, y, x, w, A, S);
11968
+ s = function(p, g, _, y, x, w, A, T) {
11969
+ return v(p, g, _, y, x, w, A, T) ? !0 : m(p, g, _, y, x, w, A, T);
11964
11970
  };
11965
11971
  } else
11966
11972
  s = m;
@@ -12056,7 +12062,7 @@ class Tu extends Au {
12056
12062
  if (t.index)
12057
12063
  t.index.array = r.index;
12058
12064
  else {
12059
- const v = new oe(r.index, 1, !1);
12065
+ const v = new le(r.index, 1, !1);
12060
12066
  t.setIndex(v);
12061
12067
  }
12062
12068
  m.setBoundingBox && (t.boundingBox = h.getBoundingBox(new Y())), i.onProgress && i.onProgress(d.progress), s(h), e.onmessage = null;
@@ -12303,7 +12309,7 @@ class Mu {
12303
12309
  const g = new Kn(16777215, h / o);
12304
12310
  g.name = "dir_light_" + p, g.castShadow = !0, g.shadow.bias = a, g.shadow.camera.near = 0.1, g.shadow.camera.far = 50, g.shadow.camera.right = c / 2, g.shadow.camera.left = -c / 2, g.shadow.camera.top = c / 2, g.shadow.camera.bottom = -c / 2, g.shadow.mapSize.width = s, g.shadow.mapSize.height = s, this.dirLights.push(g), this.lightGroup.add(g);
12305
12311
  }
12306
- const m = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ? xe : le;
12312
+ const m = /(Android|iPad|iPhone|iPod)/g.test(navigator == null ? void 0 : navigator.userAgent) ? xe : ue;
12307
12313
  this.progressiveLightMap1 = new Le(i, i, { type: m }), this.progressiveLightMap2 = new Le(i, i, { type: m }), this.progressiveLightMap1.texture.colorSpace = Ks, this.progressiveLightMap2.texture.colorSpace = Ks, this.shadowCatcherMaterial = new Cu({
12308
12314
  map: this.progressiveLightMap2.texture,
12309
12315
  transparent: !0,
@@ -12650,64 +12656,64 @@ class Rh {
12650
12656
  var u;
12651
12657
  (u = this._progressShadow) == null || u.recalculate();
12652
12658
  }, 300), this.focusSlots = (u) => {
12653
- var R;
12654
- if (this.amr.slots.forEach((P) => {
12655
- P.focused = !1, P.hide();
12659
+ var R, D, S;
12660
+ if (this.amr.slots.forEach((M) => {
12661
+ M.focused = !1, M.hide();
12656
12662
  }), !u.length)
12657
- if (this._lastTarget.set(0, 0, this._lastTarget.z), this.amr.slots.forEach((P) => {
12658
- P.show();
12659
- }), this._focusRestoreView) {
12660
- const P = this._focusRestoreView;
12663
+ if (this._lastTarget.set(0, 0, this._lastTarget.z), this.amr.slots.forEach((M) => {
12664
+ M.show();
12665
+ }), this.shadowMode = !1, this._focusRestoreView) {
12666
+ const M = this._focusRestoreView;
12661
12667
  this._focusRestoreView = void 0;
12662
- const T = this.camera.position.clone(), C = this.controls.target.clone(), D = P.position.clone(), L = P.target.clone(), k = { t: 0 };
12663
- let z = 500;
12664
- const W = T.distanceTo(D) + C.distanceTo(L);
12665
- W > 1e-3 && (z = Math.min(1e3, Math.max(450, W * 45))), (R = this._fitAnimation) == null || R.stop(), this._fitAnimation = new Kt(k).to({ t: 1 }, z).easing(Ee.Easing.Quadratic.InOut).onStart(() => {
12668
+ const P = this.camera.position.clone(), L = this.controls.target.clone(), k = M.position.clone(), z = M.target.clone(), W = { t: 0 };
12669
+ let G = 500;
12670
+ const $ = P.distanceTo(k) + L.distanceTo(z);
12671
+ $ > 1e-3 && (G = Math.min(1e3, Math.max(450, $ * 45))), (R = this._fitAnimation) == null || R.stop(), this._fitAnimation = new Kt(W).to({ t: 1 }, G).easing(Ee.Easing.Quadratic.InOut).onStart(() => {
12666
12672
  this.controls.enabled = !1;
12667
12673
  }).onUpdate(() => {
12668
- const G = k.t;
12669
- this.camera.position.lerpVectors(T, D, G), this.controls.target.lerpVectors(C, L, G);
12674
+ const ee = W.t;
12675
+ this.camera.position.lerpVectors(P, k, ee), this.controls.target.lerpVectors(L, z, ee);
12670
12676
  }).onComplete(() => {
12671
- this.controls.enabled = !0, this.camera.up.copy(P.up);
12677
+ this.controls.enabled = !0, this.camera.up.copy(M.up);
12672
12678
  }).start();
12673
12679
  return;
12674
12680
  } else {
12675
12681
  this.fit();
12676
12682
  return;
12677
12683
  }
12678
- this._focusRestoreView = {
12684
+ (D = this._fitAnimation) != null && D.isPlaying() || this.shadowMode || (this._focusRestoreView = {
12679
12685
  position: this.camera.position.clone(),
12680
12686
  target: new b(0, 0, this.controls.target.z),
12681
12687
  up: this.camera.up.clone()
12682
- };
12683
- const f = u.flatMap((P) => {
12684
- if (P.show(), P.focused = !0, !P.parent)
12688
+ }), (S = this._fitAnimation) == null || S.stop(), this.shadowMode = !0;
12689
+ const f = u.flatMap((M) => {
12690
+ if (M.show(), M.focused = !0, !M.parent)
12685
12691
  return [];
12686
- const T = new b();
12687
- return P.parent.getWorldPosition(T), [T];
12692
+ const P = new b();
12693
+ return M.parent.getWorldPosition(P), [P];
12688
12694
  });
12689
12695
  if (!f.length)
12690
12696
  return;
12691
- const d = f.reduce((P, T) => P.add(T), new b()).multiplyScalar(1 / f.length), r = this.controls.target.clone(), l = this.camera.position.clone().sub(r).normalize();
12697
+ const d = f.reduce((M, P) => M.add(P), new b()).multiplyScalar(1 / f.length), r = this.controls.target.clone(), l = this.camera.position.clone().sub(r).normalize();
12692
12698
  let h = 0;
12693
- for (const P of f) {
12694
- const T = P.clone().sub(d), C = T.dot(l), D = Math.sqrt(Math.max(0, T.lengthSq() - C * C));
12695
- D > h && (h = D);
12699
+ for (const M of f) {
12700
+ const P = M.clone().sub(d), L = P.dot(l), k = Math.sqrt(Math.max(0, P.lengthSq() - L * L));
12701
+ k > h && (h = k);
12696
12702
  }
12697
12703
  h = h + 0.4;
12698
- const m = this.camera.fov * Math.PI / 180, v = 2 * Math.atan(Math.tan(m / 2) * this.camera.aspect), p = h / Math.tan(v / 2), g = h / Math.tan(m / 2), _ = Math.max(p, g), y = d.clone(), x = d.clone().add(l.clone().multiplyScalar(_ < 1 ? 1 : _)), w = this.camera.position.clone(), A = r.clone(), S = { t: 0 };
12704
+ const m = this.camera.fov * Math.PI / 180, v = 2 * Math.atan(Math.tan(m / 2) * this.camera.aspect), p = h / Math.tan(v / 2), g = h / Math.tan(m / 2), _ = Math.max(p, g), y = d.clone(), x = d.clone().add(l.clone().multiplyScalar(_ < 1 ? 1 : _)), w = this.camera.position.clone(), A = r.clone(), T = { t: 0 };
12699
12705
  let I = 500;
12700
- const M = w.distanceTo(x) + A.distanceTo(y);
12701
- M > 1e-3 && (I = Math.min(1e3, Math.max(450, M * 45))), this._lastTarget = y.clone(), this._fitAnimation = new Kt(S).to({ t: 1 }, I).easing(Ee.Easing.Quadratic.InOut).onStart(() => {
12706
+ const C = w.distanceTo(x) + A.distanceTo(y);
12707
+ C > 1e-3 && (I = Math.min(1e3, Math.max(450, C * 45))), this._lastTarget = y.clone(), this._fitAnimation = new Kt(T).to({ t: 1 }, I).easing(Ee.Easing.Quadratic.InOut).onStart(() => {
12702
12708
  this.controls.enabled = !1;
12703
12709
  }).onUpdate(() => {
12704
- const P = S.t;
12705
- this.camera.position.lerpVectors(w, x, P), this.controls.target.lerpVectors(A, y, P);
12710
+ const M = T.t;
12711
+ this.camera.position.lerpVectors(w, x, M), this.controls.target.lerpVectors(A, y, M);
12706
12712
  }).onComplete(() => {
12707
12713
  this.controls.enabled = !0;
12708
12714
  }).start();
12709
12715
  }, this.fit = () => {
12710
- new Y().setFromObject(this._container);
12716
+ this._focusRestoreView = void 0, new Y().setFromObject(this._container);
12711
12717
  const f = this.amr.sizeBox.size.getSize(new b()), d = f.clone().multiplyScalar(0.5), r = new b(0, 0, d.z);
12712
12718
  this._lastTarget.copy(r);
12713
12719
  let l = d.clone().sub(r);
@@ -12729,18 +12735,18 @@ class Rh {
12729
12735
  }
12730
12736
  p = p * 1.05;
12731
12737
  const g = this.camera.fov * Math.PI / 180, _ = 2 * Math.atan(Math.tan(g / 2) * this.camera.aspect), y = p / Math.tan(_ / 2), x = p / Math.tan(g / 2), w = Math.max(y, x), A = d.clone();
12732
- let S = f.z / 3;
12733
- f.z < f.x && f.z < f.y && (S = f.x * 0.8), f.z > f.x && f.z > f.y && (S = 0), A.z += S;
12734
- const I = l.clone().normalize().multiplyScalar(w < 1 ? 1 : w).add(A), M = Math.max(f.x * 2, 5);
12735
- this.light.position.set(M, 0, f.z * 2);
12736
- const R = this.camera.position.clone(), P = this.controls.target.clone(), T = { t: 0 };
12737
- let C = 600;
12738
- const D = R.distanceTo(I) + P.distanceTo(r);
12739
- D > 1e-3 && (C = Math.min(800, Math.max(650, D * 45))), this._fitAnimation = new Kt(T).to({ t: 1 }, C).easing(Ee.Easing.Quadratic.InOut).onStart(() => {
12738
+ let T = f.z / 3;
12739
+ f.z < f.x && f.z < f.y && (T = f.x * 0.8), f.z > f.x && f.z > f.y && (T = 0), A.z += T;
12740
+ const I = l.clone().normalize().multiplyScalar(w < 1 ? 1 : w).add(A), C = Math.max(f.x * 2, 5);
12741
+ this.light.position.set(C, 0, f.z * 2);
12742
+ const R = this.camera.position.clone(), D = this.controls.target.clone(), S = { t: 0 };
12743
+ let M = 600;
12744
+ const P = R.distanceTo(I) + D.distanceTo(r);
12745
+ P > 1e-3 && (M = Math.min(800, Math.max(650, P * 45))), this._fitAnimation = new Kt(S).to({ t: 1 }, M).easing(Ee.Easing.Quadratic.InOut).onStart(() => {
12740
12746
  this.controls.enabled = !1;
12741
12747
  }).onUpdate(() => {
12742
- const L = T.t;
12743
- this.camera.position.lerpVectors(R, I, L), this.controls.target.lerpVectors(P, r, L);
12748
+ const L = S.t;
12749
+ this.camera.position.lerpVectors(R, I, L), this.controls.target.lerpVectors(D, r, L);
12744
12750
  }).onComplete(() => {
12745
12751
  this.controls.enabled = !0, !this.shadowMode && (this._progressShadow.visible = !0, this._progressShadow.isFinished || this._progressShadow.recalculate());
12746
12752
  }).start(), this.controls.minDistance = Math.max(0.2, Math.min(w * 0.25, w - 0.1)), this.controls.maxDistance = w * 4;
@@ -12998,7 +13004,7 @@ class Rh {
12998
13004
  a.userData[`origin_${i}`] && (o -= a.userData[`origin_${i}`]);
12999
13005
  const c = a.morphTargetDictionary[i];
13000
13006
  a.morphTargetInfluences && (a.morphTargetInfluences[c] = o), a instanceof j && a.geometry.translate(0, 0, 1e-5);
13001
- }), this._progressShadow.clear(), this._progressShadow.recalculate();
13007
+ }), ["width", "length"].includes(i) && (this._progressShadow.clear(), this._progressShadow.recalculate());
13002
13008
  });
13003
13009
  }
13004
13010
  select(e) {
@@ -13061,8 +13067,8 @@ class Fu {
13061
13067
  for (const w of d) {
13062
13068
  const A = this.configureCamera(x, w, f, c, a, o);
13063
13069
  t.setRenderTarget(r), t.clear(!0, !0, !0), t.render(this.deps.scene, A), u && this.deps.overlayScene && (t.clearDepth(), t.render(this.deps.overlayScene, A));
13064
- const S = this.readPixels(t, r, a, o);
13065
- h[w.key] = S;
13070
+ const T = this.readPixels(t, r, a, o);
13071
+ h[w.key] = T;
13066
13072
  }
13067
13073
  } finally {
13068
13074
  r.dispose(), this.restoreRendererState(t, l), (y = (_ = this.deps).onAfterCapture) == null || y.call(_);
@@ -13122,33 +13128,33 @@ class Fu {
13122
13128
  c.lengthSq() === 0 && c.set(0, 0, 1);
13123
13129
  const u = t.up.clone().normalize();
13124
13130
  if (Math.abs(u.dot(c)) > 0.999 && (u.set(0, 0, 1), Math.abs(u.dot(c)) > 0.999 && u.set(0, 1, 0)), (t.mode ?? "orthographic") === "perspective") {
13125
- const x = this.perspectiveCamera, w = t.fov ?? 45, A = Ge.degToRad(w), S = Math.max(Math.tan(A / 2), 1e-4), I = Math.max(S * (i || 1), 1e-4), M = this.getPerspectiveDirection(t, e.size).normalize(), R = new b().crossVectors(M, u).normalize();
13131
+ const x = this.perspectiveCamera, w = t.fov ?? 45, A = Ge.degToRad(w), T = Math.max(Math.tan(A / 2), 1e-4), I = Math.max(T * (i || 1), 1e-4), C = this.getPerspectiveDirection(t, e.size).normalize(), R = new b().crossVectors(C, u).normalize();
13126
13132
  R.lengthSq() < 1e-6 && R.set(1, 0, 0);
13127
- const P = new b().crossVectors(R, M).normalize(), T = Math.max(e.size.x * 0.5, 1e-4), C = Math.max(e.size.y * 0.5, 1e-4), D = Math.max(e.size.z * 0.5, 1e-4), L = [
13128
- new b(-T, -C, -D),
13129
- new b(-T, -C, D),
13130
- new b(-T, C, -D),
13131
- new b(-T, C, D),
13132
- new b(T, -C, -D),
13133
- new b(T, -C, D),
13134
- new b(T, C, -D),
13135
- new b(T, C, D)
13133
+ const D = new b().crossVectors(R, C).normalize(), S = Math.max(e.size.x * 0.5, 1e-4), M = Math.max(e.size.y * 0.5, 1e-4), P = Math.max(e.size.z * 0.5, 1e-4), L = [
13134
+ new b(-S, -M, -P),
13135
+ new b(-S, -M, P),
13136
+ new b(-S, M, -P),
13137
+ new b(-S, M, P),
13138
+ new b(S, -M, -P),
13139
+ new b(S, -M, P),
13140
+ new b(S, M, -P),
13141
+ new b(S, M, P)
13136
13142
  ];
13137
13143
  let k = 0, z = -1 / 0;
13138
- for (const ce of L) {
13139
- const ue = R.dot(ce), Me = P.dot(ce), Lt = M.dot(ce);
13144
+ for (const $ of L) {
13145
+ const ee = R.dot($), Me = D.dot($), Lt = C.dot($);
13140
13146
  z = Math.max(z, Lt);
13141
- const Vi = Lt + Math.abs(ue) / I, kt = Lt + Math.abs(Me) / S;
13147
+ const Vi = Lt + Math.abs(ee) / I, kt = Lt + Math.abs(Me) / T;
13142
13148
  k = Math.max(k, Vi, kt);
13143
13149
  }
13144
13150
  k = Math.max(k, z + 0.1);
13145
13151
  const W = k * (1 + s);
13146
13152
  let G = 1 / 0;
13147
- for (const ce of L) {
13148
- const ue = M.dot(ce), Me = W - ue;
13153
+ for (const $ of L) {
13154
+ const ee = C.dot($), Me = W - ee;
13149
13155
  Me > 1e-3 && (G = Math.min(G, Me));
13150
13156
  }
13151
- return x.fov = w, x.aspect = i || a / Math.max(o, 1), x.near = Math.max(0.1, Number.isFinite(G) ? G * 0.5 : W * 0.1), x.far = Math.max(x.near + 1, W + e.sphere.radius * 3), x.position.copy(e.center).add(M.clone().multiplyScalar(W)), x.up.copy(P), x.lookAt(e.center), x.updateProjectionMatrix(), x.updateMatrixWorld(!0), x;
13157
+ return x.fov = w, x.aspect = i || a / Math.max(o, 1), x.near = Math.max(0.1, Number.isFinite(G) ? G * 0.5 : W * 0.1), x.far = Math.max(x.near + 1, W + e.sphere.radius * 3), x.position.copy(e.center).add(C.clone().multiplyScalar(W)), x.up.copy(D), x.lookAt(e.center), x.updateProjectionMatrix(), x.updateMatrixWorld(!0), x;
13152
13158
  }
13153
13159
  const d = this.orthoCamera, r = e.size, l = e.center, h = Math.max(r[t.plane.width] * 0.5, 0.01), m = Math.max(r[t.plane.height] * 0.5, 0.01), v = Math.max(r[t.plane.depth] * 0.5, 0.01);
13154
13160
  let p = h * (1 + s), g = m * (1 + s);
@@ -13220,7 +13226,7 @@ class Fu {
13220
13226
  return this.canvas || (this.canvas = document.createElement("canvas")), (this.canvas.width !== e || this.canvas.height !== t) && (this.canvas.width = e, this.canvas.height = t), this.canvas;
13221
13227
  }
13222
13228
  }
13223
- const Bu = "shop-components", Ou = "0.3.3", zu = "Shop components", Uu = "dist/shop-components.umd.js", Hu = "dist/shop-components.mjs", Nu = "dist/main.d.ts", Wu = {
13229
+ const Bu = "shop-components", Ou = "0.3.4", zu = "Shop components", Uu = "dist/shop-components.umd.js", Hu = "dist/shop-components.mjs", Nu = "dist/main.d.ts", Wu = {
13224
13230
  dts: "tsc --emitDeclarationOnly & tsc & storybook build -o dist",
13225
13231
  dev: "vite dev",
13226
13232
  build: "vite build",