@spiffcommerce/preview 5.3.13 → 5.3.14-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { ArcRotateCamera as pe } from "@babylonjs/core/Cameras/arcRotateCamera";
2
2
  import { Engine as fe } from "@babylonjs/core/Engines/engine";
3
3
  import { NullEngine as Ce } from "@babylonjs/core/Engines/nullEngine";
4
4
  import { HighlightLayer as ye } from "@babylonjs/core/Layers/highlightLayer";
5
- import { SceneLoader as S } from "@babylonjs/core/Loading/sceneLoader";
5
+ import { SceneLoader as B } from "@babylonjs/core/Loading/sceneLoader";
6
6
  import { CubeTexture as ie } from "@babylonjs/core/Materials/Textures/cubeTexture";
7
7
  import { Color4 as b, Color3 as w } from "@babylonjs/core/Maths/math.color";
8
8
  import { Vector3 as p, Quaternion as y, Vector2 as ne, Matrix as se } from "@babylonjs/core/Maths/math.vector";
@@ -11,12 +11,12 @@ import { Observable as C } from "@babylonjs/core/Misc/observable";
11
11
  import { Tools as xe } from "@babylonjs/core/Misc/tools";
12
12
  import { Scene as Ae } from "@babylonjs/core/scene";
13
13
  import { GLTF2 as Pe } from "@babylonjs/loaders/glTF";
14
- import { PBRMaterial as B } from "@babylonjs/core/Materials/PBR/pbrMaterial";
14
+ import { PBRMaterial as D } from "@babylonjs/core/Materials/PBR/pbrMaterial";
15
15
  import { MirrorTexture as Re } from "@babylonjs/core/Materials/Textures/mirrorTexture";
16
16
  import { Color3 as Te, Vector3 as re, Plane as Ee } from "@babylonjs/core/Maths/math";
17
17
  import { ReflectionProbe as Oe } from "@babylonjs/core/Probes/reflectionProbe";
18
18
  import { GlowLayer as Le } from "@babylonjs/core/Layers/glowLayer";
19
- import { ActionManager as R } from "@babylonjs/core/Actions/actionManager";
19
+ import { ActionManager as T } from "@babylonjs/core/Actions/actionManager";
20
20
  import { ExecuteCodeAction as ae } from "@babylonjs/core/Actions/directActions";
21
21
  import { Mesh as Ie } from "@babylonjs/core/Meshes/mesh";
22
22
  import { TransformNode as Fe } from "@babylonjs/core/Meshes/transformNode";
@@ -27,9 +27,9 @@ 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 Ve } from "@babylonjs/core/Misc/assetsManager";
29
29
  import { ColorCurves as oe } from "@babylonjs/core/Materials/colorCurves";
30
- import { ImageProcessingConfiguration as A } from "@babylonjs/core/Materials/imageProcessingConfiguration";
30
+ import { ImageProcessingConfiguration as P } from "@babylonjs/core/Materials/imageProcessingConfiguration";
31
31
  import { DefaultRenderingPipeline as qe } from "@babylonjs/core/PostProcesses/RenderPipeline";
32
- import { DepthOfFieldEffectBlurLevel as T } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
32
+ import { DepthOfFieldEffectBlurLevel as E } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
33
33
  import "@babylonjs/core/Rendering/depthRendererSceneComponent";
34
34
  import "@babylonjs/core/Engines/Extensions/engine.views";
35
35
  import "@babylonjs/core/Meshes/instancedMesh";
