@spiffcommerce/preview 5.7.9-11 → 5.7.9-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { ArcRotateCamera as fe } from "@babylonjs/core/Cameras/arcRotateCamera";
2
2
  import { Engine as be } from "@babylonjs/core/Engines/engine";
3
3
  import { NullEngine as Ce } from "@babylonjs/core/Engines/nullEngine";
4
- import { HighlightLayer as xe } from "@babylonjs/core/Layers/highlightLayer";
4
+ import { HighlightLayer as ye } from "@babylonjs/core/Layers/highlightLayer";
5
5
  import { SceneLoader as S } from "@babylonjs/core/Loading/sceneLoader";
6
6
  import { CubeTexture as ne } from "@babylonjs/core/Materials/Textures/cubeTexture";
7
7
  import { Color4 as b, Color3 as w } from "@babylonjs/core/Maths/math.color";
8
- import { Vector3 as p, Quaternion as x, Vector2 as se, Matrix as re } from "@babylonjs/core/Maths/math.vector";
8
+ import { Vector3 as p, Quaternion as y, Vector2 as se, Matrix as re } from "@babylonjs/core/Maths/math.vector";
9
9
  import { DracoCompression as Ae } from "@babylonjs/core/Meshes/Compression/dracoCompression";
10
10
  import { Observable as C } from "@babylonjs/core/Misc/observable";
11
- import { Tools as ye } from "@babylonjs/core/Misc/tools";
12
- import { Scene as Me } from "@babylonjs/core/scene";
11
+ import { Tools as Me } from "@babylonjs/core/Misc/tools";
12
+ import { Scene as xe } from "@babylonjs/core/scene";
13
13
  import { GLTF2 as Pe } from "@babylonjs/loaders/glTF";
14
14
  import { GLTFLoaderAnimationStartMode as Re } from "@babylonjs/loaders/glTF/glTFFileLoader";
15
15
  import { PBRMaterial as B } from "@babylonjs/core/Materials/PBR/pbrMaterial";
@@ -27,7 +27,7 @@ import { Animation as v } from "@babylonjs/core/Animations/animation";
27
27
  import { QuadraticEase as ke, EasingFunction as ze } from "@babylonjs/core/Animations/easing";
28
28
  import { AssetsManager as Ne } from "@babylonjs/core/Misc/assetsManager";
29
29
  import { ColorCurves as le } from "@babylonjs/core/Materials/colorCurves";
30
- import { ImageProcessingConfiguration as M } from "@babylonjs/core/Materials/imageProcessingConfiguration";
30
+ import { ImageProcessingConfiguration as x } from "@babylonjs/core/Materials/imageProcessingConfiguration";
31
31
  import { DefaultRenderingPipeline as qe } from "@babylonjs/core/PostProcesses/RenderPipeline";
32
32
  import { DepthOfFieldEffectBlurLevel as E } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
33
33
  import "@babylonjs/core/Rendering/depthRendererSceneComponent";
@@ -40,29 +40,29 @@ import "@babylonjs/core/Animations/animatable";
40
40
  import "@babylonjs/core/Misc/screenshotTools";
41
41
  import "@babylonjs/core/Rendering/boundingBoxRenderer";
42
42
  import "@babylonjs/loaders/glTF/2.0/Extensions";
43
- var I = /* @__PURE__ */ ((s) => (s[s.Orbit = 0] = "Orbit", s[s.Pan = 1] = "Pan", s))(I || {}), F = /* @__PURE__ */ ((s) => (s.None = "None", s.RemoveWhenSelected = "RemoveWhenSelected", s.ApplyWhenSelected = "ApplyWhenSelected", s))(F || {});
43
+ var I = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(I || {}), F = /* @__PURE__ */ ((r) => (r.None = "None", r.RemoveWhenSelected = "RemoveWhenSelected", r.ApplyWhenSelected = "ApplyWhenSelected", r))(F || {});
44
44
  const he = /* @__PURE__ */ new Map();
