(function(k,d){"object"===typeof exports&&"undefined"!==typeof module?d(exports,require("three")):"function"===typeof define&&define.amd?define(["exports","three"],d):(k=k||self,d(k.PANOLENS={},k.THREE))})(this,function(k,d){function Y(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 F(a){this.format= null;this.eyeSep=void 0===a?.064:a;this.loffset=new d.Vector2;this.roffset=new d.Vector2}function J(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 e=this.createCanvas(),g=e.canvas;e=e.context;var h=new d.SpriteMaterial({color:a,map:this.createCanvasTexture(g)});d.Sprite.call(this,h);this.canvasWidth=g.width;this.canvasHeight=g.height;this.context=e;this.color=a instanceof d.Color?a:new d.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 y(a,b,c){a=void 0===a?300:a;b=b||t.Info;d.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=q.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=d.DoubleSide;this.material.depthTest=!1;this.material.transparent=!0;this.material.opacity=0;this.scaleUpAnimation=new m.Tween;this.scaleDownAnimation=new m.Tween;c=function(b){if(this.material){var e=b.image.width/b.image.height,c=new d.Vector3;b.image.width=b.image.naturalWidth||64;b.image.height=b.image.naturalHeight||64;this.scale.set(e*a,a,1);c.copy(this.scale);this.scaleUpAnimation=(new m.Tween(this.scale)).to({x:1.3*c.x,y:1.3*c.y},500).easing(m.Easing.Elastic.Out); this.scaleDownAnimation=(new m.Tween(this.scale)).to({x:c.x,y:c.y},500).easing(m.Easing.Elastic.Out);this.material.map=b;this.material.needsUpdate=!0}}.bind(this);this.showAnimation=(new m.Tween(this.material)).to({opacity:1},500).onStart(this.enableRaycast.bind(this,!0)).easing(m.Easing.Quartic.Out);this.hideAnimation=(new m.Tween(this.material)).to({opacity:0},500).onStart(this.enableRaycast.bind(this,!1)).easing(m.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);K.load(b,c)}function L(a){a||console.warn("PANOLENS.Widget: No container specified");d.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 r(){this.edgeLength=1E4;d.Mesh.call(this,this.createGeometry(this.edgeLength),this.createMaterial());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.renderOrder=-1;this.active=!1;this.infospotAnimation=(new m.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 u(a){r.call(this);this.src=a;this.type="image_panorama"}function R(){r.call(this);this.type="empty_panorama"}function M(a){a=void 0===a?[]:a;r.call(this);this.images=a;this.type="cube_panorama"}function S(){for(var a=[],b=0;6>b;b++)a.push(t.WhiteTile);M.call(this,a);this.type="basic_panorama"}function z(a,b){b=void 0===b?{}:b;r.call(this);this.src=a;this.options=Object.assign({videoElement:document.createElement("video"), loop:!0,muted:!0,autoplay:!1,playsinline:!0,crossOrigin:"anonymous"},b);this.videoElement=this.options.videoElement;this.videoProgress=0;this.type="video_panorama";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 Z(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(e){}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 aa(a,b){u.call(this);this.panoId=a;this.gsvLoader=null;this.loadRequested=!1;this.setupGoogleMapAPI(b);this.type="google_streetview_panorama"}function B(a,b){"image"===(void 0===a?"image":a)&&u.call(this,b);this.EPS=1E-6;this.frameId=null;this.dragging=!1;this.userMouse=new d.Vector2;this.quatA=new d.Quaternion;this.quatB=new d.Quaternion;this.quatCur=new d.Quaternion;this.quatSlerp= new d.Quaternion;this.vectorX=new d.Vector3(1,0,0);this.vectorY=new d.Vector3(0,1,0);this.type="little_planet";this.addEventListener("window-resize",this.onWindowResize)}function ba(a){B.call(this,"image",a);this.type="image_little_planet"}function T(a){r.call(this);this.media=new Y(a);this.type="camera_panorama";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 N(a,b){b=void 0===b?new F:b;u.call(this,a);this.stereo=b;this.type="stereo_image_panorama"}function G(a,b,c){b=void 0===b?{}:b;c=void 0===c?new F:c;z.call(this,a,b);this.stereo=c;this.type="stereo_video_panorama"}function ca(a,b){function c(a){U=!1;O=P=0;if(!1!==f.enabled){a.preventDefault();if(a.button===f.mouseButtons.ORBIT){if(!0===f.noRotate)return;w=v.ROTATE;D.set(a.clientX,a.clientY)}else if(a.button===f.mouseButtons.ZOOM){if(!0===f.noZoom)return;w= v.DOLLY;u.set(a.clientX,a.clientY)}else if(a.button===f.mouseButtons.PAN){if(!0===f.noPan)return;w=v.PAN;r.set(a.clientX,a.clientY)}w!==v.NONE&&(document.addEventListener("mousemove",e,!1),document.addEventListener("mouseup",g,!1),f.dispatchEvent(R));f.update()}}function e(a){if(!1!==f.enabled){a.preventDefault();var b=f.domElement===document?f.domElement.body:f.domElement;if(w===v.ROTATE){if(!0===f.noRotate)return;k.set(a.clientX,a.clientY);m.subVectors(k,D);f.rotateLeft(2*Math.PI*m.x/b.clientWidth* f.rotateSpeed);f.rotateUp(2*Math.PI*m.y/b.clientHeight*f.rotateSpeed);D.copy(k);H&&(O=a.clientX-H.clientX,P=a.clientY-H.clientY);H=a}else if(w===v.DOLLY){if(!0===f.noZoom)return;y.set(a.clientX,a.clientY);z.subVectors(y,u);0z.y&&f.dollyOut();u.copy(y)}else if(w===v.PAN){if(!0===f.noPan)return;W.set(a.clientX,a.clientY);q.subVectors(W,r);f.pan(q.x,q.y);r.copy(W)}w!==v.NONE&&f.update()}}function g(){U=!0;H=void 0;!1!==f.enabled&&(document.removeEventListener("mousemove",e,!1),document.removeEventListener("mouseup", g,!1),f.dispatchEvent(S),w=v.NONE)}function h(a){if(!1!==f.enabled&&!0!==f.noZoom&&w===v.NONE){a.preventDefault();a.stopPropagation();var b=0;void 0!==a.wheelDelta?b=a.wheelDelta:void 0!==a.detail&&(b=-a.detail);0b&&(f.object.fov=f.object.fov>f.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix());f.update();f.dispatchEvent(X);f.dispatchEvent(R);f.dispatchEvent(S)}}function p(a){switch(a.keyCode){case f.keys.UP:G= !1;break;case f.keys.BOTTOM:J=!1;break;case f.keys.LEFT:K=!1;break;case f.keys.RIGHT:L=!1}}function n(a){if(!1!==f.enabled&&!0!==f.noKeys&&!0!==f.noRotate){switch(a.keyCode){case f.keys.UP:G=!0;break;case f.keys.BOTTOM:J=!0;break;case f.keys.LEFT:K=!0;break;case f.keys.RIGHT:L=!0}if(G||J||K||L)U=!0,G&&(P=-f.rotateSpeed*f.momentumKeydownFactor),J&&(P=f.rotateSpeed*f.momentumKeydownFactor),K&&(O=-f.rotateSpeed*f.momentumKeydownFactor),L&&(O=f.rotateSpeed*f.momentumKeydownFactor)}}function l(a){U=!1; O=P=0;if(!1!==f.enabled){switch(a.touches.length){case 1:if(!0===f.noRotate)return;w=v.TOUCH_ROTATE;D.set(a.touches[0].pageX,a.touches[0].pageY);break;case 2:if(!0===f.noZoom)return;w=v.TOUCH_DOLLY;var b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;u.set(0,Math.sqrt(b*b+a*a));break;case 3:if(!0===f.noPan)return;w=v.TOUCH_PAN;r.set(a.touches[0].pageX,a.touches[0].pageY);break;default:w=v.NONE}w!==v.NONE&&f.dispatchEvent(R)}}function x(a){if(!1!==f.enabled){a.preventDefault(); a.stopPropagation();var b=f.domElement===document?f.domElement.body:f.domElement;switch(a.touches.length){case 1:if(!0===f.noRotate)break;if(w!==v.TOUCH_ROTATE)break;k.set(a.touches[0].pageX,a.touches[0].pageY);m.subVectors(k,D);f.rotateLeft(2*Math.PI*m.x/b.clientWidth*f.rotateSpeed);f.rotateUp(2*Math.PI*m.y/b.clientHeight*f.rotateSpeed);D.copy(k);H&&(O=a.touches[0].pageX-H.pageX,P=a.touches[0].pageY-H.pageY);H={pageX:a.touches[0].pageX,pageY:a.touches[0].pageY};f.update();break;case 2:if(!0===f.noZoom)break; if(w!==v.TOUCH_DOLLY)break;b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;y.set(0,Math.sqrt(b*b+a*a));z.subVectors(y,u);0>z.y?(f.object.fov=f.object.fovf.minFov?f.object.fov-1:f.minFov,f.object.updateProjectionMatrix());u.copy(y);f.update();f.dispatchEvent(X);break;case 3:if(!0===f.noPan)break;if(w!==v.TOUCH_PAN)break;W.set(a.touches[0].pageX,a.touches[0].pageY); q.subVectors(W,r);f.pan(q.x,q.y);r.copy(W);f.update();break;default:w=v.NONE}}}function Q(){U=!0;H=void 0;!1!==f.enabled&&(f.dispatchEvent(S),w=v.NONE)}this.object=a;this.domElement=void 0!==b?b:document;this.frameId=null;this.enabled=!0;this.center=this.target=new d.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:d.MOUSE.LEFT,ZOOM:d.MOUSE.MIDDLE,PAN:d.MOUSE.RIGHT};var f=this,D=new d.Vector2,k=new d.Vector2,m=new d.Vector2,r=new d.Vector2,W=new d.Vector2,q=new d.Vector2,t=new d.Vector3,A=new d.Vector3, u=new d.Vector2,y=new d.Vector2,z=new d.Vector2,V=0,I=0,B=0,C=0,E=1,F=new d.Vector3,M=new d.Vector3,N=new d.Quaternion,O=0,P=0,H,U=!1,G,J,K,L,v={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},w=v.NONE;this.target0=this.target.clone();this.position0=this.object.position.clone();this.zoom0=this.object.zoom;var T=(new d.Quaternion).setFromUnitVectors(a.up,new d.Vector3(0,1,0)),Y=T.clone().inverse(),X={type:"change"},R={type:"start"},S={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 b=this.object.matrix.elements;t.set(b[0],b[1],b[2]);t.multiplyScalar(-a);F.add(t)};this.panUp=function(a){var b=this.object.matrix.elements;t.set(b[4],b[5],b[6]);t.multiplyScalar(a);F.add(t)};this.pan=function(a,b){var e=f.domElement=== document?f.domElement.body:f.domElement;if(f.object instanceof d.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/e.clientHeight);f.panUp(2*b*c/e.clientHeight)}else f.object instanceof d.OrthographicCamera?(f.panLeft(a*(f.object.right-f.object.left)/e.clientWidth),f.panUp(b*(f.object.top-f.object.bottom)/e.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")};this.momentum= function(){U&&(1E-4>Math.abs(O)&&1E-4>Math.abs(P)?U=!1:(P*=this.momentumDampingFactor,O*=this.momentumDampingFactor,C-=this.momentumScalingFactor*O,B-=this.momentumScalingFactor*P))};this.dollyIn=function(a){void 0===a&&(a=Math.pow(.95,f.zoomSpeed));f.object instanceof d.PerspectiveCamera?E/=a:f.object instanceof d.OrthographicCamera?(f.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*a)),f.object.updateProjectionMatrix(),f.dispatchEvent(X)):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 d.PerspectiveCamera?E*=a:f.object instanceof d.OrthographicCamera?(f.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/a)),f.object.updateProjectionMatrix(),f.dispatchEvent(X)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")};this.update=function(a){var b=this.object.position;A.copy(b).sub(this.target);A.applyQuaternion(T);V=Math.atan2(A.x, A.z);I=Math.atan2(Math.sqrt(A.x*A.x+A.z*A.z),A.y);this.autoRotate&&w===v.NONE&&this.rotateLeft(2*Math.PI/60/60*f.autoRotateSpeed);this.momentum();V+=C;I+=B;V=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,V));I=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,I));I=Math.max(1E-7,Math.min(Math.PI-1E-7,I));var e=A.length()*E;e=Math.max(this.minDistance,Math.min(this.maxDistance,e));this.target.add(F);A.x=e*Math.sin(I)*Math.sin(V);A.y=e*Math.cos(I);A.z=e*Math.sin(I)*Math.cos(V);A.applyQuaternion(Y); b.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)},e)});return h}};Y.prototype=Object.assign(Object.create(d.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),e--):c(e);b(g[e])})},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 e=new RegExp(a,"i");return b.filter(function(a){return e.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(e){if(!e||0===e.length)throw Error("no video device found");b.video.deviceId=(a||e[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 d.VideoTexture(a);b.generateMipmaps=!1;b.minFilter=d.LinearFilter;b.magFilter=d.LinearFilter;b.format=d.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,e=this.element;e=e.videoHeight/e.videoWidth*(this.container?b/a:1)*this.ratioScalar;b>a?c.repeat.set(e,1):c.repeat.set(1,1/e)}}});Object.assign(F.prototype, {constructor:F,updateUniformByFormat:function(a,b){this.format=a;var c=b.repeat.value;b=b.offset.value;var e=this.loffset,g=this.roffset;switch(a){case C.TAB:c.set(1,.5);b.set(0,.5);e.set(0,.5);g.set(0,0);break;case C.SBS:c.set(.5,1),b.set(0,0),e.set(0,0),g.set(.5,0)}},updateTextureToLeft:function(a){a.copy(this.loffset)},updateTextureToRight:function(a){a.copy(this.roffset)}});J.prototype=Object.assign(Object.create(d.Sprite.prototype),{constructor:J,setColor:function(a){this.material.color.copy(a instanceof d.Color?a:new d.Color(a))},createCanvasTexture:function(a){a=new d.CanvasTexture(a);a.minFilter=d.LinearFilter;a.magFilter=d.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,e=this.canvasHeight,g=this.material,h=this.dpr, d=a*Math.PI*2,n=this.color.getStyle(),l=.5*c/h;h=.5*e/h;b.clearRect(0,0,c,e);b.beginPath();0===a?(b.arc(l,h,c/16,0,2*Math.PI),b.fillStyle=n,b.fill()):(b.arc(l,h,c/4-3,-Math.PI/2,-Math.PI/2+d),b.strokeStyle=n,b.lineWidth=3,b.stroke());b.closePath();g.map.needsUpdate=!0},ripple:function(){var a=this,b=this.context,c=this.canvasWidth,e=this.canvasHeight,g=this.material,h=this.rippleDuration,d=performance.now(),n=this.color,l=this.dpr,k=.5*c/l,m=.5*e/l,f=function(){var p=window.requestAnimationFrame(f), x=(performance.now()-d)/h,q=0<1-x?1-x:0,r=x*c*.5/l;b.clearRect(0,0,c,e);b.beginPath();b.arc(k,m,r,0,2*Math.PI);b.fillStyle="rgba("+255*n.r+", "+255*n.g+", "+255*n.b+", "+q+")";b.fill();b.closePath();1<=x&&(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 m=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 e=Object.keys(this._tweens);if(0===e.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 e=a.length-1,g=e*b,d=Math.floor(g),l=c.Interpolation.Utils.Linear;return 0>b?l(a[0],a[1],g):1e?e:d+1],g-d)},Bezier:function(a,b){for(var e=0,g=a.length-1,d=Math.pow,l=c.Interpolation.Utils.Bernstein,k=0;k<=g;k++)e+=d(1-b,g-k)*d(b,k)*a[k]*l(g,k);return e},CatmullRom:function(a,b){var e=a.length-1,g=e*b,d=Math.floor(g),l=c.Interpolation.Utils.CatmullRom;return a[0]===a[e]?(0>b&&(d=Math.floor(g=e*(1+b))),l(a[(d-1+ e)%e],a[d],a[(d+1)%e],a[(d+2)%e],g-d)):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();d=!1;e()}function e(){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,d=!1,p,n,l;var k=document.createElement("div");k.style.width="0%";k.style.height="100%";k.style.backgroundColor="#fff";var m=document.createElement("div");m.style.float="right";m.style.width="14px";m.style.height="14px";m.style.transform="translate(7px, -5px)";m.style.borderRadius="50%";m.style.backgroundColor="#ddd";m.addEventListener("mousedown",a,{passive:!0});m.addEventListener("touchstart", a,{passive:!0});k.appendChild(m);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!==m){var b=a.changedTouches&&0\n void main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV;\n sampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n sampleUV *= repeat;\n sampleUV += offset;\n vec4 texColor = texture2D( tEquirect, sampleUV );\n gl_FragColor = mapTexelToLinear( texColor );\n gl_FragColor.a *= opacity;\n #include \n #include \n }\n ", vertexShader:"\n varying vec3 vWorldDirection;\n #include \n void main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n }\n ",uniforms:c,side:d.BackSide,transparent:!0,opacity:0})},add:function(a){if(1=window.innerWidth?this.ImageQualityFair:800=window.innerWidth? this.ImageQualityMedium:1280=window.innerWidth?this.ImageQualityHigh:1920=e&&(b.zoom.value=e)},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()},getRaycastViewCenter:function(){var a=new d.Raycaster;a.setFromCamera(new d.Vector2(0,0),this.camera);a=a.intersectObject(this.panorama);return 0Math.PI?e-2*Math.PI:e;e=e<-Math.PI?e+2*Math.PI: e;b=Math.abs(c.angleTo(b)+(0>=c.y*g.y?g.angleTo(a):-g.angleTo(a)));b*=g.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,g=this.container,h=g.clientHeight;this.raycasterPoint.x=(a.clientX-c.left)/g.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.outputEnabled)&&this.outputPosition();c=this.raycaster.intersectObjects(this.panorama.children,!0);d=this.getConvertedIntersect(c);g=0