8 lines
79 KiB
JavaScript
8 lines
79 KiB
JavaScript
/**
|
|
* Minified by jsDelivr using Terser v3.14.1.
|
|
* Original file: /npm/photo-sphere-viewer@4.0.7/dist/photo-sphere-viewer.js
|
|
*
|
|
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
*/
|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three"),require("uevent")):"function"==typeof define&&define.amd?define(["exports","three","uevent"],e):e((t=t||self).PhotoSphereViewer={},t.THREE,t.uEvent)}(this,function(t,e,o){"use strict";var i=[0,2,4,5,3,1],n=["left","right","top","bottom","back","front"],r="photoSphereViewer",s={ROTATE_LAT_UP:"rotateLatitudeUp",ROTATE_LAT_DOWN:"rotateLatitudeDown",ROTATE_LONG_RIGHT:"rotateLongitudeRight",ROTATE_LONG_LEFT:"rotateLongitudeLeft",ZOOM_IN:"zoomIn",ZOOM_OUT:"zoomOut",TOGGLE_AUTOROTATE:"toggleAutorotate"},a={AUTOROTATE:"autorotate",BEFORE_RENDER:"before-render",BEFORE_ROTATE:"before-rotate",CLICK:"click",CLOSE_PANEL:"close-panel",CONFIG_CHANGED:"config-changed",DOUBLE_CLICK:"dblclick",FULLSCREEN_UPDATED:"fullscreen-updated",HIDE_NOTIFICATION:"hide-notification",HIDE_OVERLAY:"hide-overlay",HIDE_TOOLTIP:"hide-tooltip",OPEN_PANEL:"open-panel",PANORAMA_LOADED:"panorama-loaded",POSITION_UPDATED:"position-updated",READY:"ready",RENDER:"render",SHOW_NOTIFICATION:"show-notification",SHOW_OVERLAY:"show-overlay",SHOW_TOOLTIP:"show-tooltip",SIZE_UPDATED:"size-updated",STOP_ALL:"stop-all",ZOOM_UPDATED:"zoom-updated"},c={GET_ANIMATE_POSITION:"get-animate-position",GET_ROTATE_POSITION:"get-rotate-position"},h={MENU:"menu",TWO_FINGERS:"twoFingers",ERROR:"error"},p={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 Math.sqrt(1-(t-1)*(t-1))},inOutCirc:function(t){return(t*=2)<1?.5-.5*Math.sqrt(1-t*t):.5+.5*Math.sqrt(1-(t-=2)*t)}},l=Object.freeze({__proto__:null,MOVE_THRESHOLD:4,DBLCLICK_DELAY:300,LONGTOUCH_DELAY:500,TWOFINGERSOVERLAY_DELAY:100,INERTIA_WINDOW:300,SPHERE_RADIUS:100,SPHERE_VERTICES:64,CUBE_VERTICES:8,CUBE_MAP:i,CUBE_HASHMAP:n,BUTTON_DATA:"psvButton",VIEWER_DATA:r,ACTIONS:s,EVENTS:a,CHANGE_EVENTS:c,IDS:h,EASINGS:p});function u(t,e,o){if(t.classList)void 0===o?t.classList.toggle(e):o&&!t.classList.contains(e)?t.classList.add(e):o||t.classList.remove(e);else{var i=t.getAttribute("class")||"",n=-1!==i.indexOf(e),r=new RegExp("(?:^|\\s)"+e+"(?:\\s|$)");void 0!==o&&!o||n?o||(i=i.replace(r," ")):i+=i.length>0?" "+e:e,t.setAttribute("class",i)}}function d(t,e){e&&e.split(" ").forEach(function(e){u(t,e,!0)})}function v(t,e){var o=t.matches||t.msMatchesSelector,i=t;if(!o)return null;do{if(o.bind(i)(e))return i;i=i instanceof SVGElement?i.parentNode:i.parentElement}while(i);return null}var f={13:"Enter",27:"Escape",32:" ",33:"PageUp",34:"PageDown",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",46:"Delete",107:"+",109:"-"},m={Add:"+",Del:"Delete",Down:"ArrowDown",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Spacebar:" ",Subtract:"-",Up:"ArrowUp"};function g(t){var e=t.key||f[t.keyCode||t.which];return e&&m[e]&&(e=m[e]),e}function w(t){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===t}function _(t){(t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullscreen||t.msRequestFullscreen).call(t)}function b(){(document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)}function E(t,e){return window.getComputedStyle(t,null)[e]}function y(t){var e=0,o=0,i=0,n=0;return"detail"in t&&(o=t.detail),"wheelDelta"in t&&(o=-t.wheelDelta/120),"wheelDeltaY"in t&&(o=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=o,o=0),i=10*e,n=10*o,"deltaY"in t&&(n=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||n)&&t.deltaMode&&(1===t.deltaMode?(i*=40,n*=40):(i*=800,n*=800)),i&&!e&&(e=i<1?-1:1),n&&!o&&(o=n<1?-1:1),{spinX:e,spinY:o,pixelX:i,pixelY:n}}function T(t,e,o){return Math.max(e,Math.min(o,t))}function x(t){return t.reduce(function(t,e){return t+e},0)}function L(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function M(t,e){return[0,2*Math.PI,2*-Math.PI].reduce(function(o,i){var n=e-t+i;return Math.abs(n)<Math.abs(o)?n:o},1/0)}function C(t,e){return Math.acos(Math.cos(t.latitude)*Math.cos(e.latitude)*Math.cos(t.longitude-e.longitude)+Math.sin(t.latitude)*Math.sin(e.latitude))}function O(t){return t.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,function(t,e){return(e>0?"-":"")+t.toLowerCase()})}function A(t,e){var o,i,n,r,s=0,a=function(){s=Date.now(),r=void 0,n=t.apply(o,i),r||(o=i=null)};return function(){var c=Date.now();s||(s=c);var h=e-(c-s);return o=this,i=arguments,h<=0||h>e?(r&&(clearTimeout(r),r=void 0),s=c,n=t.apply(o,i),r||(o=i=null)):r||(r=setTimeout(a,h)),n}}function P(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}function z(t,e){var o=e;return function t(e,i){return Array.isArray(i)?(e&&Array.isArray(e)?e.length=0:e=[],i.forEach(function(o,i){e[i]=t(null,o)})):"object"==typeof i?(e&&!Array.isArray(e)||(e={}),Object.keys(i).forEach(function(n){"object"==typeof i[n]&&i[n]&&P(i[n])?i[n]!=o&&(e[n]?t(e[n],i[n]):e[n]=t(null,i[n])):e[n]=i[n]})):e=i,e}(t,e)}function I(t){return z(null,t)}function R(t,e){Object.keys(t).forEach(function(o){e(t[o],o)})}function k(t){this.message=t,"captureStackTrace"in Error?Error.captureStackTrace(this,k):this.stack=(new Error).stack}function S(t){console.warn("PhotoSphereViewer: "+t)}function D(t,e){var o=t.match("<GPano:"+e+">(.*)</GPano:"+e+">");return null!==o?o[1]:null!==(o=t.match("GPano:"+e+'="(.*?)"'))?o[1]:null}k.prototype=Object.create(Error.prototype),k.prototype.name="PSVError",k.prototype.constructor=k;var H={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"};function N(t){if(!t)return{x:.5,y:.5};if("object"==typeof t)return t;var e=t.toLocaleLowerCase().split(" ").slice(0,2);1===e.length&&(e=void 0!==H[e[0]]?[e[0],"center"]:[e[0],e[0]]);var o="left"!==e[1]&&"right"!==e[1]&&"top"!==e[0]&&"bottom"!==e[0];e=e.map(function(t){return H[t]||t}),o||e.reverse();var i=e.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return i?{x:parseFloat(i[1])/100,y:parseFloat(i[2])/100}:{x:.5,y:.5}}function F(t){var o;if("string"==typeof t){var i=t.toString().trim(),n=parseFloat(i.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),r=i.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(r.match(/(pm|per minute)$/)&&(n/=60),r){case"dpm":case"degrees per minute":case"dps":case"degrees per second":o=e.Math.degToRad(n);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":o=n;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":o=n*Math.PI*2;break;default:throw new k('Unknown speed unit "'+r+'"')}}else o=t;return o}function U(t,o,i){var n;if(void 0===o&&(o=!1),void 0===i&&(i=o),"string"==typeof t){var r=t.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!r)throw new k('Unknown angle "'+t+'"');var s=parseFloat(r[1]),a=r[2];if(a)switch(a){case"deg":case"degs":n=e.Math.degToRad(s);break;case"rad":case"rads":n=s;break;default:throw new k('Unknown angle unit "'+a+'"')}else n=s}else{if("number"!=typeof t||Number.isNaN(t))throw new k('Unknown angle "'+t+'"');n=t}return(n=(o?n+Math.PI:n)%(2*Math.PI))<0&&(n+=2*Math.PI),o?T(n-Math.PI,-Math.PI/(i?2:1),Math.PI/(i?2:1)):n}var W=Object.freeze({__proto__:null,toggleClass:u,addClasses:d,removeClasses:function(t,e){e&&e.split(" ").forEach(function(e){u(t,e,!1)})},hasParent:function(t,e){var o=t;do{if(o===e)return!0;o=o.parentNode}while(o);return!1},getClosest:v,getEventKey:g,isFullscreenEnabled:w,requestFullscreen:_,exitFullscreen:b,getStyle:E,normalizeWheel:y,bound:T,isInteger:function(t){return Number.isInteger?Number.isInteger(t):"number"==typeof t&&Number.isFinite(t)&&Math.floor(t)===t},sum:x,distance:L,getShortestArc:M,getAngle:C,greatArcDistance:function(t,e){var o=t[0],i=t[1],n=e[0],r=e[1],s=(n-o)*Math.cos((i+r)/2),a=r-i;return Math.sqrt(s*s+a*a)},dasherize:O,throttle:A,isPlainObject:P,deepmerge:z,clone:I,isEmpty:function(t){return!t||0===Object.keys(t).length&&t.constructor===Object},each:R,intersect:function(t,e){return t.filter(function(t){return-1!==e.indexOf(t)})},logWarn:S,getXMPValue:D,parsePosition:N,parseSpeed:F,parseAngle:U}),V=function(){function t(t){var e=this;this.__cancelled=!1,this.__resolved=!1,this.__promise=new Promise(function(t,o){e.__resolve=t,e.__reject=o}),t&&(t.easing&&"string"!=typeof t.easing||(t.easing=p[t.easing||"linear"]),this.__start=null,this.options=t,t.delay?this.__delayTimeout=setTimeout(function(){e.__delayTimeout=null,window.requestAnimationFrame(function(t){return e.__run(t)})},t.delay):window.requestAnimationFrame(function(t){return e.__run(t)}))}var e=t.prototype;return e.__run=function(t){var e=this;if(!this.__cancelled){null===this.__start&&(this.__start=t);var o=(t-this.__start)/this.options.duration,i={};o<1?(R(this.options.properties,function(t,n){t&&(i[n]=t.start+(t.end-t.start)*e.options.easing(o))}),this.options.onTick(i,o),window.requestAnimationFrame(function(t){return e.__run(t)})):(R(this.options.properties,function(t,e){t&&(i[e]=t.end)}),this.options.onTick(i,1),window.requestAnimationFrame(function(){e.__resolved=!0,e.__resolve()}))}},e.then=function(e,o){var i=this;void 0===e&&(e=null),void 0===o&&(o=null);var n=new t;return n.__promise.then(null,function(){return i.cancel()}),this.__promise.then(function(){return n.__resolve(e?e():void 0)},function(){return n.__reject(o?o():void 0)}),n},e.catch=function(t){return this.then(void 0,t)},e.finally=function(t){return this.then(t,t)},e.cancel=function(){this.__cancelled||this.__resolved||(this.__cancelled=!0,this.__reject(),this.__delayTimeout&&(window.cancelAnimationFrame(this.__delayTimeout),this.__delayTimeout=null))},t.resolve=function(){var t=Promise.resolve();return t.cancel=function(){},t.finally=function(e){return t.then(e,e)},t},t}();function Y(){return(Y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i])}return t}).apply(this,arguments)}function X(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function B(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Z=function(){function t(t,e){this.psv=t.psv||t,this.parent=t,this.parent.children.push(this),this.children=[],this.prop={visible:!0},this.container=document.createElement("div"),this.container.className=e,this.parent.container.appendChild(this.container)}var e=t.prototype;return e.destroy=function(){this.parent.container.removeChild(this.container);var t=this.parent.children.indexOf(this);-1!==t&&this.parent.children.splice(t,1),this.children.slice().forEach(function(t){return t.destroy()}),this.children.length=0,delete this.container,delete this.parent,delete this.psv,delete this.prop},e.refreshUi=function(){var t=this;this.children.every(function(e){return e.refreshUi(),!0===t.psv.prop.uiRefresh})},e.toggle=function(){this.isVisible()?this.hide():this.show()},e.hide=function(){this.container.style.display="none",this.prop.visible=!1},e.show=function(){this.container.style.display="",this.prop.visible=!0},e.isVisible=function(){return this.prop.visible},t}(),G=function(t){function e(e,o,i){var n;return void 0===o&&(o=""),void 0===i&&(i=!1),(n=t.call(this,e,"psv-button "+o)||this).prop=Y({},n.prop,{id:n.constructor.id,collapsable:i,enabled:!0,supported:!0,collapsed:!1,active:!1,width:n.container.offsetWidth}),n.constructor.icon&&n.__setIcon(n.constructor.icon),n.prop.id&&n.psv.config.lang[n.prop.id]&&(n.container.title=n.psv.config.lang[n.prop.id]),n.container.addEventListener("click",function(t){n.prop.enabled&&n.onClick(),t.stopPropagation()}),n}X(e,t);var o=e.prototype;return o.checkSupported=function(){var t=this,e=this.isSupported();P(e)?(!1===e.initial&&(this.hide(),this.prop.supported=!1),e.promise.then(function(e){t.prop&&(t.prop.supported=e,!e&&t.prop.visible?t.hide():e&&!t.prop.visible&&t.show())})):e||(this.hide(),this.prop.supported=!1)},o.isSupported=function(){return!0},o.toggleActive=function(t){this.prop.active=void 0!==t?t:!this.prop.active,u(this.container,"psv-button--active",this.prop.active),this.constructor.iconActive&&this.__setIcon(this.prop.active?this.constructor.iconActive:this.constructor.icon)},o.show=function(t){void 0===t&&(t=!0),this.isVisible()||(this.prop.visible=!0,this.prop.collapsed||(this.container.style.display=""),t&&this.psv.refreshUi("show button "+this.prop.id))},o.hide=function(t){void 0===t&&(t=!0),this.isVisible()&&(this.prop.visible=!1,this.container.style.display="none",t&&this.psv.refreshUi("hide button "+this.prop.id))},o.disable=function(){this.container.classList.add("psv-button--disabled"),this.prop.enabled=!1},o.enable=function(){this.container.classList.remove("psv-button--disabled"),this.prop.enabled=!0},o.collapse=function(){this.prop.collapsed=!0,this.container.style.display="none"},o.uncollapse=function(){this.prop.collapsed=!1,this.prop.visible&&(this.container.style.display="")},o.__setIcon=function(t,e){void 0===e&&(e=this.container),t?(e.innerHTML=t,e.querySelector("svg").setAttribute("class","psv-button-svg")):e.innerHTML=""},o.onClick=function(){throw new k('onClick not implemented for button "'+this.prop.id+'".')},e}(Z);G.id=null,G.icon=null,G.iconActive=null;var j=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-autorotate-button",!0)||this).psv.on(a.AUTOROTATE,B(o)),o}X(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(a.AUTOROTATE,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case a.AUTOROTATE:this.toggleActive(t.args[0])}},o.onClick=function(){this.psv.toggleAutorotate()},e}(G);j.id="autorotate",j.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41"><path d="M40.5 14.1c-.1-.1-1.2-.5-2.899-1-.101 0-.2-.1-.2-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.4 2.7.9.1 0 .2.1.2.199C6.3 34.4 12.9 39 20.5 39c7.601 0 14.101-4.6 16.9-11.1 0-.101.1-.101.2-.2 1.699-.6 2.699-1 2.8-1l.6-.3V14.3l-.5-.2zM20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.8-1-8.8-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5C9.7 7 14.8 4 20.5 4zm0 33c-5.9 0-11.1-3.1-14-7.899-.2-.301.1-.601.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.601-2 .3-.1.5.2.399.5A16.422 16.422 0 0 1 20.5 37zm18.601-12.1c0 .1-.101.3-.2.3-2.5.9-10.4 3.6-18.4 3.6-7.1 0-15.6-2.699-18.3-3.6C2.1 25.2 2 25 2 24.9V16c0-.1.1-.3.2-.3 2.6-.9 10.6-3.6 18.2-3.6 7.5 0 15.899 2.7 18.5 3.6.1 0 .2.2.2.3v8.9z"/><path d="M18.7 24l6.4-3.7c.3-.2.3-.7 0-.8l-6.4-3.8c-.3-.2-.7 0-.7.4v7.4c0 .5.4.7.7.5z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>\n',j.iconActive='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41"><path d="M40.5 14.1c-.1-.1-1.2-.5-2.898-1-.102 0-.202-.1-.202-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.399 2.7.899.1 0 .2.101.2.199C6.3 34.4 12.9 39 20.5 39c7.602 0 14.102-4.6 16.9-11.1 0-.102.1-.102.199-.2 1.699-.601 2.699-1 2.801-1l.6-.3V14.3l-.5-.2zM6.701 11.5C9.7 7 14.8 4 20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.799-1-8.799-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5zM25.1 20.3L18.7 24c-.3.2-.7 0-.7-.5v-7.4c0-.4.4-.6.7-.4l6.399 3.8c.301.1.301.6.001.8zm9.4 8.901A16.421 16.421 0 0 1 20.5 37c-5.9 0-11.1-3.1-14-7.898-.2-.302.1-.602.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.602-2 .298-.1.5.198.398.499z"/>\x3c!--Created by Nick Bluth from the Noun Project--\x3e</svg>\n';var q=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-custom-button",!1!==o.collapsable)||this).config=o,i.config.id?i.prop.id=i.config.id:i.prop.id="psvButton-"+Math.random().toString(36).substr(2,9),i.config.className&&d(i.container,i.config.className),i.config.title&&(i.container.title=i.config.title),i.config.content&&(i.container.innerHTML=i.config.content),i.width=i.container.offsetWidth,!1===i.config.enabled&&i.disable(),!1===i.config.visible&&i.hide(),i}X(e,t);var o=e.prototype;return o.destroy=function(){delete this.config,t.prototype.destroy.call(this)},o.onClick=function(){this.config.onClick&&this.config.onClick.apply(this.psv)},e}(G),K=function(t){function e(e){return t.call(this,e,"psv-button--hover-scale psv-download-button",!0)||this}return X(e,t),e.prototype.onClick=function(){var t=this,e=document.createElement("a");e.href=this.psv.config.panorama,e.download=this.psv.config.panorama,this.psv.container.appendChild(e),e.click(),setTimeout(function(){t.psv.container.removeChild(e)},100)},e}(G);K.id="download",K.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M83.3 35.6h-17V3H32.2v32.6H16.6l33.6 32.7 33-32.7z"/><path d="M83.3 64.2v16.3H16.6V64.2H-.1v32.6H100V64.2H83.3z"/>\x3c!--Created by Michael Zenaty from the Noun Project--\x3e</svg>\n';var $=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-fullscreen-button")||this).psv.on(a.FULLSCREEN_UPDATED,B(o)),o}X(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(a.FULLSCREEN_UPDATED,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case a.FULLSCREEN_UPDATED:this.toggleActive(t.args[0])}},o.onClick=function(){this.psv.toggleFullscreen()},e}(G);$.id="fullscreen",$.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M100 40H87.1V18.8h-21V6H100zM100 93.2H66V80.3h21.1v-21H100zM34 93.2H0v-34h12.9v21.1h21zM12.9 40H0V6h34v12.9H12.8z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>\n',$.iconActive='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M66 7h13v21h21v13H66zM66 60.3h34v12.9H79v21H66zM0 60.3h34v34H21V73.1H0zM21 7h13v34H0V28h21z"/>\x3c!--Created by Garrett Knoll from the Noun Project--\x3e</svg>\n';var Q="data-"+O("psvButton"),J=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-menu-button")||this).psv.on(a.OPEN_PANEL,B(o)),o.psv.on(a.CLOSE_PANEL,B(o)),o.hide(),o}X(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(a.OPEN_PANEL,this),this.psv.off(a.CLOSE_PANEL,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case a.OPEN_PANEL:this.toggleActive(t.args[0]===h.MENU);break;case a.CLOSE_PANEL:this.toggleActive(!1)}},o.hide=function(e){t.prototype.hide.call(this,e),this.__hideMenu()},o.show=function(e){t.prototype.show.call(this,e),this.prop.active&&this.__showMenu()},o.onClick=function(){this.prop.active?this.__hideMenu():this.__showMenu()},o.__showMenu=function(){var t,e,o=this;this.psv.panel.show({id:h.MENU,content:(t=this.parent.collapsed,e=this.psv,'\n<div class="psv-markers-list-container">\n <h1 class="psv-markers-list-title">'+e.config.lang.menu+'</h1>\n <ul class="psv-markers-list">\n '+t.map(function(t){return"\n <li "+Q+'="'+t.prop.id+'" class="psv-markers-list-item">\n <span class="psv-markers-list-image">'+t.container.innerHTML+'</span>\n <p class="psv-markers-list-name">'+t.container.title+"</p>\n </li>\n "}).join("")+"\n </ul>\n</div>\n"),noMargin:!0,clickHandler:function(t){var e=t.target?v(t.target,"li"):void 0,i=e?e.dataset.psvButton:void 0;i&&(o.parent.getButton(i).onClick(),o.__hideMenu())}})},o.__hideMenu=function(){this.psv.panel&&this.psv.panel.hide(h.MENU)},e}(G);J.id="menu",J.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 80 80"><circle r="10" cx="20" cy="20"/><circle r="10" cx="50" cy="20"/><circle r="10" cx="80" cy="20"/><circle r="10" cx="20" cy="50"/><circle r="10" cx="50" cy="50"/><circle r="10" cx="80" cy="50"/><circle r="10" cx="20" cy="80"/><circle r="10" cx="50" cy="80"/><circle r="10" cx="80" cy="80"/>\x3c!-- Created by Richard Kunák from the Noun Project--\x3e</svg>\n';var tt={loaded:!1,pixelRatio:1,isWebGLSupported:!1,isTouchEnabled:null,maxTextureWidth:0,maxCanvasWidth:0,mouseWheelEvent:null,fullscreenEvent:null};tt.load=function(){if(!tt.loaded){var t=function(){var t=document.createElement("canvas"),e=null;if(!t.getContext)return null;return["webgl","experimental-webgl","moz-webgl","webkit-3d"].some(function(o){try{return null!==(e=t.getContext(o))}catch(t){return!1}})?e:null}();tt.loaded=!0,tt.pixelRatio=window.devicePixelRatio||1,tt.isWebGLSupported=null!=t,tt.isTouchEnabled=new Promise(function(t){var e=function e(o){t(!!o),window.removeEventListener("touchstart",e)};window.addEventListener("touchstart",e,!1),setTimeout(e,1e4)}),tt.maxTextureWidth=function(t){return null!==t?t.getParameter(t.MAX_TEXTURE_SIZE):0}(t),tt.maxCanvasWidth=function(t){var e=document.createElement("canvas"),o=e.getContext("2d");e.width=t,e.height=t/2;for(;e.width>1024;){o.fillStyle="white",o.fillRect(0,0,1,1);try{if(255===o.getImageData(0,0,1,1).data[0])return e.width}catch(t){}e.width/=2,e.height/=2}return 0}(tt.maxTextureWidth),tt.mouseWheelEvent="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",tt.fullscreenEvent=(e=Object.keys(et).filter(function(t){return t in document})).length?et[e[0]]:null}var e};var et={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"};var ot=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-zoom-button",!0)||this).prop=Y({},i.prop,{value:o,buttondown:!1,longPressTimeout:null,longPressAnimation:null}),i.container.addEventListener("mousedown",B(i)),i.psv.container.addEventListener("mouseup",B(i)),i.psv.container.addEventListener("touchend",B(i)),i}X(e,t);var o=e.prototype;return o.destroy=function(){this.__onMouseUp(),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"mousedown":this.__onMouseDown();break;case"mouseup":case"touchend":this.__onMouseUp()}},o.isSupported=function(){return{initial:!0,promise:tt.isTouchEnabled.then(function(t){return!t})}},o.onClick=function(){},o.__onMouseDown=function(){var t=this;this.prop.enabled&&(this.prop.buttondown=!0,this.prop.longPressTimeout=setTimeout(function(){return t.__startLongPressInterval()},100))},o.__startLongPressInterval=function(){var t=this;if(this.prop.buttondown){var e=this.prop.value<0?0:100;this.prop.longPressAnimation=new V({properties:{zoom:{start:this.psv.prop.zoomLvl,end:e}},duration:1500*Math.abs(this.psv.prop.zoomLvl-e)/100,easing:"linear",onTick:function(e){t.psv.zoom(e.zoom)}}).catch(function(){})}},o.__onMouseUp=function(){this.prop.enabled&&this.prop.buttondown&&(this.prop.longPressAnimation?(this.prop.longPressAnimation.cancel(),this.prop.longPressAnimation=null):this.psv.zoom(this.psv.prop.zoomLvl+this.prop.value*this.psv.config.zoomButtonIncrement),this.prop.longPressTimeout&&clearTimeout(this.prop.longPressTimeout),this.prop.buttondown=!1)},e}(G),it=function(t){function e(e){return t.call(this,e,1)||this}return X(e,t),e}(ot);it.id="zoomIn",it.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path d="M8.728 4.009H6.744v2.737H4.006V8.73h2.738v2.736h1.984V8.73h2.737V6.746H8.728z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>\n';var nt=function(t){function e(e){return t.call(this,e,-1)||this}return X(e,t),e}(ot);nt.id="zoomOut",nt.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path d="M4.006 6.746h7.459V8.73H4.006z"/>\x3c!--Created by Ryan Canning from the Noun Project--\x3e</svg>\n';var rt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-zoom-range")||this).prop=Y({},o.prop,{mousedown:!1,mediaMinWidth:0}),o.zoomRange=document.createElement("div"),o.zoomRange.className="psv-zoom-range-line",o.container.appendChild(o.zoomRange),o.zoomValue=document.createElement("div"),o.zoomValue.className="psv-zoom-range-handle",o.zoomRange.appendChild(o.zoomValue),o.prop.mediaMinWidth=parseInt(E(o.container,"maxWidth"),10),o.container.addEventListener("mousedown",B(o)),o.container.addEventListener("touchstart",B(o)),o.psv.container.addEventListener("mousemove",B(o)),o.psv.container.addEventListener("touchmove",B(o)),o.psv.container.addEventListener("mouseup",B(o)),o.psv.container.addEventListener("touchend",B(o)),o.psv.on(a.ZOOM_UPDATED,B(o)),o.psv.prop.ready?o.__moveZoomValue(o.psv.prop.zoomLvl):o.psv.once(a.READY,B(o)),o.refreshUi(),o}X(e,t);var o=e.prototype;return o.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.zoomRange,delete this.zoomValue,this.psv.off(a.ZOOM_UPDATED,this),t.prototype.destroy.call(this)},o.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 a.ZOOM_UPDATED:this.__moveZoomValue(t.args[0]);break;case a.READY:this.__moveZoomValue(this.psv.prop.zoomLvl)}},o.isSupported=function(){return{initial:!0,promise:tt.isTouchEnabled.then(function(t){return!t})}},o.refreshUi=function(){this.prop.supported&&(this.psv.prop.size.width<=this.prop.mediaMinWidth&&this.prop.visible?this.hide():this.psv.prop.size.width>this.prop.mediaMinWidth&&!this.prop.visible&&this.show())},o.onClick=function(){},o.__moveZoomValue=function(t){this.zoomValue.style.left=t/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"},o.__initZoomChangeWithMouse=function(t){this.prop.enabled&&(this.prop.mousedown=!0,this.__changeZoom(t.clientX))},o.__initZoomChangeByTouch=function(t){this.prop.enabled&&(this.prop.mousedown=!0,this.__changeZoom(t.changedTouches[0].clientX))},o.__stopZoomChange=function(){this.prop.enabled&&(this.prop.mousedown=!1,this.prop.buttondown=!1)},o.__changeZoomWithMouse=function(t){this.prop.enabled&&this.prop.mousedown&&(t.preventDefault(),this.__changeZoom(t.clientX))},o.__changeZoomByTouch=function(t){this.prop.enabled&&this.prop.mousedown&&this.__changeZoom(t.changedTouches[0].clientX)},o.__changeZoom=function(t){var e=(t-this.zoomRange.getBoundingClientRect().left)/this.zoomRange.offsetWidth*100;this.psv.zoom(e)},e}(G);rt.id="zoomRange";var st={panorama:null,container:null,caption:null,loadingImg:null,loadingTxt:"Loading...",size:null,fisheye:!1,minFov:30,maxFov:90,defaultZoomLvl:50,defaultLong:0,defaultLat:0,sphereCorrection:{pan:0,tilt:0,roll:0},moveSpeed:1,zoomButtonIncrement:2,autorotateDelay:null,autorotateSpeed:"2rpm",autorotateLat:null,moveInertia:!0,mousewheel:!0,mousewheelSpeed:1,mousemove:!0,captureCursor:!1,touchmoveTwoFingers:!1,useXmpData:!0,panoData:null,withCredentials:!1,navbar:["autorotate","zoomOut","zoomRange","zoomIn","download","caption","fullscreen"],lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",download:"Download",fullscreen:"Fullscreen",menu:"Menu",twoFingers:["Use two fingers to navigate"],loadError:"The panorama can't be loaded"},keyboard:{ArrowUp:s.ROTATE_LAT_UP,ArrowDown:s.ROTATE_LAT_DOWN,ArrowRight:s.ROTATE_LONG_RIGHT,ArrowLeft:s.ROTATE_LONG_LEFT,PageUp:s.ZOOM_IN,PageDown:s.ZOOM_OUT,"+":s.ZOOM_IN,"-":s.ZOOM_OUT," ":s.TOGGLE_AUTOROTATE},plugins:[]},at={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",plugins:"Cannot change plugins"},ct={container:function(t){if(!t)throw new k("No value given for container.");return t},defaultLat:function(t){return U(t,!0)},minFov:function(t,e){return e.maxFov<t&&(S("maxFov cannot be lower than minFov"),t=e.maxFov),T(t,1,179)},maxFov:function(t,e){return t<e.minFov&&(t=e.minFov),T(t,1,179)},lang:function(t){return Y({},st.lang,{},t)},keyboard:function(t){return!0===t?I(st.keyboard):t},autorotateLat:function(t,e){return U(null===t?e.defaultLat:t,!0)},autorotateSpeed:function(t){return F(t)},fisheye:function(t){return!0===t?1:!1===t?0:t},plugins:function(t){return t.map(function(t){return Array.isArray(t)?t:[t]}).filter(function(t){return!!t[0]})}};var ht=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-caption-button")||this).psv.on(a.HIDE_NOTIFICATION,B(o)),o}X(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(a.HIDE_NOTIFICATION,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case a.HIDE_NOTIFICATION:this.toggleActive(!1)}},o.onClick=function(){this.psv.notification.prop.visible?this.psv.notification.hide():(this.psv.notification.show(this.parent.prop.caption),this.toggleActive(!0))},e}(G);ht.id="caption",ht.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M28.3 26.1c-1 2.6-1.9 4.8-2.6 7-2.5 7.4-5 14.7-7.2 22-1.3 4.4.5 7.2 4.3 7.8 1.3.2 2.8.2 4.2-.1 8.2-2 11.9-8.6 15.7-15.2l-2.2 2a18.8 18.8 0 0 1-7.4 5.2 2 2 0 0 1-1.6-.2c-.2-.1 0-1 0-1.4l.8-1.8L41.9 28c.5-1.4.9-3 .7-4.4-.2-2.6-3-4.4-6.3-4.4-8.8.2-15 4.5-19.5 11.8-.2.3-.2.6-.3 1.3 3.7-2.8 6.8-6.1 11.8-6.2z"/><circle cx="39.3" cy="9.2" r="8.2"/>\x3c!--Created by Arafat Uddin from the Noun Project--\x3e</svg>';var pt=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-caption")||this).button=new ht(B(i)),i.button.hide(),i.prop=Y({},i.prop,{id:i.constructor.id,collapsable:!1,width:i.button.prop.width,caption:"",contentVisible:!0,contentWidth:0}),i.content=document.createElement("div"),i.content.className="psv-caption-content",i.container.appendChild(i.content),i.setCaption(o),i}X(e,t);var o=e.prototype;return o.destroy=function(){delete this.button,delete this.content,t.prototype.destroy.call(this)},o.setCaption=function(t){this.prop.caption=t||"",this.content.innerHTML=this.prop.caption,t?(this.show(!1),this.content.style.display="",this.prop.contentWidth=this.content.offsetWidth,this.refreshUi()):this.hide()},o.refreshUi=function(){var t=this.container.offsetWidth;t>=this.prop.contentWidth&&!this.prop.contentVisible?(this.content.style.display="",this.prop.contentVisible=!0,this.button.hide(!1)):t<this.prop.contentWidth&&this.prop.contentVisible&&(this.content.style.display="none",this.prop.contentVisible=!1,this.button.show(!1))},e}(Z);pt.id="caption";var lt={};function ut(t){if(!t.id)throw new k("Button ID is required");lt[t.id]=t}[j,it,rt,nt,K,$].forEach(ut);var dt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-navbar")||this).children=[],o.collapsed=[],o}X(e,t);var o=e.prototype;return o.setButtons=function(t){var e=this;this.children.slice().forEach(function(t){return t.destroy()}),this.children.length=0,this.__cleanButtons(t).forEach(function(t){if("object"==typeof t)new q(e,t);else if(lt[t])new lt[t](e);else if("caption"===t)new pt(e,e.psv.config.caption);else{if("zoom"!==t)throw new k("Unknown button "+t);new nt(e),new rt(e),new it(e)}}),new J(this),this.children.forEach(function(t){"function"==typeof t.checkSupported&&t.checkSupported()})},o.setCaption=function(t){var e=this.getButton("caption",!1);if(!e)throw new k("Cannot set caption, the navbar caption container is not initialized.");e.setCaption(t)},o.getButton=function(t,e){void 0===e&&(e=!0);var o=null;return this.children.some(function(e){return e.prop.id===t&&(o=e,!0)}),!o&&e&&S('button "'+t+'" not found in the navbar'),o},o.show=function(){this.container.classList.add("psv-navbar--open"),this.prop.visible=!0},o.hide=function(){this.container.classList.remove("psv-navbar--open"),this.prop.visible=!1},o.refreshUi=function(){if(t.prototype.refreshUi.call(this),!0===this.psv.prop.uiRefresh){var e=this.container.offsetWidth,o=0,i=[],n=[];if(this.children.forEach(function(t){t.prop.visible&&(o+=t.prop.width,i.push(t),t.prop.collapsable&&n.push(t))}),!i.length)return;e<o&&n.length>0?(n.forEach(function(t){return t.collapse()}),this.collapsed=n,this.getButton(J.id).show(!1)):e>=o&&this.collapsed.length>0&&(this.collapsed.forEach(function(t){return t.uncollapse()}),this.collapsed=[],this.getButton(J.id).hide(!1));var r=this.getButton(pt.id,!1);r&&r.refreshUi()}},o.__cleanButtons=function(t){return!0===t?I(st.navbar):"string"==typeof t?t.split(/[ ,]/):t||[]},e}(Z),vt=function(t){function e(e){var o;return(o=t.call(this)||this).psv=e,o}return X(e,t),e.prototype.destroy=function(){delete this.psv},e}(o.EventEmitter);vt.id=null;var ft=function(t){function e(e){var o;return(o=t.call(this,e,"psv-loader-container")||this).loader=document.createElement("div"),o.loader.className="psv-loader",o.container.appendChild(o.loader),o.canvas=document.createElement("canvas"),o.canvas.className="psv-loader-canvas",o.canvas.width=o.loader.clientWidth*tt.pixelRatio,o.canvas.height=o.loader.clientWidth*tt.pixelRatio,o.loader.appendChild(o.canvas),o.prop=Y({},o.prop,{tickness:(o.loader.offsetWidth-o.loader.clientWidth)/2*tt.pixelRatio,current:null}),o.refreshUi(),o.hide(),o}X(e,t);var o=e.prototype;return o.destroy=function(){delete this.loader,delete this.canvas,t.prototype.destroy.call(this)},o.refreshUi=function(){if(this.prop.current!==(this.psv.config.loadingImg||this.psv.config.loadingTxt)){var t;if(this.prop.current&&this.loader.removeChild(this.loader.lastChild),this.psv.config.loadingImg?((t=document.createElement("img")).className="psv-loader-image",t.src=this.psv.config.loadingImg):this.psv.config.loadingTxt&&((t=document.createElement("div")).className="psv-loader-text",t.innerHTML=this.psv.config.loadingTxt),t){var e=Math.round(Math.sqrt(2*Math.pow((this.canvas.width/2-this.prop.tickness/2)/tt.pixelRatio,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}this.prop.current=this.psv.config.loadingImg||this.psv.config.loadingTxt}},o.setProgress=function(t){var e=this.canvas.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),e.lineWidth=this.prop.tickness,e.strokeStyle=E(this.loader,"color"),e.beginPath(),e.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.prop.tickness/2,-Math.PI/2,t/100*2*Math.PI-Math.PI/2),e.stroke()},e}(Z),mt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-notification")||this).prop=Y({},o.prop,{visible:!1,timeout:null}),o.content=document.createElement("div"),o.content.className="psv-notification-content",o.container.appendChild(o.content),o.content.addEventListener("click",function(){return o.hide()}),o}X(e,t);var o=e.prototype;return o.destroy=function(){delete this.content,t.prototype.destroy.call(this)},o.show=function(t){var e=this;this.prop.timeout&&(clearTimeout(this.prop.timeout),this.prop.timeout=null),"string"==typeof t&&(t={content:t}),this.content.innerHTML=t.content,this.prop.visible=!0,this.container.classList.add("psv-notification--visible"),this.psv.trigger(a.SHOW_NOTIFICATION),t.timeout&&(this.prop.timeout=setTimeout(function(){return e.hide()},t.timeout))},o.hide=function(){this.prop.visible&&(this.container.classList.remove("psv-notification--visible"),this.prop.visible=!1,this.psv.trigger(a.HIDE_NOTIFICATION))},e}(Z),gt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-overlay")||this).prop=Y({},o.prop,{contentId:void 0,dissmisable:!0}),o.image=document.createElement("div"),o.image.className="psv-overlay-image",o.container.appendChild(o.image),o.text=document.createElement("div"),o.text.className="psv-overlay-text",o.container.appendChild(o.text),o.subtext=document.createElement("div"),o.subtext.className="psv-overlay-subtext",o.container.appendChild(o.subtext),o.container.addEventListener("mouseup",function(t){t.stopPropagation(),o.prop.dissmisable&&o.hide()},!0),t.prototype.hide.call(B(o)),o}X(e,t);var o=e.prototype;return o.destroy=function(){delete this.image,delete this.text,delete this.subtext,t.prototype.destroy.call(this)},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new k("Overlay cannot be toggled")},o.show=function(e){"string"==typeof e&&(e={text:e}),this.prop.contentId=e.id,this.prop.dissmisable=!1!==e.dissmisable,this.image.innerHTML=e.image||"",this.text.innerHTML=e.text||"",this.subtext.innerHTML=e.subtext||"",t.prototype.show.call(this),this.psv.trigger(a.SHOW_OVERLAY,e.id)},o.hide=function(e){if(this.isVisible()&&(!e||!this.prop.contentId||this.prop.contentId===e)){var o=this.prop.contentId;t.prototype.hide.call(this),this.prop.contentId=void 0,this.psv.trigger(a.HIDE_OVERLAY,o)}},e}(Z),wt=function(t){function e(e){var o;(o=t.call(this,e,"psv-panel")||this).prop=Y({},o.prop,{visible:!1,contentId:void 0,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null});var i=document.createElement("div");i.className="psv-panel-resizer",o.container.appendChild(i);var n=document.createElement("div");return n.className="psv-panel-close-button",o.container.appendChild(n),o.content=document.createElement("div"),o.content.className="psv-panel-content",o.container.appendChild(o.content),o.container.addEventListener(tt.mouseWheelEvent,function(t){return t.stopPropagation()}),n.addEventListener("click",function(){return o.hide()}),i.addEventListener("mousedown",B(o)),i.addEventListener("touchstart",B(o)),o.psv.container.addEventListener("mouseup",B(o)),o.psv.container.addEventListener("touchend",B(o)),o.psv.container.addEventListener("mousemove",B(o)),o.psv.container.addEventListener("touchmove",B(o)),o}X(e,t);var o=e.prototype;return o.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,t.prototype.destroy.call(this)},o.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)}},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new k("Panel cannot be toggled")},o.show=function(t){"string"==typeof t&&(t={content:t}),this.prop.contentId=t.id,this.prop.visible=!0,this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.prop.clickHandler=null),this.content.innerHTML=t.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),u(this.content,"psv-panel-content--no-margin",!0===t.noMargin),t.clickHandler&&(this.prop.clickHandler=t.clickHandler,this.content.addEventListener("click",t.clickHandler)),this.psv.trigger(a.OPEN_PANEL,t.id)},o.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.prop.visible=!1,this.prop.contentId=void 0,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.prop.clickHandler&&(this.content.removeEventListener("click",this.prop.clickHandler),this.prop.clickHandler=null),this.psv.trigger(a.CLOSE_PANEL,e)}},o.__onMouseDown=function(t){t.stopPropagation(),this.__startResize(t)},o.__onTouchStart=function(t){t.stopPropagation(),this.__startResize(t.changedTouches[0])},o.__onMouseUp=function(t){this.prop.mousedown&&(t.stopPropagation(),this.prop.mousedown=!1,this.content.classList.remove("psv-panel-content--no-interaction"))},o.__onMouseMove=function(t){this.prop.mousedown&&(t.stopPropagation(),this.__resize(t))},o.__onTouchMove=function(t){this.prop.mousedown&&this.__resize(t.touches[0])},o.__startResize=function(t){this.prop.mouseX=t.clientX,this.prop.mouseY=t.clientY,this.prop.mousedown=!0,this.content.classList.add("psv-panel-content--no-interaction")},o.__resize=function(t){var e=t.clientX,o=t.clientY;this.container.style.width=Math.max(200,this.container.offsetWidth-(e-this.prop.mouseX))+"px",this.prop.mouseX=e,this.prop.mouseY=o},e}(Z),_t=function(){function t(t){this.psv=t,this.config=t.config,this.prop=t.prop}return t.prototype.destroy=function(){delete this.psv,delete this.config,delete this.prop},t}(),bt=function(t){function o(e){return t.call(this,e)||this}X(o,t);var i=o.prototype;return i.fovToZoomLevel=function(t){var e=Math.round((t-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return e-2*(e-50)},i.zoomLevelToFov=function(t){return this.config.maxFov+t/100*(this.config.minFov-this.config.maxFov)},i.vFovToHFov=function(t){return e.Math.radToDeg(2*Math.atan(Math.tan(e.Math.degToRad(t)/2)*this.prop.aspect))},i.speedToDuration=function(t,e){if(t&&"number"==typeof t)return Math.abs(t);var o=t?F(t):this.config.autorotateSpeed;return e/Math.abs(o)*1e3},i.textureCoordsToSphericalCoords=function(t){if(this.prop.isCubemap)throw new k("Unable to use texture coords with cubemap.");var e=this.prop.panoData,o=(t.x+e.croppedX)/e.fullWidth*Math.PI*2,i=(t.y+e.croppedY)/e.fullHeight*Math.PI;return{longitude:o>=Math.PI?o-Math.PI:o+Math.PI,latitude:Math.PI/2-i}},i.sphericalCoordsToTextureCoords=function(t){if(this.prop.isCubemap)throw new k("Unable to use texture coords with cubemap.");var e=this.prop.panoData,o=t.longitude/Math.PI/2*e.fullWidth,i=t.latitude/Math.PI*e.fullHeight;return{x:Math.round(t.longitude<Math.PI?o+e.fullWidth/2:o-e.fullWidth/2)-e.croppedX,y:Math.round(e.fullHeight/2-i)-e.croppedY}},i.sphericalCoordsToVector3=function(t){return new e.Vector3(100*-Math.cos(t.latitude)*Math.sin(t.longitude),100*Math.sin(t.latitude),100*Math.cos(t.latitude)*Math.cos(t.longitude))},i.vector3ToSphericalCoords=function(t){var e=Math.acos(t.y/Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)),o=Math.atan2(t.x,t.z);return{longitude:o<0?-o:2*Math.PI-o,latitude:Math.PI/2-e}},i.viewerCoordsToVector3=function(t){var o=new e.Vector2(2*t.x/this.prop.size.width-1,-2*t.y/this.prop.size.height+1);this.psv.renderer.raycaster.setFromCamera(o,this.psv.renderer.camera);var i=this.psv.renderer.raycaster.intersectObjects(this.psv.renderer.scene.children);return 1===i.length?i[0].point:null},i.vector3ToViewerCoords=function(t){var e=t.clone();return e.project(this.psv.renderer.camera),{x:Math.round((e.x+1)/2*this.prop.size.width),y:Math.round((1-e.y)/2*this.prop.size.height)}},i.isExtendedPosition=function(t){return[["x","y"],["longitude","latitude"]].some(function(e){var o=e[0],i=e[1];return o in t&&i in t})},i.cleanPosition=function(t){return"x"in t&&"y"in t?this.textureCoordsToSphericalCoords(t):{longitude:U(t.longitude),latitude:U(t.latitude,!0)}},i.cleanSphereCorrection=function(t){return{pan:U(t.pan||0),tilt:U(t.tilt||0,!0),roll:U(t.roll||0,!0,!1)}},o}(_t),Et=function(t){function e(e){var o;return(o=t.call(this,e)||this).state={keyboardEnabled:!1,moving:!1,zooming:!1,startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,mouseHistory:[],pinchDist:0,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null},o.__onResize=A(function(){return o.psv.autoSize()},50),o}X(e,t);var o=e.prototype;return o.init=function(){window.addEventListener("resize",this),window.addEventListener("keydown",this),this.psv.container.addEventListener("mouseenter",this),this.psv.container.addEventListener("mousedown",this),this.psv.container.addEventListener("mouseleave",this),window.addEventListener("mouseup",this),this.psv.container.addEventListener("touchstart",this),window.addEventListener("touchend",this),this.psv.container.addEventListener("mousemove",this),this.psv.container.addEventListener("touchmove",this),this.psv.container.addEventListener(tt.mouseWheelEvent,this),tt.fullscreenEvent&&document.addEventListener(tt.fullscreenEvent,this)},o.destroy=function(){window.removeEventListener("resize",this),window.removeEventListener("keydown",this),this.psv.container.removeEventListener("mouseenter",this),this.psv.container.removeEventListener("mousedown",this),this.psv.container.removeEventListener("mouseleave",this),window.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchstart",this),window.removeEventListener("touchend",this),this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener(tt.mouseWheelEvent,this),tt.fullscreenEvent&&document.removeEventListener(tt.fullscreenEvent,this),clearTimeout(this.state.dblclickTimeout),clearTimeout(this.state.longtouchTimeout),clearTimeout(this.state.twofingersTimeout),delete this.state,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"resize":this.__onResize();break;case"keydown":this.__onKeyDown(t);break;case"mouseup":this.__onMouseUp(t);break;case"touchend":this.__onTouchEnd(t);break;case tt.fullscreenEvent:this.__fullscreenToggled()}if(!v(t.target,".psv-navbar")&&!v(t.target,".psv-panel"))switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"mouseenter":this.__onMouseEnter(t);break;case"touchstart":this.__onTouchStart(t);break;case"mouseleave":this.__onMouseLeave(t);break;case"mousemove":this.__onMouseMove(t);break;case"touchmove":this.__onTouchMove(t);break;case tt.mouseWheelEvent:this.__onMouseWheel(t)}},o.enableKeyboard=function(){this.state.keyboardEnabled=!0},o.disableKeyboard=function(){this.state.keyboardEnabled=!1},o.__onKeyDown=function(t){if(this.state.keyboardEnabled){var e=0,o=0,i=0,n=g(t);switch(this.config.keyboard[n]){case s.ROTATE_LAT_UP:o=.01;break;case s.ROTATE_LAT_DOWN:o=-.01;break;case s.ROTATE_LONG_RIGHT:e=.01;break;case s.ROTATE_LONG_LEFT:e=-.01;break;case s.ZOOM_IN:i=1;break;case s.ZOOM_OUT:i=-1;break;case s.TOGGLE_AUTOROTATE:this.psv.toggleAutorotate()}0!==i?this.psv.zoom(this.prop.zoomLvl+i*this.config.zoomButtonIncrement):0===o&&0===e||this.psv.rotate({longitude:this.prop.position.longitude+e*this.prop.moveSpeed*this.prop.hFov,latitude:this.prop.position.latitude+o*this.prop.moveSpeed*this.prop.vFov})}},o.__onMouseDown=function(t){this.config.mousemove&&!this.config.captureCursor&&this.__startMove(t)},o.__onMouseEnter=function(t){this.config.mousemove&&this.config.captureCursor&&this.__startMove(t)},o.__onMouseUp=function(t){this.config.mousemove&&!this.config.captureCursor&&this.__stopMove(t)},o.__onMouseLeave=function(t){this.config.mousemove&&this.config.captureCursor&&this.__stopMove(t)},o.__onMouseMove=function(t){this.config.mousemove&&(0!==t.buttons?(t.preventDefault(),this.__move(t)):this.config.captureCursor&&this.__moveAbsolute(t))},o.__onTouchStart=function(t){var e=this;this.config.mousemove&&(1===t.touches.length?(this.config.touchmoveTwoFingers||(this.__startMove(t.touches[0]),t.preventDefault()),this.prop.longtouchTimeout||(this.prop.longtouchTimeout=setTimeout(function(){e.__click(t.touches[0],!0),e.prop.longtouchTimeout=null},500))):2===t.touches.length&&(this.__cancelLongTouch(),this.__startMoveZoom(t),t.preventDefault()))},o.__onTouchEnd=function(t){this.config.mousemove&&(this.__cancelLongTouch(),1===t.touches.length?this.__stopMoveZoom():0===t.touches.length&&this.__stopMove(t.changedTouches[0]),this.config.touchmoveTwoFingers&&(this.__cancelTwoFingersOverlay(),this.psv.overlay.hide(h.TWO_FINGERS)))},o.__onTouchMove=function(t){var e=this;this.config.mousemove&&(1===t.touches.length?this.config.touchmoveTwoFingers?this.prop.twofingersTimeout||(this.prop.twofingersTimeout=setTimeout(function(){e.psv.overlay.show({id:h.TWO_FINGERS,image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z" fill="#000" fill-rule="evenodd"/>\x3c!--Created by AomAm from the Noun Project--\x3e</svg>\n',text:e.config.lang.twoFingers[0]})},100)):(t.preventDefault(),this.__move(t.touches[0])):2===t.touches.length&&(t.preventDefault(),this.__moveZoom(t),this.config.touchmoveTwoFingers&&this.__cancelTwoFingersOverlay()))},o.__cancelLongTouch=function(){this.prop.longtouchTimeout&&(clearTimeout(this.prop.longtouchTimeout),this.prop.longtouchTimeout=null)},o.__cancelTwoFingersOverlay=function(){this.prop.twofingersTimeout&&(clearTimeout(this.prop.twofingersTimeout),this.prop.twofingersTimeout=null)},o.__onMouseWheel=function(t){if(this.config.mousewheel){t.preventDefault(),t.stopPropagation();var e=5*y(t).spinY;0!==e&&this.psv.zoom(this.prop.zoomLvl-e*this.config.mousewheelSpeed)}},o.__fullscreenToggled=function(t){this.prop.fullscreen=void 0!==t?t:w(this.psv.container),this.config.keyboard&&(this.prop.fullscreen?this.psv.startKeyboardControl():this.psv.stopKeyboardControl()),this.psv.trigger(a.FULLSCREEN_UPDATED,this.prop.fullscreen)},o.__startMove=function(t){var e=this;this.psv.stopAutorotate(),this.psv.stopAnimation().then(function(){e.state.mouseX=t.clientX,e.state.mouseY=t.clientY,e.state.startMouseX=e.state.mouseX,e.state.startMouseY=e.state.mouseY,e.state.moving=!0,e.state.zooming=!1,e.state.mouseHistory.length=0,e.__logMouseMove(t)})},o.__startMoveZoom=function(t){var e={x:t.touches[0].clientX,y:t.touches[0].clientY},o={x:t.touches[1].clientX,y:t.touches[1].clientY};this.state.pinchDist=L(e,o),this.state.mouseX=(e.x+o.x)/2,this.state.mouseY=(e.y+o.y)/2,this.state.startMouseX=this.state.mouseX,this.state.startMouseY=this.state.mouseY,this.state.moving=!0,this.state.zooming=!0},o.__stopMove=function(t){if(!v(t.target,".psv-container"))return this.state.moving=!1,void(this.state.mouseHistory.length=0);this.state.moving&&(Math.abs(t.clientX-this.state.startMouseX)<4&&Math.abs(t.clientY-this.state.startMouseY)<4?(this.__click(t),this.state.moving=!1):this.config.moveInertia?(this.__logMouseMove(t),this.__stopMoveInertia(t)):this.state.moving=!1,this.state.mouseHistory.length=0)},o.__stopMoveZoom=function(){this.state.mouseHistory.length=0,this.state.moving=!1,this.state.zooming=!1},o.__stopMoveInertia=function(t){var e=this,o=t.clientX-this.state.mouseHistory[0][1],i=t.clientY-this.state.mouseHistory[0][2],n=Math.sqrt(o*o+i*i);this.prop.animationPromise=new V({properties:{clientX:{start:t.clientX,end:t.clientX+o},clientY:{start:t.clientY,end:t.clientY+i}},duration:300*n/100,easing:"outCirc",onTick:function(t){e.__move(t,!1)}}).finally(function(){e.state.moving=!1})},o.__click=function(t,e){var o=this;void 0===e&&(e=!1);var i=this.psv.container.getBoundingClientRect(),n={rightclick:e||2===t.button,target:t.target,clientX:t.clientX,clientY:t.clientY,viewerX:t.clientX-i.left,viewerY:t.clientY-i.top},r=this.psv.dataHelper.viewerCoordsToVector3({x:n.viewerX,y:n.viewerY});if(r){var s=this.psv.dataHelper.vector3ToSphericalCoords(r);if(n.longitude=s.longitude,n.latitude=s.latitude,!this.prop.isCubemap){var c=this.psv.dataHelper.sphericalCoordsToTextureCoords(n);n.textureX=c.x,n.textureY=c.y}this.state.dblclickTimeout?(Math.abs(this.state.dblclickData.clientX-n.clientX)<4&&Math.abs(this.state.dblclickData.clientY-n.clientY)<4&&this.psv.trigger(a.DOUBLE_CLICK,this.state.dblclickData),clearTimeout(this.state.dblclickTimeout),this.state.dblclickTimeout=null,this.state.dblclickData=null):(this.psv.trigger(a.CLICK,n),this.state.dblclickData=I(n),this.state.dblclickTimeout=setTimeout(function(){o.state.dblclickTimeout=null,o.state.dblclickData=null},300))}},o.__move=function(t,e){if(this.state.moving){var o=t.clientX,i=t.clientY,n={longitude:(o-this.state.mouseX)/this.prop.size.width*this.prop.moveSpeed*this.prop.hFov*tt.pixelRatio,latitude:(i-this.state.mouseY)/this.prop.size.height*this.prop.moveSpeed*this.prop.vFov*tt.pixelRatio};this.psv.rotate({longitude:this.prop.position.longitude-n.longitude,latitude:this.prop.position.latitude+n.latitude}),this.state.mouseX=o,this.state.mouseY=i,!1!==e&&this.__logMouseMove(t)}},o.__moveAbsolute=function(t){if(this.state.moving){var e=this.psv.container.getBoundingClientRect();this.psv.rotate({longitude:((t.clientX-e.left)/e.width-.5)*Math.PI*2,latitude:-((t.clientY-e.top)/e.height-.5)*Math.PI})}},o.__moveZoom=function(t){if(this.state.zooming&&this.state.moving){var e={x:t.touches[0].clientX,y:t.touches[0].clientY},o={x:t.touches[1].clientX,y:t.touches[1].clientY},i=L(e,o),n=80*(i-this.state.pinchDist)/this.prop.size.width;this.psv.zoom(this.prop.zoomLvl+n),this.__move({clientX:(e.x+o.x)/2,clientY:(e.y+o.y)/2}),this.state.pinchDist=i}},o.__logMouseMove=function(t){var e=Date.now();this.state.mouseHistory.push([e,t.clientX,t.clientY]);for(var o=null,i=0;i<this.state.mouseHistory.length;)this.state.mouseHistory[0][i]<e-300?this.state.mouseHistory.splice(i,1):o&&this.state.mouseHistory[0][i]-o>30?(this.state.mouseHistory.splice(0,i),i=0,o=this.state.mouseHistory[0][i]):(i++,o=this.state.mouseHistory[0][i])},e}(_t),yt=function(t){function o(e){var o;return(o=t.call(this,e)||this).mainReqid=void 0,o.renderer=null,o.scene=null,o.camera=null,o.mesh=null,o.raycaster=null,o.canvasContainer=document.createElement("div"),o.canvasContainer.className="psv-canvas-container",o.canvasContainer.style.cursor=o.psv.config.mousemove?"move":"default",o.psv.container.appendChild(o.canvasContainer),e.on(a.SIZE_UPDATED,function(t,e){o.renderer&&o.renderer.setSize(e.width,e.height)}),e.on(a.CONFIG_CHANGED,function(){o.canvasContainer.style.cursor=o.psv.config.mousemove?"move":"default"}),o.hide(),o}X(o,t);var i=o.prototype;return i.destroy=function(){this.mainReqid&&window.cancelAnimationFrame(this.mainReqid),this.scene&&this.__cleanTHREEScene(this.scene),this.psv.container.removeChild(this.canvasContainer),delete this.canvasContainer,delete this.renderer,delete this.scene,delete this.camera,delete this.mesh,delete this.raycaster,t.prototype.destroy.call(this)},i.hide=function(){this.canvasContainer.style.opacity=0},i.show=function(){this.canvasContainer.style.opacity=1},i.__renderLoop=function(t){var e=this;this.psv.trigger(a.BEFORE_RENDER,t),this.prop.needsUpdate&&(this.render(),this.prop.needsUpdate=!1),this.mainReqid=window.requestAnimationFrame(function(t){return e.__renderLoop(t)})},i.render=function(){this.prop.direction=this.psv.dataHelper.sphericalCoordsToVector3(this.prop.position),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.renderer.render(this.scene,this.camera),this.psv.trigger(a.RENDER)},i.setTexture=function(t){var e=t.texture,o=t.panoData;if(this.prop.panoData=o,this.scene||this.__createScene(),this.prop.isCubemap)for(var i=0;i<6;i++)this.mesh.material[i].map&&this.mesh.material[i].map.dispose(),this.mesh.material[i].map=e[i];else this.mesh.material.map&&this.mesh.material.map.dispose(),this.mesh.material.map=e;this.psv.needsUpdate(),this.psv.trigger(a.PANORAMA_LOADED)},i.setSphereCorrection=function(t,e){void 0===e&&(e=this.mesh);var o=this.psv.dataHelper.cleanSphereCorrection(t);e.rotation.set(o.tilt,o.pan,o.roll)},i.__createScene=function(){this.raycaster=new e.Raycaster,this.renderer=new e.WebGLRenderer,this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.renderer.setPixelRatio(tt.pixelRatio),this.camera=new e.PerspectiveCamera(this.prop.vFov,this.prop.size.width/this.prop.size.height,1,300),this.camera.position.set(0,0,0),this.scene=new e.Scene,this.scene.add(this.camera),this.prop.isCubemap?this.mesh=this.__createCubemap():this.mesh=this.__createSphere(),this.scene.add(this.mesh),this.renderer.domElement.className="psv-canvas",this.canvasContainer.appendChild(this.renderer.domElement)},i.__createSphere=function(t){void 0===t&&(t=1);var o=new e.SphereGeometry(100*t,64,64,-Math.PI/2),i=new e.MeshBasicMaterial({side:e.BackSide}),n=new e.Mesh(o,i);return n.scale.set(-1,1,1),n},i.__createCubemap=function(t){void 0===t&&(t=1);for(var o=200*t,i=new e.BoxGeometry(o,o,o,8,8,8),n=[],r=0;r<6;r++)n.push(new e.MeshBasicMaterial({side:e.BackSide}));var s=new e.Mesh(i,n);return s.scale.set(1,1,-1),s},i.transition=function(t,o){var i,n=this,r=t.texture,s=this.psv.dataHelper.isExtendedPosition(o),a="zoom"in o;if(this.prop.isCubemap?(s&&(S("cannot perform cubemap transition to different position"),s=!1),(i=this.__createCubemap(.9)).material.forEach(function(t,e){t.map=r[e],t.transparent=!0,t.opacity=0})):((i=this.__createSphere(.9)).material.map=r,i.material.transparent=!0,i.material.opacity=0,o.sphereCorrection&&this.setSphereCorrection(o.sphereCorrection,i)),s){var c=this.psv.dataHelper.cleanPosition(o),h=new e.Vector3(0,1,0);i.rotateOnWorldAxis(h,c.longitude-this.prop.position.longitude);var p=new e.Vector3(0,1,0).cross(this.camera.getWorldDirection(new e.Vector3)).normalize();i.rotateOnWorldAxis(p,c.latitude-this.prop.position.latitude),(this.config.latitudeRange||this.config.longitudeRange)&&(this.config.longitudeRange=null,this.config.latitudeRange=null,S("trying to perform transition with longitudeRange and/or latitudeRange, ranges cleared"))}return this.scene.add(i),this.psv.needsUpdate(),new V({properties:{opacity:{start:0,end:1},zoom:a?{start:this.prop.zoomLvl,end:o.zoom}:void 0},duration:o.transition,easing:"outCubic",onTick:function(t){if(n.prop.isCubemap)for(var e=0;e<6;e++)i.material[e].opacity=t.opacity;else i.material.opacity=t.opacity;a&&n.psv.zoom(t.zoom),n.psv.needsUpdate()}}).then(function(){n.setTexture(t),n.scene.remove(i),i.geometry.dispose(),i.geometry=null,o.sphereCorrection?n.setSphereCorrection(o.sphereCorrection):n.setSphereCorrection({}),s&&n.psv.rotate(o)})},i.__cleanTHREEScene=function(t){var e=this;t.traverse(function(o){o.geometry&&o.geometry.dispose(),o.material&&(Array.isArray(o.material)?o.material.forEach(function(t){t.map&&t.map.dispose(),t.dispose()}):(o.material.map&&o.material.map.dispose(),o.material.dispose())),o.dispose&&o.dispose(),o!==t&&e.__cleanTHREEScene(o)})},o}(_t),Tt=function(t){function o(e){var o;return(o=t.call(this,e)||this).requests=[],o}X(o,t);var r=o.prototype;return r.destroy=function(){this.abortLoading(),t.prototype.destroy.call(this)},r.loadTexture=function(t,e){var o=[];if(Array.isArray(t)){if(6!==t.length)throw new k("Must provide exactly 6 image paths when using cubemap.");for(var r=0;r<6;r++)o[r]=t[i[r]];return this.__loadCubemapTexture(o)}if("object"==typeof t){if(!n.every(function(e){return!!t[e]}))throw new k("Must provide exactly left, front, right, back, top, bottom when using cubemap.");return n.forEach(function(e,i){o[i]=t[e]}),this.__loadCubemapTexture(o)}return this.__loadEquirectangularTexture(t,e)},r.abortLoading=function(){[].concat(this.requests).forEach(function(t){return t.abort()})},r.__loadFile=function(t,o){var i=this;return new Promise(function(n,r){var s=0;o&&o(s);var a=new e.FileLoader;i.config.withCredentials&&a.setWithCredentials(!0),a.setResponseType("blob");var c=a.load(t,function(t){var e=i.requests.indexOf(c);-1!==e&&i.requests.splice(e,1),s=100,o&&o(s),n(t)},function(t){if(t.lengthComputable){var e=t.loaded/t.total*100;e>s&&(s=e,o&&o(s))}},function(t){var e=i.requests.indexOf(c);-1!==e&&i.requests.splice(e,1),r(t)});c instanceof XMLHttpRequest&&i.requests.push(c)})},r.__loadImage=function(t,e){return this.__loadFile(t,e).then(function(t){return new Promise(function(e,o){var i=document.createElementNS("http://www.w3.org/1999/xhtml","img");i.onload=function(){URL.revokeObjectURL(i.src),e(i)},i.onerror=o,i.src=URL.createObjectURL(t)})})},r.__loadBlobAsString=function(t){return new Promise(function(e,o){var i=new FileReader;i.onload=function(){return e(i.result)},i.onerror=o,i.readAsText(t)})},r.__loadEquirectangularTexture=function(t,e){var o=this;if(!0===this.prop.isCubemap)throw new k("The viewer was initialized with an cubemap, cannot switch to equirectangular panorama.");return this.prop.isCubemap=!1,(e||!this.config.useXmpData?this.__loadImage(t,function(t){return o.psv.loader.setProgress(t)}).then(function(t){return{img:t,newPanoData:e}}):this.__loadXMP(t,function(t){return o.psv.loader.setProgress(t)}).then(function(e){return o.__loadImage(t).then(function(t){return{img:t,newPanoData:e}})})).then(function(t){var e=t.img,i=t.newPanoData;"function"==typeof i&&(i=i(e));var n=i||{fullWidth:e.width,fullHeight:e.height,croppedWidth:e.width,croppedHeight:e.height,croppedX:0,croppedY:0};return n.croppedWidth===e.width&&n.croppedHeight===e.height||S("Invalid panoData, croppedWidth and/or croppedHeight is not coherent with loaded image\n panoData: "+n.croppedWidth+"x"+n.croppedHeight+", image: "+e.width+"x"+e.height),{texture:o.__createEquirectangularTexture(e,n),panoData:n}})},r.__loadXMP=function(t,e){var o=this;return this.__loadFile(t,e).then(function(t){return o.__loadBlobAsString(t)}).then(function(t){var e=t.indexOf("<x:xmpmeta"),o=t.indexOf("</x:xmpmeta>"),i=t.substring(e,o),n=null;return-1!==e&&-1!==o&&-1!==i.indexOf("GPano:")&&((n={fullWidth:parseInt(D(i,"FullPanoWidthPixels"),10),fullHeight:parseInt(D(i,"FullPanoHeightPixels"),10),croppedWidth:parseInt(D(i,"CroppedAreaImageWidthPixels"),10),croppedHeight:parseInt(D(i,"CroppedAreaImageHeightPixels"),10),croppedX:parseInt(D(i,"CroppedAreaLeftPixels"),10),croppedY:parseInt(D(i,"CroppedAreaTopPixels"),10)}).fullWidth&&n.fullHeight&&n.croppedWidth&&n.croppedHeight||(S("invalid XMP data"),n=null)),n})},r.__createEquirectangularTexture=function(t,o){var i;if(o.fullWidth>tt.maxTextureWidth||o.croppedWidth!==o.fullWidth||o.croppedHeight!==o.fullHeight){var n=Y({},o),r=tt.maxCanvasWidth/o.fullWidth;n.fullWidth*=r,n.fullHeight*=r,n.croppedWidth*=r,n.croppedHeight*=r,n.croppedX*=r,n.croppedY*=r;var s=document.createElement("canvas");s.width=n.fullWidth,s.height=n.fullHeight,s.getContext("2d").drawImage(t,n.croppedX,n.croppedY,n.croppedWidth,n.croppedHeight),i=new e.Texture(s)}else i=new e.Texture(t);return i.needsUpdate=!0,i.minFilter=e.LinearFilter,i.generateMipmaps=!1,i},r.__loadCubemapTexture=function(t){var e=this;if(!1===this.prop.isCubemap)throw new k("The viewer was initialized with an equirectangular panorama, cannot switch to cubemap.");this.config.fisheye&&S("fisheye effect with cubemap texture can generate distorsion"),this.prop.isCubemap=!0;for(var o=[],i=[0,0,0,0,0,0],n=function(n){o.push(e.__loadImage(t[n],function(t){i[n]=t,e.psv.loader.setProgress(x(i)/6)}).then(function(t){return e.__createCubemapTexture(t)}))},r=0;r<6;r++)n(r);return Promise.all(o).then(function(t){return{texture:t}})},r.__createCubemapTexture=function(t){var o;if(t.width>tt.maxTextureWidth){var i=document.createElement("canvas"),n=tt.maxCanvasWidth/t.width;i.width=t.width*n,i.height=t.height*n,i.getContext("2d").drawImage(t,0,0,i.width,i.height),o=new e.Texture(i)}else o=new e.Texture(t);return o.needsUpdate=!0,o.minFilter=e.LinearFilter,o.generateMipmaps=!1,o},r.preloadPanorama=function(t){return this.loadTexture(t)},o}(_t),xt={0:"left",.5:"center",1:"right"},Lt={0:"top",.5:"center",1:"bottom"},Mt={NONE:0,SHOWING:1,HIDING:2,READY:3},Ct=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-tooltip")||this).prop=Y({},i.prop,{},o,{state:Mt.NONE,width:0,height:0,pos:"",data:null}),i.content=document.createElement("div"),i.content.className="psv-tooltip-content",i.container.appendChild(i.content),i.arrow=document.createElement("div"),i.arrow.className="psv-tooltip-arrow",i.container.appendChild(i.arrow),i.container.addEventListener("transitionend",B(i)),i.container.style.top="-1000px",i.container.style.left="-1000px",i}X(e,t);var o=e.prototype;return o.destroy=function(){delete this.arrow,delete this.content,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case"transitionend":this.__onTransitionEnd(t)}},o.toggle=function(){throw new k("Tooltip cannot be toggled")},o.show=function(t){if(this.prop.state!==Mt.NONE)throw new k("Initialized tooltip cannot be re-initialized");t.className&&d(this.container,t.className),this.content.innerHTML=t.content;var e=this.container.getBoundingClientRect();this.prop.width=e.right-e.left,this.prop.height=e.bottom-e.top,this.prop.state=Mt.READY,this.move(t),this.prop.data=t.data,this.prop.state=Mt.SHOWING,this.psv.trigger(a.SHOW_TOOLTIP,this.prop.data,this)},o.move=function(t){if(this.prop.state!==Mt.SHOWING&&this.prop.state!==Mt.READY)throw new k("Uninitialized tooltip cannot be moved");var e=this.container,o=this.arrow;if(t.position||(t.position=["top","center"]),"string"==typeof t.position){var i=N(t.position);if(!(i.x in xt&&i.y in Lt))throw new k('Unable to parse tooltip position "'+t.position+'"');t.position=[Lt[i.y],xt[i.x]]}if("center"===t.position[0]&&"center"===t.position[1])throw new k('Unable to parse tooltip position "center center"');var n={posClass:t.position.slice(),width:this.prop.width,height:this.prop.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(n,t);var r=!1;n.top<this.prop.offset?(n.posClass[0]="bottom",r=!0):n.top+n.height>this.psv.prop.size.height-this.prop.offset&&(n.posClass[0]="top",r=!0),n.left<this.prop.offset?(n.posClass[1]="right",r=!0):n.left+n.width>this.psv.prop.size.width-this.prop.offset&&(n.posClass[1]="left",r=!0),r&&this.__computeTooltipPosition(n,t),e.style.top=n.top+"px",e.style.left=n.left+"px",o.style.top=n.arrowTop+"px",o.style.left=n.arrowLeft+"px";var s=n.posClass.join("-");s!==this.prop.pos&&(e.classList.remove("psv-tooltip--"+this.prop.pos),this.prop.pos=s,e.classList.add("psv-tooltip--"+this.prop.pos))},o.hide=function(){this.container.classList.remove("psv-tooltip--visible"),this.prop.state=Mt.HIDING,this.psv.trigger(a.HIDE_TOOLTIP,this.prop.data)},o.__onTransitionEnd=function(t){if("transform"===t.propertyName)switch(this.prop.state){case Mt.SHOWING:this.container.classList.add("psv-tooltip--visible"),this.prop.state=Mt.READY;break;case Mt.HIDING:this.prop.state=Mt.NONE,this.destroy()}},o.__computeTooltipPosition=function(t,e){var o=!1;switch(e.box||(e.box={width:0,height:0}),t.posClass[0]){case"bottom":t.top=e.top+e.box.height+this.prop.offset+this.prop.arrow,t.arrowTop=2*-this.prop.arrow,o=!0;break;case"center":t.top=e.top+e.box.height/2-t.height/2,t.arrowTop=t.height/2-this.prop.arrow;break;case"top":t.top=e.top-t.height-this.prop.offset-this.prop.arrow,t.arrowTop=t.height,o=!0}switch(t.posClass[1]){case"right":o?(t.left=e.left+e.box.width/2-this.prop.offset-this.prop.arrow,t.arrowLeft=this.prop.offset):(t.left=e.left+e.box.width+this.prop.offset+this.prop.arrow,t.arrowLeft=2*-this.prop.arrow);break;case"center":t.left=e.left+e.box.width/2-t.width/2,t.arrowLeft=t.width/2-this.prop.arrow;break;case"left":o?(t.left=e.left-t.width+e.box.width/2+this.prop.offset+this.prop.arrow,t.arrowLeft=t.width-this.prop.offset-2*this.prop.arrow):(t.left=e.left-t.width-this.prop.offset-this.prop.arrow,t.arrowLeft=t.width)}},e}(Z),Ot=function(t){function e(e){var o;o=t.call(this,e)||this;var i=new Ct(o.psv);return o.size={arrow:parseInt(E(i.arrow,"borderTopWidth"),10),offset:parseInt(E(i.container,"outlineWidth"),10)},i.destroy(),o}X(e,t);var o=e.prototype;return o.destroy=function(){delete this.size,t.prototype.destroy.call(this)},o.create=function(t){var e=new Ct(this.psv,this.size);return e.show(t),e},e}(_t);e.Cache.enabled=!0;var At=function(t){function o(o){var i;if(i=t.call(this)||this,tt.load(),!tt.isWebGLSupported)throw new k("WebGL is not supported.");if(0===tt.maxCanvasWidth||0===tt.maxTextureWidth)throw new k("Unable to detect system capabilities");return i.prop={ready:!1,uiRefresh:!1,needsUpdate:!1,fullscreen:!1,isCubemap:void 0,position:{longitude:0,latitude:0},direction:null,zoomLvl:null,vFov:null,hFov:null,aspect:null,moveSpeed:.1,autorotateCb:null,animationPromise:null,loadingPromise:null,startTimeout:null,size:{width:0,height:0},panoData:{fullWidth:0,fullHeight:0,croppedWidth:0,croppedHeight:0,croppedX:0,croppedY:0}},i.config=function(t){var e=I(st);z(e,t);var o={};return R(e,function(t,i){if(!Object.prototype.hasOwnProperty.call(st,i))throw new k("Unknown option "+i);ct[i]?o[i]=ct[i](t,e):o[i]=t}),o}(o),i.parent="string"==typeof o.container?document.getElementById(o.container):o.container,i.parent[r]=B(i),i.container=document.createElement("div"),i.container.classList.add("psv-container"),i.parent.appendChild(i.container),i.children=[],i.plugins={},i.renderer=new yt(B(i)),i.textureLoader=new Tt(B(i)),i.eventsHandler=new Et(B(i)),i.dataHelper=new bt(B(i)),i.loader=new ft(B(i)),i.navbar=new dt(B(i)),i.panel=new wt(B(i)),i.tooltip=new Ot(B(i)),i.notification=new mt(B(i)),i.overlay=new gt(B(i)),i.eventsHandler.init(),i.__resizeRefresh=A(function(){return i.refreshUi("resize")},500),i.resize(i.config.size),i.prop.moveSpeed=e.Math.degToRad(i.config.moveSpeed/tt.pixelRatio),i.config.plugins.forEach(function(t){var e=t[0],o=t[1];i.plugins[e.id]=new e(B(i),o)}),i.navbar.setButtons(i.config.navbar),i.config.panorama&&i.setPanorama(i.config.panorama),tt.isTouchEnabled.then(function(t){return u(i.container,"psv--is-touch",t)}),i.once(a.RENDER,function(){i.config.navbar&&(i.container.classList.add("psv--has-navbar"),i.navbar.show()),i.config.autorotateDelay&&(i.prop.startTimeout=setTimeout(function(){return i.startAutorotate()},i.config.autorotateDelay)),i.prop.ready=!0,setTimeout(function(){i.refreshUi("init"),i.trigger(a.READY)},0)}),i}X(o,t);var i=o.prototype;return i.destroy=function(){this.__stopAll(),this.stopKeyboardControl(),this.exitFullscreen(),this.eventsHandler.destroy(),this.renderer.destroy(),this.textureLoader.destroy(),this.dataHelper.destroy(),this.children.slice().forEach(function(t){return t.destroy()}),this.children.length=0,R(this.plugins,function(t){return t.destroy()}),delete this.plugins,this.parent.removeChild(this.container),delete this.parent[r],delete this.parent,delete this.container,delete this.loader,delete this.navbar,delete this.panel,delete this.tooltip,delete this.notification,delete this.overlay,delete this.config},i.refreshUi=function(t){var e=this;this.prop.ready&&(this.prop.uiRefresh?"new"!==this.prop.uiRefresh&&(this.prop.uiRefresh="new",setTimeout(function(){e.prop.uiRefresh=!1,e.refreshUi(t)})):(this.prop.uiRefresh=!0,this.children.every(function(t){return t.refreshUi(),!0===e.prop.uiRefresh}),this.prop.uiRefresh=!1))},i.getPlugin=function(t){return t?this.plugins["function"==typeof t?t.id:t]:null},i.getPosition=function(){return{longitude:this.prop.position.longitude,latitude:this.prop.position.latitude}},i.getZoomLevel=function(){return this.prop.zoomLvl},i.getSize=function(){return{width:this.prop.size.width,height:this.prop.size.height}},i.isAutorotateEnabled=function(){return!!this.prop.autorotateCb},i.isFullscreenEnabled=function(){return tt.fullscreenEvent?w(this.container):this.prop.fullscreen},i.needsUpdate=function(){this.prop.needsUpdate=!0,!this.renderer.mainReqid&&this.renderer.renderer&&this.renderer.__renderLoop(+new Date)},i.autoSize=function(){this.container.clientWidth===this.prop.size.width&&this.container.clientHeight===this.prop.size.height||(this.prop.size.width=Math.round(this.container.clientWidth),this.prop.size.height=Math.round(this.container.clientHeight),this.prop.aspect=this.prop.size.width/this.prop.size.height,this.prop.hFov=this.dataHelper.vFovToHFov(this.prop.vFov),this.needsUpdate(),this.trigger(a.SIZE_UPDATED,this.getSize()),this.__resizeRefresh())},i.setPanorama=function(t,e){var o=this;void 0===e&&(e={}),null!==this.prop.loadingPromise&&this.textureLoader.abortLoading(),this.prop.ready||("longitude"in e||this.prop.isCubemap||(e.longitude=this.config.defaultLong),"latitude"in e||this.prop.isCubemap||(e.latitude=this.config.defaultLat),"zoom"in e||(e.zoom=this.config.defaultZoomLvl),"sphereCorrection"in e||(e.sphereCorrection=this.config.sphereCorrection),"panoData"in e||(e.panoData=this.config.panoData)),void 0!==e.transition&&!0!==e.transition||(e.transition=1500),void 0===e.showLoader&&(e.showLoader=!0);var i=this.dataHelper.isExtendedPosition(e),n="zoom"in e;(i||n)&&this.__stopAll(),this.hideError(),this.config.panorama=t;var r=function(t){return t&&"abort"===t.type?console.warn(t):t&&(o.showError(o.config.lang.loadError),console.error(t)),o.loader.hide(),o.renderer.show(),o.prop.loadingPromise=null,!t||Promise.reject(t)};return e.transition&&this.prop.ready?(e.showLoader&&this.loader.show(),this.prop.loadingPromise=this.textureLoader.loadTexture(this.config.panorama).then(function(t){return o.loader.hide(),o.renderer.transition(t,e)}).then(r,r)):(!e.showLoader&&this.prop.ready||this.loader.show(),this.prop.loadingPromise=this.textureLoader.loadTexture(this.config.panorama,e.panoData).then(function(t){o.renderer.setTexture(t),e.sphereCorrection&&o.renderer.setSphereCorrection(e.sphereCorrection),n&&o.zoom(e.zoom),i&&o.rotate(e)}).then(r,r)),this.prop.loadingPromise},i.setOptions=function(t){var o=this;R(t,function(i,n){if(!Object.prototype.hasOwnProperty.call(st,n))throw new k("Unknown option "+n);if(at[n])throw new k(at[n]);switch(ct[n]?o.config[n]=ct[n](i,t):o.config[n]=i,n){case"caption":o.navbar.setCaption(i);break;case"size":o.resize(i);break;case"sphereCorrection":o.renderer.setSphereCorrection(i);break;case"navbar":case"lang":o.navbar.setButtons(o.config.navbar);break;case"moveSpeed":o.prop.moveSpeed=e.Math.degToRad(i/tt.pixelRatio);break;case"minFov":case"maxFov":o.prop.zoomLvl=o.dataHelper.fovToZoomLevel(o.prop.vFov),o.trigger(a.ZOOM_UPDATED,o.getZoomLevel())}}),this.needsUpdate(),this.refreshUi("set options"),this.trigger(a.CONFIG_CHANGED,Object.keys(t))},i.setOption=function(t,e){var o;this.setOptions(((o={})[t]=e,o))},i.startAutorotate=function(){var t,e,o=this;this.__stopAll(),this.prop.autorotateCb=function(i,n){e=void 0===t?0:n-t,t=n,o.rotate({longitude:o.prop.position.longitude+o.config.autorotateSpeed*e/1e3,latitude:o.prop.position.latitude-(o.prop.position.latitude-o.config.autorotateLat)/200})},this.on(a.BEFORE_RENDER,this.prop.autorotateCb),this.trigger(a.AUTOROTATE,!0)},i.stopAutorotate=function(){this.prop.startTimeout&&(clearTimeout(this.prop.startTimeout),this.prop.startTimeout=null),this.isAutorotateEnabled()&&(this.off(a.BEFORE_RENDER,this.prop.autorotateCb),this.prop.autorotateCb=null,this.trigger(a.AUTOROTATE,!1))},i.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},i.showError=function(t){this.overlay.show({id:h.ERROR,image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70"><path d="M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z"/><rect x="48" y="31.7" width="4" height="28"/><rect x="48" y="63.2" width="4" height="5"/>\x3c!--Created by Shastry from the Noun Project--\x3e</svg>\n',text:t,dissmisable:!1})},i.hideError=function(){this.overlay.hide(h.ERROR)},i.rotate=function(t){if(!this.trigger(a.BEFORE_ROTATE,t).isDefaultPrevented()){var e=this.change(c.GET_ROTATE_POSITION,this.dataHelper.cleanPosition(t));this.prop.position.longitude===e.longitude&&this.prop.position.latitude===e.latitude||(this.prop.position.longitude=e.longitude,this.prop.position.latitude=e.latitude,this.needsUpdate(),this.trigger(a.POSITION_UPDATED,this.getPosition()))}},i.animate=function(t){var e=this;this.__stopAll();var o,i=this.dataHelper.isExtendedPosition(t),n="zoom"in t,r={};if(i){var s=this.change(c.GET_ANIMATE_POSITION,this.dataHelper.cleanPosition(t)),a=M(this.prop.position.longitude,s.longitude);r.longitude={start:this.prop.position.longitude,end:this.prop.position.longitude+a},r.latitude={start:this.prop.position.latitude,end:s.latitude},o=this.dataHelper.speedToDuration(t.speed,C(this.prop.position,s))}if(n){var h=Math.abs(t.zoom-this.prop.zoomLvl);r.zoom={start:this.prop.zoomLvl,end:t.zoom},o||(o=this.dataHelper.speedToDuration(t.speed,Math.PI/4*h/100))}return o?(this.prop.animationPromise=new V({properties:r,duration:o,easing:"inOutSine",onTick:function(t){i&&e.rotate(t),n&&e.zoom(t.zoom)}}),this.prop.animationPromise):(i&&this.rotate(t),n&&this.zoom(t.zoom),V.resolve())},i.stopAnimation=function(){var t=this;return this.prop.animationPromise?new Promise(function(e){t.prop.animationPromise.finally(e),t.prop.animationPromise.cancel(),t.prop.animationPromise=null}):Promise.resolve()},i.zoom=function(t){var e=T(t,0,100);this.prop.zoomLvl!==e&&(this.prop.zoomLvl=e,this.prop.vFov=this.dataHelper.zoomLevelToFov(this.prop.zoomLvl),this.prop.hFov=this.dataHelper.vFovToHFov(this.prop.vFov),this.needsUpdate(),this.trigger(a.ZOOM_UPDATED,this.getZoomLevel()),this.rotate(this.prop.position))},i.zoomIn=function(){this.zoom(this.prop.zoomLvl+this.config.zoomButtonIncrement)},i.zoomOut=function(){this.zoom(this.prop.zoomLvl-this.config.zoomButtonIncrement)},i.resize=function(t){var e=this;["width","height"].forEach(function(o){t&&t[o]&&(/^[0-9.]+$/.test(t[o])&&(t[o]+="px"),e.parent.style[o]=t[o])}),this.autoSize()},i.enterFullscreen=function(){tt.fullscreenEvent?_(this.container):(this.container.classList.add("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!0))},i.exitFullscreen=function(){this.isFullscreenEnabled()&&(tt.fullscreenEvent?b():(this.container.classList.remove("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!1)))},i.toggleFullscreen=function(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()},i.startKeyboardControl=function(){this.eventsHandler.enableKeyboard()},i.stopKeyboardControl=function(){this.eventsHandler.disableKeyboard()},i.__stopAll=function(){this.stopAutorotate(),this.stopAnimation(),this.trigger(a.STOP_ALL)},o}(o.EventEmitter);t.AbstractButton=G,t.AbstractPlugin=vt,t.Animation=V,t.CONSTANTS=l,t.DEFAULTS=st,t.PSVError=k,t.SYSTEM=tt,t.Viewer=At,t.registerButton=ut,t.utils=W,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
//# sourceMappingURL=/sm/2503706bc3bad5ee806a4dc863db6a385e734b24eea820abaf4314e16f95f95d.map
|