UNPKG

panolens

Version:
87 lines 112 kB
(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);0<T.y?f.dollyIn():0>T.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);0<d?(f.object.fov=f.object.fov<f.maxFov?f.object.fov+1:f.maxFov,f.object.updateProjectionMatrix()):0>d&&(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.fov<f.maxFov?f.object.fov+1:f.maxFov,f.object.updateProjectionMatrix()):0<T.y&&(f.object.fov=f.object.fov>f.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-7<M.distanceToSquared(this.object.position)||1E-7<8*(1-N.dot(this.object.quaternion)))!0!==a&&this.dispatchEvent(V),M.copy(this.object.position),N.copy(this.object.quaternion)};this.reset=function(){x=w.NONE;this.target.copy(this.target0);this.object.position.copy(this.position0);this.object.zoom=this.zoom0;this.object.updateProjectionMatrix();this.dispatchEvent(V);this.update()};this.getPolarAngle=function(){return H}; this.getAzimuthalAngle=function(){return R};this.dispose=function(){this.domElement.removeEventListener("mousedown",c);this.domElement.removeEventListener("mousewheel",k);this.domElement.removeEventListener("DOMMouseScroll",k);this.domElement.removeEventListener("touchstart",l);this.domElement.removeEventListener("touchend",q);this.domElement.removeEventListener("touchmove",v);window.removeEventListener("keyup",p);window.removeEventListener("keydown",m)};this.domElement.addEventListener("mousedown", c,{passive:!1});this.domElement.addEventListener("mousewheel",k,{passive:!1});this.domElement.addEventListener("DOMMouseScroll",k,{passive:!1});this.domElement.addEventListener("touchstart",l,{passive:!1});this.domElement.addEventListener("touchend",q,{passive:!1});this.domElement.addEventListener("touchmove",v,{passive:!1});window.addEventListener("keyup",p,{passive:!1});window.addEventListener("keydown",m,{passive:!1});this.update()}function ca(a,b){var c=this,d={type:"change"},g=0,k=0,p=0,m=0; this.camera=a;this.camera.rotation.reorder("YXZ");this.domElement=void 0!==b?b:document;this.enabled=!0;this.deviceOrientation={};this.alphaOffsetAngle=this.alpha=this.screenOrientation=0;var l=function(a){c.deviceOrientation=a},v=function(){c.screenOrientation=window.orientation||0},q=function(a){a.preventDefault();a.stopPropagation();p=a.touches[0].pageX;m=a.touches[0].pageY},f=function(a){a.preventDefault();a.stopPropagation();g+=e.Math.degToRad((a.touches[0].pageX-p)/4);k+=e.Math.degToRad((m- a.touches[0].pageY)/4);c.updateAlphaOffsetAngle(g);p=a.touches[0].pageX;m=a.touches[0].pageY};this.connect=function(){v();window.addEventListener("orientationchange",v,{passive:!0});window.addEventListener("deviceorientation",l,{passive:!0});window.addEventListener("deviceorientation",this.update.bind(this),{passive:!0});c.domElement.addEventListener("touchstart",q,{passive:!1});c.domElement.addEventListener("touchmove",f,{passive:!1});c.enabled=!0};this.disconnect=function(){window.removeEventListener("orientationchange", v,!1);window.removeEventListener("deviceorientation",l,!1);window.removeEventListener("deviceorientation",this.update.bind(this),!1);c.domElement.removeEventListener("touchstart",q,!1);c.domElement.removeEventListener("touchmove",f,!1);c.enabled=!1};this.update=function(a){if(!1!==c.enabled){var b=c.deviceOrientation.alpha?e.Math.degToRad(c.deviceOrientation.alpha)+c.alphaOffsetAngle:0,g=c.deviceOrientation.beta?e.Math.degToRad(c.deviceOrientation.beta):0,f=c.deviceOrientation.gamma?e.Math.degToRad(c.deviceOrientation.gamma): 0,p=c.screenOrientation?e.Math.degToRad(c.screenOrientation):0,m=c.camera.quaternion,l=new e.Vector3(0,0,1),D=new e.Euler,q=new e.Quaternion,v=new e.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),h=new e.Quaternion,r=new e.Quaternion;if(0==c.screenOrientation){var n=new e.Vector3(1,0,0);h.setFromAxisAngle(n,-k)}else 180==c.screenOrientation?(n=new e.Vector3(1,0,0),h.setFromAxisAngle(n,k)):90==c.screenOrientation?(n=new e.Vector3(0,1,0),h.setFromAxisAngle(n,k)):-90==c.screenOrientation&&(n=new e.Vector3(0, 1,0),h.setFromAxisAngle(n,-k));v.multiply(h);v.multiply(r);D.set(g,b,-f,"YXZ");m.setFromEuler(D);m.multiply(v);m.multiply(q.setFromAxisAngle(l,-p));c.alpha=b;!0!==a&&c.dispatchEvent(d)}};this.updateAlphaOffsetAngle=function(a){this.alphaOffsetAngle=a;this.update()};this.dispose=function(){this.disconnect()};this.connect()}function ha(a){var b=new e.OrthographicCamera(-1,1,1,-1,0,1),c=new e.Scene,d=new e.StereoCamera;d.aspect=.5;var g=new e.WebGLRenderTarget(512,512,{minFilter:e.LinearFilter,magFilter:e.NearestFilter, format:e.RGBAFormat});g.scissorTest=!0;g.texture.generateMipmaps=!1;var k=new e.Vector2(.441,.156),p=(new e.PlaneBufferGeometry(1,1,10,20)).removeAttribute("normal").toNonIndexed(),m=p.attributes.position.array,l=p.attributes.uv.array;p.attributes.position.count*=2;p.attributes.uv.count*=2;var v=new Float32Array(2*m.length);v.set(m);v.set(m,m.length);var q=new Float32Array(2*l.length);q.set(l);q.set(l,l.length);l=new e.Vector2;m=m.length/3;for(var f=0,D=v.length/3;f<D;f++){l.x=v[3*f];l.y=v[3*f+1]; var h=l.dot(l);h=1.5+(k.x+k.y*h)*h;var n=f<m?0:1;v[3*f]=l.x/h*1.5-.5+n;v[3*f+1]=l.y/h*3;q[2*f]=.5*(q[2*f]+n)}p.attributes.position.array=v;p.attributes.uv.array=q;k=new e.MeshBasicMaterial({map:g.texture});p=new e.Mesh(p,k);c.add(p);this.setSize=function(d,b){a.setSize(d,b);var c=a.getPixelRatio();g.setSize(d*c,b*c)};this.render=function(k,f){k.updateMatrixWorld();null===f.parent&&f.updateMatrixWorld();d.update(f);f=g.width/2;var e=g.height;a.autoClear&&a.clear();g.scissor.set(0,0,f,e);g.viewport.set(0, 0,f,e);a.setRenderTarget(g);a.render(k,d.cameraL);a.clearDepth();g.scissor.set(f,0,f,e);g.viewport.set(f,0,f,e);a.setRenderTarget(g);a.render(k,d.cameraR);a.clearDepth();a.setRenderTarget(null);a.render(c,b)}}function da(a){a=a||{};a.controlBar=void 0!==a.controlBar?a.controlBar:!0;a.controlButtons=a.controlButtons||["fullscreen","setting","video"];a.autoHideControlBar=void 0!==a.autoHideControlBar?a.autoHideControlBar:!1;a.autoHideInfospot=void 0!==a.autoHideInfospot?a.autoHideInfospot:!0;a.horizontalView= void 0!==a.horizontalView?a.horizontalView:!1;a.clickTolerance=a.clickTolerance||10;a.cameraFov=a.cameraFov||60;a.reverseDragging=a.reverseDragging||!1;a.enableReticle=a.enableReticle||!1;a.dwellTime=a.dwellTime||1500;a.autoReticleSelect=void 0!==a.autoReticleSelect?a.autoReticleSelect:!0;a.viewIndicator=void 0!==a.viewIndicator?a.viewIndicator:!1;a.indicatorSize=a.indicatorSize||30;a.output=a.output?a.output:"none";a.autoRotate=a.autoRotate||!1;a.autoRotateSpeed=a.autoRotateSpeed||2;a.autoRotateActivationDuration= a.autoRotateActivationDuration||5E3;this.options=a;if(a.container){var b=a.container;b._width=b.clientWidth;b._height=b.clientHeight}else b=document.createElement("div"),b.classList.add("panolens-container"),b.style.width="100%",b.style.height="100%",b._width=window.innerWidth,b._height=window.innerHeight,document.body.appendChild(b);this.container=b;this.camera=a.camera||new e.PerspectiveCamera(this.options.cameraFov,this.container.clientWidth/this.container.clientHeight,1,1E4);this.scene=a.scene|| new e.Scene;this.renderer=a.renderer||new e.WebGLRenderer({alpha:!0,antialias:!1});this.sceneReticle=new e.Scene;this.viewIndicatorSize=this.options.indicatorSize;this.reticle={};this.tempEnableReticle=this.options.enableReticle;this.mode=t.NORMAL;this.pressObject=this.pressEntityObject=this.infospot=this.hoverObject=this.widget=this.panorama=null;this.raycaster=new e.Raycaster;this.raycasterPoint=new e.Vector2;this.userMouse=new e.Vector2;this.updateCallbacks=[];this.requestAnimationId=null;this.cameraFrustum= new e.Frustum;this.cameraViewProjectionMatrix=new e.Matrix4;this.outputDivElement=this.autoRotateRequestId=null;this.touchSupported="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;this.HANDLER_MOUSE_DOWN=this.onMouseDown.bind(this);this.HANDLER_MOUSE_UP=this.onMouseUp.bind(this);this.HANDLER_MOUSE_MOVE=this.onMouseMove.bind(this);this.HANDLER_WINDOW_RESIZE=this.onWindowResize.bind(this);this.HANDLER_KEY_DOWN=this.onKeyDown.bind(this);this.HANDLER_KEY_UP=this.onKeyUp.bind(this); this.HANDLER_TAP=this.onTap.bind(this,{clientX:this.container.clientWidth/2,clientY:this.container.clientHeight/2});this.OUTPUT_INFOSPOT=!1;this.tweenLeftAnimation=new r.Tween;this.tweenUpAnimation=new r.Tween;this.renderer.setPixelRatio(window.devicePixelRatio);this.renderer.setSize(this.container.clientWidth,this.container.clientHeight);this.renderer.setClearColor(0,0);this.renderer.autoClear=!1;this.renderer.domElement.classList.add("panolens-canvas");this.renderer.domElement.style.display="block"; this.container.style.backgroundColor="#000";this.container.appendChild(this.renderer.domElement);this.OrbitControls=new ba(this.camera,this.container);this.OrbitControls.id="orbit";this.OrbitControls.minDistance=1;this.OrbitControls.noPan=!0;this.OrbitControls.autoRotate=this.options.autoRotate;this.OrbitControls.autoRotateSpeed=this.options.autoRotateSpeed;this.DeviceOrientationControls=new ca(this.camera,this.container);this.DeviceOrientationControls.id="device-orientation";this.DeviceOrientationControls.enabled= !1;this.camera.position.z=1;this.options.passiveRendering&&console.warn("passiveRendering is now deprecated");this.controls=[this.OrbitControls,this.DeviceOrientationControls];this.control=this.OrbitControls;this.CardboardEffect=new ha(this.renderer);this.CardboardEffect.setSize(this.container.clientWidth,this.container.clientHeight);this.StereoEffect=new ia(this.renderer);this.StereoEffect.setSize(this.container.clientWidth,this.container.clientHeight);this.effect=this.CardboardEffect;this.addReticle(); this.options.horizontalView&&(this.OrbitControls.minPolarAngle=Math.PI/2,this.OrbitControls.maxPolarAngle=Math.PI/2);!1!==this.options.controlBar&&this.addDefaultControlBar(this.options.controlButtons);this.options.viewIndicator&&this.addViewIndicator();this.options.reverseDragging&&this.reverseDraggingDirection();this.options.enableReticle?this.enableReticleControl():this.registerMouseAndTouchEvents();"overlay"===this.options.output&&this.addOutputElement();this.registerEventListeners();this.animate.call(this)} var ja="^0.105.2".replace(/[^0-9.]/g,""),E={ORBIT:0,DEVICEORIENTATION:1},t={UNKNOWN:0,NORMAL:1,CARDBOARD:2,STERE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CTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0gMTMgMCBMIDEwIDIgTCAxNiAyIFoiPjwvcGF0aD4KCQk8cGF0aCBjbGFzcz0ic3QyIiBkPSJNIDIgMCBBIDIgMiAwIDAgMCAtMiAwIEEgMiAyIDAgMCAwIDIgMCIgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwxMywxNS41KSI+PC9wYXRoPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGlkPSJpbmRpY2F0b3IiIHRyYW5zZm9ybT0ibWF0cml4KDEsMCwwLDEsMTMsMTUuNSkiPjwvcGF0aD4KCTwvZz4KPC9zdmc+"}, ea={load:function(a,b,c,d){b=void 0===b?function(){}:b;c=void 0===c?function(){}:c;d=void 0===d?function(){}:d;e.Cache.enabled=!0;var g,k,p,m;for(m in u)u.hasOwnProperty(m)&&a===u[m]&&(g=m);var l=e.Cache.get(g?g:a);if(void 0!==l)return b&&setTimeout(function(){c({loaded:1,total:1});b(l)},0),l;var h=window.URL||window.webkitURL;var q=document.createElementNS("http://www.w3.org/1999/xhtml","img");e.Cache.add(g?g:a,q);var f=function(){h.revokeObjectURL(q.src);b(q)};if(0===a.indexOf("data:"))return q.addEventListener("load", f,!1),q.src=a,q;q.crossOrigin=void 0!==this.crossOrigin?this.crossOrigin:"";g=new window.XMLHttpRequest;g.open("GET",a,!0);"test"!==process.env.npm_lifecycle_event&&(g.onreadystatechange=function(){4===this.readyState&&400<=this.status&&d()});g.responseType="arraybuffer";g.addEventListener("error",d);g.addEventListener("progress",function(a){if(a){var d=a.loaded,b=a.total;a.lengthComputable&&c({loaded:d,total:b})}});g.addEventListener("loadend",function(a){a&&(k=new Uint8Array(a.currentTarget.response), p=new window.Blob([k]),q.addEventListener("load",f,!1),q.src=h.createObjectURL(p))});g.send(null)}},N={load:function(a,b,c,d){b=void 0===b?function(){}:b;var g=new e.Texture;ea.load(a,function(d){g.image=d;d=0<a.search(/\.(jpg|jpeg)$/)||0===a.search(/^data:image\/jpeg/);g.format=d?e.RGBFormat:e.RGBAFormat;g.needsUpdate=!0;b(g)},c,d);return g}},fa={load:function(a,b,c,d){b=void 0===b?function(){}:b;c=void 0===c?function(){}:c;var g;var k=new e.CubeTexture([]);var p=0;var m={};var l={};a.map(function(a, e){ea.load(a,function(a){k.images[e]=a;p++;6===p&&(k.needsUpdate=!0,b(k))},function(a){m[e]={loaded:a.loaded,total:a.total};l.loaded=0;g=l.total=0;for(var d in m)g++,l.loaded+=m[d].loaded,l.total+=m[d].total;6>g&&(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<a.length? b:window.navigator.mediaDevices.enumerateDevices()},switchNextVideoDevice:function(){var a=this.stop.bind(this),b=this.start.bind(this),c=this.setVideDeviceIndex.bind(this),d=this.videoDeviceIndex;this.getDevices("video").then(function(g){a();d++;d>=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<d.length;){this._tweensAddedDuringUpdate={};for(var g= 0;g<d.length;g++){var e=this._tweens[d[g]];e&&!1===e.update(a)&&(e._isPlaying=!1,b||delete this._tweens[d[g]])}d=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var c=new b;c.Group=b;c._nextId=0;c.nextId=function(){return c._nextId++};c.now="undefined"===typeof self&&"undefined"!==typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:"undefined"!==typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance): void 0!==Date.now?Date.now:function(){return(new Date).getTime()};c.Tween=function(a,b){this._object=a;this._valuesStart={};this._valuesEnd={};this._valuesStartRepeat={};this._duration=1E3;this._repeat=0;this._repeatDelayTime=void 0;this._reversed=this._isPlaying=this._yoyo=!1;this._delayTime=0;this._startTime=null;this._easingFunction=c.Easing.Linear.None;this._interpolationFunction=c.Interpolation.Linear;this._chainedTweens=[];this._onStartCallback=null;this._onStartCallbackFired=!1;this._onStopCallback= this._onCompleteCallback=this._onRepeatCallback=this._onUpdateCallback=null;this._group=b||c;this._id=c.nextId()};c.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(a,b){this._valuesEnd=Object.create(a);void 0!==b&&(this._duration=b);return this},duration:function(a){this._duration=a;return this},start:function(a){this._group.add(this);this._isPlaying=!0;this._onStartCallbackFired=!1;this._startTime=void 0!==a?"string"===typeof a?c.now()+ parseFloat(a):a:c.now();this._startTime+=this._delayTime;for(var d in this._valuesEnd){if(this._valuesEnd[d]instanceof Array){if(0===this._valuesEnd[d].length)continue;this._valuesEnd[d]=[this._object[d]].concat(this._valuesEnd[d])}void 0!==this._object[d]&&(this._valuesStart[d]=this._object[d],!1===this._valuesStart[d]instanceof Array&&(this._valuesStart[d]*=1),this._valuesStartRepeat[d]=this._valuesStart[d]||0)}return this},stop:function(){if(!this._isPlaying)return this;this._group.remove(this); this._isPlaying=!1;null!==this._onStopCallback&&this._onStopCallback(this._object);this.stopChainedTweens();return this},end:function(){this.update(Infinity);return this},stopChainedTweens:function(){for(var a=0,b=this._chainedTweens.length;a<b;a++)this._chainedTweens[a].stop()},group:function(a){this._group=a;return this},delay:function(a){this._delayTime=a;return this},repeat:function(a){this._repeat=a;return this},repeatDelay:function(a){this._repeatDelayTime=a;return this},yoyo:function(a){this._yoyo= a;return this},easing:function(a){this._easingFunction=a;return this},interpolation:function(a){this._interpolationFunction=a;return this},chain:function(){this._chainedTweens=arguments;return this},onStart:function(a){this._onStartCallback=a;return this},onUpdate:function(a){this._onUpdateCallback=a;return this},onRepeat:function(a){this._onRepeatCallback=a;return this},onComplete:function(a){this._onCompleteCallback=a;return this},onStop:function(a){this._onStopCallback=a;return this},update:function(a){var b; if(a<this._startTime)return!0;!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0);var d=(a-this._startTime)/this._duration;d=0===this._duration||1<d?1:d;var c=this._easingFunction(d);for(b in this._valuesEnd)if(void 0!==this._valuesStart[b]){var e=this._valuesStart[b]||0,l=this._valuesEnd[b];l instanceof Array?this._object[b]=this._interpolationFunction(l,c):("string"===typeof l&&(l="+"===l.charAt(0)||"-"===l.charAt(0)? e+parseFloat(l):parseFloat(l)),"number"===typeof l&&(this._object[b]=e+(l-e)*c))}null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,d);if(1===d)if(0<this._repeat){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat)"string"===typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]+=parseFloat(this._valuesEnd[b])),this._yoyo&&(d=this._valuesStartRepeat[b],this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=d),this._valuesStart[b]=this._valuesStartRepeat[b]; this._yoyo&&(this._reversed=!this._reversed);this._startTime=void 0!==this._repeatDelayTime?a+this._repeatDelayTime:a+this._delayTime;null!==this._onRepeatCallback&&this._onRepeatCallback(this._object)}else{null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);a=0;for(b=this._chainedTweens.length;a<b;a++)this._chainedTweens[a].start(this._startTime+this._duration);return!1}return!0}};c.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a* (2-a)},InOut:function(a){return 1>(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):1<b?l(a[d],a[d-1],d-g):l(a[e],a[e+1>d?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:func