SimplePanoramaViewer/js/photo-sphere-viewer.min.js

7 lines
86 KiB
JavaScript

/*!
* Photo Sphere Viewer 3.3.2
* Copyright (c) 2014-2015 Jérémy Heleine
* Copyright (c) 2015-2018 Damien "Mistic" Sorel
* Licensed under MIT (http://opensource.org/licenses/MIT)
*/
!function(t,e){"function"==typeof define&&define.amd?define(["three","d.js","uevent","dot/doT"],e):"object"==typeof module&&module.exports?module.exports=e(require("three"),require("d.js"),require("uevent"),require("dot/doT")):t.PhotoSphereViewer=e(t.THREE,t.D,t.uEvent,t.doT)}(this,function(t,e,i,o){"use strict";function n(e){if(!(this instanceof n))return new n(e);if(n.SYSTEM.loaded||n._loadSystem(),this.config=M.clone(n.DEFAULTS),M.deepmerge(this.config,e),!e.container)throw new b("No value given for container.");if(!n.SYSTEM.isCanvasSupported)throw new b("Canvas is not supported.");if(!(n.SYSTEM.isWebGLSupported&&this.config.webgl||M.checkTHREE("CanvasRenderer","Projector")))throw new b("Missing Three.js components: CanvasRenderer, Projector. Get them from three.js-examples package.");if(this.config.longitude_range&&2!==this.config.longitude_range.length&&(this.config.longitude_range=null,console.warn("PhotoSphereViewer: longitude_range must have exactly two elements.")),this.config.latitude_range?2!==this.config.latitude_range.length?(this.config.latitude_range=null,console.warn("PhotoSphereViewer: latitude_range must have exactly two elements.")):this.config.latitude_range[0]>this.config.latitude_range[1]&&(this.config.latitude_range=[this.config.latitude_range[1],this.config.latitude_range[0]],console.warn("PhotoSphereViewer: latitude_range values must be ordered.")):void 0===this.config.tilt_up_max&&void 0===this.config.tilt_down_max||(this.config.latitude_range=[void 0!==this.config.tilt_down_max?this.config.tilt_down_max-Math.PI/4:-M.HalfPI,void 0!==this.config.tilt_up_max?this.config.tilt_up_max+Math.PI/4:M.HalfPI],console.warn("PhotoSphereViewer: tilt_up_max and tilt_down_max are deprecated, use latitude_range instead.")),this.config.max_fov<this.config.min_fov){var i=this.config.max_fov;this.config.max_fov=this.config.min_fov,this.config.min_fov=i,console.warn("PhotoSphereViewer: max_fov cannot be lower than min_fov.")}this.config.cache_texture&&(!M.isInteger(this.config.cache_texture)||this.config.cache_texture<0)&&(this.config.cache_texture=n.DEFAULTS.cache_texture,console.warn("PhotoSphereViewer: invalid value for cache_texture")),"panorama_roll"in this.config&&(this.config.sphere_correction.roll=this.config.panorama_roll,console.warn("PhotoSphereViewer: panorama_roll is deprecated, use sphere_correction.roll instead")),this.config.min_fov=M.bound(this.config.min_fov,1,179),this.config.max_fov=M.bound(this.config.max_fov,1,179),null===this.config.default_fov?this.config.default_fov=this.config.max_fov/2+this.config.min_fov/2:this.config.default_fov=M.bound(this.config.default_fov,this.config.min_fov,this.config.max_fov),this.config.default_long=M.parseAngle(this.config.default_long),this.config.default_lat=M.parseAngle(this.config.default_lat,!0),this.config.sphere_correction.pan=M.parseAngle(this.config.sphere_correction.pan,!0),this.config.sphere_correction.tilt=M.parseAngle(this.config.sphere_correction.tilt,!0),this.config.sphere_correction.roll=M.parseAngle(this.config.sphere_correction.roll,!0),null===this.config.anim_lat?this.config.anim_lat=this.config.default_lat:this.config.anim_lat=M.parseAngle(this.config.anim_lat,!0),this.config.longitude_range&&(this.config.longitude_range=this.config.longitude_range.map(function(t){return M.parseAngle(t)})),this.config.latitude_range&&(this.config.latitude_range=this.config.latitude_range.map(function(t){return M.parseAngle(t,!0)})),this.config.anim_speed=M.parseSpeed(this.config.anim_speed),this.config.caption&&!this.config.navbar&&(this.config.navbar=["caption"]),!0===this.config.fisheye?this.config.fisheye=1:!1===this.config.fisheye&&(this.config.fisheye=0),this.parent="string"==typeof e.container?document.getElementById(e.container):e.container,this.container=null,this.loader=null,this.navbar=null,this.hud=null,this.panel=null,this.tooltip=null,this.canvas_container=null,this.renderer=null,this.scene=null,this.camera=null,this.mesh=null,this.raycaster=null,this.doControls=null,this.prop={isCubemap:void 0,longitude:0,latitude:0,direction:null,anim_speed:0,zoom_lvl:0,vFov:0,hFov:0,aspect:0,move_speed:.1,moving:!1,zooming:!1,start_mouse_x:0,start_mouse_y:0,mouse_x:0,mouse_y:0,mouse_history:[],pinch_dist:0,orientation_reqid:null,autorotate_reqid:null,animation_promise:null,loading_promise:null,start_timeout:null,dblclick_data:null,dblclick_timeout:null,cache:[],size:{width:0,height:0},pano_data:{full_width:0,full_height:0,cropped_width:0,cropped_height:0,cropped_x:0,cropped_y:0}},Object.keys(n.TEMPLATES).forEach(function(t){this.config.templates[t]||(this.config.templates[t]=n.TEMPLATES[t]),"string"==typeof this.config.templates[t]&&(this.config.templates[t]=o.template(this.config.templates[t]))},this),this.parent.photoSphereViewer=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),null!==this.config.size&&this._setViewerSize(this.config.size),this._onResize();var s=Math.round((this.config.default_fov-this.config.min_fov)/(this.config.max_fov-this.config.min_fov)*100);this.zoom(s-2*(s-50),!1),this.prop.move_speed=t.Math.degToRad(this.config.move_speed/n.SYSTEM.pixelRatio),this.rotate({longitude:this.config.default_long,latitude:this.config.default_lat},!1),this.loader=new a(this),this.loader.hide(),this.navbar=new h(this),this.navbar.hide(),this.hud=new r(this),this.hud.hide(),this.panel=new l(this),this.tooltip=new u(this.hud),this._bindEvents(),this.config.panorama&&this.load(),this.once("render",function(){this.config.navbar&&(this.container.classList.add("psv-container--has-navbar"),this.navbar.show()),this.hud.show(),this.config.markers&&(this.config.markers.forEach(function(t){this.hud.addMarker(t,!1)},this),this.hud.renderMarkers()),!1!==this.config.time_anim&&(this.prop.start_timeout=window.setTimeout(this.startAutorotate.bind(this),this.config.time_anim)),this.trigger("ready")}.bind(this))}i.mixin(n),n.prototype._loadXMP=function(t){if(!this.config.usexmpdata)return e.resolved(null);var i=e(),o=new XMLHttpRequest,n=this,s=0;return o.onreadystatechange=function(){if(4===o.readyState){if(200!==o.status&&201!==o.status&&202!==o.status&&0!==o.status)throw n.container.textContent="Cannot load image",new b("Cannot load image");n.loader.setProgress(100);var t=o.responseText,e=t.indexOf("<x:xmpmeta"),r=t.indexOf("</x:xmpmeta>"),a=t.substring(e,r);if(-1===e||-1===r||-1===a.indexOf("GPano:"))i.resolve(null);else{var h={full_width:parseInt(M.getXMPValue(a,"FullPanoWidthPixels")),full_height:parseInt(M.getXMPValue(a,"FullPanoHeightPixels")),cropped_width:parseInt(M.getXMPValue(a,"CroppedAreaImageWidthPixels")),cropped_height:parseInt(M.getXMPValue(a,"CroppedAreaImageHeightPixels")),cropped_x:parseInt(M.getXMPValue(a,"CroppedAreaLeftPixels")),cropped_y:parseInt(M.getXMPValue(a,"CroppedAreaTopPixels"))};h.full_width&&h.full_height&&h.cropped_width&&h.cropped_height?i.resolve(h):(console.warn("PhotoSphereViewer: invalid XMP data"),i.resolve(null))}}else 3===o.readyState&&n.loader.setProgress(s+=10)},o.onprogress=function(t){if(t.lengthComputable){var e=parseInt(t.loaded/t.total*100);e>s&&(s=e,n.loader.setProgress(s))}},o.onerror=function(){throw n.container.textContent="Cannot load image",new b("Cannot load image")},o.open("GET",t,!0),o.send(null),i.promise},n.prototype._loadTexture=function(t){var e=[];if(Array.isArray(t)){if(6!==t.length)throw new b("Must provide exactly 6 image paths when using cubemap.");for(var i=0;i<6;i++)e[i]=t[n.CUBE_MAP[i]];t=e}else if("object"==typeof t){if(!n.CUBE_HASHMAP.every(function(e){return!!t[e]}))throw new b("Must provide exactly left, front, right, back, top, bottom when using cubemap.");n.CUBE_HASHMAP.forEach(function(i,o){e[o]=t[i]}),t=e}if(Array.isArray(t)){if(!1===this.prop.isCubemap)throw new b("The viewer was initialized with an equirectangular panorama, cannot switch to cubemap.");return this.config.fisheye&&console.warn("PhotoSphereViewer: fisheye effect with cubemap texture can generate distorsions."),this.config.cache_texture===n.DEFAULTS.cache_texture&&(this.config.cache_texture*=6),this.prop.isCubemap=!0,this._loadCubemapTexture(t)}if(!0===this.prop.isCubemap)throw new b("The viewer was initialized with an cubemap, cannot switch to equirectangular panorama.");return this.prop.isCubemap=!1,this._loadEquirectangularTexture(t)},n.prototype._loadEquirectangularTexture=function(i){if(this.config.cache_texture){var o=this.getPanoramaCache(i);if(o)return this.prop.pano_data=o.pano_data,e.resolved(o.image)}return this._loadXMP(i).then(function(o){var s=e(),r=new t.ImageLoader,a=o?100:0;r.setCrossOrigin("anonymous");return r.load(i,function(e){a=100,this.loader.setProgress(a),this.trigger("panorama-load-progress",i,a),!o&&this.config.pano_data&&(o=M.clone(this.config.pano_data)),o||(o={full_width:e.width,full_height:e.height,cropped_width:e.width,cropped_height:e.height,cropped_x:0,cropped_y:0}),this.prop.pano_data=o;var r,h=Math.min(o.full_width,n.SYSTEM.maxTextureWidth)/o.full_width;if(1!==h||o.cropped_width!=o.full_width||o.cropped_height!=o.full_height){var p=M.clone(o);p.full_width*=h,p.full_height*=h,p.cropped_width*=h,p.cropped_height*=h,p.cropped_x*=h,p.cropped_y*=h,e.width=p.cropped_width,e.height=p.cropped_height;var c=document.createElement("canvas");c.width=p.full_width,c.height=p.full_height,c.getContext("2d").drawImage(e,p.cropped_x,p.cropped_y,p.cropped_width,p.cropped_height),r=new t.Texture(c)}else r=new t.Texture(e);r.needsUpdate=!0,r.minFilter=t.LinearFilter,r.generateMipmaps=!1,this.config.cache_texture&&this._putPanoramaCache({panorama:i,image:r,pano_data:o}),s.resolve(r)}.bind(this),function(t){if(t.lengthComputable){var e=parseInt(t.loaded/t.total*100);e>a&&(a=e,this.loader.setProgress(a),this.trigger("panorama-load-progress",i,a))}}.bind(this),function(t){throw this.container.textContent="Cannot load image",s.reject(t),new b("Cannot load image")}.bind(this)),s.promise}.bind(this))},n.prototype._loadCubemapTexture=function(i){var o=e(),s=new t.ImageLoader,r=[0,0,0,0,0,0],a=[],h=0;s.setCrossOrigin("anonymous");for(var p=function(e,s){h++,r[e]=100,this.loader.setProgress(M.sum(r)/6),this.trigger("panorama-load-progress",i[e],r[e]);var p=Math.min(s.width,n.SYSTEM.maxTextureWidth/2)/s.width;if(1!==p){var c=document.createElement("canvas");c.width=s.width*p,c.height=s.height*p;c.getContext("2d").drawImage(s,0,0,c.width,c.height),a[e]=new t.Texture(c)}else a[e]=new t.Texture(s);this.config.cache_texture&&this._putPanoramaCache({panorama:i[e],image:a[e]}),6===h&&(a.forEach(function(e){e.needsUpdate=!0,e.minFilter=t.LinearFilter,e.generateMipmaps=!1}),o.resolve(a))},c=function(t,e){if(e.lengthComputable){var o=parseInt(e.loaded/e.total*100);o>r[t]&&(r[t]=o,this.loader.setProgress(M.sum(r)/6),this.trigger("panorama-load-progress",i[t],r[t]))}},l=function(t,e){throw this.container.textContent="Cannot load image",o.reject(e),new b("Cannot load image "+t)},u=0;u<6;u++){if(this.config.cache_texture){var d=this.getPanoramaCache(i[u]);if(d){h++,r[u]=100,a[u]=d.image;continue}}s.load(i[u],p.bind(this,u),c.bind(this,u),l.bind(this,u))}return 6===h&&o.resolve(a),o.promise},n.prototype._setTexture=function(t){if(this.scene||this._createScene(),this.prop.isCubemap)for(var e=0;e<6;e++)this.mesh.material[e].map&&this.mesh.material[e].map.dispose(),this.mesh.material[e].map=t[e];else this.mesh.material.map&&this.mesh.material.map.dispose(),this.mesh.material.map=t;this.trigger("panorama-loaded"),this.render()},n.prototype._createScene=function(){this.raycaster=new t.Raycaster,this.renderer=n.SYSTEM.isWebGLSupported&&this.config.webgl?new t.WebGLRenderer:new t.CanvasRenderer,this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.renderer.setPixelRatio(n.SYSTEM.pixelRatio);var e=n.SPHERE_RADIUS;this.prop.isCubemap&&(e*=Math.sqrt(3)),this.config.fisheye&&(e+=n.SPHERE_RADIUS),this.camera=new t.PerspectiveCamera(this.config.default_fov,this.prop.size.width/this.prop.size.height,1,e),this.camera.position.set(0,0,0),this.config.gyroscope&&M.checkTHREE("DeviceOrientationControls")&&(this.doControls=new t.DeviceOrientationControls(this.camera)),this.scene=new t.Scene,this.scene.add(this.camera),this.prop.isCubemap?this._createCubemap():this._createSphere(),this.canvas_container=document.createElement("div"),this.canvas_container.className="psv-canvas-container",this.renderer.domElement.className="psv-canvas",this.container.appendChild(this.canvas_container),this.canvas_container.appendChild(this.renderer.domElement)},n.prototype._createSphere=function(){var e=new t.SphereGeometry(n.SPHERE_RADIUS,n.SPHERE_VERTICES,n.SPHERE_VERTICES,-M.HalfPI),i=new t.MeshBasicMaterial({side:t.DoubleSide,overdraw:n.SYSTEM.isWebGLSupported&&this.config.webgl?0:1});this.mesh=new t.Mesh(e,i),this.mesh.scale.x=-1,this.mesh.rotation.x=this.config.sphere_correction.tilt,this.mesh.rotation.y=this.config.sphere_correction.pan,this.mesh.rotation.z=this.config.sphere_correction.roll,this.scene.add(this.mesh)},n.prototype._createCubemap=function(){for(var e=new t.BoxGeometry(2*n.SPHERE_RADIUS,2*n.SPHERE_RADIUS,2*n.SPHERE_RADIUS,n.CUBE_VERTICES,n.CUBE_VERTICES,n.CUBE_VERTICES),i=[],o=0;o<6;o++)i.push(new t.MeshBasicMaterial({side:t.BackSide,overdraw:n.SYSTEM.isWebGLSupported&&this.config.webgl?0:1}));this.mesh=new t.Mesh(e,i),this.mesh.position.x-=n.SPHERE_RADIUS,this.mesh.position.y-=n.SPHERE_RADIUS,this.mesh.position.z-=n.SPHERE_RADIUS,this.mesh.applyMatrix((new t.Matrix4).makeScale(1,1,-1)),this.scene.add(this.mesh)},n.prototype._transition=function(e,i){if(this.prop.isCubemap)throw new b("Transition is not available with cubemap.");var o=this,s=new t.SphereGeometry(.9*n.SPHERE_RADIUS,n.SPHERE_VERTICES,n.SPHERE_VERTICES,-M.HalfPI),r=new t.MeshBasicMaterial({side:t.DoubleSide,overdraw:n.SYSTEM.isWebGLSupported&&this.config.webgl?0:1,map:e,transparent:!0,opacity:0}),a=new t.Mesh(s,r);if(a.scale.x=-1,i){a.rotateY(i.longitude-this.prop.longitude);var h=new t.Vector3(0,1,0).cross(this.camera.getWorldDirection()).normalize(),p=(new t.Quaternion).setFromAxisAngle(h,i.latitude-this.prop.latitude);a.quaternion.multiplyQuaternions(p,a.quaternion)}return this.scene.add(a),this.render(),M.animation({properties:{opacity:{start:0,end:1}},duration:o.config.transition.duration,easing:"outCubic",onTick:function(t){r.opacity=t.opacity,o.render()}}).then(function(){o.mesh.material.map.dispose(),o.mesh.material.map=e,o.scene.remove(a),a.geometry.dispose(),a.geometry=null,a.material.dispose(),a.material=null,i?((o.config.latitude_range||o.config.longitude_range)&&(o.config.longitude_range=o.config.latitude_range=null,console.warn("PhotoSphereViewer: trying to perform transition with longitude_range and/or latitude_range, ranges cleared.")),o.rotate(i)):o.render()})},n.prototype._reverseAutorotate=function(){var t=this,e=-this.config.anim_speed,i=this.config.longitude_range;this.config.longitude_range=null,M.animation({properties:{speed:{start:this.config.anim_speed,end:0}},duration:300,easing:"inSine",onTick:function(e){t.config.anim_speed=e.speed}}).then(function(){return M.animation({properties:{speed:{start:0,end:e}},duration:300,easing:"outSine",onTick:function(e){t.config.anim_speed=e.speed}})}).then(function(){t.config.longitude_range=i,t.config.anim_speed=e})},n.prototype._putPanoramaCache=function(t){if(!this.config.cache_texture)throw new b("Cannot add panorama to cache, cache_texture is disabled");var e=this.getPanoramaCache(t.panorama);e?(e.image=t.image,e.pano_data=t.pano_data):(this.prop.cache=this.prop.cache.slice(0,this.config.cache_texture-1),this.prop.cache.unshift(t)),this.trigger("panorama-cached",t.panorama)},n.prototype._stopAll=function(){this.stopAutorotate(),this.stopAnimation(),this.stopGyroscopeControl()},n.MOVE_THRESHOLD=4,n.ANGLE_THRESHOLD=.003,n.DBLCLICK_DELAY=300,n.INERTIA_WINDOW=300,n.SPHERE_RADIUS=100,n.SPHERE_VERTICES=64,n.CUBE_VERTICES=8,n.CUBE_MAP=[0,2,4,5,3,1],n.CUBE_HASHMAP=["left","right","top","bottom","back","front"],n.KEYMAP={33:"PageUp",34:"PageDown",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",107:"+",109:"-"},n.SYSTEM={loaded:!1,pixelRatio:1,isWebGLSupported:!1,isCanvasSupported:!1,deviceOrientationSupported:null,maxTextureWidth:0,mouseWheelEvent:null,fullscreenEvent:null},n.ICONS={},n.DEFAULTS={panorama:null,container:null,caption:null,usexmpdata:!0,pano_data:null,webgl:!0,min_fov:30,max_fov:90,default_fov:null,default_long:0,default_lat:0,sphere_correction:{pan:0,tilt:0,roll:0},longitude_range:null,latitude_range:null,move_speed:1,time_anim:2e3,anim_speed:"2rpm",anim_lat:null,fisheye:!1,navbar:["autorotate","zoom","download","markers","caption","gyroscope","fullscreen"],tooltip:{offset:5,arrow_size:7,delay:100},lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",download:"Download",fullscreen:"Fullscreen",markers:"Markers",gyroscope:"Gyroscope"},mousewheel:!0,mousewheel_factor:1,mousemove:!0,keyboard:!0,gyroscope:!1,move_inertia:!0,click_event_on_marker:!1,transition:{duration:1500,loader:!0},loading_img:null,loading_txt:"Loading...",size:null,cache_texture:0,templates:{},markers:[]},n.TEMPLATES={markersList:'<div class="psv-markers-list-container"> <h1 class="psv-markers-list-title">{{= it.config.lang.markers }}</h1> <ul class="psv-markers-list"> {{~ it.markers: marker }} <li data-psv-marker="{{= marker.id }}" class="psv-markers-list-item {{? marker.className }}{{= marker.className }}{{?}}"> {{? marker.image }}<img class="psv-markers-list-image" src="{{= marker.image }}"/>{{?}} <p class="psv-markers-list-name">{{? marker.tooltip }}{{= marker.tooltip.content }}{{?? marker.html }}{{= marker.html }}{{??}}{{= marker.id }}{{?}}</p> </li> {{~}} </ul> </div>'},n.prototype._bindEvents=function(){window.addEventListener("resize",this),this.config.mousemove&&(this.hud.container.style.cursor="move",this.hud.container.addEventListener("mousedown",this),this.hud.container.addEventListener("touchstart",this),window.addEventListener("mouseup",this),window.addEventListener("touchend",this),this.hud.container.addEventListener("mousemove",this),this.hud.container.addEventListener("touchmove",this)),n.SYSTEM.fullscreenEvent&&document.addEventListener(n.SYSTEM.fullscreenEvent,this),this.config.mousewheel&&this.hud.container.addEventListener(n.SYSTEM.mouseWheelEvent,this),this.on("_side-reached",function(t){this.isAutorotateEnabled()&&("left"!==t&&"right"!==t||this._reverseAutorotate())})},n.prototype.handleEvent=function(t){switch(t.type){case"resize":M.throttle(this._onResize(),50);break;case"keydown":this._onKeyDown(t);break;case"mousedown":this._onMouseDown(t);break;case"touchstart":this._onTouchStart(t);break;case"mouseup":this._onMouseUp(t);break;case"touchend":this._onTouchEnd(t);break;case"mousemove":this._onMouseMove(t);break;case"touchmove":this._onTouchMove(t);break;case n.SYSTEM.fullscreenEvent:this._fullscreenToggled();break;case n.SYSTEM.mouseWheelEvent:this._onMouseWheel(t)}},n.prototype._onResize=function(){this.container.clientWidth==this.prop.size.width&&this.container.clientHeight==this.prop.size.height||(this.prop.size.width=parseInt(this.container.clientWidth),this.prop.size.height=parseInt(this.container.clientHeight),this.prop.aspect=this.prop.size.width/this.prop.size.height,this.renderer&&(this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.composer&&this.composer.reset(new t.WebGLRenderTarget(this.prop.size.width,this.prop.size.height)),this.render()),this.trigger("size-updated",this.getSize()))},n.prototype._onKeyDown=function(t){var e=0,i=0,o=0;switch(t.key||n.KEYMAP[t.keyCode||t.which]){case"ArrowUp":i=.01;break;case"ArrowDown":i=-.01;break;case"ArrowRight":e=.01;break;case"ArrowLeft":e=-.01;break;case"PageUp":case"+":o=1;break;case"PageDown":case"-":o=-1}0!==o?this.zoom(this.prop.zoom_lvl+o):0===i&&0===e||this.rotate({longitude:this.prop.longitude+e*this.prop.move_speed*this.prop.hFov,latitude:this.prop.latitude+i*this.prop.move_speed*this.prop.vFov})},n.prototype._onMouseDown=function(t){this._startMove(t)},n.prototype._onMouseUp=function(t){this._stopMove(t)},n.prototype._onMouseMove=function(t){0!==t.buttons&&(t.preventDefault(),this._move(t))},n.prototype._onTouchStart=function(t){1===t.touches.length?this._startMove(t.touches[0]):2===t.touches.length&&this._startZoom(t)},n.prototype._onTouchEnd=function(t){this._stopMove(t.changedTouches[0])},n.prototype._onTouchMove=function(t){1===t.touches.length?(t.preventDefault(),this._move(t.touches[0])):2===t.touches.length&&(t.preventDefault(),this._zoom(t))},n.prototype._startMove=function(t){this.isGyroscopeEnabled()||(this._stopAll(),this.prop.mouse_x=this.prop.start_mouse_x=parseInt(t.clientX),this.prop.mouse_y=this.prop.start_mouse_y=parseInt(t.clientY),this.prop.moving=!0,this.prop.zooming=!1,this.prop.mouse_history.length=0,this._logMouseMove(t))},n.prototype._startZoom=function(t){var e=[{x:parseInt(t.touches[0].clientX),y:parseInt(t.touches[0].clientY)},{x:parseInt(t.touches[1].clientX),y:parseInt(t.touches[1].clientY)}];this.prop.pinch_dist=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2)),this.prop.moving=!1,this.prop.zooming=!0},n.prototype._stopMove=function(t){M.getClosest(t.target,".psv-hud")&&(this.isGyroscopeEnabled()?this._click(t):(this.prop.moving&&(Math.abs(t.clientX-this.prop.start_mouse_x)<n.MOVE_THRESHOLD&&Math.abs(t.clientY-this.prop.start_mouse_y)<n.MOVE_THRESHOLD?(this._click(t),this.prop.moving=!1):this.config.move_inertia?(this._logMouseMove(t),this._stopMoveInertia(t)):this.prop.moving=!1,this.prop.mouse_history.length=0),this.prop.zooming=!1))},n.prototype._stopMoveInertia=function(t){var e=this,i=t.clientX-this.prop.mouse_history[0][1],o=t.clientY-this.prop.mouse_history[0][2],s=Math.sqrt(i*i+o*o);this.prop.animation_promise=M.animation({properties:{clientX:{start:t.clientX,end:t.clientX+i},clientY:{start:t.clientY,end:t.clientY+o}},duration:s*n.INERTIA_WINDOW/100,easing:"outCirc",onTick:function(t){e._move(t,!1)}}).ensure(function(){e.prop.moving=!1})},n.prototype._click=function(t){var e=this.container.getBoundingClientRect(),i={target:t.target,client_x:t.clientX,client_y:t.clientY,viewer_x:parseInt(t.clientX-e.left),viewer_y:parseInt(t.clientY-e.top)},o=this.viewerCoordsToVector3({x:i.viewer_x,y:i.viewer_y});if(o){var s=this.vector3ToSphericalCoords(o);if(i.longitude=s.longitude,i.latitude=s.latitude,!this.prop.isCubemap){var r=this.sphericalCoordsToTextureCoords({longitude:i.longitude,latitude:i.latitude});i.texture_x=r.x,i.texture_y=r.y}this.prop.dblclick_timeout?(Math.abs(this.prop.dblclick_data.client_x-i.client_x)<n.MOVE_THRESHOLD&&Math.abs(this.prop.dblclick_data.client_y-i.client_y)<n.MOVE_THRESHOLD&&this.trigger("dblclick",this.prop.dblclick_data),clearTimeout(this.prop.dblclick_timeout),this.prop.dblclick_timeout=null,this.prop.dblclick_data=null):(this.trigger("click",i),this.prop.dblclick_data=M.clone(i),this.prop.dblclick_timeout=setTimeout(function(){this.prop.dblclick_timeout=null,this.prop.dblclick_data=null}.bind(this),n.DBLCLICK_DELAY))}},n.prototype._move=function(t,e){if(this.prop.moving){var i=parseInt(t.clientX),o=parseInt(t.clientY);this.rotate({longitude:this.prop.longitude-(i-this.prop.mouse_x)/this.prop.size.width*this.prop.move_speed*this.prop.hFov,latitude:this.prop.latitude+(o-this.prop.mouse_y)/this.prop.size.height*this.prop.move_speed*this.prop.vFov}),this.prop.mouse_x=i,this.prop.mouse_y=o,!1!==e&&this._logMouseMove(t)}},n.prototype._zoom=function(t){if(this.prop.zooming){var e=[{x:parseInt(t.touches[0].clientX),y:parseInt(t.touches[0].clientY)},{x:parseInt(t.touches[1].clientX),y:parseInt(t.touches[1].clientY)}],i=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2)),o=80*(i-this.prop.pinch_dist)/this.prop.size.width;this.zoom(this.prop.zoom_lvl+o),this.prop.pinch_dist=i}},n.prototype._onMouseWheel=function(t){t.preventDefault(),t.stopPropagation();var e=5*M.normalizeWheel(t).spinY;0!==e&&this.zoom(this.prop.zoom_lvl-e*this.config.mousewheel_factor)},n.prototype._fullscreenToggled=function(){var t=this.isFullscreenEnabled();this.config.keyboard&&(t?this.startKeyboardControl():this.stopKeyboardControl()),this.trigger("fullscreen-updated",t)},n.prototype._logMouseMove=function(t){var e=Date.now();this.prop.mouse_history.push([e,t.clientX,t.clientY]);for(var i=null,o=0;o<this.prop.mouse_history.length;)this.prop.mouse_history[0][o]<e-n.INERTIA_WINDOW?this.prop.mouse_history.splice(o,1):i&&this.prop.mouse_history[0][o]-i>n.INERTIA_WINDOW/10?(this.prop.mouse_history.splice(0,o),o=0,i=this.prop.mouse_history[0][o]):(o++,i=this.prop.mouse_history[0][o])},n.prototype.load=function(){if(!this.config.panorama)throw new b("No value given for panorama.");return this.setPanorama(this.config.panorama,!1)},n.prototype.getPosition=function(){return{longitude:this.prop.longitude,latitude:this.prop.latitude}},n.prototype.getZoomLevel=function(){return this.prop.zoom_lvl},n.prototype.getSize=function(){return{width:this.prop.size.width,height:this.prop.size.height}},n.prototype.isAutorotateEnabled=function(){return!!this.prop.autorotate_reqid},n.prototype.isGyroscopeEnabled=function(){return!!this.prop.orientation_reqid},n.prototype.isFullscreenEnabled=function(){return M.isFullscreenEnabled(this.container)},n.prototype.render=function(t){!1!==t&&(this.prop.direction=this.sphericalCoordsToVector3(this.prop),this.camera.position.set(0,0,0),this.camera.lookAt(this.prop.direction)),this.config.fisheye&&this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.aspect=this.prop.aspect,this.camera.fov=this.prop.vFov,this.camera.updateProjectionMatrix(),this.composer?this.composer.render():this.renderer.render(this.scene,this.camera),this.trigger("render")},n.prototype.destroy=function(){this._stopAll(),this.stopKeyboardControl(),this.isFullscreenEnabled()&&M.exitFullscreen(),window.removeEventListener("resize",this),this.config.mousemove&&(this.hud.container.removeEventListener("mousedown",this),this.hud.container.removeEventListener("touchstart",this),window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this),this.hud.container.removeEventListener("mousemove",this),this.hud.container.removeEventListener("touchmove",this)),n.SYSTEM.fullscreenEvent&&document.removeEventListener(n.SYSTEM.fullscreenEvent,this),this.config.mousewheel&&this.hud.container.removeEventListener(n.SYSTEM.mouseWheelEvent,this),this.tooltip&&this.tooltip.destroy(),this.hud&&this.hud.destroy(),this.loader&&this.loader.destroy(),this.navbar&&this.navbar.destroy(),this.panel&&this.panel.destroy(),this.doControls&&this.doControls.disconnect(),this.scene&&M.cleanTHREEScene(this.scene),this.canvas_container&&this.container.removeChild(this.canvas_container),this.parent.removeChild(this.container),delete this.parent.photoSphereViewer,delete this.parent,delete this.container,delete this.loader,delete this.navbar,delete this.hud,delete this.panel,delete this.tooltip,delete this.canvas_container,delete this.renderer,delete this.composer,delete this.scene,delete this.camera,delete this.mesh,delete this.doControls,delete this.raycaster,delete this.passes,delete this.config,this.prop.cache.length=0},n.prototype.setPanorama=function(t,e,i){if(null!==this.prop.loading_promise)throw new b("Loading already in progress");if("boolean"==typeof e&&(i=e,e=void 0),i&&this.prop.isCubemap)throw new b("Transition is not available with cubemap.");e&&(this.cleanPosition(e),this._stopAll()),this.config.panorama=t;var o=this;return i&&this.config.transition&&this.scene?(this.config.transition.loader&&this.loader.show(),this.prop.loading_promise=this._loadTexture(this.config.panorama).then(function(t){return o.loader.hide(),o._transition(t,e)}).ensure(function(){o.loader.hide(),o.prop.loading_promise=null}).rethrow()):(this.loader.show(),this.canvas_container&&(this.canvas_container.style.opacity=0),this.prop.loading_promise=this._loadTexture(this.config.panorama).then(function(t){o._setTexture(t),e&&o.rotate(e)}).ensure(function(){o.loader.hide(),o.canvas_container.style.opacity=1,o.prop.loading_promise=null}).rethrow()),this.prop.loading_promise},n.prototype.startAutorotate=function(){this._stopAll();var t=this,e=null,i=null;!function o(n){n&&(i=null===e?0:n-e,e=n,t.rotate({longitude:t.prop.longitude+t.config.anim_speed*i/1e3,latitude:t.prop.latitude-(t.prop.latitude-t.config.anim_lat)/200})),t.prop.autorotate_reqid=window.requestAnimationFrame(o)}(null),this.trigger("autorotate",!0)},n.prototype.stopAutorotate=function(){this.prop.start_timeout&&(window.clearTimeout(this.prop.start_timeout),this.prop.start_timeout=null),this.prop.autorotate_reqid&&(window.cancelAnimationFrame(this.prop.autorotate_reqid),this.prop.autorotate_reqid=null,this.trigger("autorotate",!1))},n.prototype.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},n.prototype.startGyroscopeControl=function(){if(this.doControls&&this.doControls.enabled&&this.doControls.deviceOrientation){this._stopAll();var t=this;!function e(){t.doControls.update(),t.prop.direction=t.camera.getWorldDirection();var i=t.vector3ToSphericalCoords(t.prop.direction);t.prop.longitude=i.longitude,t.prop.latitude=i.latitude,t.render(!1),t.prop.orientation_reqid=window.requestAnimationFrame(e)}(),this.trigger("gyroscope-updated",!0)}else console.warn("PhotoSphereViewer: gyroscope disabled")},n.prototype.stopGyroscopeControl=function(){this.prop.orientation_reqid&&(window.cancelAnimationFrame(this.prop.orientation_reqid),this.prop.orientation_reqid=null,this.trigger("gyroscope-updated",!1),this.render())},n.prototype.toggleGyroscopeControl=function(){this.isGyroscopeEnabled()?this.stopGyroscopeControl():this.startGyroscopeControl()},n.prototype.rotate=function(t,e){this.cleanPosition(t),this.applyRanges(t).forEach(this.trigger.bind(this,"_side-reached")),this.prop.longitude=t.longitude,this.prop.latitude=t.latitude,!1!==e&&this.renderer&&(this.render(),this.trigger("position-updated",this.getPosition()))},n.prototype.animate=function(t,i){if(this._stopAll(),this.cleanPosition(t),!i||Math.abs(t.longitude-this.prop.longitude)<n.ANGLE_THRESHOLD&&Math.abs(t.latitude-this.prop.latitude)<n.ANGLE_THRESHOLD)return this.rotate(t),e.resolved();if(this.applyRanges(t).forEach(this.trigger.bind(this,"_side-reached")),!i&&"number"!=typeof i){i=i?M.parseSpeed(i):this.config.anim_speed;i=Math.acos(Math.cos(this.prop.latitude)*Math.cos(t.latitude)*Math.cos(this.prop.longitude-t.longitude)+Math.sin(this.prop.latitude)*Math.sin(t.latitude))/i*1e3}var o=M.getShortestArc(this.prop.longitude,t.longitude);return this.prop.animation_promise=M.animation({properties:{longitude:{start:this.prop.longitude,end:this.prop.longitude+o},latitude:{start:this.prop.latitude,end:t.latitude}},duration:i,easing:"inOutSine",onTick:this.rotate.bind(this)}),this.prop.animation_promise},n.prototype.stopAnimation=function(){this.prop.animation_promise&&(this.prop.animation_promise.cancel(),this.prop.animation_promise=null)},n.prototype.zoom=function(e,i){this.prop.zoom_lvl=M.bound(Math.round(e),0,100),this.prop.vFov=this.config.max_fov+this.prop.zoom_lvl/100*(this.config.min_fov-this.config.max_fov),this.prop.hFov=t.Math.radToDeg(2*Math.atan(Math.tan(t.Math.degToRad(this.prop.vFov)/2)*this.prop.aspect)),!1!==i&&this.renderer&&(this.render(),this.trigger("zoom-updated",this.getZoomLevel()))},n.prototype.zoomIn=function(){this.prop.zoom_lvl<100&&this.zoom(this.prop.zoom_lvl+1)},n.prototype.zoomOut=function(){this.prop.zoom_lvl>0&&this.zoom(this.prop.zoom_lvl-1)},n.prototype.resize=function(t){t.width&&(this.container.style.width=t.width),t.height&&(this.container.style.height=t.height),this._onResize()},n.prototype.toggleFullscreen=function(){this.isFullscreenEnabled()?M.exitFullscreen():M.requestFullscreen(this.container)},n.prototype.startKeyboardControl=function(){window.addEventListener("keydown",this)},n.prototype.stopKeyboardControl=function(){window.removeEventListener("keydown",this)},n.prototype.preloadPanorama=function(t){if(!this.config.cache_texture)throw new b("Cannot preload panorama, cache_texture is disabled");return this._loadTexture(t)},n.prototype.clearPanoramaCache=function(t){if(!this.config.cache_texture)throw new b("Cannot clear cache, cache_texture is disabled");if(t){for(var e=0,i=this.prop.cache.length;e<i;e++)if(this.prop.cache[e].panorama===t){this.prop.cache.splice(e,1);break}}else this.prop.cache.length=0},n.prototype.getPanoramaCache=function(t){if(!this.config.cache_texture)throw new b("Cannot query cache, cache_texture is disabled");return this.prop.cache.filter(function(e){return e.panorama===t}).shift()},n._loadSystem=function(){var t=n.SYSTEM;t.loaded=!0,t.pixelRatio=window.devicePixelRatio||1,t.isWebGLSupported=M.isWebGLSupported(),t.isCanvasSupported=M.isCanvasSupported(),t.maxTextureWidth=t.isWebGLSupported?M.getMaxTextureWidth():4096,t.mouseWheelEvent=M.mouseWheelEvent(),t.fullscreenEvent=M.fullscreenEvent(),t.deviceOrientationSupported=e(),"DeviceOrientationEvent"in window?window.addEventListener("deviceorientation",n._deviceOrientationListener,!1):t.deviceOrientationSupported.reject()},n._deviceOrientationListener=function(t){null===t.alpha||isNaN(t.alpha)?n.SYSTEM.deviceOrientationSupported.reject():n.SYSTEM.deviceOrientationSupported.resolve(),window.removeEventListener("deviceorientation",n._deviceOrientationListener)},n.prototype._setViewerSize=function(t){["width","height"].forEach(function(e){t[e]&&(/^[0-9.]+$/.test(t[e])&&(t[e]+="px"),this.parent.style[e]=t[e])},this)},n.prototype.textureCoordsToSphericalCoords=function(t){if(this.prop.isCubemap)throw new b("Unable to use texture coords with cubemap.");var e=(t.x+this.prop.pano_data.cropped_x)/this.prop.pano_data.full_width*M.TwoPI,i=(t.y+this.prop.pano_data.cropped_y)/this.prop.pano_data.full_height*Math.PI;return{longitude:e>=Math.PI?e-Math.PI:e+Math.PI,latitude:M.HalfPI-i}},n.prototype.sphericalCoordsToTextureCoords=function(t){if(this.prop.isCubemap)throw new b("Unable to use texture coords with cubemap.");var e=t.longitude/M.TwoPI*this.prop.pano_data.full_width,i=t.latitude/Math.PI*this.prop.pano_data.full_height;return{x:parseInt(t.longitude<Math.PI?e+this.prop.pano_data.full_width/2:e-this.prop.pano_data.full_width/2)-this.prop.pano_data.cropped_x,y:parseInt(this.prop.pano_data.full_height/2-i)-this.prop.pano_data.cropped_y}},n.prototype.sphericalCoordsToVector3=function(e){return new t.Vector3(n.SPHERE_RADIUS*-Math.cos(e.latitude)*Math.sin(e.longitude),n.SPHERE_RADIUS*Math.sin(e.latitude),n.SPHERE_RADIUS*Math.cos(e.latitude)*Math.cos(e.longitude))},n.prototype.vector3ToSphericalCoords=function(t){var e=Math.acos(t.y/Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)),i=Math.atan2(t.x,t.z);return{longitude:i<0?-i:M.TwoPI-i,latitude:M.HalfPI-e}},n.prototype.viewerCoordsToVector3=function(e){var i=new t.Vector2(2*e.x/this.prop.size.width-1,-2*e.y/this.prop.size.height+1);this.raycaster.setFromCamera(i,this.camera);var o=this.raycaster.intersectObjects(this.scene.children);return 1===o.length?o[0].point:null},n.prototype.vector3ToViewerCoords=function(t){return(t=t.clone()).project(this.camera),{x:parseInt((t.x+1)/2*this.prop.size.width),y:parseInt((1-t.y)/2*this.prop.size.height)}},n.prototype.cleanPosition=function(t){t.hasOwnProperty("x")&&t.hasOwnProperty("y")&&M.deepmerge(t,this.textureCoordsToSphericalCoords(t)),t.longitude=M.parseAngle(t.longitude),t.latitude=M.parseAngle(t.latitude,!0)},n.prototype.applyRanges=function(e){var i,o,n=[];return this.config.longitude_range&&(i=M.clone(this.config.longitude_range),o=t.Math.degToRad(this.prop.hFov)/2,i[0]=M.parseAngle(i[0]+o),i[1]=M.parseAngle(i[1]-o),i[0]>i[1]?e.longitude>i[1]&&e.longitude<i[0]&&(e.longitude>i[0]/2+i[1]/2?(e.longitude=i[0],n.push("left")):(e.longitude=i[1],n.push("right"))):e.longitude<i[0]?(e.longitude=i[0],n.push("left")):e.longitude>i[1]&&(e.longitude=i[1],n.push("right"))),this.config.latitude_range&&(i=M.clone(this.config.latitude_range),o=t.Math.degToRad(this.prop.vFov)/2,i[0]=M.parseAngle(Math.min(i[0]+o,i[1]),!0),i[1]=M.parseAngle(Math.max(i[1]-o,i[0]),!0),e.latitude<i[0]?(e.latitude=i[0],n.push("bottom")):e.latitude>i[1]&&(e.latitude=i[1],n.push("top"))),n};function s(t){this.psv=t instanceof n?t:t.psv,this.parent=t,this.container=null,this.constructor.publicMethods&&this.constructor.publicMethods.forEach(function(t){this.psv[t]=this[t].bind(this)},this)}s.className=null,s.publicMethods=[],s.prototype.create=function(){this.container=document.createElement("div"),this.constructor.className&&(this.container.className=this.constructor.className),this.parent.container.appendChild(this.container)},s.prototype.destroy=function(){this.parent.container.removeChild(this.container),this.constructor.publicMethods&&this.constructor.publicMethods.forEach(function(t){delete this.psv[t]},this),delete this.container,delete this.psv,delete this.parent},s.prototype.hide=function(){this.container.style.display="none"},s.prototype.show=function(){this.container.style.display=""};function r(t){s.call(this,t),this.svgContainer=null,this.markers={},this.currentMarker=null,this.hoveringMarker=null,this.prop={panelOpened:!1,panelOpening:!1,markersButton:this.psv.navbar.getNavbarButton("markers",!0)},this.create()}r.prototype=Object.create(s.prototype),r.prototype.constructor=r,r.className="psv-hud",r.publicMethods=["addMarker","removeMarker","updateMarker","clearMarkers","getMarker","getCurrentMarker","gotoMarker","hideMarker","showMarker","toggleMarker","toggleMarkersList","showMarkersList","hideMarkersList"],r.prototype.create=function(){s.prototype.create.call(this),this.svgContainer=document.createElementNS(M.svgNS,"svg"),this.svgContainer.setAttribute("class","psv-hud-svg-container"),this.container.appendChild(this.svgContainer),this.container.addEventListener("mouseenter",this,!0),this.container.addEventListener("mouseleave",this,!0),this.container.addEventListener("mousemove",this,!0),this.psv.on("click",this),this.psv.on("dblclick",this),this.psv.on("render",this),this.psv.on("open-panel",this),this.psv.on("close-panel",this)},r.prototype.destroy=function(){this.clearMarkers(!1),this.container.removeEventListener("mouseenter",this),this.container.removeEventListener("mouseleave",this),this.container.removeEventListener("mousemove",this),this.psv.off("click",this),this.psv.off("dblclick",this),this.psv.off("render",this),this.psv.off("open-panel",this),this.psv.off("close-panel",this),delete this.svgContainer,s.prototype.destroy.call(this)},r.prototype.handleEvent=function(t){switch(t.type){case"mouseenter":this._onMouseEnter(t);break;case"mouseleave":this._onMouseLeave(t);break;case"mousemove":this._onMouseMove(t);break;case"click":this._onClick(t.args[0],t,!1);break;case"dblclick":this._onClick(t.args[0],t,!0);break;case"render":this.renderMarkers();break;case"open-panel":this._onPanelOpened();break;case"close-panel":this._onPanelClosed()}},r.prototype.addMarker=function(t,e){if(!t.id)throw new b("missing marker id");if(this.markers[t.id])throw new b('marker "'+t.id+'" already exists');var i=new x(t,this.psv);return i.isNormal()?this.container.appendChild(i.$el):this.svgContainer.appendChild(i.$el),this.markers[i.id]=i,!1!==e&&this.renderMarkers(),i},r.prototype.getMarker=function(t){var e="object"==typeof t?t.id:t;if(!this.markers[e])throw new b('cannot find marker "'+e+'"');return this.markers[e]},r.prototype.getCurrentMarker=function(){return this.currentMarker},r.prototype.updateMarker=function(t,e){var i=this.getMarker(t);return i.update(t),!1!==e&&this.renderMarkers(),i},r.prototype.removeMarker=function(t,e){(t=this.getMarker(t)).isNormal()?this.container.removeChild(t.$el):this.svgContainer.removeChild(t.$el),this.hoveringMarker==t&&this.psv.tooltip.hideTooltip(),t.destroy(),delete this.markers[t.id],!1!==e&&this.renderMarkers()},r.prototype.clearMarkers=function(t){Object.keys(this.markers).forEach(function(t){this.removeMarker(t,!1)},this),!1!==t&&this.renderMarkers()},r.prototype.gotoMarker=function(t,e){return t=this.getMarker(t),this.psv.animate(t,e).then(function(){this.psv.trigger("goto-marker-done",t)}.bind(this))},r.prototype.hideMarker=function(t){this.getMarker(t).visible=!1,this.renderMarkers()},r.prototype.showMarker=function(t){this.getMarker(t).visible=!0,this.renderMarkers()},r.prototype.toggleMarker=function(t){this.getMarker(t).visible^=!0,this.renderMarkers()},r.prototype.toggleMarkersList=function(){this.prop.panelOpened?this.hideMarkersList():this.showMarkersList()},r.prototype.showMarkersList=function(){var t=[];for(var e in this.markers)t.push(this.markers[e]);var i=this.psv.config.templates.markersList({markers:this.psv.change("render-markers-list",t),config:this.psv.config});this.prop.panelOpening=!0,this.psv.panel.showPanel(i,!0),this.psv.panel.container.querySelector(".psv-markers-list").addEventListener("click",this._onClickItem.bind(this))},r.prototype.hideMarkersList=function(){this.prop.panelOpened&&this.psv.panel.hidePanel()},r.prototype.renderMarkers=function(){var e=this.psv.isGyroscopeEnabled()?t.Math.radToDeg(this.psv.camera.rotation.z):0;for(var i in this.markers){var o=this.markers[i],n=o.visible;if(n&&o.isPoly()){var s=this._getPolyPositions(o);if(n=s.length>(o.isPolygon()?2:1)){o.position2D=this._getPolyDimensions(o,s);var r="";s.forEach(function(t){r+=t.x+","+t.y+" "}),o.$el.setAttributeNS(null,"points",r)}}else if(n){var a=this._getMarkerPosition(o);if(n=this._isMarkerVisible(o,a)){o.position2D=a;var h=o.getScale(this.psv.getZoomLevel());o.isSvg()?o.$el.setAttributeNS(null,"transform","translate("+a.x+", "+a.y+")"+(1!==h?" scale("+h+", "+h+")":"")+(!o.lockRotation&&e?" rotate("+e+")":"")):o.$el.style.transform="translate3D("+a.x+"px, "+a.y+"px, 0px)"+(1!==h?" scale("+h+", "+h+")":"")+(!o.lockRotation&&e?" rotateZ("+e+"deg)":"")}}M.toggleClass(o.$el,"psv-marker--visible",n)}},r.prototype._isMarkerVisible=function(t,e){return t.position3D.dot(this.psv.prop.direction)>0&&e.x+t.width>=0&&e.x-t.width<=this.psv.prop.size.width&&e.y+t.height>=0&&e.y-t.height<=this.psv.prop.size.height},r.prototype._getMarkerPosition=function(t){if(t._dynamicSize){M.toggleClass(t.$el,"psv-marker--transparent",!0);var e=t.$el.style.transform;t.$el.style.transform=null;var i=t.$el.getBoundingClientRect();t.$el.style.transform=e,M.toggleClass(t.$el,"psv-marker--transparent",!1),t.width=i.right-i.left,t.height=i.bottom-i.top}var o=this.psv.vector3ToViewerCoords(t.position3D);return o.x-=t.width*t.anchor.left,o.y-=t.height*t.anchor.top,o},r.prototype._getPolyPositions=function(t){var e=t.positions3D.length,i=t.positions3D.map(function(t){return{vector:t,visible:t.dot(this.psv.prop.direction)>0}},this),o=[];return i.forEach(function(t,n){if(!t.visible){[0===n?i[e-1]:i[n-1],n===e-1?i[0]:i[n+1]].forEach(function(e){e.visible&&o.push({visible:e,invisible:t,index:n})})}}),o.reverse().forEach(function(t){i.splice(t.index,0,{vector:this._getPolyIntermediaryPoint(t.visible.vector,t.invisible.vector),visible:!0})},this),i.filter(function(t){return t.visible}).map(function(t){return this.psv.vector3ToViewerCoords(t.vector)},this)},r.prototype._getPolyIntermediaryPoint=function(e,i){var o=this.psv.prop.direction.clone().normalize(),s=(new t.Vector3).crossVectors(e,i).normalize(),r=(new t.Vector3).crossVectors(s,e).normalize(),a=(new t.Vector3).addVectors(e.clone().multiplyScalar(-o.dot(r)),r.clone().multiplyScalar(o.dot(e))).normalize(),h=(new t.Vector3).crossVectors(a,o);return a.applyAxisAngle(h,.01).multiplyScalar(n.SPHERE_RADIUS)},r.prototype._getPolyDimensions=function(t,e){var i=1/0,o=1/0,n=-1/0,s=-1/0;return e.forEach(function(t){i=Math.min(i,t.x),o=Math.min(o,t.y),n=Math.max(n,t.x),s=Math.max(s,t.y)}),t.width=n-i,t.height=s-o,{x:i,y:o}},r.prototype._onMouseEnter=function(t){var e;t.target&&(e=t.target.psvMarker)&&!e.isPoly()&&(this.hoveringMarker=e,this.psv.trigger("over-marker",e),e.tooltip&&this.psv.tooltip.showTooltip({content:e.tooltip.content,position:e.tooltip.position,left:e.position2D.x,top:e.position2D.y,box:{width:e.width,height:e.height}}))},r.prototype._onMouseLeave=function(t){var e;if(t.target&&(e=t.target.psvMarker)){if(e.isPoly()&&t.relatedTarget&&M.hasParent(t.relatedTarget,this.psv.tooltip.container))return;this.psv.trigger("leave-marker",e),this.hoveringMarker=null,this.psv.tooltip.hideTooltip()}},r.prototype._onMouseMove=function(t){if(!this.psv.prop.moving){var e;if(t.target&&(e=t.target.psvMarker)&&e.isPoly()||t.target&&M.hasParent(t.target,this.psv.tooltip.container)&&(e=this.hoveringMarker)){this.hoveringMarker||(this.psv.trigger("over-marker",e),this.hoveringMarker=e);var i=this.psv.container.getBoundingClientRect();e.tooltip&&this.psv.tooltip.showTooltip({content:e.tooltip.content,position:e.tooltip.position,top:t.clientY-i.top-this.psv.config.tooltip.arrow_size/2,left:t.clientX-i.left-this.psv.config.tooltip.arrow_size,box:{width:2*this.psv.config.tooltip.arrow_size,height:2*this.psv.config.tooltip.arrow_size}})}else this.hoveringMarker&&this.hoveringMarker.isPoly()&&(this.psv.trigger("leave-marker",e),this.hoveringMarker=null,this.psv.tooltip.hideTooltip())}},r.prototype._onClick=function(t,e,i){var o;t.target&&(o=M.getClosest(t.target,".psv-marker"))&&o.psvMarker?(this.currentMarker=o.psvMarker,this.psv.trigger("select-marker",this.currentMarker,i),this.psv.config.click_event_on_marker?t.marker=o.psvMarker:e.stopPropagation()):this.currentMarker&&(this.psv.trigger("unselect-marker",this.currentMarker),this.currentMarker=null),o&&o.psvMarker&&o.psvMarker.content?this.psv.panel.showPanel(o.psvMarker.content):this.psv.panel.prop.opened&&(e.stopPropagation(),this.psv.panel.hidePanel())},r.prototype._onClickItem=function(t){var e;if(t.target&&(e=M.getClosest(t.target,"li"))&&e.dataset.psvMarker){var i=this.getMarker(e.dataset.psvMarker);this.psv.trigger("select-marker-list",i),this.gotoMarker(i,1e3),this.psv.panel.hidePanel()}},r.prototype._onPanelOpened=function(){this.prop.panelOpening?(this.prop.panelOpening=!1,this.prop.panelOpened=!0):this.prop.panelOpened=!1,this.prop.markersButton&&this.prop.markersButton.toggleActive(this.prop.panelOpened)},r.prototype._onPanelClosed=function(){this.prop.panelOpened=!1,this.prop.panelOpening=!1,this.prop.markersButton&&this.prop.markersButton.toggleActive(!1)};function a(t){s.call(this,t),this.canvas=null,this.loader=null,this.create()}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.className="psv-loader-container",a.prototype.create=function(){s.prototype.create.call(this),this.loader=document.createElement("div"),this.loader.className="psv-loader",this.container.appendChild(this.loader),this.canvas=document.createElement("canvas"),this.canvas.className="psv-loader-canvas",this.canvas.width=this.loader.clientWidth,this.canvas.height=this.loader.clientWidth,this.loader.appendChild(this.canvas),this.tickness=(this.loader.offsetWidth-this.loader.clientWidth)/2;var t;if(this.psv.config.loading_img?((t=document.createElement("img")).className="psv-loader-image",t.src=this.psv.config.loading_img):this.psv.config.loading_txt&&((t=document.createElement("div")).className="psv-loader-text",t.innerHTML=this.psv.config.loading_txt),t){var e=Math.round(Math.sqrt(2*Math.pow(this.canvas.width/2-this.tickness/2,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}},a.prototype.destroy=function(){delete this.loader,delete this.canvas,s.prototype.destroy.call(this)},a.prototype.setProgress=function(t){var e=this.canvas.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),e.lineWidth=this.tickness,e.strokeStyle=M.getStyle(this.loader,"color"),e.beginPath(),e.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.tickness/2,-Math.PI/2,t/100*2*Math.PI-Math.PI/2),e.stroke()};function h(t){if(s.call(this,t),this.config=this.psv.config.navbar,this.items=[],!0===this.config)this.config=M.clone(n.DEFAULTS.navbar);else if("string"==typeof this.config)this.config=this.config.split(" ");else if(!Array.isArray(this.config)){console.warn('PhotoSphereViewer: hashmap form of "navbar" is deprecated, use an array instead.');var e=this.config;this.config=[];for(var i in e)e[i]&&this.config.push(i);this.config.sort(function(t,e){return n.DEFAULTS.navbar.indexOf(t)-n.DEFAULTS.navbar.indexOf(e)})}this.create()}h.prototype=Object.create(s.prototype),h.prototype.constructor=h,h.className="psv-navbar psv-navbar--open",h.publicMethods=["showNavbar","hideNavbar","toggleNavbar","getNavbarButton"],h.prototype.create=function(){s.prototype.create.call(this),this.config.forEach(function(t){if("object"==typeof t)this.items.push(new f(this,t));else switch(t){case g.id:this.items.push(new g(this));break;case w.id:this.items.push(new w(this));break;case m.id:this.items.push(new m(this));break;case _.id:this.items.push(new _(this));break;case v.id:this.items.push(new v(this));break;case y.id:this.psv.config.gyroscope&&this.items.push(new y(this));break;case"caption":this.items.push(new p(this,this.psv.config.caption));break;case"spacer":t="spacer-5";default:var e=t.match(/^spacer\-([0-9]+)$/);if(null===e)throw new b("Unknown button "+t);this.items.push(new c(this,e[1]))}},this)},h.prototype.destroy=function(){this.items.forEach(function(t){t.destroy()}),delete this.items,delete this.config,s.prototype.destroy.call(this)},h.prototype.getNavbarButton=function(t,e){var i=null;return this.items.some(function(e){if(e.id===t)return i=e,!0}),i||e||console.warn('PhotoSphereViewer: button "'+t+'" not found in the navbar.'),i},h.prototype.showNavbar=function(){this.toggleNavbar(!0)},h.prototype.hideNavbar=function(){this.toggleNavbar(!1)},h.prototype.toggleNavbar=function(t){M.toggleClass(this.container,"psv-navbar--open",t)};function p(t,e){s.call(this,t),this.create(),this.setCaption(e)}p.prototype=Object.create(s.prototype),p.prototype.constructor=p,p.className="psv-caption",p.publicMethods=["setCaption"],p.prototype.setCaption=function(t){this.container.innerHTML=t||""};function c(t,e){s.call(this,t),this.weight=e||5,this.create(),this.container.classList.add("psv-spacer--weight-"+this.weight)}c.prototype=Object.create(s.prototype),c.prototype.constructor=c,c.className="psv-spacer";function l(t){s.call(this,t),this.content=null,this.prop={mouse_x:0,mouse_y:0,mousedown:!1,opened:!1},this.create()}l.prototype=Object.create(s.prototype),l.prototype.constructor=l,l.className="psv-panel",l.publicMethods=["showPanel","hidePanel"],l.prototype.create=function(){s.prototype.create.call(this),this.container.innerHTML='<div class="psv-panel-resizer"></div><div class="psv-panel-close-button"></div><div class="psv-panel-content"></div>',this.content=this.container.querySelector(".psv-panel-content");this.container.querySelector(".psv-panel-close-button").addEventListener("click",this.hidePanel.bind(this)),this.psv.config.mousewheel&&this.container.addEventListener(n.SYSTEM.mouseWheelEvent,function(t){t.stopPropagation()});var t=this.container.querySelector(".psv-panel-resizer");t.addEventListener("mousedown",this),t.addEventListener("touchstart",this),this.psv.container.addEventListener("mouseup",this),this.psv.container.addEventListener("touchend",this),this.psv.container.addEventListener("mousemove",this),this.psv.container.addEventListener("touchmove",this)},l.prototype.destroy=function(){this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),delete this.prop,delete this.content,s.prototype.destroy.call(this)},l.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._onMouseDown(t);break;case"touchstart":this._onTouchStart(t);break;case"mousemove":this._onMouseMove(t);break;case"touchmove":this._onTouchMove(t);break;case"mouseup":case"touchend":this._onMouseUp(t)}},l.prototype.showPanel=function(t,e){this.content.innerHTML=t,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),M.toggleClass(this.content,"psv-panel-content--no-margin",!!e),this.prop.opened=!0,this.psv.trigger("open-panel")},l.prototype.hidePanel=function(){this.content.innerHTML=null,this.prop.opened=!1,this.container.classList.remove("psv-panel--open"),this.psv.trigger("close-panel")},l.prototype._onMouseDown=function(t){t.stopPropagation(),this._startResize(t)},l.prototype._onTouchStart=function(t){t.stopPropagation(),this._startResize(t.changedTouches[0])},l.prototype._onMouseUp=function(t){this.prop.mousedown&&(t.stopPropagation(),this.prop.mousedown=!1,this.content.classList.remove("psv-panel-content--no-interaction"))},l.prototype._onMouseMove=function(t){this.prop.mousedown&&(t.stopPropagation(),this._resize(t))},l.prototype._onTouchMove=function(t){this.prop.mousedown&&(t.stopPropagation(),this._resize(t.touches[0]))},l.prototype._startResize=function(t){this.prop.mouse_x=parseInt(t.clientX),this.prop.mouse_y=parseInt(t.clientY),this.prop.mousedown=!0,this.content.classList.add("psv-panel-content--no-interaction")},l.prototype._resize=function(t){var e=parseInt(t.clientX),i=parseInt(t.clientY);this.container.style.width=this.container.offsetWidth-(e-this.prop.mouse_x)+"px",this.prop.mouse_x=e,this.prop.mouse_y=i};function u(t){s.call(this,t),this.config=this.psv.config.tooltip,this.prop={timeout:null},this.create()}u.prototype=Object.create(s.prototype),u.prototype.constructor=u,u.className="psv-tooltip",u.publicMethods=["showTooltip","hideTooltip","isTooltipVisible"],u.leftMap={0:"left",.5:"center",1:"right"},u.topMap={0:"top",.5:"center",1:"bottom"},u.prototype.create=function(){s.prototype.create.call(this),this.container.innerHTML='<div class="psv-tooltip-arrow"></div><div class="psv-tooltip-content"></div>',this.container.style.top="-1000px",this.container.style.left="-1000px",this.content=this.container.querySelector(".psv-tooltip-content"),this.arrow=this.container.querySelector(".psv-tooltip-arrow"),this.psv.on("render",this)},u.prototype.destroy=function(){this.psv.off("render",this),delete this.config,delete this.prop,s.prototype.destroy.call(this)},u.prototype.handleEvent=function(t){switch(t.type){case"render":this.hideTooltip()}},u.prototype.isTooltipVisible=function(){return this.container.classList.contains("psv-tooltip--visible")},u.prototype.showTooltip=function(t){this.prop.timeout&&(window.clearTimeout(this.prop.timeout),this.prop.timeout=null);var e=this.isTooltipVisible(),i=this.container,o=this.content,n=this.arrow;if(t.position||(t.position=["top","center"]),t.box||(t.box={width:0,height:0}),"string"==typeof t.position){var s=M.parsePosition(t.position);if(!(s.left in u.leftMap&&s.top in u.topMap))throw new b('unable to parse tooltip position "'+tooltip.position+'"');t.position=[u.topMap[s.top],u.leftMap[s.left]]}if("center"==t.position[0]&&"center"==t.position[1])throw new b('unable to parse tooltip position "center center"');if(e)for(var r=i.classList.length-1;r>=0;r--){var a=i.classList.item(r);"psv-tooltip"!=a&&"psv-tooltip--visible"!=a&&i.classList.remove(a)}else i.className="psv-tooltip";t.className&&M.addClasses(i,t.className),o.innerHTML=t.content,i.style.top="0px",i.style.left="0px";var h=i.getBoundingClientRect(),p={posClass:t.position.slice(),width:h.right-h.left,height:h.bottom-h.top,top:0,left:0,arrow_top:0,arrow_left:0};this._computeTooltipPosition(p,t);var c=!1;if(p.top<this.config.offset?(p.posClass[0]="bottom",c=!0):p.top+p.height>this.psv.prop.size.height-this.config.offset&&(p.posClass[0]="top",c=!0),p.left<this.config.offset?(p.posClass[1]="right",c=!0):p.left+p.width>this.psv.prop.size.width-this.config.offset&&(p.posClass[1]="left",c=!0),c&&this._computeTooltipPosition(p,t),i.style.top=p.top+"px",i.style.left=p.left+"px",n.style.top=p.arrow_top+"px",n.style.left=p.arrow_left+"px",i.classList.add("psv-tooltip--"+p.posClass.join("-")),!e){var l=this;this.prop.timeout=window.setTimeout(function(){i.classList.add("psv-tooltip--visible"),l.prop.timeout=null,l.psv.trigger("show-tooltip")},this.config.delay)}},u.prototype.hideTooltip=function(){if(this.prop.timeout&&(window.clearTimeout(this.prop.timeout),this.prop.timeout=null),this.isTooltipVisible()){this.container.classList.remove("psv-tooltip--visible");var t=this;this.prop.timeout=window.setTimeout(function(){t.content.innerHTML=null,t.container.style.top="-1000px",t.container.style.left="-1000px",t.prop.timeout=null},this.config.delay),this.psv.trigger("hide-tooltip")}},u.prototype._computeTooltipPosition=function(t,e){var i=!1;switch(t.posClass[0]){case"bottom":t.top=e.top+e.box.height+this.config.offset+this.config.arrow_size,t.arrow_top=2*-this.config.arrow_size,i=!0;break;case"center":t.top=e.top+e.box.height/2-t.height/2,t.arrow_top=t.height/2-this.config.arrow_size;break;case"top":t.top=e.top-t.height-this.config.offset-this.config.arrow_size,t.arrow_top=t.height,i=!0}switch(t.posClass[1]){case"right":i?(t.left=e.left+e.box.width/2-this.config.offset-this.config.arrow_size,t.arrow_left=this.config.offset):(t.left=e.left+e.box.width+this.config.offset+this.config.arrow_size,t.arrow_left=2*-this.config.arrow_size);break;case"center":t.left=e.left+e.box.width/2-t.width/2,t.arrow_left=t.width/2-this.config.arrow_size;break;case"left":i?(t.left=e.left-t.width+e.box.width/2+this.config.offset+this.config.arrow_size,t.arrow_left=t.width-this.config.offset-2*this.config.arrow_size):(t.left=e.left-t.width-this.config.offset-this.config.arrow_size,t.arrow_left=t.width)}};function d(t){s.call(this,t),this.id=void 0,this.constructor.id&&(this.id=this.constructor.id),this.enabled=!0}d.prototype=Object.create(s.prototype),d.prototype.constructor=d,d.id=null,d.icon=null,d.iconActive=null,d.prototype.create=function(){s.prototype.create.call(this),this.constructor.icon&&this._setIcon(this.constructor.icon),this.id&&this.psv.config.lang[this.id]&&(this.container.title=this.psv.config.lang[this.id]),this.container.addEventListener("click",function(t){this.enabled&&this._onClick(),t.stopPropagation()}.bind(this))},d.prototype.destroy=function(){s.prototype.destroy.call(this)},d.prototype.toggleActive=function(t){M.toggleClass(this.container,"psv-button--active",t),this.constructor.iconActive&&this._setIcon(t?this.constructor.iconActive:this.constructor.icon)},d.prototype.disable=function(){this.container.classList.add("psv-button--disabled"),this.enabled=!1},d.prototype.enable=function(){this.container.classList.remove("psv-button--disabled"),this.enabled=!0},d.prototype._setIcon=function(t,e){e||(e=this.container),t?(e.innerHTML=n.ICONS[t],e.querySelector("svg").setAttribute("class","psv-button-svg")):e.innerHTML=""},d.prototype._onClick=function(){};function g(t){d.call(this,t),this.create()}g.prototype=Object.create(d.prototype),g.prototype.constructor=g,g.id="autorotate",g.className="psv-button psv-button--hover-scale psv-autorotate-button",g.icon="play.svg",g.iconActive="play-active.svg",g.prototype.create=function(){d.prototype.create.call(this),this.psv.on("autorotate",this)},g.prototype.destroy=function(){this.psv.off("autorotate",this),d.prototype.destroy.call(this)},g.prototype.handleEvent=function(t){switch(t.type){case"autorotate":this.toggleActive(t.args[0])}},g.prototype._onClick=function(){this.psv.toggleAutorotate()};function f(t,e){d.call(this,t),this.config=e,this.config.id&&(this.id=this.config.id),this.create()}f.prototype=Object.create(d.prototype),f.prototype.constructor=f,f.className="psv-button psv-custom-button",f.prototype.create=function(){d.prototype.create.call(this),this.config.className&&M.addClasses(this.container,this.config.className),this.config.title&&(this.container.title=this.config.title),this.config.content&&(this.container.innerHTML=this.config.content),!1!==this.config.enabled&&!0!==this.config.disabled||this.disable(),!1!==this.config.visible&&!0!==this.config.hidden||this.hide()},f.prototype.destroy=function(){delete this.config,d.prototype.destroy.call(this)},f.prototype._onClick=function(){this.config.onClick&&this.config.onClick.apply(this.psv)};function m(t){d.call(this,t),this.create()}m.prototype=Object.create(d.prototype),m.prototype.constructor=m,m.id="download",m.className="psv-button psv-button--hover-scale psv-download-button",m.icon="download.svg",m.prototype._onClick=function(){var t=document.createElement("a");t.href=this.psv.config.panorama,t.download=this.psv.config.panorama,this.psv.container.appendChild(t),t.click()};function v(t){d.call(this,t),this.create()}v.prototype=Object.create(d.prototype),v.prototype.constructor=v,v.id="fullscreen",v.className="psv-button psv-button--hover-scale psv-fullscreen-button",v.icon="fullscreen-in.svg",v.iconActive="fullscreen-out.svg",v.prototype.create=function(){d.prototype.create.call(this),n.SYSTEM.fullscreenEvent||(this.hide(),console.warn("PhotoSphereViewer: fullscreen not supported.")),this.psv.on("fullscreen-updated",this)},v.prototype.destroy=function(){this.psv.off("fullscreen-updated",this),d.prototype.destroy.call(this)},v.prototype.handleEvent=function(t){switch(t.type){case"fullscreen-updated":this.toggleActive(t.args[0])}},v.prototype._onClick=function(){this.psv.toggleFullscreen()};function y(t){d.call(this,t),this.create()}y.prototype=Object.create(d.prototype),y.prototype.constructor=y,y.id="gyroscope",y.className="psv-button psv-button--hover-scale psv-gyroscope-button",y.icon="compass.svg",y.prototype.create=function(){d.prototype.create.call(this),n.SYSTEM.deviceOrientationSupported.promise.then(this._onAvailabilityChange.bind(this,!0),this._onAvailabilityChange.bind(this,!1)),this.hide(),this.psv.on("gyroscope-updated",this)},y.prototype.destroy=function(){this.psv.off("gyroscope-updated",this),d.prototype.destroy.call(this)},y.prototype.handleEvent=function(t){switch(t.type){case"gyroscope-updated":this.toggleActive(t.args[0])}},y.prototype._onClick=function(){this.psv.toggleGyroscopeControl()},y.prototype._onAvailabilityChange=function(t){if(t){if(!M.checkTHREE("DeviceOrientationControls"))throw new b("Missing Three.js components: DeviceOrientationControls. Get them from three.js-examples package.");this.show()}};function _(t){d.call(this,t),this.create()}_.prototype=Object.create(d.prototype),_.prototype.constructor=_,_.id="markers",_.className="psv-button psv-button--hover-scale psv-markers-button",_.icon="pin.svg",_.prototype._onClick=function(){this.psv.hud.toggleMarkersList()};function w(t){d.call(this,t),this.zoom_range=null,this.zoom_value=null,this.prop={mousedown:!1,buttondown:!1,longPressInterval:null,longPressTimeout:null},this.create()}w.prototype=Object.create(d.prototype),w.prototype.constructor=w,w.id="zoom",w.className="psv-button psv-zoom-button",w.prototype.create=function(){d.prototype.create.call(this);var t=document.createElement("div");t.className="psv-zoom-button-minus",t.title=this.psv.config.lang.zoomOut,this._setIcon("zoom-out.svg",t),this.container.appendChild(t);var e=document.createElement("div");e.className="psv-zoom-button-range",this.container.appendChild(e),this.zoom_range=document.createElement("div"),this.zoom_range.className="psv-zoom-button-line",e.appendChild(this.zoom_range),this.zoom_value=document.createElement("div"),this.zoom_value.className="psv-zoom-button-handle",this.zoom_range.appendChild(this.zoom_value);var i=document.createElement("div");i.className="psv-zoom-button-plus",i.title=this.psv.config.lang.zoomIn,this._setIcon("zoom-in.svg",i),this.container.appendChild(i),this.zoom_range.addEventListener("mousedown",this),this.zoom_range.addEventListener("touchstart",this),this.psv.container.addEventListener("mousemove",this),this.psv.container.addEventListener("touchmove",this),this.psv.container.addEventListener("mouseup",this),this.psv.container.addEventListener("touchend",this),t.addEventListener("mousedown",this._zoomOut.bind(this)),i.addEventListener("mousedown",this._zoomIn.bind(this)),this.psv.on("zoom-updated",this),this.psv.once("ready",function(){this._moveZoomValue(this.psv.prop.zoom_lvl)}.bind(this))},w.prototype.destroy=function(){this._stopZoomChange(),this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),delete this.zoom_range,delete this.zoom_value,this.psv.off("zoom-updated",this),d.prototype.destroy.call(this)},w.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._initZoomChangeWithMouse(t);break;case"touchstart":this._initZoomChangeByTouch(t);break;case"mousemove":this._changeZoomWithMouse(t);break;case"touchmove":this._changeZoomByTouch(t);break;case"mouseup":case"touchend":this._stopZoomChange(t);break;case"zoom-updated":this._moveZoomValue(t.args[0])}},w.prototype._moveZoomValue=function(t){this.zoom_value.style.left=t/100*this.zoom_range.offsetWidth-this.zoom_value.offsetWidth/2+"px"},w.prototype._initZoomChangeWithMouse=function(t){this.enabled&&(this.prop.mousedown=!0,this._changeZoom(t.clientX))},w.prototype._initZoomChangeByTouch=function(t){this.enabled&&(this.prop.mousedown=!0,this._changeZoom(t.changedTouches[0].clientX))},w.prototype._zoomIn=function(){this.enabled&&(this.prop.buttondown=!0,this.psv.zoomIn(),this.prop.longPressTimeout=window.setTimeout(this._startLongPressInterval.bind(this,1),200))},w.prototype._zoomOut=function(){this.enabled&&(this.prop.buttondown=!0,this.psv.zoomOut(),this.prop.longPressTimeout=window.setTimeout(this._startLongPressInterval.bind(this,-1),200))},w.prototype._startLongPressInterval=function(t){this.prop.buttondown&&(this.prop.longPressInterval=window.setInterval(function(){this.psv.zoom(this.psv.prop.zoom_lvl+t)}.bind(this),50))},w.prototype._stopZoomChange=function(){this.enabled&&(window.clearInterval(this.prop.longPressInterval),window.clearTimeout(this.prop.longPressTimeout),this.prop.longPressInterval=null,this.prop.mousedown=!1,this.prop.buttondown=!1)},w.prototype._changeZoomWithMouse=function(t){this.enabled&&(t.preventDefault(),this._changeZoom(t.clientX))},w.prototype._changeZoomByTouch=function(t){this.enabled&&(t.preventDefault(),this._changeZoom(t.changedTouches[0].clientX))},w.prototype._changeZoom=function(t){if(this.prop.mousedown){var e=(parseInt(t)-this.zoom_range.getBoundingClientRect().left)/this.zoom_range.offsetWidth*100;this.psv.zoom(e)}};function b(t){this.message=t,"captureStackTrace"in Error?Error.captureStackTrace(this,b):this.stack=(new Error).stack}b.prototype=Object.create(Error.prototype),b.prototype.name="PSVError",b.prototype.constructor=b,n.Error=b;function x(t,e){if(!t.id)throw new b("missing marker id");if(t.image&&(!t.width||!t.height))throw new b("missing marker width/height");if((t.image||t.html)&&!(t.hasOwnProperty("x")&&t.hasOwnProperty("y")||t.hasOwnProperty("latitude")&&t.hasOwnProperty("longitude")))throw new b("missing marker position, latitude/longitude or x/y");this.psv=e,this.visible=!0,this._dynamicSize=!1;var i,o=t.id,n=x.getType(t,!1);Object.defineProperties(this,{id:{configurable:!1,enumerable:!0,get:function(){return o},set:function(t){}},type:{configurable:!1,enumerable:!0,get:function(){return n},set:function(t){}},$el:{configurable:!1,enumerable:!0,get:function(){return i},set:function(t){}},_def:{configurable:!1,enumerable:!0,get:function(){return this[n]},set:function(t){this[n]=t}}}),(i=this.isNormal()?document.createElement("div"):this.isPolygon()?document.createElementNS(M.svgNS,"polygon"):this.isPolyline()?document.createElementNS(M.svgNS,"polyline"):document.createElementNS(M.svgNS,this.type)).id="psv-marker-"+this.id,i.psvMarker=this,this.update(t)}x.types=["image","html","polygon_px","polygon_rad","polyline_px","polyline_rad","rect","circle","ellipse","path"],x.getType=function(t,e){var i=[];if(x.types.forEach(function(e){t[e]&&i.push(e)}),0===i.length&&!e)throw new b("missing marker content, either "+x.types.join(", "));if(i.length>1)throw new b("multiple marker content, either "+x.types.join(", "));return i[0]},x.prototype.destroy=function(){delete this.$el.psvMarker},x.prototype.isNormal=function(){return"image"==this.type||"html"==this.type},x.prototype.isPoly=function(){return this.isPolygon()||this.isPolyline()},x.prototype.isPolygon=function(){return"polygon_px"==this.type||"polygon_rad"==this.type},x.prototype.isPolyline=function(){return"polyline_px"==this.type||"polyline_rad"==this.type},x.prototype.isSvg=function(){return"rect"==this.type||"circle"==this.type||"ellipse"==this.type||"path"==this.type},x.prototype.getScale=function(t){return Array.isArray(this.scale)?this.scale[0]+(this.scale[1]-this.scale[0])*M.animation.easings.inQuad(t/100):"function"==typeof this.scale?this.scale(t):"number"==typeof this.scale?this.scale*M.animation.easings.inQuad(t/100):1},x.prototype.update=function(t){if(t&&t!==this){var e=x.getType(t,!0);if(void 0!==e&&e!==this.type)throw new b("cannot change marker type");M.deepmerge(this,t)}this.isNormal()?this.$el.setAttribute("class","psv-marker psv-marker--normal"):this.$el.setAttribute("class","psv-marker psv-marker--svg"),this.className&&M.addClasses(this.$el,this.className),this.tooltip&&(M.addClasses(this.$el,"has-tooltip"),"string"==typeof this.tooltip&&(this.tooltip={content:this.tooltip})),this.style&&M.deepmerge(this.$el.style,this.style),this.anchor=M.parsePosition(this.anchor),this.isNormal()?this._updateNormal():this.isPolygon()?this._updatePoly("polygon_rad","polygon_px"):this.isPolyline()?this._updatePoly("polyline_rad","polyline_px"):this._updateSvg()},x.prototype._updateNormal=function(){this.width&&this.height?(this.$el.style.width=this.width+"px",this.$el.style.height=this.height+"px",this._dynamicSize=!1):this._dynamicSize=!0,this.image?this.$el.style.backgroundImage="url("+this.image+")":this.$el.innerHTML=this.html,this.$el.style.transformOrigin=100*this.anchor.left+"% "+100*this.anchor.top+"%",this.psv.cleanPosition(this),this.position3D=this.psv.sphericalCoordsToVector3(this)},x.prototype._updateSvg=function(){switch(this._dynamicSize=!0,this.type){case"rect":"number"==typeof this._def?this._def={x:0,y:0,width:this._def,height:this._def}:Array.isArray(this._def)?this._def={x:0,y:0,width:this._def[0],height:this._def[1]}:this._def.x=this._def.y=0;break;case"circle":"number"==typeof this._def?this._def={cx:this._def,cy:this._def,r:this._def}:Array.isArray(this._def)?this._def={cx:this._def[0],cy:this._def[0],r:this._def[0]}:this._def.cx=this._def.cy=this._def.r;break;case"ellipse":"number"==typeof this._def?this._def={cx:this._def,cy:this._def,rx:this._def,ry:this._def}:Array.isArray(this._def)?this._def={cx:this._def[0],cy:this._def[1],rx:this._def[0],ry:this._def[1]}:(this._def.cx=this._def.rx,this._def.cy=this._def.ry);break;case"path":"string"==typeof this._def&&(this._def={d:this._def})}Object.getOwnPropertyNames(this._def).forEach(function(t){this.$el.setAttributeNS(null,t,this._def[t])},this),this.svgStyle?Object.getOwnPropertyNames(this.svgStyle).forEach(function(t){this.$el.setAttributeNS(null,t,this.svgStyle[t])},this):this.$el.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"),this.psv.cleanPosition(this),this.position3D=this.psv.sphericalCoordsToVector3(this)},x.prototype._updatePoly=function(t,e){this._dynamicSize=!0,this.svgStyle?(Object.getOwnPropertyNames(this.svgStyle).forEach(function(t){this.$el.setAttributeNS(null,t,this.svgStyle[t])},this),this.isPolyline()&&!this.svgStyle.fill&&this.$el.setAttributeNS(null,"fill","none")):this.isPolygon()?this.$el.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"):this.isPolyline()&&(this.$el.setAttributeNS(null,"fill","none"),this.$el.setAttributeNS(null,"stroke","rgb(0,0,0)")),[this[t],this[e]].forEach(function(t){if(t&&"object"!=typeof t[0])for(var e=0;e<t.length;e++)t.splice(e,2,[t[e],t[e+1]])}),this[e]?this[t]=this[e].map(function(t){var e=this.psv.textureCoordsToSphericalCoords({x:t[0],y:t[1]});return[e.longitude,e.latitude]},this):this[t]=this[t].map(function(t){return[M.parseAngle(t[0]),M.parseAngle(t[1],!0)]}),this.longitude=this[t][0][0],this.latitude=this[t][0][1],this.positions3D=this[t].map(function(t){return this.psv.sphericalCoordsToVector3({longitude:t[0],latitude:t[1]})},this)};var M={};return n.Utils=M,M.TwoPI=2*Math.PI,M.HalfPI=Math.PI/2,M.svgNS="http://www.w3.org/2000/svg",M.checkTHREE=function(e){for(var i=0,o=arguments.length;i<o;i++)if(!(arguments[i]in t))return!1;return!0},M.isCanvasSupported=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},M.getWebGLCtx=function(){var t=document.createElement("canvas"),e=null;return t.getContext&&["webgl","experimental-webgl","moz-webgl","webkit-3d"].some(function(i){try{return(e=t.getContext(i))&&"function"==typeof e.getParameter}catch(t){return!1}})?e:null},M.isWebGLSupported=function(){return!!window.WebGLRenderingContext&&null!==M.getWebGLCtx()},M.getMaxTextureWidth=function(){var t=M.getWebGLCtx();if(null!==t)return t.getParameter(t.MAX_TEXTURE_SIZE)},M.toggleClass=function(t,e,i){if(t.classList)void 0===i?t.classList.toggle(e):i&&!t.classList.contains(e)?t.classList.add(e):i||t.classList.remove(e);else{var o=t.getAttribute("class")||"",n=-1!==o.indexOf(e),s=new RegExp("(?:^|\\s)"+e+"(?:\\s|$)");void 0!==i&&!i||n?i||(o=o.replace(s," ")):o+=o.length>0?" "+e:e,t.setAttribute("class",o)}},M.addClasses=function(t,e){e&&e.split(" ").forEach(function(e){M.toggleClass(t,e,!0)})},M.removeClasses=function(t,e){e&&e.split(" ").forEach(function(e){M.toggleClass(t,e,!1)})},M.hasParent=function(t,e){do{if(t===e)return!0}while(t=t.parentNode);return!1},M.getClosest=function(t,e){var i=t.matches||t.msMatchesSelector;do{if(i.bind(t)(e))return t}while(t=t.parentElement);return null},M.mouseWheelEvent=function(){return"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"},M.fullscreenEvent=function(){var t={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"};for(var e in t)if(e in document)return t[e]},M.bound=function(t,e,i){return Math.max(e,Math.min(i,t))},M.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},M.sum=function(t){return t.reduce(function(t,e){return t+e},0)},M.getXMPValue=function(t,e){var i;return null!==(i=t.match("<GPano:"+e+">(.*)</GPano:"+e+">"))?i[1]:null!==(i=t.match("GPano:"+e+'="(.*?)"'))?i[1]:null},M.isFullscreenEnabled=function(t){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===t},M.requestFullscreen=function(t){(t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullscreen||t.msRequestFullscreen).call(t)},M.exitFullscreen=function(){(document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)},M.getStyle=function(t,e){return window.getComputedStyle(t,null)[e]},M.getShortestArc=function(t,e){return[0,M.TwoPI,-M.TwoPI].reduce(function(i,o){return o=e-t+o,Math.abs(o)<Math.abs(i)?o:i},1/0)},M.parsePosition=function(t){if(!t)return{top:.5,left:.5};if("object"==typeof t)return t;var e=t.toLocaleLowerCase().split(" ").slice(0,2);1===e.length&&(e=void 0!==M.parsePosition.positions[e[0]]?[e[0],"center"]:[e[0],e[0]]);var i="left"!=e[1]&&"right"!=e[1]&&"top"!=e[0]&&"bottom"!=e[0];e=e.map(function(t){return M.parsePosition.positions[t]||t}),i||e.reverse();var o=e.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return o?{left:o[1]/100,top:o[2]/100}:{top:.5,left:.5}},M.parsePosition.positions={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},M.parseSpeed=function(e){if("string"==typeof e){e=e.toString().trim();var i=parseFloat(e.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),o=e.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(o.match(/(pm|per minute)$/)&&(i/=60),o){case"dpm":case"degrees per minute":case"dps":case"degrees per second":e=t.Math.degToRad(i);break;case"radians per minute":case"radians per second":e=i;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":e=i*M.TwoPI;break;default:throw new b('unknown speed unit "'+o+'"')}}return e},M.parseAngle=function(e,i){if("string"==typeof e){var o=e.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!o)throw new b('unknown angle "'+e+'"');var n=parseFloat(o[1]),s=o[2];if(s)switch(s){case"deg":case"degs":e=t.Math.degToRad(n);break;case"rad":case"rads":e=n;break;default:throw new b('unknown angle unit "'+s+'"')}else e=n}return(e=(i?e+Math.PI:e)%M.TwoPI)<0&&(e=M.TwoPI+e),i?M.bound(e-Math.PI,-M.HalfPI,M.HalfPI):e},M.cleanTHREEScene=function(e){e.children.forEach(function(e){e instanceof t.Mesh&&(e.geometry&&(e.geometry.dispose(),e.geometry=null),e.material&&(e.material.materials?(e.material.materials.forEach(function(t){t.map&&(t.map.dispose(),t.map=null),t.dispose()}),e.material.materials.length=0):(e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose()),e.material=null))}),e.children.length=0},M.animation=function(t){var i=e(!1),o=null;t.easing&&"string"!=typeof t.easing||(t.easing=M.animation.easings[t.easing||"linear"]);function n(e){if(-1!==i.promise.getStatus()){null===o&&(o=e);var s,r=(e-o)/t.duration,a={};if(r<1){for(s in t.properties)a[s]=t.properties[s].start+(t.properties[s].end-t.properties[s].start)*t.easing(r);t.onTick(a,r),window.requestAnimationFrame(n)}else{for(s in t.properties)a[s]=t.properties[s].end;t.onTick(a,1),window.requestAnimationFrame(function(){i.resolve()})}}}void 0!==t.delay?window.setTimeout(function(){window.requestAnimationFrame(n)},t.delay):window.requestAnimationFrame(n);var s=i.promise;return s.cancel=function(){i.reject()},s},M.animation.easings={linear:function(t){return t},inQuad:function(t){return t*t},outQuad:function(t){return t*(2-t)},inOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},inCubic:function(t){return t*t*t},outCubic:function(t){return--t*t*t+1},inOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},inQuart:function(t){return t*t*t*t},outQuart:function(t){return 1- --t*t*t*t},inOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},inQuint:function(t){return t*t*t*t*t},outQuint:function(t){return 1+--t*t*t*t*t},inOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},inSine:function(t){return 1-Math.cos(t*(Math.PI/2))},outSine:function(t){return Math.sin(t*(Math.PI/2))},inOutSine:function(t){return.5-.5*Math.cos(Math.PI*t)},inExpo:function(t){return Math.pow(2,10*(t-1))},outExpo:function(t){return 1-Math.pow(2,-10*t)},inOutExpo:function(t){return(t=2*t-1)<0?.5*Math.pow(2,10*t):1-.5*Math.pow(2,-10*t)},inCirc:function(t){return 1-Math.sqrt(1-t*t)},outCirc:function(t){return t--,Math.sqrt(1-t*t)},inOutCirc:function(t){return(t*=2)<1?.5-.5*Math.sqrt(1-t*t):.5+.5*Math.sqrt(1-(t-=2)*t)}},M.throttle=function(t,e){var i,o,n,s=null,r=0,a=function(){r=Date.now(),s=null,n=t.apply(i,o),s||(i=o=null)};return function(){var h=Date.now();r||(r=h);var p=e-(h-r);return i=this,o=arguments,p<=0||p>e?(s&&(clearTimeout(s),s=null),r=h,n=t.apply(i,o),s||(i=o=null)):s||(s=setTimeout(a,p)),n}},M.isPlainObject=function(t){if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"==Object.prototype.toString.call(t)}return!1},M.deepmerge=function(t,e){var i=e;return function t(e,o){return Array.isArray(o)?(e&&Array.isArray(e)?e.length=0:e=[],o.forEach(function(i,o){e[o]=t(null,i)})):"object"==typeof o?(e&&!Array.isArray(e)||(e={}),Object.keys(o).forEach(function(n){"object"==typeof o[n]&&o[n]&&M.isPlainObject(o[n])?o[n]!=i&&(e[n]?t(e[n],o[n]):e[n]=t(null,o[n])):e[n]=o[n]})):e=o,e}(t,e)},M.clone=function(t){return M.deepmerge(null,t)},M.normalizeWheel=function(t){var e=0,i=0,o=0,n=0;return"detail"in t&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=i,i=0),o=10*e,n=10*i,"deltaY"in t&&(n=t.deltaY),"deltaX"in t&&(o=t.deltaX),(o||n)&&t.deltaMode&&(1==t.deltaMode?(o*=40,n*=40):(o*=800,n*=800)),o&&!e&&(e=o<1?-1:1),n&&!i&&(i=n<1?-1:1),{spinX:e,spinY:i,pixelX:o,pixelY:n}},function(t){if(t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame,t.cancelAnimationFrame=t.cancelAnimationFrame||t.mozCancelAnimationFrame||t.webkitCancelAnimationFrame||t.msCancelAnimationFrame,!t.requestAnimationFrame){var e,i=[],o=[],n=0;t.requestAnimationFrame=function(t){return i.push([++n,t]),e||(e=setInterval(function(){if(i.length){var t=+new Date,n=o;for(o=i,i=n;o.length;)o.shift()[1](t)}else clearInterval(e),e=void 0},20)),n},t.cancelAnimationFrame=function(t){var e,n;for(e=0,n=i.length;e<n;e+=1)if(i[e][0]===t)return void i.splice(e,1);for(e=0,n=o.length;e<n;e+=1)if(o[e][0]===t)return void o.splice(e,1)}}}(window),n.ICONS["compass.svg"]='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path d="M49.997,0C22.38,0.004,0.005,22.383,0,50.002C0.005,77.614,22.38,99.995,49.997,100C77.613,99.995,99.996,77.614,100,50.002C99.996,22.383,77.613,0.004,49.997,0z M49.997,88.81c-21.429-0.04-38.772-17.378-38.809-38.807c0.037-21.437,17.381-38.775,38.809-38.812C71.43,11.227,88.769,28.567,88.81,50.002C88.769,71.432,71.43,88.77,49.997,88.81z"/><path d="M72.073,25.891L40.25,41.071l-0.003-0.004l-0.003,0.009L27.925,74.109l31.82-15.182l0.004,0.004l0.002-0.007l-0.002-0.004L72.073,25.891z M57.837,54.411L44.912,42.579l21.092-10.062L57.837,54.411z"/>\x3c!--Created by iconoci from the Noun Project--\x3e</svg>',n.ICONS["download.svg"]='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path d="M83.285,35.575H66.271L66.277,3H32.151v32.575H16.561l33.648,32.701L83.285,35.575z"/><path d="M83.316,64.199v16.32H16.592v-16.32H-0.094v32.639H100V64.199H83.316z"/>\x3c!--Created by Michael Zenaty from the Noun Project--\x3e</svg>',n.ICONS["fullscreen-in.svg"]='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><polygon points="100,39.925 87.105,39.925 87.105,18.895 66.075,18.895 66.075,6 100,6"/><polygon points="100,93.221 66.075,93.221 66.075,80.326 87.105,80.326 87.105,59.295 100,59.295"/><polygon points="33.925,93.221 0,93.221 0,59.295 12.895,59.295 12.895,80.326 33.925,80.326"/><polygon points="12.895,39.925 0,39.925 0,6 33.925,6 33.925,18.895 12.895,18.895"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>',n.ICONS["fullscreen-out.svg"]='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><polygon points="66.075,7 78.969,7 78.969,28.031 100,28.031 100,40.925 66.075,40.925"/><polygon points="66.075,60.295 100,60.295 100,73.19 78.969,73.19 78.969,94.221 66.075,94.221"/><polygon points="0,60.295 33.925,60.295 33.925,94.221 21.031,94.221 21.031,73.19 0,73.19"/><polygon points="21.031,7 33.925,7 33.925,40.925 0,40.925 0,28.031 21.031,28.031"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>',n.ICONS["pin.svg"]='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 48 48" enable-background="new 0 0 48 48" xml:space="preserve"><path d="M24,0C13.798,0,5.499,8.3,5.499,18.501c0,10.065,17.57,28.635,18.318,29.421C23.865,47.972,23.931,48,24,48s0.135-0.028,0.183-0.078c0.748-0.786,18.318-19.355,18.318-29.421C42.501,8.3,34.202,0,24,0z M24,7.139c5.703,0,10.342,4.64,10.342,10.343c0,5.702-4.639,10.342-10.342,10.342c-5.702,0-10.34-4.64-10.34-10.342C13.66,11.778,18.298,7.139,24,7.139z"/>\x3c!--Created by Daniele Marucci from the Noun Project--\x3e</svg>',n.ICONS["play-active.svg"]='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 41 41" enable-background="new 0 0 41 41" xml:space="preserve"><path d="M40.5,14.1c-0.1-0.1-1.2-0.5-2.898-1C37.5,13.1,37.4,13,37.4,12.9C34.5,6.5,28,2,20.5,2S6.6,6.5,3.7,12.9c0,0.1-0.1,0.1-0.2,0.2c-1.7,0.6-2.8,1-2.9,1L0,14.4v12.1l0.6,0.2c0.1,0,1.1,0.399,2.7,0.899c0.1,0,0.2,0.101,0.2,0.199C6.3,34.4,12.9,39,20.5,39c7.602,0,14.102-4.6,16.9-11.1c0-0.102,0.1-0.102,0.199-0.2c1.699-0.601,2.699-1,2.801-1l0.6-0.3V14.3L40.5,14.1z M6.701,11.5C9.7,7,14.8,4,20.5,4c5.8,0,10.9,3,13.8,7.5c0.2,0.3-0.1,0.6-0.399,0.5c-3.799-1-8.799-2-13.6-2c-4.7,0-9.5,1-13.2,2C6.801,12.1,6.601,11.8,6.701,11.5z M25.1,20.3L18.7,24c-0.3,0.2-0.7,0-0.7-0.5v-7.4c0-0.4,0.4-0.6,0.7-0.4 l6.399,3.8C25.4,19.6,25.4,20.1,25.1,20.3z M34.5,29.201C31.602,33.9,26.4,37,20.5,37c-5.9,0-11.1-3.1-14-7.898c-0.2-0.302,0.1-0.602,0.4-0.5c3.9,1,8.9,2.1,13.6,2.1c5,0,9.9-1,13.602-2C34.4,28.602,34.602,28.9,34.5,29.201z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>',n.ICONS["play.svg"]='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 41 41" enable-background="new 0 0 41 41" xml:space="preserve"><path d="M40.5,14.1c-0.1-0.1-1.2-0.5-2.899-1c-0.101,0-0.2-0.1-0.2-0.2C34.5,6.5,28,2,20.5,2S6.6,6.5,3.7,12.9c0,0.1-0.1,0.1-0.2,0.2c-1.7,0.6-2.8,1-2.9,1L0,14.4v12.1l0.6,0.2c0.1,0,1.1,0.4,2.7,0.9c0.1,0,0.2,0.1,0.2,0.199C6.3,34.4,12.9,39,20.5,39c7.601,0,14.101-4.6,16.9-11.1c0-0.101,0.1-0.101,0.2-0.2c1.699-0.6,2.699-1,2.8-1l0.6-0.3V14.3L40.5,14.1zM20.5,4c5.8,0,10.9,3,13.8,7.5c0.2,0.3-0.1,0.6-0.399,0.5c-3.8-1-8.8-2-13.6-2c-4.7,0-9.5,1-13.2,2c-0.3,0.1-0.5-0.2-0.4-0.5C9.7,7,14.8,4,20.5,4z M20.5,37c-5.9,0-11.1-3.1-14-7.899c-0.2-0.301,0.1-0.601,0.4-0.5c3.9,1,8.9,2.1,13.6,2.1c5,0,9.9-1,13.601-2c0.3-0.1,0.5,0.2,0.399,0.5C31.601,33.9,26.4,37,20.5,37z M39.101,24.9c0,0.1-0.101,0.3-0.2,0.3c-2.5,0.9-10.4,3.6-18.4,3.6c-7.1,0-15.6-2.699-18.3-3.6C2.1,25.2,2,25,2,24.9V16c0-0.1,0.1-0.3,0.2-0.3c2.6-0.9,10.6-3.6,18.2-3.6c7.5,0,15.899,2.7,18.5,3.6c0.1,0,0.2,0.2,0.2,0.3V24.9z"/><path d="M18.7,24l6.4-3.7c0.3-0.2,0.3-0.7,0-0.8l-6.4-3.8c-0.3-0.2-0.7,0-0.7,0.4v7.4C18,24,18.4,24.2,18.7,24z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>',n.ICONS["zoom-in.svg"]='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve"><path d="M14.043,12.22c2.476-3.483,1.659-8.313-1.823-10.789C8.736-1.044,3.907-0.228,1.431,3.255c-2.475,3.482-1.66,8.312,1.824,10.787c2.684,1.908,6.281,1.908,8.965,0l4.985,4.985c0.503,0.504,1.32,0.504,1.822,0c0.505-0.503,0.505-1.319,0-1.822L14.043,12.22z M7.738,13.263c-3.053,0-5.527-2.475-5.527-5.525c0-3.053,2.475-5.527,5.527-5.527c3.05,0,5.524,2.474,5.524,5.527C13.262,10.789,10.788,13.263,7.738,13.263z"/><polygon points="8.728,4.009 6.744,4.009 6.744,6.746 4.006,6.746 4.006,8.73 6.744,8.73 6.744,11.466 8.728,11.466 8.728,8.73 11.465,8.73 11.465,6.746 8.728,6.746"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>',n.ICONS["zoom-out.svg"]='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve"><path d="M14.043,12.22c2.476-3.483,1.659-8.313-1.823-10.789C8.736-1.044,3.907-0.228,1.431,3.255c-2.475,3.482-1.66,8.312,1.824,10.787c2.684,1.908,6.281,1.908,8.965,0l4.985,4.985c0.503,0.504,1.32,0.504,1.822,0c0.505-0.503,0.505-1.319,0-1.822L14.043,12.22z M7.738,13.263c-3.053,0-5.527-2.475-5.527-5.525c0-3.053,2.475-5.527,5.527-5.527c3.05,0,5.524,2.474,5.524,5.527C13.262,10.789,10.788,13.263,7.738,13.263z"/><rect x="4.006" y="6.746" width="7.459" height="1.984"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>',n});