@epigraph/solutions 1.0.20 → 1.0.22

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.
@@ -13194,7 +13194,7 @@ ${r.join(`
13194
13194
  width: 100%;
13195
13195
  height: 100%;
13196
13196
  pointer-events: none;
13197
- z-index: 10;
13197
+ z-index: 7;
13198
13198
  }
13199
13199
 
13200
13200
  .dimensions-label {
@@ -13625,7 +13625,7 @@ ${r.join(`
13625
13625
  pointer-events: none;
13626
13626
  transition: opacity 0.5s ease;
13627
13627
  opacity: 1;
13628
- z-index: 9999;
13628
+ z-index: 9;
13629
13629
  }
13630
13630
 
13631
13631
  .tooltip.right {
@@ -13706,7 +13706,7 @@ ${r.join(`
13706
13706
  :host(.hover) {
13707
13707
  background-color: unset;
13708
13708
  cursor: pointer;
13709
- z-index: 999;
13709
+ z-index: 9;
13710
13710
  opacity: 1 !important;
13711
13711
 
13712
13712
  .hotspot-center-circle {
@@ -14169,7 +14169,7 @@ ${r.join(`
14169
14169
  align-items: center;
14170
14170
  opacity: 1;
14171
14171
  transition: opacity 0.3s ease;
14172
- z-index: 9;
14172
+ z-index: 2;
14173
14173
  }
14174
14174
 
14175
14175
  .video-controls.playing {
@@ -14367,7 +14367,7 @@ ${r.join(`
14367
14367
  padding: 8px 16px;
14368
14368
  height: 30px;
14369
14369
  box-sizing: border-box;
14370
- z-index: 10;
14370
+ z-index: 9;
14371
14371
  }
14372
14372
 
14373
14373
  :host([hide-pagination]) ::part(pagination) {
@@ -16102,7 +16102,7 @@ ${r.join(`
16102
16102
  height: 100%;
16103
16103
  pointer-events: none;
16104
16104
  }
16105
- `]}static setupWebComponent(){window.customElements.get(rf.webComponentName)||window.customElements.define(rf.webComponentName,rf)}firstUpdated(e){super.firstUpdated(e),this.__setupEventListeners()}addHotspot(e,t=!0){const n=new px({config:e,appWcRef:this.appWcRef,hotspotManagerRef:this});if(n.hidden)return;this.hotspots.set(n.hotspotId,n);const i=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);i&&i.addHotspot(n),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}updateHotspot(e,t){const n=this.hotspots.get(e);if(!n){window.epigraph.logger.error({title:`Invalid hotspot ID: ${e}`});return}n.updateConfig(t),this.__resolveHotspotCardContents()}removeHotspot(e,t=!0){this.hotspots.delete(e),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}stepHotspots(e){const t=this.activeHotspotIndex;if(t===null)return;const n=this.hotspotsOrder.length;let i=t;e==="next"?(i=t+1,i>=n&&(i=0)):e==="prev"&&(i=t-1,i<0&&(i=n-1));const r=this.hotspotsOrder[i];this.setActiveHotspot({hotspotId:r})}nextHotspot(){return this.stepHotspots("next"),this.appWcRef.eventsManager.hotspotNextEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}previousHotspot(){return this.stepHotspots("prev"),this.appWcRef.eventsManager.hotspotPreviousEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:n=!1}){this.appWcRef.playInteractionPrompt=!1,this.setActiveHotspot({hotspotId:e,state:t}),n||this.appWcRef.eventsManager.hotspotOpenEvent.fire({hotspot:this.activeHotspot});const i=new Hr(!0,Hr.PANEL_TYPE.HOTSPOT_PANEL,Hr.TRIGGER_SOURCE.HOTSPOT,[]);this.appWcRef.epigraphAnalytics.sendEvent(i)}closeActiveHotspot(){const e=this.activeHotspot?.hotspotId;this.setActiveHotspot({hotspotId:null}),this.appWcRef.eventsManager.hotspotClosedEvent.fire({hotspotId:e});const t=new $r(!0,$r.PANEL_TYPE.HOTSPOT_PANEL,$r.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(t)}updateHotspotsOrder(e){this.hotspotsOrder=e}removeAllHotspots(){for(const e of this.hotspots.keys())this.removeHotspot(e)}setActiveHotspotByIndex(e){const t=this.hotspotsOrder[e];this.setActiveHotspot({hotspotId:t})}updateActiveHotspotIndex(){this.activeHotspot?this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotId):this.activeHotspotIndex=-1}setActiveHotspotState(e){this.__mobileHotspotCardsManager.setAttribute("cards-state",e)}setActiveHotspot({hotspotId:e,state:t=this.__mobileHotspotCardsManager.cardsState??$n.collapsed}){if(this.activeHotspot?.hotspotId===e)return;const{x:n,y:i,z:r}=this.__cameraOffsetApplied;if((n!==0||i!==0||r!==0)&&(this.appWcRef.cameraManager.mainCameraControls.setFocalOffset(0,0,0,!0),this.__cameraOffsetApplied.x=0,this.__cameraOffsetApplied.y=0,this.__cameraOffsetApplied.z=0),e===null){const l=!!this.activeHotspot;this.activeHotspot=void 0,this.updateActiveHotspotIndex(),l&&this.appWcRef.cameraManager.resetCurrentCameraTransformsToLastSavedState();return}this.enabled===!1&&(this.enabled=!0);const a=!this.activeHotspot;if(this.activeHotspot=this.hotspots.get(e),this.activeHotspot===void 0)return;this.updateActiveHotspotIndex(),this.setActiveHotspotState(t),this.__resolveHotspotCardContents();let o=this.activeHotspot.camera;if(this.activeHotspot?.camera.target.x===9999.9999&&(o=JSON.parse(JSON.stringify(o)),o.target=this.appWcRef.sceneManager.currentSceneCenter,this.appWcRef.cameraManager.mainCameraControls.setFocalOffset(-.5,0,0,!0),this.__cameraOffsetApplied.x=-.5),this.appWcRef.eventsManager.cameraMoveToTransform.fire({cameraTransforms:o,saveFirst:a,ignoreCameraLimits:!0}),this.appWcRef.isPortraitOrientation){const l=this.appWcRef.cameraManager.mainCameraControls,c=new Q;l.getTarget(c,!0);const h=new Q;l.getPosition(h,!0),l.setLookAt(h.x-c.x,h.y,h.z-c.z,0,c.y,0,!0),l.setFocalOffset(0,.1,0,!0),this.__cameraOffsetApplied.y=.1}this.activeHotspot.visited=!0,window.addEventListener("keydown",l=>{l.key==="Escape"&&this.closeActiveHotspot()},{once:!0})}__resolveHotspotCardContents(){this.__allCards=[];let e=0;const t=this.hotspots.size-1,n=this.hotspots.size>1,i=this.appWcRef.productSettings.hotspots.showNavigationButtons;for(const r of this.hotspots.values()){const a=e===0,o=e===t,l=ae`
16105
+ `]}static setupWebComponent(){window.customElements.get(rf.webComponentName)||window.customElements.define(rf.webComponentName,rf)}firstUpdated(e){super.firstUpdated(e),this.__isPortrait=this.appWcRef.isPortraitOrientation,this.__setupEventListeners()}addHotspot(e,t=!0){const n=new px({config:e,appWcRef:this.appWcRef,hotspotManagerRef:this});if(n.hidden)return;this.hotspots.set(n.hotspotId,n);const i=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);i&&i.addHotspot(n),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}updateHotspot(e,t){const n=this.hotspots.get(e);if(!n){window.epigraph.logger.error({title:`Invalid hotspot ID: ${e}`});return}n.updateConfig(t),this.__resolveHotspotCardContents()}removeHotspot(e,t=!0){this.hotspots.delete(e),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}stepHotspots(e){const t=this.activeHotspotIndex;if(t===null)return;const n=this.hotspotsOrder.length;let i=t;e==="next"?(i=t+1,i>=n&&(i=0)):e==="prev"&&(i=t-1,i<0&&(i=n-1));const r=this.hotspotsOrder[i];this.setActiveHotspot({hotspotId:r})}nextHotspot(){return this.stepHotspots("next"),this.appWcRef.eventsManager.hotspotNextEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}previousHotspot(){return this.stepHotspots("prev"),this.appWcRef.eventsManager.hotspotPreviousEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:n=!1}){this.appWcRef.playInteractionPrompt=!1,this.setActiveHotspot({hotspotId:e,state:t}),n||this.appWcRef.eventsManager.hotspotOpenEvent.fire({hotspot:this.activeHotspot});const i=new Hr(!0,Hr.PANEL_TYPE.HOTSPOT_PANEL,Hr.TRIGGER_SOURCE.HOTSPOT,[]);this.appWcRef.epigraphAnalytics.sendEvent(i)}closeActiveHotspot(){const e=this.activeHotspot?.hotspotId;this.setActiveHotspot({hotspotId:null}),this.appWcRef.eventsManager.hotspotClosedEvent.fire({hotspotId:e});const t=new $r(!0,$r.PANEL_TYPE.HOTSPOT_PANEL,$r.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(t)}updateHotspotsOrder(e){this.hotspotsOrder=e}removeAllHotspots(){for(const e of this.hotspots.keys())this.removeHotspot(e)}setActiveHotspotByIndex(e){const t=this.hotspotsOrder[e];this.setActiveHotspot({hotspotId:t})}updateActiveHotspotIndex(){this.activeHotspot?this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotId):this.activeHotspotIndex=-1}setActiveHotspotState(e){this.__mobileHotspotCardsManager.setAttribute("cards-state",e)}setActiveHotspot({hotspotId:e,state:t=this.__mobileHotspotCardsManager.cardsState??$n.collapsed}){if(this.activeHotspot?.hotspotId===e)return;const{x:n,y:i,z:r}=this.__cameraOffsetApplied;if((n!==0||i!==0||r!==0)&&(this.appWcRef.cameraManager.mainCameraControls.setFocalOffset(0,0,0,!0),this.__cameraOffsetApplied.x=0,this.__cameraOffsetApplied.y=0,this.__cameraOffsetApplied.z=0),e===null){const l=!!this.activeHotspot;this.activeHotspot=void 0,this.updateActiveHotspotIndex(),l&&this.appWcRef.cameraManager.resetCurrentCameraTransformsToLastSavedState();return}this.enabled===!1&&(this.enabled=!0);const a=!this.activeHotspot;if(this.activeHotspot=this.hotspots.get(e),this.activeHotspot===void 0)return;this.updateActiveHotspotIndex(),this.setActiveHotspotState(t),this.__resolveHotspotCardContents();let o=this.activeHotspot.camera;if(this.activeHotspot?.camera.target.x===9999.9999&&(o=JSON.parse(JSON.stringify(o)),o.target=this.appWcRef.sceneManager.currentSceneCenter,this.appWcRef.cameraManager.mainCameraControls.setFocalOffset(-.5,0,0,!0),this.__cameraOffsetApplied.x=-.5),this.appWcRef.eventsManager.cameraMoveToTransform.fire({cameraTransforms:o,saveFirst:a,ignoreCameraLimits:!0}),this.appWcRef.isPortraitOrientation){const l=this.appWcRef.cameraManager.mainCameraControls,c=new Q;l.getTarget(c,!0);const h=new Q;l.getPosition(h,!0),l.setLookAt(h.x-c.x,h.y,h.z-c.z,0,c.y,0,!0),l.setFocalOffset(0,.1,0,!0),this.__cameraOffsetApplied.y=.1}this.activeHotspot.visited=!0,window.addEventListener("keydown",l=>{l.key==="Escape"&&this.closeActiveHotspot()},{once:!0})}__resolveHotspotCardContents(){this.__allCards=[];let e=0;const t=this.hotspots.size-1,n=this.hotspots.size>1,i=this.appWcRef.productSettings.hotspots.showNavigationButtons;for(const r of this.hotspots.values()){const a=e===0,o=e===t,l=ae`
16106
16106
  <swiper-slide part="swiper-slide">
16107
16107
  <style>
16108
16108
  .expand-button {
@@ -17483,7 +17483,7 @@ void main() {
17483
17483
  user-select: none;
17484
17484
  margin-left: 4px !important;
17485
17485
  -webkit-user-select: none;
17486
- z-index: 8;
17486
+ z-index: 7;
17487
17487
  }
17488
17488
 
17489
17489
  .lil-gui, .lil-gui * {
@@ -17999,7 +17999,7 @@ void main() {
17999
17999
  }
18000
18000
 
18001
18001
  .hotspots-manager {
18002
- z-index: 9;
18002
+ z-index: 6;
18003
18003
  }
18004
18004
 
18005
18005
  .debug-manager {
@@ -18013,13 +18013,13 @@ void main() {
18013
18013
  left: 50%;
18014
18014
  top: 50%;
18015
18015
  transform: translate(-50%, -50%);
18016
- z-index: 10;
18016
+ z-index: 7;
18017
18017
  }
18018
18018
 
18019
18019
  .splash-screen {
18020
18020
  position: absolute;
18021
18021
  background-color: white;
18022
- z-index: 13;
18022
+ z-index: 9;
18023
18023
  top: 0;
18024
18024
  left: 0;
18025
18025
  right: 0;
@@ -18037,7 +18037,7 @@ void main() {
18037
18037
  padding: inherit;
18038
18038
  align-items: flex-start;
18039
18039
  transition: opacity 0.5s;
18040
- z-index: 12;
18040
+ z-index: 6;
18041
18041
  }
18042
18042
 
18043
18043
  .toolset.hide {
@@ -18070,6 +18070,7 @@ void main() {
18070
18070
  transition: opacity 0.5s;
18071
18071
  position: absolute;
18072
18072
  pointer-events: auto;
18073
+ z-index: 6;
18073
18074
  }
18074
18075
 
18075
18076
  .powered-by-epigraph-button.hide {
@@ -18205,7 +18206,7 @@ void main() {
18205
18206
  .loadingLogoSrc=${this.splashScreenLogo}
18206
18207
  .loadingLabel=${this.splashScreenText}
18207
18208
  ></epg-loader-scene>
18208
- `}async _resetSession(){this._autoGeneratedProxyMesh?.scale.set(1,1,1),this._autoGeneratedProxyMesh?.position.set(0,0,0),this._autoGeneratedProxyMesh?.updateMatrixWorld(),await this.renderEngine.emptyScene()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.eventsManager.sceneBoundsChanged.name,()=>{this.cameraManager.fitCameraToSceneBounds()}),this.addEventListener(this.eventsManager.structureNodeAddedEvent.name,()=>{this._onSceneHierarchyUpdate()}),this.addEventListener(this.eventsManager.experienceUpdatedEvent.name,()=>{this.renderEngine.accumulativeShadows&&!this.renderEngine.accumulativeShadows.camera&&(this.renderEngine.accumulativeShadows.camera=this.cameraManager.getCameras().main),this.renderEngine.accumulativeShadows?.reset(),this.renderEngine.contactShadows&&this.renderEngine.contactShadows.updateSettings(this.productSettings.shadows.contactShadows),this.cameraManager.updateCameraSettings(this.productSettings.camera),this.productSettings.camera.initial&&this.cameraManager.moveCameraToLocation({newCameraTransforms:this.productSettings.camera.initial,transition:!0})}),this.addEventListener(this.eventsManager.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.eventsManager.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="grabbing");break;case"pan":(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="move"),this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.sessionState==="default"&&this.hotspotsManager.closeActiveHotspot()})),this.addEventListener(this.eventsManager.inputEnd.name,()=>{(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="grab"),this.hideCameraAim()}),this.addEventListener(this.eventsManager.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.eventsManager.assetLoadProgress.name,(e=>{this._loadingProgress=e.detail.progress})),this.addEventListener(this.eventsManager.hotspotOpenEvent.name,(e=>{this._hasActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot)})),this.addEventListener(this.eventsManager.hotspotNextEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot)})),this.addEventListener(this.eventsManager.hotspotPreviousEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot)})),this.addEventListener(this.eventsManager.hotspotClosedEvent.name,(e=>{this._hasActiveHotspot=!1;const t=this.hotspotsManager.hotspots.get(e.detail.hotspotId),n=t?.animation,i=t?.assetId;if(!n||!i)return;const r=n.loop,a=n.exit;r&&this.stopAnimationByNameAndAssetId(r,i);let o;a?o=this.playAnimationByNameAndAssetId({animationName:a,assetId:i}):o=this.playAnimationByNameAndAssetId({animationName:n.entry,assetId:i,reverse:!0}),setTimeout(()=>{o?.targetAnimationAction.reset(),this._activeAnimations.delete(o?.animationName??"")},this._animationFadeDurationInMiliseconds)})),this.appCanvasContainerElemRef.onpointerdown=e=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp(),this.eventsManager.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.eventsManager.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.eventsManager.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.eventsManager.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this)),this.hotspotsManager?.addEventListener("pointerdown",()=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp()})}_onCameraPositionUpdate(){this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new xs,t=new Un({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new je(e,t)}get productSettings(){return this._productSettings}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._eventsManager=new NW(this),this._sceneManager=new FV(this),this._sceneManager.initialize(),this._cameraManager=new zf({appWcRef:this}),this._cameraManager.initialize();const e=this._sceneManager.sceneStructure.setupRootEntity().catch(t=>{this.onLoadFailed(T0.SCENE_LOAD_ERROR,t)});await this.setupRenderEngine(),await e,await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.productSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners(),this._setupVisibilityObserver()}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();const t=e.animation,n=e.assetId;if(!t||!n)return;this._activeAnimations.get(t.entry)||this.playAnimationByNameAndAssetId({animationName:t.entry,assetId:n,clampWhenFinished:!0}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByNameAndAssetId({animationName:t.loop,assetId:n,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=me;return this.featuresToEnable.dimensions&&(I5.setupWebComponent(),e=ae`
18209
+ `}async _resetSession(){this._autoGeneratedProxyMesh?.scale.set(1,1,1),this._autoGeneratedProxyMesh?.position.set(0,0,0),this._autoGeneratedProxyMesh?.updateMatrixWorld(),await this.renderEngine.emptyScene()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.eventsManager.sceneBoundsChanged.name,()=>{this.cameraManager.fitCameraToSceneBounds()}),this.addEventListener(this.eventsManager.structureNodeAddedEvent.name,()=>{this._onSceneHierarchyUpdate()}),this.addEventListener(this.eventsManager.experienceUpdatedEvent.name,()=>{this.renderEngine.accumulativeShadows&&!this.renderEngine.accumulativeShadows.camera&&(this.renderEngine.accumulativeShadows.camera=this.cameraManager.getCameras().main),this.renderEngine.accumulativeShadows?.reset(),this.renderEngine.contactShadows&&this.renderEngine.contactShadows.updateSettings(this.productSettings.shadows.contactShadows),this.cameraManager.updateCameraSettings(this.productSettings.camera),this.productSettings.camera.initial&&this.cameraManager.moveCameraToLocation({newCameraTransforms:this.productSettings.camera.initial,transition:!0}).then(()=>{this.productSettings.camera.initial?.skipCameraFit||this.cameraManager.fitCameraToSceneBounds()})}),this.addEventListener(this.eventsManager.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.eventsManager.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="grabbing");break;case"pan":(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="move"),this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.sessionState==="default"&&this.hotspotsManager.closeActiveHotspot()})),this.addEventListener(this.eventsManager.inputEnd.name,()=>{(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="grab"),this.hideCameraAim()}),this.addEventListener(this.eventsManager.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.eventsManager.assetLoadProgress.name,(e=>{this._loadingProgress=e.detail.progress})),this.addEventListener(this.eventsManager.hotspotOpenEvent.name,(e=>{this._hasActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot)})),this.addEventListener(this.eventsManager.hotspotNextEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot)})),this.addEventListener(this.eventsManager.hotspotPreviousEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot)})),this.addEventListener(this.eventsManager.hotspotClosedEvent.name,(e=>{this._hasActiveHotspot=!1;const t=this.hotspotsManager.hotspots.get(e.detail.hotspotId),n=t?.animation,i=t?.assetId;if(!n||!i)return;const r=n.loop,a=n.exit;r&&this.stopAnimationByNameAndAssetId(r,i);let o;a?o=this.playAnimationByNameAndAssetId({animationName:a,assetId:i}):o=this.playAnimationByNameAndAssetId({animationName:n.entry,assetId:i,reverse:!0}),setTimeout(()=>{o?.targetAnimationAction.reset(),this._activeAnimations.delete(o?.animationName??"")},this._animationFadeDurationInMiliseconds)})),this.appCanvasContainerElemRef.onpointerdown=e=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp(),this.eventsManager.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.eventsManager.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.eventsManager.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.eventsManager.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this)),this.hotspotsManager?.addEventListener("pointerdown",()=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp()})}_onCameraPositionUpdate(){this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new xs,t=new Un({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new je(e,t)}get productSettings(){return this._productSettings}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._eventsManager=new NW(this),this._sceneManager=new FV(this),this._sceneManager.initialize(),this._cameraManager=new zf({appWcRef:this}),this._cameraManager.initialize();const e=this._sceneManager.sceneStructure.setupRootEntity().catch(t=>{this.onLoadFailed(T0.SCENE_LOAD_ERROR,t)});await this.setupRenderEngine(),await e,await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.productSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners()}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();const t=e.animation,n=e.assetId;if(!t||!n)return;this._activeAnimations.get(t.entry)||this.playAnimationByNameAndAssetId({animationName:t.entry,assetId:n,clampWhenFinished:!0}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByNameAndAssetId({animationName:t.loop,assetId:n,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=me;return this.featuresToEnable.dimensions&&(I5.setupWebComponent(),e=ae`
18209
18210
  <dimensions-manager
18210
18211
  id="dimensionsManager"
18211
18212
  .appWcRef=${this}
@@ -18245,7 +18246,7 @@ void main() {
18245
18246
  <div class="view-in-your-space-button ${this._hasActiveHotspot?"hide":""}">
18246
18247
  <slot name=${af.slotCustomViewInYourSpaceButton.name} @click=${this.launchAR}></slot>
18247
18248
  </div>
18248
- `}getAllHotspotsFromScene(){const e=[];return this.sceneManager.sceneStructure.traverse(t=>{if(t instanceof Al)for(const n of t.asset.hotspots)this.hotspotsManager.addHotspot(n,!1)}),e}_repopulateHotspots(){window.epigraph.logger.info({title:"Override to repopulate hotspots in scene on identifier changes"}),this.featuresToEnable.hotspots===!0&&this.hotspotsManager&&(this.hotspotsManager.removeAllHotspots(),this.getAllHotspotsFromScene(),this.updateHotspotsOrder(Array.from(this.hotspotsManager.hotspots.keys())))}_setupAnalytics(){this._isDevEnv||this._isStagingEnv||(this._nexusAnalyticsPlugin=new cD({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:this._isDevEnv,sendToStaging:this._isStagingEnv}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new lD({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:this._isDevEnv}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin)))}__onWebComponentResize(){if(!this.appCanvasContainerElemRef)return;const{width:e,height:t}=this.appCanvasContainerElemRef.getBoundingClientRect();if(!(e===0||t===0)){if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.textRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const n=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.getCameras().main.aspect=n,this.cameraManager.getCameras().main.updateProjectionMatrix(),this.cameraManager.getCameras().screenshot.aspect=n,this.cameraManager.getCameras().screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToSceneBounds(!1),this.isPortraitOrientation=e<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta()),this.eventsManager.webComponentResized.fire()}}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupVisibilityObserver(){new IntersectionObserver(()=>{this.isAppReady&&(window.epigraph.logger.info({title:"Component became visible, re-calculating scene hierarchy.",contextOverride:this._loggerContext}),this._onSceneHierarchyUpdate(),this.productSettings.camera.initial&&this.cameraManager.moveCameraToLocation({newCameraTransforms:this.productSettings.camera.initial,transition:!0}))}).observe(this)}_setupResizeObservers(){new ResizeObserver(t=>{for(const n of t){const{width:i,height:r}=n.target.getBoundingClientRect(),a=i*.5,o=r*.5;if(a>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const l=this.toolsetElem?.getBoundingClientRect();if(!l)continue;const c=l.width>a,h=l.height>o;this._isToolsetLargerThanTheLeftBottomQuadrant=c||h}}}).observe(this)}async _postExperienceDataInitialization(){if(!this._identifier||!this._identifierType)return Promise.resolve(!0);if(this.productSettings.render.mode===ga.SPLAT&&this._renderEngine.sparkRenderer){const{preBlurAmount:i,blurAmount:r}=this.productSettings.render.splatMode;this._renderEngine.sparkRenderer.preBlurAmount=i,this._renderEngine.sparkRenderer.blurAmount=r}const e=this._experienceData.productVariantCollection.getProductVariantByIdentifierAndType(this._identifier,this._identifierType);if(!e)return Promise.reject(!1);const{envMap:t,envMapRotation:n}=this.productSettings.render;return await this.renderEngine.updateEnvMap(t,n),await this.spawnProductVariant(e)}async spawnProductVariant(e){if(!e.productParts)return Promise.reject(!1);for(const t of e.productParts)await this.spawnProductPart(t);return Promise.resolve(!0)}async spawnProductPart(e){let t=this.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);if(!t){const i=this._experienceData.getAssetCollection().getAssetByName(e.asset);if(!i||(await i.load(),t=await this.spawnAssetInScene(i),!t))return Promise.reject(!1)}const n=e.finish;return n?(await t.selectAssetFinish(n),Promise.resolve(!0)):Promise.resolve(!1)}async _fetchExperienceDataConfig(){return null}async _buildExperienceData(){const e=await this._fetchExperienceDataConfig();if(e===null)return await this._onAuthenticationFailed("Unable to retrieve experience data config."),Promise.reject();if(!e.success)return await this._onAuthenticationFailed(e.message),Promise.reject();this._experienceData=new HW({nexusApiResultPayload:e.payload,appWcRef:this}),await this._experienceData.initialize();const t=this._experienceData.channelSettings.ga_measurement_id;!this.gaMeasurementId&&t&&(window.epigraph.logger.info({title:"GA Measurement ID set from experience data",details:t,contextOverride:this._loggerContext}),this.gaMeasurementId=t,this._setupAnalytics())}__checkIfCurrentExperienceHasIdentifier(e,t){let n=!1;switch(e){case"sku":this.experienceData?.productVariantCollection?.getProductVariantBySku(t)&&(n=!0);break;case"shopify_variant_id":this.experienceData?.productVariantCollection?.getProductVariantByShopifyVariantId(t)&&(n=!0);break;case"upc":this.experienceData?.productVariantCollection?.getProductVariantByUpc(t)&&(n=!0);break;case"asin":this.experienceData?.productVariantCollection?.getProductVariantByAsin(t)&&(n=!0);break;case"experience_id":break;case"product_variant_uuid":this.experienceData?.productVariantCollection?.getProductVariantByUuid(t)&&(n=!0);break}return n}__guessesWhyTheExperienceFailed(){const e=[];return this._experienceData.getAssetCollection().hasAnyAssetWithSplat()&&this.productSettings.render.mode!==ga.SPLAT&&e.push("Render Splat provided in one of the assets. Try switching the render mode to Splat in Render Settings."),e}async _clearAndLoadNewExperienceInScene(){this._onNewExperienceLoadStart(),this.__checkIfCurrentExperienceHasIdentifier(this.identifierType,this.identifier)===!1&&await this._buildExperienceData().catch(e=>(window.epigraph.logger.error({title:`Couldn't build experience data for "${this.identifierType}" - "${this.identifier}"`,details:e,contextOverride:this._loggerContext}),Promise.reject(e))),await this._resetSession(),await this._postExperienceDataInitialization().catch(e=>Promise.reject(e)),this.parsedUrlParams.get(td.AR)&&!this.didARAutoLaunch&&(await this.launchAR(),this.didARAutoLaunch=!0),this._onNewExperienceLoadFinish()}async _onIdentifierOrTypeChange(){this.isAppReady&&(await this._resolveIdentifierAndType(),!(!this._identifier||!this._identifierType)&&(window.epigraph.logger.info({title:"IDENTIFIER CHANGED",details:`${this._identifierType} = ${this._identifier}`}),this._nexusAnalyticsPlugin&&(this._nexusAnalyticsPlugin.experienceID=this._identifier),this._ga4AnalyticsPlugin&&(this._ga4AnalyticsPlugin.experienceID=this._identifier),await this._clearAndLoadNewExperienceInScene().catch(e=>(window.epigraph.logger.error({title:"Error while clearing the session and loading a new experience.",details:e}),window.epigraph.logger.warn({title:"BEST GUESSES FOR FAILURE BELOW:",details:this.__guessesWhyTheExperienceFailed(),contextOverride:this._loggerContext}),Promise.reject(e)))))}showCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef?.classList.add("show")}hideCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef?.classList.remove("show")}_onPlayInteractionPromptChange(){this.playInteractionPrompt?this.__onPlayInteractionPrompt():(this.hideCameraInteractionPromptIndicator(),this._cameraManager?.mainCameraControls?.stop&&this._cameraManager?.mainCameraControls?.stop())}connectedCallback(){super.connectedCallback(),this._loadTimeBegin=performance.now(),this.parsedUrlParams=It.parseUrlForEpigraphParams(this.baseUrlOverride),this._setupAnalytics()}firstUpdated(){this.modalView&&(this.hide=!0),this._setup().then(()=>{this.featuresToEnable.viewer===!0&&(this._setupResizeObservers(),this.hideSplashScreen()),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext}),this.isAppReady=!0,this._onIdentifierOrTypeChange()}).catch(e=>{window.epigraph.logger.error({title:"Error while setup",details:e})})}updated(e){(e.has("sku")||e.has("shopify_variant_id")||e.has("upc")||e.has("asin")||e.has("experience_id")||e.has("product_variant_uuid")||e.has("customVersionId"))&&this._onIdentifierOrTypeChange(),e.has("playInteractionPrompt")&&this._onPlayInteractionPromptChange(),e.has("_isActiveHotspot")&&(this._hasActiveHotspot?this._hideCustomViewInYourSpaceButton():this._showCustomViewInYourSpaceButton()),e.has("debug")&&this.eventsManager.debugChanged.fire({value:this.debug}),e.has("showSettings")&&this.eventsManager.showSettingsChanged.fire({value:this.showSettings}),e.has("modalView")&&(this.hide=this.modalView)}_getSlottedElements(e){if(!this.customViewInYourSpaceButtonSlotElem)return[];const t=e.assignedElements();return[...t.length>0?t:e.children]}disconnectedCallback(){super.disconnectedCallback()}showFullScreenModal(){this.hide=!1}hideFullScreenModal(){this.hide=!0}render(){return ae`
18249
+ `}getAllHotspotsFromScene(){const e=[];return this.sceneManager.sceneStructure.traverse(t=>{if(t instanceof Al)for(const n of t.asset.hotspots)this.hotspotsManager.addHotspot(n,!1)}),e}_repopulateHotspots(){window.epigraph.logger.info({title:"Override to repopulate hotspots in scene on identifier changes"}),this.featuresToEnable.hotspots===!0&&this.hotspotsManager&&(this.hotspotsManager.removeAllHotspots(),this.getAllHotspotsFromScene(),this.updateHotspotsOrder(Array.from(this.hotspotsManager.hotspots.keys())))}_setupAnalytics(){this._isDevEnv||this._isStagingEnv||(this._nexusAnalyticsPlugin=new cD({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:this._isDevEnv,sendToStaging:this._isStagingEnv}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new lD({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:this._isDevEnv}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin)))}__onWebComponentResize(){if(!this.appCanvasContainerElemRef)return;const{width:e,height:t}=this.appCanvasContainerElemRef.getBoundingClientRect();if(!(e===0||t===0)){if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.textRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const n=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.getCameras().main.aspect=n,this.cameraManager.getCameras().main.updateProjectionMatrix(),this.cameraManager.getCameras().screenshot.aspect=n,this.cameraManager.getCameras().screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToSceneBounds(!1),this.isPortraitOrientation=e<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta()),this.eventsManager.webComponentResized.fire()}}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupVisibilityObserver(){new IntersectionObserver(()=>{this.isAppReady&&(window.epigraph.logger.info({title:"Component became visible, re-calculating scene hierarchy.",contextOverride:this._loggerContext}),this._onSceneHierarchyUpdate(),this.productSettings.camera.initial&&this.cameraManager.moveCameraToLocation({newCameraTransforms:this.productSettings.camera.initial,transition:!0}).then(()=>{this.productSettings.camera.initial?.skipCameraFit||this.cameraManager.fitCameraToSceneBounds()}))}).observe(this)}_setupResizeObservers(){new ResizeObserver(t=>{for(const n of t){const{width:i,height:r}=n.target.getBoundingClientRect(),a=i*.5,o=r*.5;if(a>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const l=this.toolsetElem?.getBoundingClientRect();if(!l)continue;const c=l.width>a,h=l.height>o;this._isToolsetLargerThanTheLeftBottomQuadrant=c||h}}}).observe(this)}async _postExperienceDataInitialization(){if(!this._identifier||!this._identifierType)return Promise.resolve(!0);if(this.productSettings.render.mode===ga.SPLAT&&this._renderEngine.sparkRenderer){const{preBlurAmount:i,blurAmount:r}=this.productSettings.render.splatMode;this._renderEngine.sparkRenderer.preBlurAmount=i,this._renderEngine.sparkRenderer.blurAmount=r}const e=this._experienceData.productVariantCollection.getProductVariantByIdentifierAndType(this._identifier,this._identifierType);if(!e)return Promise.reject(!1);const{envMap:t,envMapRotation:n}=this.productSettings.render;return await this.renderEngine.updateEnvMap(t,n),await this.spawnProductVariant(e)}async spawnProductVariant(e){if(!e.productParts)return Promise.reject(!1);for(const t of e.productParts)await this.spawnProductPart(t);return Promise.resolve(!0)}async spawnProductPart(e){let t=this.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);if(!t){const i=this._experienceData.getAssetCollection().getAssetByName(e.asset);if(!i||(await i.load(),t=await this.spawnAssetInScene(i),!t))return Promise.reject(!1)}const n=e.finish;return n?(await t.selectAssetFinish(n),Promise.resolve(!0)):Promise.resolve(!1)}async _fetchExperienceDataConfig(){return null}async _buildExperienceData(){const e=await this._fetchExperienceDataConfig();if(e===null)return await this._onAuthenticationFailed("Unable to retrieve experience data config."),Promise.reject();if(!e.success)return await this._onAuthenticationFailed(e.message),Promise.reject();this._experienceData=new HW({nexusApiResultPayload:e.payload,appWcRef:this}),await this._experienceData.initialize();const t=this._experienceData.channelSettings.ga_measurement_id;!this.gaMeasurementId&&t&&(window.epigraph.logger.info({title:"GA Measurement ID set from experience data",details:t,contextOverride:this._loggerContext}),this.gaMeasurementId=t,this._setupAnalytics())}__checkIfCurrentExperienceHasIdentifier(e,t){let n=!1;switch(e){case"sku":this.experienceData?.productVariantCollection?.getProductVariantBySku(t)&&(n=!0);break;case"shopify_variant_id":this.experienceData?.productVariantCollection?.getProductVariantByShopifyVariantId(t)&&(n=!0);break;case"upc":this.experienceData?.productVariantCollection?.getProductVariantByUpc(t)&&(n=!0);break;case"asin":this.experienceData?.productVariantCollection?.getProductVariantByAsin(t)&&(n=!0);break;case"experience_id":break;case"product_variant_uuid":this.experienceData?.productVariantCollection?.getProductVariantByUuid(t)&&(n=!0);break}return n}__guessesWhyTheExperienceFailed(){const e=[];return this._experienceData.getAssetCollection().hasAnyAssetWithSplat()&&this.productSettings.render.mode!==ga.SPLAT&&e.push("Render Splat provided in one of the assets. Try switching the render mode to Splat in Render Settings."),e}async _clearAndLoadNewExperienceInScene(){this._onNewExperienceLoadStart(),this.__checkIfCurrentExperienceHasIdentifier(this.identifierType,this.identifier)===!1&&await this._buildExperienceData().catch(e=>(window.epigraph.logger.error({title:`Couldn't build experience data for "${this.identifierType}" - "${this.identifier}"`,details:e,contextOverride:this._loggerContext}),Promise.reject(e))),await this._resetSession(),await this._postExperienceDataInitialization().catch(e=>Promise.reject(e)),this.parsedUrlParams.get(td.AR)&&!this.didARAutoLaunch&&(await this.launchAR(),this.didARAutoLaunch=!0),this._onNewExperienceLoadFinish()}async _onIdentifierOrTypeChange(){this.isAppReady&&(await this._resolveIdentifierAndType(),!(!this._identifier||!this._identifierType)&&(window.epigraph.logger.info({title:"IDENTIFIER CHANGED",details:`${this._identifierType} = ${this._identifier}`}),this._nexusAnalyticsPlugin&&(this._nexusAnalyticsPlugin.experienceID=this._identifier),this._ga4AnalyticsPlugin&&(this._ga4AnalyticsPlugin.experienceID=this._identifier),await this._clearAndLoadNewExperienceInScene().catch(e=>(window.epigraph.logger.error({title:"Error while clearing the session and loading a new experience.",details:e}),window.epigraph.logger.warn({title:"BEST GUESSES FOR FAILURE BELOW:",details:this.__guessesWhyTheExperienceFailed(),contextOverride:this._loggerContext}),Promise.reject(e)))))}showCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef?.classList.add("show")}hideCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef?.classList.remove("show")}_onPlayInteractionPromptChange(){this.playInteractionPrompt?this.__onPlayInteractionPrompt():(this.hideCameraInteractionPromptIndicator(),this._cameraManager?.mainCameraControls?.stop&&this._cameraManager?.mainCameraControls?.stop())}connectedCallback(){super.connectedCallback(),this._loadTimeBegin=performance.now(),this.parsedUrlParams=It.parseUrlForEpigraphParams(this.baseUrlOverride),this._setupAnalytics()}firstUpdated(){this.modalView&&(this.hide=!0),this._setup().then(()=>{this.featuresToEnable.viewer===!0&&(this._setupResizeObservers(),this.hideSplashScreen()),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext}),this.isAppReady=!0,this._onIdentifierOrTypeChange()}).catch(e=>{window.epigraph.logger.error({title:"Error while setup",details:e})})}updated(e){(e.has("sku")||e.has("shopify_variant_id")||e.has("upc")||e.has("asin")||e.has("experience_id")||e.has("product_variant_uuid")||e.has("customVersionId"))&&this._onIdentifierOrTypeChange(),e.has("playInteractionPrompt")&&this._onPlayInteractionPromptChange(),e.has("_isActiveHotspot")&&(this._hasActiveHotspot?this._hideCustomViewInYourSpaceButton():this._showCustomViewInYourSpaceButton()),e.has("debug")&&this.eventsManager.debugChanged.fire({value:this.debug}),e.has("showSettings")&&this.eventsManager.showSettingsChanged.fire({value:this.showSettings}),e.has("modalView")&&(this.hide=this.modalView)}_getSlottedElements(e){if(!this.customViewInYourSpaceButtonSlotElem)return[];const t=e.assignedElements();return[...t.length>0?t:e.children]}disconnectedCallback(){super.disconnectedCallback()}showFullScreenModal(){this.hide=!1}hideFullScreenModal(){this.hide=!0}render(){return ae`
18249
18250
  ${It.getCustomStylesTemplate()}
18250
18251
 
18251
18252
  <epg-button-icon
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/solutions",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-solutions.js",
6
6
  "files": [