var PANOLENS={REVISION:"9"},enableInlineVideo=function(){"use strict";function t(t,e,n,i){function o(n){r=e(o,i),t(n-(a||n)),a=n}var r,a;return{start:function(){r||o(0)},stop:function(){n(r),r=null,a=0}}}function e(e){return t(e,requestAnimationFrame,cancelAnimationFrame)}function n(t,e,n){function i(i){n&&!n(t,e)||i.stopImmediatePropagation()}return t.addEventListener(e,i),i}function i(t,e,n,i){function o(){return n[e]}function r(t){n[e]=t}i&&r(t[e]),Object.defineProperty(t,e,{get:o,set:r})}function o(t,e,n){n.addEventListener(e,function(){return t.dispatchEvent(new Event(e))})}function r(t,e){Promise.resolve().then(function(){t.dispatchEvent(new Event(e))})}function a(t){var e=new Audio;return o(t,"play",e),o(t,"playing",e),o(t,"pause",e),e.crossOrigin=t.crossOrigin,e.src=t.src||t.currentSrc||"data:",e}function s(t,e,n){(m||0)+200=t.video.duration}function c(t){var e=this;e.video.readyState>=e.video.HAVE_FUTURE_DATA?(e.hasAudio||(e.driver.currentTime=e.video.currentTime+t*e.video.playbackRate/1e3,e.video.loop&&h(e)&&(e.driver.currentTime=0)),s(e.video,e.driver.currentTime)):e.video.networkState===e.video.NETWORK_IDLE&&0===e.video.buffered.length&&e.video.load(),e.video.ended&&(delete e.video[y],e.video.pause(!0))}function l(){var t=this,e=t[g];if(t.webkitDisplayingFullscreen)return void t[N]();"data:"!==e.driver.src&&e.driver.src!==t.src&&(s(t,0,!0),e.driver.src=t.src),t.paused&&(e.paused=!1,0===t.buffered.length&&t.load(),e.driver.play(),e.updater.start(),e.hasAudio||(r(t,"play"),e.video.readyState>=e.video.HAVE_ENOUGH_DATA&&r(t,"playing")))}function u(t){var e=this,n=e[g];n.driver.pause(),n.updater.stop(),e.webkitDisplayingFullscreen&&e[w](),n.paused&&!t||(n.paused=!0,n.hasAudio||r(e,"pause"),e.ended&&!e.webkitDisplayingFullscreen&&(e[y]=!0,r(e,"ended")))}function d(t,n){var i={};t[g]=i,i.paused=!0,i.hasAudio=n,i.video=t,i.updater=e(c.bind(i)),n?i.driver=a(t):(t.addEventListener("canplay",function(){t.paused||r(t,"playing")}),i.driver={src:t.src||t.currentSrc||"data:",muted:!0,paused:!0,pause:function(){i.driver.paused=!0},play:function(){i.driver.paused=!1,h(i)&&s(t,0)},get ended(){return h(i)}}),t.addEventListener("emptied",function(){var e=!i.driver.src||"data:"===i.driver.src;i.driver.src&&i.driver.src!==t.src&&(s(t,0,!0),i.driver.src=t.src,e||!n&&t.autoplay?i.driver.play():i.updater.stop())},!1),t.addEventListener("webkitbeginfullscreen",function(){t.paused?n&&0===i.driver.buffered.length&&i.driver.load():(t.pause(),t[N]())}),n&&(t.addEventListener("webkitendfullscreen",function(){i.driver.currentTime=t.currentTime}),t.addEventListener("seeking",function(){b.indexOf(100*t.currentTime|0)<0&&(i.driver.currentTime=t.currentTime)}))}function p(t){var e=t[y];return delete t[y],!t.webkitDisplayingFullscreen&&!e}function f(t){var e=t[g];t[N]=t.play,t[w]=t.pause,t.play=l,t.pause=u,i(t,"paused",e.driver),i(t,"muted",e.driver,!0),i(t,"playbackRate",e.driver,!0),i(t,"ended",e.driver),i(t,"loop",e.driver,!0),n(t,"seeking",function(t){return!t.webkitDisplayingFullscreen}),n(t,"seeked",function(t){return!t.webkitDisplayingFullscreen}),n(t,"timeupdate",p),n(t,"ended",p)}function E(t,e){if(void 0===e&&(e={}),!t[g]){if(!e.everywhere){if(!v)return;if(!(e.iPad||e.ipad?/iPhone|iPod|iPad/:/iPhone|iPod/).test(navigator.userAgent))return}t.pause();var n=t.autoplay;t.autoplay=!1,d(t,!t.muted),f(t),t.classList.add("IIV"),t.muted&&n&&(t.play(),t.addEventListener("playing",function e(){t.autoplay=!0,t.removeEventListener("playing",e)})),/iPhone|iPod|iPad/.test(navigator.platform)||console.warn("iphone-inline-video is not guaranteed to work in emulated environments")}}var m,v="object"==typeof document&&"object-fit"in document.head.style&&!matchMedia("(-webkit-video-playable-inline)").matches,g="bfred-it:iphone-inline-video",y="bfred-it:iphone-inline-video:event",N="bfred-it:iphone-inline-video:nativeplay",w="bfred-it:iphone-inline-video:nativepause",b=[],L=0;return E}(),TWEEN=TWEEN||function(){var t=[];return{getAll:function(){return t},removeAll:function(){t=[]},add:function(e){t.push(e)},remove:function(e){var n=t.indexOf(e);n!==-1&&t.splice(n,1)},update:function(e,n){if(0===t.length)return!1;var i=0;for(e=void 0!==e?e:TWEEN.now();i1?1:N,w=p(N);for(c in o)if(void 0!==i[c]){var b=i[c]||0,L=o[c];L instanceof Array?n[c]=f(L,w):("string"==typeof L&&(L="+"===L.charAt(0)||"-"===L.charAt(0)?b+parseFloat(L):parseFloat(L)),"number"==typeof L&&(n[c]=b+(L-b)*w))}if(null!==g&&g.call(n,w),1===N){if(s>0){isFinite(s)&&s--;for(c in r){if("string"==typeof o[c]&&(r[c]=r[c]+parseFloat(o[c])),h){var O=r[c];r[c]=o[c],o[c]=O}i[c]=r[c]}return h&&(l=!l),d=void 0!==e?t+e:t+u,!0}null!==y&&y.call(n,n);for(var A=0,P=E.length;A1?r(t[n],t[n-1],n-i):r(t[o],t[o+1>n?n:o+1],i-o)},Bezier:function(t,e){for(var n=0,i=t.length-1,o=Math.pow,r=TWEEN.Interpolation.Utils.Bernstein,a=0;a<=i;a++)n+=o(1-e,i-a)*o(e,a)*t[a]*r(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),r=TWEEN.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(i=n*(1+e))),r(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o)):e<0?t[0]-(r(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(r(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):r(t[o?o-1:0],t[o],t[n1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,o){var r=.5*(n-t),a=.5*(i-e),s=o*o;return(2*e-2*n+r+a)*(o*s)+(-3*e+3*n-2*r-a)*s+r*o+e}}},function(t){"function"==typeof define&&define.amd?define([],function(){return TWEEN}):"undefined"!=typeof module&&"object"==typeof exports?module.exports=TWEEN:void 0!==t&&(t.TWEEN=TWEEN)}(this),THREE.OrbitControls=function(t,e){function n(){return 2*Math.PI/60/60*N.autoRotateSpeed}function i(){return Math.pow(.95,N.zoomSpeed)}function o(t){if(j=!1,U=k=0,N.enabled!==!1){if(t.preventDefault(),t.button===N.mouseButtons.ORBIT){if(N.noRotate===!0)return;F=B.ROTATE,w.set(t.clientX,t.clientY)}else if(t.button===N.mouseButtons.ZOOM){if(N.noZoom===!0)return;F=B.DOLLY,R.set(t.clientX,t.clientY)}else if(t.button===N.mouseButtons.PAN){if(N.noPan===!0)return;F=B.PAN,O.set(t.clientX,t.clientY)}F!==B.NONE&&(document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",a,!1),N.dispatchEvent(X)),N.update()}}function r(t){if(N.enabled!==!1){t.preventDefault();var e=N.domElement===document?N.domElement.body:N.domElement;if(F===B.ROTATE){if(N.noRotate===!0)return;b.set(t.clientX,t.clientY),L.subVectors(b,w),N.rotateLeft(2*Math.PI*L.x/e.clientWidth*N.rotateSpeed),N.rotateUp(2*Math.PI*L.y/e.clientHeight*N.rotateSpeed),w.copy(b),E&&(U=t.clientX-E.clientX,k=t.clientY-E.clientY),E=t}else if(F===B.DOLLY){if(N.noZoom===!0)return;x.set(t.clientX,t.clientY),M.subVectors(x,R),M.y>0?N.dollyIn():M.y<0&&N.dollyOut(),R.copy(x)}else if(F===B.PAN){if(N.noPan===!0)return;A.set(t.clientX,t.clientY),P.subVectors(A,O),N.pan(P.x,P.y),O.copy(A)}F!==B.NONE&&N.update()}}function a(){j=!0,E=void 0,N.enabled!==!1&&(document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",a,!1),N.dispatchEvent(q),F=B.NONE)}function s(t){if(N.enabled!==!1&&N.noZoom!==!0&&F===B.NONE){t.preventDefault(),t.stopPropagation();var e=0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),e>0?(N.object.fov=N.object.fovN.minFov?N.object.fov-1:N.minFov,N.object.updateProjectionMatrix()),N.update(),N.dispatchEvent(Y),N.dispatchEvent(X),N.dispatchEvent(q)}}function h(t){switch(t.keyCode){case N.keys.UP:m=!1;break;case N.keys.BOTTOM:v=!1;break;case N.keys.LEFT:g=!1;break;case N.keys.RIGHT:y=!1}}function c(t){if(N.enabled!==!1&&N.noKeys!==!0&&N.noRotate!==!0){switch(t.keyCode){case N.keys.UP:m=!0;break;case N.keys.BOTTOM:v=!0;break;case N.keys.LEFT:g=!0;break;case N.keys.RIGHT:y=!0}(m||v||g||y)&&(j=!0,m&&(k=-N.rotateSpeed*N.momentumKeydownFactor),v&&(k=N.rotateSpeed*N.momentumKeydownFactor),g&&(U=-N.rotateSpeed*N.momentumKeydownFactor),y&&(U=N.rotateSpeed*N.momentumKeydownFactor))}}function l(t){if(j=!1,U=k=0,N.enabled!==!1){switch(t.touches.length){case 1:if(N.noRotate===!0)return;F=B.TOUCH_ROTATE,w.set(t.touches[0].pageX,t.touches[0].pageY);break;case 2:if(N.noZoom===!0)return;F=B.TOUCH_DOLLY;var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY;Math.sqrt(e*e+n*n);break;case 3:if(N.noPan===!0)return;F=B.TOUCH_PAN,O.set(t.touches[0].pageX,t.touches[0].pageY);break;default:F=B.NONE}F!==B.NONE&&N.dispatchEvent(X)}}function u(t){if(N.enabled!==!1){t.preventDefault(),t.stopPropagation();var e=N.domElement===document?N.domElement.body:N.domElement;switch(t.touches.length){case 1:if(N.noRotate===!0)return;if(F!==B.TOUCH_ROTATE)return;b.set(t.touches[0].pageX,t.touches[0].pageY),L.subVectors(b,w),N.rotateLeft(2*Math.PI*L.x/e.clientWidth*N.rotateSpeed),N.rotateUp(2*Math.PI*L.y/e.clientHeight*N.rotateSpeed),w.copy(b),E&&(U=t.touches[0].pageX-E.pageX,k=t.touches[0].pageY-E.pageY),E={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY},N.update();break;case 2:if(N.noZoom===!0)return;if(F!==B.TOUCH_DOLLY)return;var n=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY;Math.sqrt(n*n+i*i);t.scale<1?(N.object.fov=N.object.fov1&&(N.object.fov=N.object.fov>N.minFov?N.object.fov-1:N.minFov,N.object.updateProjectionMatrix()),N.update(),N.dispatchEvent(Y);break;case 3:if(N.noPan===!0)return;if(F!==B.TOUCH_PAN)return;A.set(t.touches[0].pageX,t.touches[0].pageY),P.subVectors(A,O),N.pan(P.x,P.y),O.copy(A),N.update();break;default:F=B.NONE}}}function d(){j=!0,E=void 0,N.enabled!==!1&&(N.dispatchEvent(q),F=B.NONE)}this.object=t,this.domElement=void 0!==e?e:document,this.frameId,this.enabled=!0,this.target=new THREE.Vector3,this.center=this.target,this.noZoom=!1,this.zoomSpeed=1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,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=-(1/0),this.maxAzimuthAngle=1/0,this.noKeys=!1,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT};var p,f,E,m,v,g,y,N=this,w=new THREE.Vector2,b=new THREE.Vector2,L=new THREE.Vector2,O=new THREE.Vector2,A=new THREE.Vector2,P=new THREE.Vector2,S=new THREE.Vector3,T=new THREE.Vector3,R=new THREE.Vector2,x=new THREE.Vector2,M=new THREE.Vector2,I=0,C=0,H=1,D=new THREE.Vector3,V=new THREE.Vector3,_=new THREE.Quaternion,U=0,k=0,j=!1,B={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},F=B.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var W=(new THREE.Quaternion).setFromUnitVectors(t.up,new THREE.Vector3(0,1,0)),z=W.clone().inverse(),Y={type:"change"},X={type:"start"},q={type:"end"};this.setLastQuaternion=function(t){_.copy(t),N.object.quaternion.copy(t)},this.getLastPosition=function(){return V},this.rotateLeft=function(t){void 0===t&&(t=n()),C-=t},this.rotateUp=function(t){void 0===t&&(t=n()),I-=t},this.panLeft=function(t){var e=this.object.matrix.elements;S.set(e[0],e[1],e[2]),S.multiplyScalar(-t),D.add(S)},this.panUp=function(t){var e=this.object.matrix.elements;S.set(e[4],e[5],e[6]),S.multiplyScalar(t),D.add(S)},this.pan=function(t,e){var n=N.domElement===document?N.domElement.body:N.domElement;if(N.object instanceof THREE.PerspectiveCamera){var i=N.object.position,o=i.clone().sub(N.target),r=o.length();r*=Math.tan(N.object.fov/2*Math.PI/180),N.panLeft(2*t*r/n.clientHeight),N.panUp(2*e*r/n.clientHeight)}else N.object instanceof THREE.OrthographicCamera?(N.panLeft(t*(N.object.right-N.object.left)/n.clientWidth),N.panUp(e*(N.object.top-N.object.bottom)/n.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")},this.momentum=function(){if(j){if(Math.abs(U)<1e-4&&Math.abs(k)<1e-4)return void(j=!1);k*=this.momentumDampingFactor,U*=this.momentumDampingFactor,C-=this.momentumScalingFactor*U,I-=this.momentumScalingFactor*k}},this.dollyIn=function(t){void 0===t&&(t=i()),N.object instanceof THREE.PerspectiveCamera?H/=t:N.object instanceof THREE.OrthographicCamera?(N.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),N.object.updateProjectionMatrix(),N.dispatchEvent(Y)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.dollyOut=function(t){void 0===t&&(t=i()),N.object instanceof THREE.PerspectiveCamera?H*=t:N.object instanceof THREE.OrthographicCamera?(N.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),N.object.updateProjectionMatrix(),N.dispatchEvent(Y)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.update=function(t){var e=this.object.position;T.copy(e).sub(this.target),T.applyQuaternion(W),p=Math.atan2(T.x,T.z),f=Math.atan2(Math.sqrt(T.x*T.x+T.z*T.z),T.y),this.autoRotate&&F===B.NONE&&this.rotateLeft(n()),this.momentum(),p+=C,f+=I,p=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,p)),f=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,f)),f=Math.max(1e-7,Math.min(Math.PI-1e-7,f));var i=T.length()*H;i=Math.max(this.minDistance,Math.min(this.maxDistance,i)),this.target.add(D),T.x=i*Math.sin(f)*Math.sin(p),T.y=i*Math.cos(f),T.z=i*Math.sin(f)*Math.cos(p),T.applyQuaternion(z),e.copy(this.target).add(T),this.object.lookAt(this.target),C=0,I=0,H=1,D.set(0,0,0),(V.distanceToSquared(this.object.position)>1e-7||8*(1-_.dot(this.object.quaternion))>1e-7)&&(t!==!0&&this.dispatchEvent(Y),V.copy(this.object.position),_.copy(this.object.quaternion))},this.reset=function(){F=B.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Y),this.update()},this.getPolarAngle=function(){return f},this.getAzimuthalAngle=function(){return p},this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mousewheel",s,!1),this.domElement.addEventListener("DOMMouseScroll",s,!1),this.domElement.addEventListener("touchstart",l,!1),this.domElement.addEventListener("touchend",d,!1),this.domElement.addEventListener("touchmove",u,!1),window.addEventListener("keyup",h,!1),window.addEventListener("keydown",c,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,THREE.DeviceOrientationControls=function(t,e){var n=this,i={type:"change"},o=0,r=0,a=0,s=0;this.camera=t,this.camera.rotation.reorder("YXZ"),this.domElement=void 0!==e?e:document,this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alpha=0,this.alphaOffsetAngle=0;var h=function(t){n.deviceOrientation=t},c=function(){n.screenOrientation=window.orientation||0},l=function(t){t.preventDefault(),t.stopPropagation(),a=t.touches[0].pageX,s=t.touches[0].pageY},u=function(t){t.preventDefault(),t.stopPropagation(),o+=THREE.Math.degToRad((t.touches[0].pageX-a)/4),r+=THREE.Math.degToRad((s-t.touches[0].pageY)/4),n.updateAlphaOffsetAngle(o),a=t.touches[0].pageX,s=t.touches[0].pageY},d=function(t,e,i,o,a){var s,h=new THREE.Vector3(0,0,1),c=new THREE.Euler,l=new THREE.Quaternion,u=new THREE.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),d=new THREE.Quaternion,p=new THREE.Quaternion;0==n.screenOrientation?(s=new THREE.Vector3(1,0,0),d.setFromAxisAngle(s,-r)):180==n.screenOrientation?(s=new THREE.Vector3(1,0,0),d.setFromAxisAngle(s,r)):90==n.screenOrientation?(s=new THREE.Vector3(0,1,0),d.setFromAxisAngle(s,r)):n.screenOrientation==-90&&(s=new THREE.Vector3(0,1,0),d.setFromAxisAngle(s,-r)),u.multiply(d),u.multiply(p),c.set(i,e,-o,"YXZ"),t.setFromEuler(c),t.multiply(u),t.multiply(l.setFromAxisAngle(h,-a))};this.connect=function(){c(),window.addEventListener("orientationchange",c,!1),window.addEventListener("deviceorientation",h,!1),window.addEventListener("deviceorientation",this.update.bind(this),!1),n.domElement.addEventListener("touchstart",l,!1),n.domElement.addEventListener("touchmove",u,!1),n.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",c,!1),window.removeEventListener("deviceorientation",h,!1),window.removeEventListener("deviceorientation",this.update.bind(this),!1),n.domElement.removeEventListener("touchstart",l,!1),n.domElement.removeEventListener("touchmove",u,!1),n.enabled=!1},this.update=function(t){if(n.enabled!==!1){var e=n.deviceOrientation.alpha?THREE.Math.degToRad(n.deviceOrientation.alpha)+this.alphaOffsetAngle:0,o=n.deviceOrientation.beta?THREE.Math.degToRad(n.deviceOrientation.beta):0,r=n.deviceOrientation.gamma?THREE.Math.degToRad(n.deviceOrientation.gamma):0,a=n.screenOrientation?THREE.Math.degToRad(n.screenOrientation):0;d(n.camera.quaternion,e,o,r,a),this.alpha=e,t!==!0&&this.dispatchEvent(i)}},this.updateAlphaOffsetAngle=function(t){this.alphaOffsetAngle=t,this.update()},this.dispose=function(){this.disconnect()},this.connect()},THREE.DeviceOrientationControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.DeviceOrientationControls.prototype.constructor=THREE.DeviceOrientationControls,THREE.BendModifier=function(){},THREE.BendModifier.prototype={constructor:THREE.BendModifier,set:function(t,e,n){return this.direction=new THREE.Vector3,this.direction.copy(t),this.axis=new THREE.Vector3,this.axis.copy(e),this.angle=n,this},_sign:function(t){return 0>t?-1:0s&&(s=o[u].x),o[u].xc&&(c=o[u].y),o[u].y1){for(var i=0;i800&&window.innerWidth<=1280?this.ImageQualityMedium:window.innerWidth>1280&&window.innerWidth<=1920?this.ImageQualityHigh:window.innerWidth>1920?this.ImageQualitySuperHigh:this.ImageQualityLow},PANOLENS.Panorama.prototype.updateTexture=function(t){this.material.map=t,this.material.needsUpdate=!0},PANOLENS.Panorama.prototype.toggleInfospotVisibility=function(t,e){e=void 0!==e?e:0;var n,i;n=this,i=void 0!==t?t:!this.isInfospotVisible,this.traverse(function(t){t instanceof PANOLENS.Infospot&&(i?t.show(e):t.hide(e))}),this.isInfospotVisible=i,this.infospotAnimation.onComplete(function(){n.dispatchEvent({type:"infospot-animation-complete",visible:i})}).delay(e).start()},PANOLENS.Panorama.prototype.setLinkingImage=function(t,e){this.linkingImageURL=t,this.linkingImageScale=e},PANOLENS.Panorama.prototype.link=function(t,e,n,i){var o,r,a,s=this;if(this.visible=!0,!e)return void console.warn("Please specify infospot position for linking");r=void 0!==n?n:void 0!==t.linkingImageScale?t.linkingImageScale:300,a=i||(t.linkingImageURL?t.linkingImageURL:PANOLENS.DataImage.Arrow),o=new PANOLENS.Infospot(r,a),o.position.copy(e),o.toPanorama=t,o.addEventListener("click",function(){s.dispatchEvent({type:"panolens-viewer-handler",method:"setPanorama",data:t})}),this.linkedSpots.push(o),this.add(o),this.visible=!1},PANOLENS.Panorama.prototype.reset=function(){this.children.length=0},PANOLENS.Panorama.prototype.setupTransitions=function(){this.fadeInAnimation=new TWEEN.Tween(this.material).easing(TWEEN.Easing.Quartic.Out).onStart(function(){this.visible=!0,this.material.visible=!0,this.dispatchEvent({type:"enter-fade-start"})}.bind(this)),this.fadeOutAnimation=new TWEEN.Tween(this.material).easing(TWEEN.Easing.Quartic.Out).onComplete(function(){this.visible=!1,this.material.visible=!0,this.dispatchEvent({type:"leave-complete"})}.bind(this)),this.enterTransition=new TWEEN.Tween(this).easing(TWEEN.Easing.Quartic.Out).onComplete(function(){this.dispatchEvent({type:"enter-animation-complete"})}.bind(this)).start(),this.leaveTransition=new TWEEN.Tween(this).easing(TWEEN.Easing.Quartic.Out)},PANOLENS.Panorama.prototype.fadeIn=function(t){t=t>=0?t:this.animationDuration,this.fadeOutAnimation.stop(),this.fadeInAnimation.to({opacity:1},t).onComplete(function(){this.toggleInfospotVisibility(!0,t/2),this.dispatchEvent({type:"enter-fade-complete"})}.bind(this)).start()},PANOLENS.Panorama.prototype.fadeOut=function(t){t=t>=0?t:this.animationDuration,this.fadeInAnimation.stop(),this.fadeOutAnimation.to({opacity:0},t).start()},PANOLENS.Panorama.prototype.onEnter=function(){var t=this.animationDuration;this.leaveTransition.stop(),this.enterTransition.to({},t).onStart(function(){this.dispatchEvent({type:"enter-animation-start"}),this.loaded?this.fadeIn(t):this.load()}.bind(this)).start(),this.dispatchEvent({type:"enter"})},PANOLENS.Panorama.prototype.onLeave=function(){var t=this.animationDuration;this.enterTransition.stop(),this.leaveTransition.to({},t).onStart(function(){this.dispatchEvent({type:"leave-animation-start"}),this.fadeOut(t),this.toggleInfospotVisibility(!1)}.bind(this)).start(),this.dispatchEvent({type:"leave"})},PANOLENS.Panorama.prototype.dispose=function(){function t(e){for(var n=e.children.length-1;n>=0;n--)t(e.children[n]),e.remove(e.children[n]);e instanceof PANOLENS.Infospot&&e.dispose(),e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}this.dispatchEvent({type:"panolens-viewer-handler",method:"onPanoramaDispose",data:this}),t(this),this.parent&&this.parent.remove(this)}}(),function(){"use strict";PANOLENS.ImagePanorama=function(t,e){e=e||5e3;var n=new THREE.SphereGeometry(e,60,40),i=new THREE.MeshBasicMaterial({opacity:0,transparent:!0});PANOLENS.Panorama.call(this,n,i),this.src=t},PANOLENS.ImagePanorama.prototype=Object.create(PANOLENS.Panorama.prototype),PANOLENS.ImagePanorama.prototype.constructor=PANOLENS.ImagePanorama,PANOLENS.ImagePanorama.prototype.load=function(t){if(!(t=t||this.src))return void console.warn("Image source undefined");"string"==typeof t?PANOLENS.Utils.TextureLoader.load(t,this.onLoad.bind(this),this.onProgress.bind(this),this.onError.bind(this)):t instanceof HTMLImageElement&&this.onLoad(new THREE.Texture(t))},PANOLENS.ImagePanorama.prototype.onLoad=function(t){t.minFilter=t.magFilter=THREE.LinearFilter,t.needsUpdate=!0,this.updateTexture(t),window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){PANOLENS.Panorama.prototype.onLoad.call(this)}.bind(this))}.bind(this))},PANOLENS.ImagePanorama.prototype.reset=function(){PANOLENS.Panorama.prototype.reset.call(this)}}(),function(){"use strict";PANOLENS.GoogleStreetviewPanorama=function(t,e){PANOLENS.ImagePanorama.call(this,void 0,e),this.panoId=t,this.gsvLoader=void 0,this.loadRequested=!1,this.setupGoogleMapAPI()},PANOLENS.GoogleStreetviewPanorama.prototype=Object.create(PANOLENS.ImagePanorama.prototype),PANOLENS.GoogleStreetviewPanorama.constructor=PANOLENS.GoogleStreetviewPanorama,PANOLENS.GoogleStreetviewPanorama.prototype.load=function(t){this.loadRequested=!0,t=t||this.panoId||{},t&&this.gsvLoader?this.loadGSVLoader(t):this.gsvLoader={}},PANOLENS.GoogleStreetviewPanorama.prototype.setupGoogleMapAPI=function(){var t=document.createElement("script");t.src="https://maps.googleapis.com/maps/api/js",t.onreadystatechange=this.setGSVLoader.bind(this),t.onload=this.setGSVLoader.bind(this),document.getElementsByTagName("head")[0].appendChild(t)},PANOLENS.GoogleStreetviewPanorama.prototype.setGSVLoader=function(){this.gsvLoader=new GSVPANO.PanoLoader,(this.gsvLoader==={}||this.loadRequested)&&this.load()},PANOLENS.GoogleStreetviewPanorama.prototype.getGSVLoader=function(){return this.gsvLoader},PANOLENS.GoogleStreetviewPanorama.prototype.loadGSVLoader=function(t){this.loadRequested=!1,this.gsvLoader.onProgress=this.onProgress.bind(this),this.gsvLoader.onPanoramaLoad=this.onLoad.bind(this),this.gsvLoader.setZoom(this.getZoomLevel()),this.gsvLoader.load(t),this.gsvLoader.loaded=!0},PANOLENS.GoogleStreetviewPanorama.prototype.onLoad=function(t){this.gsvLoader&&PANOLENS.ImagePanorama.prototype.onLoad.call(this,new THREE.Texture(t))},PANOLENS.GoogleStreetviewPanorama.prototype.reset=function(){this.gsvLoader=void 0,PANOLENS.ImagePanorama.prototype.reset.call(this)}}(),function(){"use strict";PANOLENS.CubePanorama=function(t,e){var n,i,o;this.images=t||[],e=e||1e4,n=JSON.parse(JSON.stringify(THREE.ShaderLib.cube)),i=new THREE.BoxGeometry(e,e,e),o=new THREE.ShaderMaterial({fragmentShader:n.fragmentShader,vertexShader:n.vertexShader,uniforms:n.uniforms,side:THREE.BackSide}),PANOLENS.Panorama.call(this,i,o)},PANOLENS.CubePanorama.prototype=Object.create(PANOLENS.Panorama.prototype),PANOLENS.CubePanorama.prototype.constructor=PANOLENS.CubePanorama,PANOLENS.CubePanorama.prototype.load=function(){PANOLENS.Utils.CubeTextureLoader.load(this.images,this.onLoad.bind(this),this.onProgress.bind(this),this.onError.bind(this))},PANOLENS.CubePanorama.prototype.onLoad=function(t){this.material.uniforms.tCube.value=t,PANOLENS.Panorama.prototype.onLoad.call(this)}}(),function(){"use strict";PANOLENS.BasicPanorama=function(t){var e=PANOLENS.DataImage.WhiteTile;PANOLENS.CubePanorama.call(this,[e,e,e,e,e,e],t)},PANOLENS.BasicPanorama.prototype=Object.create(PANOLENS.CubePanorama.prototype),PANOLENS.BasicPanorama.prototype.constructor=PANOLENS.BasicPanorama}(),function(){"use strict";PANOLENS.VideoPanorama=function(t,e,n){n=n||5e3;var i=new THREE.SphereGeometry(n,60,40),o=new THREE.MeshBasicMaterial({opacity:0,transparent:!0});PANOLENS.Panorama.call(this,i,o),this.src=t,this.options=e||{},this.options.playsinline=this.options.playsinline!==!1,this.videoElement=void 0,this.videoRenderObject=void 0,this.videoProgress=0,this.isIOS=/iPhone|iPad|iPod/i.test(navigator.userAgent),this.isMobile=this.isIOS||/Android|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent),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))},PANOLENS.VideoPanorama.prototype=Object.create(PANOLENS.Panorama.prototype),PANOLENS.VideoPanorama.constructor=PANOLENS.VideoPanorama,PANOLENS.VideoPanorama.prototype.load=function(t,e){var n=this;t=t||this.src||"",e=e||this.options||{},this.videoElement=e.videoElement||document.createElement("video"),this.videoElement.muted=e.muted||!1,this.videoElement.loop=void 0===e.loop||e.loop,this.videoElement.autoplay=void 0!==e.autoplay&&e.autoplay,this.videoElement.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:"anonymous",e.playsinline&&(this.videoElement.setAttribute("playsinline",""),this.videoElement.setAttribute("webkit-playsinline",""));var i=function(){n.onProgress({loaded:1,total:1}),n.setVideoTexture(n.videoElement),n.videoElement.autoplay&&n.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1}),n.isMobile&&(n.videoElement.autoplay&&n.videoElement.muted?n.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1}):n.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0})),n.onLoad()};this.videoElement.readyState>2?i():(this.videoElement.querySelectorAll("source").length&&this.videoElement.src||(this.videoElement.src=t),this.videoElement.load()),this.videoElement.onloadeddata=i,this.videoElement.ontimeupdate=function(t){n.videoProgress=this.duration>=0?this.currentTime/this.duration:0,n.dispatchEvent({type:"panolens-viewer-handler",method:"onVideoUpdate",data:n.videoProgress})},this.videoElement.addEventListener("ended",function(){n.options.loop||(n.resetVideo(),n.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0}))},!1)},PANOLENS.VideoPanorama.prototype.setVideoTexture=function(t){var e,n;t&&(e=new THREE.VideoTexture(t),e.minFilter=THREE.LinearFilter,e.magFilter=THREE.LinearFilter,e.format=THREE.RGBFormat,n={video:t,videoTexture:e},this.isIOS&&enableInlineVideo(t),this.updateTexture(e),this.videoRenderObject=n)},PANOLENS.VideoPanorama.prototype.reset=function(){this.videoElement=void 0,PANOLENS.Panorama.prototype.reset.call(this)},PANOLENS.VideoPanorama.prototype.isVideoPaused=function(){return this.videoRenderObject.video.paused},PANOLENS.VideoPanorama.prototype.toggleVideo=function(){this.videoRenderObject&&this.videoRenderObject.video&&(this.isVideoPaused()?this.videoRenderObject.video.play():this.videoRenderObject.video.pause())},PANOLENS.VideoPanorama.prototype.setVideoCurrentTime=function(t){this.videoRenderObject&&this.videoRenderObject.video&&!Number.isNaN(t.percentage)&&1!==t.percentage&&(this.videoRenderObject.video.currentTime=this.videoRenderObject.video.duration*t.percentage,this.dispatchEvent({type:"panolens-viewer-handler",method:"onVideoUpdate",data:t.percentage}))},PANOLENS.VideoPanorama.prototype.playVideo=function(){this.videoRenderObject&&this.videoRenderObject.video&&this.isVideoPaused()&&this.videoRenderObject.video.play(),this.dispatchEvent({type:"play"})},PANOLENS.VideoPanorama.prototype.pauseVideo=function(){this.videoRenderObject&&this.videoRenderObject.video&&!this.isVideoPaused()&&this.videoRenderObject.video.pause(),this.dispatchEvent({type:"pause"})},PANOLENS.VideoPanorama.prototype.resumeVideoProgress=function(){this.videoElement.autoplay&&!this.isMobile?(this.playVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1})):(this.pauseVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0})),this.setVideoCurrentTime({percentage:this.videoProgress})},PANOLENS.VideoPanorama.prototype.resetVideo=function(){this.videoRenderObject&&this.videoRenderObject.video&&this.setVideoCurrentTime({percentage:0})},PANOLENS.VideoPanorama.prototype.isVideoMuted=function(){return this.videoRenderObject.video.muted},PANOLENS.VideoPanorama.prototype.muteVideo=function(){this.videoRenderObject&&this.videoRenderObject.video&&!this.isVideoMuted()&&(this.videoRenderObject.video.muted=!0),this.dispatchEvent({type:"volumechange"})},PANOLENS.VideoPanorama.prototype.unmuteVideo=function(){this.videoRenderObject&&this.videoRenderObject.video&&this.isVideoMuted()&&(this.videoRenderObject.video.muted=!1),this.dispatchEvent({type:"volumechange"})},PANOLENS.VideoPanorama.prototype.getVideoElement=function(){return this.videoRenderObject.video},PANOLENS.VideoPanorama.prototype.dispose=function(){this.resetVideo(),this.pauseVideo(),this.removeEventListener("leave",this.pauseVideo.bind(this)),this.removeEventListener("enter-fade-start",this.resumeVideoProgress.bind(this)),this.removeEventListener("video-toggle",this.toggleVideo.bind(this)),this.removeEventListener("video-time",this.setVideoCurrentTime.bind(this)),PANOLENS.Panorama.prototype.dispose.call(this)}}(),function(){"use strict";PANOLENS.EmptyPanorama=function(t){t=t||5e3;var e=new THREE.Geometry,n=new THREE.MeshBasicMaterial({color:0,opacity:1,transparent:!0});PANOLENS.Panorama.call(this,e,n)},PANOLENS.EmptyPanorama.prototype=Object.create(PANOLENS.Panorama.prototype),PANOLENS.EmptyPanorama.prototype.constructor=PANOLENS.EmptyPanorama}(),function(){PANOLENS.LittlePlanet=function(t,e,n,i){t=t||"image","image"===t&&PANOLENS.ImagePanorama.call(this,e,n),this.size=n||1e4,this.ratio=i||.5,this.EPS=1e-6,this.frameId,this.geometry=this.createGeometry(),this.material=this.createMaterial(this.size),this.dragging=!1,this.userMouse=new THREE.Vector2,this.quatA=new THREE.Quaternion,this.quatB=new THREE.Quaternion,this.quatCur=new THREE.Quaternion,this.quatSlerp=new THREE.Quaternion,this.vectorX=new THREE.Vector3(1,0,0),this.vectorY=new THREE.Vector3(0,1,0),this.addEventListener("window-resize",this.onWindowResize)},PANOLENS.LittlePlanet.prototype=Object.create(PANOLENS.ImagePanorama.prototype),PANOLENS.LittlePlanet.prototype.constructor=PANOLENS.LittlePlanet,PANOLENS.LittlePlanet.prototype.createGeometry=function(){return new THREE.PlaneGeometry(this.size,this.size*this.ratio)},PANOLENS.LittlePlanet.prototype.createMaterial=function(t){var e=PANOLENS.StereographicShader.uniforms;return e.zoom.value=t,new THREE.ShaderMaterial({uniforms:e,vertexShader:PANOLENS.StereographicShader.vertexShader,fragmentShader:PANOLENS.StereographicShader.fragmentShader})},PANOLENS.LittlePlanet.prototype.registerMouseEvents=function(){this.container.addEventListener("mousedown",this.onMouseDown.bind(this),!1),this.container.addEventListener("mousemove",this.onMouseMove.bind(this),!1),this.container.addEventListener("mouseup",this.onMouseUp.bind(this),!1),this.container.addEventListener("touchstart",this.onMouseDown.bind(this),!1),this.container.addEventListener("touchmove",this.onMouseMove.bind(this),!1),this.container.addEventListener("touchend",this.onMouseUp.bind(this),!1),this.container.addEventListener("mousewheel",this.onMouseWheel.bind(this),!1),this.container.addEventListener("DOMMouseScroll",this.onMouseWheel.bind(this),!1),this.container.addEventListener("contextmenu",this.onContextMenu.bind(this),!1)},PANOLENS.LittlePlanet.prototype.unregisterMouseEvents=function(){this.container.removeEventListener("mousedown",this.onMouseDown.bind(this),!1),this.container.removeEventListener("mousemove",this.onMouseMove.bind(this),!1),this.container.removeEventListener("mouseup",this.onMouseUp.bind(this),!1),this.container.removeEventListener("touchstart",this.onMouseDown.bind(this),!1),this.container.removeEventListener("touchmove",this.onMouseMove.bind(this),!1),this.container.removeEventListener("touchend",this.onMouseUp.bind(this),!1),this.container.removeEventListener("mousewheel",this.onMouseWheel.bind(this),!1),this.container.removeEventListener("DOMMouseScroll",this.onMouseWheel.bind(this),!1),this.container.removeEventListener("contextmenu",this.onContextMenu.bind(this),!1)},PANOLENS.LittlePlanet.prototype.onMouseDown=function(t){var e=t.clientX>=0?t.clientX:t.touches[0].clientX,n=t.clientY>=0?t.clientY:t.touches[0].clientY;switch(t.touches&&t.touches.length||1){case 1:this.dragging=!0,this.userMouse.set(e,n);break;case 2:var i=t.touches[0].pageX-t.touches[1].pageX,o=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(i*i+o*o);this.userMouse.pinchDistance=r}this.onUpdateCallback()},PANOLENS.LittlePlanet.prototype.onMouseMove=function(t){var e=t.clientX>=0?t.clientX:t.touches[0].clientX,n=t.clientY>=0?t.clientY:t.touches[0].clientY;switch(t.touches&&t.touches.length||1){case 1:var i=.4*THREE.Math.degToRad(e-this.userMouse.x),o=.4*THREE.Math.degToRad(n-this.userMouse.y);this.dragging&&(this.quatA.setFromAxisAngle(this.vectorY,i),this.quatB.setFromAxisAngle(this.vectorX,o),this.quatCur.multiply(this.quatA).multiply(this.quatB),this.userMouse.set(e,n));break;case 2:var r=(this.material.uniforms,t.touches[0].pageX-t.touches[1].pageX),a=t.touches[0].pageY-t.touches[1].pageY,s=Math.sqrt(r*r+a*a);this.addZoomDelta(this.userMouse.pinchDistance-s)}},PANOLENS.LittlePlanet.prototype.onMouseUp=function(t){this.dragging=!1},PANOLENS.LittlePlanet.prototype.onMouseWheel=function(t){t.preventDefault(),t.stopPropagation();var e=0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),this.addZoomDelta(e),this.onUpdateCallback()},PANOLENS.LittlePlanet.prototype.addZoomDelta=function(t){var e=this.material.uniforms,n=.1*this.size,i=10*this.size;e.zoom.value+=t,e.zoom.value<=n?e.zoom.value=n:e.zoom.value>=i&&(e.zoom.value=i)},PANOLENS.LittlePlanet.prototype.onUpdateCallback=function(){this.frameId=window.requestAnimationFrame(this.onUpdateCallback.bind(this)),this.quatSlerp.slerp(this.quatCur,.1),this.material.uniforms.transform.value.makeRotationFromQuaternion(this.quatSlerp),!this.dragging&&1-this.quatSlerp.clone().dot(this.quatCur)=this.dwellTime?(this.completeDwelling(),t()):this.autoSelect&&(this.updateDwelling(performance.now()),this.timerId=window.requestAnimationFrame(this.select.bind(this,t)))},PANOLENS.Reticle.prototype.clearTimer=function(){window.cancelAnimationFrame(this.timerId),this.timerId=null},PANOLENS.Reticle.prototype.setupDwellSprite=function(t){t.wrapS=THREE.RepeatWrapping,t.repeat.set(1/this.dwellSpriteAmount,1)},PANOLENS.Reticle.prototype.updateStatus=function(t){this.status=t,t===this.IDLE?(this.scale.copy(this.scaleIdle),this.material.map=this.idleTexture):t===this.DWELLING&&(this.scale.copy(this.scaleDwell),this.material.map=this.dwellTexture),this.currentTile=0,this.material.map.offset.x=0},PANOLENS.Reticle.prototype.startDwelling=function(t){this.autoSelect&&(this.startTime=performance.now(),this.updateStatus(this.DWELLING),this.select(t))},PANOLENS.Reticle.prototype.updateDwelling=function(t){var e=t-this.startTime;this.currentTile<=this.dwellSpriteAmount?(this.currentTile=Math.floor(e/this.dwellTime*this.dwellSpriteAmount),this.material.map.offset.x=this.currentTile/this.dwellSpriteAmount):this.updateStatus(this.IDLE)},PANOLENS.Reticle.prototype.cancelDwelling=function(){this.clearTimer(),this.updateStatus(this.IDLE)},PANOLENS.Reticle.prototype.completeDwelling=function(){this.clearTimer(),this.updateStatus(this.IDLE)}}(),function(){PANOLENS.Tile=function(t,e,n,i,o,r,a){this.parameters={width:t,height:e,widthSegments:n,heightSegments:i,forceDirection:o,forceAxis:r,forceAngle:a},t=t||10,e=e||5,n=n||1,i=i||1,o=o||new THREE.Vector3(0,0,1),r=r||new THREE.Vector3(0,1,0),a=void 0!==a?a:0,THREE.Mesh.call(this,new THREE.PlaneGeometry(t,e,n,i),new THREE.MeshBasicMaterial({color:16777215,transparent:!0})),this.bendModifier=new THREE.BendModifier,this.entity=void 0,this.animationDuration=500,this.animationFadeOut=void 0,this.animationFadeIn=void 0,this.animationTranslation=void 0,this.tweens={},0!==a&&this.bend(o,r,a),this.originalGeometry=this.geometry.clone()},PANOLENS.Tile.prototype=Object.create(THREE.Mesh.prototype),PANOLENS.Tile.prototype.constructor=PANOLENS.Tile,PANOLENS.Tile.prototype.clone=function(){var t,e=this.parameters;return t=new PANOLENS.Tile(e.width,e.height,e.widthSegments,e.heightSegments,e.forceDirection,e.forceAxis,e.forceAngle),t.setEntity(this.entity),t.material=this.material.clone(),t},PANOLENS.Tile.prototype.bend=function(t,e,n){this.bendModifier.set(t,e,n).modify(this.geometry)},PANOLENS.Tile.prototype.unbend=function(){var t=this.geometry;this.geometry=this.originalGeometry,this.originalGeometry=this.geometry.clone(),t.dispose(),t=null},PANOLENS.Tile.prototype.tween=function(t,e,n,i,o,r,a,s,h){return e=e||this,n=n||{},i=i||this.animationDuration,o=o||TWEEN.Easing.Exponential.Out,r=void 0!==r?r:0,a=a||null,s=s||null,h=h||null,this.tweens[t]||(this.tweens[t]=new TWEEN.Tween(e).to(n,i).easing(o).delay(r).onStart(a).onUpdate(s).onComplete(h)),this.tweens[t]},PANOLENS.Tile.prototype.ripple=function(t,e,n){t=t||2,e=e||200,n=n||TWEEN.Easing.Cubic.Out;var i=this,o=this.clone();new TWEEN.Tween(o.scale).to({x:t,y:t},e).easing(n).start(),new TWEEN.Tween(o.material).to({opacity:0},e).easing(n).onComplete(function(){i.remove(o),o.geometry.dispose(),o.material.dispose()}).start(),this.add(o)},PANOLENS.Tile.prototype.setEntity=function(t){this.entity=t}}(),function(){"use strict";PANOLENS.TileGroup=function(t,e,n,i,o){var r=this;THREE.Object3D.call(this),this.tileArray=t||[],this.offset=void 0!==o?o:0,this.v_gap=void 0!==e?e:6,this.d_gap=void 0!==n?n:2,this.animationDuration=void 0!==i?i:200,this.animationEasing=TWEEN.Easing.Exponential.Out,this.visibleDelta=2,this.tileArray.map(function(t,e){t.image&&PANOLENS.Utils.TextureLoader.load(t.image,r.setTexture.bind(t)),t.position.set(0,e*-r.v_gap,e*-r.d_gap),t.originalPosition=t.position.clone(),t.setEntity(r),r.add(t)}),this.updateVisbility()},PANOLENS.TileGroup.prototype=Object.create(THREE.Object3D.prototype),PANOLENS.TileGroup.prototype.constructor=PANOLENS.TileGroup,PANOLENS.TileGroup.prototype.updateTexture=function(t){var e=this;t=t||[],this.children.map(function(n,i){n instanceof PANOLENS.Tile&&t[i]&&(PANOLENS.Utils.TextureLoader.load(t[i],e.setTexture.bind(n)),n.outline&&(n.outline.material.visible=!0))})},PANOLENS.TileGroup.prototype.updateAllTexture=function(t){if(this.updateTexture(t),t.length=0;t--)this.tileArray.indexOf(this.children[t])!==-1&&(this.offset-t<=this.visibleDelta?(this.children[t].visible=!0,new TWEEN.Tween(this.children[t].material).to({opacity:1/(this.offset-t)*.5},this.animationDuration).easing(this.animationEasing).start()):this.children[t].visible=!1,this.children[t].outline&&(this.children[t].outline.visible=!1));for(var t=this.offset+1;t=0;i--)new TWEEN.Tween(n[i].position).to({y:(i-e)*-this.v_gap,z:Math.abs(i-e)*-this.d_gap},t).easing(this.animationEasing).start();this.offset++,this.updateVisbility(),this.dispatchEvent({type:"scroll",direction:"up"})}},PANOLENS.TileGroup.prototype.scrollDown=function(t){var e,n=this.tileArray;if(t=void 0!==t?t:this.animationDuration,e=this.offset-1,this.offset>0&&n[this.offset-1].material.visible){for(var i=0;i=0;a--)n[a].target.addText(n[a].text);for(;n.length>0;)n.pop();i&&i()},PANOLENS.SpriteText.prototype.addText=function(i){if(!t||!e)return void n.push({target:this,text:i});var o=new THREE.Object3D;this.options.text=i,this.options.font=t,this.options.width=this.maxWidth;var r=this.generateTextGeometry(this.options);r.computeBoundingBox(),r.computeBoundingSphere();var a=new THREE.RawShaderMaterial(this.generateSDFShader({ map:e,side:THREE.DoubleSide,transparent:!0,color:this.color,opacity:this.opacity})),s=r.layout,h=new THREE.Mesh(r,a);h.entity=this,h.position.x=-s.width/2,h.position.y=1.035*s.height,o.scale.x=o.scale.y=-.05,o.add(h),this.mesh=h,this.add(o)},PANOLENS.SpriteText.prototype.update=function(t){var e;t=t||{},e=this.mesh,e.geometry.update(t),e.position.x=-e.geometry.layout.width/2,e.position.y=1.035*e.geometry.layout.height},PANOLENS.SpriteText.prototype.tween=function(t,e,n,i,o,r,a,s,h){return e=e||this,n=n||{},i=i||this.animationDuration,o=o||TWEEN.Easing.Exponential.Out,r=void 0!==r?r:0,a=a||null,s=s||null,h=h||null,this.tweens[t]||(this.tweens[t]=new TWEEN.Tween(e).to(n,i).easing(o).delay(r).onStart(a).onUpdate(s).onComplete(h)),this.tweens[t]},PANOLENS.SpriteText.prototype.getLayout=function(){return this.mesh&&this.mesh.geometry&&this.mesh.geometry.layout||{}},PANOLENS.SpriteText.prototype.setEntity=function(t){this.entity=t}}(),function(){PANOLENS.Widget=function(t){THREE.EventDispatcher.call(this),this.DEFAULT_TRANSITION="all 0.27s ease",this.TOUCH_ENABLED=PANOLENS.Utils.checkTouchSupported(),this.PREVENT_EVENT_HANDLER=function(t){t.preventDefault(),t.stopPropagation()},this.container=t,this.barElement,this.fullscreenElement,this.videoElement,this.settingElement,this.mainMenu,this.activeMainItem,this.activeSubMenu,this.mask},PANOLENS.Widget.prototype=Object.create(THREE.EventDispatcher.prototype),PANOLENS.Widget.prototype.constructor=PANOLENS.Widget,PANOLENS.Widget.prototype.addControlBar=function(){if(!this.container)return void console.warn("Widget container not set");var t,e,n,i,o=this;i="linear-gradient(bottom, rgba(0,0,0,0.2), rgba(0,0,0,0))",t=document.createElement("div"),t.style.width="100%",t.style.height="44px",t.style.float="left",t.style.transform=t.style.webkitTransform=t.style.msTransform="translateY(-100%)",t.style.background="-webkit-"+i,t.style.background="-moz-"+i,t.style.background="-o-"+i,t.style.background="-ms-"+i,t.style.background=i,t.style.transition=this.DEFAULT_TRANSITION,t.style.pointerEvents="none",t.isHidden=!1,t.toggle=function(){t.isHidden=!t.isHidden,e=t.isHidden?"translateY(0)":"translateY(-100%)",n=t.isHidden?0:1,t.style.transform=t.style.webkitTransform=t.style.msTransform=e,t.style.opacity=n};var r=this.createDefaultMenu();this.mainMenu=this.createMainMenu(r),t.appendChild(this.mainMenu);var a=this.createMask();this.mask=a,this.container.appendChild(a),t.dispose=function(){o.fullscreenElement&&(t.removeChild(o.fullscreenElement),o.fullscreenElement.dispose(),o.fullscreenElement=null),o.settingElement&&(t.removeChild(o.settingElement),o.settingElement.dispose(),o.settingElement=null),o.videoElement&&(t.removeChild(o.videoElement),o.videoElement.dispose(),o.videoElement=null)},this.container.appendChild(t),this.mask.addEventListener("mousemove",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener("mouseup",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener("mousedown",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener(o.TOUCH_ENABLED?"touchend":"click",function(t){t.preventDefault(),t.stopPropagation(),o.mask.hide(),o.settingElement.deactivate()},!1),this.addEventListener("control-bar-toggle",t.toggle),this.barElement=t},PANOLENS.Widget.prototype.createDefaultMenu=function(){var t,e=this;return t=function(t,n){return function(){e.dispatchEvent({type:"panolens-viewer-handler",method:t,data:n})}},[{title:"Control",subMenu:[{title:this.TOUCH_ENABLED?"Touch":"Mouse",handler:t("enableControl",PANOLENS.Controls.ORBIT)},{title:"Sensor",handler:t("enableControl",PANOLENS.Controls.DEVICEORIENTATION)}]},{title:"Mode",subMenu:[{title:"Normal",handler:t("disableEffect")},{title:"Cardboard",handler:t("enableEffect",PANOLENS.Modes.CARDBOARD)},{title:"Stereoscopic",handler:t("enableEffect",PANOLENS.Modes.STEREO)}]}]},PANOLENS.Widget.prototype.addControlButton=function(t){var e;switch(t){case"fullscreen":e=this.createFullscreenButton(),this.fullscreenElement=e;break;case"setting":e=this.createSettingButton(),this.settingElement=e;break;case"video":e=this.createVideoControl(),this.videoElement=e;break;default:return}e&&this.barElement.appendChild(e)},PANOLENS.Widget.prototype.createMask=function(){var t=document.createElement("div");return t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.width="100%",t.style.height="100%",t.style.background="transparent",t.style.display="none",t.show=function(){this.style.display="block"},t.hide=function(){this.style.display="none"},t},PANOLENS.Widget.prototype.createSettingButton=function(){function t(t){t.preventDefault(),t.stopPropagation(),n.mainMenu.toggle(),this.activated?this.deactivate():this.activate()}var e,n=this;return e=this.createCustomItem({style:{backgroundImage:'url("'+PANOLENS.DataImage.Setting+'")',webkitTransition:this.DEFAULT_TRANSITION,transition:this.DEFAULT_TRANSITION},onTap:t}),e.activate=function(){this.style.transform="rotate3d(0,0,1,90deg)",this.activated=!0,n.mask.show()},e.deactivate=function(){this.style.transform="rotate3d(0,0,0,0)",this.activated=!1,n.mask.hide(),n.mainMenu&&n.mainMenu.visible&&n.mainMenu.hide(),n.activeSubMenu&&n.activeSubMenu.visible&&n.activeSubMenu.hide(),n.mainMenu&&n.mainMenu._width&&(n.mainMenu.changeSize(n.mainMenu._width),n.mainMenu.unslideAll())},e.activated=!1,e},PANOLENS.Widget.prototype.createFullscreenButton=function(){function t(t){t.preventDefault(),t.stopPropagation(),a=!1,r?(document.exitFullscreen&&document.exitFullscreen(),document.msExitFullscreen&&document.msExitFullscreen(),document.mozCancelFullScreen&&document.mozCancelFullScreen(),document.webkitExitFullscreen&&document.webkitExitFullscreen(),r=!1):(o.container.requestFullscreen&&o.container.requestFullscreen(),o.container.msRequestFullscreen&&o.container.msRequestFullscreen(),o.container.mozRequestFullScreen&&o.container.mozRequestFullScreen(),o.container.webkitRequestFullscreen&&o.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT),r=!0),this.style.backgroundImage=r?'url("'+PANOLENS.DataImage.FullscreenLeave+'")':'url("'+PANOLENS.DataImage.FullscreenEnter+'")'}function e(t){a&&(r=!r,n.style.backgroundImage=r?'url("'+PANOLENS.DataImage.FullscreenLeave+'")':'url("'+PANOLENS.DataImage.FullscreenEnter+'")'),o.dispatchEvent({type:"panolens-viewer-handler",method:"onWindowResize",data:!1}),a=!0}var n,i,o=this,r=!1,a=!0;if(i="panolens-style-addon",document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled){if(document.addEventListener("fullscreenchange",e,!1),document.addEventListener("webkitfullscreenchange",e,!1),document.addEventListener("mozfullscreenchange",e,!1),document.addEventListener("MSFullscreenChange",e,!1),n=this.createCustomItem({style:{backgroundImage:'url("'+PANOLENS.DataImage.FullscreenEnter+'")'},onTap:t}),!document.querySelector(i)){var s=document.createElement("style");s.id=i,s.innerHTML=":-webkit-full-screen { width: 100% !important; height: 100% !important }",document.body.appendChild(s)}return n}},PANOLENS.Widget.prototype.createVideoControl=function(){var t;return t=document.createElement("span"),t.style.display="none",t.show=function(){t.style.display=""},t.hide=function(){t.style.display="none",t.controlButton.paused=!0,t.controlButton.update()},t.controlButton=this.createVideoControlButton(),t.seekBar=this.createVideoControlSeekbar(),t.appendChild(t.controlButton),t.appendChild(t.seekBar),t.dispose=function(){t.removeChild(t.controlButton),t.removeChild(t.seekBar),t.controlButton.dispose(),t.controlButton=null,t.seekBar.dispose(),t.seekBar=null},this.addEventListener("video-control-show",t.show),this.addEventListener("video-control-hide",t.hide),t},PANOLENS.Widget.prototype.createVideoControlButton=function(){function t(t){t.preventDefault(),t.stopPropagation(),n.dispatchEvent({type:"panolens-viewer-handler",method:"toggleVideoPlay",data:!this.paused}),this.paused=!this.paused,e.update()}var e,n=this;return e=this.createCustomItem({style:{float:"left",backgroundImage:'url("'+PANOLENS.DataImage.VideoPlay+'")'},onTap:t}),e.paused=!0,e.update=function(t){this.paused=void 0!==t?t:this.paused,this.style.backgroundImage='url("'+(this.paused?PANOLENS.DataImage.VideoPlay:PANOLENS.DataImage.VideoPause)+'")'},e},PANOLENS.Widget.prototype.createVideoControlSeekbar=function(){function t(t){t.stopPropagation(),f=!0,l=t.clientX||t.changedTouches&&t.changedTouches[0].clientX,u=parseInt(h.style.width)/100,i()}function e(t){var e;f&&(e=t.clientX||t.changedTouches&&t.changedTouches[0].clientX,d=(e-l)/s.clientWidth,d=u+d,d=d>1?1:d<0?0:d,s.setProgress(d),p.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:d}))}function n(t){t.stopPropagation(),f=!1,o()}function i(){p.container.addEventListener("mousemove",e,!1),p.container.addEventListener("mouseup",n,!1),p.container.addEventListener("touchmove",e,!1),p.container.addEventListener("touchend",n,!1)}function o(){p.container.removeEventListener("mousemove",e,!1),p.container.removeEventListener("mouseup",n,!1),p.container.removeEventListener("touchmove",e,!1),p.container.removeEventListener("touchend",n,!1)}function r(t){t.preventDefault(),t.stopPropagation();var e;t.target!==c&&(e=t.changedTouches&&t.changedTouches.length>0?(t.changedTouches[0].pageX-t.target.getBoundingClientRect().left)/this.clientWidth:t.offsetX/this.clientWidth,p.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:e}),s.setProgress(t.offsetX/this.clientWidth))}function a(){o(),h=null,c=null}var s,h,c,l,u,d,p=this,f=!1;return h=document.createElement("div"),h.style.width="0%",h.style.height="100%",h.style.backgroundColor="#fff",c=document.createElement("div"),c.style.float="right",c.style.width="14px",c.style.height="14px",c.style.transform="translate(7px, -5px)",c.style.borderRadius="50%",c.style.backgroundColor="#ddd",c.addEventListener("mousedown",t,!1),c.addEventListener("touchstart",t,!1),h.appendChild(c),s=this.createCustomItem({style:{float:"left",width:"30%",height:"4px",marginTop:"20px",backgroundColor:"rgba(188,188,188,0.8)"},onTap:r,onDispose:a}),s.appendChild(h),s.setProgress=function(t){h.style.width=100*t+"%"},this.addEventListener("video-update",function(t){s.setProgress(t.percentage)}),s},PANOLENS.Widget.prototype.createMenuItem=function(t){var e=this,n=document.createElement("a");return n.textContent=t,n.style.display="block",n.style.padding="10px",n.style.textDecoration="none",n.style.cursor="pointer",n.style.pointerEvents="auto",n.style.transition=this.DEFAULT_TRANSITION,n.slide=function(t){this.style.transform="translateX("+(t?"":"-")+"100%)"},n.unslide=function(){this.style.transform="translateX(0)"},n.setIcon=function(t){this.icon&&(this.icon.style.backgroundImage="url("+t+")")},n.setSelectionTitle=function(t){this.selection&&(this.selection.textContent=t)},n.addSelection=function(t){var e=document.createElement("span");return e.style.fontSize="13px",e.style.fontWeight="300",e.style.float="right",this.selection=e,this.setSelectionTitle(t),this.appendChild(e),this},n.addIcon=function(t,e,n){t=t||PANOLENS.DataImage.ChevronRight,e=e||!1,n=n||!1;var i=document.createElement("span");return i.style.float=e?"left":"right",i.style.width="17px",i.style.height="17px",i.style["margin"+(e?"Right":"Left")]="12px",i.style.backgroundSize="cover",n&&(i.style.transform="rotateZ(180deg)"),this.icon=i,this.setIcon(t),this.appendChild(i),this},n.addSubMenu=function(t,n){return this.subMenu=e.createSubMenu(t,n),this},n.addEventListener("mouseenter",function(){this.style.backgroundColor="#e0e0e0"},!1),n.addEventListener("mouseleave",function(){this.style.backgroundColor="#fafafa"},!1),n},PANOLENS.Widget.prototype.createMenuItemHeader=function(t){var e=this.createMenuItem(t);return e.style.borderBottom="1px solid #333",e.style.paddingBottom="15px",e},PANOLENS.Widget.prototype.createMainMenu=function(t){function e(t){function e(){i.changeSize(o.clientWidth),o.show(),o.unslideAll()}t.preventDefault(),t.stopPropagation();var i=n.mainMenu,o=this.subMenu;i.hide(),i.slideAll(),i.parentElement.appendChild(o),n.activeMainItem=this,n.activeSubMenu=o,window.requestAnimationFrame(e)}var n=this,i=this.createMenu();i._width=200,i.changeSize(i._width);for(var o=0;o0){var a=t[o].subMenu[0].title;r.addSelection(a).addSubMenu(t[o].title,t[o].subMenu)}}return i},PANOLENS.Widget.prototype.createSubMenu=function(t,e){function n(t){t.preventDefault(),t.stopPropagation(),i=o.mainMenu,i.changeSize(i._width),i.unslideAll(),i.show(),r.slideAll(!0),r.hide(),"header"!==this.type&&(r.setActiveItem(this),o.activeMainItem.setSelectionTitle(this.textContent),this.handler&&this.handler())}var i,o=this,r=this.createMenu();r.items=e,r.activeItem,r.addHeader(t).addIcon(void 0,!0,!0).addEventListener(o.TOUCH_ENABLED?"touchend":"click",n,!1);for(var a=0;a=0&&t.mouseEvent.clientY>=0&&(this.mode===PANOLENS.Modes.CARDBOARD||this.mode===PANOLENS.Modes.STEREO?(this.element.style.display="none",this.element.left&&(this.element.left.style.display="block"),this.element.right&&(this.element.right.style.display="block"),this.element._width=this.element.left.clientWidth,this.element._height=this.element.left.clientHeight):(this.element.style.display="block",this.element.left&&(this.element.left.style.display="none"),this.element.right&&(this.element.right.style.display="none"),this.element._width=this.element.clientWidth,this.element._height=this.element.clientHeight))}},PANOLENS.Infospot.prototype.onHoverEnd=function(){this.getContainer()&&(this.isHovering=!1,this.container.style.cursor="default",this.animated&&(this.scaleUpAnimation&&this.scaleUpAnimation.stop(),this.scaleDownAnimation&&this.scaleDownAnimation.start()),this.element&&!this.element.locked&&(this.element.style.display="none",this.element.left&&(this.element.left.style.display="none"),this.element.right&&(this.element.right.style.display="none"),this.unlockHoverElement()))},PANOLENS.Infospot.prototype.onDualEyeEffect=function(t){if(this.getContainer()){var e,n,i;this.mode=t.mode,e=this.element,n=this.container.clientWidth/2,i=this.container.clientHeight/2,e&&(e.left&&e.right||(e.left=e.cloneNode(!0),e.right=e.cloneNode(!0)),this.mode===PANOLENS.Modes.CARDBOARD||this.mode===PANOLENS.Modes.STEREO?(e.left.style.display=e.style.display,e.right.style.display=e.style.display,e.style.display="none"):(e.style.display=e.left.style.display,e.left.style.display="none",e.right.style.display="none"),this.translateElement(n,i),this.container.appendChild(e.left),this.container.appendChild(e.right))}},PANOLENS.Infospot.prototype.translateElement=function(t,e){if(this.element._width&&this.element._height&&this.getContainer()){var n,i,o,r,a,s,h;h=this.container,o=this.element,r=o._width/2,a=o._height/2,s=void 0!==o.verticalDelta?o.verticalDelta:40,n=t-r,i=e-a-s,this.mode!==PANOLENS.Modes.CARDBOARD&&this.mode!==PANOLENS.Modes.STEREO||!o.left||!o.right||t===h.clientWidth/2&&e===h.clientHeight/2?this.setElementStyle("transform",o,"translate("+n+"px, "+i+"px)"):(n=h.clientWidth/4-r+(t-h.clientWidth/2),i=h.clientHeight/2-a-s+(e-h.clientHeight/2),this.setElementStyle("transform",o.left,"translate("+n+"px, "+i+"px)"),n+=h.clientWidth/2,this.setElementStyle("transform",o.right,"translate("+n+"px, "+i+"px)"))}},PANOLENS.Infospot.prototype.setElementStyle=function(t,e,n){var i=e.style;"transform"===t&&(i.webkitTransform=i.msTransform=i.transform=n)},PANOLENS.Infospot.prototype.setText=function(t){this.element&&(this.element.textContent=t)},PANOLENS.Infospot.prototype.setCursorHoverStyle=function(t){this.cursorStyle=t},PANOLENS.Infospot.prototype.addHoverText=function(t,e){this.element||(this.element=document.createElement("div"),this.element.style.display="none",this.element.style.color="#fff",this.element.style.top=0,this.element.style.maxWidth="50%",this.element.style.maxHeight="50%",this.element.style.textShadow="0 0 3px #000000",this.element.style.fontFamily='"Trebuchet MS", Helvetica, sans-serif',this.element.style.position="absolute",this.element.classList.add("panolens-infospot"),this.element.verticalDelta=void 0!==e?e:40),this.setText(t)},PANOLENS.Infospot.prototype.addHoverElement=function(t,e){this.element||(this.element=t.cloneNode(!0),this.element.style.display="none",this.element.style.top=0,this.element.style.position="absolute",this.element.classList.add("panolens-infospot"),this.element.verticalDelta=void 0!==e?e:40)},PANOLENS.Infospot.prototype.removeHoverElement=function(){this.element&&(this.element.left&&(this.container.removeChild(this.element.left),this.element.left=null),this.element.right&&(this.container.removeChild(this.element.right),this.element.right=null),this.container.removeChild(this.element),this.element=null)},PANOLENS.Infospot.prototype.lockHoverElement=function(){this.element&&(this.element.locked=!0)},PANOLENS.Infospot.prototype.unlockHoverElement=function(){this.element&&(this.element.locked=!1)},PANOLENS.Infospot.prototype.show=function(t){t=t||0,this.animated&&(this.hideAnimation&&this.hideAnimation.stop(),this.showAnimation&&this.showAnimation.delay(t).start())},PANOLENS.Infospot.prototype.hide=function(t){t=t||0,this.animated&&(this.showAnimation&&this.showAnimation.stop(),this.hideAnimation&&this.hideAnimation.delay(t).start())},PANOLENS.Infospot.prototype.setFocusMethod=function(t){t&&(this.HANDLER_FOCUS=t.method)},PANOLENS.Infospot.prototype.focus=function(t,e){this.HANDLER_FOCUS&&(this.HANDLER_FOCUS(this.position,t,e),this.onDismiss())},PANOLENS.Infospot.prototype.dispose=function(){this.removeHoverElement(),this.material.dispose(),this.parent&&this.parent.remove(this)}}(),function(){"use strict";PANOLENS.Viewer=function(t){if(THREE.EventDispatcher.call(this),!THREE)return void console.error("Three.JS not found");var e;t=t||{},t.controlBar=void 0===t.controlBar||t.controlBar,t.controlButtons=t.controlButtons||["fullscreen","setting","video"],t.autoHideControlBar=void 0!==t.autoHideControlBar&&t.autoHideControlBar,t.autoHideInfospot=void 0===t.autoHideInfospot||t.autoHideInfospot,t.horizontalView=void 0!==t.horizontalView&&t.horizontalView,t.clickTolerance=t.clickTolerance||10,t.cameraFov=t.cameraFov||60,t.reverseDragging=t.reverseDragging||!1,t.enableReticle=t.enableReticle||!1,t.dwellTime=t.dwellTime||1500,t.autoReticleSelect=void 0===t.autoReticleSelect||t.autoReticleSelect,t.viewIndicator=void 0!==t.viewIndicator&&t.viewIndicator,t.indicatorSize=t.indicatorSize||30,t.output=t.output?t.output:"none",this.options=t,t.container?(e=t.container,e._width=e.clientWidth,e._height=e.clientHeight):(e=document.createElement("div"),e.classList.add("panolens-container"),e.style.width="100%",e.style.height="100%",e._width=window.innerWidth,e._height=window.innerHeight,document.body.appendChild(e)),this.container=e,this.camera=t.camera||new THREE.PerspectiveCamera(this.options.cameraFov,this.container.clientWidth/this.container.clientHeight,1,1e4),this.scene=t.scene||new THREE.Scene,this.renderer=t.renderer||new THREE.WebGLRenderer({alpha:!0,antialias:!1}),this.viewIndicatorSize=t.indicatorSize,this.reticle={},this.tempEnableReticle=this.options.enableReticle,this.mode=PANOLENS.Modes.NORMAL,this.OrbitControls,this.DeviceOrientationControls,this.CardboardEffect,this.StereoEffect,this.controls,this.effect,this.panorama,this.widget,this.hoverObject,this.infospot,this.pressEntityObject,this.pressObject,this.raycaster=new THREE.Raycaster,this.raycasterPoint=new THREE.Vector2,this.userMouse=new THREE.Vector2,this.updateCallbacks=[],this.requestAnimationId,this.cameraFrustum=new THREE.Frustum,this.cameraViewProjectionMatrix=new THREE.Matrix4,this.outputDivElement,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 TWEEN.Tween,this.tweenUpAnimation=new TWEEN.Tween,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.container.clientWidth,this.container.clientHeight),this.renderer.setClearColor(0,1),this.renderer.sortObjects=!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 THREE.OrbitControls(this.camera,this.container),this.OrbitControls.name="orbit",this.OrbitControls.minDistance=1,this.OrbitControls.noPan=!0,this.DeviceOrientationControls=new THREE.DeviceOrientationControls(this.camera,this.container),this.DeviceOrientationControls.name="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 THREE.CardboardEffect(this.renderer),this.CardboardEffect.setSize(this.container.clientWidth,this.container.clientHeight),this.StereoEffect=new THREE.StereoEffect(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),this.options.controlBar!==!1&&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)},PANOLENS.Viewer.prototype=Object.create(THREE.EventDispatcher.prototype),PANOLENS.Viewer.prototype.constructor=PANOLENS.Viewer,PANOLENS.Viewer.prototype.add=function(t){if(arguments.length>1){for(var e=0;e=0&&this.updateCallbacks.splice(e,1)},PANOLENS.Viewer.prototype.showVideoWidget=function(){this.widget&&this.widget.dispatchEvent({type:"video-control-show"})},PANOLENS.Viewer.prototype.hideVideoWidget=function(){this.widget&&this.widget.dispatchEvent({type:"video-control-hide"})},PANOLENS.Viewer.prototype.updateVideoPlayButton=function(t){this.widget&&this.widget.videoElement&&this.widget.videoElement.controlButton&&this.widget.videoElement.controlButton.update(t)},PANOLENS.Viewer.prototype.addPanoramaEventListener=function(t){t.addEventListener("enter-fade-start",this.setCameraControl.bind(this)),t instanceof PANOLENS.VideoPanorama&&(t.addEventListener("enter-fade-start",this.showVideoWidget.bind(this)),t.addEventListener("leave",function(){this.panorama instanceof PANOLENS.VideoPanorama||this.hideVideoWidget.call(this)}.bind(this)))},PANOLENS.Viewer.prototype.setCameraControl=function(){this.OrbitControls.target.copy(this.panorama.position)},PANOLENS.Viewer.prototype.getControl=function(){return this.control},PANOLENS.Viewer.prototype.getScene=function(){return this.scene},PANOLENS.Viewer.prototype.getCamera=function(){return this.camera},PANOLENS.Viewer.prototype.getRenderer=function(){return this.renderer},PANOLENS.Viewer.prototype.getContainer=function(){return this.container},PANOLENS.Viewer.prototype.getControlName=function(){return this.control.name},PANOLENS.Viewer.prototype.getNextControlName=function(){return this.controls[this.getNextControlIndex()].name},PANOLENS.Viewer.prototype.getNextControlIndex=function(){var t,e,n;return t=this.controls,e=this.control,n=t.indexOf(e)+1,n>=t.length?0:n},PANOLENS.Viewer.prototype.setCameraFov=function(t){this.camera.fov=t,this.camera.updateProjectionMatrix()},PANOLENS.Viewer.prototype.enableControl=function(t){switch(t=t>=0&&tMath.PI?o-2*Math.PI:o,o=o<-Math.PI?o+2*Math.PI:o,r=Math.abs(s.angleTo(a)+(s.y*c.y<=0?c.angleTo(h):-c.angleTo(h))),r*=c.y0)switch(e=t[0].point,n=this.panorama.getWorldPosition(),i=new THREE.Vector3(-(e.x-n.x).toFixed(2),(e.y-n.y).toFixed(2),(e.z-n.z).toFixed(2)),this.options.output){case"console":console.info(i.x+", "+i.y+", "+i.z);break;case"overlay":this.outputDivElement.textContent=i.x+", "+i.y+", "+i.z}},PANOLENS.Viewer.prototype.onMouseDown=function(t){t.preventDefault(),this.userMouse.x=t.clientX>=0?t.clientX:t.touches[0].clientX,this.userMouse.y=t.clientY>=0?t.clientY:t.touches[0].clientY,this.userMouse.type="mousedown",this.onTap(t)},PANOLENS.Viewer.prototype.onMouseMove=function(t){t.preventDefault(),this.userMouse.type="mousemove",this.onTap(t)},PANOLENS.Viewer.prototype.onMouseUp=function(t){var e,n=!1;this.userMouse.type="mouseup",e=this.userMouse.x>=t.clientX-this.options.clickTolerance&&this.userMouse.x<=t.clientX+this.options.clickTolerance&&this.userMouse.y>=t.clientY-this.options.clickTolerance&&this.userMouse.y<=t.clientY+this.options.clickTolerance||t.changedTouches&&this.userMouse.x>=t.changedTouches[0].clientX-this.options.clickTolerance&&this.userMouse.x<=t.changedTouches[0].clientX+this.options.clickTolerance&&this.userMouse.y>=t.changedTouches[0].clientY-this.options.clickTolerance&&this.userMouse.y<=t.changedTouches[0].clientY+this.options.clickTolerance?"click":void 0,t&&t.target&&!t.target.classList.contains("panolens-canvas")||(t.preventDefault(),n=t.changedTouches&&1===t.changedTouches.length?this.onTap({clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY},e):this.onTap(t,e),this.userMouse.type="none",n||"click"===e&&(this.options.autoHideInfospot&&this.panorama&&this.panorama.toggleInfospotVisibility(),this.options.autoHideControlBar&&this.toggleControlBar()))},PANOLENS.Viewer.prototype.onTap=function(t,e){var n,i,o;if(this.raycasterPoint.x=(t.clientX-this.container.offsetLeft)/this.container.clientWidth*2-1,this.raycasterPoint.y=2*-((t.clientY-this.container.offsetTop)/this.container.clientHeight)+1,this.raycaster.setFromCamera(this.raycasterPoint,this.camera),this.panorama)if(("mousedown"!==t.type&&PANOLENS.Utils.checkTouchSupported()||this.OUTPUT_INFOSPOT)&&this.outputInfospotPosition(),n=this.raycaster.intersectObjects(this.panorama.children,!0),i=this.getConvertedIntersect(n),o=n.length>0?n[0].object:o,"mouseup"===this.userMouse.type&&(i&&this.pressEntityObject===i&&this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressstop-entity",mouseEvent:t}),this.pressEntityObject=void 0),"mouseup"===this.userMouse.type&&(o&&this.pressObject===o&&this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressstop",mouseEvent:t}),this.pressObject=void 0),"click"===e?(this.panorama.dispatchEvent({type:"click",intersects:n,mouseEvent:t}),i&&i.dispatchEvent&&i.dispatchEvent({type:"click-entity",mouseEvent:t}),o&&o.dispatchEvent&&o.dispatchEvent({type:"click",mouseEvent:t})):(this.panorama.dispatchEvent({type:"hover",intersects:n,mouseEvent:t}),(this.hoverObject&&n.length>0&&this.hoverObject!==i||this.hoverObject&&0===n.length)&&(this.hoverObject.dispatchEvent&&(this.hoverObject.dispatchEvent({type:"hoverleave",mouseEvent:t}),this.reticle.cancelDwelling()),this.hoverObject=void 0),i&&n.length>0&&(this.hoverObject!==i&&(this.hoverObject=i,this.hoverObject.dispatchEvent&&(this.hoverObject.dispatchEvent({type:"hoverenter",mouseEvent:t}),(this.options.autoReticleSelect&&this.options.enableReticle||this.tempEnableReticle)&&this.reticle.startDwelling(this.onTap.bind(this,t,"click")))),"mousedown"===this.userMouse.type&&this.pressEntityObject!=i&&(this.pressEntityObject=i,this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressstart-entity",mouseEvent:t})),"mousedown"===this.userMouse.type&&this.pressObject!=o&&(this.pressObject=o,this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressstart",mouseEvent:t})),("mousemove"===this.userMouse.type||this.options.enableReticle)&&(o&&o.dispatchEvent&&o.dispatchEvent({type:"hover",mouseEvent:t}),this.pressEntityObject&&this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressmove-entity",mouseEvent:t}),this.pressObject&&this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressmove",mouseEvent:t}))),!i&&this.pressEntityObject&&this.pressEntityObject.dispatchEvent&&(this.pressEntityObject.dispatchEvent({type:"pressstop-entity",mouseEvent:t}),this.pressEntityObject=void 0),!o&&this.pressObject&&this.pressObject.dispatchEvent&&(this.pressObject.dispatchEvent({type:"pressstop",mouseEvent:t}),this.pressObject=void 0)),o&&o instanceof PANOLENS.Infospot){if(this.infospot=o,"click"===e)return!0}else this.infospot&&this.hideInfospot()},PANOLENS.Viewer.prototype.getConvertedIntersect=function(t){for(var e,n=0;n=0&&t[n].object&&!t[n].object.passThrough){if(t[n].object.entity&&t[n].object.entity.passThrough)continue;if(t[n].object.entity&&!t[n].object.entity.passThrough){e=t[n].object.entity;break}e=t[n].object;break}return e},PANOLENS.Viewer.prototype.hideInfospot=function(t){this.infospot&&(this.infospot.onHoverEnd(),this.infospot=void 0)},PANOLENS.Viewer.prototype.toggleControlBar=function(){this.widget&&this.widget.dispatchEvent({type:"control-bar-toggle"})},PANOLENS.Viewer.prototype.onKeyDown=function(t){this.options.output&&"none"!==this.options.output&&"Control"===t.key&&(this.OUTPUT_INFOSPOT=!0)},PANOLENS.Viewer.prototype.onKeyUp=function(t){this.OUTPUT_INFOSPOT=!1},PANOLENS.Viewer.prototype.update=function(){TWEEN.update(),this.updateCallbacks.forEach(function(t){t()}),this.control.update(),this.scene.traverse(function(t){if(t instanceof PANOLENS.Infospot&&t.element&&(this.hoverObject===t||"none"!==t.element.style.display||t.element.left&&"none"!==t.element.left.style.display||t.element.right&&"none"!==t.element.right.style.display))if(this.checkSpriteInViewport(t)){var e=this.getScreenVector(t.getWorldPosition());t.translateElement(e.x,e.y)}else t.onDismiss()}.bind(this))},PANOLENS.Viewer.prototype.render=function(){this.mode===PANOLENS.Modes.CARDBOARD||this.mode===PANOLENS.Modes.STEREO?this.effect.render(this.scene,this.camera):this.renderer.render(this.scene,this.camera)},PANOLENS.Viewer.prototype.animate=function(){this.requestAnimationId=window.requestAnimationFrame(this.animate.bind(this)),this.onChange()},PANOLENS.Viewer.prototype.onChange=function(){this.update(),this.render()},PANOLENS.Viewer.prototype.registerMouseAndTouchEvents=function(){this.container.addEventListener("mousedown",this.HANDLER_MOUSE_DOWN,!1),this.container.addEventListener("mousemove",this.HANDLER_MOUSE_MOVE,!1),this.container.addEventListener("mouseup",this.HANDLER_MOUSE_UP,!1),this.container.addEventListener("touchstart",this.HANDLER_MOUSE_DOWN,!1),this.container.addEventListener("touchend",this.HANDLER_MOUSE_UP,!1)},PANOLENS.Viewer.prototype.unregisterMouseAndTouchEvents=function(){this.container.removeEventListener("mousedown",this.HANDLER_MOUSE_DOWN,!1),this.container.removeEventListener("mousemove",this.HANDLER_MOUSE_MOVE,!1),this.container.removeEventListener("mouseup",this.HANDLER_MOUSE_UP,!1),this.container.removeEventListener("touchstart",this.HANDLER_MOUSE_DOWN,!1),this.container.removeEventListener("touchend",this.HANDLER_MOUSE_UP,!1)},PANOLENS.Viewer.prototype.registerReticleEvent=function(){this.addUpdateCallback(this.HANDLER_TAP)},PANOLENS.Viewer.prototype.unregisterReticleEvent=function(){this.removeUpdateCallback(this.HANDLER_TAP)},PANOLENS.Viewer.prototype.updateReticleEvent=function(){var t,e;t=this.container.clientWidth/2+this.container.offsetLeft,e=this.container.clientHeight/2,this.removeUpdateCallback(this.HANDLER_TAP),this.HANDLER_TAP=this.onTap.bind(this,{clientX:t,clientY:e}),this.addUpdateCallback(this.HANDLER_TAP)},PANOLENS.Viewer.prototype.registerEventListeners=function(){window.addEventListener("resize",this.HANDLER_WINDOW_RESIZE,!0),window.addEventListener("keydown",this.HANDLER_KEY_DOWN,!0),window.addEventListener("keyup",this.HANDLER_KEY_UP,!0)},PANOLENS.Viewer.prototype.unregisterEventListeners=function(){window.removeEventListener("resize",this.HANDLER_WINDOW_RESIZE,!0),window.removeEventListener("keydown",this.HANDLER_KEY_DOWN,!0),window.removeEventListener("keyup",this.HANDLER_KEY_UP,!0)},PANOLENS.Viewer.prototype.dispose=function(){function t(e){for(var n=e.children.length-1;n>=0;n--)t(e.children[n]),e.remove(e.children[n]);e instanceof PANOLENS.Infospot&&e.dispose(),e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}this.unregisterEventListeners(),t(this.scene),this.widget&&(this.widget.dispose(),this.widget=null),THREE.Cache&&THREE.Cache.enabled&&THREE.Cache.clear()},PANOLENS.Viewer.prototype.destory=function(){this.dispose(),this.render(),window.cancelAnimationFrame(this.requestAnimationId)},PANOLENS.Viewer.prototype.onPanoramaDispose=function(t){t instanceof PANOLENS.VideoPanorama&&this.hideVideoWidget(),t===this.panorama&&(this.panorama=null)},PANOLENS.Viewer.prototype.loadAsyncRequest=function(t,e){var n=new XMLHttpRequest;n.onloadend=function(t){e&&e(t)},n.open("GET",t,!0),n.send(null)},PANOLENS.Viewer.prototype.addViewIndicator=function(){function t(t){if(0!==t.loaded){var n=t.target.responseXML.documentElement;n.style.width=e.viewIndicatorSize+"px",n.style.height=e.viewIndicatorSize+"px",n.style.position="absolute",n.style.top="10px",n.style.left="10px",n.style.opacity="0.5",n.style.cursor="pointer",n.id="panolens-view-indicator-container",e.container.appendChild(n);var i=n.querySelector("#indicator"),o=function(){e.radius=.225*e.viewIndicatorSize,e.currentPanoAngle=e.camera.rotation.y-THREE.Math.degToRad(90),e.fovAngle=THREE.Math.degToRad(e.camera.fov),e.leftAngle=-e.currentPanoAngle-e.fovAngle/2,e.rightAngle=-e.currentPanoAngle+e.fovAngle/2,e.leftX=e.radius*Math.cos(e.leftAngle),e.leftY=e.radius*Math.sin(e.leftAngle),e.rightX=e.radius*Math.cos(e.rightAngle),e.rightY=e.radius*Math.sin(e.rightAngle),e.indicatorD="M "+e.leftX+" "+e.leftY+" A "+e.radius+" "+e.radius+" 0 0 1 "+e.rightX+" "+e.rightY,e.leftX&&e.leftY&&e.rightX&&e.rightY&&e.radius&&i.setAttribute("d",e.indicatorD)};e.addUpdateCallback(o);var r=function(){this.style.opacity="1"},a=function(){this.style.opacity="0.5"};n.addEventListener("mouseenter",r),n.addEventListener("mouseleave",a)}}var e=this;this.loadAsyncRequest(PANOLENS.DataImage.ViewIndicator,t)},PANOLENS.Viewer.prototype.appendControlItem=function(t){var e=this.widget.createCustomItem(t);return"video"===t.group?this.widget.videoElement.appendChild(e):this.widget.barElement.appendChild(e),e}}(),function t(e,n,i){function o(a,s){if(!n[a]){if(!e[a]){var h="function"==typeof require&&require;if(!s&&h)return h(a,!0);if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n||t)},l,l.exports,t,e,n,i)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a0});this.visibleGlyphs=l;var u=c.positions(l),d=c.uvs(l,i,r,e),p=a({clockwise:!0,type:"uint16",count:l.length});if(s.index(this,p,1,"uint16"),s.attr(this,"position",u,2),s.attr(this,"uv",d,2),!t.multipage&&"page"in this.attributes)this.removeAttribute("page");else if(t.multipage){var f=c.pages(l);s.attr(this,"page",f,1)}},i.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var t=this.attributes.position.array,e=this.attributes.position.itemSize;if(!t||!e||t.length<2)return this.boundingSphere.radius=0,void this.boundingSphere.center.set(0,0,0);l.computeSphere(t,this.boundingSphere),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')},i.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var t=this.boundingBox,e=this.attributes.position.array,n=this.attributes.position.itemSize;if(!e||!n||e.length<2)return void t.makeEmpty();l.computeBox(e,t)}},{"./lib/utils":2,"./lib/vertices":3,inherits:4,"layout-bmfont-text":5,"object-assign":26,"quad-indices":27,"three-buffer-vertex-data":31}],2:[function(t,e,n){function i(t){var e=t.length/o;r.min[0]=t[0],r.min[1]=t[1],r.max[0]=t[0],r.max[1]=t[1];for(var n=0;n=0?t.chars[n]:null}function s(t){for(var e=0;e=0)return t.chars[i].height}return 0}function h(t){for(var e=0;e=0)return t.chars[i]}return 0}function c(t){for(var e=0;e=0)return t.chars[i].height}return 0}function l(t,e,n){if(!t.kernings||0===t.kernings.length)return 0;for(var i=t.kernings,o=0;o=i||f>=i)break;h=f,c=E,r=o}u++}return r&&(c+=r.xoffset),{start:e,end:e+u,width:c}},["width","height","descender","ascender","xHeight","baseline","capHeight","lineHeight"].forEach(o)},{"as-number":6,"indexof-property":7,"word-wrapper":8,xtend:9}],6:[function(t,e,n){e.exports=function(t,e){return"number"==typeof t?t:"number"==typeof e?e:0}},{}],7:[function(t,e,n){e.exports=function(t){if(!t||"string"!=typeof t)throw new Error("must specify property for indexof search");return new Function("array","value","start",["start = start || 0","for (var i=start; ii?i:o}function o(t){return l.test(t)}function r(t,e,n,i,o){for(var r=[],a=n,s=n;sn&&!o(e.charAt(p));)p--;if(p===n)f>n+c.length&&f--,p=f;else for(f=p;p>n&&o(e.charAt(p-c.length));)p--}if(p>=n){var E=t(e,n,p,l);h.push(E)}n=f}return h}function s(t,e,n,i){return{start:e,end:e+Math.min(i,n-e)}}var h=/\n/,c="\n",l=/\s/;e.exports=function(t,n){return e.exports.lines(t,n).map(function(e){return t.substring(e.start,e.end)}).join("\n")},e.exports.lines=function(t,e){if(e=e||{},0===e.width&&"nowrap"!==e.mode)return[];t=t||"";var n="number"==typeof e.width?e.width:Number.MAX_VALUE,i=Math.max(0,e.start||0),o="number"==typeof e.end?e.end:t.length,h=e.mode,c=e.measure||s;return"pre"===h?r(c,t,i,o,n):a(c,t,i,o,n,h)}},{}],9:[function(t,e,n){function i(){for(var t={},e=0;e4&&i(t.slice(0,4),o)}}).call(this,t("buffer").Buffer)},{buffer:37,"buffer-equal":12}],12:[function(t,e,n){var i=t("buffer").Buffer;e.exports=function(t,e){if(i.isBuffer(t)&&i.isBuffer(e)){if("function"==typeof t.equals)return t.equals(e);if(t.length!==e.length)return!1;for(var n=0;ne.length-1)return 0;var i=e.readUInt8(n++),c=e.readInt32LE(n);switch(n+=4,i){case 1:t.info=o(e,n);break;case 2:t.common=r(e,n);break;case 3:t.pages=a(e,n,c);break;case 4:t.chars=s(e,n,c);break;case 5:t.kernings=h(e,n,c)}return 5+c}function o(t,e){var n={};n.size=t.readInt16LE(e);var i=t.readUInt8(e+2);return n.smooth=i>>7&1,n.unicode=i>>6&1,n.italic=i>>5&1,n.bold=i>>4&1,i>>3&1&&(n.fixedHeight=1),n.charset=t.readUInt8(e+3)||"",n.stretchH=t.readUInt16LE(e+4),n.aa=t.readUInt8(e+6),n.padding=[t.readInt8(e+7),t.readInt8(e+8),t.readInt8(e+9),t.readInt8(e+10)],n.spacing=[t.readInt8(e+11),t.readInt8(e+12)],n.outline=t.readUInt8(e+13),n.face=l(t,e+14),n}function r(t,e){var n={};n.lineHeight=t.readUInt16LE(e),n.base=t.readUInt16LE(e+2),n.scaleW=t.readUInt16LE(e+4),n.scaleH=t.readUInt16LE(e+6),n.pages=t.readUInt16LE(e+8);t.readUInt8(e+10);return n.packed=0,n.alphaChnl=t.readUInt8(e+11),n.redChnl=t.readUInt8(e+12),n.greenChnl=t.readUInt8(e+13),n.blueChnl=t.readUInt8(e+14),n}function a(t,e,n){for(var i=[],o=c(t,e),r=o.length+1,a=n/r,s=0;s3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var n={kernings:[],chars:[]},o=0;o<5;o++)e+=i(n,t,e);return n}},{}],15:[function(t,e,n){function i(t){return o(t).reduce(function(t,e){return t[r(e.nodeName)]=e.nodeValue,t},{})}function o(t){for(var e=[],n=0;n element");for(var r=o.getElementsByTagName("page"),h=0;h0&&(f=setTimeout(function(){p=!0,l.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",o(t)},t.timeout)),l.setRequestHeader)for(d in g)g.hasOwnProperty(d)&&l.setRequestHeader(d,g[d]);else if(t.headers&&!i(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(l.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(l),l.send(v),l}function s(){}var h=t("global/window"),c=t("once"),l=t("is-function"),u=t("parse-headers"),d=t("xtend");e.exports=r,r.XMLHttpRequest=h.XMLHttpRequest||s,r.XDomainRequest="withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:h.XDomainRequest,function(t,e){for(var n=0;n1?arguments[1]:"utf8"):s(this,t)):arguments.length>1?new o(t,arguments[1]):new o(t)}function r(t,e){if(t=f(t,e<0?0:0|E(e)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n>>1&&(t.parent=Z),t}function E(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var n=new o(t,e);return delete n.parent,n}function v(t,e){"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(i)return F(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var i=!1;if(e|=0,n=void 0===n||n===1/0?this.length:0|n,t||(t="utf8"),e<0&&(e=0),n>this.length&&(n=this.length),n<=e)return"";for(;;)switch(t){case"hex":return x(this,e,n);case"utf8":case"utf-8":return P(this,e,n);case"ascii":return T(this,e,n);case"binary":return R(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,n,i){n=Number(n)||0;var o=t.length-n;i?(i=Number(i))>o&&(i=o):i=o;var r=e.length;if(r%2!=0)throw new Error("Invalid hex string");i>r/2&&(i=r/2);for(var a=0;a239?4:r>223?3:r>191?2:1;if(o+s<=n){var h,c,l,u;switch(s){case 1:r<128&&(a=r);break;case 2:h=t[o+1],128==(192&h)&&(u=(31&r)<<6|63&h)>127&&(a=u);break;case 3:h=t[o+1],c=t[o+2],128==(192&h)&&128==(192&c)&&(u=(15&r)<<12|(63&h)<<6|63&c)>2047&&(u<55296||u>57343)&&(a=u);break;case 4:h=t[o+1],c=t[o+2],l=t[o+3],128==(192&h)&&128==(192&c)&&128==(192&l)&&(u=(15&r)<<18|(63&h)<<12|(63&c)<<6|63&l)>65535&&u<1114112&&(a=u)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),o+=s}return S(i)}function S(t){var e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var o="",r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,i,r,a){if(!o.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>r||et.length)throw new RangeError("index out of range")}function H(t,e,n,i){e<0&&(e=65535+e+1);for(var o=0,r=Math.min(t.length-n,2);o>>8*(i?o:1-o)}function D(t,e,n,i){e<0&&(e=4294967295+e+1);for(var o=0,r=Math.min(t.length-n,4);o>>8*(i?o:3-o)&255}function V(t,e,n,i,o,r){if(e>o||et.length)throw new RangeError("index out of range");if(n<0)throw new RangeError("index out of range")}function _(t,e,n,i,o){return o||V(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),G.write(t,e,n,i,23,4),n+4}function U(t,e,n,i,o){return o||V(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),G.write(t,e,n,i,52,8),n+8}function k(t){if(t=j(t).replace(J,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function j(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){e=e||1/0;for(var n,i=t.length,o=null,r=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&r.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&r.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function W(t){for(var e=[],n=0;n>8,o=n%256,r.push(o),r.push(i);return r}function Y(t){return q.toByteArray(k(t))}function X(t,e,n,i){for(var o=0;o=e.length||o>=t.length);o++)e[o+n]=t[o];return o}var q=t("base64-js"),G=t("ieee754"),Q=t("isarray");n.Buffer=o,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,o.poolSize=8192;var Z={};o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT?(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array):(o.prototype.length=void 0,o.prototype.parent=void 0),o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,a=Math.min(n,i);r0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},o.prototype.compare=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:o.compare(this,t)},o.prototype.indexOf=function(t,e){function n(t,e,n){for(var i=-1,o=0;n+o2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(e<0&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(o.isBuffer(t))return n(this,t,e);if("number"==typeof t)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):n(this,[t],e);throw new TypeError("val must be string, number or Buffer")},o.prototype.write=function(t,e,n,i){if(void 0===e)i="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)i=e,n=this.length,e=0;else if(isFinite(e))e|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0);else{var o=i;i=e,e=0|n,n=o}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return N(this,t,e,n);case"ascii":return w(this,t,e,n);case"binary":return b(this,t,e,n);case"base64":return L(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)i+=this[t+--e]*o;return i},o.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var i=this[t],o=1,r=0;++r=o&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var i=e,o=1,r=this[t+--i];i>0&&(o*=256);)r+=this[t+--i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},o.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),G.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),G.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),G.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),G.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||C(this,t,e,n,Math.pow(2,8*n),0);var o=1,r=0;for(this[e]=255&t;++r=0&&(r*=256);)this[e+o]=t/r&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var o=Math.pow(2,8*n-1);C(this,t,e,n,o-1,-o)}var r=0,a=1,s=t<0?1:0;for(this[e]=255&t;++r>0)-s&255;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var o=Math.pow(2,8*n-1);C(this,t,e,n,o-1,-o)}var r=n-1,a=1,s=t<0?1:0;for(this[e+r]=255&t;--r>=0&&(a*=256);)this[e+r]=(t/a>>0)-s&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return _(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return _(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;r--)t[r+e]=this[r+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(r=0;r=this.length)throw new RangeError("start out of bounds");if(n<0||n>this.length)throw new RangeError("end out of bounds");var i;if("number"==typeof t)for(i=e;i0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;h="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new r(3*t.length/4-h),a=h>0?t.length-4:t.length;var u=0;for(i=0,o=0;i>16),n((65280&s)>>8),n(255&s);return 2===h?(s=e(t.charAt(i))<<2|e(t.charAt(i+1))>>4,n(255&s)):1===h&&(s=e(t.charAt(i))<<10|e(t.charAt(i+1))<<4|e(t.charAt(i+2))>>2,n(s>>8&255),n(255&s)),c}function i(t){function e(t){return o.charAt(t)}var n,i,r,a=t.length%3,s="";for(n=0,r=t.length-a;n>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}(i);switch(a){case 1:i=t[t.length-1],s+=e(i>>2),s+=e(i<<4&63),s+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],s+=e(i>>10),s+=e(i>>4&63),s+=e(i<<2&63),s+="="}return s}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),h="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0),u="-".charCodeAt(0),d="_".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}(void 0===n?this.base64js={}:n)},{}],39:[function(t,e,n){n.read=function(t,e,n,i,o){var r,a,s=8*o-i-1,h=(1<>1,l=-7,u=n?o-1:0,d=n?-1:1,p=t[e+u];for(u+=d,r=p&(1<<-l)-1,p>>=-l,l+=s;l>0;r=256*r+t[e+u],u+=d,l-=8);for(a=r&(1<<-l)-1,r>>=-l,l+=i;l>0;a=256*a+t[e+u],u+=d,l-=8);if(0===r)r=1-c;else{if(r===h)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,i),r-=c}return(p?-1:1)*a*Math.pow(2,r-i)},n.write=function(t,e,n,i,o,r){var a,s,h,c=8*r-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:r-1,f=i?1:-1,E=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),e+=a+u>=1?d/h:d*Math.pow(2,1-u),e*h>=2&&(a++,h/=2),a+u>=l?(s=0,a=l):a+u>=1?(s=(e*h-1)*Math.pow(2,o),a+=u):(s=e*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&s,p+=f,s/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=f,a/=256,c-=8);t[n+p-f]|=128*E}},{}],40:[function(t,e,n){var i={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},{}]},{},[36]);