45
- async function D(s, e, t) {
46
- const i = await he.get(s);
45
+ async function D(r, e, t) {
46
+ const i = await he.get(r);
47
47
  if (i && i.scene.uid === e.uid)
48
48
  return i;
49
- const r = S.LoadAssetContainerAsync(
50
- s,
49
+ const n = S.LoadAssetContainerAsync(
50
+ r,
51
51
  void 0,
52
52
  e,
53
53
  t
54
54
  );
55
- return he.set(s, r), r;
55
+ return he.set(r, n), n;
56
56
  }
57
- S.OnPluginActivatedObservable.add((s) => {
58
- s.name === "gltf" && (s.animationStartMode = Re.NONE);
57
+ S.OnPluginActivatedObservable.add((r) => {
58
+ r.name === "gltf" && (r.animationStartMode = Re.NONE);
59
59
  });
60
60
  class ce {
61
61
  constructor(e) {
62
62
  this.getSceneClearColor = () => {
63
- var i, r, n, o;
64
- const t = (i = this.customOptions) != null && i.transparentBackground || (r = this.customOptions) != null && r.backgroundImage ? 0 : 1;
65
- if (this.customOptions && ((n = this.customOptions) != null && n.transparentBackground) || (o = this.customOptions) != null && o.backgroundImage)
63
+ var i, n, s, o;
64
+ const t = (i = this.customOptions) != null && i.transparentBackground || (n = this.customOptions) != null && n.backgroundImage ? 0 : 1;
65
+ if (this.customOptions && ((s = this.customOptions) != null && s.transparentBackground) || (o = this.customOptions) != null && o.backgroundImage)
66
66
  return new b(0, 0, 0, t).toLinearSpace();
67
67
  if (this.customOptions && this.customOptions.backgroundColor) {
68
68
  const a = w.FromHexString(
@@ -77,11 +77,11 @@ class ce {
77
77
  }
78
78
  return new b(0.98, 0.98, 0.98, t).toLinearSpace();
79
79
  }, this.highlightColorFromConfig = () => this.customOptions && this.customOptions.highlightColor ? this.hexToColor4(this.customOptions.highlightColor) : new b(0.98, 0.98, 0.98, 1).toLinearSpace(), this.hexToColor4 = (t, i = 1) => {
80
- const r = w.FromHexString(t);
80
+ const n = w.FromHexString(t);
81
81
  return new b(
82
- r.r,
83
- r.g,
84
- r.b,
82
+ n.r,
83
+ n.g,
84
+ n.b,
85
85
  i
86
86
  ).toLinearSpace();
87
87
  }, this.customOptions = e;
@@ -97,14 +97,14 @@ class ce {
97
97
  * Configuration related to the scene
98
98
  */
99
99
  get scene() {
100
- var e, t, i, r, n;
100
+ var e, t, i, n, s;
101
101
  return {
102
102
  clearColor: this.getSceneClearColor(),
103
103
  transparentBackground: ((e = this.customOptions) == null ? void 0 : e.transparentBackground) || ((t = this.customOptions) == null ? void 0 : t.backgroundImage),
104
104
  environment: {
105
105
  file: ((i = this.customOptions) == null ? void 0 : i.environmentFile) ?? "assets/model-viewer/default.env",
106
- intensity: ((r = this.customOptions) == null ? void 0 : r.environmentIntensity) ?? 1,
107
- rotationY: (((n = this.customOptions) == null ? void 0 : n.environmentRotationY) ?? 0) * (Math.PI / 180)
106
+ intensity: ((n = this.customOptions) == null ? void 0 : n.environmentIntensity) ?? 1,
107
+ rotationY: (((s = this.customOptions) == null ? void 0 : s.environmentRotationY) ?? 0) * (Math.PI / 180)
108
108
  // Convert to radians
109
109
  }
110
110
  };
@@ -113,7 +113,7 @@ class ce {
113
113
  * Configuration related to the camera used to view and interact with the scene.
114
114
  */
115
115
  get camera() {
116
- var e, t, i, r, n, o, a, h, l, c, m, u, g;
116
+ var e, t, i, n, s, o, a, h, l, c, m, u, g;
117
117
  return {
118
118
  autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
119
119
  autoRotation: {
@@ -122,7 +122,7 @@ class ce {
122
122
  },
123
123
  limits: {
124
124
  min: {
125
- alpha: (r = this.customOptions) != null && r.lowerAlphaLimitDeg ? ((n = this.customOptions) == null ? void 0 : n.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
125
+ alpha: (n = this.customOptions) != null && n.lowerAlphaLimitDeg ? ((s = this.customOptions) == null ? void 0 : s.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
126
126
  beta: (o = this.customOptions) != null && o.lowerBetaLimitDeg ? ((a = this.customOptions) == null ? void 0 : a.lowerBetaLimitDeg) * Math.PI / 180 : void 0,
127
127
  radius: (h = this.customOptions) == null ? void 0 : h.minZoomOverride
128
128
  },
@@ -146,10 +146,10 @@ class ce {
146
146
  };
147
147
  }
148
148
  get lighting() {
149
- var e, t, i, r;
149
+ var e, t, i, n;
150
150
  return {
151
151
  exposure: ((t = (e = this.customOptions) == null ? void 0 : e.lighting) == null ? void 0 : t.exposure) ?? 0.9,
152
- contrast: ((r = (i = this.customOptions) == null ? void 0 : i.lighting) == null ? void 0 : r.contrast) ?? 1.6
152
+ contrast: ((n = (i = this.customOptions) == null ? void 0 : i.lighting) == null ? void 0 : n.contrast) ?? 1.6
153
153
  };
154
154
  }
155
155
  get emissiveGlowIntensity() {
@@ -157,12 +157,12 @@ class ce {
157
157
  return ((e = this.customOptions) == null ? void 0 : e.emissiveGlowIntensity) ?? 0.5;
158
158
  }
159
159
  }
160
- class y {
160
+ class M {
161
161
  /**
162
162
  * Returns the resolution expected for generated textures.
163
163
  */
164
164
  static getDynamicTextureResolution() {
165
- return this.getIsMobile() || !y.offscreenRenderingSupported() ? {
165
+ return this.getIsMobile() || !M.offscreenRenderingSupported() ? {
166
166
  width: 1024,
167
167
  height: 1024
168
168
  } : {
@@ -270,11 +270,11 @@ class _e {
270
270
  return this.loader.loadNodeAsync(
271
271
  e,
272
272
  t,
273
- function(r) {
274
- t.extras && Object.keys(t.extras).forEach((n) => {
275
- const o = t.extras[n];
276
- r.metadata[n] = o;
277
- }), i(r);
273
+ function(n) {
274
+ t.extras && Object.keys(t.extras).forEach((s) => {
275
+ const o = t.extras[s];
276
+ n.metadata[s] = o;
277
+ }), i(n);
278
278
  }
279
279
  );
280
280
  }
@@ -332,51 +332,51 @@ class _e {
332
332
  * @param scene The scene to parse.
333
333
  */
334
334
  applyReflections(e) {
335
- function t(n) {
335
+ function t(s) {
336
336
  const o = [];
337
- return n.transformNodes.forEach((a) => {
337
+ return s.transformNodes.forEach((a) => {
338
338
  a.metadata && a.metadata.reflective && o.push(...a.getChildMeshes());
339
- }), n.meshes.forEach((a) => {
339
+ }), s.meshes.forEach((a) => {
340
340
  a.metadata && a.metadata.reflective && !o.includes(a) && o.push(a);
341
341
  }), o;
342
342
  }
343
- function i(n, o = 1) {
344
- const a = n.material;
343
+ function i(s, o = 1) {
344
+ const a = s.material;
345
345
  if (!a)
346
346
  return;
347
347
  const h = new Ee(
348
348
  "mirror",
349
- y.getMirrorTextureResolution(),
349
+ M.getMirrorTextureResolution(),
350
350
  e,
351
351
  !0
352
352
  );
353
353
  h.renderList = t(e);
354
- const l = n.getVerticesData("normal");
354
+ const l = s.getVerticesData("normal");
355
355
  if (!l)
356
356
  throw new Error(
357
- "Mirror attribute specified on: " + n.name + "But no normals exist to generate a mirror from!"
357
+ "Mirror attribute specified on: " + s.name + "But no normals exist to generate a mirror from!"
358
358
  );
359
- n.computeWorldMatrix(!0);
360
- const c = n.getWorldMatrix(), m = ae.TransformNormal(
359
+ s.computeWorldMatrix(!0);
360
+ const c = s.getWorldMatrix(), m = ae.TransformNormal(
361
361
  new ae(l[0], l[1], l[2]),
362
362
  c
363
363
  ).normalize(), u = Oe.FromPositionAndNormal(
364
- n.position,
364
+ s.position,
365
365
  m.scale(-1)
366
366
  );
367
367
  h.mirrorPlane = u, h.level = o, a.reflectionTexture = h;
368
368
  }
369
- function r(n) {
370
- const o = n.material, a = new Le(
369
+ function n(s) {
370
+ const o = s.material, a = new Le(
371
371
  "probe-" + o.name,
372
372
  Ve,
373
373
  e
374
374
  );
375
- a.cubeTexture.name = "reflection-probe-cube-texture", a.attachToMesh(n), a.renderList && a.renderList.push(...t(e)), o.reflectionTexture = a.cubeTexture;
375
+ a.attachToMesh(s), a.renderList && a.renderList.push(...t(e)), o.reflectionTexture = a.cubeTexture;
376
376
  }
377
- e.meshes.forEach((n) => {
378
- const o = n.metadata;
379
- o && (o.mirrorTexture && i(n, o.mirrorTexture), o.reflectionProbe && r(n));
377
+ e.meshes.forEach((s) => {
378
+ const o = s.metadata;
379
+ o && (o.mirrorTexture && i(s, o.mirrorTexture), o.reflectionProbe && n(s));
380
380
  });
381
381
  }
382
382
  }
@@ -402,68 +402,90 @@ class Ge {
402
402
  }
403
403
  }
404
404
  }
405
- function He(s, e, t, i, r = "") {
406
- t.forEach((n) => {
407
- const o = n.getID(), a = n.getName(), h = y.getDynamicTextureResolution();
408
- s.filter((c) => c.name === r + a).forEach((c) => {
405
+ function He(r, e, t, i, n = "") {
406
+ t.forEach((s) => {
407
+ const o = s.getID(), a = s.getName(), h = M.getDynamicTextureResolution();
408
+ r.filter((c) => c.name === n + a).forEach((c) => {
409
+ console.log(`cheking material ${c.name}`);
409
410
  const m = i.get(o), u = !1;
410
411
  if (m)
411
- de(c, m), m.update(u);
412
+ de(c, m), console.log(`case b applying texture ${m.name}`), m.update(u);
412
413
  else {
413
- const g = Ue(
414
+ const g = Ke(
414
415
  a,
415
416
  e,
416
417
  h.width,
417
418
  h.height
418
419
  );
419
- i.set(o, g), n.setStaticContext(
420
+ i.set(o, g), s.setStaticContext(
420
421
  g.getContext()
421
- ), de(c, g), g.onLoadObservable.addOnce(() => {
422
+ ), de(c, g), console.log(`case a applying texture ${g.name}`), g.onLoadObservable.addOnce(() => {
422
423
  g.update(u);
423
424
  });
424
425
  }
425
426
  });
426
- });
427
+ }), Ue(e);
427
428
  }
428
- function Ue(s, e, t, i) {
429
- const r = new Be(
430
- s,
429
+ const Ue = (r) => {
430
+ const e = () => r.textures.reduce((i, n) => {
431
+ var o;
432
+ return !r.meshes.some(
433
+ (a) => a.material && a.material.hasTexture(n)
434
+ ) && !((o = n == null ? void 0 : n.url) != null && o.includes("data:")) && !n.name.endsWith(".env") && i.push(n), i;
435
+ }, []), t = () => r.materials.reduce((i, n) => (n.getBindedMeshes().length == 0 && i.push(n), i), []);
436
+ e().forEach((i) => {
437
+ try {
438
+ console.log(`disposing texture ${i.name}`), i.dispose();
439
+ } catch {
440
+ console.log(`Failed to dispose texture ${i.name}`);
441
+ }
442
+ }), t().forEach((i) => {
443
+ try {
444
+ console.log(`disposing material ${i.name}`), i.dispose(!0, !0);
445
+ } catch {
446
+ console.log(`Failed to dispose material ${i.name}`);
447
+ }
448
+ });
449
+ };
450
+ function Ke(r, e, t, i) {
451
+ const n = new Be(
452
+ r,
431
453
  { width: t, height: i },
432
454
  e,
433
- y.shouldMipMap(),
455
+ M.shouldMipMap(),
434
456
  De.TRILINEAR_SAMPLINGMODE,
435
457
  be.TEXTUREFORMAT_RGBA
436
- ), n = r.getContext();
437
- return n && (n.fillStyle = "#f5f5f5", n.fillRect(0, 0, t, i), r.update()), r;
458
+ ), s = n.getContext();
459
+ return s && (s.fillStyle = "#f5f5f5", s.fillRect(0, 0, t, i), n.update()), n;
438
460
  }
439
- function de(s, e) {
440
- if (s instanceof B) {
441
- const t = s, i = t.albedoTexture;
461
+ function de(r, e) {
462
+ if (r instanceof B) {
463
+ const t = r, i = t.albedoTexture;
442
464
  i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
443
465
  } else {
444
- const t = s, i = t.diffuseTexture;
466
+ const t = r, i = t.diffuseTexture;
445
467
  i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
446
468
  }
447
469
  }
448
- function Ke() {
449
- const s = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
450
- return s() + s() + "-" + s() + "-" + s() + "-" + s() + "-" + s() + s() + s();
470
+ function We() {
471
+ const r = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
472
+ return r() + r() + "-" + r() + "-" + r() + "-" + r() + "-" + r() + r() + r();
451
473
  }
452
474
  const A = 60, ue = 1;
453
- function me(s) {
454
- return s.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / s.targetedAnimations.length || 0;
475
+ function me(r) {
476
+ return r.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / r.targetedAnimations.length || 0;
455
477
  }
456
- function ve(s, e, t, i, r, n) {
457
- const o = r ? s.filter((c) => c.name === r) : s;
478
+ function ve(r, e, t, i, n, s) {
479
+ const o = n ? r.filter((c) => c.name === n) : r;
458
480
  if (o.length === 0) {
459
- console.warn(`No animations found for name: ${r}`);
481
+ console.warn(`No animations found for name: ${n}`);
460
482
  return;
461
483
  }
462
484
  let a = 0;
463
485
  const h = () => {
464
- a++, a === o.length && n && n();
486
+ a++, a === o.length && s && s();
465
487
  }, l = (c, m, u, g, f) => {
466
- c.stop(), c.start(m, u, g, f), n && (m == !1 || m === void 0 && !c.loopAnimation ? c.onAnimationGroupEndObservable.addOnce(() => {
488
+ c.stop(), c.start(m, u, g, f), s && (m == !1 || m === void 0 && !c.loopAnimation ? c.onAnimationGroupEndObservable.addOnce(() => {
467
489
  h();
468
490
  }) : c.onAnimationLoopObservable.addOnce(() => {
469
491
  h();
@@ -481,11 +503,11 @@ function ve(s, e, t, i, r, n) {
481
503
  l(c, e, ue, u, g);
482
504
  });
483
505
  }
484
- function We(s, e, t) {
506
+ function Ye(r, e, t) {
485
507
  return new Promise((i) => {
486
- s.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ye(e.alpha, 0, 2 * Math.PI));
487
- const r = [], n = t.target, o = 0, a = n ? 1 : 0;
488
- if (t.target && Object.keys(t.target).length > 0 && r.push(
508
+ r.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = $e(e.alpha, 0, 2 * Math.PI));
509
+ const n = [], s = t.target, o = 0, a = s ? 1 : 0;
510
+ if (t.target && Object.keys(t.target).length > 0 && n.push(
489
511
  P(
490
512
  "cameraTargetLerp",
491
513
  "target",
@@ -498,7 +520,7 @@ function We(s, e, t) {
498
520
  v.ANIMATIONTYPE_VECTOR3,
499
521
  o
500
522
  )
501
- ), r.push(
523
+ ), n.push(
502
524
  P(
503
525
  "cameraAlphaLerp",
504
526
  "alpha",
@@ -507,7 +529,7 @@ function We(s, e, t) {
507
529
  v.ANIMATIONTYPE_FLOAT,
508
530
  a
509
531
  )
510
- ), r.push(
532
+ ), n.push(
511
533
  P(
512
534
  "cameraBetaLerp",
513
535
  "beta",
@@ -518,7 +540,7 @@ function We(s, e, t) {
518
540
  )
519
541
  ), t.radius !== void 0) {
520
542
  const c = Math.max(0.01, t.radius);
521
- r.push(
543
+ n.push(
522
544
  P(
523
545
  "cameraRadiusLerp",
524
546
  "radius",
@@ -529,12 +551,12 @@ function We(s, e, t) {
529
551
  )
530
552
  );
531
553
  }
532
- e.animations.push(...r);
554
+ e.animations.push(...n);
533
555
  const l = e.useAutoRotationBehavior;
534
- e.disableAutoRotationBehavior(), s.beginAnimation(
556
+ e.disableAutoRotationBehavior(), r.beginAnimation(
535
557
  e,
536
558
  0,
537
- n ? A * 2 : A,
559
+ s ? A * 2 : A,
538
560
  !1,
539
561
  1,
540
562
  () => {
@@ -543,33 +565,33 @@ function We(s, e, t) {
543
565
  );
544
566
  });
545
567
  }
546
- function ge(s) {
547
- return s * Math.PI / 180;
568
+ function ge(r) {
569
+ return r * Math.PI / 180;
548
570
  }
549
- function P(s, e, t, i, r, n = 0, o = v.ANIMATIONLOOPMODE_CONSTANT) {
571
+ function P(r, e, t, i, n, s = 0, o = v.ANIMATIONLOOPMODE_CONSTANT) {
550
572
  const a = new ke();
551
573
  a.setEasingMode(ze.EASINGMODE_EASEINOUT);
552
574
  const h = new v(
553
- s,
575
+ r,
554
576
  e,
555
577
  A,
556
- r,
578
+ n,
557
579
  o
558
580
  ), l = [];
559
- return n > 0 && l.push({ frame: 0, value: t }), l.push({ frame: A * n, value: t }), l.push({
560
- frame: A * (n + 1),
581
+ return s > 0 && l.push({ frame: 0, value: t }), l.push({ frame: A * s, value: t }), l.push({
582
+ frame: A * (s + 1),
561
583
  value: i
562
584
  }), h.setKeys(l), h.setEasingFunction(a), h;
563
585
  }
564
- function Ye(s, e, t) {
565
- return s < e ? s = t - (e - s) % (t - e) : s = e + (s - e) % (t - e);
586
+ function $e(r, e, t) {
587
+ return r < e ? r = t - (e - r) % (t - e) : r = e + (r - e) % (t - e);
566
588
  }
567
- function Qe(s, e, t) {
568
- s.forEach((i) => {
589
+ function Qe(r, e, t) {
590
+ r.forEach((i) => {
569
591
  t && i.name !== t || i.goToFrame(e);
570
592
  });
571
593
  }
572
- const $e = {
594
+ const Ze = {
573
595
  albedoTexture: "albedoMap",
574
596
  bumpTexture: "normalMap",
575
597
  ambientTexture: "ambientMap",
@@ -579,7 +601,7 @@ const $e = {
579
601
  refractionTexture: "refractionMap",
580
602
  reflectionTexture: "reflectionMap"
581
603
  };
582
- function Ze(s, e, t, i) {
604
+ function je(r, e, t, i) {
583
605
  [
584
606
  "albedoTexture",
585
607
  "bumpTexture",
@@ -589,51 +611,51 @@ function Ze(s, e, t, i) {
589
611
  "metallicTexture",
590
612
  "refractionTexture",
591
613
  "reflectionTexture"
592
- ].forEach((n) => {
593
- je(
594
- n,
614
+ ].forEach((s) => {
615
+ Xe(
595
616
  s,
617
+ r,
596
618
  e,
597
619
  t,
598
620
  i
599
621
  );
600
- }), et(s, e);
622
+ }), tt(r, e);
601
623
  }
602
- function je(s, e, t, i, r) {
603
- const n = $e[s];
604
- if (!n)
624
+ function Xe(r, e, t, i, n) {
625
+ const s = Ze[r];
626
+ if (!s)
605
627
  throw new Error("Unexpected texture name encountered.");
606
- const o = e[n], a = o == null ? void 0 : o.fileLink;
607
- a ? s === "reflectionTexture" ? a.endsWith(".env") || a.endsWith(".dds") ? i.addCubeTextureTask(
608
- s,
628
+ const o = e[s], a = o == null ? void 0 : o.fileLink;
629
+ a ? r === "reflectionTexture" ? a.endsWith(".env") || a.endsWith(".dds") ? i.addCubeTextureTask(
630
+ r,
609
631
  a,
610
632
  void 0,
611
633
  !1,
612
634
  void 0,
613
635
  !0
614
636
  ) : a.endsWith(".hdr") ? i.addHDRCubeTextureTask(
615
- s,
637
+ r,
616
638
  a,
617
639
  128,
618
640
  !1,
619
641
  !0,
620
642
  !1
621
- ) : i.addTextureTask(s, a, !1, !1) : i.addTextureTask(s, a, !1, !1) : r && t[s] && (t[s] && t[s].dispose(), t[s] = null, Xe(s, t));
643
+ ) : i.addTextureTask(r, a, !1, !1) : i.addTextureTask(r, a, !1, !1) : n && t[r] && (t[r] && t[r].dispose(), t[r] = null, Je(r, t));
622
644
  }
623
- function Xe(s, e) {
624
- s === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), s === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), s === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), s === "reflectionTexture" && (e.environmentIntensity = 1), s === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new w(0, 0, 0), e.reflectionTexture);
645
+ function Je(r, e) {
646
+ r === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), r === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), r === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), r === "reflectionTexture" && (e.environmentIntensity = 1), r === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new w(0, 0, 0), e.reflectionTexture);
625
647
  }
626
- function Je(s, e, t, i) {
648
+ function et(r, e, t, i) {
627
649
  if (!e) {
628
650
  console.error("Failed to apply texture to material: material is null.");
629
651
  return;
630
652
  }
631
- s === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), s === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), s === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), s === "reflectionTexture" && (e.environmentIntensity = t.reflectionIntensity || 1, i.isCube && (i.rotationY = t.reflectionRotation ? t.reflectionRotation * Math.PI / 180 : 0)), e[s] = i, s === "emissiveTexture" && (e.emissiveColor = new w(1, 1, 1), e.emissiveIntensity = 1);
653
+ r === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), r === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), r === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), r === "reflectionTexture" && (e.environmentIntensity = t.reflectionIntensity || 1, i.isCube && (i.rotationY = t.reflectionRotation ? t.reflectionRotation * Math.PI / 180 : 0)), e[r] = i, r === "emissiveTexture" && (e.emissiveColor = new w(1, 1, 1), e.emissiveIntensity = 1);
632
654
  }
633
- function et(s, e) {
634
- s.clearCoat && (s.clearCoat === F.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : s.clearCoat === F.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = s.clearCoatIOR || e.clearCoat.indexOfRefraction));
655
+ function tt(r, e) {
656
+ r.clearCoat && (r.clearCoat === F.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : r.clearCoat === F.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = r.clearCoatIOR || e.clearCoat.indexOfRefraction));
635
657
  }
636
- class tt {
658
+ class it {
637
659
  constructor(e, t, i) {
638
660
  this.materialVariantMap = /* @__PURE__ */ new Map(), this.keysThatRemovedBaseModel = [], this.loadedContainerForKey = /* @__PURE__ */ new Map(), this.loadedMaterialsForKey = /* @__PURE__ */ new Map(), this.scene = e, this.renameClonedAsset = t, this.setBaseModelEnabled = i;
639
661
  }
@@ -646,8 +668,8 @@ class tt {
646
668
  * instead remove material textures when they aren't defined. this is useful for material editor applications
647
669
  * where we want to undo changes are remove effects from display.
648
670
  */
649
- async applyMaterial(e, t, i, r) {
650
- return new Promise((n) => {
671
+ async applyMaterial(e, t, i, n) {
672
+ return new Promise((s) => {
651
673
  const o = this.materialVariantMap.get(e);
652
674
  this.materialVariantMap.set(e, {
653
675
  ...o,
@@ -657,16 +679,16 @@ class tt {
657
679
  (c) => c.name === a
658
680
  );
659
681
  if (h.length === 0) {
660
- n();
682
+ s();
661
683
  return;
662
684
  }
663
685
  const l = new Ne(this.scene);
664
686
  l.useDefaultLoadingScreen = !1, h.forEach(
665
- (c) => Ze(
687
+ (c) => je(
666
688
  t,
667
689
  c,
668
690
  l,
669
- r
691
+ n
670
692
  )
671
693
  ), l.onProgress = (c, m, u) => {
672
694
  i && i(c / m * 100, 100, u.name);
@@ -675,15 +697,15 @@ class tt {
675
697
  const u = m;
676
698
  i && i(100, 100, m.name), this.scene.materials.filter(
677
699
  (f) => f.name === a
678
- ).forEach((f) => {
679
- Je(
700
+ ).forEach(
701
+ (f) => et(
680
702
  m.name,
681
703
  f,
682
704
  t,
683
705
  u.texture
684
- );
685
- });
686
- }), n();
706
+ )
707
+ );
708
+ }), s();
687
709
  }, l.loadAsync();
688
710
  });
689
711
  }
@@ -697,23 +719,23 @@ class tt {
697
719
  * @param getCurrentFrame A function that returns the current frame of the animation.
698
720
  * @param getAnimationIsPlaying A function that returns whether the animation is currently playing.
699
721
  */
700
- async applyModel(e, t, i, r, n, o, a) {
722
+ async applyModel(e, t, i, n, s, o, a) {
701
723
  var m;
702
- if (i && t && !this.keysThatRemovedBaseModel.includes(e) && (this.keysThatRemovedBaseModel.push(e), console.log(`adding new model key ${e}`)), !i)
724
+ if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
703
725
  return this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.length === 1 && await this.setBaseModelEnabled(!0), (m = this.loadedContainerForKey.get(e)) == null || m.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e), this.keysThatRemovedBaseModel = this.keysThatRemovedBaseModel.filter(
704
726
  (u) => u !== e
705
727
  ), Promise.resolve(void 0);
706
- const l = (await D(i, this.scene, r)).instantiateModelsToScene(
728
+ const l = (await D(i, this.scene, n)).instantiateModelsToScene(
707
729
  this.renameClonedAsset,
708
730
  !0
709
731
  );
710
- if (this.loadedContainerForKey.has(e) && (console.log(`disposing model ${e}`), this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), n) {
711
- const u = o && o(), g = n.name ? this.renameClonedAsset(n.name) : void 0;
732
+ if (this.loadedContainerForKey.has(e) && (this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), s) {
733
+ const u = o && o(), g = s.name ? this.renameClonedAsset(s.name) : void 0;
712
734
  if (ve(
713
735
  l.animationGroups,
714
- n.loop,
715
- n.to,
716
- n.from,
736
+ s.loop,
737
+ s.to,
738
+ s.from,
717
739
  g
718
740
  ), u != null) {
719
741
  const f = a && a() || !0;
@@ -750,36 +772,36 @@ class tt {
750
772
  }), e;
751
773
  }
752
774
  }
753
- function we(s) {
775
+ function we(r) {
754
776
  const e = [];
755
- return s.rootNodes.forEach((t) => {
777
+ return r.rootNodes.forEach((t) => {
756
778
  t.getChildMeshes().forEach((i) => {
757
- i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((r) => {
758
- const n = r.getMaterial(!1);
759
- n && !e.includes(n) && e.push(n);
779
+ i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((n) => {
780
+ const s = n.getMaterial(!1);
781
+ s && !e.includes(s) && e.push(s);
760
782
  });
761
783
  });
762
784
  }), e;
763
785
  }
764
- function pe(s, e = "") {
765
- return s.map((t) => ({
786
+ function pe(r, e = "") {
787
+ return r.map((t) => ({
766
788
  name: t.name.substring(e.length),
767
789
  loop: t.loopAnimation,
768
790
  to: t.to,
769
791
  from: t.from
770
792
  }));
771
793
  }
772
- class it {
794
+ class nt {
773
795
  constructor(e) {
774
796
  this.metadata = /* @__PURE__ */ new Map(), this.materialSelectedObservable = new C(), this.materialDeselectedObservable = new C(), this.materialVariantObservable = new C(), this.modelVariantObservable = new C(), this.materialReadyToLoadCallbacks = /* @__PURE__ */ new Map(), this.modelReadyToLoadCallbacks = /* @__PURE__ */ new Map(), this.dynamicTextures = /* @__PURE__ */ new Map(), this.queuedMaterialChanges = /* @__PURE__ */ new Map(), this.materialChangesInProgress = [], this.queuedModelChanges = /* @__PURE__ */ new Map(), this.modelChangesInProgress = [], this.isExecutingAnimation = !1, this.animations = [], this.initialized = !1, this.materials = [];
775
797
  const {
776
798
  enablePicking: t,
777
799
  modelDetails: i,
778
- previewService: r,
779
- progressHandler: n,
800
+ previewService: n,
801
+ progressHandler: s,
780
802
  scene: o
781
803
  } = e;
782
- this.enablePicking = t, this.contextService = i.contextService, this.id = Ke(), this.previewService = r, this.scene = o, this.variantManager = new tt(
804
+ this.enablePicking = t, this.contextService = i.contextService, this.id = We(), this.previewService = n, this.scene = o, this.variantManager = new it(
783
805
  o,
784
806
  this.renameClonedAsset.bind(this),
785
807
  this.setBaseModelEnabled.bind(this)
@@ -792,13 +814,13 @@ class it {
792
814
  return this.assetContainer = await D(
793
815
  i.model,
794
816
  o,
795
- n
817
+ s
796
818
  ), await this.instantiate(), this;
797
819
  };
798
820
  this.importPromise = a();
799
821
  }
800
822
  //#region Interface implementation
801
- async applyMaterialVariant(e, t, i, r) {
823
+ async applyMaterialVariant(e, t, i, n) {
802
824
  if (!this.initialized) {
803
825
  if (this.materialReadyToLoadCallbacks.has(e)) {
804
826
  const o = this.materialReadyToLoadCallbacks.get(e);
@@ -809,7 +831,7 @@ class it {
809
831
  e,
810
832
  t,
811
833
  i,
812
- r
834
+ n
813
835
  )
814
836
  );
815
837
  } else {
@@ -825,13 +847,13 @@ class it {
825
847
  e,
826
848
  t,
827
849
  i,
828
- r
850
+ n
829
851
  )
830
852
  );
831
853
  }
832
854
  return;
833
855
  }
834
- const n = async () => {
856
+ const s = async () => {
835
857
  await this.variantManager.applyMaterial(
836
858
  e,
837
859
  i,
@@ -842,24 +864,24 @@ class it {
842
864
  taskName: h
843
865
  });
844
866
  },
845
- r
867
+ n
846
868
  );
847
869
  };
848
870
  if (this.materialChangesInProgress.includes(e)) {
849
871
  if (this.queuedMaterialChanges.has(e)) {
850
872
  const o = this.queuedMaterialChanges.get(e);
851
- o == null || o.set(t, n);
873
+ o == null || o.set(t, s);
852
874
  } else {
853
875
  this.queuedMaterialChanges.set(
854
876
  e,
855
877
  /* @__PURE__ */ new Map()
856
878
  );
857
879
  const o = this.queuedMaterialChanges.get(e);
858
- o == null || o.set(t, n);
880
+ o == null || o.set(t, s);
859
881
  }
860
882
  return;
861
883
  }
862
- if (this.materialChangesInProgress.push(e), await n(), this.queuedMaterialChanges.has(e)) {
884
+ if (this.materialChangesInProgress.push(e), await s(), this.queuedMaterialChanges.has(e)) {
863
885
  const o = this.queuedMaterialChanges.get(e);
864
886
  if (!o)
865
887
  throw new Error("Target material is undefined");
@@ -885,7 +907,7 @@ class it {
885
907
  );
886
908
  return;
887
909
  }
888
- const r = () => this.variantManager.applyModel(
910
+ const n = () => this.variantManager.applyModel(
889
911
  e,
890
912
  i,
891
913
  t == null ? void 0 : t.model,
@@ -900,12 +922,12 @@ class it {
900
922
  this.getAnimationIsPlaying.bind(this)
901
923
  );
902
924
  if (this.modelChangesInProgress.includes(e)) {
903
- this.queuedModelChanges.set(e, r);
925
+ this.queuedModelChanges.set(e, n);
904
926
  return;
905
927
  }
906
928
  const o = await (async () => {
907
929
  this.modelChangesInProgress.push(e);
908
- let a = await r();
930
+ let a = await n();
909
931
  if (this.queuedModelChanges.has(e)) {
910
932
  const h = this.queuedModelChanges.get(e);
911
933
  if (!h)
@@ -929,24 +951,24 @@ class it {
929
951
  let t = () => {
930
952
  };
931
953
  const i = async () => {
932
- this.lastPlayedAnimation = e, this.isExecutingAnimation = !0, await new Promise((r) => {
954
+ this.lastPlayedAnimation = e, this.isExecutingAnimation = !0, await new Promise((n) => {
933
955
  var o;
934
- const n = [
956
+ const s = [
935
957
  ...((o = this.modelInstance) == null ? void 0 : o.animationGroups) || [],
936
958
  ...this.variantManager.getAnimationGroups()
937
959
  ];
938
960
  ve(
939
- n,
961
+ s,
940
962
  e.loop,
941
963
  e.to,
942
964
  e.from,
943
965
  e.name ? this.renameClonedAsset(e.name) : void 0,
944
- r
966
+ n
945
967
  );
946
968
  }), this.isExecutingAnimation = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, t();
947
969
  };
948
- return this.isExecutingAnimation ? (this.queuedAnimationFunction = i, new Promise((r) => {
949
- t = r;
970
+ return this.isExecutingAnimation ? (this.queuedAnimationFunction = i, new Promise((n) => {
971
+ t = n;
950
972
  })) : i();
951
973
  }
952
974
  getAnimations(e) {
@@ -956,7 +978,7 @@ class it {
956
978
  this.variantManager.getAnimationGroups(),
957
979
  this.renameClonedAsset("")
958
980
  ) : []
959
- ].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i, r) => r.indexOf(r.find((n) => n.name === t.name)) == i);
981
+ ].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i, n) => n.indexOf(n.find((s) => s.name === t.name)) == i);
960
982
  }
961
983
  getId() {
962
984
  return this.id;
@@ -1002,7 +1024,7 @@ class it {
1002
1024
  set rotation(e) {
1003
1025
  if (!this.transformRoot)
1004
1026
  throw new Error("ModelContainer disposed prior to setting rotation!");
1005
- this.transformRoot.rotationQuaternion = x.FromEulerAngles(
1027
+ this.transformRoot.rotationQuaternion = y.FromEulerAngles(
1006
1028
  e.x,
1007
1029
  e.y,
1008
1030
  e.z
@@ -1024,8 +1046,8 @@ class it {
1024
1046
  e.rootNodes.forEach((t) => {
1025
1047
  t.getChildMeshes(!1).forEach((i) => {
1026
1048
  i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new R(this.scene)), i.actionManager.registerAction(
1027
- new oe(R.OnPointerOverTrigger, (r) => {
1028
- r.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
1049
+ new oe(R.OnPointerOverTrigger, (n) => {
1050
+ n.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
1029
1051
  id: i.material.id,
1030
1052
  name: this.stripIdFromName(i.material.name)
1031
1053
  });
@@ -1064,19 +1086,19 @@ class it {
1064
1086
  this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
1065
1087
  }
1066
1088
  configureModelInstance(e) {
1067
- var n;
1089
+ var s;
1068
1090
  if (!this.transformRoot)
1069
1091
  throw new Error(
1070
1092
  "Transform disposed! This should never happen unless there is a race condition present!"
1071
1093
  );
1072
- const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion, r = this.transformRoot.scaling;
1073
- this.transformRoot.position = p.Zero(), this.transformRoot.rotationQuaternion = x.Identity(), this.transformRoot.scaling = p.One();
1094
+ const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion, n = this.transformRoot.scaling;
1095
+ this.transformRoot.position = p.Zero(), this.transformRoot.rotationQuaternion = y.Identity(), this.transformRoot.scaling = p.One();
1074
1096
  for (const o of e.rootNodes) {
1075
1097
  o.parent = this.transformRoot;
1076
1098
  for (const a of o.getChildMeshes(!1))
1077
1099
  a.alwaysSelectAsActiveMesh = !0;
1078
1100
  }
1079
- this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = r, this.canvasPanels = ((n = this.contextService) == null ? void 0 : n.getAll()) || /* @__PURE__ */ new Map(), He(
1101
+ this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = n, this.canvasPanels = ((s = this.contextService) == null ? void 0 : s.getAll()) || /* @__PURE__ */ new Map(), He(
1080
1102
  this.materials.concat(this.variantManager.getAllMaterials()),
1081
1103
  this.scene,
1082
1104
  this.canvasPanels,
@@ -1089,7 +1111,7 @@ class it {
1089
1111
  */
1090
1112
  destroyInstance() {
1091
1113
  var e;
1092
- console.log("destroying model instance"), (e = this.modelInstance) == null || e.dispose(), this.modelInstance = void 0;
1114
+ (e = this.modelInstance) == null || e.dispose(), this.modelInstance = void 0;
1093
1115
  }
1094
1116
  getAllMeshes() {
1095
1117
  var e;
@@ -1105,7 +1127,7 @@ class it {
1105
1127
  this.modelInstance = this.assetContainer.instantiateModelsToScene(
1106
1128
  this.renameClonedAsset.bind(this),
1107
1129
  !0
1108
- ), console.log("instantiated model instance"), this.materials = we(this.modelInstance), this.configureModelInstance(this.modelInstance), this.animations = pe(
1130
+ ), this.materials = we(this.modelInstance), this.configureModelInstance(this.modelInstance), this.animations = pe(
1109
1131
  this.modelInstance.animationGroups,
1110
1132
  this.renameClonedAsset("")
1111
1133
  ), this.initialized = !0, await this.processQueuedEvents();
@@ -1120,8 +1142,8 @@ class it {
1120
1142
  var e;
1121
1143
  (e = this.canvasPanels) == null || e.forEach(
1122
1144
  (t, i) => {
1123
- const r = this.dynamicTextures.get(i);
1124
- r && t.getStaticContextDirty() && r.isReady() && (r.update(!1), t.setStaticContextDirty(!1));
1145
+ const n = this.dynamicTextures.get(i);
1146
+ n && t.getStaticContextDirty() && n.isReady() && (n.update(!1), t.setStaticContextDirty(!1));
1125
1147
  }
1126
1148
  );
1127
1149
  }
@@ -1180,13 +1202,13 @@ class it {
1180
1202
  //#endregion
1181
1203
  }
1182
1204
  class k extends fe {
1183
- constructor(e, t, i, r, n, o, a, h) {
1205
+ constructor(e, t, i, n, s, o, a, h) {
1184
1206
  super(
1185
1207
  e,
1186
1208
  t,
1187
1209
  i,
1188
- r,
1189
1210
  n,
1211
+ s,
1190
1212
  o,
1191
1213
  h
1192
1214
  ), this.lastFocus = new p(0, 0, 0), this._isRunningFramingBehavior = !1, this.panDenominator = 1, this.panEnabled = !0, this.minZ = 0.01, this.updateRadiusBounds(this.radius), this.enableFramingBehavior(), this.wheelDeltaPercentage = 0.01, this.pinchDeltaPercentage = 5e-3, this.useNaturalPinchZoom = !0, a.camera.autoOrientation && (this.alpha += Math.PI), a && (a.camera.limits.min.beta && (this.lowerBetaLimit = a.camera.limits.min.beta), a.camera.limits.max.beta && (this.upperBetaLimit = a.camera.limits.max.beta), a.camera.limits.min.alpha && (this.lowerAlphaLimit = a.camera.limits.min.alpha), a.camera.limits.max.alpha && (this.upperAlphaLimit = a.camera.limits.max.alpha), a.camera.limits.min.radius && (this.lowerRadiusLimit = a.camera.limits.min.radius), a.camera.limits.max.radius && (this.upperRadiusLimit = a.camera.limits.max.radius), a.camera.autoRotation.enabled && this.enableAutoRotationBehavior(
@@ -1242,14 +1264,14 @@ class k extends fe {
1242
1264
  this._isRunningFramingBehavior = !0, this.framingBehaviourCallback = e;
1243
1265
  const i = this.getFramingBehavior();
1244
1266
  i.framingTime = t || 800;
1245
- const r = () => {
1267
+ const n = () => {
1246
1268
  this.isRunningFramingBehavior = !1;
1247
- }, n = T(this._scene), o = n.max.subtract(n.min), a = n.min.add(o.scale(0.5));
1269
+ }, s = T(this._scene), o = s.max.subtract(s.min), a = s.min.add(o.scale(0.5));
1248
1270
  this.updateRadiusBounds(o.length() * 1.5), this.wheelPrecision = 100 / this.radius, this.panningInertia = 0, this.panningOriginTarget.copyFrom(a), this.panDenominator = o.length(), this.lastFocus.copyFrom(a), i.zoomOnBoundingInfo(
1249
- n.min,
1250
- n.max,
1271
+ s.min,
1272
+ s.max,
1251
1273
  void 0,
1252
- r
1274
+ n
1253
1275
  ), i.framingTime = 0;
1254
1276
  }
1255
1277
  /**
@@ -1281,32 +1303,32 @@ class k extends fe {
1281
1303
  */
1282
1304
  static create(e, t, i) {
1283
1305
  var h;
1284
- const r = T(e), n = r.max.subtract(r.min), o = r.min.add(n.scale(0.5)), a = new k(
1306
+ const n = T(e), s = n.max.subtract(n.min), o = n.min.add(s.scale(0.5)), a = new k(
1285
1307
  "ProductCamera",
1286
1308
  -(Math.PI / 2),
1287
1309
  Math.PI / 2,
1288
- n.length() * 1.5,
1310
+ s.length() * 1.5,
1289
1311
  o,
1290
1312
  e,
1291
1313
  t
1292
1314
  );
1293
1315
  return a.setPanEnabled(
1294
1316
  ((h = t.options) == null ? void 0 : h.noPan) !== void 0 ? !t.options.noPan : !0
1295
- ), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator = n.length(), a.onAfterCheckInputsObservable.addOnce(() => {
1317
+ ), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator = s.length(), a.onAfterCheckInputsObservable.addOnce(() => {
1296
1318
  a.setPanEnabled(a.panEnabled);
1297
1319
  }), i && (e.activeCamera = a), a;
1298
1320
  }
1299
1321
  }
1300
- function T(s) {
1301
- if (s.meshes.length === 0)
1322
+ function T(r) {
1323
+ if (r.meshes.length === 0)
1302
1324
  return {
1303
1325
  min: new p(-1, -1, -1),
1304
1326
  max: new p(1, 1, 1)
1305
1327
  };
1306
- const e = s.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1307
- return s.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1328
+ const e = r.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1329
+ return r.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1308
1330
  }
1309
- class nt {
1331
+ class st {
1310
1332
  constructor(e, t = !1, i = void 0) {
1311
1333
  this.renderingPipeline = new qe(
1312
1334
  "default",
@@ -1324,9 +1346,9 @@ class nt {
1324
1346
  return this.currentConfiguration;
1325
1347
  }
1326
1348
  setConfiguration(e) {
1327
- var t, i, r, n, o, a, h, l, c, m, u, g, f, z, N, q, V, _, G, H, U, K, W, Y, Q, $, Z, j, X, J, ee, te, ie;
1349
+ var t, i, n, s, o, a, h, l, c, m, u, g, f, z, N, q, V, _, G, H, U, K, W, Y, $, Q, Z, j, X, J, ee, te, ie;
1328
1350
  if (this.renderingPipeline.isSupported) {
1329
- if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? d.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? d.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? d.bloom.enabled, this.renderingPipeline.bloomKernel = ((n = e.bloom) == null ? void 0 : n.kernel) ?? d.bloom.kernel, this.renderingPipeline.bloomScale = ((o = e.bloom) == null ? void 0 : o.scale) ?? d.bloom.scale, this.renderingPipeline.bloomThreshold = ((a = e.bloom) == null ? void 0 : a.threshold) ?? d.bloom.threshold, this.renderingPipeline.bloomWeight = ((h = e.bloom) == null ? void 0 : h.weight) ?? d.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((l = e.chromaticAberration) == null ? void 0 : l.enabled) ?? d.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((c = e.chromaticAberration) == null ? void 0 : c.aberrationAmount) ?? d.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((m = e.chromaticAberration) == null ? void 0 : m.radialIntensity) ?? d.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (u = e.chromaticAberration) != null && u.direction ? new se(
1351
+ if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? d.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? d.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((n = e.bloom) == null ? void 0 : n.enabled) ?? d.bloom.enabled, this.renderingPipeline.bloomKernel = ((s = e.bloom) == null ? void 0 : s.kernel) ?? d.bloom.kernel, this.renderingPipeline.bloomScale = ((o = e.bloom) == null ? void 0 : o.scale) ?? d.bloom.scale, this.renderingPipeline.bloomThreshold = ((a = e.bloom) == null ? void 0 : a.threshold) ?? d.bloom.threshold, this.renderingPipeline.bloomWeight = ((h = e.bloom) == null ? void 0 : h.weight) ?? d.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((l = e.chromaticAberration) == null ? void 0 : l.enabled) ?? d.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((c = e.chromaticAberration) == null ? void 0 : c.aberrationAmount) ?? d.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((m = e.chromaticAberration) == null ? void 0 : m.radialIntensity) ?? d.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (u = e.chromaticAberration) != null && u.direction ? new se(
1330
1352
  e.chromaticAberration.direction.x,
1331
1353
  e.chromaticAberration.direction.y
1332
1354
  ) : new se(
@@ -1347,19 +1369,19 @@ class nt {
1347
1369
  if (this.renderingPipeline.depthOfField.focalLength = ((z = e.depthOfField) == null ? void 0 : z.focalLength) ?? d.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((N = e.depthOfField) == null ? void 0 : N.fStop) ?? d.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((q = e.depthOfField) == null ? void 0 : q.focusDistance) ?? d.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((V = e.depthOfField) == null ? void 0 : V.lensSize) ?? d.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((_ = e.grain) == null ? void 0 : _.enabled) ?? d.grain.enabled, this.renderingPipeline.grain.animated = ((G = e.grain) == null ? void 0 : G.animated) ?? d.grain.animated, this.renderingPipeline.grain.intensity = ((H = e.grain) == null ? void 0 : H.intensity) ?? d.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((U = e.misc) == null ? void 0 : U.contrast) ?? d.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((K = e.misc) == null ? void 0 : K.exposure) ?? d.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((W = e.misc) == null ? void 0 : W.toneMappingEnabled) ?? d.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1348
1370
  switch (e.misc.toneMappingType ?? d.misc.toneMappingType) {
1349
1371
  case "Standard":
1350
- this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_STANDARD;
1372
+ this.renderingPipeline.imageProcessing.toneMappingType = x.TONEMAPPING_STANDARD;
1351
1373
  break;
1352
1374
  case "ACES":
1353
- this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_ACES;
1375
+ this.renderingPipeline.imageProcessing.toneMappingType = x.TONEMAPPING_ACES;
1354
1376
  break;
1355
1377
  }
1356
- if (this.renderingPipeline.sharpenEnabled = ((Y = e.sharpen) == null ? void 0 : Y.enabled) ?? d.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Q = e.sharpen) == null ? void 0 : Q.colorAmount) ?? d.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = (($ = e.sharpen) == null ? void 0 : $.edgeAmount) ?? d.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((Z = e.vignette) == null ? void 0 : Z.enabled) ?? d.vignette.enabled, (j = e.vignette) != null && j.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = d.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = d.vignette.center.y), e.vignette)
1378
+ if (this.renderingPipeline.sharpenEnabled = ((Y = e.sharpen) == null ? void 0 : Y.enabled) ?? d.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = (($ = e.sharpen) == null ? void 0 : $.colorAmount) ?? d.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((Q = e.sharpen) == null ? void 0 : Q.edgeAmount) ?? d.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((Z = e.vignette) == null ? void 0 : Z.enabled) ?? d.vignette.enabled, (j = e.vignette) != null && j.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = d.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = d.vignette.center.y), e.vignette)
1357
1379
  switch (((X = e.vignette) == null ? void 0 : X.blendMode) ?? d.vignette.blendMode) {
1358
1380
  case "Multiply":
1359
- this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_MULTIPLY;
1381
+ this.renderingPipeline.imageProcessing.vignetteBlendMode = x.VIGNETTEMODE_MULTIPLY;
1360
1382
  break;
1361
1383
  case "Opaque":
1362
- this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_OPAQUE;
1384
+ this.renderingPipeline.imageProcessing.vignetteBlendMode = x.VIGNETTEMODE_OPAQUE;
1363
1385
  break;
1364
1386
  }
1365
1387
  (J = e.vignette) != null && J.colorRgba ? this.renderingPipeline.imageProcessing.vignetteColor = new b(
@@ -1380,22 +1402,22 @@ class nt {
1380
1402
  return t.globalDensity = e.globalDensity ?? t.globalDensity, t.globalExposure = e.globalExposure ?? t.globalExposure, t.globalHue = e.globalHue ?? t.globalHue, t.globalSaturation = e.globalSaturation ?? t.globalSaturation, t.highlightsDensity = e.highlightsDensity ?? t.highlightsDensity, t.highlightsExposure = e.highlightsExposure ?? t.highlightsExposure, t.highlightsHue = e.highlightsHue ?? t.highlightsHue, t.highlightsSaturation = e.highlightsSaturation ?? t.highlightsSaturation, t.midtonesDensity = e.midtonesDensity ?? t.midtonesDensity, t.midtonesExposure = e.midtonesExposure ?? t.midtonesExposure, t.midtonesHue = e.midtonesHue ?? t.midtonesHue, t.midtonesSaturation = e.midtonesSaturation ?? t.midtonesSaturation, t.shadowsDensity = e.shadowsDensity ?? t.shadowsDensity, t.shadowsExposure = e.shadowsExposure ?? t.shadowsExposure, t.shadowsHue = e.shadowsHue ?? t.shadowsHue, t.shadowsSaturation = e.shadowsSaturation ?? t.shadowsSaturation, t;
1381
1403
  }
1382
1404
  }
1383
- Pe.GLTFLoader.RegisterExtension("glbPostProcessor", function(s) {
1384
- return new _e(s);
1405
+ Pe.GLTFLoader.RegisterExtension("glbPostProcessor", function(r) {
1406
+ return new _e(r);
1385
1407
  });
1386
- S.OnPluginActivatedObservable.add((s) => {
1387
- if (s.name === "gltf") {
1388
- const e = s;
1408
+ S.OnPluginActivatedObservable.add((r) => {
1409
+ if (r.name === "gltf") {
1410
+ const e = r;
1389
1411
  e.transparencyAsCoverage = !0;
1390
1412
  }
1391
1413
  });
1392
- function O(s) {
1393
- return new p(s.x, s.y, s.z);
1414
+ function O(r) {
1415
+ return new p(r.x, r.y, r.z);
1394
1416
  }
1395
- function L(s) {
1396
- return { x: s.x, y: s.y, z: s.z };
1417
+ function L(r) {
1418
+ return { x: r.x, y: r.y, z: r.z };
1397
1419
  }
1398
- class Wt {
1420
+ class Yt {
1399
1421
  constructor(e) {
1400
1422
  var h;
1401
1423
  this.focusLostNotified = !1, this.focusLostObservable = new C(), this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.initComplete = !1, this.isAnimatingCamera = !1, this.renderLoop = () => {
@@ -1422,15 +1444,15 @@ class Wt {
1422
1444
  const i = (() => {
1423
1445
  if (!(e != null && e.noRender))
1424
1446
  return this.configuration.createCanvas();
1425
- })(), r = "1.5.6";
1447
+ })(), n = "1.5.6";
1426
1448
  Ae.Configuration = {
1427
1449
  decoder: {
1428
- wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_wasm_wrapper_gltf.js`,
1429
- wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_decoder_gltf.wasm`,
1430
- fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_decoder_gltf.js`
1450
+ wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${n}/draco_wasm_wrapper_gltf.js`,
1451
+ wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${n}/draco_decoder_gltf.wasm`,
1452
+ fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${n}/draco_decoder_gltf.js`
1431
1453
  }
1432
1454
  }, i && (i.getContext("webgl2") || i.getContext("webgl"));
1433
- const n = console.log;
1455
+ const s = console.log;
1434
1456
  console.log = () => {
1435
1457
  };
1436
1458
  const o = i ? new be(i, !0, {
@@ -1442,7 +1464,7 @@ class Wt {
1442
1464
  stencil: this.configuration.highlights.enabled,
1443
1465
  forceSRGBBufferSupportState: !0
1444
1466
  }) : new Ce();
1445
- console.log = n, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new Me(o), this.camera = k.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new nt(
1467
+ console.log = s, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new xe(o), this.camera = k.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new st(
1446
1468
  this.scene,
1447
1469
  !1,
1448
1470
  this.camera
@@ -1451,7 +1473,7 @@ class Wt {
1451
1473
  this.configuration.scene.environment.file,
1452
1474
  this.scene
1453
1475
  );
1454
- a.name = "initial-environment-cube", a.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = a, this.scene.environmentIntensity = this.configuration.scene.environment.intensity, (h = this.configuration.options) != null && h.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
1476
+ a.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = a, this.scene.environmentIntensity = this.configuration.scene.environment.intensity, (h = this.configuration.options) != null && h.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
1455
1477
  this.configuration.options.renderingPipelineConfiguration
1456
1478
  ) : (this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast), this.glowLayerManager = new Ge(
1457
1479
  this.scene,
@@ -1503,19 +1525,19 @@ class Wt {
1503
1525
  this.plugins.forEach((e) => e.dispose(!0)), this.renderingPipeline.dispose(), this.engine && this.engine.dispose(), window.removeEventListener("resize", this.fireResizeEvent);
1504
1526
  }
1505
1527
  executeCameraAnimation(e) {
1506
- if (!this.camera || this.scene.activeCamera !== this.camera || this.getAllModels().length === 0 || !this.getAllModels().some((r) => r.getIsInitialized()))
1528
+ if (!this.camera || this.scene.activeCamera !== this.camera || this.getAllModels().length === 0 || !this.getAllModels().some((n) => n.getIsInitialized()))
1507
1529
  return this.queuedCameraAnimation = e, Promise.resolve();
1508
1530
  let t = () => {
1509
1531
  };
1510
1532
  const i = async () => {
1511
- this.isAnimatingCamera = !0, await We(
1533
+ this.isAnimatingCamera = !0, await Ye(
1512
1534
  this.scene,
1513
1535
  this.scene.activeCamera,
1514
1536
  e
1515
1537
  ), this.isAnimatingCamera = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, t();
1516
1538
  };
1517
- return this.isAnimatingCamera ? (this.queuedAnimationFunction = i, new Promise((r) => {
1518
- t = r;
1539
+ return this.isAnimatingCamera ? (this.queuedAnimationFunction = i, new Promise((n) => {
1540
+ t = n;
1519
1541
  })) : i();
1520
1542
  }
1521
1543
  getCameraPose() {
@@ -1552,13 +1574,13 @@ class Wt {
1552
1574
  const t = async () => {
1553
1575
  this.isAnimatingCamera = !0, await new Promise((i) => {
1554
1576
  this.focusLostNotified = !1;
1555
- const r = () => {
1556
- const n = this.configuration;
1577
+ const n = () => {
1578
+ const s = this.configuration;
1557
1579
  this.camera.rerunFramingBehavior(() => {
1558
- n.camera.limits.min.radius && (this.camera.lowerRadiusLimit = n.camera.limits.min.radius), n.camera.limits.max.radius && (this.camera.upperRadiusLimit = n.camera.limits.max.radius), i();
1580
+ s.camera.limits.min.radius && (this.camera.lowerRadiusLimit = s.camera.limits.min.radius), s.camera.limits.max.radius && (this.camera.upperRadiusLimit = s.camera.limits.max.radius), i();
1559
1581
  });
1560
1582
  };
1561
- this.scene.onAfterRenderObservable.addOnce(r);
1583
+ this.scene.onAfterRenderObservable.addOnce(n);
1562
1584
  }), this.isAnimatingCamera = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, e();
1563
1585
  };
1564
1586
  return this.isAnimatingCamera ? (this.queuedAnimationFunction = t, new Promise((i) => {
@@ -1589,9 +1611,9 @@ class Wt {
1589
1611
  this.scene
1590
1612
  );
1591
1613
  try {
1592
- const r = t.latDeg * Math.PI / 180, n = t.lonDeg * Math.PI / 180;
1593
- i.target = t.target ? new p(t.target.x, t.target.y, t.target.z) : p.Zero(), i.alpha = n, i.beta = r, i.radius = t.radius || this.camera.radius, i.minZ = 0.01, this.scene.render();
1594
- const o = await ye.CreateScreenshotUsingRenderTargetAsync(
1614
+ const n = t.latDeg * Math.PI / 180, s = t.lonDeg * Math.PI / 180;
1615
+ i.target = t.target ? new p(t.target.x, t.target.y, t.target.z) : p.Zero(), i.alpha = s, i.beta = n, i.radius = t.radius || this.camera.radius, i.minZ = 0.01, this.scene.render();
1616
+ const o = await Me.CreateScreenshotUsingRenderTargetAsync(
1595
1617
  this.engine,
1596
1618
  i,
1597
1619
  e,
@@ -1608,26 +1630,26 @@ class Wt {
1608
1630
  const e = this.configuration;
1609
1631
  if (!e)
1610
1632
  return !0;
1611
- const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, r = e.camera.limits.min.beta, n = e.camera.limits.max.beta;
1612
- if (t === void 0 || i === void 0 || r === void 0 || n === void 0)
1633
+ const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, n = e.camera.limits.min.beta, s = e.camera.limits.max.beta;
1634
+ if (t === void 0 || i === void 0 || n === void 0 || s === void 0)
1613
1635
  return !0;
1614
- const o = [t, i], a = [r, n], h = o.every((c) => c === t), l = a.every((c) => c === r);
1636
+ const o = [t, i], a = [n, s], h = o.every((c) => c === t), l = a.every((c) => c === n);
1615
1637
  return !h && !l;
1616
1638
  }
1617
1639
  fireResizeEvent() {
1618
1640
  this.getNumViewports() > 0 && this.engine.resize();
1619
1641
  }
1620
1642
  setHighlights(e, t) {
1621
- var r;
1622
- e.length === 0 && ((r = this.highlightLayer) == null || r.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new xe("highlights", this.scene, {
1643
+ var n;
1644
+ e.length === 0 && ((n = this.highlightLayer) == null || n.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new ye("highlights", this.scene, {
1623
1645
  isStroke: !0,
1624
1646
  blurVerticalSize: 0.85,
1625
1647
  blurHorizontalSize: 0.85
1626
1648
  }), this.highlightLayer.innerGlow = !0, this.highlightLayer.outerGlow = !1), this.highlightLayer.removeAllMeshes();
1627
1649
  const i = t ? new w(t[0], t[1], t[2]).toLinearSpace() : void 0;
1628
- e.forEach((n) => {
1650
+ e.forEach((s) => {
1629
1651
  const o = this.scene.materials.find(
1630
- (a) => a.name === n.name && a.id === n.id
1652
+ (a) => a.name === s.name && a.id === s.id
1631
1653
  );
1632
1654
  o && o.getBindedMeshes().forEach(
1633
1655
  (a) => {
@@ -1644,14 +1666,14 @@ class Wt {
1644
1666
  this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
1645
1667
  }
1646
1668
  loadModel(e, t) {
1647
- const { refocusCamera: i = !0, progressHandler: r } = t ?? {}, n = new it({
1669
+ const { refocusCamera: i = !0, progressHandler: n } = t ?? {}, s = new nt({
1648
1670
  enablePicking: this.configuration.highlights.enabled,
1649
1671
  modelDetails: e,
1650
1672
  scene: this.scene,
1651
1673
  previewService: this,
1652
- progressHandler: r
1674
+ progressHandler: n
1653
1675
  });
1654
- return n.getInitializationPromise().then(() => {
1676
+ return s.getInitializationPromise().then(() => {
1655
1677
  if (this.modelContainers.size <= 1 && i) {
1656
1678
  const o = this.queuedCameraAnimation;
1657
1679
  this.forceStopCameraAnimations(), this.camera.rerunFramingBehavior(() => {
@@ -1660,14 +1682,14 @@ class Wt {
1660
1682
  });
1661
1683
  }, 1);
1662
1684
  }
1663
- }), this.configuration.highlights.enabled && (n.registerMaterialSelectedCallback((o) => {
1685
+ }), this.configuration.highlights.enabled && (s.registerMaterialSelectedCallback((o) => {
1664
1686
  this.setHighlights([o]);
1665
- }), n.registerMaterialDeselectedCallback(() => {
1687
+ }), s.registerMaterialDeselectedCallback(() => {
1666
1688
  this.setHighlights([]);
1667
- })), this.modelContainers.set(n.getId(), n), this.triggerModelLoadEvent({
1689
+ })), this.modelContainers.set(s.getId(), s), this.triggerModelLoadEvent({
1668
1690
  eventType: "load",
1669
- modelContainer: n
1670
- }), n;
1691
+ modelContainer: s
1692
+ }), s;
1671
1693
  }
1672
1694
  async preloadModel(e) {
1673
1695
  await D(e, this.scene);
@@ -1687,7 +1709,7 @@ class Wt {
1687
1709
  }
1688
1710
  unregisterPlugin(e) {
1689
1711
  const t = this.plugins.indexOf(e);
1690
- t > -1 && this.plugins.splice(t, 1).forEach((r) => r.dispose(!1));
1712
+ t > -1 && this.plugins.splice(t, 1).forEach((n) => n.dispose(!1));
1691
1713
  }
1692
1714
  getGlowLayerManager() {
1693
1715
  return this.glowLayerManager;
@@ -1705,31 +1727,31 @@ class Wt {
1705
1727
  * Flips a transform around the origin.
1706
1728
  */
1707
1729
  flipTransform(e, t, i) {
1708
- const r = re.Compose(
1730
+ const n = re.Compose(
1709
1731
  O(i || { x: 1, y: 1, z: 1 }),
1710
- x.FromEulerVector(
1732
+ y.FromEulerVector(
1711
1733
  O(t || { x: 0, y: 0, z: 0 })
1712
1734
  ),
1713
1735
  O(e || { x: 0, y: 0, z: 0 })
1714
- ), n = re.RotationAxis(p.Up(), Math.PI), o = r.multiply(n), a = p.Zero(), h = x.Identity(), l = p.Zero();
1715
- return o.decompose(l, h, a), h.multiplyInPlace(x.FromEulerAngles(0, Math.PI, 0)), {
1736
+ ), s = re.RotationAxis(p.Up(), Math.PI), o = n.multiply(s), a = p.Zero(), h = y.Identity(), l = p.Zero();
1737
+ return o.decompose(l, h, a), h.multiplyInPlace(y.FromEulerAngles(0, Math.PI, 0)), {
1716
1738
  position: L(a),
1717
1739
  rotation: L(h.toEulerAngles()),
1718
1740
  scale: L(l)
1719
1741
  };
1720
1742
  }
1721
1743
  updatePreviewOptions(e) {
1722
- var r, n;
1744
+ var n, s;
1723
1745
  const t = new ce(e);
1724
1746
  this.configuration.highlights.enabled !== t.highlights.enabled && this.engine.setStencilBuffer(t.highlights.enabled), this.scene.clearColor = t.scene.clearColor;
1725
1747
  let i = this.scene.environmentTexture;
1726
1748
  this.configuration.scene.environment.file !== t.scene.environment.file && (i = ne.CreateFromPrefilteredData(
1727
1749
  t.scene.environment.file,
1728
1750
  this.scene
1729
- ), i.name = "updated-environment-cube", i.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = i), i.rotationY = t.scene.environment.rotationY, this.scene.environmentIntensity = t.scene.environment.intensity, (r = t.options) != null && r.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
1751
+ ), i.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = i), i.rotationY = t.scene.environment.rotationY, this.scene.environmentIntensity = t.scene.environment.intensity, (n = t.options) != null && n.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
1730
1752
  t.options.renderingPipelineConfiguration
1731
1753
  ) : (this.scene.imageProcessingConfiguration.exposure = t.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = t.lighting.contrast), this.glowLayerManager.setIntensity(t.emissiveGlowIntensity), this.camera.updateConfiguration(t), this.camera.setPanEnabled(
1732
- ((n = t.options) == null ? void 0 : n.noPan) !== void 0 ? !t.options.noPan : !0
1754
+ ((s = t.options) == null ? void 0 : s.noPan) !== void 0 ? !t.options.noPan : !0
1733
1755
  ), this.configuration = t;
1734
1756
  }
1735
1757
  /**
@@ -1750,7 +1772,7 @@ export {
1750
1772
  F as MaterialEffectMode,
1751
1773
  I as ProductCameraRig,
1752
1774
  Ve as REFLECTION_PROBE_RESOLUTION,
1753
- y as RenderingConfiguration,
1754
- Wt as SpiffCommerce3DPreviewService,
1775
+ M as RenderingConfiguration,
1776
+ Yt as SpiffCommerce3DPreviewService,
1755
1777
  d as renderingPipelineDefaults
1756
1778
  };