@epigraph/solutions 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4375,7 +4375,7 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
4375
4375
|
@epgonclick=${this._onHotspotClick.bind(this)}
|
|
4376
4376
|
size=${this.__appWcRef.isPortraitOrientation?"small":"medium"}
|
|
4377
4377
|
></epg-tool-hotspot>
|
|
4378
|
-
`}renderCardTemplate({isFirstHotspot:e=!1,isLastHotspot:t=!1,showPreviousButton:i=!0,showNextButton:a=!0}){const l={assetId:this.assetId,hotspotId:this.hotspotId,header:{preheadText:this.header.preheadText,headerText:this.header.headerText,subheadText:this.header.subheadText,media:{uri:this.header.media.uri,type:this.header.media.type,mediaCaption:"",altText:this.header.media.altText}},carousel:{mediaItems:this.carousel.mediaItems,indicator:this.carousel.indicator},details:this.details,desktopPlacement:this.desktopPlacement,showNavigationButtons:this.__appWcRef.
|
|
4378
|
+
`}renderCardTemplate({isFirstHotspot:e=!1,isLastHotspot:t=!1,showPreviousButton:i=!0,showNextButton:a=!0}){const l={assetId:this.assetId,hotspotId:this.hotspotId,header:{preheadText:this.header.preheadText,headerText:this.header.headerText,subheadText:this.header.subheadText,media:{uri:this.header.media.uri,type:this.header.media.type,mediaCaption:"",altText:this.header.media.altText}},carousel:{mediaItems:this.carousel.mediaItems,indicator:this.carousel.indicator},details:this.details,desktopPlacement:this.desktopPlacement,showNavigationButtons:this.__appWcRef.productSettings.hotspots.showNavigationButtons};return Ee`
|
|
4379
4379
|
<epg-card
|
|
4380
4380
|
class="hotspot-card"
|
|
4381
4381
|
.data=${l}
|
|
@@ -7067,7 +7067,7 @@ Arguments: [`+B+"]"}},s.fz.prototype={k(n){return"Unsupported operation: "+this.
|
|
|
7067
7067
|
}
|
|
7068
7068
|
}
|
|
7069
7069
|
}
|
|
7070
|
-
`]}updateActiveHotspotIndex(){this.activeHotspot&&(this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotId))}static setupWebComponent(){window.customElements.get(Gd.webComponentName)||window.customElements.define(Gd.webComponentName,Gd)}firstUpdated(e){super.firstUpdated(e),this.__setupEventListeners()}updated(e){if(e.has("__cardsState")){const t=this.__currentCardsPerView,i=this.__cardsState===Wi.collapsed?1.2:1.03;if(Et.animateValue(t,i,500,a=>{this.__currentCardsPerView=a}),this?.cardsCarouselSwiperContainer?.swiper!==void 0){this.cardsCarouselSwiperContainer.swiper.allowTouchMove=this.__cardsState===Wi.collapsed;const a=this.cardsCarouselSwiperContainer.querySelectorAll("epg-card");for(const l of a)l.showPreviousButton=this.__cardsState===Wi.expanded&&!l.hasAttribute("is-first-hotspot"),l.showNextButton=this.__cardsState===Wi.expanded&&!l.hasAttribute("is-last-hotspot")}}this.cardsCarouselSwiperContainer?.swiper?.slideTo(this.activeHotspotIndex,400)}addHotspot(e,t=!0){const i=new Uv({config:e,appWcRef:this.appWcRef,hotspotManagerRef:this});this.hotspots.set(i.hotspotId,i);const a=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);a&&a.addHotspot(i),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}updateHotspot(e,t){const i=this.hotspots.get(e);if(!i){window.epigraph.logger.error({title:`Invalid hotspot ID: ${e}`});return}i.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 i=this.hotspotsOrder.length;let a=t;e==="next"?(a=t+1,a>=i&&(a=0)):e==="prev"&&(a=t-1,a<0&&(a=i-1));const l=this.hotspotsOrder[a];this.setActiveHotspot({hotspotId:l})}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:i=!1}){this.appWcRef.playInteractionPrompt=!1,this.setActiveHotspot({hotspotId:e,state:t}),i||this.appWcRef.eventsManager.hotspotOpenEvent.fire({hotspot:this.activeHotspot});const a=new ir(!0,ir.PANEL_TYPE.HOTSPOT_PANEL,ir.TRIGGER_SOURCE.HOTSPOT,[]);this.appWcRef.epigraphAnalytics.sendEvent(a)}closeActiveHotspot(){const e=this.activeHotspot?.hotspotId;this.setActiveHotspot({hotspotId:null}),this.appWcRef.eventsManager.hotspotClosedEvent.fire({hotspotId:e});const t=new nr(!0,nr.PANEL_TYPE.HOTSPOT_PANEL,nr.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,state:this.__cardsState})}setActiveHotspot({hotspotId:e,state:t=this.__cardsState}){if(this.activeHotspot?.hotspotId===e)return;if(e===null){const a=!!this.activeHotspot;this.activeHotspot=void 0,this.updateActiveHotspotIndex(),a&&this.appWcRef.cameraManager.resetCurrentCameraTransformsToLastSavedState();return}this.enabled===!1&&(this.enabled=!0);const i=!this.activeHotspot;if(this.activeHotspot=this.hotspots.get(e),this.updateActiveHotspotIndex(),this.setActiveHotspotState(t),this.__resolveHotspotCardContents(),this.appWcRef.eventsManager.cameraMoveToTransform.fire({cameraTransforms:this.activeHotspot?.camera,saveFirst:i}),this.appWcRef.isPortraitOrientation){const a=this.appWcRef.cameraManager.mainCameraControls,l=new se;a.getTarget(l,!0);const h=new se;a.getPosition(h,!0),a.setLookAt(h.x-l.x,h.y,h.z-l.z,0,l.y,0,!0),a.setFocalOffset(0,.1,0,!0)}window.addEventListener("keydown",a=>{a.key==="Escape"&&this.closeActiveHotspot()},{once:!0})}expandCards(){this.__cardsState=Wi.expanded}collapseCards(){this.__cardsState=Wi.collapsed}setActiveHotspotState(e=Wi.collapsed){if(this.activeHotspot)switch(this.appWcRef.clientHeight<420&&(e=Wi.expanded),e){case Wi.collapsed:this.collapseCards();break;case Wi.expanded:this.expandCards();break}}__resolveHotspotCardContents(){this.__allCards=[];let e=0;const t=this.hotspots.size-1,i=this.hotspots.size>1,a=this.appWcRef.
|
|
7070
|
+
`]}updateActiveHotspotIndex(){this.activeHotspot&&(this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotId))}static setupWebComponent(){window.customElements.get(Gd.webComponentName)||window.customElements.define(Gd.webComponentName,Gd)}firstUpdated(e){super.firstUpdated(e),this.__setupEventListeners()}updated(e){if(e.has("__cardsState")){const t=this.__currentCardsPerView,i=this.__cardsState===Wi.collapsed?1.2:1.03;if(Et.animateValue(t,i,500,a=>{this.__currentCardsPerView=a}),this?.cardsCarouselSwiperContainer?.swiper!==void 0){this.cardsCarouselSwiperContainer.swiper.allowTouchMove=this.__cardsState===Wi.collapsed;const a=this.cardsCarouselSwiperContainer.querySelectorAll("epg-card");for(const l of a)l.showPreviousButton=this.__cardsState===Wi.expanded&&!l.hasAttribute("is-first-hotspot"),l.showNextButton=this.__cardsState===Wi.expanded&&!l.hasAttribute("is-last-hotspot")}}this.cardsCarouselSwiperContainer?.swiper?.slideTo(this.activeHotspotIndex,400)}addHotspot(e,t=!0){const i=new Uv({config:e,appWcRef:this.appWcRef,hotspotManagerRef:this});this.hotspots.set(i.hotspotId,i);const a=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);a&&a.addHotspot(i),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}updateHotspot(e,t){const i=this.hotspots.get(e);if(!i){window.epigraph.logger.error({title:`Invalid hotspot ID: ${e}`});return}i.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 i=this.hotspotsOrder.length;let a=t;e==="next"?(a=t+1,a>=i&&(a=0)):e==="prev"&&(a=t-1,a<0&&(a=i-1));const l=this.hotspotsOrder[a];this.setActiveHotspot({hotspotId:l})}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:i=!1}){this.appWcRef.playInteractionPrompt=!1,this.setActiveHotspot({hotspotId:e,state:t}),i||this.appWcRef.eventsManager.hotspotOpenEvent.fire({hotspot:this.activeHotspot});const a=new ir(!0,ir.PANEL_TYPE.HOTSPOT_PANEL,ir.TRIGGER_SOURCE.HOTSPOT,[]);this.appWcRef.epigraphAnalytics.sendEvent(a)}closeActiveHotspot(){const e=this.activeHotspot?.hotspotId;this.setActiveHotspot({hotspotId:null}),this.appWcRef.eventsManager.hotspotClosedEvent.fire({hotspotId:e});const t=new nr(!0,nr.PANEL_TYPE.HOTSPOT_PANEL,nr.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,state:this.__cardsState})}setActiveHotspot({hotspotId:e,state:t=this.__cardsState}){if(this.activeHotspot?.hotspotId===e)return;if(e===null){const a=!!this.activeHotspot;this.activeHotspot=void 0,this.updateActiveHotspotIndex(),a&&this.appWcRef.cameraManager.resetCurrentCameraTransformsToLastSavedState();return}this.enabled===!1&&(this.enabled=!0);const i=!this.activeHotspot;if(this.activeHotspot=this.hotspots.get(e),this.updateActiveHotspotIndex(),this.setActiveHotspotState(t),this.__resolveHotspotCardContents(),this.appWcRef.eventsManager.cameraMoveToTransform.fire({cameraTransforms:this.activeHotspot?.camera,saveFirst:i}),this.appWcRef.isPortraitOrientation){const a=this.appWcRef.cameraManager.mainCameraControls,l=new se;a.getTarget(l,!0);const h=new se;a.getPosition(h,!0),a.setLookAt(h.x-l.x,h.y,h.z-l.z,0,l.y,0,!0),a.setFocalOffset(0,.1,0,!0)}window.addEventListener("keydown",a=>{a.key==="Escape"&&this.closeActiveHotspot()},{once:!0})}expandCards(){this.__cardsState=Wi.expanded}collapseCards(){this.__cardsState=Wi.collapsed}setActiveHotspotState(e=Wi.collapsed){if(this.activeHotspot)switch(this.appWcRef.clientHeight<420&&(e=Wi.expanded),e){case Wi.collapsed:this.collapseCards();break;case Wi.expanded:this.expandCards();break}}__resolveHotspotCardContents(){this.__allCards=[];let e=0;const t=this.hotspots.size-1,i=this.hotspots.size>1,a=this.appWcRef.productSettings.hotspots.showNavigationButtons;for(const l of this.hotspots.values()){const h=e===0,d=e===t,p=Ee`
|
|
7071
7071
|
<swiper-slide part="swiper-slide">
|
|
7072
7072
|
<style>
|
|
7073
7073
|
.expand-button {
|
|
@@ -8359,7 +8359,7 @@ void main() {
|
|
|
8359
8359
|
`:Ee`
|
|
8360
8360
|
${super.render()}
|
|
8361
8361
|
${this.__renderQrModal()}
|
|
8362
|
-
`}};co([Ut("#modelViewer")],ia.prototype,"modelViewerElem");co([Ut("#arModal")],ia.prototype,"arModalElem");co([Ut("#qrModal")],ia.prototype,"qrModalElem");co([ue({attribute:!1})],ia.prototype,"appWcRef");co([ue({type:String,attribute:"glb-src"})],ia.prototype,"glbSrc");co([ue({type:String,attribute:"usdz-src"})],ia.prototype,"usdzSrc");co([ue({type:Boolean,attribute:"debug"})],ia.prototype,"debug");let SH=ia;class wt{constructor(e,t,i=""){this.__name="app:generic:event",this.__eventsManager=e,this.__name=t,this.__detail=i}get name(){return this.__name}get detail(){return this.__detail}fire(e){const t=new CustomEvent(this.__name,{detail:e??this.__detail});this.__eventsManager.eventHubRef.dispatchEvent(t)}}class CH extends EventTarget{constructor(e){super(),this._loggerContext="EVENTS MANAGER",window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext}),e?this.eventHubRef=e:this.eventHubRef=this,this.assetLoadProgress=new wt(this,"assetLoadProgress",""),this.experienceUpdatedEvent=new wt(this,"experienceUpdated",""),this.appReadyEvent=new wt(this,"appReady",""),this.appFailedEvent=new wt(this,"appFailed",""),this.productClassChangedEvent=new wt(this,"productClassChanged",""),this.productChangedEvent=new wt(this,"productChanged",""),this.variantChangedEvent=new wt(this,"variantChanged",""),this.structureNodeAddedEvent=new wt(this,"structureNodeAdded",""),this.structureNodeRemovedEvent=new wt(this,"structureNodeRemoved",""),this.structureChangedEvent=new wt(this,"structureChanged",""),this.showNodeLoadingIcon=new wt(this,"nodeLoadingShow",""),this.hideNodeLoadingIcon=new wt(this,"nodeLoadingHide",""),this.cameraFitEvent=new wt(this,"cameraFit",""),this.hotspotsUpdatedEvent=new wt(this,"hotspotsUpdated",""),this.hotspotsVisibilityChanged=new wt(this,"hotspotsVisibilityChanged",""),this.hotspotClickedEvent=new wt(this,"hotspotClicked",""),this.hotspotOpenEvent=new wt(this,"hotspotOpen",""),this.hotspotClosedEvent=new wt(this,"hotspotClosed",""),this.hotspotNextEvent=new wt(this,"hotspotNext",""),this.hotspotPreviousEvent=new wt(this,"hotspotPrevious",""),this.sceneBoundsChanged=new wt(this,"sceneBoundsChanged",""),this.dimensionsPositionChanged=new wt(this,"dimensionsPositionChanged",""),this.dimensionsValueChanged=new wt(this,"dimensionsValueChanged",""),this.dimensionsVisibilityChanged=new wt(this,"dimensionsVisibilityChanged",""),this.arModelReadyEvent=new wt(this,"arGlbReady",""),this.cartChangedEvent=new wt(this,"cartChanged",""),this.sceneRestartedEvent=new wt(this,"sceneRestarted",""),this.pickerFoundPosition=new wt(this,"pickerFoundPosition",""),this.frameUpdated=new wt(this,"frameUpdated",""),this.cameraControlsStart=new wt(this,"cameraControlsStart",""),this.inputStart=new wt(this,"inputStart",""),this.inputMove=new wt(this,"inputMove",""),this.inputEnd=new wt(this,"inputEnd",""),this.cameraMoveToTransform=new wt(this,"cameraMoveToTransform",""),this.debugChanged=new wt(this,"debugChanged","")}}class TH{constructor(e,t){this.__assets=new Map,this.__appWcRef=t,this.__config=e}async initialize(){for(const e in this.__config){const t=new yC(this.__config[e],this.__appWcRef);await t.load(),this.__assets.set(e,t)}}async loadAllProxies(){for(const e of this.__assets.values())await e.loadProxyGltf()}async loadAllRenderAssets(){for(const e of this.__assets.values())await e.loadRenderGltf(!0)}getAssetByName(e){return this.__assets.get(e)}getFirstAsset(){return this.__assets.values().next().value}}class IH{constructor(e){this.__assetClass=e.assetClass,this.__asset=e.asset,this.__assetId=e.assetId,this.__finish=e.finish,this.__productOptionValue=e.productOptionValue}get assetClass(){return this.__assetClass}get asset(){return this.__asset}get assetId(){return this.__assetId}get finish(){return this.__finish}get productOptionValue(){return this.__productOptionValue}}class MH{constructor(e,t){this.__productParts=[],this.__id=e.id,this.__name=e.name,this.__productId=t,this.__sku=e.sku,this.__upc=e.upc,this.__asin=e.asin,this.__shopifyVariantId=e.shopifyVariantId,this.__uuid=e.uuid,this.parseProductParts(e.productParts)}get id(){return this.__id}get name(){return this.__name}get productId(){return this.__productId}get sku(){return this.__sku}get upc(){return this.__upc}get asin(){return this.__asin}get shopifyVariantId(){return this.__shopifyVariantId}get uuid(){return this.__uuid}get productParts(){return this.__productParts}parseProductParts(e){for(const t of e){const i=new IH(t);this.__productParts.push(i)}}}class RH{constructor(e,t){this.__productVariants=new Map,this.__productVariantNames=new Map,this.__productVariantSkus=new Map,this.__productVariantUpcs=new Map,this.__productVariantAsins=new Map,this.__productVariantShopifyVariantIds=new Map,this.__productVariantUuids=new Map,this.__productId=t;for(const i of e){const a=new MH(i,this.__productId);a&&this.addProductVariant(a)}}addProductVariant(e){this.__productVariants.set(e.id,e),this.__productVariantNames.set(e.name,e),e.sku&&this.__productVariantSkus.set(e.sku,e),e.upc&&this.__productVariantUpcs.set(e.upc,e),e.asin&&this.__productVariantAsins.set(e.asin,e),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.set(e.shopifyVariantId,e),e.uuid&&this.__productVariantUuids.set(e.uuid,e)}removeProductVariant(e){e.sku&&this.__productVariantSkus.delete(e.sku),e.upc&&this.__productVariantUpcs.delete(e.upc),e.asin&&this.__productVariantAsins.delete(e.asin),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.delete(e.shopifyVariantId),this.__productVariantNames.delete(e.name),this.__productVariants.delete(e.id)}getAllProductVariants(){return Array.from(this.__productVariants.values())}getAllProductVariantIds(){return Array.from(this.__productVariants.keys())}getAllProductVariantNames(){return Array.from(this.__productVariantNames.keys())}getProductVariantById(e){return this.__productVariants.get(e)}getProductVariantByName(e){return this.__productVariantNames.get(e)}getProductVariantBySku(e){return this.__productVariantSkus.get(e)}getProductVariantByUpc(e){return this.__productVariantUpcs.get(e)}getProductVariantByAsin(e){return this.__productVariantAsins.get(e)}getProductVariantByShopifyVariantId(e){return this.__productVariantShopifyVariantIds.get(e)}getProductVariantByUuid(e){return this.__productVariantUuids.get(e)}getProductVariantByIdentifierAndType(e,t){switch(t){case Ta.SKU:return this.getProductVariantBySku(e);case Ta.SHOPIFY_VARIANT_ID:return this.getProductVariantByShopifyVariantId(e);case Ta.ASIN:return this.getProductVariantByAsin(e);case Ta.UPC:return this.getProductVariantByUpc(e);case Ta.EXPERIENCE_ID:return;case Ta.PRODUCT_VARIANT_UUID:return this.getProductVariantByUuid(e);default:return}}}class FT{constructor(){this.productSettings={postEffect:{ao:!1},camera:{initial:null,backgroundColor:"#ffffff",backgroundAlpha:1,focalLength:35,nearClip:.01,farClip:1e3,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,minPolarAngle:null,maxPolarAngle:null,minAzimuthAngle:null,maxAzimuthAngle:null},renderQuality:{antiAlias:!0},screenshots:{enabled:!1},shadows:{shadowType:EC.NONE,accumulativeShadows:{shadowMaterial:{opacity:.8,alphaTest:.75,color:"#000000",blend:1},shadowParams:{frames:30,scale:10,radius:.8,ambient:.5},light:{direction:{x:3,y:5,z:3}}},contactShadows:{planeLength:3,planeWidth:3,cameraHeight:1,intensity:1,softness:1}},hotspots:{showNavigationButtons:!0}}}_deepCopyProductSettings(e){const t=this.productSettings;e.camera&&(e.camera.initial&&(t.camera.initial=e.camera.initial),e.camera.backgroundColor&&(t.camera.backgroundColor=e.camera.backgroundColor),e.camera.backgroundAlpha&&(t.camera.backgroundAlpha=e.camera.backgroundAlpha),e.camera.focalLength&&(t.camera.focalLength=e.camera.focalLength),e.camera.canPan&&(t.camera.canPan=e.camera.canPan),e.camera.canZoom&&(t.camera.canZoom=e.camera.canZoom),e.camera.minDistance&&(t.camera.minDistance=e.camera.minDistance),e.camera.maxDistance&&(t.camera.maxDistance=e.camera.maxDistance),e.camera.minPolarAngle&&(t.camera.minPolarAngle=e.camera.minPolarAngle),e.camera.maxPolarAngle&&(t.camera.maxPolarAngle=e.camera.maxPolarAngle),e.camera.minAzimuthAngle&&(t.camera.minAzimuthAngle=e.camera.minAzimuthAngle),e.camera.maxAzimuthAngle&&(t.camera.maxAzimuthAngle=e.camera.maxAzimuthAngle)),e.postEffect&&(t.postEffect=e.postEffect),e.renderQuality&&(t.renderQuality=e.renderQuality),e.screenshots&&(t.screenshots=e.screenshots),e.shadows?.shadowType&&(t.shadows.shadowType=e.shadows.shadowType),e.shadows?.accumulativeShadows&&(t.shadows.accumulativeShadows=e.shadows.accumulativeShadows),e.shadows?.contactShadows&&(e.shadows.contactShadows.cameraHeight&&(t.shadows.contactShadows.cameraHeight=e.shadows.contactShadows.cameraHeight),e.shadows.contactShadows.intensity&&(t.shadows.contactShadows.intensity=e.shadows.contactShadows.intensity),e.shadows.contactShadows.planeLength&&(t.shadows.contactShadows.planeLength=e.shadows.contactShadows.planeLength),e.shadows.contactShadows.planeWidth&&(t.shadows.contactShadows.planeWidth=e.shadows.contactShadows.planeWidth),e.shadows.contactShadows.softness&&(t.shadows.contactShadows.softness=e.shadows.contactShadows.softness)),e.hotspots?.showNavigationButtons&&(t.hotspots.showNavigationButtons=e.hotspots.showNavigationButtons)}}class BH extends FT{constructor({nexusApiResultPayload:e,appWcRef:t}){super(),this.__needsRootPlug=!1,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this._data.product_data.settings&&this._deepCopyProductSettings(this._data.product_data.settings);const i=this._data.product_data.assets;if(Object.values(i).length===1){const a=Object.values(i)[0];a?.proxyGeo?window.epigraph.logger.warn({title:"Single asset experience detected and a proxy was provided. Please ensure that the proxy provided has a root plug in it. Expand for the asset config used...",details:a,contextOverride:"ASSET COLLECTION"}):(a.proxyGeo="https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/staging-assets/pipeline-assets/3d-assets/proxies/null-proxy.glb",this.__needsRootPlug=!0,a.autoGenerateProxyEntity=!0)}}async __parseAssets(){return this.__assetCollection=new TH(this._data.product_data.assets,this._appWcRef),await this.__assetCollection.initialize(),this.__needsRootPlug&&this.__assetCollection.getFirstAsset()?.proxyGltf?.plugs.push(new Jr({name:"root@plug",isPrimary:!0,connectionId:"root",position:new se,rotation:new bn})),this.__assetCollection}getAssetCollection(){return this.__assetCollection}__parseProductVariants(){this.__productVariantCollection=new RH(this._data.product_data.product.productVariants,this._data.product_data.product.id)}get productVariantCollection(){return this.__productVariantCollection}async initialize(){await this.__parseAssets(),await this.__parseProductVariants()}getExperienceDataSettings(){return{}}}var wh=function(){var o=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(A){A.preventDefault(),i(++o%e.children.length)},!1);function t(A){return e.appendChild(A.dom),A}function i(A){for(var _=0;_<e.children.length;_++)e.children[_].style.display=_===A?"block":"none";o=A}var a=(performance||Date).now(),l=a,h=0,d=t(new wh.Panel("FPS","#0ff","#002")),p=t(new wh.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var g=t(new wh.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){a=(performance||Date).now()},end:function(){h++;var A=(performance||Date).now();if(p.update(A-a,200),A>=l+1e3&&(d.update(h*1e3/(A-l),100),l=A,h=0,g)){var _=performance.memory;g.update(_.usedJSHeapSize/1048576,_.jsHeapSizeLimit/1048576)}return A},update:function(){a=this.end()},domElement:e,setMode:i}};wh.Panel=function(o,e,t){var i=1/0,a=0,l=Math.round,h=l(window.devicePixelRatio||1),d=80*h,p=48*h,g=3*h,A=2*h,_=3*h,b=15*h,w=74*h,E=30*h,C=document.createElement("canvas");C.width=d,C.height=p,C.style.cssText="width:80px;height:48px";var T=C.getContext("2d");return T.font="bold "+9*h+"px Helvetica,Arial,sans-serif",T.textBaseline="top",T.fillStyle=t,T.fillRect(0,0,d,p),T.fillStyle=e,T.fillText(o,g,A),T.fillRect(_,b,w,E),T.fillStyle=t,T.globalAlpha=.9,T.fillRect(_,b,w,E),{dom:C,update:function(x,P){i=Math.min(i,x),a=Math.max(a,x),T.fillStyle=t,T.globalAlpha=1,T.fillRect(0,0,d,b),T.fillStyle=e,T.fillText(l(x)+" "+o+" ("+l(i)+"-"+l(a)+")",g,A),T.drawImage(C,_+h,b,w-h,E,_,b,w-h,E),T.fillRect(_+w-h,b,h,E),T.fillStyle=t,T.globalAlpha=.9,T.fillRect(_+w-h,b,h,l((1-x/P)*E))}}};class as extends Yf{constructor(){super(),this._loggerContext="DEBUG MANAGER",this.stats=new wh}static{this.webComponentName="debug-manager"}static setupWebComponent(){window.customElements.get(as.webComponentName)||window.customElements.define(as.webComponentName,as)}static{this.styles=ct`
|
|
8362
|
+
`}};co([Ut("#modelViewer")],ia.prototype,"modelViewerElem");co([Ut("#arModal")],ia.prototype,"arModalElem");co([Ut("#qrModal")],ia.prototype,"qrModalElem");co([ue({attribute:!1})],ia.prototype,"appWcRef");co([ue({type:String,attribute:"glb-src"})],ia.prototype,"glbSrc");co([ue({type:String,attribute:"usdz-src"})],ia.prototype,"usdzSrc");co([ue({type:Boolean,attribute:"debug"})],ia.prototype,"debug");let SH=ia;class wt{constructor(e,t,i=""){this.__name="app:generic:event",this.__eventsManager=e,this.__name=t,this.__detail=i}get name(){return this.__name}get detail(){return this.__detail}fire(e){const t=new CustomEvent(this.__name,{detail:e??this.__detail});this.__eventsManager.eventHubRef.dispatchEvent(t)}}class CH extends EventTarget{constructor(e){super(),this._loggerContext="EVENTS MANAGER",window.epigraph.logger.info({title:"Initializing...",contextOverride:this._loggerContext}),e?this.eventHubRef=e:this.eventHubRef=this,this.assetLoadProgress=new wt(this,"assetLoadProgress",""),this.experienceUpdatedEvent=new wt(this,"experienceUpdated",""),this.appReadyEvent=new wt(this,"appReady",""),this.appFailedEvent=new wt(this,"appFailed",""),this.productClassChangedEvent=new wt(this,"productClassChanged",""),this.productChangedEvent=new wt(this,"productChanged",""),this.variantChangedEvent=new wt(this,"variantChanged",""),this.structureNodeAddedEvent=new wt(this,"structureNodeAdded",""),this.structureNodeRemovedEvent=new wt(this,"structureNodeRemoved",""),this.structureChangedEvent=new wt(this,"structureChanged",""),this.showNodeLoadingIcon=new wt(this,"nodeLoadingShow",""),this.hideNodeLoadingIcon=new wt(this,"nodeLoadingHide",""),this.cameraFitEvent=new wt(this,"cameraFit",""),this.hotspotsUpdatedEvent=new wt(this,"hotspotsUpdated",""),this.hotspotsVisibilityChanged=new wt(this,"hotspotsVisibilityChanged",""),this.hotspotClickedEvent=new wt(this,"hotspotClicked",""),this.hotspotOpenEvent=new wt(this,"hotspotOpen",""),this.hotspotClosedEvent=new wt(this,"hotspotClosed",""),this.hotspotNextEvent=new wt(this,"hotspotNext",""),this.hotspotPreviousEvent=new wt(this,"hotspotPrevious",""),this.sceneBoundsChanged=new wt(this,"sceneBoundsChanged",""),this.dimensionsPositionChanged=new wt(this,"dimensionsPositionChanged",""),this.dimensionsValueChanged=new wt(this,"dimensionsValueChanged",""),this.dimensionsVisibilityChanged=new wt(this,"dimensionsVisibilityChanged",""),this.arModelReadyEvent=new wt(this,"arGlbReady",""),this.cartChangedEvent=new wt(this,"cartChanged",""),this.sceneRestartedEvent=new wt(this,"sceneRestarted",""),this.pickerFoundPosition=new wt(this,"pickerFoundPosition",""),this.frameUpdated=new wt(this,"frameUpdated",""),this.cameraControlsStart=new wt(this,"cameraControlsStart",""),this.inputStart=new wt(this,"inputStart",""),this.inputMove=new wt(this,"inputMove",""),this.inputEnd=new wt(this,"inputEnd",""),this.cameraMoveToTransform=new wt(this,"cameraMoveToTransform",""),this.debugChanged=new wt(this,"debugChanged","")}}class TH{constructor(e,t){this.__assets=new Map,this.__appWcRef=t,this.__config=e}async initialize(){for(const e in this.__config){const t=new yC(this.__config[e],this.__appWcRef);await t.load(),this.__assets.set(e,t)}}async loadAllProxies(){for(const e of this.__assets.values())await e.loadProxyGltf()}async loadAllRenderAssets(){for(const e of this.__assets.values())await e.loadRenderGltf(!0)}getAssetByName(e){return this.__assets.get(e)}getFirstAsset(){return this.__assets.values().next().value}}class IH{constructor(e){this.__assetClass=e.assetClass,this.__asset=e.asset,this.__assetId=e.assetId,this.__finish=e.finish,this.__productOptionValue=e.productOptionValue}get assetClass(){return this.__assetClass}get asset(){return this.__asset}get assetId(){return this.__assetId}get finish(){return this.__finish}get productOptionValue(){return this.__productOptionValue}}class MH{constructor(e,t){this.__productParts=[],this.__id=e.id,this.__name=e.name,this.__productId=t,this.__sku=e.sku,this.__upc=e.upc,this.__asin=e.asin,this.__shopifyVariantId=e.shopifyVariantId,this.__uuid=e.uuid,this.parseProductParts(e.productParts)}get id(){return this.__id}get name(){return this.__name}get productId(){return this.__productId}get sku(){return this.__sku}get upc(){return this.__upc}get asin(){return this.__asin}get shopifyVariantId(){return this.__shopifyVariantId}get uuid(){return this.__uuid}get productParts(){return this.__productParts}parseProductParts(e){for(const t of e){const i=new IH(t);this.__productParts.push(i)}}}class RH{constructor(e,t){this.__productVariants=new Map,this.__productVariantNames=new Map,this.__productVariantSkus=new Map,this.__productVariantUpcs=new Map,this.__productVariantAsins=new Map,this.__productVariantShopifyVariantIds=new Map,this.__productVariantUuids=new Map,this.__productId=t;for(const i of e){const a=new MH(i,this.__productId);a&&this.addProductVariant(a)}}addProductVariant(e){this.__productVariants.set(e.id,e),this.__productVariantNames.set(e.name,e),e.sku&&this.__productVariantSkus.set(e.sku,e),e.upc&&this.__productVariantUpcs.set(e.upc,e),e.asin&&this.__productVariantAsins.set(e.asin,e),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.set(e.shopifyVariantId,e),e.uuid&&this.__productVariantUuids.set(e.uuid,e)}removeProductVariant(e){e.sku&&this.__productVariantSkus.delete(e.sku),e.upc&&this.__productVariantUpcs.delete(e.upc),e.asin&&this.__productVariantAsins.delete(e.asin),e.shopifyVariantId&&this.__productVariantShopifyVariantIds.delete(e.shopifyVariantId),this.__productVariantNames.delete(e.name),this.__productVariants.delete(e.id)}getAllProductVariants(){return Array.from(this.__productVariants.values())}getAllProductVariantIds(){return Array.from(this.__productVariants.keys())}getAllProductVariantNames(){return Array.from(this.__productVariantNames.keys())}getProductVariantById(e){return this.__productVariants.get(e)}getProductVariantByName(e){return this.__productVariantNames.get(e)}getProductVariantBySku(e){return this.__productVariantSkus.get(e)}getProductVariantByUpc(e){return this.__productVariantUpcs.get(e)}getProductVariantByAsin(e){return this.__productVariantAsins.get(e)}getProductVariantByShopifyVariantId(e){return this.__productVariantShopifyVariantIds.get(e)}getProductVariantByUuid(e){return this.__productVariantUuids.get(e)}getProductVariantByIdentifierAndType(e,t){switch(t){case Ta.SKU:return this.getProductVariantBySku(e);case Ta.SHOPIFY_VARIANT_ID:return this.getProductVariantByShopifyVariantId(e);case Ta.ASIN:return this.getProductVariantByAsin(e);case Ta.UPC:return this.getProductVariantByUpc(e);case Ta.EXPERIENCE_ID:return;case Ta.PRODUCT_VARIANT_UUID:return this.getProductVariantByUuid(e);default:return}}}class FT{constructor(){this.productSettings={postEffect:{ao:!1},camera:{initial:null,backgroundColor:"#ffffff",backgroundAlpha:1,focalLength:35,nearClip:.01,farClip:1e3,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,minPolarAngle:null,maxPolarAngle:null,minAzimuthAngle:null,maxAzimuthAngle:null},renderQuality:{antiAlias:!0},screenshots:{enabled:!1},shadows:{shadowType:EC.NONE,accumulativeShadows:{shadowMaterial:{opacity:.8,alphaTest:.75,color:"#000000",blend:1},shadowParams:{frames:30,scale:10,radius:.8,ambient:.5},light:{direction:{x:3,y:5,z:3}}},contactShadows:{planeLength:3,planeWidth:3,cameraHeight:1,intensity:1,softness:1}},hotspots:{showNavigationButtons:!0}}}_deepCopyProductSettings(e){const t=this.productSettings;e.camera&&(e.camera.initial&&(t.camera.initial=e.camera.initial),e.camera.backgroundColor&&(t.camera.backgroundColor=e.camera.backgroundColor),e.camera.backgroundAlpha&&(t.camera.backgroundAlpha=e.camera.backgroundAlpha),e.camera.focalLength&&(t.camera.focalLength=e.camera.focalLength),e.camera.canPan&&(t.camera.canPan=e.camera.canPan),e.camera.canZoom&&(t.camera.canZoom=e.camera.canZoom),e.camera.minDistance&&(t.camera.minDistance=e.camera.minDistance),e.camera.maxDistance&&(t.camera.maxDistance=e.camera.maxDistance),e.camera.minPolarAngle&&(t.camera.minPolarAngle=e.camera.minPolarAngle),e.camera.maxPolarAngle&&(t.camera.maxPolarAngle=e.camera.maxPolarAngle),e.camera.minAzimuthAngle&&(t.camera.minAzimuthAngle=e.camera.minAzimuthAngle),e.camera.maxAzimuthAngle&&(t.camera.maxAzimuthAngle=e.camera.maxAzimuthAngle)),e.postEffect&&(t.postEffect=e.postEffect),e.renderQuality&&(t.renderQuality=e.renderQuality),e.screenshots&&(t.screenshots=e.screenshots),e.shadows?.shadowType&&(t.shadows.shadowType=e.shadows.shadowType),e.shadows?.accumulativeShadows&&(t.shadows.accumulativeShadows=e.shadows.accumulativeShadows),e.shadows?.contactShadows&&(e.shadows.contactShadows.cameraHeight&&(t.shadows.contactShadows.cameraHeight=e.shadows.contactShadows.cameraHeight),e.shadows.contactShadows.intensity&&(t.shadows.contactShadows.intensity=e.shadows.contactShadows.intensity),e.shadows.contactShadows.planeLength&&(t.shadows.contactShadows.planeLength=e.shadows.contactShadows.planeLength),e.shadows.contactShadows.planeWidth&&(t.shadows.contactShadows.planeWidth=e.shadows.contactShadows.planeWidth),e.shadows.contactShadows.softness&&(t.shadows.contactShadows.softness=e.shadows.contactShadows.softness)),e.hotspots?.showNavigationButtons!==void 0&&(t.hotspots.showNavigationButtons=e.hotspots.showNavigationButtons)}}class BH extends FT{constructor({nexusApiResultPayload:e,appWcRef:t}){super(),this.__needsRootPlug=!1,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this._data.product_data.settings&&this._deepCopyProductSettings(this._data.product_data.settings);const i=this._data.product_data.assets;if(Object.values(i).length===1){const a=Object.values(i)[0];a?.proxyGeo?window.epigraph.logger.warn({title:"Single asset experience detected and a proxy was provided. Please ensure that the proxy provided has a root plug in it. Expand for the asset config used...",details:a,contextOverride:"ASSET COLLECTION"}):(a.proxyGeo="https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/staging-assets/pipeline-assets/3d-assets/proxies/null-proxy.glb",this.__needsRootPlug=!0,a.autoGenerateProxyEntity=!0)}}async __parseAssets(){return this.__assetCollection=new TH(this._data.product_data.assets,this._appWcRef),await this.__assetCollection.initialize(),this.__needsRootPlug&&this.__assetCollection.getFirstAsset()?.proxyGltf?.plugs.push(new Jr({name:"root@plug",isPrimary:!0,connectionId:"root",position:new se,rotation:new bn})),this.__assetCollection}getAssetCollection(){return this.__assetCollection}__parseProductVariants(){this.__productVariantCollection=new RH(this._data.product_data.product.productVariants,this._data.product_data.product.id)}get productVariantCollection(){return this.__productVariantCollection}async initialize(){await this.__parseAssets(),await this.__parseProductVariants()}getExperienceDataSettings(){return{}}}var wh=function(){var o=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(A){A.preventDefault(),i(++o%e.children.length)},!1);function t(A){return e.appendChild(A.dom),A}function i(A){for(var _=0;_<e.children.length;_++)e.children[_].style.display=_===A?"block":"none";o=A}var a=(performance||Date).now(),l=a,h=0,d=t(new wh.Panel("FPS","#0ff","#002")),p=t(new wh.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var g=t(new wh.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){a=(performance||Date).now()},end:function(){h++;var A=(performance||Date).now();if(p.update(A-a,200),A>=l+1e3&&(d.update(h*1e3/(A-l),100),l=A,h=0,g)){var _=performance.memory;g.update(_.usedJSHeapSize/1048576,_.jsHeapSizeLimit/1048576)}return A},update:function(){a=this.end()},domElement:e,setMode:i}};wh.Panel=function(o,e,t){var i=1/0,a=0,l=Math.round,h=l(window.devicePixelRatio||1),d=80*h,p=48*h,g=3*h,A=2*h,_=3*h,b=15*h,w=74*h,E=30*h,C=document.createElement("canvas");C.width=d,C.height=p,C.style.cssText="width:80px;height:48px";var T=C.getContext("2d");return T.font="bold "+9*h+"px Helvetica,Arial,sans-serif",T.textBaseline="top",T.fillStyle=t,T.fillRect(0,0,d,p),T.fillStyle=e,T.fillText(o,g,A),T.fillRect(_,b,w,E),T.fillStyle=t,T.globalAlpha=.9,T.fillRect(_,b,w,E),{dom:C,update:function(x,P){i=Math.min(i,x),a=Math.max(a,x),T.fillStyle=t,T.globalAlpha=1,T.fillRect(0,0,d,b),T.fillStyle=e,T.fillText(l(x)+" "+o+" ("+l(i)+"-"+l(a)+")",g,A),T.drawImage(C,_+h,b,w-h,E,_,b,w-h,E),T.fillRect(_+w-h,b,h,E),T.fillStyle=t,T.globalAlpha=.9,T.fillRect(_+w-h,b,h,l((1-x/P)*E))}}};class as extends Yf{constructor(){super(),this._loggerContext="DEBUG MANAGER",this.stats=new wh}static{this.webComponentName="debug-manager"}static setupWebComponent(){window.customElements.get(as.webComponentName)||window.customElements.define(as.webComponentName,as)}static{this.styles=ct`
|
|
8363
8363
|
.debug-label {
|
|
8364
8364
|
position: absolute;
|
|
8365
8365
|
top: 0%;
|