/** * Minified by jsDelivr using Terser v5.14.1. * Original file: /npm/photo-sphere-viewer@4.7.1/dist/photo-sphere-viewer.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ /*! * Photo Sphere Viewer 4.7.1 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) */ !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="undefined"!=typeof globalThis?globalThis:t||self).PhotoSphereViewer={},t.THREE,t.uEvent)}(this,(function(t,e,o){"use strict";function i(t){this.message=t,"captureStackTrace"in Error?Error.captureStackTrace(this,i):this.stack=(new Error).stack}i.prototype=Object.create(Error.prototype),i.prototype.name="PSVError",i.prototype.constructor=i;var n=function(){function t(t){this.psv=t}var o=t.prototype;return o.destroy=function(){delete this.psv},o.supportsTransition=function(t){return!1},o.supportsPreload=function(t){return!1},o.loadTexture=function(t,e,o){throw new i("loadTexture not implemented")},o.createMesh=function(t){throw new i("createMesh not implemented")},o.setTexture=function(t,e,o){throw new i("setTexture not implemented")},o.setTextureOpacity=function(t,e){throw new i("setTextureOpacity not implemented")},o.disposeTexture=function(t){throw new i("disposeTexture not implemented")},o.setOverlay=function(t,e,o){throw new i("setOverlay not implemented")},t.createOverlayMaterial=function(){var o;return new e.ShaderMaterial({uniforms:(o={},o[t.OVERLAY_UNIFORMS.panorama]={value:new e.Texture},o[t.OVERLAY_UNIFORMS.overlay]={value:new e.Texture},o[t.OVERLAY_UNIFORMS.globalOpacity]={value:1},o[t.OVERLAY_UNIFORMS.overlayOpacity]={value:1},o),vertexShader:"\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"\nuniform sampler2D "+t.OVERLAY_UNIFORMS.panorama+";\nuniform sampler2D "+t.OVERLAY_UNIFORMS.overlay+";\nuniform float "+t.OVERLAY_UNIFORMS.globalOpacity+";\nuniform float "+t.OVERLAY_UNIFORMS.overlayOpacity+";\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 tColor1 = texture2D( "+t.OVERLAY_UNIFORMS.panorama+", vUv );\n vec4 tColor2 = texture2D( "+t.OVERLAY_UNIFORMS.overlay+", vUv );\n gl_FragColor = vec4( \n mix( tColor1.rgb, tColor2.rgb, tColor2.a * "+t.OVERLAY_UNIFORMS.overlayOpacity+" ), \n "+t.OVERLAY_UNIFORMS.globalOpacity+"\n );\n}"})},t}();function r(t,e){for(var o=0;o0;T in localStorage&&(t="true"===localStorage[T]);var e=new Promise((function(e){var o,i=function(){o(),localStorage[T]=!1,e(!1)},n=function(){o(),localStorage[T]=!0,e(!0)},r=function(){o(),localStorage[T]=t,e(t)};window.addEventListener("mousedown",i,!1),window.addEventListener("touchstart",n,!1);var s=setTimeout(r,1e4);o=function(){window.removeEventListener("mousedown",i),window.removeEventListener("touchstart",n),clearTimeout(s)}}));return{initial:t,promise:e}}(),b.maxTextureWidth=function(t){return null!==t?t.getParameter(t.MAX_TEXTURE_SIZE):0}(t),b.mouseWheelEvent="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",b.fullscreenEvent=(e=Object.keys(M).filter((function(t){return t in document}))).length?M[e[0]]:null}var e};var O=null;b.getMaxCanvasWidth=function(){return null===O&&(O=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(o.getImageData(0,0,1,1).data[0]>0)return e.width}catch(t){}e.width/=2,e.height/=2}throw new i("Unable to detect system capabilities")}(b.maxTextureWidth)),O};var M={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"};function L(t,e,o){void 0===o?t.classList.toggle(e):o?t.classList.add(e):o||t.classList.remove(e)}function x(t,e){var o;(o=t.classList).add.apply(o,e.split(" "))}function C(t,e){if(!t.matches)return null;var o=t;do{if(o.matches(e))return o;o=o instanceof SVGElement?o.parentNode:o.parentElement}while(o);return null}function P(t){for(var e=0,o=0,i=t;i;)e+=i.offsetLeft-i.scrollLeft+i.clientLeft,o+=i.offsetTop-i.scrollTop+i.clientTop,i=i.offsetParent;return{left:e,top:o}}function A(t){return(document.fullscreenElement||document.webkitFullscreenElement)===t}function I(t){(t.requestFullscreen||t.webkitRequestFullscreen).call(t)}function S(){(document.exitFullscreen||document.webkitExitFullscreen).call(document)}function R(t,e){return window.getComputedStyle(t,null)[e]} /** * @summary Normalize mousewheel values accross browsers * @memberOf PSV.utils * @description From Facebook's Fixed Data Table * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js} * @copyright Facebook * @param {WheelEvent} event * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}} */function k(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 D(t,e){var o=t%e;return o<0&&(o+=e),o}function N(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function U(t,e){return[0,2*Math.PI,2*-Math.PI].reduce((function(o,i){var n=e-t+i;return Math.abs(n)0?"-":"")+t.toLowerCase()}))} /** * @summary Returns a function, that, when invoked, will only be triggered at most once during a given window of time. * @memberOf PSV.utils * @copyright underscore.js - modified by Clément Prévost {@link http://stackoverflow.com/a/27078401} * @param {Function} func * @param {number} wait * @returns {Function} */function F(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 V(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} /** * @summary Merges the enumerable attributes of two objects * @memberOf PSV.utils * @description Replaces arrays and alters the target object. * @copyright Nicholas Fisher * @param {Object} target * @param {Object} src * @returns {Object} target */function W(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]&&V(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 Y(t){return W(null,t)}function j(t){return!t||0===Object.keys(t).length&&t.constructor===Object}function Z(t,e){Object.keys(t).forEach((function(o){e(t[o],o)}))}function X(t){return null==t}function B(){for(var t=arguments.length,e=new Array(t),o=0;o(.*)");if(null!==o){var i=parseInt(o[1],10);return isNaN(i)?null:i}if(null!==(o=t.match("GPano:"+e+'="(.*?)"'))){var n=parseInt(o[1],10);return isNaN(n)?null:n}return null}var et={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"};function ot(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!==et[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 et[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}}var it={0:"left",.5:"center",1:"right"},nt={0:"top",.5:"center",1:"bottom"};function rt(t,e){if(void 0===e&&(e=!0),"string"==typeof t){var o=ot(t);if(!(o.x in it)||!(o.y in nt))throw new i('Unable to parse position "'+t+'"');t=[nt[o.y],it[o.x]]}if(!e&&"center"===t[0]&&"center"===t[1])throw new i('Unable to parse position "center center"');return t}function st(t){var o;if("string"==typeof t){var n=t.toString().trim(),r=parseFloat(n.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),s=n.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(s.match(/(pm|per minute)$/)&&(r/=60),s){case"dpm":case"degrees per minute":case"dps":case"degrees per second":o=e.MathUtils.degToRad(r);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":o=r;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":o=r*Math.PI*2;break;default:throw new i('Unknown speed unit "'+s+'"')}}else o=t;return o}function at(t,o,n){var r;if(void 0===o&&(o=!1),void 0===n&&(n=o),"string"==typeof t){var s=t.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!s)throw new i('Unknown angle "'+t+'"');var a=parseFloat(s[1]),c=s[2];if(c)switch(c){case"deg":case"degs":r=e.MathUtils.degToRad(a);break;case"rad":case"rads":r=a;break;default:throw new i('Unknown angle unit "'+c+'"')}else r=a}else{if("number"!=typeof t||isNaN(t))throw new i('Unknown angle "'+t+'"');r=t}return r=D(o?r+Math.PI:r,2*Math.PI),o?e.MathUtils.clamp(r-Math.PI,-Math.PI/(n?2:1),Math.PI/(n?2:1)):r}function ct(t){var o=new e.Texture(t);return o.needsUpdate=!0,o.minFilter=e.LinearFilter,o.generateMipmaps=!1,o}var ht=new e.Quaternion;function lt(t,e){ht.setFromEuler(e).invert(),t.applyQuaternion(ht)}var pt=function(){function t(t){var e=this;this.__callbacks=[],t?(t.easing&&"string"!=typeof t.easing||(t.easing=w[t.easing||"linear"]),this.__start=null,this.options=t,t.delay?this.__delayTimeout=setTimeout((function(){e.__delayTimeout=null,e.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))}),t.delay):this.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))):this.__resolved=!0}var e=t.prototype;return e.__run=function(t){var e=this;null===this.__start&&(this.__start=t);var o=(t-this.__start)/this.options.duration,i={};o<1?(Z(this.options.properties,(function(t,n){t&&(i[n]=t.start+(t.end-t.start)*e.options.easing(o))})),this.options.onTick(i,o),this.__animationFrame=window.requestAnimationFrame((function(t){return e.__run(t)}))):(Z(this.options.properties,(function(t,e){t&&(i[e]=t.end)})),this.options.onTick(i,1),this.__animationFrame=window.requestAnimationFrame((function(){e.__resolved=!0,e.__resolve(!0)})))},e.__resolve=function(t){this.__callbacks.forEach((function(e){return e(t)})),this.__callbacks.length=0},e.then=function(t){var e=this;return this.__resolved||this.__cancelled?Promise.resolve(this.__resolved).then(t):new Promise((function(t){e.__callbacks.push(t)})).then(t)},e.cancel=function(){this.__cancelled||this.__resolved||(this.__cancelled=!0,this.__resolve(!1),this.__delayTimeout&&(window.clearTimeout(this.__delayTimeout),this.__delayTimeout=null),this.__animationFrame&&(window.cancelAnimationFrame(this.__animationFrame),this.__animationFrame=null))},t}(),ut=function(){function t(e,o,n,r,s){if(void 0===o&&(o=0),void 0===n&&(n=-1/0),void 0===r&&(r=1/0),void 0===s&&(s=!1),this.fn=e,this.mode=t.STOP,this.speed=0,this.speedMult=1,this.currentSpeed=0,this.target=0,this.current=o,this.min=n,this.max=r,this.loopValue=s,s&&0!==n)throw new i("invalid config");this.fn&&this.fn(o)}var o=t.prototype;return o.setSpeed=function(t){this.speed=t},o.goto=function(o,i){void 0===i&&(i=1),this.mode=t.POSITION,this.target=this.loopValue?D(o,this.max):e.MathUtils.clamp(o,this.min,this.max),this.speedMult=i},o.step=function(e,o){void 0===o&&(o=1),this.mode!==t.POSITION&&(this.target=this.current),this.goto(this.target+e,o)},o.roll=function(e,o){void 0===e&&(e=!1),void 0===o&&(o=1),this.mode=t.INFINITE,this.target=e?-1/0:1/0,this.speedMult=o},o.stop=function(){this.mode=t.STOP},o.setValue=function(o){return this.target=this.loopValue?D(o,this.max):e.MathUtils.clamp(o,this.min,this.max),this.mode=t.STOP,this.target!==this.current&&(this.current=this.target,this.fn&&this.fn(this.current),!0)},o.update=function(o){if(this.mode===t.POSITION){this.loopValue&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.currentn&&(this.currentSpeed=Math.max(n,this.currentSpeed-o/1e3*this.speed*this.speedMult*2));var r=null;return this.current>this.target&&this.currentSpeed?r=Math.max(this.target,this.current+this.currentSpeed*o/1e3):this.current"),i=t.substring(e,o);return-1!==e&&-1!==o&&i.includes("GPano:")?{fullWidth:tt(i,"FullPanoWidthPixels"),fullHeight:tt(i,"FullPanoHeightPixels"),croppedWidth:tt(i,"CroppedAreaImageWidthPixels"),croppedHeight:tt(i,"CroppedAreaImageHeightPixels"),croppedX:tt(i,"CroppedAreaLeftPixels"),croppedY:tt(i,"CroppedAreaTopPixels"),poseHeading:tt(i,"PoseHeadingDegrees"),posePitch:tt(i,"PosePitchDegrees"),poseRoll:tt(i,"PoseRollDegrees")}:null}))},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.__createEquirectangularTexture=function(t,e){if(e.fullWidth>b.maxTextureWidth||e.croppedWidth!==e.fullWidth||e.croppedHeight!==e.fullHeight){var o=b.getMaxCanvasWidth()/e.fullWidth,i=a({},e);o<1&&(i.fullWidth*=o,i.fullHeight*=o,i.croppedWidth*=o,i.croppedHeight*=o,i.croppedX*=o,i.croppedY*=o);var n=document.createElement("canvas");return n.width=i.fullWidth,n.height=i.fullHeight,n.getContext("2d").drawImage(t,i.croppedX,i.croppedY,i.croppedWidth,i.croppedHeight),ct(n)}return ct(t)},r.createMesh=function(t){void 0===t&&(t=1);var o=new e.SphereGeometry(p*t,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS,-Math.PI/2).scale(-1,1,1),i=n.createOverlayMaterial();return new e.Mesh(o,i)},r.setTexture=function(t,e){this.__setUniform(t,n.OVERLAY_UNIFORMS.panorama,e.texture),this.setOverlay(t,null)},r.setOverlay=function(t,o,i){this.__setUniform(t,n.OVERLAY_UNIFORMS.overlayOpacity,i),o?this.__setUniform(t,n.OVERLAY_UNIFORMS.overlay,o.texture):this.__setUniform(t,n.OVERLAY_UNIFORMS.overlay,new e.Texture)},r.setTextureOpacity=function(t,e){this.__setUniform(t,n.OVERLAY_UNIFORMS.globalOpacity,e),t.material.transparent=e<1},r.disposeTexture=function(t){var e;null==(e=t.texture)||e.dispose()},r.__setUniform=function(t,o,i){t.material.uniforms[o].value instanceof e.Texture&&t.material.uniforms[o].value.dispose(),t.material.uniforms[o].value=i},o}(n);mt.id="equirectangular",mt.supportsDownload=!0,mt.supportsOverlay=!0;var gt=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}(),_t=function(t){function e(e,o,i,n){var r;return void 0===o&&(o=""),void 0===i&&(i=!1),void 0===n&&(n=!0),(r=t.call(this,e,"psv-button "+o)||this).prop=a({},r.prop,{id:r.constructor.id,collapsable:i,enabled:!0,supported:!0,collapsed:!1,active:!1,width:r.container.offsetWidth}),r.constructor.icon&&r.__setIcon(r.constructor.icon),r.prop.id&&r.psv.config.lang[r.prop.id]&&(r.container.title=r.psv.config.lang[r.prop.id]),n&&(r.container.tabIndex=0),r.container.addEventListener("click",(function(t){r.prop.enabled&&r.onClick(),t.stopPropagation()})),r.container.addEventListener("keydown",(function(t){t.key===y.Enter&&r.prop.enabled&&(r.onClick(),t.stopPropagation())})),r}c(e,t);var o=e.prototype;return o.checkSupported=function(){var t=this,e=this.isSupported();V(e)?(!1===e.initial&&(this.hide(),this.prop.supported=!1),e.promise.then((function(e){t.prop&&(t.prop.supported=e,e?t.show():t.hide())}))):(this.prop.supported=e,e||this.hide())},o.isSupported=function(){return!0},o.toggleActive=function(t){this.prop.active=void 0!==t?t:!this.prop.active,L(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").classList.add("psv-button-svg")):e.innerHTML=""},o.onClick=function(){throw new i('onClick not implemented for button "'+this.prop.id+'".')},e}(gt);_t.id=null,_t.groupId=null,_t.icon=null,_t.iconActive=null;var wt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-autorotate-button",!0)||this).psv.on(f.AUTOROTATE,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.AUTOROTATE,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(t.type===f.AUTOROTATE)this.toggleActive(t.args[0])},o.onClick=function(){this.psv.isAutorotateEnabled()&&(this.psv.config.autorotateIdle=!1,this.psv.resetIdleTimer()),this.psv.toggleAutorotate()},e}(_t);wt.id="autorotate",wt.icon='\x3c!--Created by Nick Bluth from the Noun Project--\x3e\n',wt.iconActive='\x3c!--Created by Nick Bluth from the Noun Project--\x3e\n';var yt=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-custom-button",!1!==o.collapsable,!1!==o.tabbable)||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&&x(i.container,i.config.className),i.config.title&&(i.container.title=i.config.title),i.config.content&&(i.container.innerHTML=i.config.content),i.prop.width=i.container.offsetWidth,!1===i.config.enabled&&i.disable(),!1===i.config.visible&&i.hide(),i}c(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.call(this.psv,this.psv)},e}(_t),Et=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-description-button")||this).prop=a({},o.prop,{mode:null}),o.psv.on(f.HIDE_NOTIFICATION,l(o)),o.psv.on(f.SHOW_NOTIFICATION,l(o)),o.psv.on(f.CLOSE_PANEL,l(o)),o.psv.on(f.OPEN_PANEL,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.HIDE_NOTIFICATION,this),this.psv.off(f.SHOW_NOTIFICATION,this),this.psv.off(f.CLOSE_PANEL,this),this.psv.off(f.OPEN_PANEL,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(this.prop.mode){var e=!1;switch(t.type){case f.HIDE_NOTIFICATION:e=1===this.prop.mode;break;case f.SHOW_NOTIFICATION:e=1===this.prop.mode&&t.args[0]!==_.DESCRIPTION;break;case f.CLOSE_PANEL:e=2===this.prop.mode;break;case f.OPEN_PANEL:e=2===this.prop.mode&&t.args[0]!==_.DESCRIPTION}e&&(this.toggleActive(!1),this.prop.mode=null)}},o.hide=function(e){t.prototype.hide.call(this,e),this.prop.mode&&this.__close()},o.refreshUi=function(t){if(void 0===t&&(t=!1),t){var e=this.psv.navbar.getButton("caption",!1),o=e&&!e.isVisible(),i=!!this.psv.config.description;o||i?this.show(!1):this.hide(!1)}},o.onClick=function(){this.prop.mode?this.__close():this.__open()},o.__close=function(){switch(this.prop.mode){case 1:this.psv.notification.hide(_.DESCRIPTION);break;case 2:this.psv.panel.hide(_.DESCRIPTION)}},o.__open=function(){this.toggleActive(!0),this.psv.config.description?(this.prop.mode=2,this.psv.panel.show({id:_.DESCRIPTION,content:(this.psv.config.caption?"

"+this.psv.config.caption+"

":"")+this.psv.config.description})):(this.prop.mode=1,this.psv.notification.show({id:_.DESCRIPTION,content:this.psv.config.caption}))},e}(_t);Et.id="description",Et.icon='\x3c!--Created by Arafat Uddin from the Noun Project--\x3e\n';var Tt=function(t){function e(e){return t.call(this,e,"psv-button--hover-scale psv-download-button",!0)||this}c(e,t);var o=e.prototype;return o.onClick=function(){var t=this,e=document.createElement("a");e.href=this.psv.config.downloadUrl||this.psv.config.panorama,e.download=e.href.split("/").pop(),this.psv.container.appendChild(e),e.click(),setTimeout((function(){t.psv.container.removeChild(e)}),100)},o.refreshUi=function(){var t=this.psv.adapter.constructor.supportsDownload||this.psv.config.downloadUrl;t&&!this.prop.visible?this.show():!t&&this.prop.visible&&this.hide()},e}(_t);Tt.id="download",Tt.icon='\x3c!--Created by Michael Zenaty from the Noun Project--\x3e\n';var bt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-fullscreen-button")||this).psv.on(f.FULLSCREEN_UPDATED,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.FULLSCREEN_UPDATED,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){if(t.type===f.FULLSCREEN_UPDATED)this.toggleActive(t.args[0])},o.onClick=function(){this.psv.toggleFullscreen()},e}(_t);bt.id="fullscreen",bt.icon='\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n',bt.iconActive='\x3c!--Created by Garrett Knoll from the Noun Project--\x3e\n';var Ot='\x3c!-- Created by Richard Kunák from the Noun Project--\x3e\n',Mt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-button--hover-scale psv-menu-button")||this).psv.on(f.OPEN_PANEL,l(o)),o.psv.on(f.CLOSE_PANEL,l(o)),t.prototype.hide.call(l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.OPEN_PANEL,this),this.psv.off(f.CLOSE_PANEL,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.OPEN_PANEL:this.toggleActive(t.args[0]===_.MENU);break;case f.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=this;this.psv.panel.show({id:_.MENU,content:e.MENU_TEMPLATE(this.parent.collapsed,this.psv,z(e.BUTTON_DATA)),noMargin:!0,clickHandler:function(o){var i=o.target?C(o.target,"li"):void 0,n=i?i.dataset[e.BUTTON_DATA]:void 0;n&&(t.parent.getButton(n).onClick(),t.__hideMenu())}})},o.__hideMenu=function(){this.psv.panel.hide(_.MENU)},e}(_t);Mt.id="menu",Mt.icon=Ot,Mt.BUTTON_DATA="psvButton",Mt.MENU_TEMPLATE=function(t,e,o){return'\n
\n

