1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7111],{87111:(e,t,i)=>{i.r(t),i.d(t,{VirtualTourPlugin:()=>W,events:()=>o});var s=i(12690),r=i(85339),n=Object.defineProperty,o={};((e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0})})(o,{EnterArrowEvent:()=>h,LeaveArrowEvent:()=>p,NodeChangedEvent:()=>l});var a=class e extends s.TypedEvent{constructor(t,i){super(e.type),this.node=t,this.data=i}};a.type="node-changed";var l=a,d=class e extends s.TypedEvent{constructor(t,i){super(e.type),this.link=t,this.node=i}};d.type="enter-arrow";var h=d,c=class e extends s.TypedEvent{constructor(t,i){super(e.type),this.link=t,this.node=i}};c.type="leave-arrow";var p=c,u=class extends r.B69{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new r.I9Y(.5,.5),this.addEventListener("removed",function(){this.traverse(function(e){e.element instanceof e.element.ownerDocument.defaultView.Element&&null!==e.element.parentNode&&e.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}},m=new r.Pq0,g=new r.kn4,v=new r.kn4,f=new r.Pq0,w=new r.Pq0,y=class{constructor(e={}){let t,i,s,r,n=this,o={objects:new WeakMap},a=void 0!==e.element?e.element:document.createElement("div");a.style.overflow="hidden",this.domElement=a,this.getSize=function(){return{width:t,height:i}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),g.copy(t.matrixWorldInverse),v.multiplyMatrices(t.projectionMatrix,g),function e(t,i,l){if(!1===t.visible)return void function e(t){t.isCSS2DObject&&(t.element.style.display="none");for(let i=0,s=t.children.length;i<s;i++)e(t.children[i])}(t);if(t.isCSS2DObject){var d,h;m.setFromMatrixPosition(t.matrixWorld),m.applyMatrix4(v);let e=m.z>=-1&&m.z<=1&&!0===t.layers.test(l.layers),c=t.element;c.style.display=!0===e?"":"none",!0===e&&(t.onBeforeRender(n,i,l),c.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(m.x*s+s)+"px,"+(-m.y*r+r)+"px)",c.parentNode!==a&&a.appendChild(c),t.onAfterRender(n,i,l));let p={distanceToCameraSquared:(d=l,h=t,f.setFromMatrixPosition(d.matrixWorld),w.setFromMatrixPosition(h.matrixWorld),f.distanceToSquared(w))};o.objects.set(t,p)}for(let s=0,r=t.children.length;s<r;s++)e(t.children[s],i,l)}(e,e,t),function(e){let t=(function(e){let t=[];return e.traverseVisible(function(e){e.isCSS2DObject&&t.push(e)}),t})(e).sort(function(e,t){return e.renderOrder!==t.renderOrder?t.renderOrder-e.renderOrder:o.objects.get(e).distanceToCameraSquared-o.objects.get(t).distanceToCameraSquared}),i=t.length;for(let e=0,s=t.length;e<s;e++)t[e].element.style.zIndex=i-e}(e)},this.setSize=function(e,n){t=e,i=n,s=t/2,r=i/2,a.style.width=e+"px",a.style.height=n+"px"}}},_=new r.Pq0,k=new r.PTz,E=new r.Pq0,P=class extends r.B69{constructor(e=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(e){e.element instanceof e.element.ownerDocument.defaultView.Element&&null!==e.element.parentNode&&e.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}},N=new r.kn4,x=new r.kn4,S=class{constructor(e={}){let t,i,s,r,n=this,o={camera:{style:""},objects:new WeakMap},a=void 0!==e.element?e.element:document.createElement("div");a.style.overflow="hidden",this.domElement=a;let l=document.createElement("div");l.style.transformOrigin="0 0",l.style.pointerEvents="none",a.appendChild(l);let d=document.createElement("div");function h(e){return 1e-10>Math.abs(e)?0:e}function c(e){let t=e.elements;return"matrix3d("+h(t[0])+","+h(-t[1])+","+h(t[2])+","+h(t[3])+","+h(t[4])+","+h(-t[5])+","+h(t[6])+","+h(t[7])+","+h(t[8])+","+h(-t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(-t[13])+","+h(t[14])+","+h(t[15])+")"}function p(e){let t=e.elements;return"translate(-50%,-50%)"+("matrix3d("+h(t[0])+","+h(t[1])+","+h(t[2])+","+h(t[3])+","+h(-t[4])+","+h(-t[5])+","+h(-t[6])+","+h(-t[7])+","+h(t[8])+","+h(t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(t[13])+","+h(t[14])+","+h(t[15]))+")"}
1d.style.transformStyle="preserve-3d",l.appendChild(d),this.getSize=function(){return{width:t,height:i}},this.render=function(e,a){let u,m,g=a.projectionMatrix.elements[5]*r;a.view&&a.view.enabled?(l.style.transform=`translate( ${-a.view.offsetX*(t/a.view.width)}px, ${-a.view.offsetY*(i/a.view.height)}px )`,l.style.transform+=`scale( ${a.view.fullWidth/a.view.width}, ${a.view.fullHeight/a.view.height} )`):l.style.transform="",!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===a.parent&&!0===a.matrixWorldAutoUpdate&&a.updateMatrixWorld(),a.isOrthographicCamera&&(u=-(a.right+a.left)/2,m=(a.top+a.bottom)/2);let v=a.view&&a.view.enabled?a.view.height/a.view.fullHeight:1,f=a.isOrthographicCamera?`scale( ${v} )scale(`+g+")translate("+h(u)+"px,"+h(m)+"px)"+c(a.matrixWorldInverse):`scale( ${v} )translateZ(`+g+"px)"+c(a.matrixWorldInverse),w=(a.isPerspectiveCamera?"perspective("+g+"px) ":"")+f+"translate("+s+"px,"+r+"px)";o.camera.style!==w&&(d.style.transform=w,o.camera.style=w),function e(t,i,s,r){if(!1===t.visible)return void function e(t){t.isCSS3DObject&&(t.element.style.display="none");for(let i=0,s=t.children.length;i<s;i++)e(t.children[i])}(t);if(t.isCSS3DObject){let e=!0===t.layers.test(s.layers),r=t.element;if(r.style.display=!0===e?"":"none",!0===e){let e;t.onBeforeRender(n,i,s),t.isCSS3DSprite?(N.copy(s.matrixWorldInverse),N.transpose(),0!==t.rotation2D&&N.multiply(x.makeRotationZ(t.rotation2D)),t.matrixWorld.decompose(_,k,E),N.setPosition(_),N.scale(E),N.elements[3]=0,N.elements[7]=0,N.elements[11]=0,N.elements[15]=1,e=p(N)):e=p(t.matrixWorld);let a=o.objects.get(t);if(void 0===a||a.style!==e){r.style.transform=e;let i={style:e};o.objects.set(t,i)}r.parentNode!==d&&d.appendChild(r),t.onAfterRender(n,i,s)}}for(let n=0,o=t.children.length;n<o;n++)e(t.children[n],i,s,r)}(e,e,a,f)},this.setSize=function(e,n){t=e,i=n,s=t/2,r=i/2,a.style.width=e+"px",a.style.height=n+"px",l.style.width=e+"px",l.style.height=n+"px",d.style.width=e+"px",d.style.height=n+"px"}}},b="tourLink",C="__tour-link__",M={className:"psv-virtual-tour-tooltip",content:'<div class="psv-virtual-tour-loader"><div></div><div></div><div></div></div>'},L="arrow",T=class extends s.AbstractComponent{constructor(e,t){super(e,{className:"psv-virtual-tour-arrows"}),this.plugin=t,this.renderer=this.is3D?new S({element:this.container}):new y({element:this.container}),this.camera=this.is3D?new r.ubm(30,1):null,this.scene=new r.Z58,this.viewer.addEventListener(s.events.ReadyEvent.type,this,{once:!0}),this.viewer.addEventListener(s.events.PositionUpdatedEvent.type,this),this.viewer.addEventListener(s.events.SizeUpdatedEvent.type,this),this.viewer.addEventListener(s.events.RenderEvent.type,this),this.viewer.addEventListener(s.events.ClickEvent.type,this),this.container.addEventListener("mouseenter",this,!0),this.container.addEventListener("mouseleave",this,!0),this.container.addEventListener("mousemove",this,!0),this.container.addEventListener("contextmenu",e=>e.preventDefault())}get is3D(){return this.plugin.is3D}get arrowsPosition(){return this.plugin.config.arrowsPosition}get arrowStyle(){return this.plugin.config.arrowStyle}init(){this.is3D&&(this.gallery=this.viewer.getPlugin("gallery"),this.gallery?.addEventListener("show-gallery",this),this.gallery?.addEventListener("hide-gallery",this))}destroy(){this.viewer.removeEventListener(s.events.ReadyEvent.type,this),this.viewer.removeEventListener(s.events.PositionUpdatedEvent.type,this),this.viewer.removeEventListener(s.events.SizeUpdatedEvent.type,this),this.viewer.removeEventListener(s.events.RenderEvent.type,this),this.viewer.removeEventListener(s.events.ClickEvent.type,this),this.gallery?.removeEventListener("show-gallery",this),this.gallery?.removeEventListener("hide-gallery",this),super.destroy()}handleEvent(e){switch(e.type){case s.events.ReadyEvent.type:case s.events.SizeUpdatedEvent.type:case s.events.PositionUpdatedEvent.type:this.__updateCamera();break;case s.events.RenderEvent.type:this.render();break;case s.events.ClickEvent.type:{if(e.data.rightclick)break;let t=this.__getTargetLink(e.data.target,!0);t&&this.plugin.setCurrentNode(t.nodeId,null,t);break}case"mouseenter":{let t=this.__getTargetLink(s.utils.getEventTarget(e));t&&this.plugin.__onEnterArrow(t,e);break}case"mouseleave":{let t=this.__getTargetLink(s.utils.getEventTarget(e));t&&this.plugin.__onLeaveArrow(t);break}case"mousemove":this.__getTargetLink(s.utils.getEventTarget(e),!0)&&this.plugin.__onHoverArrow(e);break;case"hide-gallery":this.__onToggleGallery(!1);break;case"show-gallery":e.fullscreen||this.__onToggleGallery(!0)}}__updateCamera(){let e=this.viewer.getSize();if(this.renderer.setSize(e.width,e.height),this.is3D){let t=this.viewer.getPosition();t.pitch=r.cj9.clamp(t.pitch,-this.arrowsPosition.maxPitch,-this.arrowsPosition.minPitch),this.viewer.dataHelper.sphericalCoordsToVector3(t,this.camera.position,2*e.height).negate(),this.camera.lookAt(0,0,0),this.camera.translateY(e.height/3),this.camera.updateProjectionMatrix()}}
1render(){if(this.is3D){let e=this.viewer.getPosition(),t=[],i=Number.MAX_SAFE_INTEGER;this.scene.children.forEach(r=>{let n=r.userData[L];if(n.conflict){let o=Math.abs(s.utils.getShortestArc(e.yaw,n.yaw));i=Math.min(i,o),t.push([r,o])}}),t.forEach(([e,t])=>{let s=t!==i;e.element.style.opacity=s?"0.5":null,e.element.style.zIndex=s?"-1":null}),this.renderer.render(this.scene,this.camera)}else this.renderer.render(this.scene,this.viewer.renderer.camera)}clear(){this.scene.clear()}__buildArrowElement(e,t){if(t?.image){let e=document.createElement("img");return e.src=t.image,e}if(t?.element)if("function"==typeof t.element)return t.element(e);else return t.element}addLinkArrow(e,t,i=1){let r=this.__buildArrowElement(e,e.arrowStyle);r||(r=this.__buildArrowElement(e,this.arrowStyle)),r[b]=e;let n={...this.arrowStyle,...e.arrowStyle};if(r.classList.add("psv-virtual-tour-link"),n.className&&s.utils.addClasses(r,n.className),n.style&&Object.assign(r.style,n.style),this.is3D){r.style.width=1.5*n.size.width+"px",r.style.height=1.5*n.size.height+"px";let e=!1;this.scene.children.forEach(i=>{let r=i.userData[L];Math.abs(s.utils.getShortestArc(r.yaw,t.yaw))<this.arrowsPosition.linkOverlapAngle&&(r.conflict=!0,e=!0)});let o=new P(r);o.userData[L]={yaw:t.yaw,conflict:e},o.rotation.set(-Math.PI/2,0,Math.PI-t.yaw),this.viewer.dataHelper.sphericalCoordsToVector3({yaw:t.yaw,pitch:0},o.position,100*i),this.scene.add(o)}else{r.style.width=n.size.width+"px",r.style.height=n.size.height+"px",r.style.pointerEvents="auto";let e=new u(r);this.viewer.dataHelper.sphericalCoordsToVector3(t,e.position),this.scene.add(e)}}__getTargetLink(e,t=!1){let i=t?s.utils.getClosest(e,".psv-virtual-tour-link"):e;return i?i[b]:void 0}__onToggleGallery(e){e?this.container.style.marginBottom=this.viewer.container.querySelector(".psv-gallery").offsetHeight+"px":this.container.style.marginBottom=""}},I=class{constructor(e,t){this.plugin=e,this.viewer=t,this.nodes={}}destroy(){}checkNode(e){if(!e.id)throw new s.PSVError("No id given for node");if(!e.panorama)throw new s.PSVError(`No panorama provided for node ${e.id}`);if(this.plugin.isGps&&!(e.gps?.length>=2))throw new s.PSVError(`No GPS position provided for node ${e.id}`);if(!this.plugin.isGps&&e.markers?.some(e=>e.gps&&!e.position))throw new s.PSVError("Cannot use GPS positioning for markers in manual mode");e.links||(s.utils.logWarn(`Node ${e.id} has no links`),e.links=[])}checkLink(e,t){if(!t.nodeId)throw new s.PSVError(`Link of node ${e.id} has no target id`);if(t.nodeId===e.id)throw new s.PSVError(`Node ${e.id} links to itself`);if(!this.plugin.isGps&&!s.utils.isExtendedPosition(t.position))throw new s.PSVError(`No position provided for link ${t.nodeId} of node ${e.id}`);if(this.plugin.isGps&&!t.gps)throw new s.PSVError(`No GPS position provided for link ${t.nodeId} of node ${e.id}`)}},O=class extends I{async loadNode(e){if(this.nodes[e])return this.nodes[e];throw new s.PSVError(`Node ${e} not found`)}setNodes(e){if(!e?.length)throw new s.PSVError("No nodes provided");let t={},i={};e.forEach(e=>{if(this.checkNode(e),t[e.id])throw new s.PSVError(`Duplicate node ${e.id}`);t[e.id]=e}),e.forEach(e=>{this.__checkLinks(e,t),e.links.forEach(e=>{i[e.nodeId]=!0})}),e.forEach(e=>{i[e.id]||s.utils.logWarn(`Node ${e.id} is never linked to`)}),this.nodes=t}updateNode(e){if(!e.id)throw new s.PSVError("No id given for node");let t=this.nodes[e.id];if(!t)throw new s.PSVError(`Node ${e.id} does not exist`);return Object.assign(t,e),this.checkNode(t),this.__checkLinks(t,this.nodes),t}__checkLinks(e,t){e.links.forEach(i=>{if(!t[i.nodeId])throw new s.PSVError(`Target node ${i.nodeId} of node ${e.id} does not exists`);i.gps=i.gps||t[i.nodeId].gps,this.checkLink(e,i)})}},A=class extends I{constructor(e,t){if(super(e,t),!e.config.getNode)throw new s.PSVError("Missing getNode() option.");this.nodeResolver=e.config.getNode}async loadNode(e){if(this.nodes[e])return this.nodes[e];{let t=await this.nodeResolver(e);return this.checkNode(t),t.links.forEach(e=>{this.checkLink(t,e)}),this.nodes[e]=t,t}}clearCache(){this.nodes={}}};function V(e,t){var i,r;let n=D(e),o=D(t),a=e[2]??0,l=t[2]??0,d=0;return a!==l&&(d=Math.atan((l-a)/(i=n,r=o,6371e3*s.utils.greatArcDistance(i,r)))),{yaw:function(e,t){let[i,s]=e,[r,n]=t;return Math.atan2(Math.sin(r-i)*Math.cos(n),Math.cos(s)*Math.sin(n)-Math.sin(s)*Math.cos(n)*Math.cos(r-i))}(n,o),pitch:d}}function D(e){return[r.cj9.degToRad(e[0]),r.cj9.degToRad(e[1])]}var j=s.utils.getConfigParser({dataMode:"client",positionMode:"manual",renderMode:"3d",nodes:null,getNode:null,startNodeId:null,preload:!1,transitionOptions:{showLoader:!0,speed:"20rpm",effect:"fade",rotation:!0},linksOnCompass:!0,showLinkTooltip:!0,getLinkTooltip:null,arrowStyle:{element:()=>{let e=document.createElement("button");
1return e.className="psv-virtual-tour-arrow",e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">\n <path fill-rule="even-odd" fill="currentColor" d="\n M50,50 m45,0\n a45,45 0 1,0 -90,0\n a45,45 0 1,0 90,0\n\n M50,50 m38,0\n a38,38 0 0,1 -76,0\n a38,38 0 0,1 76,0\n\n M50,50 m30,0\n a30,30 0 1,0 -60,0\n a30,30 0 1,0 60,0\n \n M50,40 m2.5,-2.5\n l17.5,17.5\n a 2.5,2.5 0 0 1 -5,5\n l-15,-15\n l-15,15\n a 2.5,2.5 0 0 1 -5,-5\n l17.5,-17.5\n a 3.5,3.5 0 0 1 5,0\n "/>\n</svg>',e},size:{width:80,height:80}},arrowsPosition:{minPitch:.3,maxPitch:Math.PI/2,linkOverlapAngle:Math.PI/4,linkPitchOffset:-.1},map:null},{dataMode(e){if("client"!==e&&"server"!==e)throw new s.PSVError("VirtualTourPlugin: invalid dataMode");return e},positionMode(e){if("gps"!==e&&"manual"!==e)throw new s.PSVError("VirtualTourPlugin: invalid positionMode");return e},renderMode(e){if("3d"!==e&&"2d"!==e)throw new s.PSVError("VirtualTourPlugin: invalid renderMode");return e},arrowsPosition:(e,{defValue:t})=>({...t,...e}),arrowStyle:(e,{defValue:t})=>({...t,...e}),map(e,{rawConfig:t}){if(e){if("server"===t.dataMode)return s.utils.logWarn("VirtualTourPlugin: The map cannot be used in server side mode"),null;if(!e.imageUrl)return s.utils.logWarn('VirtualTourPlugin: configuring the map requires at least "imageUrl"'),null;"recenter"in e||(e.recenter=!0)}return e}}),z=class e extends s.AbstractConfigurablePlugin{constructor(e,t){super(e,t),this.state={currentNode:null,currentTooltip:null,loadingNode:null,preload:{}},this.arrowsRenderer=new T(this.viewer,this)}get is3D(){return"3d"===this.config.renderMode}get isServerSide(){return"server"===this.config.dataMode}get isGps(){return"gps"===this.config.positionMode}static withConfig(t){return[e,t]}init(){super.init(),this.arrowsRenderer.init(),s.utils.checkStylesheet(this.viewer.container,"virtual-tour
1-plugin"),this.markers=this.viewer.getPlugin("markers"),this.compass=this.viewer.getPlugin("compass"),this.markers?.config.markers&&(s.utils.logWarn("No default markers can be configured on the MarkersPlugin when using the VirtualTourPlugin. Consider defining `markers` on each tour node."),delete this.markers.config.markers),this.isGps&&(this.plan=this.viewer.getPlugin("plan")),this.isServerSide||(this.gallery=this.viewer.getPlugin("gallery"),this.map=this.viewer.getPlugin("map"),this.config.map&&!this.map&&s.utils.logWarn("The map is configured on the VirtualTourPlugin but the MapPlugin is not loaded.")),this.datasource=this.isServerSide?new A(this,this.viewer):new O(this,this.viewer),this.map&&(this.map.addEventListener("select-hotspot",this),this.map.setImage(this.config.map.imageUrl)),this.plan?.addEventListener("select-hotspot",this),this.isServerSide?this.config.startNodeId&&this.setCurrentNode(this.config.startNodeId):this.config.nodes&&(this.setNodes(this.config.nodes,this.config.startNodeId),delete this.config.nodes)}destroy(){this.map?.removeEventListener("select-hotspot",this),this.plan?.removeEventListener("select-hotspot",this),this.datasource.destroy(),this.arrowsRenderer.destroy(),delete this.datasource,delete this.markers,delete this.compass,delete this.gallery,delete this.arrowsRenderer,super.destroy()}handleEvent(e){if(e instanceof s.events.ClickEvent){let t=e.data.objects.find(e=>e.userData[b])?.userData[b];t&&this.setCurrentNode(t.nodeId,null,t)}else if("select-hotspot"===e.type){let t=e.hotspotId;t.startsWith(C)&&this.setCurrentNode(t.substring(C.length))}}getCurrentNode(){return this.state.currentNode}setNodes(e,t){if(this.isServerSide)throw new s.PSVError("Cannot set nodes in server side mode");this.__hideTooltip(),this.state.currentNode=null,this.datasource.setNodes(e),t?this.datasource.nodes[t]||(t=e[0].id,s.utils.logWarn(`startNodeId not found is provided nodes, resetted to ${t}`)):t=e[0].id,this.setCurrentNode(t),this.__setGalleryItems(),this.__setMapHotspots(),this.__setPlanHotspots()}setCurrentNode(e,t,i){if(e===this.state.currentNode?.id&&!t?.forceUpdate)return Promise.resolve(!0);t?.forceUpdate&&this.isServerSide&&this.datasource.clearCache(),this.viewer.hideError(),this.state.loadingNode=e;let r=this.state.currentNode,n=r&&i?this.__getLinkPosition(r,i):null;return Promise.resolve(this.state.preload[e]).then(()=>{if(this.state.loadingNode!==e)throw s.utils.getAbortError();return this.datasource.loadNode(e)}).then(o=>{if(this.state.loadingNode!==e)throw s.utils.getAbortError();let a={...j.defaults.transitionOptions,rotateTo:n,zoomTo:n?this.viewer.getZoomLevel():null,..."function"==typeof this.config.transitionOptions?this.config.transitionOptions(o,r,i):this.config.transitionOptions,...t};return(a.effect||(a.effect="none"),this.viewer.panel.hide("description"),this.__hideTooltip(),this.arrowsRenderer.clear(),this.gallery?.config.hideOnClick&&this.gallery.hide(),this.map?.config.minimizeOnHotspotClick&&this.map.minimize(),this.plan?.config.minimizeOnHotspotClick&&this.plan.minimize(),a.rotation&&"none"===a.effect)?this.viewer.animate({...a.rotateTo,zoom:a.zoomTo,speed:a.speed}).then(()=>[o,a]):Promise.resolve([o,a])}).then(([t,i])=>{if(this.state.loadingNode!==e)throw s.utils.getAbortError();return this.markers?.clearMarkers(),this.config.linksOnCompass&&this.compass?.clearHotspots(),this.viewer.setPanorama(t.panorama,{caption:t.caption,description:t.description,panoData:t.panoData,sphereCorrection:t.sphereCorrection,showLoader:i.showLoader,position:i.rotateTo,zoom:i.zoomTo,transition:"none"!==i.effect&&{effect:i.effect,rotation:i.rotation,speed:i.speed}}).then(e=>{if(!e)throw s.utils.getAbortError();return t})}).then(t=>{if(this.state.loadingNode!==e)throw s.utils.getAbortError();return this.state.currentNode=t,this.map&&this.map.setCenter(this.__getNodeMapPosition(t)??this.map.config.center,this.config.map.recenter),this.plan?.setCoordinates(t.gps),this.__addNodeMarkers(t),this.__renderLinks(t),this.__preload(t),this.state.loadingNode=null,this.dispatchEvent(new l(t,{fromNode:r,fromLink:i,fromLinkPosition:n})),this.viewer.resetIdleTimer(),!0}).catch(e=>{if(s.utils.isAbortError(e))return!1;throw this.viewer.showError(this.viewer.config.lang.loadError),this.viewer.loader.hide(),this.viewer.navbar.
vendor: 4,670 bytes, line 1
1setCaption(""),this.state.loadingNode=null,e})}async gotoLink(e,t="8rpm"){let i=this.getLinkPosition(e);t?await this.viewer.animate({...i,speed:t}):this.viewer.rotate(i)}getLinkPosition(e){let t=this.state.currentNode?.links.find(t=>t.nodeId===e);if(!t)throw new s.PSVError(`Cannot find link "${e}"`);return this.__getLinkPosition(this.state.currentNode,t)}updateNode(e){if(this.isServerSide)throw new s.PSVError("Cannot update node in server side mode");let t=this.datasource.updateNode(e);if((e.name||e.thumbnail||e.panorama)&&this.__setGalleryItems(),(e.name||e.gps||e.map)&&this.__setMapHotspots(),(e.name||e.gps||e.plan)&&this.__setPlanHotspots(),this.state.currentNode?.id===t.id){if(this.__hideTooltip(),e.panorama||e.panoData||e.sphereCorrection)return void this.setCurrentNode(t.id,{forceUpdate:!0});e.caption&&this.viewer.setOption("caption",t.caption),e.description&&this.viewer.setOption("description",t.description),(e.links||e.gps)&&this.__renderLinks(t),e.gps&&this.plan?.setCoordinates(t.gps),(e.map||e.gps)&&this.map?.setCenter(this.__getNodeMapPosition(t)),(e.markers||e.gps)&&this.__addNodeMarkers(t)}}__setGalleryItems(){this.gallery&&this.gallery.setItems(Object.values(this.datasource.nodes).filter(e=>!1!==e.showInGallery).map(e=>({id:e.id,panorama:e.panorama,name:e.name,thumbnail:e.thumbnail})),e=>{this.setCurrentNode(e)})}__setMapHotspots(){this.map&&this.map.setHotspots(Object.values(this.datasource.nodes).filter(e=>!1!==e.map).map(e=>({tooltip:e.name,...e.map||{},...this.__getNodeMapPosition(e),id:C+e.id})))}__setPlanHotspots(){this.plan&&this.plan.setHotspots(Object.values(this.datasource.nodes).filter(e=>!1!==e.plan).map(e=>({tooltip:e.name,...e.plan||{},coordinates:e.gps,id:C+e.id})))}__renderLinks(e){this.arrowsRenderer.clear();let t=[];e.links.forEach(i=>{let s=this.__getLinkPosition(e,i);s.yaw+=i.linkOffset?.yaw??0,s.pitch+=i.linkOffset?.pitch??0,this.isGps&&!this.is3D&&(s.pitch+=this.config.arrowsPosition.linkPitchOffset),t.push(s),this.arrowsRenderer.addLinkArrow(i,s,i.linkOffset?.depth)}),this.arrowsRenderer.render(),this.config.linksOnCompass&&this.compass?.setHotspots(t)}__getLinkPosition(e,t){return this.isGps?V(e.gps,t.gps):this.viewer.dataHelper.cleanPosition(t.position)}async __getTooltipContent(e){let t=await this.datasource.loadNode(e.nodeId),i=[];(t.name||t.thumbnail||t.caption)&&(t.name&&i.push(`<h3>${t.name}</h3>`),t.thumbnail&&i.push(`<img src="${t.thumbnail}">`),t.caption&&i.push(`<p>${t.caption}</p>`));let s=i.join("");return this.config.getLinkTooltip&&(s=this.config.getLinkTooltip(s,e,t)),s}__onEnterArrow(e,t){let i=s.utils.getPosition(this.viewer.container),r={x:t.clientX-i.x,y:t.clientY-i.y};this.config.showLinkTooltip&&(this.state.currentTooltip=this.viewer.createTooltip({...M,left:r.x,top:r.y,box:{width:20,height:20}}),this.__getTooltipContent(e).then(e=>{e?this.state.currentTooltip.update(e):this.__hideTooltip()})),this.map?.setActiveHotspot(C+e.nodeId),this.plan?.setActiveHotspot(C+e.nodeId),this.dispatchEvent(new h(e,this.state.currentNode))}__onHoverArrow(e){let t=s.utils.getPosition(this.viewer.container),i={x:e.clientX-t.x,y:e.clientY-t.y};this.state.currentTooltip?.move({left:i.x,top:i.y})}__onLeaveArrow(e){this.__hideTooltip(),this.map?.setActiveHotspot(null),this.plan?.setActiveHotspot(null),this.dispatchEvent(new p(e,this.state.currentNode))}__hideTooltip(){this.state.currentTooltip?.hide(),this.state.currentTooltip=null}__preload(e){this.config.preload&&(this.state.preload[e.id]=!0,this.state.currentNode.links.filter(e=>!this.state.preload[e.nodeId]).filter(e=>"function"!=typeof this.config.preload||this.config.preload(this.state.currentNode,e)).forEach(e=>{this.state.preload[e.nodeId]=this.datasource.loadNode(e.nodeId).then(e=>this.viewer.textureLoader.preloadPanorama(e.panorama)).then(()=>{this.state.preload[e.nodeId]=!0}).catch(()=>{delete this.state.preload[e.nodeId]})}))}__addNodeMarkers(e){e.markers&&(this.markers?this.markers.setMarkers(e.markers.map(t=>(t.gps&&this.isGps&&(t.position=V(e.gps,t.gps),t.data?.map&&Object.assign(t.data.map,this.__getGpsMapPosition(t.gps)),t.data?.plan&&(t.data.plan.coordinates=t.gps)),t))):s.utils.logWarn(`Node ${e.id} markers ignored because the plugin is not loaded.`))}__getNodeMapPosition(e){let t=this.__getGpsMapPosition(e.gps);return t||(e.map?{x:e.map.x,y:e.map.y}:null)}__getGpsMapPosition(e){let t=this.config.map;return this.isGps&&t&&t.extent&&t.size?{x:r.cj9.mapLinear(e[0],t.extent[0],t.extent[2],0,t.size.width),y:r.cj9.mapLinear(e[1],t.extent[1],t.extent[3],0,t.size.height)}:null}};z.id="virtual-tour",z.VERSION="5.14.1",z.configParser=j,z.readonlyOptions=Object.keys(j.defaults);var W=z}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.