@@ -40,7 +40,7 @@ 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__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(I || {}), F = /* @__PURE__ */ ((n) => (n.None = "None", n.RemoveWhenSelected = "RemoveWhenSelected", n.ApplyWhenSelected = "ApplyWhenSelected", n))(F || {});
43
+ var F = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(F || {}), S = /* @__PURE__ */ ((n) => (n.None = "None", n.RemoveWhenSelected = "RemoveWhenSelected", n.ApplyWhenSelected = "ApplyWhenSelected", n))(S || {});
44
44
  class le {
45
45
  constructor(e) {
46
46
  this.getSceneClearColor = () => {
@@ -97,7 +97,7 @@ class le {
97
97
  * Configuration related to the camera used to view and interact with the scene.
98
98
  */
99
99
  get camera() {
100
- var e, t, i, s, r, o, a, h, c, l, u, m, g;
100
+ var e, t, i, s, r, o, a, l, d, h, u, m, g;
101
101
  return {
102
102
  autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
103
103
  autoRotation: {
@@ -108,10 +108,10 @@ class le {
108
108
  min: {
109
109
  alpha: (s = this.customOptions) != null && s.lowerAlphaLimitDeg ? ((r = this.customOptions) == null ? void 0 : r.lowerAlphaLimitDeg) * Math.PI / 180 : void 0,
110
110
  beta: (o = this.customOptions) != null && o.lowerBetaLimitDeg ? ((a = this.customOptions) == null ? void 0 : a.lowerBetaLimitDeg) * Math.PI / 180 : void 0,
111
- radius: (h = this.customOptions) == null ? void 0 : h.minZoomOverride
111
+ radius: (l = this.customOptions) == null ? void 0 : l.minZoomOverride
112
112
  },
113
113
  max: {
114
- alpha: (c = this.customOptions) != null && c.upperAlphaLimitDeg ? ((l = this.customOptions) == null ? void 0 : l.upperAlphaLimitDeg) * Math.PI / 180 : void 0,
114
+ alpha: (d = this.customOptions) != null && d.upperAlphaLimitDeg ? ((h = this.customOptions) == null ? void 0 : h.upperAlphaLimitDeg) * Math.PI / 180 : void 0,
115
115
  beta: (u = this.customOptions) != null && u.upperBetaLimitDeg ? ((m = this.customOptions) == null ? void 0 : m.upperBetaLimitDeg) * Math.PI / 180 : void 0,
116
116
  radius: (g = this.customOptions) == null ? void 0 : g.maxZoomOverride
117
117
  }
@@ -182,7 +182,7 @@ class x {
182
182
  }
183
183
  }
184
184
  }
185
- const Ne = 128, d = {
185
+ const Ne = 128, c = {
186
186
  antiAliasing: {
187
187
  samples: 4,
188
188
  fxaaEnabled: !1
@@ -283,7 +283,7 @@ class Ge {
283
283
  * @param babylonMaterial An instance of a material representation in babylon.
284
284
  */
285
285
  enableMaterialExtrasIfRequired(e, t) {
286
- if (!(!e.extras || !(t instanceof B))) {
286
+ if (!(!e.extras || !(t instanceof D))) {
287
287
  if (e.extras.sheen) {
288
288
  const i = t;
289
289
  i.sheen.isEnabled = !0, i.sheen.intensity = e.extras.sheen;
@@ -328,27 +328,27 @@ class Ge {
328
328
  const a = r.material;
329
329
  if (!a)
330
330
  return;
331
- const h = new Re(
331
+ const l = new Re(
332
332
  "mirror",
333
333
  x.getMirrorTextureResolution(),
334
334
  e,
335
335
  !0
336
336
  );
337
- h.renderList = t(e);
338
- const c = r.getVerticesData("normal");
339
- if (!c)
337
+ l.renderList = t(e);
338
+ const d = r.getVerticesData("normal");
339
+ if (!d)
340
340
  throw new Error(
341
341
  "Mirror attribute specified on: " + r.name + "But no normals exist to generate a mirror from!"
342
342
  );
343
343
  r.computeWorldMatrix(!0);
344
- const l = r.getWorldMatrix(), u = re.TransformNormal(
345
- new re(c[0], c[1], c[2]),
346
- l
344
+ const h = r.getWorldMatrix(), u = re.TransformNormal(
345
+ new re(d[0], d[1], d[2]),
346
+ h
347
347
  ).normalize(), m = Ee.FromPositionAndNormal(
348
348
  r.position,
349
349
  u.scale(-1)
350
350
  );
351
- h.mirrorPlane = m, h.level = o, a.reflectionTexture = h;
351
+ l.mirrorPlane = m, l.level = o, a.reflectionTexture = l;
352
352
  }
353
353
  function s(r) {
354
354
  const o = r.material, a = new Oe(
@@ -387,47 +387,54 @@ class _e {
387
387
  }
388
388
  }
389
389
  const he = /* @__PURE__ */ new Map();
390
- async function be(n, e, t) {
391
- const i = he.get(n);
392
- if (i && i.scene.uid === e.uid)
393
- return i;
390
+ async function He(n, e) {
391
+ if (e)
392
+ return e(n).then(
393
+ (t) => new File([t], n, { type: "model/gltf-binary" })
394
+ );
395
+ }
396
+ async function be(n, e, t, i) {
397
+ const s = he.get(n);
398
+ if (s && s.scene.uid === e.uid)
399
+ return s;
394
400
  {
395
- const s = await S.LoadAssetContainerAsync(
401
+ const r = await He(n, i), o = await B.LoadAssetContainerAsync(
396
402
  n,
397
- void 0,
403
+ r,
398
404
  e,
399
- t
405
+ t,
406
+ ".glb"
400
407
  );
401
- return he.set(n, s), s;
408
+ return he.set(n, o), o;
402
409
  }
403
410
  }
404
- S.OnPluginActivatedObservable.add((n) => {
411
+ B.OnPluginActivatedObservable.add((n) => {
405
412
  n.name === "gltf" && (n.animationStartMode = Se.NONE);
406
413
  });
407
- function He(n, e, t, i, s = "") {
414
+ function Ke(n, e, t, i, s = "") {
408
415
  t.forEach((r) => {
409
- const o = r.getID(), a = r.getName(), h = x.getDynamicTextureResolution();
410
- n.filter((l) => l.name === s + a).forEach((l) => {
416
+ const o = r.getID(), a = r.getName(), l = x.getDynamicTextureResolution();
417
+ n.filter((h) => h.name === s + a).forEach((h) => {
411
418
  const u = i.get(o), m = !1;
412
419
  if (u)
413
- ce(l, u), u.update(m);
420
+ ce(h, u), u.update(m);
414
421
  else {
415
- const g = Ke(
422
+ const g = Ue(
416
423
  a,
417
424
  e,
418
- h.width,
419
- h.height
425
+ l.width,
426
+ l.height
420
427
  );
421
428
  i.set(o, g), r.setStaticContext(
422
429
  g.getContext()
423
- ), ce(l, g), g.onLoadObservable.addOnce(() => {
430
+ ), ce(h, g), g.onLoadObservable.addOnce(() => {
424
431
  g.update(m);
425
432
  });
426
433
  }
427
434
  });
428
435
  });
429
436
  }
430
- function Ke(n, e, t, i) {
437
+ function Ue(n, e, t, i) {
431
438
  const s = new Be(
432
439
  n,
433
440
  { width: t, height: i },
@@ -439,7 +446,7 @@ function Ke(n, e, t, i) {
439
446
  return r && (r.fillStyle = "#f5f5f5", r.fillRect(0, 0, t, i), s.update()), s;
440
447
  }
441
448
  function ce(n, e) {
442
- if (n instanceof B) {
449
+ if (n instanceof D) {
443
450
  const t = n, i = t.albedoTexture;
444
451
  i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
445
452
  } else {
@@ -447,7 +454,7 @@ function ce(n, e) {
447
454
  i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
448
455
  }
449
456
  }
450
- function Ue() {
457
+ function We() {
451
458
  const n = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
452
459
  return n() + n() + "-" + n() + "-" + n() + "-" + n() + "-" + n() + n() + n();
453
460
  }
@@ -456,39 +463,39 @@ function ue(n) {
456
463
  return n.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / n.targetedAnimations.length || 0;
457
464
  }
458
465
  function ve(n, e, t, i, s, r) {
459
- const o = s ? n.filter((l) => l.name === s) : n;
466
+ const o = s ? n.filter((h) => h.name === s) : n;
460
467
  if (o.length === 0) {
461
468
  console.warn(`No animations found for name: ${s}`);
462
469
  return;
463
470
  }
464
471
  let a = 0;
465
- const h = () => {
472
+ const l = () => {
466
473
  a++, a === o.length && r && r();
467
- }, c = (l, u, m, g, f) => {
468
- l.stop(), l.start(u, m, g, f), r && (u == !1 || u === void 0 && !l.loopAnimation ? l.onAnimationGroupEndObservable.addOnce(() => {
469
- h();
470
- }) : l.onAnimationLoopObservable.addOnce(() => {
471
- h();
474
+ }, d = (h, u, m, g, f) => {
475
+ h.stop(), h.start(u, m, g, f), r && (u == !1 || u === void 0 && !h.loopAnimation ? h.onAnimationGroupEndObservable.addOnce(() => {
476
+ l();
477
+ }) : h.onAnimationLoopObservable.addOnce(() => {
478
+ l();
472
479
  }));
473
480
  };
474
481
  if (i !== void 0 && t !== void 0 && i === t) {
475
- o.forEach((l) => {
476
- const u = ue(l), m = i * u;
477
- c(l, !1, de, m, m);
482
+ o.forEach((h) => {
483
+ const u = ue(h), m = i * u;
484
+ d(h, !1, de, m, m);
478
485
  });
479
486
  return;
480
487
  }
481
- o.forEach((l) => {
482
- const u = ue(l), m = i !== void 0 ? i * u : void 0, g = t !== void 0 ? t * u : void 0;
483
- c(l, e, de, m, g);
488
+ o.forEach((h) => {
489
+ const u = ue(h), m = i !== void 0 ? i * u : void 0, g = t !== void 0 ? t * u : void 0;
490
+ d(h, e, de, m, g);
484
491
  });
485
492
  }
486
- function We(n, e, t) {
493
+ function Ye(n, e, t) {
487
494
  return new Promise((i) => {
488
- n.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ye(e.alpha, 0, 2 * Math.PI));
495
+ n.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Qe(e.alpha, 0, 2 * Math.PI));
489
496
  const s = [], r = t.target, o = 0, a = r ? 1 : 0;
490
497
  if (t.target && Object.keys(t.target).length > 0 && s.push(
491
- P(
498
+ R(
492
499
  "cameraTargetLerp",
493
500
  "target",
494
501
  new p().copyFrom(e.target),
@@ -501,7 +508,7 @@ function We(n, e, t) {
501
508
  o
502
509
  )
503
510
  ), s.push(
504
- P(
511
+ R(
505
512
  "cameraAlphaLerp",
506
513
  "alpha",
507
514
  e.alpha,
@@ -510,7 +517,7 @@ function We(n, e, t) {
510
517
  a
511
518
  )
512
519
  ), s.push(
513
- P(
520
+ R(
514
521
  "cameraBetaLerp",
515
522
  "beta",
516
523
  e.beta,
@@ -519,20 +526,20 @@ function We(n, e, t) {
519
526
  a
520
527
  )
521
528
  ), t.radius !== void 0) {
522
- const l = Math.max(0.01, t.radius);
529
+ const h = Math.max(0.01, t.radius);
523
530
  s.push(
524
- P(
531
+ R(
525
532
  "cameraRadiusLerp",
526
533
  "radius",
527
534
  e.radius,
528
- l,
535
+ h,
529
536
  v.ANIMATIONTYPE_FLOAT,
530
537
  a
531
538
  )
532
539
  );
533
540
  }
534
541
  e.animations.push(...s);
535
- const c = e.useAutoRotationBehavior;
542
+ const d = e.useAutoRotationBehavior;
536
543
  e.disableAutoRotationBehavior(), n.beginAnimation(
537
544
  e,
538
545
  0,
@@ -540,7 +547,7 @@ function We(n, e, t) {
540
547
  !1,
541
548
  1,
542
549
  () => {
543
- e.animations = [], c && e.enableAutoRotationBehavior(), i();
550
+ e.animations = [], d && e.enableAutoRotationBehavior(), i();
544
551
  }
545
552
  );
546
553
  });
@@ -548,30 +555,30 @@ function We(n, e, t) {
548
555
  function me(n) {
549
556
  return n * Math.PI / 180;
550
557
  }
551
- function P(n, e, t, i, s, r = 0, o = v.ANIMATIONLOOPMODE_CONSTANT) {
558
+ function R(n, e, t, i, s, r = 0, o = v.ANIMATIONLOOPMODE_CONSTANT) {
552
559
  const a = new ke();
553
560
  a.setEasingMode(ze.EASINGMODE_EASEINOUT);
554
- const h = new v(
561
+ const l = new v(
555
562
  n,
556
563
  e,
557
564
  M,
558
565
  s,
559
566
  o
560
- ), c = [];
561
- return r > 0 && c.push({ frame: 0, value: t }), c.push({ frame: M * r, value: t }), c.push({
567
+ ), d = [];
568
+ return r > 0 && d.push({ frame: 0, value: t }), d.push({ frame: M * r, value: t }), d.push({
562
569
  frame: M * (r + 1),
563
570
  value: i
564
- }), h.setKeys(c), h.setEasingFunction(a), h;
571
+ }), l.setKeys(d), l.setEasingFunction(a), l;
565
572
  }
566
- function Ye(n, e, t) {
573
+ function Qe(n, e, t) {
567
574
  return n < e ? n = t - (e - n) % (t - e) : n = e + (n - e) % (t - e);
568
575
  }
569
- function Qe(n, e, t) {
576
+ function Ze(n, e, t) {
570
577
  n.forEach((i) => {
571
578
  t && i.name !== t || i.goToFrame(e);
572
579
  });
573
580
  }
574
- const Ze = {
581
+ const $e = {
575
582
  albedoTexture: "albedoMap",
576
583
  bumpTexture: "normalMap",
577
584
  ambientTexture: "ambientMap",
@@ -581,7 +588,7 @@ const Ze = {
581
588
  refractionTexture: "refractionMap",
582
589
  reflectionTexture: "reflectionMap"
583
590
  };
584
- function $e(n, e, t, i) {
591
+ function je(n, e, t, i) {
585
592
  [
586
593
  "albedoTexture",
587
594
  "bumpTexture",
@@ -592,17 +599,17 @@ function $e(n, e, t, i) {
592
599
  "refractionTexture",
593
600
  "reflectionTexture"
594
601
  ].forEach((r) => {
595
- je(
602
+ Xe(
596
603
  r,
597
604
  n,
598
605
  e,
599
606
  t,
600
607
  i
601
608
  );
602
- }), et(n, e);
609
+ }), tt(n, e);
603
610
  }
604
- function je(n, e, t, i, s) {
605
- const r = Ze[n];
611
+ function Xe(n, e, t, i, s) {
612
+ const r = $e[n];
606
613
  if (!r)
607
614
  throw new Error("Unexpected texture name encountered.");
608
615
  const o = e[r], a = o == null ? void 0 : o.fileLink;
@@ -620,22 +627,22 @@ function je(n, e, t, i, s) {
620
627
  !1,
621
628
  !0,
622
629
  !1
623
- ) : i.addTextureTask(n, a, !1, !1) : i.addTextureTask(n, a, !1, !1) : s && t[n] && (t[n] && t[n].dispose(), t[n] = null, Xe(n, t));
630
+ ) : i.addTextureTask(n, a, !1, !1) : i.addTextureTask(n, a, !1, !1) : s && t[n] && (t[n] && t[n].dispose(), t[n] = null, Je(n, t));
624
631
  }
625
- function Xe(n, e) {
632
+ function Je(n, e) {
626
633
  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 w(0, 0, 0), e.reflectionTexture);
627
634
  }
628
- function Je(n, e, t, i) {
635
+ function et(n, e, t, i) {
629
636
  if (!e) {
630
637
  console.error("Failed to apply texture to material: material is null.");
631
638
  return;
632
639
  }
633
640
  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 w(1, 1, 1), e.emissiveIntensity = 1);
634
641
  }
635
- function et(n, e) {
636
- n.clearCoat && (n.clearCoat === F.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : n.clearCoat === F.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = n.clearCoatIOR || e.clearCoat.indexOfRefraction));
642
+ function tt(n, e) {
643
+ n.clearCoat && (n.clearCoat === S.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : n.clearCoat === S.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = n.clearCoatIOR || e.clearCoat.indexOfRefraction));
637
644
  }
638
- class tt {
645
+ class it {
639
646
  constructor(e, t, i) {
640
647
  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;
641
648
  }
@@ -655,30 +662,30 @@ class tt {
655
662
  ...o,
656
663
  ...t
657
664
  });
658
- const a = this.renameClonedAsset(e), h = this.scene.materials.filter(
659
- (l) => l.name === a
665
+ const a = this.renameClonedAsset(e), l = this.scene.materials.filter(
666
+ (h) => h.name === a
660
667
  );
661
- if (h.length === 0) {
668
+ if (l.length === 0) {
662
669
  r();
663
670
  return;
664
671
  }
665
- const c = new Ve(this.scene);
666
- c.useDefaultLoadingScreen = !1, h.forEach(
667
- (l) => $e(
672
+ const d = new Ve(this.scene);
673
+ d.useDefaultLoadingScreen = !1, l.forEach(
674
+ (h) => je(
668
675
  t,
669
- l,
670
- c,
676
+ h,
677
+ d,
671
678
  s
672
679
  )
673
- ), c.onProgress = (l, u, m) => {
674
- i && i(l / u * 100, 100, m.name);
675
- }, c.onFinish = (l) => {
676
- l.forEach((u) => {
680
+ ), d.onProgress = (h, u, m) => {
681
+ i && i(h / u * 100, 100, m.name);
682
+ }, d.onFinish = (h) => {
683
+ h.forEach((u) => {
677
684
  const m = u;
678
685
  i && i(100, 100, u.name), this.scene.materials.filter(
679
686
  (f) => f.name === a
680
687
  ).forEach(
681
- (f) => Je(
688
+ (f) => et(
682
689
  u.name,
683
690
  f,
684
691
  t,
@@ -686,7 +693,7 @@ class tt {
686
693
  )
687
694
  );
688
695
  }), r();
689
- }, c.loadAsync();
696
+ }, d.loadAsync();
690
697
  });
691
698
  }
692
699
  /**
@@ -698,39 +705,45 @@ class tt {
698
705
  * @param lastPlayedAnimation The last played animation, this is used to ensure the animation is played on the new model.
699
706
  * @param getCurrentFrame A function that returns the current frame of the animation.
700
707
  * @param getAnimationIsPlaying A function that returns whether the animation is currently playing.
708
+ * @param loadModel A function that loads a model from a given URL.
701
709
  */
702
- async applyModel(e, t, i, s, r, o, a) {
703
- var u;
710
+ async applyModel(e, t, i, s, r, o, a, l) {
711
+ var m;
704
712
  if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
705
- return this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.length === 1 && await this.setBaseModelEnabled(!0), (u = this.loadedContainerForKey.get(e)) == null || u.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e), this.keysThatRemovedBaseModel = this.keysThatRemovedBaseModel.filter(
706
- (m) => m !== e
713
+ 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(
714
+ (g) => g !== e
707
715
  ), Promise.resolve(void 0);
708
- const c = (await be(i, this.scene, s)).instantiateModelsToScene(
716
+ const h = (await be(
717
+ i,
718
+ this.scene,
719
+ s,
720
+ l
721
+ )).instantiateModelsToScene(
709
722
  this.renameClonedAsset,
710
723
  !0
711
724
  );
712
725
  if (this.loadedContainerForKey.has(e) && (this.loadedContainerForKey.get(e).dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), r) {
713
- const m = o && o(), g = r.name ? this.renameClonedAsset(r.name) : void 0;
726
+ const g = o && o(), f = r.name ? this.renameClonedAsset(r.name) : void 0;
714
727
  if (ve(
715
- c.animationGroups,
728
+ h.animationGroups,
716
729
  r.loop,
717
730
  r.to,
718
731
  r.from,
719
- g
720
- ), m != null) {
721
- const f = a && a() || !0;
722
- Qe(
723
- c.animationGroups,
724
- m + (f ? 2 : 0),
725
- g
732
+ f
733
+ ), g != null) {
734
+ const A = a && a() || !0;
735
+ Ze(
736
+ h.animationGroups,
737
+ g + (A ? 2 : 0),
738
+ f
726
739
  );
727
740
  }
728
741
  }
729
- t && await this.setBaseModelEnabled(!1), this.loadedContainerForKey.set(e, c), this.loadedMaterialsForKey.set(e, we(c));
730
- const l = [];
731
- return this.materialVariantMap.forEach(async (m, g) => {
732
- l.push(this.applyMaterial(g, m));
733
- }), await Promise.all(l), c;
742
+ t && await this.setBaseModelEnabled(!1), this.loadedContainerForKey.set(e, h), this.loadedMaterialsForKey.set(e, we(h));
743
+ const u = [];
744
+ return this.materialVariantMap.forEach(async (g, f) => {
745
+ u.push(this.applyMaterial(f, g));
746
+ }), await Promise.all(u), h;
734
747
  }
735
748
  dispose() {
736
749
  this.loadedContainerForKey.forEach((e) => e == null ? void 0 : e.dispose()), this.loadedContainerForKey.clear(), this.loadedMaterialsForKey.forEach(
@@ -771,7 +784,7 @@ function ge(n, e = "") {
771
784
  from: t.from
772
785
  }));
773
786
  }
774
- class it {
787
+ class nt {
775
788
  constructor(e) {
776
789
  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 = [];
777
790
  const {
@@ -781,12 +794,13 @@ class it {
781
794
  progressHandler: r,
782
795
  scene: o
783
796
  } = e;
784
- this.enablePicking = t, this.contextService = i.contextService, this.id = Ue(), this.previewService = s, this.scene = o, this.variantManager = new tt(
797
+ this.enablePicking = t, this.contextService = i.contextService, this.id = We(), this.previewService = s, this.scene = o, this.variantManager = new it(
785
798
  o,
786
799
  this.renameClonedAsset.bind(this),
787
800
  this.setBaseModelEnabled.bind(this)
788
801
  ), this.transformRoot = new Fe("root", this.scene);
789
802
  const a = async () => {
803
+ var l;
790
804
  if (!i.model)
791
805
  throw new Error(
792
806
  "Model container constructed with no URL. This is currently unsupported."
@@ -794,7 +808,8 @@ class it {
794
808
  return this.assetContainer = await be(
795
809
  i.model,
796
810
  o,
797
- r
811
+ r,
812
+ (l = this.previewService.getCurrentConfiguration()) == null ? void 0 : l.loadModel
798
813
  ), await this.instantiate(), this;
799
814
  };
800
815
  this.importPromise = a();
@@ -837,11 +852,11 @@ class it {
837
852
  await this.variantManager.applyMaterial(
838
853
  e,
839
854
  i,
840
- (o, a, h) => {
855
+ (o, a, l) => {
841
856
  this.materialVariantObservable.notifyObservers({
842
857
  remainingCount: o,
843
858
  totalCount: a,
844
- taskName: h
859
+ taskName: l
845
860
  });
846
861
  },
847
862
  s
@@ -887,20 +902,24 @@ class it {
887
902
  );
888
903
  return;
889
904
  }
890
- const s = () => this.variantManager.applyModel(
891
- e,
892
- i,
893
- t == null ? void 0 : t.model,
894
- (a) => {
895
- this.modelVariantObservable.notifyObservers({
896
- ...a,
897
- key: e
898
- });
899
- },
900
- this.lastPlayedAnimation,
901
- this.getCurrentAnimationFrame.bind(this),
902
- this.getAnimationIsPlaying.bind(this)
903
- );
905
+ const s = () => {
906
+ var a;
907
+ return this.variantManager.applyModel(
908
+ e,
909
+ i,
910
+ t == null ? void 0 : t.model,
911
+ (l) => {
912
+ this.modelVariantObservable.notifyObservers({
913
+ ...l,
914
+ key: e
915
+ });
916
+ },
917
+ this.lastPlayedAnimation,
918
+ this.getCurrentAnimationFrame.bind(this),
919
+ this.getAnimationIsPlaying.bind(this),
920
+ (a = this.previewService.getCurrentConfiguration()) == null ? void 0 : a.loadModel
921
+ );
922
+ };
904
923
  if (this.modelChangesInProgress.includes(e)) {
905
924
  this.queuedModelChanges.set(e, s);
906
925
  return;
@@ -909,10 +928,10 @@ class it {
909
928
  this.modelChangesInProgress.push(e);
910
929
  let a = await s();
911
930
  if (this.queuedModelChanges.has(e)) {
912
- const h = this.queuedModelChanges.get(e);
913
- if (!h)
931
+ const l = this.queuedModelChanges.get(e);
932
+ if (!l)
914
933
  throw new Error("Queued change resolved undefined");
915
- a = await h(), this.queuedModelChanges.delete(e);
934
+ a = await l(), this.queuedModelChanges.delete(e);
916
935
  }
917
936
  return this.modelChangesInProgress.splice(
918
937
  this.modelChangesInProgress.indexOf(e),
@@ -1025,15 +1044,15 @@ class it {
1025
1044
  attachPickingHandler(e) {
1026
1045
  e.rootNodes.forEach((t) => {
1027
1046
  t.getChildMeshes(!1).forEach((i) => {
1028
- i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new R(this.scene)), i.actionManager.registerAction(
1029
- new ae(R.OnPointerOverTrigger, (s) => {
1047
+ i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new T(this.scene)), i.actionManager.registerAction(
1048
+ new ae(T.OnPointerOverTrigger, (s) => {
1030
1049
  s.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
1031
1050
  id: i.material.id,
1032
1051
  name: this.stripIdFromName(i.material.name)
1033
1052
  });
1034
1053
  })
1035
1054
  ), i.actionManager.registerAction(
1036
- new ae(R.OnPointerOutTrigger, () => {
1055
+ new ae(T.OnPointerOutTrigger, () => {
1037
1056
  i.material && this.materialDeselectedObservable.notifyObservers({
1038
1057
  id: i.material.id,
1039
1058
  name: this.stripIdFromName(i.material.name)
@@ -1062,7 +1081,7 @@ class it {
1062
1081
  return this.modelReadyToLoadCallbacks.size;
1063
1082
  }
1064
1083
  configureGlowLayer() {
1065
- const e = (i) => i instanceof B && i.emissiveTexture !== null;
1084
+ const e = (i) => i instanceof D && i.emissiveTexture !== null;
1066
1085
  this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
1067
1086
  }
1068
1087
  configureModelInstance(e) {
@@ -1075,7 +1094,7 @@ class it {
1075
1094
  this.transformRoot.position = p.Zero(), this.transformRoot.rotationQuaternion = y.Identity(), this.transformRoot.scaling = p.One();
1076
1095
  for (const o of e.rootNodes)
1077
1096
  o.parent = this.transformRoot;
1078
- this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = s, this.canvasPanels = ((r = this.contextService) == null ? void 0 : r.getAll()) || /* @__PURE__ */ new Map(), He(
1097
+ this.transformRoot.position = t, this.transformRoot.rotationQuaternion = i, this.transformRoot.scaling = s, this.canvasPanels = ((r = this.contextService) == null ? void 0 : r.getAll()) || /* @__PURE__ */ new Map(), Ke(
1079
1098
  this.materials.concat(this.variantManager.getAllMaterials()),
1080
1099
  this.scene,
1081
1100
  this.canvasPanels,
@@ -1178,8 +1197,8 @@ class it {
1178
1197
  }
1179
1198
  //#endregion
1180
1199
  }
1181
- class D extends pe {
1182
- constructor(e, t, i, s, r, o, a, h) {
1200
+ class k extends pe {
1201
+ constructor(e, t, i, s, r, o, a, l) {
1183
1202
  super(
1184
1203
  e,
1185
1204
  t,
@@ -1187,7 +1206,7 @@ class D extends pe {
1187
1206
  s,
1188
1207
  r,
1189
1208
  o,
1190
- h
1209
+ l
1191
1210
  ), this.lastFocus = new p(0, 0, 0), this._isRunningFramingBehavior = !1, this.panDenominator = 1, 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(
1192
1211
  a.camera.autoRotation.idleTimeMs
1193
1212
  ));
@@ -1221,7 +1240,7 @@ class D extends pe {
1221
1240
  this.useFramingBehavior = !0;
1222
1241
  const e = this.getFramingBehavior();
1223
1242
  e.attach(this), e.framingTime = 0, e.elevationReturnTime = -1, e.zoomStopsAnimation = !1, this.lowerRadiusLimit = null;
1224
- const t = E(this._scene);
1243
+ const t = O(this._scene);
1225
1244
  return e.zoomOnBoundingInfo(t.min, t.max), this.wheelPrecision = 100 / this.radius, this.lowerRadiusLimit === null && (this.lowerRadiusLimit = 0.1), this.lastFocus.copyFrom(this.target), e;
1226
1245
  }
1227
1246
  /**
@@ -1235,7 +1254,7 @@ class D extends pe {
1235
1254
  i.framingTime = t || 800;
1236
1255
  const s = () => {
1237
1256
  this.isRunningFramingBehavior = !1;
1238
- }, r = E(this._scene), o = r.max.subtract(r.min), a = r.min.add(o.scale(0.5));
1257
+ }, r = O(this._scene), o = r.max.subtract(r.min), a = r.min.add(o.scale(0.5));
1239
1258
  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(
1240
1259
  r.min,
1241
1260
  r.max,
@@ -1270,7 +1289,7 @@ class D extends pe {
1270
1289
  * @param assignActive If true the camera will be assigned as the active camera on the scene.
1271
1290
  */
1272
1291
  static create(e, t, i) {
1273
- const s = E(e), r = s.max.subtract(s.min), o = s.min.add(r.scale(0.5)), a = new D(
1292
+ const s = O(e), r = s.max.subtract(s.min), o = s.min.add(r.scale(0.5)), a = new k(
1274
1293
  "ProductCamera",
1275
1294
  -(Math.PI / 2),
1276
1295
  Math.PI / 2,
@@ -1284,7 +1303,7 @@ class D extends pe {
1284
1303
  }), i && (e.activeCamera = a), a;
1285
1304
  }
1286
1305
  }
1287
- function E(n) {
1306
+ function O(n) {
1288
1307
  if (n.meshes.length === 0)
1289
1308
  return {
1290
1309
  min: new p(-1, -1, -1),
@@ -1293,7 +1312,7 @@ function E(n) {
1293
1312
  const e = n.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1294
1313
  return n.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1295
1314
  }
1296
- class nt {
1315
+ class st {
1297
1316
  constructor(e, t = !1, i = void 0) {
1298
1317
  this.renderingPipeline = new qe(
1299
1318
  "default",
@@ -1302,7 +1321,7 @@ class nt {
1302
1321
  i ? [i] : void 0,
1303
1322
  !1
1304
1323
  // Disable automatic build
1305
- ), this.renderingPipeline.isSupported && (this.renderingPipeline.prepare(), this.setConfiguration(d));
1324
+ ), this.renderingPipeline.isSupported && (this.renderingPipeline.prepare(), this.setConfiguration(c));
1306
1325
  }
1307
1326
  dispose() {
1308
1327
  this.renderingPipeline.dispose();
@@ -1311,42 +1330,42 @@ class nt {
1311
1330
  return this.currentConfiguration;
1312
1331
  }
1313
1332
  setConfiguration(e) {
1314
- var t, i, s, r, o, a, h, c, l, u, m, g, f, k, z, V, q, N, G, _, H, K, U, W, Y, Q, Z, $, j, X, J, ee, te;
1333
+ var t, i, s, r, o, a, l, d, h, u, m, g, f, A, z, V, q, N, G, _, H, K, U, W, Y, Q, Z, $, j, X, J, ee, te;
1315
1334
  if (this.renderingPipeline.isSupported) {
1316
- 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 = ((s = e.bloom) == null ? void 0 : s.enabled) ?? d.bloom.enabled, this.renderingPipeline.bloomKernel = ((r = e.bloom) == null ? void 0 : r.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 = ((c = e.chromaticAberration) == null ? void 0 : c.enabled) ?? d.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((l = e.chromaticAberration) == null ? void 0 : l.aberrationAmount) ?? d.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((u = e.chromaticAberration) == null ? void 0 : u.radialIntensity) ?? d.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new ne(
1335
+ if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? c.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? c.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((s = e.bloom) == null ? void 0 : s.enabled) ?? c.bloom.enabled, this.renderingPipeline.bloomKernel = ((r = e.bloom) == null ? void 0 : r.kernel) ?? c.bloom.kernel, this.renderingPipeline.bloomScale = ((o = e.bloom) == null ? void 0 : o.scale) ?? c.bloom.scale, this.renderingPipeline.bloomThreshold = ((a = e.bloom) == null ? void 0 : a.threshold) ?? c.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? c.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((d = e.chromaticAberration) == null ? void 0 : d.enabled) ?? c.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((h = e.chromaticAberration) == null ? void 0 : h.aberrationAmount) ?? c.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((u = e.chromaticAberration) == null ? void 0 : u.radialIntensity) ?? c.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new ne(
1317
1336
  e.chromaticAberration.direction.x,
1318
1337
  e.chromaticAberration.direction.y
1319
1338
  ) : new ne(
1320
- d.chromaticAberration.direction.x,
1321
- d.chromaticAberration.direction.y
1322
- ), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((g = e.colorCurves) == null ? void 0 : g.enabled) ?? d.colorCurves.enabled, this.renderingPipeline.imageProcessing.colorCurves = e.colorCurves ? this.updateColorCurve(e.colorCurves) : new oe(), this.renderingPipeline.depthOfFieldEnabled = ((f = e.depthOfField) == null ? void 0 : f.enabled) ?? d.depthOfField.enabled, e.depthOfField)
1323
- switch (e.depthOfField.blurLevel ?? d.depthOfField.blurLevel) {
1339
+ c.chromaticAberration.direction.x,
1340
+ c.chromaticAberration.direction.y
1341
+ ), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((g = e.colorCurves) == null ? void 0 : g.enabled) ?? c.colorCurves.enabled, this.renderingPipeline.imageProcessing.colorCurves = e.colorCurves ? this.updateColorCurve(e.colorCurves) : new oe(), this.renderingPipeline.depthOfFieldEnabled = ((f = e.depthOfField) == null ? void 0 : f.enabled) ?? c.depthOfField.enabled, e.depthOfField)
1342
+ switch (e.depthOfField.blurLevel ?? c.depthOfField.blurLevel) {
1324
1343
  case "Low":
1325
- this.renderingPipeline.depthOfFieldBlurLevel = T.Low;
1344
+ this.renderingPipeline.depthOfFieldBlurLevel = E.Low;
1326
1345
  break;
1327
1346
  case "Medium":
1328
- this.renderingPipeline.depthOfFieldBlurLevel = T.Medium;
1347
+ this.renderingPipeline.depthOfFieldBlurLevel = E.Medium;
1329
1348
  break;
1330
1349
  case "High":
1331
- this.renderingPipeline.depthOfFieldBlurLevel = T.High;
1350
+ this.renderingPipeline.depthOfFieldBlurLevel = E.High;
1332
1351
  break;
1333
1352
  }
1334
- if (this.renderingPipeline.depthOfField.focalLength = ((k = e.depthOfField) == null ? void 0 : k.focalLength) ?? d.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((z = e.depthOfField) == null ? void 0 : z.fStop) ?? d.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((V = e.depthOfField) == null ? void 0 : V.focusDistance) ?? d.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((q = e.depthOfField) == null ? void 0 : q.lensSize) ?? d.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((N = e.grain) == null ? void 0 : N.enabled) ?? d.grain.enabled, this.renderingPipeline.grain.animated = ((G = e.grain) == null ? void 0 : G.animated) ?? d.grain.animated, this.renderingPipeline.grain.intensity = ((_ = e.grain) == null ? void 0 : _.intensity) ?? d.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((H = e.misc) == null ? void 0 : H.contrast) ?? d.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((K = e.misc) == null ? void 0 : K.exposure) ?? d.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((U = e.misc) == null ? void 0 : U.toneMappingEnabled) ?? d.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1335
- switch (e.misc.toneMappingType ?? d.misc.toneMappingType) {
1353
+ if (this.renderingPipeline.depthOfField.focalLength = ((A = e.depthOfField) == null ? void 0 : A.focalLength) ?? c.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((z = e.depthOfField) == null ? void 0 : z.fStop) ?? c.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((V = e.depthOfField) == null ? void 0 : V.focusDistance) ?? c.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((q = e.depthOfField) == null ? void 0 : q.lensSize) ?? c.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((N = e.grain) == null ? void 0 : N.enabled) ?? c.grain.enabled, this.renderingPipeline.grain.animated = ((G = e.grain) == null ? void 0 : G.animated) ?? c.grain.animated, this.renderingPipeline.grain.intensity = ((_ = e.grain) == null ? void 0 : _.intensity) ?? c.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((H = e.misc) == null ? void 0 : H.contrast) ?? c.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((K = e.misc) == null ? void 0 : K.exposure) ?? c.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((U = e.misc) == null ? void 0 : U.toneMappingEnabled) ?? c.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1354
+ switch (e.misc.toneMappingType ?? c.misc.toneMappingType) {
1336
1355
  case "Standard":
1337
- this.renderingPipeline.imageProcessing.toneMappingType = A.TONEMAPPING_STANDARD;
1356
+ this.renderingPipeline.imageProcessing.toneMappingType = P.TONEMAPPING_STANDARD;
1338
1357
  break;
1339
1358
  case "ACES":
1340
- this.renderingPipeline.imageProcessing.toneMappingType = A.TONEMAPPING_ACES;
1359
+ this.renderingPipeline.imageProcessing.toneMappingType = P.TONEMAPPING_ACES;
1341
1360
  break;
1342
1361
  }
1343
- if (this.renderingPipeline.sharpenEnabled = ((W = e.sharpen) == null ? void 0 : W.enabled) ?? d.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Y = e.sharpen) == null ? void 0 : Y.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, ($ = e.vignette) != null && $.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)
1344
- switch (((j = e.vignette) == null ? void 0 : j.blendMode) ?? d.vignette.blendMode) {
1362
+ if (this.renderingPipeline.sharpenEnabled = ((W = e.sharpen) == null ? void 0 : W.enabled) ?? c.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((Y = e.sharpen) == null ? void 0 : Y.colorAmount) ?? c.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((Q = e.sharpen) == null ? void 0 : Q.edgeAmount) ?? c.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((Z = e.vignette) == null ? void 0 : Z.enabled) ?? c.vignette.enabled, ($ = e.vignette) != null && $.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = c.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = c.vignette.center.y), e.vignette)
1363
+ switch (((j = e.vignette) == null ? void 0 : j.blendMode) ?? c.vignette.blendMode) {
1345
1364
  case "Multiply":
1346
- this.renderingPipeline.imageProcessing.vignetteBlendMode = A.VIGNETTEMODE_MULTIPLY;
1365
+ this.renderingPipeline.imageProcessing.vignetteBlendMode = P.VIGNETTEMODE_MULTIPLY;
1347
1366
  break;
1348
1367
  case "Opaque":
1349
- this.renderingPipeline.imageProcessing.vignetteBlendMode = A.VIGNETTEMODE_OPAQUE;
1368
+ this.renderingPipeline.imageProcessing.vignetteBlendMode = P.VIGNETTEMODE_OPAQUE;
1350
1369
  break;
1351
1370
  }
1352
1371
  (X = e.vignette) != null && X.colorRgba ? this.renderingPipeline.imageProcessing.vignetteColor = new b(
@@ -1355,11 +1374,11 @@ class nt {
1355
1374
  e.vignette.colorRgba.b,
1356
1375
  e.vignette.colorRgba.a
1357
1376
  ) : (J = e.vignette) != null && J.colorHex ? this.renderingPipeline.imageProcessing.vignetteColor = b.FromHexString(e.vignette.colorHex) : this.renderingPipeline.imageProcessing.vignetteColor = new b(
1358
- d.vignette.colorRgba.r,
1359
- d.vignette.colorRgba.g,
1360
- d.vignette.colorRgba.b,
1361
- d.vignette.colorRgba.a
1362
- ), this.renderingPipeline.imageProcessing.vignetteStretch = ((ee = e.vignette) == null ? void 0 : ee.stretch) ?? d.vignette.stretch, this.renderingPipeline.imageProcessing.vignetteWeight = ((te = e.vignette) == null ? void 0 : te.weight) ?? d.vignette.weight, this.renderingPipeline.prepare(), this.currentConfiguration = e;
1377
+ c.vignette.colorRgba.r,
1378
+ c.vignette.colorRgba.g,
1379
+ c.vignette.colorRgba.b,
1380
+ c.vignette.colorRgba.a
1381
+ ), this.renderingPipeline.imageProcessing.vignetteStretch = ((ee = e.vignette) == null ? void 0 : ee.stretch) ?? c.vignette.stretch, this.renderingPipeline.imageProcessing.vignetteWeight = ((te = e.vignette) == null ? void 0 : te.weight) ?? c.vignette.weight, this.renderingPipeline.prepare(), this.currentConfiguration = e;
1363
1382
  }
1364
1383
  }
1365
1384
  updateColorCurve(e) {
@@ -1370,29 +1389,29 @@ class nt {
1370
1389
  Pe.GLTFLoader.RegisterExtension("glbPostProcessor", function(n) {
1371
1390
  return new Ge(n);
1372
1391
  });
1373
- S.OnPluginActivatedObservable.add((n) => {
1392
+ B.OnPluginActivatedObservable.add((n) => {
1374
1393
  if (n.name === "gltf") {
1375
1394
  const e = n;
1376
1395
  e.transparencyAsCoverage = !0;
1377
1396
  }
1378
1397
  });
1379
- function O(n) {
1398
+ function L(n) {
1380
1399
  return new p(n.x, n.y, n.z);
1381
1400
  }
1382
- function L(n) {
1401
+ function I(n) {
1383
1402
  return { x: n.x, y: n.y, z: n.z };
1384
1403
  }
1385
- class Wt {
1404
+ class Yt {
1386
1405
  constructor(e) {
1387
- var h;
1406
+ var l;
1388
1407
  this.focusLostNotified = !1, this.focusLostObservable = new C(), this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.initComplete = !1, this.isAnimatingCamera = !1, this.renderLoop = () => {
1389
1408
  if (!this.engine.views)
1390
1409
  return;
1391
- this.modelContainers.forEach((l) => {
1392
- l.updateDynamicTextures();
1410
+ this.modelContainers.forEach((h) => {
1411
+ h.updateDynamicTextures();
1393
1412
  }), this.scene.render(), this.camera.isRunningFramingBehavior && this.camera.getFramingBehavior().isUserIsMoving && (this.camera.isRunningFramingBehavior = !1);
1394
- const c = Math.max((this.camera.lowerRadiusLimit ?? 1) * 0.01, 1e-3);
1395
- !this.camera.isRunningFramingBehavior && !this.camera.target.equalsWithEpsilon(this.camera.lastFocus, c) && !this.focusLostNotified && (this.focusLostObservable.notifyObservers(void 0), this.focusLostNotified = !0), this.screenshotPrepareResolve && (this.screenshotPrepareResolve(), this.screenshotPrepareResolve = void 0);
1413
+ const d = Math.max((this.camera.lowerRadiusLimit ?? 1) * 0.01, 1e-3);
1414
+ !this.camera.isRunningFramingBehavior && !this.camera.target.equalsWithEpsilon(this.camera.lastFocus, d) && !this.focusLostNotified && (this.focusLostObservable.notifyObservers(void 0), this.focusLostNotified = !0), this.screenshotPrepareResolve && (this.screenshotPrepareResolve(), this.screenshotPrepareResolve = void 0);
1396
1415
  }, this.configuration = new le(e);
1397
1416
  const i = (() => {
1398
1417
  if (!(e != null && e.noRender))
@@ -1417,7 +1436,7 @@ class Wt {
1417
1436
  stencil: this.configuration.highlights.enabled,
1418
1437
  forceSRGBBufferSupportState: !0
1419
1438
  }) : new Ce();
1420
- console.log = r, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new Ae(o), this.scene.autoClear = !0, this.scene.autoClearDepthAndStencil = !0, this.camera = D.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new nt(
1439
+ console.log = r, o.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = o, this.scene = new Ae(o), this.scene.autoClear = !0, this.scene.autoClearDepthAndStencil = !0, this.camera = k.create(this.scene, this.configuration), this.scene.activeCamera = this.camera, this.renderingPipeline = new st(
1421
1440
  this.scene,
1422
1441
  !1,
1423
1442
  this.camera
@@ -1426,14 +1445,14 @@ class Wt {
1426
1445
  this.configuration.scene.environment.file,
1427
1446
  this.scene
1428
1447
  );
1429
- 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(
1448
+ a.rotationY = this.configuration.scene.environment.rotationY, this.scene.environmentTexture = a, this.scene.environmentIntensity = this.configuration.scene.environment.intensity, (l = this.configuration.options) != null && l.renderingPipelineConfiguration ? this.renderingPipeline.setConfiguration(
1430
1449
  this.configuration.options.renderingPipelineConfiguration
1431
1450
  ) : (this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast), this.glowLayerManager = new _e(
1432
1451
  this.scene,
1433
1452
  this.configuration.emissiveGlowIntensity
1434
- ), this.initPromise = new Promise((c) => {
1453
+ ), this.initPromise = new Promise((d) => {
1435
1454
  this.scene.onReadyObservable.addOnce(() => {
1436
- this.initComplete = !0, c();
1455
+ this.initComplete = !0, d();
1437
1456
  });
1438
1457
  }), this.engine.runRenderLoop(this.renderLoop);
1439
1458
  }
@@ -1465,7 +1484,7 @@ class Wt {
1465
1484
  }
1466
1485
  registerView(e) {
1467
1486
  const t = e.height, i = e.width;
1468
- this.engine.registerView(e, void 0, !0), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(I.Pan), this.reattachControls(e);
1487
+ this.engine.registerView(e, void 0, !0), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(F.Pan), this.reattachControls(e);
1469
1488
  }
1470
1489
  getNumViewports() {
1471
1490
  var e;
@@ -1483,7 +1502,7 @@ class Wt {
1483
1502
  let t = () => {
1484
1503
  };
1485
1504
  const i = async () => {
1486
- this.isAnimatingCamera = !0, await We(
1505
+ this.isAnimatingCamera = !0, await Ye(
1487
1506
  this.scene,
1488
1507
  this.scene.activeCamera,
1489
1508
  e
@@ -1519,7 +1538,7 @@ class Wt {
1519
1538
  throw new Error(
1520
1539
  "No views attached, camera state requires a view to attach controls onto."
1521
1540
  );
1522
- e === I.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
1541
+ e === F.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
1523
1542
  }
1524
1543
  animateToLastCameraFocus() {
1525
1544
  let e = () => {
@@ -1582,8 +1601,8 @@ class Wt {
1582
1601
  const t = e.camera.limits.min.alpha, i = e.camera.limits.max.alpha, s = e.camera.limits.min.beta, r = e.camera.limits.max.beta;
1583
1602
  if (t === void 0 || i === void 0 || s === void 0 || r === void 0)
1584
1603
  return !0;
1585
- const o = [t, i], a = [s, r], h = o.every((l) => l === t), c = a.every((l) => l === s);
1586
- return !h && !c;
1604
+ const o = [t, i], a = [s, r], l = o.every((h) => h === t), d = a.every((h) => h === s);
1605
+ return !l && !d;
1587
1606
  }
1588
1607
  fireResizeEvent() {
1589
1608
  this.getNumViewports() > 0 && this.engine.resize();
@@ -1602,8 +1621,8 @@ class Wt {
1602
1621
  );
1603
1622
  o && o.getBindedMeshes().forEach(
1604
1623
  (a) => {
1605
- var h;
1606
- return (h = this.highlightLayer) == null ? void 0 : h.addMesh(
1624
+ var l;
1625
+ return (l = this.highlightLayer) == null ? void 0 : l.addMesh(
1607
1626
  a,
1608
1627
  i || w.FromHexString("#fcba03")
1609
1628
  );
@@ -1615,7 +1634,7 @@ class Wt {
1615
1634
  this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
1616
1635
  }
1617
1636
  loadModel(e, t) {
1618
- const i = new it({
1637
+ const i = new nt({
1619
1638
  enablePicking: this.configuration.highlights.enabled,
1620
1639
  modelDetails: e,
1621
1640
  scene: this.scene,
@@ -1671,16 +1690,16 @@ class Wt {
1671
1690
  */
1672
1691
  flipTransform(e, t, i) {
1673
1692
  const s = se.Compose(
1674
- O(i || { x: 1, y: 1, z: 1 }),
1693
+ L(i || { x: 1, y: 1, z: 1 }),
1675
1694
  y.FromEulerVector(
1676
- O(t || { x: 0, y: 0, z: 0 })
1695
+ L(t || { x: 0, y: 0, z: 0 })
1677
1696
  ),
1678
- O(e || { x: 0, y: 0, z: 0 })
1679
- ), r = se.RotationAxis(p.Up(), Math.PI), o = s.multiply(r), a = p.Zero(), h = y.Identity(), c = p.Zero();
1680
- return o.decompose(c, h, a), h.multiplyInPlace(y.FromEulerAngles(0, Math.PI, 0)), {
1681
- position: L(a),
1682
- rotation: L(h.toEulerAngles()),
1683
- scale: L(c)
1697
+ L(e || { x: 0, y: 0, z: 0 })
1698
+ ), r = se.RotationAxis(p.Up(), Math.PI), o = s.multiply(r), a = p.Zero(), l = y.Identity(), d = p.Zero();
1699
+ return o.decompose(d, l, a), l.multiplyInPlace(y.FromEulerAngles(0, Math.PI, 0)), {
1700
+ position: I(a),
1701
+ rotation: I(l.toEulerAngles()),
1702
+ scale: I(d)
1684
1703
  };
1685
1704
  }
1686
1705
  updatePreviewOptions(e) {
@@ -1710,10 +1729,10 @@ class Wt {
1710
1729
  }
1711
1730
  }
1712
1731
  export {
1713
- F as MaterialEffectMode,
1714
- I as ProductCameraRig,
1732
+ S as MaterialEffectMode,
1733
+ F as ProductCameraRig,
1715
1734
  Ne as REFLECTION_PROBE_RESOLUTION,
1716
1735
  x as RenderingConfiguration,
1717
- Wt as SpiffCommerce3DPreviewService,
1718
- d as renderingPipelineDefaults
1736
+ Yt as SpiffCommerce3DPreviewService,
1737
+ c as renderingPipelineDefaults
1719
1738
  };