(function(h,e){"object"===typeof exports&&"undefined"!==typeof module?e(exports,require("three")):"function"===typeof define&&define.amd?define(["exports","three"],e):(h=h||self,e(h.PANOLENS={},h.THREE))})(this,function(h,e){function S(a){this.constraints=Object.assign({video:{width:{ideal:1920},height:{ideal:1080},facingMode:{exact:"environment"}},audio:!1},a);this.element=this.scene=this.container=null;this.devices=[];this.stream=null;this.ratioScalar=1;this.videoDeviceIndex=0}function M(a,b,c){a= void 0===a?16777215:a;b=void 0===b?!0:b;c=void 0===c?1500:c;this.dpr=window.devicePixelRatio;var d=this.createCanvas(),g=d.canvas;d=d.context;var k=new e.SpriteMaterial({color:a,map:this.createCanvasTexture(g)});e.Sprite.call(this,k);this.canvasWidth=g.width;this.canvasHeight=g.height;this.context=d;this.color=a instanceof e.Color?a:new e.Color(a);this.autoSelect=b;this.dwellTime=c;this.rippleDuration=500;this.position.z=-10;this.center.set(.5,.5);this.scale.set(.5,.5,1);this.callback=this.timerId= this.startTimestamp=null;this.frustumCulled=!1;this.updateCanvasArcByProgress(0)}function z(a,b,c){a=void 0===a?300:a;b=b||u.Info;e.Sprite.call(this);this.type="infospot";this.animated=void 0!==c?c:!0;this.frustumCulled=this.isHovering=!1;this.cursorStyle=this.toPanorama=this.element=null;this.mode=t.NORMAL;this.scale.set(a,a,1);this.rotation.y=Math.PI;this.container=null;this.originalRaycast=this.raycast;this.HANDLER_FOCUS=null;this.material.side=e.DoubleSide;this.material.depthTest=!1;this.material.transparent= !0;this.material.opacity=0;this.scaleUpAnimation=new r.Tween;this.scaleDownAnimation=new r.Tween;c=function(d){if(this.material){var b=d.image.width/d.image.height,c=new e.Vector3;d.image.width=d.image.naturalWidth||64;d.image.height=d.image.naturalHeight||64;this.scale.set(b*a,a,1);c.copy(this.scale);this.scaleUpAnimation=(new r.Tween(this.scale)).to({x:1.3*c.x,y:1.3*c.y},500).easing(r.Easing.Elastic.Out);this.scaleDownAnimation=(new r.Tween(this.scale)).to({x:c.x,y:c.y},500).easing(r.Easing.Elastic.Out); this.material.map=d;this.material.needsUpdate=!0}}.bind(this);this.showAnimation=(new r.Tween(this.material)).to({opacity:1},500).onStart(this.enableRaycast.bind(this,!0)).easing(r.Easing.Quartic.Out);this.hideAnimation=(new r.Tween(this.material)).to({opacity:0},500).onStart(this.enableRaycast.bind(this,!1)).easing(r.Easing.Quartic.Out);this.addEventListener("click",this.onClick);this.addEventListener("hover",this.onHover);this.addEventListener("hoverenter",this.onHoverStart);this.addEventListener("hoverleave", this.onHoverEnd);this.addEventListener("panolens-dual-eye-effect",this.onDualEyeEffect);this.addEventListener("panolens-container",this.setContainer.bind(this));this.addEventListener("dismiss",this.onDismiss);this.addEventListener("panolens-infospot-focus",this.setFocusMethod);N.load(b,c)}function I(a){a||console.warn("PANOLENS.Widget: No container specified");e.EventDispatcher.call(this);this.DEFAULT_TRANSITION="all 0.27s ease";this.TOUCH_ENABLED=!!("ontouchstart"in window||window.DocumentTouch&& document instanceof DocumentTouch);this.PREVENT_EVENT_HANDLER=function(a){a.preventDefault();a.stopPropagation()};this.container=a;this.mask=this.activeSubMenu=this.activeMainItem=this.mainMenu=this.settingElement=this.videoElement=this.fullscreenElement=this.barElement=null}function n(a,b){e.Mesh.call(this,a,b);this.type="panorama";this.ImageQualityLow=1;this.ImageQualityFair=2;this.ImageQualityMedium=3;this.ImageQualityHigh=4;this.ImageQualitySuperHigh=5;this.animationDuration=1E3;this.defaultInfospotSize= 350;this.container=void 0;this.loaded=!1;this.linkedSpots=[];this.isInfospotVisible=!1;this.linkingImageScale=this.linkingImageURL=void 0;this.material.side=e.BackSide;this.material.opacity=0;this.scale.x*=-1;this.renderOrder=-1;this.active=!1;this.infospotAnimation=(new r.Tween(this)).to({},this.animationDuration/2);this.addEventListener("load",this.fadeIn.bind(this));this.addEventListener("panolens-container",this.setContainer.bind(this));this.addEventListener("click",this.onClick.bind(this));this.setupTransitions()} function y(a,b,c){b=b||new e.SphereBufferGeometry(5E3,60,40);c=c||new e.MeshBasicMaterial({opacity:0,transparent:!0});n.call(this,b,c);this.src=a;this.radius=5E3}function W(){var a=new e.BufferGeometry,b=new e.MeshBasicMaterial({color:0,opacity:0,transparent:!0});a.addAttribute("position",new e.BufferAttribute(new Float32Array,1));n.call(this,a,b)}function F(a){a=void 0===a?[]:a;var b=Object.assign({},e.ShaderLib.cube),c=new e.BoxBufferGeometry(1E4,1E4,1E4);b=new e.ShaderMaterial({fragmentShader:b.fragmentShader, vertexShader:b.vertexShader,uniforms:b.uniforms,side:e.BackSide,transparent:!0});n.call(this,c,b);this.images=a;this.edgeLength=1E4;this.material.uniforms.opacity.value=0}function O(){for(var a=[],b=0;6>b;b++)a.push(u.WhiteTile);F.call(this,a)}function B(a,b){b=void 0===b?{}:b;var c=new e.SphereBufferGeometry(5E3,60,40),d=new e.MeshBasicMaterial({opacity:0,transparent:!0});n.call(this,c,d);this.src=a;this.options={videoElement:document.createElement("video"),loop:!0,muted:!0,autoplay:!1,playsinline:!0, crossOrigin:"anonymous"};Object.assign(this.options,b);this.videoElement=this.options.videoElement;this.videoProgress=0;this.radius=5E3;this.addEventListener("leave",this.pauseVideo.bind(this));this.addEventListener("enter-fade-start",this.resumeVideoProgress.bind(this));this.addEventListener("video-toggle",this.toggleVideo.bind(this));this.addEventListener("video-time",this.setVideoCurrentTime.bind(this))}function P(a){this._parameters=a=void 0===a?{}:a;this._panoId=this._zoom=null;this._panoClient= new google.maps.StreetViewService;this._total=this._count=0;this._canvas=[];this._ctx=[];this._hc=this._wc=0;this.result=null;this.rotation=0;this.copyright="";this.onPanoramaLoad=this.onSizeChange=null;this.levelsW=[1,2,4,7,13,26];this.levelsH=[1,1,2,4,7,13];this.widths=[416,832,1664,3328,6656,13312];this.heights=[416,416,832,1664,3328,6656];this.maxH=this.maxW=6656;var b;try{var c=document.createElement("canvas");(b=c.getContext("experimental-webgl"))||(b=c.getContext("webgl"))}catch(d){}this.maxW= Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxW);this.maxH=Math.max(b.getParameter(b.MAX_TEXTURE_SIZE),this.maxH)}function Z(a,b){y.call(this);this.panoId=a;this.gsvLoader=null;this.loadRequested=!1;this.setupGoogleMapAPI(b)}function C(a,b,c,d){c=void 0===c?1E4:c;d=void 0===d?.5:d;"image"===(void 0===a?"image":a)&&y.call(this,b,this.createGeometry(c,d),this.createMaterial(c));this.size=c;this.ratio=d;this.EPS=1E-6;this.frameId=null;this.dragging=!1;this.userMouse=new e.Vector2;this.quatA=new e.Quaternion; this.quatB=new e.Quaternion;this.quatCur=new e.Quaternion;this.quatSlerp=new e.Quaternion;this.vectorX=new e.Vector3(1,0,0);this.vectorY=new e.Vector3(0,1,0);this.addEventListener("window-resize",this.onWindowResize)}function aa(a,b,c){C.call(this,"image",a,b,c)}function J(a){var b=new e.SphereBufferGeometry(5E3,60,40),c=new e.MeshBasicMaterial({visible:!1});n.call(this,b,c);this.media=new S(a);this.radius=5E3;this.addEventListener("enter",this.start.bind(this));this.addEventListener("leave",this.stop.bind(this)); this.addEventListener("panolens-container",this.onPanolensContainer.bind(this));this.addEventListener("panolens-scene",this.onPanolensScene.bind(this))}function ba(a,b){function c(a){Q=!1;K=L=0;if(!1!==f.enabled){a.preventDefault();if(a.button===f.mouseButtons.ORBIT){if(!0===f.noRotate)return;x=w.ROTATE;D.set(a.clientX,a.clientY)}else if(a.button===f.mouseButtons.ZOOM){if(!0===f.noZoom)return;x=w.DOLLY;y.set(a.clientX,a.clientY)}else if(a.button===f.mouseButtons.PAN){if(!0===f.noPan)return;x=w.PAN; n.set(a.clientX,a.clientY)}x!==w.NONE&&(document.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",g,!1),f.dispatchEvent(O));f.update()}}function d(a){if(!1!==f.enabled){a.preventDefault();var d=f.domElement===document?f.domElement.body:f.domElement;if(x===w.ROTATE){if(!0===f.noRotate)return;h.set(a.clientX,a.clientY);r.subVectors(h,D);f.rotateLeft(2*Math.PI*r.x/d.clientWidth*f.rotateSpeed);f.rotateUp(2*Math.PI*r.y/d.clientHeight*f.rotateSpeed);D.copy(h);G&&(K=a.clientX-G.clientX, L=a.clientY-G.clientY);G=a}else if(x===w.DOLLY){if(!0===f.noZoom)return;z.set(a.clientX,a.clientY);T.subVectors(z,y);0T.y&&f.dollyOut();y.copy(z)}else if(x===w.PAN){if(!0===f.noPan)return;U.set(a.clientX,a.clientY);t.subVectors(U,n);f.pan(t.x,t.y);n.copy(U)}x!==w.NONE&&f.update()}}function g(){Q=!0;G=void 0;!1!==f.enabled&&(document.removeEventListener("mousemove",d,!1),document.removeEventListener("mouseup",g,!1),f.dispatchEvent(P),x=w.NONE)}function k(a){if(!1!==f.enabled&&!0!== f.noZoom&&x===w.NONE){a.preventDefault();a.stopPropagation();var d=0;void 0!==a.wheelDelta?d=a.wheelDelta:void 0!==a.detail&&(d=-a.detail);0d&&(f.object.fov=f.object.fov>f.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix());f.update();f.dispatchEvent(V);f.dispatchEvent(O);f.dispatchEvent(P)}}function p(a){switch(a.keyCode){case f.keys.UP:I=!1;break;case f.keys.BOTTOM:J=!1;break;case f.keys.LEFT:X= !1;break;case f.keys.RIGHT:Y=!1}}function m(a){if(!1!==f.enabled&&!0!==f.noKeys&&!0!==f.noRotate){switch(a.keyCode){case f.keys.UP:I=!0;break;case f.keys.BOTTOM:J=!0;break;case f.keys.LEFT:X=!0;break;case f.keys.RIGHT:Y=!0}if(I||J||X||Y)Q=!0,I&&(L=-f.rotateSpeed*f.momentumKeydownFactor),J&&(L=f.rotateSpeed*f.momentumKeydownFactor),X&&(K=-f.rotateSpeed*f.momentumKeydownFactor),Y&&(K=f.rotateSpeed*f.momentumKeydownFactor)}}function l(a){Q=!1;K=L=0;if(!1!==f.enabled){switch(a.touches.length){case 1:if(!0=== f.noRotate)return;x=w.TOUCH_ROTATE;D.set(a.touches[0].pageX,a.touches[0].pageY);break;case 2:if(!0===f.noZoom)return;x=w.TOUCH_DOLLY;var d=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;y.set(0,Math.sqrt(d*d+a*a));break;case 3:if(!0===f.noPan)return;x=w.TOUCH_PAN;n.set(a.touches[0].pageX,a.touches[0].pageY);break;default:x=w.NONE}x!==w.NONE&&f.dispatchEvent(O)}}function v(a){if(!1!==f.enabled){a.preventDefault();a.stopPropagation();var d=f.domElement===document?f.domElement.body: f.domElement;switch(a.touches.length){case 1:if(!0===f.noRotate)break;if(x!==w.TOUCH_ROTATE)break;h.set(a.touches[0].pageX,a.touches[0].pageY);r.subVectors(h,D);f.rotateLeft(2*Math.PI*r.x/d.clientWidth*f.rotateSpeed);f.rotateUp(2*Math.PI*r.y/d.clientHeight*f.rotateSpeed);D.copy(h);G&&(K=a.touches[0].pageX-G.pageX,L=a.touches[0].pageY-G.pageY);G={pageX:a.touches[0].pageX,pageY:a.touches[0].pageY};f.update();break;case 2:if(!0===f.noZoom)break;if(x!==w.TOUCH_DOLLY)break;d=a.touches[0].pageX-a.touches[1].pageX; a=a.touches[0].pageY-a.touches[1].pageY;z.set(0,Math.sqrt(d*d+a*a));T.subVectors(z,y);0>T.y?(f.object.fov=f.object.fovf.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix());y.copy(z);f.update();f.dispatchEvent(V);break;case 3:if(!0===f.noPan)break;if(x!==w.TOUCH_PAN)break;U.set(a.touches[0].pageX,a.touches[0].pageY);t.subVectors(U,n);f.pan(t.x,t.y);n.copy(U);f.update();break;default:x= w.NONE}}}function q(){Q=!0;G=void 0;!1!==f.enabled&&(f.dispatchEvent(P),x=w.NONE)}this.object=a;this.domElement=void 0!==b?b:document;this.frameId=null;this.enabled=!0;this.center=this.target=new e.Vector3;this.noZoom=!1;this.zoomSpeed=1;this.minDistance=0;this.maxDistance=Infinity;this.minZoom=0;this.maxZoom=Infinity;this.noRotate=!1;this.rotateSpeed=-.15;this.noPan=!0;this.keyPanSpeed=7;this.autoRotate=!1;this.autoRotateSpeed=2;this.minPolarAngle=0;this.maxPolarAngle=Math.PI;this.momentumDampingFactor= .9;this.momentumScalingFactor=-.005;this.momentumKeydownFactor=20;this.minFov=30;this.maxFov=120;this.minAzimuthAngle=-Infinity;this.maxAzimuthAngle=Infinity;this.noKeys=!1;this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};this.mouseButtons={ORBIT:e.MOUSE.LEFT,ZOOM:e.MOUSE.MIDDLE,PAN:e.MOUSE.RIGHT};var f=this,D=new e.Vector2,h=new e.Vector2,r=new e.Vector2,n=new e.Vector2,U=new e.Vector2,t=new e.Vector2,u=new e.Vector3,A=new e.Vector3,y=new e.Vector2,z=new e.Vector2,T=new e.Vector2,R=0,H=0,B=0,C=0,E=1, F=new e.Vector3,M=new e.Vector3,N=new e.Quaternion,K=0,L=0,G,Q=!1,I,J,X,Y,w={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},x=w.NONE;this.target0=this.target.clone();this.position0=this.object.position.clone();this.zoom0=this.object.zoom;var S=(new e.Quaternion).setFromUnitVectors(a.up,new e.Vector3(0,1,0)),W=S.clone().inverse(),V={type:"change"},O={type:"start"},P={type:"end"};this.setLastQuaternion=function(a){N.copy(a);f.object.quaternion.copy(a)};this.getLastPosition= function(){return M};this.rotateLeft=function(a){void 0===a&&(a=2*Math.PI/60/60*f.autoRotateSpeed);C-=a};this.rotateUp=function(a){void 0===a&&(a=2*Math.PI/60/60*f.autoRotateSpeed);B-=a};this.panLeft=function(a){var d=this.object.matrix.elements;u.set(d[0],d[1],d[2]);u.multiplyScalar(-a);F.add(u)};this.panUp=function(a){var d=this.object.matrix.elements;u.set(d[4],d[5],d[6]);u.multiplyScalar(a);F.add(u)};this.pan=function(a,d){var b=f.domElement===document?f.domElement.body:f.domElement;if(f.object instanceof e.PerspectiveCamera){var c=f.object.position.clone().sub(f.target).length();c*=Math.tan(f.object.fov/2*Math.PI/180);f.panLeft(2*a*c/b.clientHeight);f.panUp(2*d*c/b.clientHeight)}else f.object instanceof e.OrthographicCamera?(f.panLeft(a*(f.object.right-f.object.left)/b.clientWidth),f.panUp(d*(f.object.top-f.object.bottom)/b.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")};this.momentum=function(){Q&&(1E-4>Math.abs(K)&&1E-4>Math.abs(L)?Q= !1:(L*=this.momentumDampingFactor,K*=this.momentumDampingFactor,C-=this.momentumScalingFactor*K,B-=this.momentumScalingFactor*L))};this.dollyIn=function(a){void 0===a&&(a=Math.pow(.95,f.zoomSpeed));f.object instanceof e.PerspectiveCamera?E/=a:f.object instanceof e.OrthographicCamera?(f.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*a)),f.object.updateProjectionMatrix(),f.dispatchEvent(V)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")}; this.dollyOut=function(a){void 0===a&&(a=Math.pow(.95,f.zoomSpeed));f.object instanceof e.PerspectiveCamera?E*=a:f.object instanceof e.OrthographicCamera?(f.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/a)),f.object.updateProjectionMatrix(),f.dispatchEvent(V)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")};this.update=function(a){var d=this.object.position;A.copy(d).sub(this.target);A.applyQuaternion(S);R=Math.atan2(A.x, A.z);H=Math.atan2(Math.sqrt(A.x*A.x+A.z*A.z),A.y);this.autoRotate&&x===w.NONE&&this.rotateLeft(2*Math.PI/60/60*f.autoRotateSpeed);this.momentum();R+=C;H+=B;R=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,R));H=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,H));H=Math.max(1E-7,Math.min(Math.PI-1E-7,H));var b=A.length()*E;b=Math.max(this.minDistance,Math.min(this.maxDistance,b));this.target.add(F);A.x=b*Math.sin(H)*Math.sin(R);A.y=b*Math.cos(H);A.z=b*Math.sin(H)*Math.cos(R);A.applyQuaternion(W); d.copy(this.target).add(A);this.object.lookAt(this.target);B=C=0;E=1;F.set(0,0,0);if(1E-7g&&(l.total=l.total/g*6);c(l)},d)});return k}};S.prototype=Object.assign(Object.create(e.EventDispatcher.prototype),{setContainer:function(a){this.container=a},setScene:function(a){this.scene=a},enumerateDevices:function(){var a=this.devices,b=new Promise(function(b){b(a)});return 0=g.length?(c(0),d--):c(d);b(g[d])})},getDevices:function(a){a=void 0===a?"video":a;var b=this.devices;return this.enumerateDevices().then(function(a){return a.map(function(a){b.includes(a)||b.push(a);return a})}).then(function(b){var d=new RegExp(a,"i");return b.filter(function(a){return d.test(a.kind)})})},getUserMedia:function(a){var b=this.setMediaStream.bind(this),c=this.playVideo.bind(this); return window.navigator.mediaDevices.getUserMedia(a).then(b).then(c).catch(function(a){console.warn("PANOLENS.Media: "+a)})},setVideDeviceIndex:function(a){this.videoDeviceIndex=a},start:function(a){var b=this.constraints,c=this.getUserMedia.bind(this);this.element=this.createVideoElement();return this.getDevices().then(function(d){if(!d||0===d.length)throw Error("no video device found");b.video.deviceId=(a||d[0]).deviceId;return c(b)})},stop:function(){var a=this.stream;a&&a.active&&(a.getTracks()[0].stop(), window.removeEventListener("resize",this.onWindowResize.bind(this)),this.stream=this.element=null)},setMediaStream:function(a){this.stream=a;this.element.srcObject=a;this.scene&&(this.scene.background=this.createVideoTexture());window.addEventListener("resize",this.onWindowResize.bind(this))},playVideo:function(){var a=this.element;a&&(a.play(),this.dispatchEvent({type:"play"}))},pauseVideo:function(){var a=this.element;a&&(a.pause(),this.dispatchEvent({type:"pause"}))},createVideoTexture:function(){var a= this.element,b=new e.VideoTexture(a);b.generateMipmaps=!1;b.minFilter=e.LinearFilter;b.magFilter=e.LinearFilter;b.format=e.RGBFormat;b.center.set(.5,.5);a.addEventListener("canplay",this.onWindowResize.bind(this));return b},createVideoElement:function(){var a=this.dispatchEvent.bind(this),b=document.createElement("video");b.setAttribute("autoplay","");b.setAttribute("muted","");b.setAttribute("playsinline","");b.style.position="absolute";b.style.top="0";b.style.left="0";b.style.width="100%";b.style.height= "100%";b.style.objectPosition="center";b.style.objectFit="cover";b.style.display=this.scene?"none":"";b.addEventListener("canplay",function(){return a({type:"canplay"})});return b},onWindowResize:function(){if(this.element&&this.element.videoWidth&&this.element.videoHeight&&this.scene){var a=this.container,b=a.clientWidth;a=a.clientHeight;var c=this.scene.background,d=this.element;d=d.videoHeight/d.videoWidth*(this.container?b/a:1)*this.ratioScalar;b>a?c.repeat.set(d,1):c.repeat.set(1,1/d)}}});M.prototype= Object.assign(Object.create(e.Sprite.prototype),{constructor:M,setColor:function(a){this.material.color.copy(a instanceof e.Color?a:new e.Color(a))},createCanvasTexture:function(a){a=new e.CanvasTexture(a);a.minFilter=e.LinearFilter;a.magFilter=e.LinearFilter;a.generateMipmaps=!1;return a},createCanvas:function(){var a=document.createElement("canvas"),b=a.getContext("2d"),c=this.dpr;a.width=32*c;a.height=32*c;b.scale(c,c);b.shadowBlur=5;b.shadowColor="rgba(200,200,200,0.9)";return{canvas:a,context:b}}, updateCanvasArcByProgress:function(a){var b=this.context,c=this.canvasWidth,d=this.canvasHeight,g=this.material,k=this.dpr,e=a*Math.PI*2,m=this.color.getStyle(),l=.5*c/k;k=.5*d/k;b.clearRect(0,0,c,d);b.beginPath();0===a?(b.arc(l,k,c/16,0,2*Math.PI),b.fillStyle=m,b.fill()):(b.arc(l,k,c/4-3,-Math.PI/2,-Math.PI/2+e),b.strokeStyle=m,b.lineWidth=3,b.stroke());b.closePath();g.map.needsUpdate=!0},ripple:function(){var a=this,b=this.context,c=this.canvasWidth,d=this.canvasHeight,g=this.material,k=this.rippleDuration, e=performance.now(),m=this.color,l=this.dpr,h=.5*c/l,q=.5*d/l,f=function(){var p=window.requestAnimationFrame(f),v=(performance.now()-e)/k,n=0<1-v?1-v:0,r=v*c*.5/l;b.clearRect(0,0,c,d);b.beginPath();b.arc(h,q,r,0,2*Math.PI);b.fillStyle="rgba("+255*m.r+", "+255*m.g+", "+255*m.b+", "+n+")";b.fill();b.closePath();1<=v&&(window.cancelAnimationFrame(p),a.updateCanvasArcByProgress(0),a.dispatchEvent({type:"reticle-ripple-end"}));g.map.needsUpdate=!0};this.dispatchEvent({type:"reticle-ripple-start"});f()}, show:function(){this.visible=!0},hide:function(){this.visible=!1},start:function(a){this.autoSelect&&(this.dispatchEvent({type:"reticle-start"}),this.startTimestamp=performance.now(),this.callback=a,this.update())},end:function(){this.startTimestamp&&(window.cancelAnimationFrame(this.timerId),this.updateCanvasArcByProgress(0),this.startTimestamp=this.timerId=this.callback=null,this.dispatchEvent({type:"reticle-end"}))},update:function(){this.timerId=window.requestAnimationFrame(this.update.bind(this)); var a=(performance.now()-this.startTimestamp)/this.dwellTime;this.updateCanvasArcByProgress(a);this.dispatchEvent({type:"reticle-update",progress:a});1<=a&&(window.cancelAnimationFrame(this.timerId),this.callback&&this.callback(),this.end(),this.ripple())}});var r=function(a,b){return b={exports:{}},a(b,b.exports),b.exports}(function(a,b){b=function(){this._tweens={};this._tweensAddedDuringUpdate={}};b.prototype={getAll:function(){return Object.keys(this._tweens).map(function(a){return this._tweens[a]}.bind(this))}, removeAll:function(){this._tweens={}},add:function(a){this._tweens[a.getId()]=a;this._tweensAddedDuringUpdate[a.getId()]=a},remove:function(a){delete this._tweens[a.getId()];delete this._tweensAddedDuringUpdate[a.getId()]},update:function(a,b){var d=Object.keys(this._tweens);if(0===d.length)return!1;for(a=void 0!==a?a:c.now();0(a*=2)?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return 1> (a*=2)?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return 1>(a*=2)?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return 1>(a*=2)?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0=== a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:1>(a*=2)?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return 1>(a*=2)?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){return 0===a?0:1===a?1:-Math.pow(2,10*(a-1))*Math.sin(5*(a-1.1)*Math.PI)},Out:function(a){return 0===a?0:1===a? 1:Math.pow(2,-10*a)*Math.sin(5*(a-.1)*Math.PI)+1},InOut:function(a){if(0===a)return 0;if(1===a)return 1;a*=2;return 1>a?-.5*Math.pow(2,10*(a-1))*Math.sin(5*(a-1.1)*Math.PI):.5*Math.pow(2,-10*(a-1))*Math.sin(5*(a-1.1)*Math.PI)+1}},Back:{In:function(a){return a*a*(2.70158*a-1.70158)},Out:function(a){return--a*a*(2.70158*a+1.70158)+1},InOut:function(a){return 1>(a*=2)?.5*a*a*(3.5949095*a-2.5949095):.5*((a-=2)*a*(3.5949095*a+2.5949095)+2)}},Bounce:{In:function(a){return 1-c.Easing.Bounce.Out(1-a)},Out:function(a){return a< 1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*c.Easing.Bounce.In(2*a):.5*c.Easing.Bounce.Out(2*a-1)+.5}}};c.Interpolation={Linear:function(a,b){var d=a.length-1,g=d*b,e=Math.floor(g),l=c.Interpolation.Utils.Linear;return 0>b?l(a[0],a[1],g):1d?d:e+1],g-e)},Bezier:function(a,b){for(var d=0,g=a.length-1,e=Math.pow,l=c.Interpolation.Utils.Bernstein,h=0;h<= g;h++)d+=e(1-b,g-h)*e(b,h)*a[h]*l(g,h);return d},CatmullRom:function(a,b){var d=a.length-1,g=d*b,e=Math.floor(g),l=c.Interpolation.Utils.CatmullRom;return a[0]===a[d]?(0>b&&(e=Math.floor(g=d*(1+b))),l(a[(e-1+d)%d],a[e],a[(e+1)%d],a[(e+2)%d],g-e)):0>b?a[0]-(l(a[0],a[0],a[1],a[1],-g)-a[0]):1l?0:l,f.setProgress(l),g.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:l}))}function c(a){a.stopPropagation();e=!1;d()}function d(){g.container.removeEventListener("mousemove",b,!1);g.container.removeEventListener("mouseup",c,!1);g.container.removeEventListener("touchmove",b,!1);g.container.removeEventListener("touchend",c,!1)}var g=this,e=!1,p,m,l;var h=document.createElement("div");h.style.width="0%";h.style.height="100%";h.style.backgroundColor="#fff";var q= document.createElement("div");q.style.float="right";q.style.width="14px";q.style.height="14px";q.style.transform="translate(7px, -5px)";q.style.borderRadius="50%";q.style.backgroundColor="#ddd";q.addEventListener("mousedown",a,{passive:!0});q.addEventListener("touchstart",a,{passive:!0});h.appendChild(q);var f=this.createCustomItem({style:{float:"left",width:"30%",height:"4px",marginTop:"20px",backgroundColor:"rgba(188,188,188,0.8)"},onTap:function(a){a.preventDefault();a.stopPropagation();if(a.target!== q){var b=a.changedTouches&&0=window.innerWidth?this.ImageQualityFair:800=window.innerWidth?this.ImageQualityMedium:1280=window.innerWidth?this.ImageQualityHigh:1920=d&&(b.zoom.value=d)},onUpdateCallback:function(){this.frameId=window.requestAnimationFrame(this.onUpdateCallback.bind(this));this.quatSlerp.slerp(this.quatCur,.1);this.material&& this.material.uniforms.transform.value.makeRotationFromQuaternion(this.quatSlerp);!this.dragging&&1-this.quatSlerp.clone().dot(this.quatCur)=a.length?0:b},setCameraFov:function(a){this.camera.fov=a;this.camera.updateProjectionMatrix()}, enableControl:function(a){a=0<=a&&aMath.PI?m-2*Math.PI:m;m=m<-Math.PI?m+2*Math.PI:m;k=Math.abs(h.angleTo(k)+(0>=h.y*l.y?l.angleTo(a):-l.angleTo(a)));k*=l.y=a.clientX-this.options.clickTolerance&&this.userMouse.x<=a.clientX+ this.options.clickTolerance&&this.userMouse.y>=a.clientY-this.options.clickTolerance&&this.userMouse.y<=a.clientY+this.options.clickTolerance||a.changedTouches&&this.userMouse.x>=a.changedTouches[0].clientX-this.options.clickTolerance&&this.userMouse.x<=a.changedTouches[0].clientX+this.options.clickTolerance&&this.userMouse.y>=a.changedTouches[0].clientY-this.options.clickTolerance&&this.userMouse.y<=a.changedTouches[0].clientY+this.options.clickTolerance?"click":void 0;if(!a||!a.target||a.target.classList.contains("panolens-canvas"))if(a.preventDefault(), a=a.changedTouches&&1===a.changedTouches.length?this.onTap({clientX:a.changedTouches[0].clientX,clientY:a.changedTouches[0].clientY},b):this.onTap(a,b),this.userMouse.type="none",!a&&"click"===b){b=this.options;a=b.autoHideControlBar;var c=this.panorama,d=this.toggleControlBar;b.autoHideInfospot&&c&&c.toggleInfospotVisibility();a&&d()}},onTap:function(a,b){var c=this.container.getBoundingClientRect(),d=c.top,e=this.container,h=e.clientHeight;this.raycasterPoint.x=(a.clientX-c.left)/e.clientWidth* 2-1;this.raycasterPoint.y=2*-((a.clientY-d)/h)+1;this.raycaster.setFromCamera(this.raycasterPoint,this.camera);if(this.panorama){("mousedown"!==a.type&&this.touchSupported||this.OUTPUT_INFOSPOT)&&this.outputPosition();c=this.raycaster.intersectObjects(this.panorama.children,!0);d=this.getConvertedIntersect(c);e=0