@epigraph/solutions 0.38.0-beta → 0.38.0-beta.2

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.
@@ -31,7 +31,7 @@ var xd=(o=>(o.Release="release",o.Staging="staging",o.Dev="dev",o))(xd||{});let
31
31
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
32
  * See the License for the specific language governing permissions and
33
33
  * limitations under the License.
34
- */var gS;const Yc=Symbol("analyticsPluginsMap");gS=Yc;class MM{constructor(e,t){this[gS]=new Map,this.__consentPlugin=null,e&&t&&(this.__consentPlugin=this.buildConsentPlugin(e,t)),window.addEventListener("epigraphAnalyticsConsentChange",this.__onConsentChangeFromEvent)}__onConsentChangeFromEvent(e){let t=e;this.__overrideConsent=t.detail.hasConsent;for(const i of this[Yc].values())this.__hasConsent()||i.setStatus(Vr.RESTRICTED)}addEventPlugin(e){this[Yc].has(e.getUniquePluginIdentifier())||(this[Yc].set(e.getUniquePluginIdentifier(),e),e.setupPlugin())}__hasConsent(){let e=!0;return this.__overrideConsent!==void 0?(e=this.__overrideConsent,e):(this.__consentPlugin&&(e=this.__consentPlugin.hasConsent()),e)}sendEvent(e){this[Yc].forEach(t=>{t.sendEvent(e,this.__hasConsent())})}buildConsentPlugin(e,t){return e.toLowerCase()===hS.OneTrust.toLowerCase()?new xM(t):null}}let AS=class{constructor(e,t,i,a=""){this._success=e,this._payload=t,this._status=i,this._message=a}get success(){return this._success}get payload(){return this._payload}get status(){return this._status}get message(){return this._message}};function IM(o,e,t=""){return new AS(!0,o,e,t)}function tb(o,e,t=""){return new AS(!1,o,e,t)}let I0=class{constructor(e="https://api.myepigraph.com/api/",t,i,a="",l="",h="v1/"){this.epigraphXPath="",this.epigraphComponentVersion=a,this.epigraphSessionId=i,this.epigraphXPath=l,this.baseUrl=e+h,this.epgLocation=t}async getButtonBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorByExperienceId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator/experience_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorByClientAccessKey(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator/client_access_key/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorLiteByExperienceId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator-lite/experience_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorLiteByProjectId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator-lite/project_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async postExperienceSaveAndShare(e,t){const i=`experience/${e}/save`,a=this.buildNexusUrl(i),l={save_data:JSON.stringify(t)},h=new Headers;return h.set("Content-Type","application/json"),await this.callNexusAPI(a,"POST",JSON.stringify(l),h)}async getExperienceSaveAndShare(e,t){const i=`experience/${e}/save/${t}`,a=this.buildNexusUrl(i);return await this.callNexusAPI(a,"GET")}async callNexusAPI(e,t="GET",i,a=new Headers){a=this.addRequiredHeaders(a);const l={method:t,body:i,headers:a};try{const h=await fetch(e,l),d=await h.json();if(!h.ok){let p="Unable to retrieve configurator experience";return d.message&&(p=d.message),Promise.resolve(tb(d,h.status,p))}return Promise.resolve(IM(d,h.status))}catch{return Promise.resolve(tb({},500,"Unknown error"))}}buildNexusUrl(e,t={}){let i=new URL(this.baseUrl);i.pathname+=e;for(const[a,l]of Object.entries(t))i.searchParams.set(a,l);return i}addRequiredHeaders(e){return e.has("accept")||e.set("accept","application/json"),e.has("EPG-Location")||e.set("EPG-location",this.epgLocation),e.has("EPG-Session-ID")||e.set("EPG-Session-ID",this.epigraphSessionId),e.has("EPG-XPATH")||e.set("EPG-XPATH",this.epigraphXPath),e.has("EPG-Version")||e.set("EPG-Version",this.epigraphComponentVersion),e}};var Cd=(o=>(o.PRODUCTION="https://api.myepigraph.com/api/",o.STAGING="https://nexus.epigraph.dev/api/",o.LOCAL="https://nexus.test/api/",o))(Cd||{});/**
34
+ */var gS;const Yc=Symbol("analyticsPluginsMap");gS=Yc;class MM{constructor(e,t){this[gS]=new Map,this.__consentPlugin=null,e&&t&&(this.__consentPlugin=this.buildConsentPlugin(e,t)),window.addEventListener("epigraphAnalyticsConsentChange",this.__onConsentChangeFromEvent)}__onConsentChangeFromEvent(e){let t=e;this.__overrideConsent=t.detail.hasConsent;for(const i of this[Yc].values())this.__hasConsent()||i.setStatus(Vr.RESTRICTED)}addEventPlugin(e){this[Yc].has(e.getUniquePluginIdentifier())||(this[Yc].set(e.getUniquePluginIdentifier(),e),e.setupPlugin())}__hasConsent(){let e=!0;return this.__overrideConsent!==void 0?(e=this.__overrideConsent,e):(this.__consentPlugin&&(e=this.__consentPlugin.hasConsent()),e)}sendEvent(e){this[Yc].forEach(t=>{t.sendEvent(e,this.__hasConsent())})}buildConsentPlugin(e,t){return e.toLowerCase()===hS.OneTrust.toLowerCase()?new xM(t):null}}let AS=class{constructor(e,t,i,a=""){this._success=e,this._payload=t,this._status=i,this._message=a}get success(){return this._success}get payload(){return this._payload}get status(){return this._status}get message(){return this._message}};function IM(o,e,t=""){return new AS(!0,o,e,t)}function tb(o,e,t=""){return new AS(!1,o,e,t)}let I0=class{constructor(e="https://api.myepigraph.com/api/",t,i,a="",l="",h="v1/"){this.epigraphXPath="",this.epigraphComponentVersion=a,this.epigraphSessionId=i,this.epigraphXPath=l,this.baseUrl=e+h,this.epgLocation=t}async getButtonBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getButtonByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/button/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getViewerByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/viewer/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getTourByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/tour/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerBySku(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/sku/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByShopifyVariantId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/shopify_variant_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByUpc(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/upc/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByAsin(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/asin/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getCustomizerByUuid(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/customizer/uuid/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorByExperienceId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator/experience_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorByClientAccessKey(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator/client_access_key/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorLiteByExperienceId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator-lite/experience_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async getConfiguratorLiteByProjectId(e,t=""){const i={};t!==""&&(i.version_id=t);const a=`experience/configurator-lite/project_id/${e}`,l=this.buildNexusUrl(a,i);return await this.callNexusAPI(l,"GET")}async postExperienceSaveAndShare(e,t){const i=`experience/${e}/save`,a=this.buildNexusUrl(i),l={save_data:JSON.stringify(t)},h=new Headers;return h.set("Content-Type","application/json"),await this.callNexusAPI(a,"POST",JSON.stringify(l),h)}async getExperienceSaveAndShare(e,t){const i=`experience/${e}/save/${t}`,a=this.buildNexusUrl(i);return await this.callNexusAPI(a,"GET")}async callNexusAPI(e,t="GET",i,a=new Headers){a=this.addRequiredHeaders(a);const l={method:t,body:i,headers:a};try{const h=await fetch(e,l),d=await h.json();if(!h.ok){let p="Unable to retrieve configurator experience";return d.message&&(p=d.message),Promise.resolve(tb(d,h.status,p))}return Promise.resolve(IM(d,h.status))}catch(h){return console.log(h),Promise.resolve(tb({},500,"Unknown error"))}}buildNexusUrl(e,t={}){let i=new URL(this.baseUrl);i.pathname+=e;for(const[a,l]of Object.entries(t))i.searchParams.set(a,l);return i}addRequiredHeaders(e){return e.has("accept")||e.set("accept","application/json"),e.has("EPG-Location")||e.set("EPG-location",this.epgLocation),e.has("EPG-Session-ID")||e.set("EPG-Session-ID",this.epigraphSessionId),e.has("EPG-XPATH")||e.set("EPG-XPATH",this.epigraphXPath),e.has("EPG-Version")||e.set("EPG-Version",this.epigraphComponentVersion),e}};var Cd=(o=>(o.PRODUCTION="https://api.myepigraph.com/api/",o.STAGING="https://nexus.epigraph.dev/api/",o.LOCAL="https://nexus.test/api/",o))(Cd||{});/**
35
35
  * @license
36
36
  * Copyright 2019 Google LLC
37
37
  * SPDX-License-Identifier: BSD-3-Clause
@@ -8728,7 +8728,7 @@ void main() {
8728
8728
  <div class="view-in-your-space-button ${this._hasActiveHotspot?"hide":""}">
8729
8729
  <slot name=${c0.slotCustomViewInYourSpaceButton.name} @click=${this.launchAR}></slot>
8730
8730
  </div>
8731
- `}getAllHotspotsFromScene(){const e=[];return this.sceneManager.sceneStructure.traverse(t=>{if(t instanceof Va)for(const i of t.asset.hotspots)this.hotspotsManager.addHotspot(i,!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._nexusAnalyticsPlugin=new EM({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:!1,sendToStaging:!1}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new wM({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:!1}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin))}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();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 i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.getCameras().main.aspect=i,this.cameraManager.getCameras().main.updateProjectionMatrix(),this.cameraManager.getCameras().screenshot.aspect=i,this.cameraManager.getCameras().screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToSceneBounds(!1),this.isPortraitOrientation=e<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupResizeObservers(){new ResizeObserver(t=>{for(const i of t){const{width:a,height:l}=i.target.getBoundingClientRect(),h=a*.5,d=l*.5;if(h>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const p=this.toolsetElem?.getBoundingClientRect();if(!p)continue;const m=p.width>h,A=p.height>d;this._isToolsetLargerThanTheLeftBottomQuadrant=m||A}}}).observe(this)}async _postExperienceDataInitialization(){if(!this._identifier||!this._identifierType)return Promise.resolve(!0);const e=this._experienceData.productVariantCollection.getProductVariantByIdentifierAndType(this._identifier,this._identifierType);return e?await this.spawnProductVariant(e):Promise.resolve(!1)}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){const t=this._experienceData.getAssetCollection().getAssetByName(e.asset);if(!t)return Promise.reject(!1);await t.load();const i=await this.spawnAssetInScene(t);if(!i)return Promise.reject(!1);const a=e.finish;return a?(await i.selectAssetFinish(a),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===void 0||e.success===!1)return await this._onAuthenticationFailed(e.message),Promise.reject();this._experienceData=new BH({nexusApiResultPayload:e.payload,appWcRef:this}),await this._experienceData.initialize()}async _clearAndLoadNewExperienceInScene(){this._onNewExperienceLoadStart(),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(),this.parsedUrlParams.get(lh.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}),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=Et.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("modalView")&&(this.hide=this.modalView)}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}disconnectedCallback(){super.disconnectedCallback()}showFullScreenModal(){this.hide=!1}hideFullScreenModal(){this.hide=!0}render(){return Ee`
8731
+ `}getAllHotspotsFromScene(){const e=[];return this.sceneManager.sceneStructure.traverse(t=>{if(t instanceof Va)for(const i of t.asset.hotspots)this.hotspotsManager.addHotspot(i,!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._nexusAnalyticsPlugin=new EM({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:!1,sendToStaging:!1}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new wM({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:!1}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin))}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();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 i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.getCameras().main.aspect=i,this.cameraManager.getCameras().main.updateProjectionMatrix(),this.cameraManager.getCameras().screenshot.aspect=i,this.cameraManager.getCameras().screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToSceneBounds(!1),this.isPortraitOrientation=e<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupResizeObservers(){new ResizeObserver(t=>{for(const i of t){const{width:a,height:l}=i.target.getBoundingClientRect(),h=a*.5,d=l*.5;if(h>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const p=this.toolsetElem?.getBoundingClientRect();if(!p)continue;const m=p.width>h,A=p.height>d;this._isToolsetLargerThanTheLeftBottomQuadrant=m||A}}}).observe(this)}async _postExperienceDataInitialization(){if(!this._identifier||!this._identifierType)return Promise.resolve(!0);const e=this._experienceData.productVariantCollection.getProductVariantByIdentifierAndType(this._identifier,this._identifierType);return e?await this.spawnProductVariant(e):Promise.resolve(!1)}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){const t=this._experienceData.getAssetCollection().getAssetByName(e.asset);if(!t)return Promise.reject(!1);await t.load();const i=await this.spawnAssetInScene(t);if(!i)return Promise.reject(!1);const a=e.finish;return a?(await i.selectAssetFinish(a),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(console.log(e),e===void 0||e.success===!1)return await this._onAuthenticationFailed(e.message),Promise.reject();this._experienceData=new BH({nexusApiResultPayload:e.payload,appWcRef:this}),await this._experienceData.initialize()}async _clearAndLoadNewExperienceInScene(){this._onNewExperienceLoadStart(),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(),this.parsedUrlParams.get(lh.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}),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=Et.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("modalView")&&(this.hide=this.modalView)}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}disconnectedCallback(){super.disconnectedCallback()}showFullScreenModal(){this.hide=!1}hideFullScreenModal(){this.hide=!0}render(){return Ee`
8732
8732
  ${Et.getCustomStylesTemplate()}
8733
8733
 
8734
8734
  <epg-button-icon
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/solutions",
3
- "version": "0.38.0-beta",
3
+ "version": "0.38.0-beta.2",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-solutions.js",
6
6
  "files": [