@spiffcommerce/preview 5.11.6-1 → 5.11.6

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
@@ -4,9 +4,9 @@ import { NullEngine as Ce } from "@babylonjs/core/Engines/nullEngine";
4
4
  import { SceneLoader as k } from "@babylonjs/core/Loading/sceneLoader";
5
5
  import { CubeTexture as se } from "@babylonjs/core/Materials/Textures/cubeTexture";
6
6
  import { Color4 as v, Color3 as C } from "@babylonjs/core/Maths/math.color";
7
- import { Vector3 as g, Quaternion as y, Vector2 as re, Matrix as ae } from "@babylonjs/core/Maths/math.vector";
7
+ import { Vector3 as g, Quaternion as x, Vector2 as re, Matrix as ae } from "@babylonjs/core/Maths/math.vector";
8
8
  import { DracoCompression as Ae } from "@babylonjs/core/Meshes/Compression/dracoCompression";
9
- import { Observable as x } from "@babylonjs/core/Misc/observable";
9
+ import { Observable as M } from "@babylonjs/core/Misc/observable";
10
10
  import { Tools as Me } from "@babylonjs/core/Misc/tools";
11
11
  import { Scene as xe } from "@babylonjs/core/scene";
12
12
  import { GLTF2 as ye } from "@babylonjs/loaders/glTF";
@@ -40,33 +40,33 @@ 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 D = /* @__PURE__ */ ((s) => (s[s.Orbit = 0] = "Orbit", s[s.Pan = 1] = "Pan", s))(D || {}), q = /* @__PURE__ */ ((s) => (s.None = "None", s.RemoveWhenSelected = "RemoveWhenSelected", s.ApplyWhenSelected = "ApplyWhenSelected", s))(q || {});
43
+ var D = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(D || {}), q = /* @__PURE__ */ ((n) => (n.None = "None", n.RemoveWhenSelected = "RemoveWhenSelected", n.ApplyWhenSelected = "ApplyWhenSelected", n))(q || {});
44
44
  function ze() {
45
- const s = navigator.vendor.toLowerCase().includes("apple"), e = navigator.maxTouchPoints > 0, t = !navigator.userAgent.toLowerCase().includes("crios");
46
- return s && e && t;
45
+ const n = navigator.vendor.toLowerCase().includes("apple"), e = navigator.maxTouchPoints > 0, t = !navigator.userAgent.toLowerCase().includes("crios");
46
+ return n && e && t;
47
47
  }
48
48
  const ce = /* @__PURE__ */ new Map();