'+Ot+" "+e.config.lang.menu+'

\n
    \n '+t.map((function(t){return"\n
  • \n '+t.container.innerHTML+'\n '+t.container.title+"\n
  • \n "})).join("")+"\n
\n
\n"};var Lt=function(){function t(t){void 0===t&&(t=200),this.delay=t,this.time=0,this.timeout=null}var e=t.prototype;return e.down=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.time=(new Date).getTime()},e.up=function(t){var e=this;this.time&&((new Date).getTime()-this.time\x3c!-- Created by Flatart from the Noun Project --\x3e\n'.replace("rotate(0","rotate("+e)}var Ct=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-move-button")||this).container.title=i.psv.config.lang.move,i.prop=a({},i.prop,{value:o,handler:new Lt}),i.container.addEventListener("mousedown",l(i)),i.container.addEventListener("keydown",l(i)),i.container.addEventListener("keyup",l(i)),i.psv.container.addEventListener("mouseup",l(i)),i.psv.container.addEventListener("touchend",l(i)),i}c(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();break;case"keydown":t.key===y.Enter&&this.__onMouseDown();break;case"keyup":t.key===y.Enter&&this.__onMouseUp()}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.onClick=function(){},o.__onMouseDown=function(){this.prop.enabled&&(this.psv.__stopAll(),this.psv.dynamics.position.roll(this.prop.value),this.prop.handler.down())},o.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up((function(){t.psv.dynamics.position.stop(),t.psv.resetIdleTimer()}))},e}(_t);Ct.groupId="move";var Pt=function(t){function e(e){return t.call(this,e,{latitude:!0})||this}return c(e,t),e}(Ct);Pt.id="moveDown",Pt.icon=xt("down");var At=function(t){function e(e){return t.call(this,e,{longitude:!0})||this}return c(e,t),e}(Ct);At.id="moveLeft",At.icon=xt("left");var It=function(t){function e(e){return t.call(this,e,{longitude:!1})||this}return c(e,t),e}(Ct);It.id="moveRight",It.icon=xt("right");var St=function(t){function e(e){return t.call(this,e,{latitude:!1})||this}return c(e,t),e}(Ct);St.id="moveUp",St.icon=xt("up");var Rt=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-button--hover-scale psv-zoom-button")||this).prop=a({},i.prop,{value:o,handler:new Lt}),i.container.addEventListener("mousedown",l(i)),i.container.addEventListener("keydown",l(i)),i.container.addEventListener("keyup",l(i)),i.psv.container.addEventListener("mouseup",l(i)),i.psv.container.addEventListener("touchend",l(i)),i}c(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();break;case"keydown":t.key===y.Enter&&this.__onMouseDown();break;case"keyup":t.key===y.Enter&&this.__onMouseUp()}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.then((function(t){return!t}))}},o.onClick=function(){},o.__onMouseDown=function(){this.prop.enabled&&(this.psv.dynamics.zoom.roll(this.prop.value),this.prop.handler.down())},o.__onMouseUp=function(){var t=this;this.prop.enabled&&this.prop.handler.up((function(){return t.psv.dynamics.zoom.stop()}))},e}(_t);Rt.groupId="zoom";var kt=function(t){function e(e){return t.call(this,e,!1)||this}return c(e,t),e}(Rt);kt.id="zoomIn",kt.icon='\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n';var Dt=function(t){function e(e){return t.call(this,e,!0)||this}return c(e,t),e}(Rt);Dt.id="zoomOut",Dt.icon='\x3c!--Created by Ryan Canning from the Noun Project--\x3e\n';var Nt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-zoom-range",!1,!1)||this).prop=a({},o.prop,{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.slider=new vt({container:o.container,direction:vt.HORIZONTAL,onUpdate:function(t){return o.__onSliderUpdate(t)}}),o.prop.mediaMinWidth=parseInt(R(o.container,"maxWidth"),10),o.psv.on(f.ZOOM_UPDATED,l(o)),o.psv.prop.ready?o.__moveZoomValue(o.psv.getZoomLevel()):o.psv.once(f.READY,l(o)),o.refreshUi(),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.slider.destroy(),delete this.zoomRange,delete this.zoomValue,this.psv.off(f.ZOOM_UPDATED,this),this.psv.off(f.READY,this),t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.ZOOM_UPDATED:this.__moveZoomValue(t.args[0]);break;case f.READY:this.__moveZoomValue(this.psv.getZoomLevel())}},o.isSupported=function(){return{initial:!b.isTouchEnabled.initial,promise:b.isTouchEnabled.promise.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.__onSliderUpdate=function(t){t.mousedown&&this.psv.zoom(100*t.value)},e}(_t);Nt.id="zoomRange",Nt.groupId="zoom";var Ut,Ht=function(t){function e(e){var o;return(o=t.call(this)||this).psv=e,o}c(e,t);var o=e.prototype;return o.init=function(){},o.destroy=function(){delete this.psv},e}(o.EventEmitter);Ht.id=null;var zt={panorama:null,overlay:null,overlayOpacity:1,container:null,adapter:null,plugins:[],caption:null,description:null,downloadUrl:null,loadingImg:null,loadingTxt:"Loading...",size:null,fisheye:!1,minFov:30,maxFov:90,defaultZoomLvl:50,defaultLong:0,defaultLat:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,autorotateDelay:null,autorotateIdle:!1,autorotateSpeed:"2rpm",autorotateLat:null,moveInertia:!0,mousewheel:!0,mousemove:!0,captureCursor:!1,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,useXmpData:!0,panoData:null,requestHeaders:null,canvasBackground:"#000",withCredentials:!1,navbar:["autorotate","zoom","move","download","description","caption","fullscreen"],lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",move:"Move",download:"Download",fullscreen:"Fullscreen",menu:"Menu",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama can't be loaded"},keyboard:(Ut={},Ut[y.ArrowUp]=v.ROTATE_LAT_UP,Ut[y.ArrowDown]=v.ROTATE_LAT_DOWN,Ut[y.ArrowRight]=v.ROTATE_LONG_RIGHT,Ut[y.ArrowLeft]=v.ROTATE_LONG_LEFT,Ut[y.PageUp]=v.ZOOM_IN,Ut[y.PageDown]=v.ZOOM_OUT,Ut[y.Plus]=v.ZOOM_IN,Ut[y.Minus]=v.ZOOM_OUT,Ut[y.Space]=v.TOGGLE_AUTOROTATE,Ut)},Ft={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},Vt={zoomButtonIncrement:"zoomButtonIncrement is deprecated, use zoomSpeed",mousewheelSpeed:"mousewheelSpeed is deprecated, use zoomSpeed",sphereCorrectionReorder:"sphereCorrectionReorder is deprecated"},Wt={container:function(t){if(!t)throw new i("No value given for container.");return t},adapter:function(t){if(!(t=t?Array.isArray(t)?[q(t[0],n),t[1]]:[q(t,n)]:[mt])[0])throw new i("Un undefined value with given for adapter.");return t},overlayOpacity:function(t){return e.MathUtils.clamp(t,0,1)},defaultLong:function(t){return at(t)},defaultLat:function(t){return at(t,!0)},minFov:function(t,o){return o.maxFov=this.prop.contentWidth?this.show():t0?(n.forEach((function(t){return t.collapse()})),this.collapsed=n,this.getButton(Mt.id).show(!1)):e>=o&&this.collapsed.length>0&&(this.collapsed.forEach((function(t){return t.uncollapse()})),this.collapsed=[],this.getButton(Mt.id).hide(!1));var r=this.getButton(Yt.id,!1);r&&r.refreshUi()}},o.__cleanButtons=function(t){return!0===t?Y(zt.navbar):"string"==typeof t?t.split(/[ ,]/):t||[]},e}(gt),Gt=function(t){function o(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*b.pixelRatio,o.canvas.height=o.loader.clientWidth*b.pixelRatio,o.loader.appendChild(o.canvas),o.prop=a({},o.prop,{tickness:(o.loader.offsetWidth-o.loader.clientWidth)/2*b.pixelRatio,current:null}),o.refreshUi(),o.hide(),o}c(o,t);var i=o.prototype;return i.destroy=function(){delete this.loader,delete this.canvas,t.prototype.destroy.call(this)},i.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)/b.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}},i.setProgress=function(t){var o=this.canvas.getContext("2d");o.clearRect(0,0,this.canvas.width,this.canvas.height),o.lineWidth=this.prop.tickness,o.strokeStyle=R(this.loader,"color"),o.beginPath(),o.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.prop.tickness/2,-Math.PI/2,e.MathUtils.clamp(t,0,100)/100*2*Math.PI-Math.PI/2),o.stroke(),this.psv.trigger(f.LOAD_PROGRESS,Math.round(t))},o}(gt),qt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-notification")||this).prop=a({},o.prop,{visible:!1,contentId:void 0,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}c(e,t);var o=e.prototype;return o.destroy=function(){delete this.content,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 i("Notification cannot be toggled")},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.prop.contentId=t.id,this.content.innerHTML=t.content,this.container.classList.add("psv-notification--visible"),this.prop.visible=!0,this.psv.trigger(f.SHOW_NOTIFICATION,t.id),t.timeout&&(this.prop.timeout=setTimeout((function(){return e.hide(t.id)}),t.timeout))},o.hide=function(t){if(this.isVisible(t)){var e=this.prop.contentId;this.container.classList.remove("psv-notification--visible"),this.prop.visible=!1,this.prop.contentId=void 0,this.psv.trigger(f.HIDE_NOTIFICATION,e)}},e}(gt),Kt=function(t){function e(e){var o;return(o=t.call(this,e,"psv-overlay")||this).prop=a({},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.psv.on(f.CLICK,l(o)),o.psv.on(f.KEY_PRESS,l(o)),t.prototype.hide.call(l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.CLICK,this),this.psv.off(f.KEY_PRESS,this),delete this.image,delete this.text,delete this.subtext,t.prototype.destroy.call(this)},o.handleEvent=function(t){switch(t.type){case f.CLICK:this.isVisible()&&this.prop.dissmisable&&(this.hide(),t.stopPropagation());break;case f.KEY_PRESS:this.isVisible()&&this.prop.dissmisable&&t.args[0]===y.Escape&&(this.hide(),t.preventDefault())}},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new i("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(f.SHOW_OVERLAY,e.id)},o.hide=function(e){if(this.isVisible(e)){var o=this.prop.contentId;t.prototype.hide.call(this),this.prop.contentId=void 0,this.psv.trigger(f.HIDE_OVERLAY,o)}},e}(gt),Qt=function(t){function e(e){var o;(o=t.call(this,e,"psv-panel psv--capture-event")||this).prop=a({},o.prop,{visible:!1,contentId:void 0,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}});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(b.mouseWheelEvent,(function(t){return t.stopPropagation()})),n.addEventListener("click",(function(){return o.hide()})),i.addEventListener("mousedown",l(o)),i.addEventListener("touchstart",l(o)),o.psv.container.addEventListener("mouseup",l(o)),o.psv.container.addEventListener("touchend",l(o)),o.psv.container.addEventListener("mousemove",l(o)),o.psv.container.addEventListener("touchmove",l(o)),o.psv.on(f.KEY_PRESS,l(o)),o}c(e,t);var o=e.prototype;return o.destroy=function(){this.psv.off(f.KEY_PRESS,this),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);break;case f.KEY_PRESS:this.isVisible()&&t.args[0]===y.Escape&&(this.hide(),t.preventDefault())}},o.isVisible=function(t){return this.prop.visible&&(!t||!this.prop.contentId||this.prop.contentId===t)},o.toggle=function(){throw new i("Panel cannot be toggled")},o.show=function(t){var e=this,o=this.isVisible(t.id);"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.content.removeEventListener("keydown",this.prop.keyHandler),this.prop.clickHandler=null,this.prop.keyHandler=null),t.id&&this.prop.width[t.id]?this.container.style.width=this.prop.width[t.id]:t.width?this.container.style.width=t.width:this.container.style.width=null,this.content.innerHTML=t.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),L(this.content,"psv-panel-content--no-margin",!0===t.noMargin),t.clickHandler&&(this.prop.clickHandler=t.clickHandler,this.prop.keyHandler=function(e){e.key===y.Enter&&t.clickHandler(e)},this.content.addEventListener("click",this.prop.clickHandler),this.content.addEventListener("keydown",this.prop.keyHandler),o||setTimeout((function(){var t;null==(t=e.content.querySelector("a,button,[tabindex]"))||t.focus()}),300)),this.psv.trigger(f.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(f.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,i=Math.max(200,this.container.offsetWidth-(e-this.prop.mouseX))+"px";this.prop.contentId&&(this.prop.width[this.prop.contentId]=i),this.container.style.width=i,this.prop.mouseX=e,this.prop.mouseY=o},e}(gt),$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}(),Jt=new e.Vector2,te=new e.Vector3,ee=new e.Euler(0,0,0,"ZXY"),oe=function(t){function o(e){return t.call(this,e)||this}c(o,t);var n=o.prototype;return n.fovToZoomLevel=function(t){var e=Math.round((t-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return e-2*(e-50)},n.zoomLevelToFov=function(t){return this.config.maxFov+t/100*(this.config.minFov-this.config.maxFov)},n.vFovToHFov=function(t){return e.MathUtils.radToDeg(2*Math.atan(Math.tan(e.MathUtils.degToRad(t)/2)*this.prop.aspect))},n.speedToDuration=function(t,e){if(t&&"number"==typeof t)return Math.abs(t);var o=t?st(t):this.config.autorotateSpeed;return e/Math.abs(o)*1e3},n.textureCoordsToSphericalCoords=function(t){var e=this.prop.panoData;if(!e)throw new i("Current adapter does not support texture coordinates.");var o=(t.x+e.croppedX)/e.fullWidth*Math.PI*2,n=(t.y+e.croppedY)/e.fullHeight*Math.PI,r={longitude:o>=Math.PI?o-Math.PI:o+Math.PI,latitude:Math.PI/2-n};return ee.equals(this.psv.renderer.mesh.rotation)&&ee.equals(this.psv.renderer.meshContainer.rotation)?r:(this.sphericalCoordsToVector3(r,te),te.applyEuler(this.psv.renderer.mesh.rotation),te.applyEuler(this.psv.renderer.meshContainer.rotation),this.vector3ToSphericalCoords(te))},n.sphericalCoordsToTextureCoords=function(t){var e=this.prop.panoData;if(!e)throw new i("Current adapter does not support texture coordinates.");ee.equals(this.psv.renderer.mesh.rotation)&&ee.equals(this.psv.renderer.meshContainer.rotation)||(this.sphericalCoordsToVector3(t,te),lt(te,this.psv.renderer.meshContainer.rotation),lt(te,this.psv.renderer.mesh.rotation),t=this.vector3ToSphericalCoords(te));var o=t.longitude/Math.PI/2*e.fullWidth,n=t.latitude/Math.PI*e.fullHeight;return{x:Math.round(t.longitude\x3c!--Created by AomAm from the Noun Project--\x3e\n',text:e.config.lang.twoFingers})}),100)):(t.preventDefault(),this.__move(t.touches[0])):2===t.touches.length&&(t.preventDefault(),this.__moveZoom(t),this.__cancelTwoFingersOverlay()))},i.__cancelLongTouch=function(){this.prop.longtouchTimeout&&(clearTimeout(this.prop.longtouchTimeout),this.prop.longtouchTimeout=null)},i.__cancelTwoFingersOverlay=function(){this.prop.twofingersTimeout&&(clearTimeout(this.prop.twofingersTimeout),this.prop.twofingersTimeout=null),this.psv.overlay.hide(_.TWO_FINGERS)},i.__onMouseWheel=function(t){var e=this;if(this.config.mousewheel){if(this.config.mousewheelCtrlKey&&!this.state.ctrlKeyDown)return this.psv.overlay.show({id:_.CTRL_ZOOM,image:'\x3c!-- Created by Icon Island from the Noun Project --\x3e\n',text:this.config.lang.ctrlZoom}),clearTimeout(this.state.ctrlZoomTimeout),void(this.state.ctrlZoomTimeout=setTimeout((function(){return e.psv.overlay.hide(_.CTRL_ZOOM)}),2e3));t.preventDefault(),t.stopPropagation();var o=5*k(t).spinY*this.config.zoomSpeed;0!==o&&this.psv.dynamics.zoom.step(-o,5)}},i.__fullscreenToggled=function(t){this.prop.fullscreen=void 0!==t?t:A(this.psv.container),this.config.keyboard&&(this.prop.fullscreen?this.psv.startKeyboardControl():this.psv.stopKeyboardControl()),this.psv.trigger(f.FULLSCREEN_UPDATED,this.prop.fullscreen)},i.__startMove=function(t){var e=this;this.psv.__stopAll().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)}))},i.__startMoveZoom=function(t){var e=this;this.psv.__stopAll().then((function(){var o={x:t.touches[0].clientX,y:t.touches[0].clientY},i={x:t.touches[1].clientX,y:t.touches[1].clientY};e.state.pinchDist=N(o,i),e.state.mouseX=(o.x+i.x)/2,e.state.mouseY=(o.y+i.y)/2,e.state.startMouseX=e.state.mouseX,e.state.startMouseY=e.state.mouseY,e.state.moving=!0,e.state.zooming=!0}))},i.__stopMove=function(t){if(this.psv.resetIdleTimer(),!C(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)30?(this.state.mouseHistory.splice(0,n),n=0,i=this.state.mouseHistory[n][0]):(i=this.state.mouseHistory[n][0],n++)},o}($t),ne=function(t){function o(o){var i,n;return(n=t.call(this,o)||this).renderer=new e.WebGLRenderer({alpha:!0,antialias:!0}),n.renderer.setPixelRatio(b.pixelRatio),n.renderer.domElement.className="psv-canvas",n.scene=new e.Scene,n.camera=new e.PerspectiveCamera(50,16/9,1,20),n.mesh=n.psv.adapter.createMesh(),n.mesh.userData=((i={}).psvSphere=!0,i),n.meshContainer=new e.Group,n.meshContainer.add(n.mesh),n.scene.add(n.meshContainer),n.raycaster=new e.Raycaster,n.timestamp=null,n.ready=!1,n.canvasContainer=document.createElement("div"),n.canvasContainer.className="psv-canvas-container",n.canvasContainer.style.background=n.psv.config.canvasBackground,n.canvasContainer.style.cursor=n.psv.config.mousemove?"move":"default",n.canvasContainer.appendChild(n.renderer.domElement),n.psv.container.appendChild(n.canvasContainer),o.on(f.SIZE_UPDATED,l(n)),o.on(f.ZOOM_UPDATED,l(n)),o.on(f.POSITION_UPDATED,l(n)),o.on(f.CONFIG_CHANGED,l(n)),n.hide(),n}c(o,t);var i=o.prototype;return i.destroy=function(){this.renderer.setAnimationLoop(null),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.meshContainer,delete this.raycaster,t.prototype.destroy.call(this)},i.handleEvent=function(t){switch(t.type){case f.SIZE_UPDATED:this.__onSizeUpdated();break;case f.ZOOM_UPDATED:this.__onZoomUpdated();break;case f.POSITION_UPDATED:this.__onPositionUpdated();break;case f.CONFIG_CHANGED:t.args[0].includes("fisheye")&&this.__onPositionUpdated(),t.args[0].includes("mousemove")&&(this.canvasContainer.style.cursor=this.psv.config.mousemove?"move":"default")}},i.hide=function(){this.canvasContainer.style.opacity=0},i.show=function(){this.canvasContainer.style.opacity=1},i.__onSizeUpdated=function(){this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.camera.aspect=this.prop.aspect,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},i.__onZoomUpdated=function(){this.camera.fov=this.prop.vFov,this.camera.updateProjectionMatrix(),this.prop.needsUpdate=!0},i.__onPositionUpdated=function(){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.prop.needsUpdate=!0},i.__renderLoop=function(t){var e=null!==this.timestamp?t-this.timestamp:0;this.timestamp=t,this.psv.trigger(f.BEFORE_RENDER,t,e),Z(this.psv.dynamics,(function(t){return t.update(e)})),this.prop.idleTime>0&&t-this.prop.idleTime>this.config.autorotateDelay&&this.psv.startAutorotate(),this.prop.needsUpdate&&(this.render(),this.prop.needsUpdate=!1)},i.render=function(){this.renderer.render(this.scene,this.camera),this.psv.trigger(f.RENDER)},i.setTexture=function(t){var e=this;this.prop.panoData=t.panoData,this.psv.adapter.setTexture(this.mesh,t),this.ready||(this.renderer.setAnimationLoop((function(t){return e.__renderLoop(t)})),this.ready=!0),this.psv.needsUpdate(),this.psv.trigger(f.PANORAMA_LOADED,t)},i.setOverlay=function(t,e){this.psv.adapter.setOverlay(this.mesh,t,e),this.psv.needsUpdate()},i.setPanoramaPose=function(t,e){void 0===e&&(e=this.mesh);var o=this.psv.dataHelper.cleanPanoramaPose(t);e.rotation.set(-o.tilt,-o.pan,-o.roll,"ZXY")},i.setSphereCorrection=function(t,e){void 0===e&&(e=this.meshContainer);var o=this.psv.dataHelper.cleanSphereCorrection(t);e.rotation.set(o.tilt,o.pan,o.roll,"ZXY")},i.transition=function(t,o){var i=this,n=J(o),r="zoom"in o,s=new e.Group,a=this.psv.adapter.createMesh(.5);if(this.psv.adapter.setTexture(a,t,!0),this.psv.adapter.setTextureOpacity(a,0),this.setPanoramaPose(t.panoData,a),this.setSphereCorrection(o.sphereCorrection,s),n){var c=this.psv.dataHelper.cleanPosition(o),h=this.psv.getPosition(),l=new e.Vector3(0,1,0);s.rotateOnWorldAxis(l,c.longitude-h.longitude);var p=new e.Vector3(0,1,0).cross(this.camera.getWorldDirection(new e.Vector3)).normalize();s.rotateOnWorldAxis(p,c.latitude-h.latitude)}s.add(a),this.scene.add(s);var u=new pt({properties:{opacity:{start:0,end:1},zoom:r?{start:this.psv.getZoomLevel(),end:o.zoom}:void 0},duration:o.transition,easing:"outCubic",onTick:function(t){i.psv.adapter.setTextureOpacity(a,t.opacity),i.psv.adapter.setTextureOpacity(i.mesh,1-t.opacity),r&&i.psv.zoom(t.zoom),i.psv.needsUpdate()}});return u.then((function(e){e?(i.setTexture(t),i.psv.adapter.setTextureOpacity(i.mesh,1),i.setPanoramaPose(t.panoData),i.setSphereCorrection(o.sphereCorrection),n&&i.psv.rotate(o)):i.psv.adapter.disposeTexture(t),i.scene.remove(s),a.geometry.dispose(),a.geometry=null})),u},i.__cleanTHREEScene=function(t){var o=this;t.traverse((function(i){i.geometry&&i.geometry.dispose(),i.material&&(Array.isArray(i.material)?i.material.forEach((function(t){t.map&&t.map.dispose(),t.dispose()})):(i.material.map&&i.material.map.dispose(),i.material.dispose())),!i.dispose||i instanceof e.Scene||i.dispose(),i!==t&&o.__cleanTHREEScene(i)}))},o}($t),re=function(t){function o(o){var i;return(i=t.call(this,o)||this).loader=new e.FileLoader,i.loader.setResponseType("blob"),i.config.withCredentials&&i.loader.setWithCredentials(!0),i.config.requestHeaders&&"object"==typeof i.config.requestHeaders&&i.loader.setRequestHeader(i.config.requestHeaders),i}c(o,t);var i=o.prototype;return i.destroy=function(){this.abortLoading(),t.prototype.destroy.call(this)},i.loadTexture=function(t,e){return this.psv.adapter.loadTexture(t,e)},i.abortLoading=function(){},i.loadFile=function(t,e){var o=this;return this.config.requestHeaders&&"function"==typeof this.config.requestHeaders&&this.loader.setRequestHeader(this.config.requestHeaders(t)),new Promise((function(i,n){var r=0;e&&e(r),o.loader.load(t,(function(t){r=100,e&&e(r),i(t)}),(function(t){if(t.lengthComputable){var o=t.loaded/t.total*100;o>r&&(r=o,e&&e(r))}}),(function(t){n(t)}))}))},i.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)}))}))},i.preloadPanorama=function(t){return this.psv.adapter.supportsPreload(t)?this.psv.adapter.loadTexture(t):Promise.resolve()},o}($t),se=0,ae=1,ce=2,he=3,le=function(t){function e(e,o){var i;return(i=t.call(this,e,"psv-tooltip")||this).prop=a({},i.prop,o,{state:se,width:0,height:0,pos:"",config:null,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",l(i)),i.container.style.top="-1000px",i.container.style.left="-1000px",i}c(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){if("transitionend"===t.type)this.__onTransitionEnd(t)},o.toggle=function(){throw new i("Tooltip cannot be toggled")},o.show=function(t){if(this.prop.state!==se)throw new i("Initialized tooltip cannot be re-initialized");t.className&&x(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=he,this.move(t),this.prop.data=t.data,this.prop.state=ae,this.psv.trigger(f.SHOW_TOOLTIP,this.prop.data,this),this.__waitImages()},o.move=function(t){if(this.prop.state!==ae&&this.prop.state!==he)throw new i("Uninitialized tooltip cannot be moved");this.config=t;var e=this.container,o=this.arrow,n={posClass:t.position?rt(t.position,!1):["top","center"],width:this.prop.width,height:this.prop.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(n,t);var r=!1;n.topthis.psv.prop.size.height-this.prop.offset&&(n.posClass[0]="top",r=!0),n.leftthis.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=ce,this.psv.trigger(f.HIDE_TOOLTIP,this.prop.data)},o.__onTransitionEnd=function(t){if("transform"===t.propertyName)switch(this.prop.state){case ae:this.container.classList.add("psv-tooltip--visible"),this.prop.state=he;break;case ce:this.prop.state=se,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)}},o.__waitImages=function(){var t=this,e=this.content.querySelectorAll("img");if(e.length>0){var o=[];e.forEach((function(t){o.push(new Promise((function(e){t.onload=e,t.onerror=e})))})),Promise.all(o).then((function(){if(t.prop.state===ae||t.prop.state===he){var e=t.container.getBoundingClientRect();t.prop.width=e.right-e.left,t.prop.height=e.bottom-e.top,t.move(t.config)}}))}},e}(gt),pe=function(t){function e(e){var o;o=t.call(this,e)||this;var i=new le(o.psv);return o.size={arrow:parseInt(R(i.arrow,"borderTopWidth"),10),offset:parseInt(R(i.container,"outlineWidth"),10)},i.destroy(),o}c(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 le(this.psv,this.size);return e.show(t),e},e}($t);e.Cache.enabled=!0;var ue=function(t){function o(o){var n;if(n=t.call(this)||this,b.load(),!b.isWebGLSupported)throw new i("WebGL is not supported.");if(0===b.maxTextureWidth)throw new i("Unable to detect system capabilities");return n.prop={ready:!1,uiRefresh:!1,needsUpdate:!1,fullscreen:!1,direction:new e.Vector3(0,0,p),vFov:null,hFov:null,aspect:null,autorotateEnabled:!1,animationPromise:null,loadingPromise:null,littlePlanet:!1,idleTime:-1,objectsObservers:{},size:{width:0,height:0},panoData:{fullWidth:0,fullHeight:0,croppedWidth:0,croppedHeight:0,croppedX:0,croppedY:0,poseHeading:0,posePitch:0,poseRoll:0}},n.config=function(t){var e=Y(zt);W(e,t);var o={};return Z(e,(function(t,n){if(Vt[n])$(Vt[n]);else{if(!Object.prototype.hasOwnProperty.call(zt,n))throw new i("Unknown option "+n);Wt[n]?o[n]=Wt[n](t,e):o[n]=t}})),o}(o),n.parent="string"==typeof o.container?document.getElementById(o.container):o.container,n.parent[u]=l(n),n.container=document.createElement("div"),n.container.classList.add("psv-container"),n.parent.appendChild(n.container),n.adapter=new n.config.adapter[0](l(n),n.config.adapter[1]),n.children=[],n.plugins={},n.renderer=new ne(l(n)),n.textureLoader=new re(l(n)),n.eventsHandler=new ie(l(n)),n.dataHelper=new oe(l(n)),n.loader=new Gt(l(n)),n.navbar=new Bt(l(n)),n.panel=new Qt(l(n)),n.tooltip=new pe(l(n)),n.notification=new qt(l(n)),n.overlay=new Kt(l(n)),n.dynamics={zoom:new ut((function(t){n.prop.vFov=n.dataHelper.zoomLevelToFov(t),n.prop.hFov=n.dataHelper.vFovToHFov(n.prop.vFov),n.trigger(f.ZOOM_UPDATED,t)}),n.config.defaultZoomLvl,0,100),position:new dt({longitude:new ut(null,n.config.defaultLong,0,2*Math.PI,!0),latitude:n.prop.littlePlanet?new ut(null,n.config.defaultLat,0,2*Math.PI,!0):new ut(null,n.config.defaultLat,-Math.PI/2,Math.PI/2)},(function(t){n.dataHelper.sphericalCoordsToVector3(t,n.prop.direction),n.trigger(f.POSITION_UPDATED,t)}))},n.__updateSpeeds(),n.eventsHandler.init(),n.__resizeRefresh=F((function(){return n.refreshUi("resize")}),500),n.resize(n.config.size),n.config.plugins.forEach((function(t){var e=t[0],o=t[1];n.plugins[e.id]=new e(l(n),o)})),Z(n.plugins,(function(t){return null==t.init?void 0:t.init()})),n.navbar.setButtons(n.config.navbar),n.config.panorama&&n.setPanorama(n.config.panorama),L(n.container,"psv--is-touch",b.isTouchEnabled.initial),b.isTouchEnabled.promise.then((function(t){return L(n.container,"psv--is-touch",t)})),n.once(f.RENDER,(function(){n.config.navbar&&(n.container.classList.add("psv--has-navbar"),n.navbar.show()),X(n.config.autorotateDelay)||(n.prop.idleTime=performance.now()),n.prop.ready=!0,setTimeout((function(){n.refreshUi("init"),n.trigger(f.READY)}),0)})),n}c(o,t);var n=o.prototype;return n.destroy=function(){this.__stopAll(),this.stopKeyboardControl(),this.exitFullscreen(),Z(this.plugins,(function(t){return t.destroy()})),delete this.plugins,this.children.slice().forEach((function(t){return t.destroy()})),this.children.length=0,this.eventsHandler.destroy(),this.renderer.destroy(),this.textureLoader.destroy(),this.dataHelper.destroy(),this.adapter.destroy(),this.parent.removeChild(this.container),delete this.parent[u],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.dynamics,delete this.config},n.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))},n.getPlugin=function(t){if("string"==typeof t)return this.plugins[t];var e=q(t,Ht);return e?this.plugins[e.id]:void 0},n.getPosition=function(){return this.dataHelper.cleanPosition(this.dynamics.position.current)},n.getZoomLevel=function(){return this.dynamics.zoom.current},n.getSize=function(){return a({},this.prop.size)},n.isAutorotateEnabled=function(){return this.prop.autorotateEnabled},n.isFullscreenEnabled=function(){return b.fullscreenEvent?A(this.container):this.prop.fullscreen},n.needsUpdate=function(){this.prop.needsUpdate=!0},n.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.trigger(f.SIZE_UPDATED,this.getSize()),this.__resizeRefresh())},n.setPanorama=function(t,e){var o,i=this;void 0===e&&(e={}),this.textureLoader.abortLoading(),null==(o=this.prop.transitionAnimation)||o.cancel(),this.prop.ready||["sphereCorrection","panoData","overlay","overlayOpacity"].forEach((function(t){t in e||(e[t]=i.config[t])})),void 0!==e.transition&&!0!==e.transition||(e.transition=1500),void 0===e.showLoader&&(e.showLoader=!0),void 0===e.caption&&(e.caption=this.config.caption),void 0===e.description&&(e.description=this.config.description),e.panoData||"function"!=typeof this.config.panoData||(e.panoData=this.config.panoData);var n=J(e),r="zoom"in e;(n||r)&&this.__stopAll(),this.hideError(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description;var s=function(t){if(i.loader.hide(),i.prop.loadingPromise=null,Q(t))return!1;if(t)throw i.navbar.setCaption(""),i.showError(i.config.lang.loadError),console.error(t),t;return i.resetIdleTimer(),i.setOverlay(e.overlay,e.overlayOpacity),i.navbar.setCaption(i.config.caption),!0};this.navbar.setCaption(""+(this.config.loadingTxt||"")+""),!e.showLoader&&this.prop.ready||this.loader.show();var a=this.adapter.loadTexture(this.config.panorama,e.panoData).then((function(t){if(t.panorama!==i.config.panorama)throw i.adapter.disposeTexture(t),K();return t}));return e.transition&&this.prop.ready&&this.adapter.supportsTransition(this.config.panorama)?this.prop.loadingPromise=a.then((function(t){return i.loader.hide(),i.prop.transitionAnimation=i.renderer.transition(t,e),i.prop.transitionAnimation})).then((function(t){if(i.prop.transitionAnimation=null,!t)throw K()})).then(s,s):this.prop.loadingPromise=a.then((function(t){i.renderer.show(),i.renderer.setTexture(t),i.renderer.setPanoramaPose(t.panoData),i.renderer.setSphereCorrection(e.sphereCorrection),r&&i.zoom(e.zoom),n&&i.rotate(e)})).then(s,s),this.prop.loadingPromise},n.setOverlay=function(t,e){var o=this;return void 0===e&&(e=1),this.adapter.constructor.supportsOverlay?t?this.adapter.loadTexture(t,(function(t){var e=o.prop.panoData,i=t.width/e.croppedWidth;return{fullWidth:i*e.fullWidth,fullHeight:i*e.fullHeight,croppedWidth:i*e.croppedWidth,croppedHeight:i*e.croppedHeight,croppedX:i*e.croppedX,croppedY:i*e.croppedY}}),!1).then((function(t){o.renderer.setOverlay(t,e)})):(this.renderer.setOverlay(null,0),Promise.resolve()):Promise.reject(new i(this.adapter.constructor.id+" adapter does not supports overlay"))},n.setOptions=function(t){var e=this,o=a({},this.config,t);Z(t,(function(t,n){if(Vt[n])$(Vt[n]);else{if(!Object.prototype.hasOwnProperty.call(zt,n))throw new i("Unknown option "+n);if(Ft[n])throw new i(Ft[n]);switch(Wt[n]?e.config[n]=Wt[n](t,o):e.config[n]=t,n){case"overlay":case"overlayOpacity":e.setOverlay(e.config.overlay,e.config.overlayOpacity);break;case"caption":case"description":e.navbar.setCaption(e.config.caption);break;case"size":e.resize(t);break;case"sphereCorrection":e.renderer.setSphereCorrection(t);break;case"navbar":case"lang":e.navbar.setButtons(e.config.navbar);break;case"moveSpeed":case"zoomSpeed":e.__updateSpeeds();break;case"minFov":case"maxFov":e.dynamics.zoom.setValue(e.dataHelper.fovToZoomLevel(e.prop.vFov)),e.trigger(f.ZOOM_UPDATED,e.getZoomLevel());break;case"canvasBackground":e.renderer.canvasContainer.style.background=e.config.canvasBackground;break;case"autorotateIdle":e.resetIdleTimer()}}})),this.needsUpdate(),this.refreshUi("set options"),this.trigger(f.CONFIG_CHANGED,Object.keys(t))},n.setOption=function(t,e){var o;this.setOptions(((o={})[t]=e,o))},n.resetIdleTimer=function(){this.prop.idleTime=this.config.autorotateIdle?performance.now():-1},n.disableIdleTimer=function(){this.prop.idleTime=-1},n.startAutorotate=function(t){void 0===t&&(t=!1),t&&!this.isAutorotateEnabled()||!t&&this.isAutorotateEnabled()||(t||this.__stopAll(),this.dynamics.position.roll({longitude:this.config.autorotateSpeed<0},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),this.dynamics.position.goto({latitude:this.config.autorotateLat},Math.abs(this.config.autorotateSpeed/this.config.moveSpeed)),this.prop.autorotateEnabled=!0,t||this.trigger(f.AUTOROTATE,!0))},n.stopAutorotate=function(){this.isAutorotateEnabled()&&(this.dynamics.position.stop(),this.prop.autorotateEnabled=!1,this.trigger(f.AUTOROTATE,!1))},n.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},n.showError=function(t){this.overlay.show({id:_.ERROR,image:'\x3c!--Created by Shastry from the Noun Project--\x3e\n',text:t,dissmisable:!1})},n.hideError=function(){this.overlay.hide(_.ERROR)},n.rotate=function(t){if(!this.trigger(f.BEFORE_ROTATE,t).isDefaultPrevented()){var e=this.change(m.GET_ROTATE_POSITION,this.dataHelper.cleanPosition(t));this.dynamics.position.setValue(e)}},n.animate=function(t){var e=this;this.__stopAll();var o,i=J(t),n="zoom"in t,r={};if(i){var s=this.change(m.GET_ANIMATE_POSITION,this.dataHelper.cleanPosition(t)),a=this.getPosition(),c=U(a.longitude,s.longitude);r.longitude={start:a.longitude,end:a.longitude+c},r.latitude={start:a.latitude,end:s.latitude},o=this.dataHelper.speedToDuration(t.speed,H(a,s))}if(n){var h=Math.abs(t.zoom-this.getZoomLevel());r.zoom={start:this.getZoomLevel(),end:t.zoom},o||(o=this.dataHelper.speedToDuration(t.speed,Math.PI/4*h/100))}return o?(this.prop.animationPromise=new pt({properties:r,duration:o,easing:"inOutSine",onTick:function(t){i&&e.rotate(t),n&&e.zoom(t.zoom)}}),this.prop.animationPromise.then((function(){e.prop.animationPromise=null,e.resetIdleTimer()})),this.prop.animationPromise):(i&&this.rotate(t),n&&this.zoom(t.zoom),new pt)},n.stopAnimation=function(){var t=this;return this.prop.animationPromise?new Promise((function(e){t.prop.animationPromise.then(e),t.prop.animationPromise.cancel(),t.prop.animationPromise=null})):Promise.resolve()},n.zoom=function(t){this.dynamics.zoom.setValue(t)},n.zoomIn=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(t)},n.zoomOut=function(t){void 0===t&&(t=1),this.dynamics.zoom.step(-t)},n.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()},n.enterFullscreen=function(){b.fullscreenEvent?I(this.container):(this.container.classList.add("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!0))},n.exitFullscreen=function(){this.isFullscreenEnabled()&&(b.fullscreenEvent?S():(this.container.classList.remove("psv-container--fullscreen"),this.autoSize(),this.eventsHandler.__fullscreenToggled(!1)))},n.toggleFullscreen=function(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()},n.startKeyboardControl=function(){this.eventsHandler.enableKeyboard()},n.stopKeyboardControl=function(){this.eventsHandler.disableKeyboard()},n.observeObjects=function(t,e){var o=this;return this.prop.objectsObservers[t]={listener:e},function(){delete o.prop.objectsObservers[t]}},n.__stopAll=function(){return this.trigger(f.STOP_ALL),this.disableIdleTimer(),this.stopAutorotate(),this.stopAnimation()},n.__updateSpeeds=function(){this.dynamics.zoom.setSpeed(50*this.config.zoomSpeed),this.dynamics.position.setSpeed(e.MathUtils.degToRad(50*this.config.moveSpeed))},o}(o.EventEmitter);t.AbstractAdapter=n,t.AbstractButton=_t,t.AbstractComponent=gt,t.AbstractPlugin=Ht,t.Animation=pt,t.CONSTANTS=E,t.DEFAULTS=zt,t.EquirectangularAdapter=mt,t.PSVError=i,t.SYSTEM=b,t.Viewer=ue,t.registerButton=Xt,t.utils=ft,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=/sm/3711cd16151c12d984aa9d8c7a6d39223b65090654f0d64937f0d9c4005b15a8.map