@spiffcommerce/preview 4.1.0-alpha.0 → 4.1.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,34 +1,34 @@
1
- import { ArcRotateCamera as he } from "@babylonjs/core/Cameras/arcRotateCamera";
2
- import { Engine as de } from "@babylonjs/core/Engines/engine";
3
- import { NullEngine as pe } from "@babylonjs/core/Engines/nullEngine";
4
- import { HighlightLayer as fe } from "@babylonjs/core/Layers/highlightLayer";
5
- import { SceneLoader as ce } from "@babylonjs/core/Loading/sceneLoader";
6
- import { CubeTexture as be } from "@babylonjs/core/Materials/Textures/cubeTexture";
1
+ import { ArcRotateCamera as de } from "@babylonjs/core/Cameras/arcRotateCamera";
2
+ import { Engine as ue } from "@babylonjs/core/Engines/engine";
3
+ import { NullEngine as be } from "@babylonjs/core/Engines/nullEngine";
4
+ import { HighlightLayer as ve } from "@babylonjs/core/Layers/highlightLayer";
5
+ import { SceneLoader as ge } from "@babylonjs/core/Loading/sceneLoader";
6
+ import { CubeTexture as we } from "@babylonjs/core/Materials/Textures/cubeTexture";
7
7
  import { Color4 as f, Color3 as w } from "@babylonjs/core/Maths/math.color";
8
- import { Vector3 as g, Vector2 as J } from "@babylonjs/core/Maths/math.vector";
9
- import { DracoCompression as ve } from "@babylonjs/core/Meshes/Compression/dracoCompression";
8
+ import { Vector3 as g, Quaternion as C, Vector2 as ee, Matrix as te } from "@babylonjs/core/Maths/math.vector";
9
+ import { DracoCompression as Ce } from "@babylonjs/core/Meshes/Compression/dracoCompression";
10
10
  import { Observable as b } from "@babylonjs/core/Misc/observable";
11
- import { Tools as we } from "@babylonjs/core/Misc/tools";
12
- import { Scene as Ce } from "@babylonjs/core/scene";
11
+ import { Tools as ye } from "@babylonjs/core/Misc/tools";
12
+ import { Scene as Me } from "@babylonjs/core/scene";
13
13
  import { GLTF2 as Pe } from "@babylonjs/loaders/glTF";
14
- import { PBRMaterial as T } from "@babylonjs/core/Materials/PBR/pbrMaterial";
15
- import { MirrorTexture as Me } from "@babylonjs/core/Materials/Textures/mirrorTexture";
16
- import { Color3 as ye, Vector3 as ee, Plane as xe } from "@babylonjs/core/Maths/math";
17
- import { ReflectionProbe as Le } from "@babylonjs/core/Probes/reflectionProbe";
18
- import { GlowLayer as Ae } from "@babylonjs/core/Layers/glowLayer";
19
- import { ActionManager as L } from "@babylonjs/core/Actions/actionManager";
20
- import { ExecuteCodeAction as te } from "@babylonjs/core/Actions/directActions";
14
+ import { PBRMaterial as I } from "@babylonjs/core/Materials/PBR/pbrMaterial";
15
+ import { MirrorTexture as xe } from "@babylonjs/core/Materials/Textures/mirrorTexture";
16
+ import { Color3 as Le, Vector3 as ie, Plane as Ae } from "@babylonjs/core/Maths/math";
17
+ import { ReflectionProbe as Ee } from "@babylonjs/core/Probes/reflectionProbe";
18
+ import { GlowLayer as Oe } from "@babylonjs/core/Layers/glowLayer";
19
+ import { ActionManager as A } from "@babylonjs/core/Actions/actionManager";
20
+ import { ExecuteCodeAction as se } from "@babylonjs/core/Actions/directActions";
21
21
  import { Mesh as Re } from "@babylonjs/core/Meshes/mesh";
22
- import { TransformNode as Oe } from "@babylonjs/core/Meshes/transformNode";
23
- import { DynamicTexture as Ee } from "@babylonjs/core/Materials/Textures/dynamicTexture";
24
- import { Texture as Te } from "@babylonjs/core/Materials/Textures/texture";
22
+ import { TransformNode as Te } from "@babylonjs/core/Meshes/transformNode";
23
+ import { DynamicTexture as Ie } from "@babylonjs/core/Materials/Textures/dynamicTexture";
24
+ import { Texture as Se } from "@babylonjs/core/Materials/Textures/texture";
25
25
  import { Animation as v } from "@babylonjs/core/Animations/animation";
26
- import { QuadraticEase as Ie, EasingFunction as Se } from "@babylonjs/core/Animations/easing";
27
- import { AssetsManager as Fe } from "@babylonjs/core/Misc/assetsManager";
28
- import { ColorCurves as ie } from "@babylonjs/core/Materials/colorCurves";
29
- import { ImageProcessingConfiguration as M } from "@babylonjs/core/Materials/imageProcessingConfiguration";
30
- import { DefaultRenderingPipeline as Be } from "@babylonjs/core/PostProcesses/RenderPipeline";
31
- import { DepthOfFieldEffectBlurLevel as A } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
26
+ import { QuadraticEase as Fe, EasingFunction as Be } from "@babylonjs/core/Animations/easing";
27
+ import { AssetsManager as De } from "@babylonjs/core/Misc/assetsManager";
28
+ import { ColorCurves as ne } from "@babylonjs/core/Materials/colorCurves";
29
+ import { ImageProcessingConfiguration as P } from "@babylonjs/core/Materials/imageProcessingConfiguration";
30
+ import { DefaultRenderingPipeline as ze } from "@babylonjs/core/PostProcesses/RenderPipeline";
31
+ import { DepthOfFieldEffectBlurLevel as E } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
32
32
  import "@babylonjs/core/Rendering/depthRendererSceneComponent";
33
33
  import "@babylonjs/core/Engines/Extensions/engine.views";
34
34
  import "@babylonjs/core/Meshes/instancedMesh";
@@ -39,8 +39,8 @@ import "@babylonjs/core/Animations/animatable";
39
39
  import "@babylonjs/core/Misc/screenshotTools";
40
40
  import "@babylonjs/core/Rendering/boundingBoxRenderer";
41
41
  import "@babylonjs/loaders/glTF/2.0/Extensions";