49
- async function z(s, e, t) {
50
- const i = await ce.get(s);
49
+ async function z(n, e, t) {
50
+ const i = await ce.get(n);
51
51
  if (i && i.scene.uid === e.uid)
52
52
  return i;
53
53
  const r = k.LoadAssetContainerAsync(
54
- s,
54
+ n,
55
55
  void 0,
56
56
  e,
57
57
  t
58
58
  );
59
- return !ze() && ce.set(s, r), r;
59
+ return !ze() && ce.set(n, r), r;
60
60
  }
61
- k.OnPluginActivatedObservable.add((s) => {
62
- s.name === "gltf" && (s.animationStartMode = Pe.NONE);
61
+ k.OnPluginActivatedObservable.add((n) => {
62
+ n.name === "gltf" && (n.animationStartMode = Pe.NONE);
63
63
  });
64
64
  class de {
65
65
  constructor(e) {
66
66
  this.getSceneClearColor = () => {
67
- var i, r, n, o;
67
+ var i, r, s, o;
68
68
  const t = (i = this.customOptions) != null && i.transparentBackground || (r = this.customOptions) != null && r.backgroundImage ? 0 : 1;
69
- if (this.customOptions && ((n = this.customOptions) != null && n.transparentBackground) || (o = this.customOptions) != null && o.backgroundImage)
69
+ if (this.customOptions && ((s = this.customOptions) != null && s.transparentBackground) || (o = this.customOptions) != null && o.backgroundImage)
70
70
  return new v(0, 0, 0, t).toLinearSpace();
71
71
  if (this.customOptions && this.customOptions.backgroundColor) {
72
72
  const a = C.FromHexString(
@@ -101,14 +101,14 @@ class de {
101
101
  * Configuration related to the scene
102
102
  */
103
103
  get scene() {
104
- var e, t, i, r, n;
104
+ var e, t, i, r, s;
105
105
  return {
106
106
  clearColor: this.getSceneClearColor(),
107
107
  transparentBackground: ((e = this.customOptions) == null ? void 0 : e.transparentBackground) || ((t = this.customOptions) == null ? void 0 : t.backgroundImage),
108
108
  environment: {
109
109
  file: (i = this.customOptions) == null ? void 0 : i.environmentFile,
110
110
  intensity: ((r = this.customOptions) == null ? void 0 : r.environmentIntensity) ?? 1,
111
- rotationY: (((n = this.customOptions) == null ? void 0 : n.environmentRotationY) ?? 0) * (Math.PI / 180)
111
+ rotationY: (((s = this.customOptions) == null ? void 0 : s.environmentRotationY) ?? 0) * (Math.PI / 180)
112
112
  // Convert to radians
113
113
  }
114
114
  };
@@ -117,7 +117,7 @@ class de {
117
117
  * Configuration related to the camera used to view and interact with the scene.
118
118
  */
119
119
  get camera() {
120
- var e, t, i, r, n, o, a, l, c, h, d, m, f;
120
+ var e, t, i, r, s, o, a, l, c, h, d, m, f;
121
121
  return {
122
122
  autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
123
123
  autoRotation: {
@@ -126,7 +126,7 @@ class de {
126
126
  },
127
127
  limits: {
128
128
  min: {
129
- alpha: (r = this.customOptions) != null && r.lowerAlphaLimitDeg ? ((n = this.customOptions) == null ? void 0 : n.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
129
+ alpha: (r = this.customOptions) != null && r.lowerAlphaLimitDeg ? ((s = this.customOptions) == null ? void 0 : s.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
130
130
  beta: (o = this.customOptions) != null && o.lowerBetaLimitDeg ? ((a = this.customOptions) == null ? void 0 : a.lowerBetaLimitDeg) * Math.PI / 180 : void 0,
131
131
  radius: (l = this.customOptions) == null ? void 0 : l.minZoomOverride
132
132
  },
@@ -161,12 +161,12 @@ class de {
161
161
  return ((e = this.customOptions) == null ? void 0 : e.emissiveGlowIntensity) ?? 0.5;
162
162
  }
163
163
  }
164
- class M {
164
+ class P {
165
165
  /**
166
166
  * Returns the resolution expected for generated textures.
167
167
  */
168
168
  static getDynamicTextureResolution(e = !1) {
169
- return e ? { width: 1, height: 1 } : this.getIsMobile() || !M.offscreenRenderingSupported() ? {
169
+ return e ? { width: 1, height: 1 } : this.getIsMobile() || !P.offscreenRenderingSupported() ? {
170
170
  width: 1024,
171
171
  height: 1024
172
172
  } : {
@@ -275,9 +275,9 @@ class Ve {
275
275
  e,
276
276
  t,
277
277
  function(r) {
278
- t.extras && Object.keys(t.extras).forEach((n) => {
279
- const o = t.extras[n];
280
- r.metadata[n] = o;
278
+ t.extras && Object.keys(t.extras).forEach((s) => {
279
+ const o = t.extras[s];
280
+ r.metadata[s] = o;
281
281
  }), i(r);
282
282
  }
283
283
  );
@@ -336,51 +336,51 @@ class Ve {
336
336
  * @param scene The scene to parse.
337
337
  */
338
338
  applyReflections(e) {
339
- function t(n) {
339
+ function t(s) {
340
340
  const o = [];
341
- return n.transformNodes.forEach((a) => {
341
+ return s.transformNodes.forEach((a) => {
342
342
  a.metadata && a.metadata.reflective && o.push(...a.getChildMeshes());
343
- }), n.meshes.forEach((a) => {
343
+ }), s.meshes.forEach((a) => {
344
344
  a.metadata && a.metadata.reflective && !o.includes(a) && o.push(a);
345
345
  }), o;
346
346
  }
347
- function i(n, o = 1) {
348
- const a = n.material;
347
+ function i(s, o = 1) {
348
+ const a = s.material;
349
349
  if (!a)
350
350
  return;
351
351
  const l = new Re(
352
352
  "mirror",
353
- M.getMirrorTextureResolution(),
353
+ P.getMirrorTextureResolution(),
354
354
  e,
355
355
  !0
356
356
  );
357
357
  l.renderList = t(e);
358
- const c = n.getVerticesData("normal");
358
+ const c = s.getVerticesData("normal");
359
359
  if (!c)
360
360
  throw new Error(
361
- "Mirror attribute specified on: " + n.name + "But no normals exist to generate a mirror from!"
361
+ "Mirror attribute specified on: " + s.name + "But no normals exist to generate a mirror from!"
362
362
  );
363
- n.computeWorldMatrix(!0);
364
- const h = n.getWorldMatrix(), d = oe.TransformNormal(
363
+ s.computeWorldMatrix(!0);
364
+ const h = s.getWorldMatrix(), d = oe.TransformNormal(
365
365
  new oe(c[0], c[1], c[2]),
366
366
  h
367
367
  ).normalize(), m = Te.FromPositionAndNormal(
368
- n.position,
368
+ s.position,
369
369
  d.scale(-1)
370
370
  );
371
371
  l.mirrorPlane = m, l.level = o, a.reflectionTexture = l;
372
372
  }
373
- function r(n) {
374
- const o = n.material, a = new Oe(
373
+ function r(s) {
374
+ const o = s.material, a = new Oe(
375
375
  "probe-" + o.name,
376
376
  Ge,
377
377
  e
378
378
  );
379
- a.cubeTexture.name = "reflection-probe-cube-texture", a.attachToMesh(n), a.renderList && a.renderList.push(...t(e)), o.reflectionTexture = a.cubeTexture;
379
+ a.cubeTexture.name = "reflection-probe-cube-texture", a.attachToMesh(s), a.renderList && a.renderList.push(...t(e)), o.reflectionTexture = a.cubeTexture;
380
380
  }
381
- e.meshes.forEach((n) => {
382
- const o = n.metadata;
383
- o && (o.mirrorTexture && i(n, o.mirrorTexture), o.reflectionProbe && r(n));
381
+ e.meshes.forEach((s) => {
382
+ const o = s.metadata;
383
+ o && (o.mirrorTexture && i(s, o.mirrorTexture), o.reflectionProbe && r(s));
384
384
  });
385
385
  }
386
386
  }
@@ -406,12 +406,12 @@ class _e {
406
406
  }
407
407
  }
408
408
  }
409
- function He(s, e, t, i, r = "") {
410
- t.forEach((n) => {
411
- const o = n.getID(), a = n.getName(), l = n.getPanelSize && n.getPanelSize(), c = M.getDynamicTextureResolution(
409
+ function He(n, e, t, i, r = "") {
410
+ t.forEach((s) => {
411
+ const o = s.getID(), a = s.getName(), l = s.getPanelSize && s.getPanelSize(), c = P.getDynamicTextureResolution(
412
412
  (l == null ? void 0 : l.width) === 1 || (l == null ? void 0 : l.height) === 1
413
413
  );
414
- s.filter((d) => d.name === r + a).forEach((d) => {
414
+ n.filter((d) => d.name === r + a).forEach((d) => {
415
415
  const m = i.get(o), f = !1;
416
416
  if (m)
417
417
  ue(d, m), m.update(f);
@@ -422,7 +422,7 @@ function He(s, e, t, i, r = "") {
422
422
  c.width,
423
423
  c.height
424
424
  );
425
- i.set(o, p), n.setStaticContext(
425
+ i.set(o, p), s.setStaticContext(
426
426
  p.getContext()
427
427
  ), ue(d, p), p.onLoadObservable.addOnce(() => {
428
428
  p.update(f);
@@ -431,45 +431,45 @@ function He(s, e, t, i, r = "") {
431
431
  });
432
432
  });
433
433
  }
434
- function Ue(s, e, t, i) {
434
+ function Ue(n, e, t, i) {
435
435
  const r = new Se(
436
- s,
436
+ n,
437
437
  { width: t, height: i },
438
438
  e,
439
- M.shouldMipMap(),
439
+ P.shouldMipMap(),
440
440
  Be.TRILINEAR_SAMPLINGMODE,
441
441
  B.TEXTUREFORMAT_RGBA
442
- ), n = r.getContext();
443
- return n && (n.fillStyle = "#f5f5f5", n.fillRect(0, 0, t, i), r.update()), r;
442
+ ), s = r.getContext();
443
+ return s && (s.fillStyle = "#f5f5f5", s.fillRect(0, 0, t, i), r.update()), r;
444
444
  }
445
- function ue(s, e) {
446
- if (s instanceof N) {
447
- const t = s, i = t.albedoTexture;
445
+ function ue(n, e) {
446
+ if (n instanceof N) {
447
+ const t = n, i = t.albedoTexture;
448
448
  i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
449
449
  } else {
450
- const t = s, i = t.diffuseTexture;
450
+ const t = n, i = t.diffuseTexture;
451
451
  i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
452
452
  }
453
453
  }
454
454
  function Ke() {
455
- const s = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
456
- return s() + s() + "-" + s() + "-" + s() + "-" + s() + "-" + s() + s() + s();
455
+ const n = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
456
+ return n() + n() + "-" + n() + "-" + n() + "-" + n() + "-" + n() + n() + n();
457
457
  }
458
- const P = 60, me = 1;
459
- function ge(s) {
460
- return s.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / s.targetedAnimations.length || 0;
458
+ const y = 60, me = 1;
459
+ function ge(n) {
460
+ return n.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / n.targetedAnimations.length || 0;
461
461
  }
462
- function ve(s, e, t, i, r, n) {
463
- const o = r ? s.filter((h) => h.name === r) : s;
462
+ function ve(n, e, t, i, r, s) {
463
+ const o = r ? n.filter((h) => h.name === r) : n;
464
464
  if (o.length === 0) {
465
465
  console.warn(`No animations found for name: ${r}`);
466
466
  return;
467
467
  }
468
468
  let a = 0;
469
469
  const l = () => {
470
- a++, a === o.length && n && n();
470
+ a++, a === o.length && s && s();
471
471
  }, c = (h, d, m, f, p) => {
472
- h.stop(), h.start(d, m, f, p), n && (d == !1 || d === void 0 && !h.loopAnimation ? h.onAnimationGroupEndObservable.addOnce(() => {
472
+ h.stop(), h.start(d, m, f, p), s && (d == !1 || d === void 0 && !h.loopAnimation ? h.onAnimationGroupEndObservable.addOnce(() => {
473
473
  l();
474
474
  }) : h.onAnimationLoopObservable.addOnce(() => {
475
475
  l();
@@ -487,19 +487,19 @@ function ve(s, e, t, i, r, n) {
487
487
  c(h, e, me, m, f);
488
488
  });
489
489
  }
490
- function We(s) {
491
- s.forEach((e) => {
490
+ function We(n) {
491
+ n.forEach((e) => {
492
492
  e.reset(), e.stop();
493
493
  });
494
494
  }
495
- function $e(s) {
496
- const e = s.animationGroups;
495
+ function Qe(n) {
496
+ const e = n.animationGroups;
497
497
  We(e);
498
498
  }
499
- function Qe(s, e, t) {
499
+ function Ye(n, e, t) {
500
500
  return new Promise((i) => {
501
- s.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ye(e.alpha, 0, 2 * Math.PI));
502
- const r = [], n = t.target;
501
+ n.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ze(e.alpha, 0, 2 * Math.PI));
502
+ const r = [], s = t.target;
503
503
  if (t.target && Object.keys(t.target).length > 0 && r.push(
504
504
  T(
505
505
  "cameraTargetLerp",
@@ -542,10 +542,10 @@ function Qe(s, e, t) {
542
542
  }
543
543
  e.animations.push(...r);
544
544
  const a = e.useAutoRotationBehavior;
545
- e.disableAutoRotationBehavior(), s.beginAnimation(
545
+ e.disableAutoRotationBehavior(), n.beginAnimation(
546
546
  e,
547
547
  0,
548
- n ? P * 2 : P,
548
+ s ? y * 2 : y,
549
549
  !1,
550
550
  1,
551
551
  () => {
@@ -554,36 +554,33 @@ function Qe(s, e, t) {
554
554
  );
555
555
  });
556
556
  }
557
- function pe(s) {
558
- return s * Math.PI / 180;
557
+ function pe(n) {
558
+ return n * Math.PI / 180;
559
559
  }
560
- function T(s, e, t, i, r, n = 0, o = A.ANIMATIONLOOPMODE_CONSTANT) {
560
+ function T(n, e, t, i, r, s = 0, o = A.ANIMATIONLOOPMODE_CONSTANT) {
561
561
  const a = new De();
562
562
  a.setEasingMode(qe.EASINGMODE_EASEINOUT);
563
563
  const l = new A(
564
- s,
564
+ n,
565
565
  e,
566
- P,
566
+ y,
567
567
  r,
568
568
  o
569
569
  ), c = [];
570
- return n > 0 && c.push({ frame: 0, value: t }), c.push({ frame: P * n, value: t }), c.push({
571
- frame: P * (n + 1),
570
+ return s > 0 && c.push({ frame: 0, value: t }), c.push({ frame: y * s, value: t }), c.push({
571
+ frame: y * (s + 1),
572
572
  value: i
573
573
  }), l.setKeys(c), l.setEasingFunction(a), l;
574
574
  }
575
- function Ye(s, e, t) {
576
- return s < e ? s = t - (e - s) % (t - e) : s = e + (s - e) % (t - e);
575
+ function Ze(n, e, t) {
576
+ return n < e ? n = t - (e - n) % (t - e) : n = e + (n - e) % (t - e);
577
577
  }
578
- function Ze(s, e, t) {
579
- s.forEach((i) => {
578
+ function $e(n, e, t) {
579
+ n.forEach((i) => {
580
580
  t && i.name !== t || i.goToFrame(e);
581
581
  });
582
582
  }
583
- const je = (s, e = 512, t, i) => {
584
- const r = s.includes("?") ? "&" : "?", n = [`w=${e}`, `h=${e}`];
585
- return i !== void 0 && n.push(`q=${i}`), t && n.push(`format=${t}`), `${s}${r}${n.join("&")}`;
586
- }, Xe = {
583
+ const je = {
587
584
  albedoTexture: "albedoMap",
588
585
  bumpTexture: "normalMap",
589
586
  ambientTexture: "ambientMap",
@@ -593,7 +590,7 @@ const je = (s, e = 512, t, i) => {
593
590
  refractionTexture: "refractionMap",
594
591
  reflectionTexture: "reflectionMap"
595
592
  };
596
- function Je(s, e, t, i) {
593
+ function Xe(n, e, t, i) {
597
594
  [
598
595
  "albedoTexture",
599
596
  "bumpTexture",
@@ -603,64 +600,51 @@ function Je(s, e, t, i) {
603
600
  "metallicTexture",
604
601
  "refractionTexture",
605
602
  "reflectionTexture"
606
- ].forEach((n) => {
607
- et(
608
- n,
603
+ ].forEach((s) => {
604
+ Je(
609
605
  s,
606
+ n,
610
607
  e,
611
608
  t,
612
609
  i
613
610
  );
614
- }), nt(s, e);
611
+ }), it(n, e);
615
612
  }
616
- function et(s, e, t, i, r) {
617
- const n = Xe[s];
618
- if (!n)
613
+ function Je(n, e, t, i, r) {
614
+ const s = je[n];
615
+ if (!s)
619
616
  throw new Error("Unexpected texture name encountered.");
620
- const o = e[n], a = o == null ? void 0 : o.fileLink;
621
- if (a)
622
- if (s === "reflectionTexture")
623
- a.endsWith(".env") || a.endsWith(".dds") ? i.addCubeTextureTask(
624
- s,
625
- a,
626
- void 0,
627
- !1,
628
- void 0,
629
- !0
630
- ) : a.endsWith(".hdr") ? i.addHDRCubeTextureTask(
631
- s,
632
- a,
633
- 128,
634
- !1,
635
- !0,
636
- !1
637
- ) : i.addTextureTask(s, a, !1, !1);
638
- else {
639
- const l = M.getDynamicTextureResolution(!1);
640
- i.addTextureTask(
641
- s,
642
- je(a, l.width, "webp", 80),
643
- !1,
644
- !1
645
- );
646
- }
647
- else
648
- r && t[s] && (t[s] && t[s].dispose(), t[s] = null, tt(s, t));
617
+ const o = e[s], a = o == null ? void 0 : o.fileLink;
618
+ a ? n === "reflectionTexture" ? a.endsWith(".env") || a.endsWith(".dds") ? i.addCubeTextureTask(
619
+ n,
620
+ a,
621
+ void 0,
622
+ !1,
623
+ void 0,
624
+ !0
625
+ ) : a.endsWith(".hdr") ? i.addHDRCubeTextureTask(
626
+ n,
627
+ a,
628
+ 128,
629
+ !1,
630
+ !0,
631
+ !1
632
+ ) : i.addTextureTask(n, a, !1, !1) : i.addTextureTask(n, a, !1, !1) : r && t[n] && (t[n] && t[n].dispose(), t[n] = null, et(n, t));
649
633
  }
650
- function tt(s, e) {
651
- 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 C(0, 0, 0), e.reflectionTexture);
634
+ function et(n, e) {
635
+ n === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), n === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), n === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), n === "reflectionTexture" && (e.environmentIntensity = 1), n === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new C(0, 0, 0), e.reflectionTexture);
652
636
  }
653
- function it(s, e, t, i) {
637
+ function tt(n, e, t, i) {
654
638
  if (!e) {
655
639
  console.error("Failed to apply texture to material: material is null.");
656
640
  return;
657
641
  }
658
- 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 C(1, 1, 1), e.emissiveIntensity = 1);
642
+ n === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), n === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), n === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), n === "reflectionTexture" && (e.environmentIntensity = t.reflectionIntensity || 1, i.isCube && (i.rotationY = t.reflectionRotation ? t.reflectionRotation * Math.PI / 180 : 0)), e[n] = i, n === "emissiveTexture" && (e.emissiveColor = new C(1, 1, 1), e.emissiveIntensity = 1);
659
643
  }
660
- function nt(s, e) {
661
- s.clearCoat && (s.clearCoat === q.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : s.clearCoat === q.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = s.clearCoatIOR || e.clearCoat.indexOfRefraction));
644
+ function it(n, e) {
645
+ n.clearCoat && (n.clearCoat === q.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : n.clearCoat === q.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = n.clearCoatIOR || e.clearCoat.indexOfRefraction));
662
646
  }
663
- class st {
647
+ class nt {
664
648
  constructor(e, t, i) {
665
649
  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;
666
650
  }
@@ -674,7 +658,7 @@ class st {
674
658
  * where we want to undo changes are remove effects from display.
675
659
  */
676
660
  async applyMaterial(e, t, i, r) {
677
- return new Promise((n) => {
661
+ return new Promise((s) => {
678
662
  const o = this.materialVariantMap.get(e);
679
663
  this.materialVariantMap.set(e, {
680
664
  ...o,
@@ -684,12 +668,12 @@ class st {
684
668
  (h) => h.name === a
685
669
  );
686
670
  if (l.length === 0) {
687
- n();
671
+ s();
688
672
  return;
689
673
  }
690
674
  const c = new ke(this.scene);
691
675
  c.useDefaultLoadingScreen = !1, l.forEach(
692
- (h) => Je(
676
+ (h) => Xe(
693
677
  t,
694
678
  h,
695
679
  c,
@@ -703,14 +687,14 @@ class st {
703
687
  i && i(100, 100, d.name), this.scene.materials.filter(
704
688
  (p) => p.name === a
705
689
  ).forEach((p) => {
706
- it(
690
+ tt(
707
691
  d.name,
708
692
  p,
709
693
  t,
710
694
  m.texture
711
695
  );
712
696
  });
713
- }), n();
697
+ }), s();
714
698
  }, c.loadAsync();
715
699
  });
716
700
  }
@@ -724,7 +708,7 @@ class st {
724
708
  * @param getCurrentFrame A function that returns the current frame of the animation.
725
709
  * @param getAnimationIsPlaying A function that returns whether the animation is currently playing.
726
710
  */
727
- async applyModel(e, t, i, r, n, o, a) {
711
+ async applyModel(e, t, i, r, s, o, a) {
728
712
  var m, f, p;
729
713
  if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
730
714
  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), (f = this.loadedMaterialsForKey.get(e)) == null || f.forEach((b) => b.dispose()), this.loadedMaterialsForKey.delete(e), this.keysThatRemovedBaseModel = this.keysThatRemovedBaseModel.filter(
@@ -735,7 +719,7 @@ class st {
735
719
  !0
736
720
  );
737
721
  this.loadedContainerForKey.has(e) && (this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), (p = this.loadedMaterialsForKey.get(e)) == null || p.forEach((b) => b.dispose()), this.loadedMaterialsForKey.delete(e));
738
- const h = n && n();
722
+ const h = s && s();
739
723
  if (h) {
740
724
  const b = o && o(), w = h.name ? this.renameClonedAsset(h.name) : void 0;
741
725
  if (ve(
@@ -746,7 +730,7 @@ class st {
746
730
  w
747
731
  ), b != null) {
748
732
  const R = a && a() || !0;
749
- Ze(
733
+ $e(
750
734
  c.animationGroups,
751
735
  b + (R ? 2 : 0),
752
736
  w
@@ -779,36 +763,36 @@ class st {
779
763
  }), e;
780
764
  }
781
765
  }
782
- function we(s) {
766
+ function we(n) {
783
767
  const e = [];
784
- return s.rootNodes.forEach((t) => {
768
+ return n.rootNodes.forEach((t) => {
785
769
  t.getChildMeshes().forEach((i) => {
786
770
  i.material && !e.includes(i.material) && e.push(i.material), i.subMeshes && i.subMeshes.forEach((r) => {
787
- const n = r.getMaterial(!1);
788
- n && !e.includes(n) && e.push(n);
771
+ const s = r.getMaterial(!1);
772
+ s && !e.includes(s) && e.push(s);
789
773
  });
790
774
  });
791
775
  }), e;
792
776
  }
793
- function fe(s, e = "") {
794
- return s.map((t) => ({
777
+ function fe(n, e = "") {
778
+ return n.map((t) => ({
795
779
  name: t.name.substring(e.length),
796
780
  loop: t.loopAnimation,
797
781
  to: t.to,
798
782
  from: t.from
799
783
  }));
800
784
  }
801
- class rt {
785
+ class st {
802
786
  constructor(e) {
803
- this.metadata = /* @__PURE__ */ new Map(), this.materialSelectedObservable = new x(), this.materialDeselectedObservable = new x(), this.materialVariantObservable = new x(), this.modelVariantObservable = new x(), this.materialReadyToLoadCallbacks = /* @__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 = [];
787
+ this.metadata = /* @__PURE__ */ new Map(), this.materialSelectedObservable = new M(), this.materialDeselectedObservable = new M(), this.materialVariantObservable = new M(), this.modelVariantObservable = new M(), this.materialReadyToLoadCallbacks = /* @__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 = [];
804
788
  const {
805
789
  enablePicking: t,
806
790
  modelDetails: i,
807
791
  previewService: r,
808
- progressHandler: n,
792
+ progressHandler: s,
809
793
  scene: o
810
794
  } = e;
811
- this.enablePicking = t, this.contextService = i.contextService, this.id = Ke(), this.previewService = r, this.scene = o, this.variantManager = new st(
795
+ this.enablePicking = t, this.contextService = i.contextService, this.id = Ke(), this.previewService = r, this.scene = o, this.variantManager = new nt(
812
796
  o,
813
797
  this.renameClonedAsset.bind(this),
814
798
  this.setBaseModelEnabled.bind(this)
@@ -821,7 +805,7 @@ class rt {
821
805
  return this.assetContainer = await z(
822
806
  i.model,
823
807
  o,
824
- n
808
+ s
825
809
  ), await this.instantiate(), this;
826
810
  };
827
811
  this.importPromise = a();
@@ -860,7 +844,7 @@ class rt {
860
844
  }
861
845
  return;
862
846
  }
863
- const n = async () => {
847
+ const s = async () => {
864
848
  await this.variantManager.applyMaterial(
865
849
  e,
866
850
  i,
@@ -877,18 +861,18 @@ class rt {
877
861
  if (this.materialChangesInProgress.includes(e)) {
878
862
  if (this.queuedMaterialChanges.has(e)) {
879
863
  const o = this.queuedMaterialChanges.get(e);
880
- o == null || o.set(t, n);
864
+ o == null || o.set(t, s);
881
865
  } else {
882
866
  this.queuedMaterialChanges.set(
883
867
  e,
884
868
  /* @__PURE__ */ new Map()
885
869
  );
886
870
  const o = this.queuedMaterialChanges.get(e);
887
- o == null || o.set(t, n);
871
+ o == null || o.set(t, s);
888
872
  }
889
873
  return;
890
874
  }
891
- if (this.materialChangesInProgress.push(e), await n(), this.queuedMaterialChanges.has(e)) {
875
+ if (this.materialChangesInProgress.push(e), await s(), this.queuedMaterialChanges.has(e)) {
892
876
  const o = this.queuedMaterialChanges.get(e);
893
877
  if (!o)
894
878
  throw new Error("Target material is undefined");
@@ -915,7 +899,7 @@ class rt {
915
899
  this.getLastRequestedAnimation.bind(this),
916
900
  this.getCurrentAnimationFrame.bind(this),
917
901
  this.getAnimationIsPlaying.bind(this)
918
- ), n = async () => {
902
+ ), s = async () => {
919
903
  this.modelChangesInProgress.push(e);
920
904
  let a = await r();
921
905
  if (this.queuedModelChanges.has(e)) {
@@ -937,7 +921,7 @@ class rt {
937
921
  this.queuedModelChanges.set(e, a);
938
922
  return;
939
923
  }
940
- const o = await n();
924
+ const o = await s();
941
925
  this.contextService || (this.contextService = t == null ? void 0 : t.contextService), o ? this.configureModelInstance(o) : this.configureGlowLayer();
942
926
  }
943
927
  dispose() {
@@ -950,7 +934,7 @@ class rt {
950
934
  let i = () => {
951
935
  };
952
936
  const r = async () => {
953
- this.isExecutingAnimation = !0, await new Promise((n) => {
937
+ this.isExecutingAnimation = !0, await new Promise((s) => {
954
938
  var a;
955
939
  const o = [
956
940
  ...((a = this.modelInstance) == null ? void 0 : a.animationGroups) || [],
@@ -962,12 +946,12 @@ class rt {
962
946
  e.to,
963
947
  e.from,
964
948
  e.name ? this.renameClonedAsset(e.name) : void 0,
965
- n
949
+ s
966
950
  );
967
951
  }), this.isExecutingAnimation = !1, this.queuedAnimationFunction && this.queuedAnimationFunction(), this.queuedAnimationFunction = void 0, i();
968
952
  };
969
- return t ? ($e(this.scene), r()) : this.isExecutingAnimation ? (this.queuedAnimationFunction = r, new Promise((n) => {
970
- i = n;
953
+ return t ? (Qe(this.scene), r()) : this.isExecutingAnimation ? (this.queuedAnimationFunction = r, new Promise((s) => {
954
+ i = s;
971
955
  })) : r();
972
956
  }
973
957
  getAnimations(e) {
@@ -977,7 +961,7 @@ class rt {
977
961
  this.variantManager.getAnimationGroups(),
978
962
  this.renameClonedAsset("")
979
963
  ) : []
980
- ].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i, r) => r.indexOf(r.find((n) => n.name === t.name)) == i);
964
+ ].map((t, i) => ({ ...t, name: t.name || `UNNAMED_ANIMATION_${i}` })).filter((t, i, r) => r.indexOf(r.find((s) => s.name === t.name)) == i);
981
965
  }
982
966
  getId() {
983
967
  return this.id;
@@ -1023,7 +1007,7 @@ class rt {
1023
1007
  set rotation(e) {
1024
1008
  if (!this.transformRoot)
1025
1009
  throw new Error("ModelContainer disposed prior to setting rotation!");
1026
- this.transformRoot.rotationQuaternion = y.FromEulerAngles(
1010
+ this.transformRoot.rotationQuaternion = x.FromEulerAngles(
1027
1011
  e.x,
1028
1012
  e.y,
1029
1013
  e.z
@@ -1085,19 +1069,19 @@ class rt {
1085
1069
  this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
1086
1070
  }
1087
1071
  configureModelInstance(e) {
1088
- var n;
1072
+ var s;
1089
1073
  if (!this.transformRoot)
1090
1074
  throw new Error(
1091
1075
  "Transform disposed! This should never happen unless there is a race condition present!"
1092
1076
  );
1093
1077
  const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion, r = this.transformRoot.scaling;
1094
- this.transformRoot.position = g.Zero(), this.transformRoot.rotationQuaternion = y.Identity(), this.transformRoot.scaling = g.One();
1078
+ this.transformRoot.position = g.Zero(), this.transformRoot.rotationQuaternion = x.Identity(), this.transformRoot.scaling = g.One();
1095
1079
  for (const o of e.rootNodes) {
1096
1080
  o.parent = this.transformRoot;
1097
1081
  for (const a of o.getChildMeshes(!1))
1098
1082
  a.alwaysSelectAsActiveMesh = !0;
1099
1083
  }
1100
- 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(
1084
+ this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = r, this.canvasPanels = ((s = this.contextService) == null ? void 0 : s.getAll()) || /* @__PURE__ */ new Map(), He(
1101
1085
  this.materials.concat(this.variantManager.getAllMaterials()),
1102
1086
  this.scene,
1103
1087
  this.canvasPanels,
@@ -1204,13 +1188,13 @@ class rt {
1204
1188
  //#endregion
1205
1189
  }
1206
1190
  class G extends be {
1207
- constructor(e, t, i, r, n, o, a, l) {
1191
+ constructor(e, t, i, r, s, o, a, l) {
1208
1192
  super(
1209
1193
  e,
1210
1194
  t,
1211
1195
  i,
1212
1196
  r,
1213
- n,
1197
+ s,
1214
1198
  o,
1215
1199
  l
1216
1200
  ), this.lastFocus = new g(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(
@@ -1268,10 +1252,10 @@ class G extends be {
1268
1252
  i.framingTime = t || 800;
1269
1253
  const r = () => {
1270
1254
  this.isRunningFramingBehavior = !1;
1271
- }, n = I(this._scene), o = n.max.subtract(n.min), a = n.min.add(o.scale(0.5));
1255
+ }, s = I(this._scene), o = s.max.subtract(s.min), a = s.min.add(o.scale(0.5));
1272
1256
  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(
1273
- n.min,
1274
- n.max,
1257
+ s.min,
1258
+ s.max,
1275
1259
  void 0,
1276
1260
  r
1277
1261
  ), i.framingTime = 0;
@@ -1305,32 +1289,32 @@ class G extends be {
1305
1289
  */
1306
1290
  static create(e, t, i) {
1307
1291
  var l;
1308
- const r = I(e), n = r.max.subtract(r.min), o = r.min.add(n.scale(0.5)), a = new G(
1292
+ const r = I(e), s = r.max.subtract(r.min), o = r.min.add(s.scale(0.5)), a = new G(
1309
1293
  "ProductCamera",
1310
1294
  -(Math.PI / 2),
1311
1295
  Math.PI / 2,
1312
- n.length() * 1.5,
1296
+ s.length() * 1.5,
1313
1297
  o,
1314
1298
  e,
1315
1299
  t
1316
1300
  );
1317
1301
  return a.setPanEnabled(
1318
1302
  ((l = t.options) == null ? void 0 : l.noPan) !== void 0 ? !t.options.noPan : !0
1319
- ), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator = n.length(), a.onAfterCheckInputsObservable.addOnce(() => {
1303
+ ), a.panningInertia = 0, a.panningOriginTarget.copyFrom(o), a.panDenominator = s.length(), a.onAfterCheckInputsObservable.addOnce(() => {
1320
1304
  a.setPanEnabled(a.panEnabled);
1321
1305
  }), i && (e.activeCamera = a), a;
1322
1306
  }
1323
1307
  }
1324
- function I(s) {
1325
- if (s.meshes.length === 0)
1308
+ function I(n) {
1309
+ if (n.meshes.length === 0)
1326
1310
  return {
1327
1311
  min: new g(-1, -1, -1),
1328
1312
  max: new g(1, 1, 1)
1329
1313
  };
1330
- const e = s.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1331
- return s.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1314
+ const e = n.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1315
+ return n.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1332
1316
  }
1333
- class at {
1317
+ class rt {
1334
1318
  constructor(e, t = !1, i = void 0) {
1335
1319
  this.renderingPipeline = new Ne(
1336
1320
  "default",
@@ -1348,9 +1332,9 @@ class at {
1348
1332
  return this.currentConfiguration;
1349
1333
  }
1350
1334
  setConfiguration(e) {
1351
- var t, i, r, n, o, a, l, c, h, d, m, f, p, b, w, R, V, _, H, U, K, W, $, Q, Y, Z, j, X, J, ee, te, ie, ne;
1335
+ var t, i, r, s, o, a, l, c, h, d, m, f, p, b, w, R, V, _, H, U, K, W, Q, Y, Z, $, j, X, J, ee, te, ie, ne;
1352
1336
  if (this.renderingPipeline.isSupported) {
1353
- if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? u.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? u.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? u.bloom.enabled, this.renderingPipeline.bloomKernel = ((n = e.bloom) == null ? void 0 : n.kernel) ?? u.bloom.kernel, this.renderingPipeline.bloomScale = ((o = e.bloom) == null ? void 0 : o.scale) ?? u.bloom.scale, this.renderingPipeline.bloomThreshold = ((a = e.bloom) == null ? void 0 : a.threshold) ?? u.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? u.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((c = e.chromaticAberration) == null ? void 0 : c.enabled) ?? u.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((h = e.chromaticAberration) == null ? void 0 : h.aberrationAmount) ?? u.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((d = e.chromaticAberration) == null ? void 0 : d.radialIntensity) ?? u.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new re(
1337
+ if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? u.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? u.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? u.bloom.enabled, this.renderingPipeline.bloomKernel = ((s = e.bloom) == null ? void 0 : s.kernel) ?? u.bloom.kernel, this.renderingPipeline.bloomScale = ((o = e.bloom) == null ? void 0 : o.scale) ?? u.bloom.scale, this.renderingPipeline.bloomThreshold = ((a = e.bloom) == null ? void 0 : a.threshold) ?? u.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? u.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((c = e.chromaticAberration) == null ? void 0 : c.enabled) ?? u.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((h = e.chromaticAberration) == null ? void 0 : h.aberrationAmount) ?? u.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((d = e.chromaticAberration) == null ? void 0 : d.radialIntensity) ?? u.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new re(
1354
1338
  e.chromaticAberration.direction.x,
1355
1339
  e.chromaticAberration.direction.y
1356
1340
  ) : new re(
@@ -1368,7 +1352,7 @@ class at {
1368
1352
  this.renderingPipeline.depthOfFieldBlurLevel = L.High;
1369
1353
  break;
1370
1354
  }
1371
- if (this.renderingPipeline.depthOfField.focalLength = ((b = e.depthOfField) == null ? void 0 : b.focalLength) ?? u.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((w = e.depthOfField) == null ? void 0 : w.fStop) ?? u.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((R = e.depthOfField) == null ? void 0 : R.focusDistance) ?? u.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((V = e.depthOfField) == null ? void 0 : V.lensSize) ?? u.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((_ = e.grain) == null ? void 0 : _.enabled) ?? u.grain.enabled, this.renderingPipeline.grain.animated = ((H = e.grain) == null ? void 0 : H.animated) ?? u.grain.animated, this.renderingPipeline.grain.intensity = ((U = e.grain) == null ? void 0 : U.intensity) ?? u.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((K = e.misc) == null ? void 0 : K.contrast) ?? u.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((W = e.misc) == null ? void 0 : W.exposure) ?? u.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = (($ = e.misc) == null ? void 0 : $.toneMappingEnabled) ?? u.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1355
+ if (this.renderingPipeline.depthOfField.focalLength = ((b = e.depthOfField) == null ? void 0 : b.focalLength) ?? u.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((w = e.depthOfField) == null ? void 0 : w.fStop) ?? u.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((R = e.depthOfField) == null ? void 0 : R.focusDistance) ?? u.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((V = e.depthOfField) == null ? void 0 : V.lensSize) ?? u.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((_ = e.grain) == null ? void 0 : _.enabled) ?? u.grain.enabled, this.renderingPipeline.grain.animated = ((H = e.grain) == null ? void 0 : H.animated) ?? u.grain.animated, this.renderingPipeline.grain.intensity = ((U = e.grain) == null ? void 0 : U.intensity) ?? u.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((K = e.misc) == null ? void 0 : K.contrast) ?? u.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((W = e.misc) == null ? void 0 : W.exposure) ?? u.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((Q = e.misc) == null ? void 0 : Q.toneMappingEnabled) ?? u.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1372
1356
  switch (e.misc.toneMappingType ?? u.misc.toneMappingType) {
1373
1357
  case "Standard":
1374
1358
  this.renderingPipeline.imageProcessing.toneMappingType = E.TONEMAPPING_STANDARD;
@@ -1377,7 +1361,7 @@ class at {
1377
1361
  this.renderingPipeline.imageProcessing.toneMappingType = E.TONEMAPPING_ACES;
1378
1362
  break;
1379
1363
  }
1380
- if (this.renderingPipeline.sharpenEnabled = ((Q = e.sharpen) == null ? void 0 : Q.enabled) ?? u.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Y = e.sharpen) == null ? void 0 : Y.colorAmount) ?? u.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((Z = e.sharpen) == null ? void 0 : Z.edgeAmount) ?? u.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((j = e.vignette) == null ? void 0 : j.enabled) ?? u.vignette.enabled, (X = e.vignette) != null && X.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = u.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = u.vignette.center.y), e.vignette)
1364
+ if (this.renderingPipeline.sharpenEnabled = ((Y = e.sharpen) == null ? void 0 : Y.enabled) ?? u.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Z = e.sharpen) == null ? void 0 : Z.colorAmount) ?? u.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = (($ = e.sharpen) == null ? void 0 : $.edgeAmount) ?? u.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((j = e.vignette) == null ? void 0 : j.enabled) ?? u.vignette.enabled, (X = e.vignette) != null && X.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = u.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = u.vignette.center.y), e.vignette)
1381
1365
  switch (((J = e.vignette) == null ? void 0 : J.blendMode) ?? u.vignette.blendMode) {
1382
1366
  case "Multiply":
1383
1367
  this.renderingPipeline.imageProcessing.vignetteBlendMode = E.VIGNETTEMODE_MULTIPLY;
@@ -1404,25 +1388,25 @@ class at {
1404
1388
  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;
1405
1389
  }
1406
1390
  }
1407
- ye.GLTFLoader.RegisterExtension("glbPostProcessor", function(s) {
1408
- return new Ve(s);
1391
+ ye.GLTFLoader.RegisterExtension("glbPostProcessor", function(n) {
1392
+ return new Ve(n);
1409
1393
  });
1410
- k.OnPluginActivatedObservable.add((s) => {
1411
- if (s.name === "gltf") {
1412
- const e = s;
1394
+ k.OnPluginActivatedObservable.add((n) => {
1395
+ if (n.name === "gltf") {
1396
+ const e = n;
1413
1397
  e.transparencyAsCoverage = !0;
1414
1398
  }
1415
1399
  });
1416
- function F(s) {
1417
- return new g(s.x, s.y, s.z);
1400
+ function F(n) {
1401
+ return new g(n.x, n.y, n.z);
1418
1402
  }
1419
- function S(s) {
1420
- return { x: s.x, y: s.y, z: s.z };
1403
+ function S(n) {
1404
+ return { x: n.x, y: n.y, z: n.z };
1421
1405
  }
1422
1406
  class Yt {
1423
1407
  constructor(e) {
1424
1408
  var a;
1425
- this.focusLostNotified = !1, this.focusLostObservable = new x(), this.modelLoadEventCallbacks = [], this.validHighlightMaterials = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.initComplete = !1, this.isAnimatingCamera = !1, this.renderLoop = () => {
1409
+ this.focusLostNotified = !1, this.focusLostObservable = new M(), this.modelLoadEventCallbacks = [], this.validHighlightMaterials = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.initComplete = !1, this.isAnimatingCamera = !1, this.renderLoop = () => {
1426
1410
  if (!this.engine.views)
1427
1411
  return;
1428
1412
  this.modelContainers.forEach((h) => {
@@ -1454,7 +1438,7 @@ class Yt {
1454
1438
  fallbackUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_decoder_gltf.js`
1455
1439
  }
1456
1440
  }, i && (i.getContext("webgl2") || i.getContext("webgl"));
1457
- const n = console.log;
1441
+ const s = console.log;
1458
1442
  console.log = () => {
1459
1443
  };
1460
1444
  const o = i ? new B(i, !0, {
@@ -1466,7 +1450,7 @@ class Yt {
1466
1450
  stencil: this.configuration.highlights.enabled,
1467
1451
  forceSRGBBufferSupportState: !0
1468
1452
  }) : new Ce();
1469
- if (o.enableOfflineSupport = !1, o.doNotHandleContextLost = !0, console.log = n, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new xe(o), this.camera = G.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new at(
1453
+ if (o.enableOfflineSupport = !1, o.doNotHandleContextLost = !0, console.log = s, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new xe(o), this.camera = G.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new rt(
1470
1454
  this.scene,
1471
1455
  !1,
1472
1456
  this.camera
@@ -1483,7 +1467,7 @@ class Yt {
1483
1467
  this.scene,
1484
1468
  this.configuration.emissiveGlowIntensity
1485
1469
  ), this.initPromise = new Promise((l) => {
1486
- this.scene.onReadyObservable.addOnce(() => {
1470
+ this.scene.isReady() ? l() : this.scene.onReadyObservable.addOnce(() => {
1487
1471
  this.initComplete = !0, l();
1488
1472
  });
1489
1473
  });
@@ -1534,7 +1518,7 @@ class Yt {
1534
1518
  let t = () => {
1535
1519
  };
1536
1520
  const i = async () => {
1537
- this.isAnimatingCamera = !0, await Qe(
1521
+ this.isAnimatingCamera = !0, await Ye(
1538
1522
  this.scene,
1539
1523
  this.scene.activeCamera,
1540
1524
  e
@@ -1579,9 +1563,9 @@ class Yt {
1579
1563
  this.isAnimatingCamera = !0, await new Promise((i) => {
1580
1564
  this.focusLostNotified = !1;
1581
1565
  const r = () => {
1582
- const n = this.configuration;
1566
+ const s = this.configuration;
1583
1567
  this.camera.rerunFramingBehavior(() => {
1584
- 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();
1568
+ 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();
1585
1569
  });
1586
1570
  };
1587
1571
  this.scene.onAfterRenderObservable.addOnce(r);
@@ -1613,8 +1597,8 @@ class Yt {
1613
1597
  0,
1614
1598
  g.Zero(),
1615
1599
  this.scene
1616
- ), r = t.latDeg * Math.PI / 180, n = t.lonDeg * Math.PI / 180;
1617
- i.target = t.target ? new g(t.target.x, t.target.y, t.target.z) : g.Zero(), i.alpha = n, i.beta = r, i.radius = t.radius || this.camera.radius, i.minZ = 0.01;
1600
+ ), r = t.latDeg * Math.PI / 180, s = t.lonDeg * Math.PI / 180;
1601
+ i.target = t.target ? new g(t.target.x, t.target.y, t.target.z) : g.Zero(), i.alpha = s, i.beta = r, i.radius = t.radius || this.camera.radius, i.minZ = 0.01;
1618
1602
  try {
1619
1603
  return await new Promise((o) => {
1620
1604
  const a = this.scene.onBeforeRenderObservable.add(async () => {
@@ -1639,10 +1623,10 @@ class Yt {
1639
1623
  const e = this.configuration;
1640
1624
  if (!e)
1641
1625
  return !0;
1642
- 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;
1643
- if (t === void 0 || i === void 0 || r === void 0 || n === void 0)
1626
+ const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, r = e.camera.limits.min.beta, s = e.camera.limits.max.beta;
1627
+ if (t === void 0 || i === void 0 || r === void 0 || s === void 0)
1644
1628
  return !0;
1645
- const o = [t, i], a = [r, n], l = o.every((h) => h === t), c = a.every((h) => h === r);
1629
+ const o = [t, i], a = [r, s], l = o.every((h) => h === t), c = a.every((h) => h === r);
1646
1630
  return !l && !c;
1647
1631
  }
1648
1632
  fireResizeEvent() {
@@ -1657,7 +1641,7 @@ class Yt {
1657
1641
  (i) => this.validHighlightMaterials.includes(i.name)
1658
1642
  ).forEach((i) => {
1659
1643
  const r = this.scene.materials.find(
1660
- (n) => n.id === i.id
1644
+ (s) => s.id === i.id
1661
1645
  );
1662
1646
  r && (r.emissiveColor = new C(
1663
1647
  this.configuration.highlights.color.r,
@@ -1670,14 +1654,14 @@ class Yt {
1670
1654
  this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
1671
1655
  }
1672
1656
  loadModel(e, t) {
1673
- const { refocusCamera: i = !0, progressHandler: r } = t ?? {}, n = new rt({
1657
+ const { refocusCamera: i = !0, progressHandler: r } = t ?? {}, s = new st({
1674
1658
  enablePicking: this.configuration.highlights.enabled,
1675
1659
  modelDetails: e,
1676
1660
  scene: this.scene,
1677
1661
  previewService: this,
1678
1662
  progressHandler: r
1679
1663
  });
1680
- return n.getInitializationPromise().then(() => {
1664
+ return s.getInitializationPromise().then(() => {
1681
1665
  if (this.modelContainers.size <= 1 && i) {
1682
1666
  const o = this.queuedCameraAnimation;
1683
1667
  this.forceStopCameraAnimations(), this.camera.rerunFramingBehavior(() => {
@@ -1686,14 +1670,14 @@ class Yt {
1686
1670
  });
1687
1671
  }, 1);
1688
1672
  }
1689
- }), this.configuration.highlights.enabled && (n.registerMaterialSelectedCallback((o) => {
1673
+ }), this.configuration.highlights.enabled && (s.registerMaterialSelectedCallback((o) => {
1690
1674
  this.setHighlights([o]);
1691
- }), n.registerMaterialDeselectedCallback(() => {
1675
+ }), s.registerMaterialDeselectedCallback(() => {
1692
1676
  this.setHighlights([]);
1693
- })), this.modelContainers.set(n.getId(), n), this.triggerModelLoadEvent({
1677
+ })), this.modelContainers.set(s.getId(), s), this.triggerModelLoadEvent({
1694
1678
  eventType: "load",
1695
- modelContainer: n
1696
- }), n;
1679
+ modelContainer: s
1680
+ }), s;
1697
1681
  }
1698
1682
  async preloadModel(e) {
1699
1683
  await z(e, this.scene);
@@ -1733,19 +1717,19 @@ class Yt {
1733
1717
  flipTransform(e, t, i) {
1734
1718
  const r = ae.Compose(
1735
1719
  F(i || { x: 1, y: 1, z: 1 }),
1736
- y.FromEulerVector(
1720
+ x.FromEulerVector(
1737
1721
  F(t || { x: 0, y: 0, z: 0 })
1738
1722
  ),
1739
1723
  F(e || { x: 0, y: 0, z: 0 })
1740
- ), n = ae.RotationAxis(g.Up(), Math.PI), o = r.multiply(n), a = g.Zero(), l = y.Identity(), c = g.Zero();
1741
- return o.decompose(c, l, a), l.multiplyInPlace(y.FromEulerAngles(0, Math.PI, 0)), {
1724
+ ), s = ae.RotationAxis(g.Up(), Math.PI), o = r.multiply(s), a = g.Zero(), l = x.Identity(), c = g.Zero();
1725
+ return o.decompose(c, l, a), l.multiplyInPlace(x.FromEulerAngles(0, Math.PI, 0)), {
1742
1726
  position: S(a),
1743
1727
  rotation: S(l.toEulerAngles()),
1744
1728
  scale: S(c)
1745
1729
  };
1746
1730
  }
1747
1731
  updatePreviewOptions(e) {
1748
- var r, n;
1732
+ var r, s;
1749
1733
  const t = new de(e);
1750
1734
  this.configuration.highlights.enabled !== t.highlights.enabled && this.engine.setStencilBuffer(t.highlights.enabled), this.scene.clearColor = t.scene.clearColor;
1751
1735
  let i = this.scene.environmentTexture;
@@ -1755,7 +1739,7 @@ class Yt {
1755
1739
  ), i.name = "updated-environment-cube", this.scene.environmentTexture = i), i && (i.rotationY = t.scene.environment.rotationY), this.scene.environmentIntensity = t.scene.environment.intensity, (r = t.options) != null && r.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
1756
1740
  t.options.renderingPipelineConfiguration
1757
1741
  ) : (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(
1758
- ((n = t.options) == null ? void 0 : n.noPan) !== void 0 ? !t.options.noPan : !0
1742
+ ((s = t.options) == null ? void 0 : s.noPan) !== void 0 ? !t.options.noPan : !0
1759
1743
  ), this.configuration = t;
1760
1744
  }
1761
1745
  setHighlightMaterials(e) {
@@ -1782,7 +1766,7 @@ export {
1782
1766
  q as MaterialEffectMode,
1783
1767
  D as ProductCameraRig,
1784
1768
  Ge as REFLECTION_PROBE_RESOLUTION,
1785
- M as RenderingConfiguration,
1769
+ P as RenderingConfiguration,
1786
1770
  Yt as SpiffCommerce3DPreviewService,
1787
1771
  u as renderingPipelineDefaults
1788
1772
  };