42
- var O = /* @__PURE__ */ ((a) => (a[a.Orbit = 0] = "Orbit", a[a.Pan = 1] = "Pan", a))(O || {}), E = /* @__PURE__ */ ((a) => (a.None = "None", a.RemoveWhenSelected = "RemoveWhenSelected", a.ApplyWhenSelected = "ApplyWhenSelected", a))(E || {});
43
- class De {
42
+ var R = /* @__PURE__ */ ((a) => (a[a.Orbit = 0] = "Orbit", a[a.Pan = 1] = "Pan", a))(R || {}), T = /* @__PURE__ */ ((a) => (a.None = "None", a.RemoveWhenSelected = "RemoveWhenSelected", a.ApplyWhenSelected = "ApplyWhenSelected", a))(T || {});
43
+ class ke {
44
44
  constructor(e) {
45
45
  this.getSceneClearColor = () => {
46
46
  var i, r, n, s;
@@ -91,7 +91,7 @@ class De {
91
91
  * Configuration related to the camera used to view and interact with the scene.
92
92
  */
93
93
  get camera() {
94
- var e, t, i, r, n, s, o, l, d, c, u, m, p;
94
+ var e, t, i, r, n, s, o, l, c, d, u, m, p;
95
95
  return {
96
96
  autoOrientation: ((e = this.customOptions) == null ? void 0 : e.disableAutomaticOrientation) ?? !0,
97
97
  autoRotation: {
@@ -105,7 +105,7 @@ class De {
105
105
  radius: (l = this.customOptions) == null ? void 0 : l.minZoomOverride
106
106
  },
107
107
  max: {
108
- alpha: (d = this.customOptions) != null && d.upperAlphaLimitDeg ? ((c = this.customOptions) == null ? void 0 : c.upperAlphaLimitDeg) * Math.PI / 180 : void 0,
108
+ alpha: (c = this.customOptions) != null && c.upperAlphaLimitDeg ? ((d = this.customOptions) == null ? void 0 : d.upperAlphaLimitDeg) * Math.PI / 180 : void 0,
109
109
  beta: (u = this.customOptions) != null && u.upperBetaLimitDeg ? ((m = this.customOptions) == null ? void 0 : m.upperBetaLimitDeg) * Math.PI / 180 : void 0,
110
110
  radius: (p = this.customOptions) == null ? void 0 : p.maxZoomOverride
111
111
  }
@@ -135,12 +135,12 @@ class De {
135
135
  return ((e = this.customOptions) == null ? void 0 : e.emissiveGlowIntensity) ?? 0.5;
136
136
  }
137
137
  }
138
- class P {
138
+ class M {
139
139
  /**
140
140
  * Returns the resolution expected for generated textures.
141
141
  */
142
142
  static getDynamicTextureResolution() {
143
- return this.getIsMobile() || !P.offscreenRenderingSupported() ? {
143
+ return this.getIsMobile() || !M.offscreenRenderingSupported() ? {
144
144
  width: 1024,
145
145
  height: 1024
146
146
  } : {
@@ -176,7 +176,7 @@ class P {
176
176
  }
177
177
  }
178
178
  }
179
- const ze = 128, h = {
179
+ const Ve = 128, h = {
180
180
  antiAliasing: {
181
181
  samples: 4,
182
182
  fxaaEnabled: !1
@@ -233,7 +233,7 @@ const ze = 128, h = {
233
233
  weight: 1
234
234
  }
235
235
  };
236
- class ke {
236
+ class Ne {
237
237
  constructor(e) {
238
238
  this.name = "glbPostProcessor", this.enabled = !0, this.loader = e;
239
239
  }
@@ -277,14 +277,14 @@ class ke {
277
277
  * @param babylonMaterial An instance of a material representation in babylon.
278
278
  */
279
279
  enableMaterialExtrasIfRequired(e, t) {
280
- if (!(!e.extras || !(t instanceof T))) {
280
+ if (!(!e.extras || !(t instanceof I))) {
281
281
  if (e.extras.sheen) {
282
282
  const i = t;
283
283
  i.sheen.isEnabled = !0, i.sheen.intensity = e.extras.sheen;
284
284
  }
285
285
  if (e.extras.translucency) {
286
286
  const i = t;
287
- i.subSurface.isTranslucencyEnabled = !0, i.subSurface.translucencyIntensity = e.extras.translucency, e.extras.translucencyR && e.extras.translucencyG && e.extras.translucencyB && (i.subSurface.tintColor = new ye(
287
+ i.subSurface.isTranslucencyEnabled = !0, i.subSurface.translucencyIntensity = e.extras.translucency, e.extras.translucencyR && e.extras.translucencyG && e.extras.translucencyB && (i.subSurface.tintColor = new Le(
288
288
  e.extras.translucencyR,
289
289
  e.extras.translucencyG,
290
290
  e.extras.translucencyB
@@ -322,32 +322,32 @@ class ke {
322
322
  const o = n.material;
323
323
  if (!o)
324
324
  return;
325
- const l = new Me(
325
+ const l = new xe(
326
326
  "mirror",
327
- P.getMirrorTextureResolution(),
327
+ M.getMirrorTextureResolution(),
328
328
  e,
329
329
  !0
330
330
  );
331
331
  l.renderList = t(e);
332
- const d = n.getVerticesData("normal");
333
- if (!d)
332
+ const c = n.getVerticesData("normal");
333
+ if (!c)
334
334
  throw new Error(
335
335
  "Mirror attribute specified on: " + n.name + "But no normals exist to generate a mirror from!"
336
336
  );
337
337
  n.computeWorldMatrix(!0);
338
- const c = n.getWorldMatrix(), u = ee.TransformNormal(
339
- new ee(d[0], d[1], d[2]),
340
- c
341
- ).normalize(), m = xe.FromPositionAndNormal(
338
+ const d = n.getWorldMatrix(), u = ie.TransformNormal(
339
+ new ie(c[0], c[1], c[2]),
340
+ d
341
+ ).normalize(), m = Ae.FromPositionAndNormal(
342
342
  n.position,
343
343
  u.scale(-1)
344
344
  );
345
345
  l.mirrorPlane = m, l.level = s, o.reflectionTexture = l;
346
346
  }
347
347
  function r(n) {
348
- const s = n.material, o = new Le(
348
+ const s = n.material, o = new Ee(
349
349
  "probe-" + s.name,
350
- ze,
350
+ Ve,
351
351
  e
352
352
  );
353
353
  o.attachToMesh(n), o.renderList && o.renderList.push(...t(e)), s.reflectionTexture = o.cubeTexture;
@@ -358,12 +358,12 @@ class ke {
358
358
  });
359
359
  }
360
360
  }
361
- class Ne {
361
+ class Ge {
362
362
  constructor(e, t) {
363
363
  this.scene = e, this.intensity = t, this.meshCount = 0;
364
364
  }
365
365
  includeMeshes(e) {
366
- this.glowLayer || (this.glowLayer = new Ae("glow", this.scene), this.glowLayer.intensity = this.intensity), e.forEach((t) => {
366
+ this.glowLayer || (this.glowLayer = new Oe("glow", this.scene), this.glowLayer.intensity = this.intensity), e.forEach((t) => {
367
367
  this.glowLayer.hasMesh(t) || (this.glowLayer.addIncludedOnlyMesh(t), this.meshCount++);
368
368
  });
369
369
  }
@@ -373,31 +373,31 @@ class Ne {
373
373
  }), this.meshCount === 0 && (this.glowLayer.dispose(), this.glowLayer = void 0));
374
374
  }
375
375
  }
376
- const se = /* @__PURE__ */ new Map();
377
- async function ue(a, e, t) {
376
+ const re = /* @__PURE__ */ new Map();
377
+ async function me(a, e, t) {
378
378
  return new Promise((i, r) => {
379
- const n = se.get(a);
379
+ const n = re.get(a);
380
380
  if (n && n.scene.uid === e.uid)
381
381
  return i(n);
382
- ce.LoadAssetContainerAsync(
382
+ ge.LoadAssetContainerAsync(
383
383
  a,
384
384
  void 0,
385
385
  e,
386
386
  t
387
387
  ).then((s) => {
388
- se.set(a, s), i(s);
388
+ re.set(a, s), i(s);
389
389
  }).catch(r);
390
390
  });
391
391
  }
392
- function Ve(a, e, t, i, r = "") {
392
+ function He(a, e, t, i, r = "") {
393
393
  t.forEach((n) => {
394
- const s = n.getID(), o = n.getName(), l = P.getDynamicTextureResolution();
395
- a.filter((c) => c.name === r + o).forEach((c) => {
394
+ const s = n.getID(), o = n.getName(), l = M.getDynamicTextureResolution();
395
+ a.filter((d) => d.name === r + o).forEach((d) => {
396
396
  const u = i.get(s), m = !1;
397
397
  if (u)
398
- ne(c, u), u.update(m);
398
+ ae(d, u), u.update(m);
399
399
  else {
400
- const p = Ge(
400
+ const p = _e(
401
401
  o,
402
402
  e,
403
403
  l.width,
@@ -405,26 +405,26 @@ function Ve(a, e, t, i, r = "") {
405
405
  );
406
406
  i.set(s, p), n.setStaticContext(
407
407
  p.getContext()
408
- ), ne(c, p), p.onLoadObservable.addOnce(() => {
408
+ ), ae(d, p), p.onLoadObservable.addOnce(() => {
409
409
  p.update(m);
410
410
  });
411
411
  }
412
412
  });
413
413
  });
414
414
  }
415
- function Ge(a, e, t, i) {
416
- const r = new Ee(
415
+ function _e(a, e, t, i) {
416
+ const r = new Ie(
417
417
  a,
418
418
  { width: t, height: i },
419
419
  e,
420
- P.shouldMipMap(),
421
- Te.TRILINEAR_SAMPLINGMODE,
422
- de.TEXTUREFORMAT_RGBA
420
+ M.shouldMipMap(),
421
+ Se.TRILINEAR_SAMPLINGMODE,
422
+ ue.TEXTUREFORMAT_RGBA
423
423
  ), n = r.getContext();
424
424
  return n && (n.fillStyle = "#f5f5f5", n.fillRect(0, 0, t, i), r.update()), r;
425
425
  }
426
- function ne(a, e) {
427
- if (a instanceof T) {
426
+ function ae(a, e) {
427
+ if (a instanceof I) {
428
428
  const t = a, i = t.albedoTexture;
429
429
  i ? (e.wrapU = i.wrapU, e.wrapV = i.wrapV) : (e.wrapU = 1, e.wrapV = 1), t.albedoTexture = e;
430
430
  } else {
@@ -432,15 +432,15 @@ function ne(a, e) {
432
432
  i && (e.wrapU = i.wrapU, e.wrapV = i.wrapV), t.diffuseTexture = e;
433
433
  }
434
434
  }
435
- function He() {
435
+ function qe() {
436
436
  const a = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
437
437
  return a() + a() + "-" + a() + "-" + a() + "-" + a() + "-" + a() + a() + a();
438
438
  }
439
- const C = 60, re = 1;
440
- function ae(a) {
439
+ const y = 60, oe = 1;
440
+ function le(a) {
441
441
  return a.targetedAnimations.map((t) => t.animation.framePerSecond).reduce((t, i) => t + i, 0) / a.targetedAnimations.length || 0;
442
442
  }
443
- function _e(a, e, t, i, r) {
443
+ function Ke(a, e, t, i, r) {
444
444
  const n = r ? a.filter((s) => s.name === r) : a;
445
445
  if (n.length === 0) {
446
446
  console.warn(`No animations found for name: ${r}`);
@@ -449,36 +449,36 @@ function _e(a, e, t, i, r) {
449
449
  if (i !== void 0 && t !== void 0 && i === t) {
450
450
  n.forEach((s) => {
451
451
  s.stop();
452
- const o = ae(s), l = i * o;
453
- s.start(e, re, l, l);
452
+ const o = le(s), l = i * o;
453
+ s.start(e, oe, l, l);
454
454
  });
455
455
  return;
456
456
  }
457
457
  n.forEach((s) => {
458
458
  s.stop();
459
- const o = ae(s), l = i !== void 0 ? i * o : void 0, d = t !== void 0 ? t * o : void 0;
460
- s.start(e, re, l, d);
459
+ const o = le(s), l = i !== void 0 ? i * o : void 0, c = t !== void 0 ? t * o : void 0;
460
+ s.start(e, oe, l, c);
461
461
  });
462
462
  }
463
- function ge(a) {
463
+ function pe(a) {
464
464
  a.forEach((e) => {
465
465
  e.stop();
466
466
  });
467
467
  }
468
- function qe(a) {
468
+ function Ue(a) {
469
469
  const e = a.animationGroups;
470
- ge(e);
470
+ pe(e);
471
471
  }
472
- function Ke(a, e, t) {
473
- a.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Ue(e.alpha, 0, 2 * Math.PI));
472
+ function We(a, e, t) {
473
+ a.stopAnimation(e), e.animations = [], Math.abs(e.alpha) > 2 * Math.PI && (e.alpha = Qe(e.alpha, 0, 2 * Math.PI));
474
474
  const i = [], r = t.target, n = 0, s = r ? 1 : 0;
475
475
  if (t.target && Object.keys(t.target).length > 0 && i.push(
476
- y(
476
+ x(
477
477
  "cameraTargetLerp",
478
478
  "target",
479
479
  new g().copyFrom(e.target),
480
480
  new g(
481
- -t.target.x,
481
+ t.target.x,
482
482
  t.target.y,
483
483
  t.target.z
484
484
  ),
@@ -486,31 +486,31 @@ function Ke(a, e, t) {
486
486
  n
487
487
  )
488
488
  ), i.push(
489
- y(
489
+ x(
490
490
  "cameraAlphaLerp",
491
491
  "alpha",
492
492
  e.alpha,
493
- oe(t.lonDeg),
493
+ he(t.lonDeg),
494
494
  v.ANIMATIONTYPE_FLOAT,
495
495
  s
496
496
  )
497
497
  ), i.push(
498
- y(
498
+ x(
499
499
  "cameraBetaLerp",
500
500
  "beta",
501
501
  e.beta,
502
- oe(t.latDeg),
502
+ he(t.latDeg),
503
503
  v.ANIMATIONTYPE_FLOAT,
504
504
  s
505
505
  )
506
506
  ), t.radius !== void 0) {
507
- const d = Math.max(0.01, t.radius);
507
+ const c = Math.max(0.01, t.radius);
508
508
  i.push(
509
- y(
509
+ x(
510
510
  "cameraRadiusLerp",
511
511
  "radius",
512
512
  e.radius,
513
- d,
513
+ c,
514
514
  v.ANIMATIONTYPE_FLOAT,
515
515
  s
516
516
  )
@@ -521,7 +521,7 @@ function Ke(a, e, t) {
521
521
  e.disableAutoRotationBehavior(), a.beginAnimation(
522
522
  e,
523
523
  0,
524
- r ? C * 2 : C,
524
+ r ? y * 2 : y,
525
525
  !1,
526
526
  1,
527
527
  () => {
@@ -529,28 +529,28 @@ function Ke(a, e, t) {
529
529
  }
530
530
  );
531
531
  }
532
- function oe(a) {
532
+ function he(a) {
533
533
  return a * Math.PI / 180;
534
534
  }
535
- function y(a, e, t, i, r, n = 0, s = v.ANIMATIONLOOPMODE_CONSTANT) {
536
- const o = new Ie();
537
- o.setEasingMode(Se.EASINGMODE_EASEINOUT);
535
+ function x(a, e, t, i, r, n = 0, s = v.ANIMATIONLOOPMODE_CONSTANT) {
536
+ const o = new Fe();
537
+ o.setEasingMode(Be.EASINGMODE_EASEINOUT);
538
538
  const l = new v(
539
539
  a,
540
540
  e,
541
- C,
541
+ y,
542
542
  r,
543
543
  s
544
- ), d = [];
545
- return n > 0 && d.push({ frame: 0, value: t }), d.push({ frame: C * n, value: t }), d.push({
546
- frame: C * (n + 1),
544
+ ), c = [];
545
+ return n > 0 && c.push({ frame: 0, value: t }), c.push({ frame: y * n, value: t }), c.push({
546
+ frame: y * (n + 1),
547
547
  value: i
548
- }), l.setKeys(d), l.setEasingFunction(o), l;
548
+ }), l.setKeys(c), l.setEasingFunction(o), l;
549
549
  }
550
- function Ue(a, e, t) {
550
+ function Qe(a, e, t) {
551
551
  return a < e ? a = t - (e - a) % (t - e) : a = e + (a - e) % (t - e);
552
552
  }
553
- const We = {
553
+ const Ze = {
554
554
  albedoTexture: "albedoMap",
555
555
  bumpTexture: "normalMap",
556
556
  ambientTexture: "ambientMap",
@@ -559,7 +559,7 @@ const We = {
559
559
  metallicTexture: "metallicMap",
560
560
  refractionTexture: "refractionMap"
561
561
  };
562
- function Ze(a, e, t, i) {
562
+ function $e(a, e, t, i) {
563
563
  [
564
564
  "albedoTexture",
565
565
  "bumpTexture",
@@ -569,32 +569,32 @@ function Ze(a, e, t, i) {
569
569
  "metallicTexture",
570
570
  "refractionTexture"
571
571
  ].forEach((n) => {
572
- $e(
572
+ Ye(
573
573
  n,
574
574
  a,
575
575
  e,
576
576
  t,
577
577
  i
578
578
  );
579
- }), je(a, e);
579
+ }), Je(a, e);
580
580
  }
581
- function $e(a, e, t, i, r) {
582
- const n = We[a];
581
+ function Ye(a, e, t, i, r) {
582
+ const n = Ze[a];
583
583
  if (!n)
584
584
  throw new Error("Unexpected texture name encountered.");
585
585
  const s = e[n], o = s == null ? void 0 : s.fileLink;
586
- o ? i.addTextureTask(a, o, !1, !1) : r && t[a] && (t[a] && t[a].dispose(), t[a] = null, Ye(a, t));
586
+ o ? i.addTextureTask(a, o, !1, !1) : r && t[a] && (t[a] && t[a].dispose(), t[a] = null, je(a, t));
587
587
  }
588
- function Ye(a, e) {
588
+ function je(a, e) {
589
589
  a === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !0), a === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !1, e.useMetallnessFromMetallicTextureBlue = !1), a === "refractionTexture" && (e.subSurface.isRefractionEnabled = !1, e.subSurface.refractionIntensity = 1), a === "emissiveTexture" && (e.emissiveIntensity = 0, e.emissiveColor = new w(0, 0, 0));
590
590
  }
591
- function Qe(a, e, t, i) {
591
+ function Xe(a, e, t, i) {
592
592
  a === "opacityTexture" && (e.useAlphaFromAlbedoTexture = !1), a === "metallicTexture" && (e.useRoughnessFromMetallicTextureAlpha = !1, e.useRoughnessFromMetallicTextureGreen = !0, e.useMetallnessFromMetallicTextureBlue = !0), a === "refractionTexture" && (e.subSurface.isRefractionEnabled = !0, e.subSurface.refractionIntensity = t.refractionIntensity || 1), e[a] = i, a === "emissiveTexture" && (e.emissiveColor = new w(1, 1, 1), e.emissiveIntensity = 1);
593
593
  }
594
- function je(a, e) {
595
- a.clearCoat && (a.clearCoat === E.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : a.clearCoat === E.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = a.clearCoatIOR || e.clearCoat.indexOfRefraction));
594
+ function Je(a, e) {
595
+ a.clearCoat && (a.clearCoat === T.RemoveWhenSelected ? (e.clearCoat.isEnabled = !1, e.clearCoat.indexOfRefraction = 1.5) : a.clearCoat === T.ApplyWhenSelected && (e.clearCoat.isEnabled = !0, e.clearCoat.indexOfRefraction = a.clearCoatIOR || e.clearCoat.indexOfRefraction));
596
596
  }
597
- class Xe {
597
+ class et {
598
598
  constructor(e, t, i) {
599
599
  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;
600
600
  }
@@ -615,27 +615,27 @@ class Xe {
615
615
  ...t
616
616
  });
617
617
  const o = this.renameClonedAsset(e), l = this.scene.materials.filter(
618
- (c) => c.name === o
618
+ (d) => d.name === o
619
619
  );
620
620
  if (l.length === 0) {
621
621
  n();
622
622
  return;
623
623
  }
624
- const d = new Fe(this.scene);
625
- d.useDefaultLoadingScreen = !1, l.forEach(
626
- (c) => Ze(
624
+ const c = new De(this.scene);
625
+ c.useDefaultLoadingScreen = !1, l.forEach(
626
+ (d) => $e(
627
627
  t,
628
- c,
629
628
  d,
629
+ c,
630
630
  r
631
631
  )
632
- ), d.onProgress = (c, u, m) => {
633
- i && i(c / u * 100, 100, m.name);
634
- }, d.onFinish = (c) => {
635
- c.forEach((u) => {
632
+ ), c.onProgress = (d, u, m) => {
633
+ i && i(d / u * 100, 100, m.name);
634
+ }, c.onFinish = (d) => {
635
+ d.forEach((u) => {
636
636
  const m = u;
637
637
  i && i(100, 100, u.name), l.forEach(
638
- (p) => Qe(
638
+ (p) => Xe(
639
639
  u.name,
640
640
  p,
641
641
  t,
@@ -643,7 +643,7 @@ class Xe {
643
643
  )
644
644
  );
645
645
  }), n();
646
- }, d.loadAsync();
646
+ }, c.loadAsync();
647
647
  });
648
648
  }
649
649
  /**
@@ -654,18 +654,18 @@ class Xe {
654
654
  * @param onProgress A load progress callback that can be used for loading bars and event timing.
655
655
  */
656
656
  async applyModel(e, t, i, r) {
657
- var l, d;
657
+ var l, c;
658
658
  if (i && t && !this.keysThatRemovedBaseModel.includes(e) && this.keysThatRemovedBaseModel.push(e), !i)
659
659
  return this.keysThatRemovedBaseModel.includes(e) && this.setBaseModelEnabled(!0), (l = this.loadedContainerForKey.get(e)) == null || l.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e), Promise.resolve(void 0);
660
- this.loadedContainerForKey.has(e) && ((d = this.loadedContainerForKey.get(e)) == null || d.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), t && this.setBaseModelEnabled(!1);
661
- const s = (await ue(i, this.scene, r)).instantiateModelsToScene(
660
+ this.loadedContainerForKey.has(e) && ((c = this.loadedContainerForKey.get(e)) == null || c.dispose(), this.loadedContainerForKey.delete(e), this.loadedMaterialsForKey.delete(e)), t && this.setBaseModelEnabled(!1);
661
+ const s = (await me(i, this.scene, r)).instantiateModelsToScene(
662
662
  this.renameClonedAsset,
663
663
  !0
664
664
  );
665
- this.loadedContainerForKey.set(e, s), this.loadedMaterialsForKey.set(e, me(s));
665
+ this.loadedContainerForKey.set(e, s), this.loadedMaterialsForKey.set(e, fe(s));
666
666
  const o = [];
667
- return this.materialVariantMap.forEach(async (c, u) => {
668
- o.push(this.applyMaterial(u, c));
667
+ return this.materialVariantMap.forEach(async (d, u) => {
668
+ o.push(this.applyMaterial(u, d));
669
669
  }), await Promise.all(o), s;
670
670
  }
671
671
  dispose() {
@@ -688,7 +688,7 @@ class Xe {
688
688
  }), e;
689
689
  }
690
690
  }
691
- function me(a) {
691
+ function fe(a) {
692
692
  const e = [];
693
693
  return a.rootNodes.forEach((t) => {
694
694
  t.getChildMeshes().forEach((i) => {
@@ -699,7 +699,7 @@ function me(a) {
699
699
  });
700
700
  }), e;
701
701
  }
702
- function le(a, e = "") {
702
+ function ce(a, e = "") {
703
703
  return a.map((t) => ({
704
704
  name: t.name.substring(e.length),
705
705
  loop: t.loopAnimation,
@@ -707,7 +707,7 @@ function le(a, e = "") {
707
707
  from: t.from
708
708
  }));
709
709
  }
710
- class Je {
710
+ class tt {
711
711
  constructor(e) {
712
712
  this.metadata = /* @__PURE__ */ new Map(), this.materialSelectedObservable = new b(), this.materialDeselectedObservable = new b(), this.materialVariantObservable = new b(), this.modelVariantObservable = new b(), 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.animations = [], this.initialized = !1, this.materials = [];
713
713
  const {
@@ -717,14 +717,14 @@ class Je {
717
717
  progressHandler: n,
718
718
  scene: s
719
719
  } = e;
720
- this.enablePicking = t, this.contextService = i.contextService, this.id = He(), this.previewService = r, this.scene = s, this.variantManager = new Xe(
720
+ this.enablePicking = t, this.contextService = i.contextService, this.id = qe(), this.previewService = r, this.scene = s, this.variantManager = new et(
721
721
  s,
722
722
  this.renameClonedAsset.bind(this),
723
723
  this.setEnabled.bind(this)
724
724
  ), this.previewService.registerInitializedListener(
725
725
  async () => await this.processQueuedEvents()
726
- ), this.transformRoot = new Oe("root", this.scene);
727
- const o = async () => (this.assetContainer = await ue(
726
+ ), this.transformRoot = new Te("root", this.scene);
727
+ const o = async () => (this.assetContainer = await me(
728
728
  i.model,
729
729
  s,
730
730
  n
@@ -836,7 +836,7 @@ class Je {
836
836
  1
837
837
  ), o;
838
838
  })();
839
- this.modelInstance && ge(this.modelInstance.animationGroups), this.contextService || (this.contextService = t == null ? void 0 : t.contextService), s ? this.configureModelInstance(s) : this.configureGlowLayer();
839
+ this.modelInstance && pe(this.modelInstance.animationGroups), this.contextService || (this.contextService = t == null ? void 0 : t.contextService), s ? this.configureModelInstance(s) : this.configureGlowLayer();
840
840
  }
841
841
  dispose() {
842
842
  var e;
@@ -847,7 +847,7 @@ class Je {
847
847
  this.queuedModelAnimation = e;
848
848
  return;
849
849
  }
850
- this.modelInstance && _e(
850
+ this.modelInstance && Ke(
851
851
  [
852
852
  ...this.modelInstance.animationGroups,
853
853
  ...this.variantManager.getAnimationGroups()
@@ -861,7 +861,7 @@ class Je {
861
861
  getAnimations(e) {
862
862
  return [
863
863
  ...this.animations,
864
- ...e ? le(
864
+ ...e ? ce(
865
865
  this.variantManager.getAnimationGroups(),
866
866
  this.renameClonedAsset("")
867
867
  ) : []
@@ -899,10 +899,14 @@ class Je {
899
899
  this.transformRoot.position = new g(e.x, e.y, e.z);
900
900
  }
901
901
  get rotation() {
902
- return this.transformRoot.rotation;
902
+ return this.transformRoot.rotationQuaternion.toEulerAngles();
903
903
  }
904
904
  set rotation(e) {
905
- this.transformRoot.rotation = new g(e.x, e.y, e.z);
905
+ this.transformRoot.rotationQuaternion = C.FromEulerAngles(
906
+ e.x,
907
+ e.y,
908
+ e.z
909
+ );
906
910
  }
907
911
  get scale() {
908
912
  return this.transformRoot.scaling;
@@ -915,15 +919,15 @@ class Je {
915
919
  attachPickingHandler(e) {
916
920
  e.rootNodes.forEach((t) => {
917
921
  t.getChildMeshes(!1).forEach((i) => {
918
- i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new L(this.scene)), i.actionManager.registerAction(
919
- new te(L.OnPointerOverTrigger, (r) => {
922
+ i.name === "targetcube_t" || i.name === "backgroundShell" || (i.actionManager || (i.actionManager = new A(this.scene)), i.actionManager.registerAction(
923
+ new se(A.OnPointerOverTrigger, (r) => {
920
924
  r.meshUnderPointer && i.material && this.materialSelectedObservable.notifyObservers({
921
925
  id: i.material.id,
922
926
  name: this.stripIdFromName(i.material.name)
923
927
  });
924
928
  })
925
929
  ), i.actionManager.registerAction(
926
- new te(L.OnPointerOutTrigger, () => {
930
+ new se(A.OnPointerOutTrigger, () => {
927
931
  i.material && this.materialDeselectedObservable.notifyObservers({
928
932
  id: i.material.id,
929
933
  name: this.stripIdFromName(i.material.name)
@@ -952,15 +956,15 @@ class Je {
952
956
  return this.modelReadyToLoadCallbacks.size;
953
957
  }
954
958
  configureGlowLayer() {
955
- const e = (i) => i instanceof T && i.emissiveTexture !== null;
959
+ const e = (i) => i instanceof I && i.emissiveTexture !== null;
956
960
  this.materials.some(e) || this.variantManager.getAllMaterials().some(e) ? this.previewService.getGlowLayerManager().includeMeshes(this.getAllMeshes()) : this.previewService.getGlowLayerManager().removeMeshes(this.getAllMeshes());
957
961
  }
958
962
  configureModelInstance(e) {
959
963
  var n;
960
- const t = this.transformRoot.position, i = this.transformRoot.rotation, r = this.transformRoot.scaling;
961
- this.transformRoot.position = g.Zero(), this.transformRoot.rotation = g.Zero(), this.transformRoot.scaling = g.One(), e.rootNodes.forEach((s) => {
964
+ const t = this.transformRoot.position, i = this.transformRoot.rotationQuaternion, r = this.transformRoot.scaling;
965
+ this.transformRoot.position = g.Zero(), this.transformRoot.rotationQuaternion = C.Identity(), this.transformRoot.scaling = g.One(), e.rootNodes.forEach((s) => {
962
966
  s.parent = this.transformRoot;
963
- }), this.transformRoot.position = t, this.transformRoot.rotation = i, this.transformRoot.scaling = r, this.canvasPanels = ((n = this.contextService) == null ? void 0 : n.getAll()) || /* @__PURE__ */ new Map(), Ve(
967
+ }), 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(
964
968
  this.materials.concat(this.variantManager.getAllMaterials()),
965
969
  this.scene,
966
970
  this.canvasPanels,
@@ -985,7 +989,7 @@ class Je {
985
989
  this.modelInstance = this.assetContainer.instantiateModelsToScene(
986
990
  this.renameClonedAsset.bind(this),
987
991
  !0
988
- ), this.materials = me(this.modelInstance), this.configureModelInstance(this.modelInstance), this.animations = le(
992
+ ), this.materials = fe(this.modelInstance), this.configureModelInstance(this.modelInstance), this.animations = ce(
989
993
  this.modelInstance.animationGroups,
990
994
  this.renameClonedAsset("")
991
995
  ), this.processQueuedEvents();
@@ -1035,7 +1039,7 @@ class Je {
1035
1039
  }
1036
1040
  //#endregion
1037
1041
  }
1038
- class I extends he {
1042
+ class S extends de {
1039
1043
  constructor(e, t, i, r, n, s, o, l) {
1040
1044
  super(
1041
1045
  e,
@@ -1072,7 +1076,7 @@ class I extends he {
1072
1076
  this.useFramingBehavior = !0;
1073
1077
  const e = this.getFramingBehavior();
1074
1078
  e.attach(this), e.framingTime = 0, e.elevationReturnTime = -1, e.zoomStopsAnimation = !1, this.lowerRadiusLimit = null;
1075
- const t = R(this._scene);
1079
+ const t = O(this._scene);
1076
1080
  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;
1077
1081
  }
1078
1082
  /**
@@ -1085,7 +1089,7 @@ class I extends he {
1085
1089
  i.framingTime = t || 800;
1086
1090
  const r = () => {
1087
1091
  e && e();
1088
- }, n = R(this._scene), s = n.max.subtract(n.min), o = n.min.add(s.scale(0.5));
1092
+ }, n = O(this._scene), s = n.max.subtract(n.min), o = n.min.add(s.scale(0.5));
1089
1093
  this.setRadius(s.length() * 1.5), this.wheelPrecision = 100 / this.radius, this.panningInertia = 0, this.panningOriginTarget.copyFrom(o), this.panDenominator = s.length(), i.zoomOnBoundingInfo(
1090
1094
  n.min,
1091
1095
  n.max,
@@ -1120,7 +1124,7 @@ class I extends he {
1120
1124
  * @param assignActive If true the camera will be assigned as the active camera on the scene.
1121
1125
  */
1122
1126
  static create(e, t, i) {
1123
- const r = R(e), n = r.max.subtract(r.min), s = r.min.add(n.scale(0.5)), o = new I(
1127
+ const r = O(e), n = r.max.subtract(r.min), s = r.min.add(n.scale(0.5)), o = new S(
1124
1128
  "ProductCamera",
1125
1129
  -(Math.PI / 2),
1126
1130
  Math.PI / 2,
@@ -1134,7 +1138,7 @@ class I extends he {
1134
1138
  }), i && (e.activeCamera = o), o;
1135
1139
  }
1136
1140
  }
1137
- function R(a) {
1141
+ function O(a) {
1138
1142
  if (a.meshes.length === 0)
1139
1143
  return {
1140
1144
  min: new g(-1, -1, -1),
@@ -1143,9 +1147,9 @@ function R(a) {
1143
1147
  const e = a.meshes.filter((t) => t.name.toLowerCase().endsWith("_t") || t.name.toLowerCase().includes("_t_"));
1144
1148
  return a.getWorldExtends((t) => t.isVisible && t.isEnabled() && (e.length === 0 || e.includes(t)));
1145
1149
  }
1146
- class et {
1150
+ class it {
1147
1151
  constructor(e, t = !1, i = void 0) {
1148
- this.renderingPipeline = new Be(
1152
+ this.renderingPipeline = new ze(
1149
1153
  "default",
1150
1154
  t,
1151
1155
  e,
@@ -1161,42 +1165,42 @@ class et {
1161
1165
  return this.currentConfiguration;
1162
1166
  }
1163
1167
  setConfiguration(e) {
1164
- var t, i, r, n, s, o, l, d, c, u, m, p, S, F, B, D, z, k, N, V, G, H, _, q, K, U, W, Z, $, Y, Q, j, X;
1168
+ var t, i, r, n, s, o, l, c, d, u, m, p, F, B, D, z, k, V, N, G, H, _, q, K, U, W, Q, Z, $, Y, j, X, J;
1165
1169
  if (this.renderingPipeline.isSupported) {
1166
- if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? h.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? h.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? h.bloom.enabled, this.renderingPipeline.bloomKernel = ((n = e.bloom) == null ? void 0 : n.kernel) ?? h.bloom.kernel, this.renderingPipeline.bloomScale = ((s = e.bloom) == null ? void 0 : s.scale) ?? h.bloom.scale, this.renderingPipeline.bloomThreshold = ((o = e.bloom) == null ? void 0 : o.threshold) ?? h.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? h.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((d = e.chromaticAberration) == null ? void 0 : d.enabled) ?? h.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((c = e.chromaticAberration) == null ? void 0 : c.aberrationAmount) ?? h.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((u = e.chromaticAberration) == null ? void 0 : u.radialIntensity) ?? h.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new J(
1170
+ if (this.renderingPipeline.samples = ((t = e.antiAliasing) == null ? void 0 : t.samples) ?? h.antiAliasing.samples, this.renderingPipeline.fxaaEnabled = ((i = e.antiAliasing) == null ? void 0 : i.fxaaEnabled) ?? h.antiAliasing.fxaaEnabled, this.renderingPipeline.bloomEnabled = ((r = e.bloom) == null ? void 0 : r.enabled) ?? h.bloom.enabled, this.renderingPipeline.bloomKernel = ((n = e.bloom) == null ? void 0 : n.kernel) ?? h.bloom.kernel, this.renderingPipeline.bloomScale = ((s = e.bloom) == null ? void 0 : s.scale) ?? h.bloom.scale, this.renderingPipeline.bloomThreshold = ((o = e.bloom) == null ? void 0 : o.threshold) ?? h.bloom.threshold, this.renderingPipeline.bloomWeight = ((l = e.bloom) == null ? void 0 : l.weight) ?? h.bloom.weight, this.renderingPipeline.chromaticAberrationEnabled = ((c = e.chromaticAberration) == null ? void 0 : c.enabled) ?? h.chromaticAberration.enabled, this.renderingPipeline.chromaticAberration.aberrationAmount = ((d = e.chromaticAberration) == null ? void 0 : d.aberrationAmount) ?? h.chromaticAberration.aberrationAmount, this.renderingPipeline.chromaticAberration.radialIntensity = ((u = e.chromaticAberration) == null ? void 0 : u.radialIntensity) ?? h.chromaticAberration.radialIntensity, this.renderingPipeline.chromaticAberration.direction = (m = e.chromaticAberration) != null && m.direction ? new ee(
1167
1171
  e.chromaticAberration.direction.x,
1168
1172
  e.chromaticAberration.direction.y
1169
- ) : new J(
1173
+ ) : new ee(
1170
1174
  h.chromaticAberration.direction.x,
1171
1175
  h.chromaticAberration.direction.y
1172
- ), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((p = e.colorCurves) == null ? void 0 : p.enabled) ?? h.colorCurves.enabled, this.renderingPipeline.imageProcessing.colorCurves = e.colorCurves ? this.updateColorCurve(e.colorCurves) : new ie(), this.renderingPipeline.depthOfFieldEnabled = ((S = e.depthOfField) == null ? void 0 : S.enabled) ?? h.depthOfField.enabled, e.depthOfField)
1176
+ ), this.renderingPipeline.imageProcessing.colorCurvesEnabled = ((p = e.colorCurves) == null ? void 0 : p.enabled) ?? h.colorCurves.enabled, this.renderingPipeline.imageProcessing.colorCurves = e.colorCurves ? this.updateColorCurve(e.colorCurves) : new ne(), this.renderingPipeline.depthOfFieldEnabled = ((F = e.depthOfField) == null ? void 0 : F.enabled) ?? h.depthOfField.enabled, e.depthOfField)
1173
1177
  switch (e.depthOfField.blurLevel ?? h.depthOfField.blurLevel) {
1174
1178
  case "Low":
1175
- this.renderingPipeline.depthOfFieldBlurLevel = A.Low;
1179
+ this.renderingPipeline.depthOfFieldBlurLevel = E.Low;
1176
1180
  break;
1177
1181
  case "Medium":
1178
- this.renderingPipeline.depthOfFieldBlurLevel = A.Medium;
1182
+ this.renderingPipeline.depthOfFieldBlurLevel = E.Medium;
1179
1183
  break;
1180
1184
  case "High":
1181
- this.renderingPipeline.depthOfFieldBlurLevel = A.High;
1185
+ this.renderingPipeline.depthOfFieldBlurLevel = E.High;
1182
1186
  break;
1183
1187
  }
1184
- if (this.renderingPipeline.depthOfField.focalLength = ((F = e.depthOfField) == null ? void 0 : F.focalLength) ?? h.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((B = e.depthOfField) == null ? void 0 : B.fStop) ?? h.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((D = e.depthOfField) == null ? void 0 : D.focusDistance) ?? h.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((z = e.depthOfField) == null ? void 0 : z.lensSize) ?? h.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((k = e.grain) == null ? void 0 : k.enabled) ?? h.grain.enabled, this.renderingPipeline.grain.animated = ((N = e.grain) == null ? void 0 : N.animated) ?? h.grain.animated, this.renderingPipeline.grain.intensity = ((V = e.grain) == null ? void 0 : V.intensity) ?? h.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((G = e.misc) == null ? void 0 : G.contrast) ?? h.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((H = e.misc) == null ? void 0 : H.exposure) ?? h.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((_ = e.misc) == null ? void 0 : _.toneMappingEnabled) ?? h.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1188
+ if (this.renderingPipeline.depthOfField.focalLength = ((B = e.depthOfField) == null ? void 0 : B.focalLength) ?? h.depthOfField.focalLength, this.renderingPipeline.depthOfField.fStop = ((D = e.depthOfField) == null ? void 0 : D.fStop) ?? h.depthOfField.fStop, this.renderingPipeline.depthOfField.focusDistance = ((z = e.depthOfField) == null ? void 0 : z.focusDistance) ?? h.depthOfField.focusDistance, this.renderingPipeline.depthOfField.lensSize = ((k = e.depthOfField) == null ? void 0 : k.lensSize) ?? h.depthOfField.lensSize, this.renderingPipeline.grainEnabled = ((V = e.grain) == null ? void 0 : V.enabled) ?? h.grain.enabled, this.renderingPipeline.grain.animated = ((N = e.grain) == null ? void 0 : N.animated) ?? h.grain.animated, this.renderingPipeline.grain.intensity = ((G = e.grain) == null ? void 0 : G.intensity) ?? h.grain.intensity, this.renderingPipeline.imageProcessing.contrast = ((H = e.misc) == null ? void 0 : H.contrast) ?? h.misc.contrast, this.renderingPipeline.imageProcessing.exposure = ((_ = e.misc) == null ? void 0 : _.exposure) ?? h.misc.exposure, this.renderingPipeline.imageProcessing.toneMappingEnabled = ((q = e.misc) == null ? void 0 : q.toneMappingEnabled) ?? h.misc.toneMappingEnabled, this.renderingPipeline.imageProcessing.toneMappingEnabled)
1185
1189
  switch (e.misc.toneMappingType ?? h.misc.toneMappingType) {
1186
1190
  case "Standard":
1187
- this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_STANDARD;
1191
+ this.renderingPipeline.imageProcessing.toneMappingType = P.TONEMAPPING_STANDARD;
1188
1192
  break;
1189
1193
  case "ACES":
1190
- this.renderingPipeline.imageProcessing.toneMappingType = M.TONEMAPPING_ACES;
1194
+ this.renderingPipeline.imageProcessing.toneMappingType = P.TONEMAPPING_ACES;
1191
1195
  break;
1192
1196
  }
1193
- if (this.renderingPipeline.sharpenEnabled = ((q = e.sharpen) == null ? void 0 : q.enabled) ?? h.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((K = e.sharpen) == null ? void 0 : K.colorAmount) ?? h.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((U = e.sharpen) == null ? void 0 : U.edgeAmount) ?? h.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((W = e.vignette) == null ? void 0 : W.enabled) ?? h.vignette.enabled, (Z = e.vignette) != null && Z.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = h.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = h.vignette.center.y), e.vignette)
1197
+ if (this.renderingPipeline.sharpenEnabled = ((K = e.sharpen) == null ? void 0 : K.enabled) ?? h.sharpen.enabled, this.renderingPipeline.sharpen.colorAmount = ((U = e.sharpen) == null ? void 0 : U.colorAmount) ?? h.sharpen.colorAmount, this.renderingPipeline.sharpen.edgeAmount = ((W = e.sharpen) == null ? void 0 : W.edgeAmount) ?? h.sharpen.edgeAmount, this.renderingPipeline.imageProcessing.vignetteEnabled = ((Q = e.vignette) == null ? void 0 : Q.enabled) ?? h.vignette.enabled, (Z = e.vignette) != null && Z.center ? (this.renderingPipeline.imageProcessing.vignetteCenterX = e.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = e.vignette.center.y) : (this.renderingPipeline.imageProcessing.vignetteCenterX = h.vignette.center.x, this.renderingPipeline.imageProcessing.vignetteCenterY = h.vignette.center.y), e.vignette)
1194
1198
  switch ((($ = e.vignette) == null ? void 0 : $.blendMode) ?? h.vignette.blendMode) {
1195
1199
  case "Multiply":
1196
- this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_MULTIPLY;
1200
+ this.renderingPipeline.imageProcessing.vignetteBlendMode = P.VIGNETTEMODE_MULTIPLY;
1197
1201
  break;
1198
1202
  case "Opaque":
1199
- this.renderingPipeline.imageProcessing.vignetteBlendMode = M.VIGNETTEMODE_OPAQUE;
1203
+ this.renderingPipeline.imageProcessing.vignetteBlendMode = P.VIGNETTEMODE_OPAQUE;
1200
1204
  break;
1201
1205
  }
1202
1206
  (Y = e.vignette) != null && Y.colorRgba ? this.renderingPipeline.imageProcessing.vignetteColor = new f(
@@ -1204,39 +1208,39 @@ class et {
1204
1208
  e.vignette.colorRgba.g,
1205
1209
  e.vignette.colorRgba.b,
1206
1210
  e.vignette.colorRgba.a
1207
- ) : (Q = e.vignette) != null && Q.colorHex ? this.renderingPipeline.imageProcessing.vignetteColor = f.FromHexString(e.vignette.colorHex) : this.renderingPipeline.imageProcessing.vignetteColor = new f(
1211
+ ) : (j = e.vignette) != null && j.colorHex ? this.renderingPipeline.imageProcessing.vignetteColor = f.FromHexString(e.vignette.colorHex) : this.renderingPipeline.imageProcessing.vignetteColor = new f(
1208
1212
  h.vignette.colorRgba.r,
1209
1213
  h.vignette.colorRgba.g,
1210
1214
  h.vignette.colorRgba.b,
1211
1215
  h.vignette.colorRgba.a
1212
- ), this.renderingPipeline.imageProcessing.vignetteStretch = ((j = e.vignette) == null ? void 0 : j.stretch) ?? h.vignette.stretch, this.renderingPipeline.imageProcessing.vignetteWeight = ((X = e.vignette) == null ? void 0 : X.weight) ?? h.vignette.weight, this.renderingPipeline.prepare(), this.currentConfiguration = e;
1216
+ ), this.renderingPipeline.imageProcessing.vignetteStretch = ((X = e.vignette) == null ? void 0 : X.stretch) ?? h.vignette.stretch, this.renderingPipeline.imageProcessing.vignetteWeight = ((J = e.vignette) == null ? void 0 : J.weight) ?? h.vignette.weight, this.renderingPipeline.prepare(), this.currentConfiguration = e;
1213
1217
  }
1214
1218
  }
1215
1219
  updateColorCurve(e) {
1216
- const t = new ie();
1220
+ const t = new ne();
1217
1221
  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;
1218
1222
  }
1219
1223
  }
1220
1224
  Pe.GLTFLoader.RegisterExtension("glbPostProcessor", function(a) {
1221
- return new ke(a);
1225
+ return new Ne(a);
1222
1226
  });
1223
- ce.OnPluginActivatedObservable.add((a) => {
1227
+ ge.OnPluginActivatedObservable.add((a) => {
1224
1228
  if (a.name === "gltf") {
1225
1229
  const e = a;
1226
1230
  e.transparencyAsCoverage = !0;
1227
1231
  }
1228
1232
  });
1229
- const x = "initialScene";
1230
- class _t {
1233
+ const L = "initialScene";
1234
+ class Kt {
1231
1235
  constructor(e) {
1232
1236
  this.loadProgress = /* @__PURE__ */ new Map([
1233
- [x, 0]
1234
- ]), this.focusLostNotified = !1, this.loadObservable = new b(), this.focusLostObservable = new b(), this.initializedCallbacks = [], this.isInitialized = !1, this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.configuration = new De(e);
1237
+ [L, 0]
1238
+ ]), this.focusLostNotified = !1, this.loadObservable = new b(), this.focusLostObservable = new b(), this.initializedCallbacks = [], this.isInitialized = !1, this.modelLoadEventCallbacks = [], this.modelContainers = /* @__PURE__ */ new Map(), this.plugins = [], this.configuration = new ke(e);
1235
1239
  const i = (() => {
1236
1240
  if (!(e != null && e.noRender))
1237
1241
  return this.configuration.createCanvas();
1238
1242
  })(), r = "1.5.6";
1239
- ve.Configuration = {
1243
+ Ce.Configuration = {
1240
1244
  decoder: {
1241
1245
  wasmUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_wasm_wrapper_gltf.js`,
1242
1246
  wasmBinaryUrl: `https://www.gstatic.com/draco/versioned/decoders/${r}/draco_decoder_gltf.wasm`,
@@ -1246,7 +1250,7 @@ class _t {
1246
1250
  const n = console.log;
1247
1251
  console.log = () => {
1248
1252
  };
1249
- const s = i ? new de(i, !0, {
1253
+ const s = i ? new ue(i, !0, {
1250
1254
  adaptToDeviceRatio: !0,
1251
1255
  limitDeviceRatio: 2,
1252
1256
  premultipliedAlpha: !1,
@@ -1254,12 +1258,12 @@ class _t {
1254
1258
  audioEngine: !1,
1255
1259
  stencil: this.configuration.highlights.enabled,
1256
1260
  forceSRGBBufferSupportState: !0
1257
- }) : new pe();
1258
- console.log = n, s.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = s, this.scene = new Ce(s), this.scene.useRightHandedSystem = !0, this.camera = I.create(this.scene, this.configuration), this.renderingPipeline = new et(
1261
+ }) : new be();
1262
+ console.log = n, s.hideLoadingUI(), window.addEventListener("resize", this.fireResizeEvent.bind(this)), this.engine = s, this.scene = new Me(s), this.camera = S.create(this.scene, this.configuration), this.renderingPipeline = new it(
1259
1263
  this.scene,
1260
1264
  !1,
1261
1265
  this.camera
1262
- ), this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast, this.glowLayerManager = new Ne(
1266
+ ), this.scene.imageProcessingConfiguration.exposure = this.configuration.lighting.exposure, this.scene.imageProcessingConfiguration.contrast = this.configuration.lighting.contrast, this.glowLayerManager = new Ge(
1263
1267
  this.scene,
1264
1268
  this.configuration.emissiveGlowIntensity
1265
1269
  );
@@ -1304,7 +1308,7 @@ class _t {
1304
1308
  }
1305
1309
  registerView(e) {
1306
1310
  const t = e.height, i = e.width;
1307
- this.engine.registerView(e), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(O.Pan), this.reattachControls(e);
1311
+ this.engine.registerView(e), e.setAttribute("height", t.toString()), e.setAttribute("width", i.toString()), this.orbitEnabled() || this.setCameraState(R.Pan), this.reattachControls(e);
1308
1312
  }
1309
1313
  getNumViewports() {
1310
1314
  var e;
@@ -1317,11 +1321,11 @@ class _t {
1317
1321
  this.plugins.forEach((e) => e.dispose(!0)), this.renderingPipeline.dispose(), this.engine && this.engine.dispose(), window.removeEventListener("resize", this.fireResizeEvent);
1318
1322
  }
1319
1323
  getSceneInitializationProgress() {
1320
- return this.loadProgress.get(x);
1324
+ return this.loadProgress.get(L);
1321
1325
  }
1322
1326
  async initialize(e) {
1323
1327
  var i, r;
1324
- this.scene.clearColor = this.configuration.scene.clearColor, this.scene.environmentTexture = be.CreateFromPrefilteredData(
1328
+ this.scene.clearColor = this.configuration.scene.clearColor, this.scene.environmentTexture = we.CreateFromPrefilteredData(
1325
1329
  this.configuration.scene.environmentFile,
1326
1330
  this.scene
1327
1331
  );
@@ -1330,11 +1334,11 @@ class _t {
1330
1334
  e,
1331
1335
  (s) => {
1332
1336
  this.loadProgress.set(
1333
- x,
1337
+ L,
1334
1338
  s.loaded * 100 / s.total
1335
1339
  ), this.notifyLoadHandlers();
1336
1340
  }
1337
- ).getInitializationPromise()), this.loadProgress.set(x, 100), this.notifyLoadHandlers(), this.scene.activeCamera = this.camera, this.camera.rerunFramingBehavior(void 0, 1), qe(this.scene), ((i = this.engine.views) == null ? void 0 : i.length) >= 1 && this.reattachControls(
1341
+ ).getInitializationPromise()), this.loadProgress.set(L, 100), this.notifyLoadHandlers(), this.scene.activeCamera = this.camera, this.camera.rerunFramingBehavior(void 0, 1), Ue(this.scene), ((i = this.engine.views) == null ? void 0 : i.length) >= 1 && this.reattachControls(
1338
1342
  this.engine.views[this.engine.views.length - 1].target
1339
1343
  ), this.queuedCameraAnimation && (this.executeCameraAnimation(this.queuedCameraAnimation), this.queuedCameraAnimation = void 0), this.isInitialized = !0, await Promise.all(this.initializedCallbacks.map((n) => n())), this.initializedCallbacks = [], (r = this.configuration.options) != null && r.renderingPipelineConfiguration && this.renderingPipeline.setConfiguration(
1340
1344
  this.configuration.options.renderingPipelineConfiguration
@@ -1357,7 +1361,7 @@ class _t {
1357
1361
  this.queuedCameraAnimation = e;
1358
1362
  return;
1359
1363
  }
1360
- Ke(
1364
+ We(
1361
1365
  this.scene,
1362
1366
  this.scene.activeCamera,
1363
1367
  e
@@ -1370,8 +1374,7 @@ class _t {
1370
1374
  latDeg: Math.round(this.camera.beta * 180 / Math.PI),
1371
1375
  radius: Math.round((this.camera.radius + Number.EPSILON) * 1e4) / 1e4,
1372
1376
  target: {
1373
- x: -this.camera.target.x,
1374
- // Negate x to match legacy behavior
1377
+ x: this.camera.target.x,
1375
1378
  y: this.camera.target.y,
1376
1379
  z: this.camera.target.z
1377
1380
  }
@@ -1390,7 +1393,7 @@ class _t {
1390
1393
  throw new Error(
1391
1394
  "No views attached, camera state requires a view to attach controls onto."
1392
1395
  );
1393
- e === O.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
1396
+ e === R.Orbit ? this.reattachControls(this.engine.views[0].target, 2) : this.reattachControls(this.engine.views[0].target, 0);
1394
1397
  }
1395
1398
  animateToLastCameraFocus() {
1396
1399
  return new Promise((e) => {
@@ -1414,7 +1417,7 @@ class _t {
1414
1417
  async renderSceneScreenshot(e, t) {
1415
1418
  if (!this.camera)
1416
1419
  throw new Error("Missing product camera, cannot render screenshot!");
1417
- const i = new he(
1420
+ const i = new de(
1418
1421
  "screenshotCamera",
1419
1422
  0,
1420
1423
  0,
@@ -1424,8 +1427,8 @@ class _t {
1424
1427
  );
1425
1428
  try {
1426
1429
  const r = t.latDeg * Math.PI / 180, n = t.lonDeg * Math.PI / 180;
1427
- 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, this.scene.render();
1428
- const s = await we.CreateScreenshotUsingRenderTargetAsync(
1430
+ 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, this.scene.render();
1431
+ const s = await ye.CreateScreenshotUsingRenderTargetAsync(
1429
1432
  this.engine,
1430
1433
  i,
1431
1434
  e,
@@ -1445,15 +1448,15 @@ class _t {
1445
1448
  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;
1446
1449
  if (t === void 0 || i === void 0 || r === void 0 || n === void 0)
1447
1450
  return !0;
1448
- const s = [t, i], o = [r, n], l = s.every((c) => c === t), d = o.every((c) => c === r);
1449
- return !l && !d;
1451
+ const s = [t, i], o = [r, n], l = s.every((d) => d === t), c = o.every((d) => d === r);
1452
+ return !l && !c;
1450
1453
  }
1451
1454
  fireResizeEvent() {
1452
1455
  this.getNumViewports() > 0 && this.engine.resize();
1453
1456
  }
1454
1457
  setHighlights(e, t) {
1455
1458
  var r;
1456
- e.length === 0 && ((r = this.highlightLayer) == null || r.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new fe("highlights", this.scene, {
1459
+ e.length === 0 && ((r = this.highlightLayer) == null || r.dispose(), this.highlightLayer = void 0), this.highlightLayer || (this.highlightLayer = new ve("highlights", this.scene, {
1457
1460
  isStroke: !0,
1458
1461
  blurVerticalSize: 0.85,
1459
1462
  blurHorizontalSize: 0.85
@@ -1478,7 +1481,7 @@ class _t {
1478
1481
  this.renderingPipeline && this.renderingPipeline.setConfiguration(e);
1479
1482
  }
1480
1483
  loadModel(e, t) {
1481
- const i = new Je({
1484
+ const i = new tt({
1482
1485
  enablePicking: this.configuration.highlights.enabled,
1483
1486
  modelDetails: e,
1484
1487
  scene: this.scene,
@@ -1531,6 +1534,40 @@ class _t {
1531
1534
  triggerModelLoadEvent(e) {
1532
1535
  this.modelLoadEventCallbacks.forEach((t) => t(e));
1533
1536
  }
1537
+ /**
1538
+ * Rotates a transform around the origin.
1539
+ * @param transform The transform to rotate. All values are optional and default to standard identity values.
1540
+ * @param axis The axis to rotate around. Defaults to the Y axis.
1541
+ * @param angle The angle to rotate by. Defaults to PI (180 degrees);
1542
+ */
1543
+ rotateAroundOrigin(e, t = { x: 0, y: 1, z: 0 }, i = Math.PI) {
1544
+ const {
1545
+ position: r = g.Zero(),
1546
+ rotation: n = g.Zero(),
1547
+ scale: s = g.One()
1548
+ } = e, o = te.Compose(
1549
+ this.toBabylonVector3(s),
1550
+ C.FromEulerVector(this.toBabylonVector3(n)),
1551
+ this.toBabylonVector3(r)
1552
+ ), l = te.RotationAxis(this.toBabylonVector3(t), i), c = o.multiply(l), d = g.Zero(), u = C.Identity(), m = g.Zero();
1553
+ return c.decompose(m, u, d), {
1554
+ position: this.fromBabylonVector3(d),
1555
+ rotation: this.fromBabylonVector3(u.toEulerAngles()),
1556
+ scale: this.fromBabylonVector3(m)
1557
+ };
1558
+ }
1559
+ vecToQuat(e) {
1560
+ return C.FromEulerVector(this.toBabylonVector3(e));
1561
+ }
1562
+ quatToVec(e) {
1563
+ return this.fromBabylonVector3(e.toEulerAngles());
1564
+ }
1565
+ toBabylonVector3(e) {
1566
+ return new g(e.x, e.y, e.z);
1567
+ }
1568
+ fromBabylonVector3(e) {
1569
+ return { x: e.x, y: e.y, z: e.z };
1570
+ }
1534
1571
  handleMaterialProgressCallback(e, t, i) {
1535
1572
  this.loadProgress.set(`key_${i}`, e / t * 100), this.notifyLoadHandlers();
1536
1573
  }
@@ -1571,10 +1608,10 @@ class _t {
1571
1608
  }
1572
1609
  }
1573
1610
  export {
1574
- E as MaterialEffectMode,
1575
- O as ProductCameraRig,
1576
- ze as REFLECTION_PROBE_RESOLUTION,
1577
- P as RenderingConfiguration,
1578
- _t as SpiffCommerce3DPreviewService,
1611
+ T as MaterialEffectMode,
1612
+ R as ProductCameraRig,
1613
+ Ve as REFLECTION_PROBE_RESOLUTION,
1614
+ M as RenderingConfiguration,
1615
+ Kt as SpiffCommerce3DPreviewService,
1579
1616
  h as renderingPipelineDefaults
1580
1617
  };