diff --git a/dist/adapters/cubemap-tiles.js b/dist/adapters/cubemap-tiles.js index 6a432b37c..5e9a5920c 100644 --- a/dist/adapters/cubemap-tiles.js +++ b/dist/adapters/cubemap-tiles.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/adapters/cubemap-video.js b/dist/adapters/cubemap-video.js index 575055305..631386543 100644 --- a/dist/adapters/cubemap-video.js +++ b/dist/adapters/cubemap-video.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/adapters/cubemap.js b/dist/adapters/cubemap.js index cb3a81497..c708e2c7a 100644 --- a/dist/adapters/cubemap.js +++ b/dist/adapters/cubemap.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/adapters/equirectangular-tiles.js b/dist/adapters/equirectangular-tiles.js index 851db5302..8a651b8bd 100644 --- a/dist/adapters/equirectangular-tiles.js +++ b/dist/adapters/equirectangular-tiles.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/adapters/equirectangular-video.js b/dist/adapters/equirectangular-video.js index 5ac265cbe..ab0a8f261 100644 --- a/dist/adapters/equirectangular-video.js +++ b/dist/adapters/equirectangular-video.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/photo-sphere-viewer.css b/dist/photo-sphere-viewer.css index 1f5330196..baf42fdc7 100644 --- a/dist/photo-sphere-viewer.css +++ b/dist/photo-sphere-viewer.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.6.5 + * Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/photo-sphere-viewer.d.ts b/dist/photo-sphere-viewer.d.ts index 95babff19..32a74f32b 100644 --- a/dist/photo-sphere-viewer.d.ts +++ b/dist/photo-sphere-viewer.d.ts @@ -276,6 +276,7 @@ type PanoramaOptions = (ExtendedPosition | {}) & { * Result of the AbstractAdapter#loadTexture method */ type TextureData = { + panorama: any; texture: Texture | Texture[] | Record; panoData?: PanoData; }; diff --git a/dist/photo-sphere-viewer.js b/dist/photo-sphere-viewer.js index b01f647cd..110a6c3eb 100644 --- a/dist/photo-sphere-viewer.js +++ b/dist/photo-sphere-viewer.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -1493,6 +1493,40 @@ return undefined; } + /** + * @summary Returns deep equality between objects + * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9} + * @param obj1 + * @param obj2 + * @return {boolean} + * @private + */ + + function deepEqual(obj1, obj2) { + if (obj1 === obj2) { + return true; + } else if (isObject(obj1) && isObject(obj2)) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) { + return false; + } + + for (var _i2 = 0, _Object$keys = Object.keys(obj1); _i2 < _Object$keys.length; _i2++) { + var prop = _Object$keys[_i2]; + + if (!deepEqual(obj1[prop], obj2[prop])) { + return false; + } + } + + return true; + } else { + return false; + } + } + + function isObject(obj) { + return typeof obj === 'object' && obj != null; + } /** * @summary Returns the plugin constructor from the imported object @@ -2779,6 +2813,7 @@ each: each, isNil: isNil, firstNonNull: firstNonNull, + deepEqual: deepEqual, pluginInterop: pluginInterop, getAbortError: getAbortError, isAbortError: isAbortError, @@ -5291,7 +5326,7 @@ function Navbar(psv) { var _this; - _this = _AbstractComponent.call(this, psv, 'psv-navbar') || this; + _this = _AbstractComponent.call(this, psv, 'psv-navbar psv--capture-event') || this; /** * @summary List of buttons of the navbar * @member {PSV.buttons.AbstractButton[]} @@ -5953,7 +5988,7 @@ function Panel(psv) { var _this; - _this = _AbstractComponent.call(this, psv, 'psv-panel') || this; + _this = _AbstractComponent.call(this, psv, 'psv-panel psv--capture-event') || this; /** * @override * @property {string} contentId @@ -6799,7 +6834,7 @@ /* eslint-enable */ - if (!getClosest(evt.target, '.psv-navbar') && !getClosest(evt.target, '.psv-panel')) { + if (!getClosest(evt.target, '.psv--capture-event')) { /* eslint-disable */ switch (evt.type) { // @formatter:off @@ -8240,6 +8275,7 @@ width: 0, height: 0, pos: '', + config: null, data: null }); /** @@ -8345,6 +8381,8 @@ this.prop.data = config.data; this.prop.state = STATE.SHOWING; this.psv.trigger(EVENTS.SHOW_TOOLTIP, this.prop.data, this); + + this.__waitImages(); } /** * @summary Moves the tooltip to a new position @@ -8359,6 +8397,7 @@ throw new PSVError('Uninitialized tooltip cannot be moved'); } + this.config = config; var t = this.container; var a = this.arrow; // compute size @@ -8511,6 +8550,37 @@ break; // no default } + } + /** + * @summary If the tooltip contains images, recompute its size once they are loaded + * @private + */ + ; + + _proto.__waitImages = function __waitImages() { + var _this2 = this; + + var images = this.content.querySelectorAll('img'); + + if (images.length > 0) { + var promises = []; + images.forEach(function (image) { + promises.push(new Promise(function (resolve) { + image.onload = resolve; + image.onerror = resolve; + })); + }); + Promise.all(promises).then(function () { + if (_this2.prop.state === STATE.SHOWING || _this2.prop.state === STATE.READY) { + var rect = _this2.container.getBoundingClientRect(); + + _this2.prop.width = rect.right - rect.left; + _this2.prop.height = rect.bottom - rect.top; + + _this2.move(_this2.config); + } + }); + } }; return Tooltip; diff --git a/dist/photo-sphere-viewer.js.map b/dist/photo-sphere-viewer.js.map index 93bab96ec..218fc282b 100644 --- a/dist/photo-sphere-viewer.js.map +++ b/dist/photo-sphere-viewer.js.map @@ -1 +1 @@ -{"version":3,"file":"photo-sphere-viewer.js","sources":["../src/PSVError.js","../src/adapters/AbstractAdapter.js","../src/data/constants.js","../src/data/system.js","../src/utils/browser.js","../src/utils/math.js","../src/utils/misc.js","../src/utils/psv.js","../src/utils/Animation.js","../src/utils/Dynamic.js","../src/utils/MultiDynamic.js","../src/utils/Slider.js","../src/utils/index.js","../src/adapters/equirectangular/index.js","../src/components/AbstractComponent.js","../src/buttons/AbstractButton.js","../src/buttons/AutorotateButton.js","../src/buttons/CustomButton.js","../src/buttons/DescriptionButton.js","../src/buttons/DownloadButton.js","../src/buttons/FullscreenButton.js","../src/buttons/MenuButton.js","../src/utils/PressHandler.js","../src/buttons/AbstractMoveButton.js","../src/buttons/MoveDownButton.js","../src/buttons/MoveLeftButton.js","../src/buttons/MoveRightButton.js","../src/buttons/MoveUpButton.js","../src/buttons/AbstractZoomButton.js","../src/buttons/ZoomInButton.js","../src/buttons/ZoomOutButton.js","../src/buttons/ZoomRangeButton.js","../src/plugins/AbstractPlugin.js","../src/data/config.js","../src/components/NavbarCaption.js","../src/components/Navbar.js","../src/components/Loader.js","../src/components/Notification.js","../src/components/Overlay.js","../src/components/Panel.js","../src/services/AbstractService.js","../src/services/DataHelper.js","../src/services/EventsHandler.js","../src/services/Renderer.js","../src/services/TextureLoader.js","../src/components/Tooltip.js","../src/services/TooltipRenderer.js","../src/Viewer.js"],"sourcesContent":["/**\n * @summary Custom error used in the lib\n * @param {string} message\n * @constructor\n * @memberOf PSV\n */\nfunction PSVError(message) {\n this.message = message;\n\n // Use V8's native method if available, otherwise fallback\n if ('captureStackTrace' in Error) {\n Error.captureStackTrace(this, PSVError);\n }\n else {\n this.stack = (new Error()).stack;\n }\n}\n\nPSVError.prototype = Object.create(Error.prototype);\nPSVError.prototype.name = 'PSVError';\nPSVError.prototype.constructor = PSVError;\n\nexport { PSVError };\n","import { PSVError } from '../PSVError';\n\n/**\n * @namespace PSV.adapters\n */\n\n/**\n * @summary Base adapters class\n * @memberof PSV.adapters\n * @abstract\n */\nexport class AbstractAdapter {\n\n /**\n * @summary Unique identifier of the adapter\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @summary Indicates if the adapter supports panorama download natively\n * @type {boolean}\n * @readonly\n * @static\n */\n static supportsDownload = false;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n }\n\n /**\n * @summary Destroys the adapter\n */\n destroy() {\n delete this.psv;\n }\n\n /**\n * @summary Indicates if the adapter supports transitions between panoramas\n * @param {*} panorama\n * @return {boolean}\n */\n supportsTransition(panorama) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n * @summary Indicates if the adapter supports preload of a panorama\n * @param {*} panorama\n * @return {boolean}\n */\n supportsPreload(panorama) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n * @abstract\n * @summary Loads the panorama texture(s)\n * @param {*} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData) { // eslint-disable-line no-unused-vars\n throw new PSVError('loadTexture not implemented');\n }\n\n /**\n * @abstract\n * @summary Creates the cube mesh\n * @param {number} [scale=1]\n * @returns {external:THREE.Mesh}\n */\n createMesh(scale = 1) { // eslint-disable-line no-unused-vars\n throw new PSVError('createMesh not implemented');\n }\n\n /**\n * @abstract\n * @summary Applies the texture to the mesh\n * @param {external:THREE.Mesh} mesh\n * @param {PSV.TextureData} textureData\n * @param {boolean} [transition=false]\n */\n setTexture(mesh, textureData, transition = false) { // eslint-disable-line no-unused-vars\n throw new PSVError('setTexture not implemented');\n }\n\n /**\n * @abstract\n * @summary Changes the opacity of the mesh\n * @param {external:THREE.Mesh} mesh\n * @param {number} opacity\n */\n setTextureOpacity(mesh, opacity) { // eslint-disable-line no-unused-vars\n throw new PSVError('setTextureOpacity not implemented');\n }\n\n /**\n * @abstract\n * @summary Clear a loaded texture from memory\n * @param {PSV.TextureData} textureData\n */\n disposeTexture(textureData) { // eslint-disable-line no-unused-vars\n throw new PSVError('disposeTexture not implemented');\n }\n\n}\n","/**\n * @namespace PSV.constants\n */\n\n/**\n * @summary Default duration of the transition between panoramas\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const DEFAULT_TRANSITION = 1500;\n\n/**\n * @summary Number of pixels bellow which a mouse move will be considered as a click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const MOVE_THRESHOLD = 4;\n\n/**\n * @summary Delay in milliseconds between two clicks to consider a double click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const DBLCLICK_DELAY = 300;\n\n/**\n * @summary Delay in milliseconds to emulate a long touch\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const LONGTOUCH_DELAY = 500;\n\n/**\n * @summary Delay in milliseconds to for the two fingers overlay to appear\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const TWOFINGERSOVERLAY_DELAY = 100;\n\n/**\n * @summary Duration in milliseconds of the \"ctrl zoom\" overlay\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const CTRLZOOM_TIMEOUT = 2000;\n\n/**\n * @summary Time size of the mouse position history used to compute inertia\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const INERTIA_WINDOW = 300;\n\n/**\n * @summary Radius of the THREE.SphereGeometry, Half-length of the THREE.BoxGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const SPHERE_RADIUS = 10;\n\n/**\n * @summary Property name added to viewer element\n * @memberOf PSV.constants\n * @type {string}\n * @constant\n */\nexport const VIEWER_DATA = 'photoSphereViewer';\n\n/**\n * @summary Property added the the main Mesh object\n * @memberOf PSV.constants\n * @type {string}\n * @constant\n */\nexport const MESH_USER_DATA = 'psvSphere';\n\n/**\n * @summary Available actions\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const ACTIONS = {\n ROTATE_LAT_UP : 'rotateLatitudeUp',\n ROTATE_LAT_DOWN : 'rotateLatitudeDown',\n ROTATE_LONG_RIGHT: 'rotateLongitudeRight',\n ROTATE_LONG_LEFT : 'rotateLongitudeLeft',\n ZOOM_IN : 'zoomIn',\n ZOOM_OUT : 'zoomOut',\n TOGGLE_AUTOROTATE: 'toggleAutorotate',\n};\n\n/**\n * @summary Available events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event autorotate\n * @memberof PSV\n * @summary Triggered when the automatic rotation is enabled/disabled\n * @param {boolean} enabled\n */\n AUTOROTATE : 'autorotate',\n /**\n * @event before-render\n * @memberof PSV\n * @summary Triggered before a render, used to modify the view\n * @param {number} timestamp - time provided by requestAnimationFrame\n * @param {number} elapsed - time elapsed from the previous frame\n */\n BEFORE_RENDER : 'before-render',\n /**\n * @event before-rotate\n * @memberOf PSV\n * @summary Triggered before a rotate operation, can be cancelled\n * @param {PSV.ExtendedPosition}\n */\n BEFORE_ROTATE : 'before-rotate',\n /**\n * @event click\n * @memberof PSV\n * @summary Triggered when the user clicks on the viewer (everywhere excluding the navbar and the side panel)\n * @param {PSV.ClickData} data\n */\n CLICK : 'click',\n /**\n * @event close-panel\n * @memberof PSV\n * @summary Triggered when the panel is closed\n * @param {string} [id]\n */\n CLOSE_PANEL : 'close-panel',\n /**\n * @event config-changed\n * @memberOf PSV\n * @summary Triggered after a call to setOption/setOptions\n * @param {string[]} name of changed options\n */\n CONFIG_CHANGED : 'config-changed',\n /**\n * @event dblclick\n * @memberof PSV\n * @summary Triggered when the user double clicks on the viewer. The simple `click` event is always fired before `dblclick`\n * @param {PSV.ClickData} data\n */\n DOUBLE_CLICK : 'dblclick',\n /**\n * @event fullscreen-updated\n * @memberof PSV\n * @summary Triggered when the fullscreen mode is enabled/disabled\n * @param {boolean} enabled\n */\n FULLSCREEN_UPDATED: 'fullscreen-updated',\n /**\n * @event hide-notification\n * @memberof PSV\n * @summary Triggered when the notification is hidden\n * @param {string} [id]\n */\n HIDE_NOTIFICATION : 'hide-notification',\n /**\n * @event hide-overlay\n * @memberof PSV\n * @summary Triggered when the overlay is hidden\n * @param {string} [id]\n */\n HIDE_OVERLAY : 'hide-overlay',\n /**\n * @event hide-tooltip\n * @memberof PSV\n * @summary Triggered when the tooltip is hidden\n * @param {*} Data associated to this tooltip\n */\n HIDE_TOOLTIP : 'hide-tooltip',\n /**\n * @event key-press\n * @memberof PSV\n * @summary Triggered when a key is pressed, can be cancelled\n * @param {string} key\n */\n KEY_PRESS : 'key-press',\n /**\n * @event load-progress\n * @memberof PSV\n * @summary Triggered when the loader value changes\n * @param {number} value from 0 to 100\n */\n LOAD_PROGRESS : 'load-progress',\n /**\n * @event open-panel\n * @memberof PSV\n * @summary Triggered when the panel is opened\n * @param {string} [id]\n */\n OPEN_PANEL : 'open-panel',\n /**\n * @event panorama-loaded\n * @memberof PSV\n * @summary Triggered when a panorama image has been loaded\n * @param {PSV.TextureData} textureData\n */\n PANORAMA_LOADED : 'panorama-loaded',\n /**\n * @event position-updated\n * @memberof PSV\n * @summary Triggered when the view longitude and/or latitude changes\n * @param {PSV.Position} position\n */\n POSITION_UPDATED : 'position-updated',\n /**\n * @event ready\n * @memberof PSV\n * @summary Triggered when the panorama image has been loaded and the viewer is ready to perform the first render\n */\n READY : 'ready',\n /**\n * @event render\n * @memberof PSV\n * @summary Triggered on each viewer render, **this event is triggered very often**\n */\n RENDER : 'render',\n /**\n * @event show-notification\n * @memberof PSV\n * @summary Triggered when the notification is shown\n * @param {string} [id]\n */\n SHOW_NOTIFICATION : 'show-notification',\n /**\n * @event show-overlay\n * @memberof PSV\n * @summary Triggered when the overlay is shown\n * @param {string} [id]\n */\n SHOW_OVERLAY : 'show-overlay',\n /**\n * @event show-tooltip\n * @memberof PSV\n * @summary Triggered when the tooltip is shown\n * @param {*} Data associated to this tooltip\n * @param {PSV.components.Tooltip} Instance of the tooltip\n */\n SHOW_TOOLTIP : 'show-tooltip',\n /**\n * @event size-updated\n * @memberof PSV\n * @summary Triggered when the viewer size changes\n * @param {PSV.Size} size\n */\n SIZE_UPDATED : 'size-updated',\n /**\n * @event stop-all\n * @memberof PSV\n * @summary Triggered when all current animations are stopped\n */\n STOP_ALL : 'stop-all',\n /**\n * @event zoom-updated\n * @memberof PSV\n * @summary Triggered when the zoom level changes\n * @param {number} zoomLevel\n */\n ZOOM_UPDATED : 'zoom-updated',\n};\n\n/**\n * @summary Available change events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const CHANGE_EVENTS = {\n /**\n * @event get-animate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of an animation\n */\n GET_ANIMATE_POSITION: 'get-animate-position',\n /**\n * @event get-rotate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of a rotation\n */\n GET_ROTATE_POSITION : 'get-rotate-position',\n};\n\n/**\n * @summary Special events emitted to listener using {@link Viewer#observeObjects}\n * @memberOf PSV.constants\n * @constant\n * @package\n */\nexport const OBJECT_EVENTS = {\n ENTER_OBJECT: 'enter-object',\n HOVER_OBJECT: 'hover-object',\n LEAVE_OBJECT: 'leave-object',\n};\n\n/**\n * @summary Internal identifiers for various stuff\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const IDS = {\n MENU : 'menu',\n TWO_FINGERS: 'twoFingers',\n CTRL_ZOOM : 'ctrlZoom',\n ERROR : 'error',\n DESCRIPTION: 'description',\n};\n\n/* eslint-disable */\n// @formatter:off\n/**\n * @summary Collection of easing functions\n * @memberOf PSV.constants\n * @see {@link https://gist.github.com/frederickk/6165768}\n * @type {Object}\n * @constant\n */\nexport const EASINGS = {\n linear : (t) => t,\n\n inQuad : (t) => t*t,\n outQuad : (t) => t*(2-t),\n inOutQuad : (t) => t<.5 ? 2*t*t : -1+(4-2*t)*t,\n\n inCubic : (t) => t*t*t,\n outCubic : (t) => (--t)*t*t+1,\n inOutCubic: (t) => t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1,\n\n inQuart : (t) => t*t*t*t,\n outQuart : (t) => 1-(--t)*t*t*t,\n inOutQuart: (t) => t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t,\n\n inQuint : (t) => t*t*t*t*t,\n outQuint : (t) => 1+(--t)*t*t*t*t,\n inOutQuint: (t) => t<.5 ? 16*t*t*t*t*t : 1+16*(--t)*t*t*t*t,\n\n inSine : (t) => 1-Math.cos(t*(Math.PI/2)),\n outSine : (t) => Math.sin(t*(Math.PI/2)),\n inOutSine : (t) => .5-.5*Math.cos(Math.PI*t),\n\n inExpo : (t) => Math.pow(2, 10*(t-1)),\n outExpo : (t) => 1-Math.pow(2, -10*t),\n inOutExpo : (t) => (t=t*2-1)<0 ? .5*Math.pow(2, 10*t) : 1-.5*Math.pow(2, -10*t),\n\n inCirc : (t) => 1-Math.sqrt(1-t*t),\n outCirc : (t) => Math.sqrt(1-(t-1)*(t-1)),\n inOutCirc : (t) => (t*=2)<1 ? .5-.5*Math.sqrt(1-t*t) : .5+.5*Math.sqrt(1-(t-=2)*t)\n};\n// @formatter:on\n/* eslint-enable */\n\n/**\n * @summary Subset of key codes\n * @memberOf PSV.constants\n * @type {Object}\n * @constant\n */\nexport const KEY_CODES = {\n Enter : 'Enter',\n Control : 'Control',\n Escape : 'Escape',\n Space : ' ',\n PageUp : 'PageUp',\n PageDown : 'PageDown',\n ArrowLeft : 'ArrowLeft',\n ArrowUp : 'ArrowUp',\n ArrowRight: 'ArrowRight',\n ArrowDown : 'ArrowDown',\n Delete : 'Delete',\n Plus : '+',\n Minus : '-',\n};\n","import { PSVError } from '../PSVError';\nimport { VIEWER_DATA } from './constants';\n\nconst LOCALSTORAGE_TOUCH_SUPPORT = `${VIEWER_DATA}_touchSupport`;\n\n/**\n * @summary General information about the system\n * @constant\n * @memberOf PSV\n * @property {boolean} loaded - Indicates if the system data has been loaded\n * @property {Function} load - Loads the system if not already loaded\n * @property {number} pixelRatio\n * @property {boolean} isWebGLSupported\n * @property {number} maxCanvasWidth\n * @property {string} mouseWheelEvent\n * @property {string} fullscreenEvent\n * @property {Function} getMaxCanvasWidth - Returns the max width of a canvas allowed by the browser\n * @property {{initial: boolean, promise: Promise}} isTouchEnabled\n */\nexport const SYSTEM = {\n loaded : false,\n pixelRatio : 1,\n isWebGLSupported: false,\n isTouchEnabled : null,\n maxTextureWidth : 0,\n mouseWheelEvent : null,\n fullscreenEvent : null,\n};\n\n/**\n * @summary Loads the system if not already loaded\n */\nSYSTEM.load = () => {\n if (!SYSTEM.loaded) {\n const ctx = getWebGLCtx();\n\n SYSTEM.loaded = true;\n SYSTEM.pixelRatio = window.devicePixelRatio || 1;\n SYSTEM.isWebGLSupported = ctx != null;\n SYSTEM.isTouchEnabled = isTouchEnabled();\n SYSTEM.maxTextureWidth = getMaxTextureWidth(ctx);\n SYSTEM.mouseWheelEvent = getMouseWheelEvent();\n SYSTEM.fullscreenEvent = getFullscreenEvent();\n }\n};\n\nlet maxCanvasWidth = null;\nSYSTEM.getMaxCanvasWidth = () => {\n if (maxCanvasWidth === null) {\n maxCanvasWidth = getMaxCanvasWidth(SYSTEM.maxTextureWidth);\n }\n return maxCanvasWidth;\n};\n\n/**\n * @summary Tries to return a canvas webgl context\n * @returns {WebGLRenderingContext}\n * @private\n */\nfunction getWebGLCtx() {\n const canvas = document.createElement('canvas');\n const names = ['webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'];\n let context = null;\n\n if (!canvas.getContext) {\n return null;\n }\n\n if (names.some((name) => {\n try {\n context = canvas.getContext(name);\n return context !== null;\n }\n catch (e) {\n return false;\n }\n })) {\n return context;\n }\n else {\n return null;\n }\n}\n\n/**\n * @summary Detects if the user is using a touch screen\n * @returns {{initial: boolean, promise: Promise}}\n * @private\n */\nfunction isTouchEnabled() {\n let initial = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);\n if (LOCALSTORAGE_TOUCH_SUPPORT in localStorage) {\n initial = localStorage[LOCALSTORAGE_TOUCH_SUPPORT] === 'true';\n }\n\n const promise = new Promise((resolve) => {\n let clear;\n\n const listenerMouse = () => {\n clear();\n localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = false;\n resolve(false);\n };\n\n const listenerTouch = () => {\n clear();\n localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = true;\n resolve(true);\n };\n\n const listenerTimeout = () => {\n clear();\n localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = initial;\n resolve(initial);\n };\n\n window.addEventListener('mousedown', listenerMouse, false);\n window.addEventListener('touchstart', listenerTouch, false);\n const listenerTimeoutId = setTimeout(listenerTimeout, 10000);\n\n clear = () => {\n window.removeEventListener('mousedown', listenerMouse);\n window.removeEventListener('touchstart', listenerTouch);\n clearTimeout(listenerTimeoutId);\n };\n });\n\n return { initial, promise };\n}\n\n/**\n * @summary Gets max texture width in WebGL context\n * @returns {number}\n * @private\n */\nfunction getMaxTextureWidth(ctx) {\n if (ctx !== null) {\n return ctx.getParameter(ctx.MAX_TEXTURE_SIZE);\n }\n else {\n return 0;\n }\n}\n\n/**\n * @summary Gets max canvas width supported by the browser.\n * We only test powers of 2 and height = width / 2 because that's what we need to generate WebGL textures\n * @param maxWidth\n * @return {number}\n * @private\n */\nfunction getMaxCanvasWidth(maxWidth) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = maxWidth;\n canvas.height = maxWidth / 2;\n\n while (canvas.width > 1024) {\n ctx.fillStyle = 'white';\n ctx.fillRect(0, 0, 1, 1);\n\n try {\n if (ctx.getImageData(0, 0, 1, 1).data[0] > 0) {\n return canvas.width;\n }\n }\n catch (e) {\n // continue\n }\n\n canvas.width /= 2;\n canvas.height /= 2;\n }\n\n throw new PSVError('Unable to detect system capabilities');\n}\n\n/**\n * @summary Gets the event name for mouse wheel\n * @returns {string}\n * @private\n */\nfunction getMouseWheelEvent() {\n if ('onwheel' in document.createElement('div')) { // Modern browsers support \"wheel\"\n return 'wheel';\n }\n else if (document.onmousewheel !== undefined) { // Webkit and IE support at least \"mousewheel\"\n return 'mousewheel';\n }\n else { // let's assume that remaining browsers are older Firefox\n return 'DOMMouseScroll';\n }\n}\n\n/**\n * @summary Map between fullsceen method and fullscreen event name\n * @type {Object}\n * @readonly\n * @private\n */\nconst FULLSCREEN_EVT_MAP = {\n exitFullscreen : 'fullscreenchange',\n webkitExitFullscreen: 'webkitfullscreenchange',\n mozCancelFullScreen : 'mozfullscreenchange',\n msExitFullscreen : 'MSFullscreenChange',\n};\n\n\n/**\n * @summary Gets the event name for fullscreen\n * @returns {string}\n * @private\n */\nfunction getFullscreenEvent() {\n const validExits = Object.keys(FULLSCREEN_EVT_MAP).filter(exit => exit in document);\n\n if (validExits.length) {\n return FULLSCREEN_EVT_MAP[validExits[0]];\n }\n else {\n return null;\n }\n}\n","/**\n * @summary Toggles a CSS class\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} element\n * @param {string} className\n * @param {boolean} [active] - forced state\n */\nexport function toggleClass(element, className, active) {\n if (active === undefined) {\n element.classList.toggle(className);\n }\n else if (active && !element.classList.contains(className)) {\n element.classList.add(className);\n }\n else if (!active) {\n element.classList.remove(className);\n }\n}\n\n/**\n * @summary Adds one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function addClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, true);\n });\n }\n}\n\n/**\n * @summary Removes one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function removeClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, false);\n });\n }\n}\n\n/**\n * @summary Searches if an element has a particular parent at any level including itself\n * @memberOf PSV.utils\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @returns {boolean}\n */\nexport function hasParent(el, parent) {\n let test = el;\n\n do {\n if (test === parent) {\n return true;\n }\n test = test.parentNode;\n } while (test);\n\n return false;\n}\n\n/**\n * @summary Gets the closest parent (can by itself)\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} el\n * @param {string} selector\n * @returns {HTMLElement}\n */\nexport function getClosest(el, selector) {\n // When el is document or window, the matches does not exist\n if (!el.matches) {\n return null;\n }\n\n let test = el;\n\n do {\n if (test.matches(selector)) {\n return test;\n }\n test = test instanceof SVGElement ? test.parentNode : test.parentElement;\n } while (test);\n\n return null;\n}\n\n/**\n * @summary Gets the position of an element in the viewer without reflow\n * @description Will gives the same result as getBoundingClientRect() as soon as there are no CSS transforms\n * @memberOf PSV.utils\n * @param {HTMLElement} el\n * @return {{left: number, top: number}}\n */\nexport function getPosition(el) {\n let left = 0;\n let top = 0;\n let test = el;\n\n while (test) {\n left += (test.offsetLeft - test.scrollLeft + test.clientLeft);\n top += (test.offsetTop - test.scrollTop + test.clientTop);\n test = test.offsetParent;\n }\n\n return { left, top };\n}\n\n/**\n * @summary Detects if fullscreen is enabled\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @returns {boolean}\n */\nexport function isFullscreenEnabled(elt) {\n return (document.fullscreenElement || document.webkitFullscreenElement) === elt;\n}\n\n/**\n * @summary Enters fullscreen mode\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n */\nexport function requestFullscreen(elt) {\n (elt.requestFullscreen || elt.webkitRequestFullscreen).call(elt);\n}\n\n/**\n * @summary Exits fullscreen mode\n * @memberOf PSV.utils\n */\nexport function exitFullscreen() {\n (document.exitFullscreen || document.webkitExitFullscreen).call(document);\n}\n\n/**\n * @summary Gets an element style\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @param {string} prop\n * @returns {*}\n */\nexport function getStyle(elt, prop) {\n return window.getComputedStyle(elt, null)[prop];\n}\n\n/**\n * @summary Normalize mousewheel values accross browsers\n * @memberOf PSV.utils\n * @description From Facebook's Fixed Data Table\n * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js}\n * @copyright Facebook\n * @param {WheelEvent} event\n * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}}\n */\nexport function normalizeWheel(event) {\n const PIXEL_STEP = 10;\n const LINE_HEIGHT = 40;\n const PAGE_HEIGHT = 800;\n\n let spinX = 0;\n let spinY = 0;\n let pixelX = 0;\n let pixelY = 0;\n\n // Legacy\n if ('detail' in event) {\n spinY = event.detail;\n }\n if ('wheelDelta' in event) {\n spinY = -event.wheelDelta / 120;\n }\n if ('wheelDeltaY' in event) {\n spinY = -event.wheelDeltaY / 120;\n }\n if ('wheelDeltaX' in event) {\n spinX = -event.wheelDeltaX / 120;\n }\n\n // side scrolling on FF with DOMMouseScroll\n if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {\n spinX = spinY;\n spinY = 0;\n }\n\n pixelX = spinX * PIXEL_STEP;\n pixelY = spinY * PIXEL_STEP;\n\n if ('deltaY' in event) {\n pixelY = event.deltaY;\n }\n if ('deltaX' in event) {\n pixelX = event.deltaX;\n }\n\n if ((pixelX || pixelY) && event.deltaMode) {\n // delta in LINE units\n if (event.deltaMode === 1) {\n pixelX *= LINE_HEIGHT;\n pixelY *= LINE_HEIGHT;\n }\n // delta in PAGE units\n else {\n pixelX *= PAGE_HEIGHT;\n pixelY *= PAGE_HEIGHT;\n }\n }\n\n // Fall-back if spin cannot be determined\n if (pixelX && !spinX) {\n spinX = (pixelX < 1) ? -1 : 1;\n }\n if (pixelY && !spinY) {\n spinY = (pixelY < 1) ? -1 : 1;\n }\n\n return { spinX, spinY, pixelX, pixelY };\n}\n","/**\n * @summary Ensures that a number is in a given interval\n * @memberOf PSV.utils\n * @param {number} x\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport function bound(x, min, max) {\n return Math.max(min, Math.min(max, x));\n}\n\n/**\n * @summary Ensure a value is within 0 and `max`\n * @param {number} value\n * @param {number} max\n * @return {number}\n */\nexport function loop(value, max) {\n let result = value % max;\n\n if (result < 0) {\n result += max;\n }\n\n return result;\n}\n\n/**\n * @summary Checks if a value is an integer\n * @memberOf PSV.utils\n * @param {*} value\n * @returns {boolean}\n */\nexport function isInteger(value) {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value;\n}\n\n/**\n * @summary Tests if a number is power of two\n * @memberOf PSV.utils\n * @param {number} x\n * @return {boolean}\n */\nexport function isPowerOfTwo(x) {\n return (Math.log(x) / Math.log(2)) % 1 === 0;\n}\n\n/**\n * @summary Computes the sum of an array\n * @memberOf PSV.utils\n * @param {number[]} array\n * @returns {number}\n */\nexport function sum(array) {\n return array.reduce((a, b) => a + b, 0);\n}\n\n/**\n * @summary Computes the distance between two points\n * @memberOf PSV.utils\n * @param {PSV.Point} p1\n * @param {PSV.Point} p2\n * @returns {number}\n */\nexport function distance(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\n\n/**\n * @summary Compute the shortest offset between two longitudes\n * @memberOf PSV.utils\n * @param {number} from\n * @param {number} to\n * @returns {number}\n */\nexport function getShortestArc(from, to) {\n const tCandidates = [\n 0, // direct\n Math.PI * 2, // clock-wise cross zero\n -Math.PI * 2, // counter-clock-wise cross zero\n ];\n\n return tCandidates.reduce((value, candidate) => {\n const newCandidate = to - from + candidate;\n return Math.abs(newCandidate) < Math.abs(value) ? newCandidate : value;\n }, Infinity);\n}\n\n/**\n * @summary Computes the angle between the current position and a target position\n * @memberOf PSV.utils\n * @param {PSV.Position} position1\n * @param {PSV.Position} position2\n * @returns {number}\n */\nexport function getAngle(position1, position2) {\n return Math.acos(\n Math.cos(position1.latitude)\n * Math.cos(position2.latitude)\n * Math.cos(position1.longitude - position2.longitude)\n + Math.sin(position1.latitude)\n * Math.sin(position2.latitude)\n );\n}\n\n/**\n * @summary Returns the distance between two points on a sphere of radius one\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @memberOf PSV.utils\n * @param {number[]} p1\n * @param {number[]} p2\n * @returns {number}\n */\nexport function greatArcDistance(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const x = (λ2 - λ1) * Math.cos((φ1 + φ2) / 2);\n const y = (φ2 - φ1);\n return Math.sqrt(x * x + y * y);\n}\n","/**\n * @summary Transforms a string to dash-case {@link https://github.com/shahata/dasherize}\n * @memberOf PSV.utils\n * @param {string} str\n * @returns {string}\n */\nexport function dasherize(str) {\n return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (s, i) => {\n return (i > 0 ? '-' : '') + s.toLowerCase();\n });\n}\n\n/**\n * @summary Returns a function, that, when invoked, will only be triggered at most once during a given window of time.\n * @memberOf PSV.utils\n * @copyright underscore.js - modified by Clément Prévost {@link http://stackoverflow.com/a/27078401}\n * @param {Function} func\n * @param {number} wait\n * @returns {Function}\n */\nexport function throttle(func, wait) {\n /* eslint-disable */\n let self, args, result;\n let timeout;\n let previous = 0;\n const later = function() {\n previous = Date.now();\n timeout = undefined;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n };\n return function() {\n const now = Date.now();\n if (!previous) {\n previous = now;\n }\n const remaining = wait - (now - previous);\n self = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n previous = now;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n }\n else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n /* eslint-enable */\n}\n\n/**\n * @summary Test if an object is a plain object\n * @memberOf PSV.utils\n * @description Test if an object is a plain object, i.e. is constructed\n * by the built-in Object constructor and inherits directly from Object.prototype\n * or null. Some built-in objects pass the test, e.g. Math which is a plain object\n * and some host or exotic objects may pass also.\n * {@link http://stackoverflow.com/a/5878101/1207670}\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isPlainObject(obj) {\n // Basic check for Type object that's not null\n if (typeof obj === 'object' && obj !== null) {\n // If Object.getPrototypeOf supported, use it\n if (typeof Object.getPrototypeOf === 'function') {\n const proto = Object.getPrototypeOf(obj);\n return proto === Object.prototype || proto === null;\n }\n\n // Otherwise, use internal class\n // This should be reliable as if getPrototypeOf not supported, is pre-ES5\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n // Not an object\n return false;\n}\n\n/**\n * @summary Merges the enumerable attributes of two objects\n * @memberOf PSV.utils\n * @description Replaces arrays and alters the target object.\n * @copyright Nicholas Fisher \n * @param {Object} target\n * @param {Object} src\n * @returns {Object} target\n */\nexport function deepmerge(target, src) {\n /* eslint-disable */\n let first = src;\n\n return (function merge(target, src) {\n if (Array.isArray(src)) {\n if (!target || !Array.isArray(target)) {\n target = [];\n }\n else {\n target.length = 0;\n }\n src.forEach(function(e, i) {\n target[i] = merge(null, e);\n });\n }\n else if (typeof src === 'object') {\n if (!target || Array.isArray(target)) {\n target = {};\n }\n Object.keys(src).forEach(function(key) {\n if (typeof src[key] !== 'object' || !src[key] || !isPlainObject(src[key])) {\n target[key] = src[key];\n }\n else if (src[key] != first) {\n if (!target[key]) {\n target[key] = merge(null, src[key]);\n }\n else {\n merge(target[key], src[key]);\n }\n }\n });\n }\n else {\n target = src;\n }\n\n return target;\n }(target, src));\n /* eslint-enable */\n}\n\n/**\n * @summary Deeply clones an object\n * @memberOf PSV.utils\n * @param {Object} src\n * @returns {Object}\n */\nexport function clone(src) {\n return deepmerge(null, src);\n}\n\n/**\n * @summery Test of an object is empty\n * @memberOf PSV.utils\n * @param {object} obj\n * @returns {boolean}\n */\nexport function isEmpty(obj) {\n return !obj || (Object.keys(obj).length === 0 && obj.constructor === Object);\n}\n\n/**\n * @summary Loops over enumerable properties of an object\n * @memberOf PSV.utils\n * @param {Object} object\n * @param {Function} callback\n */\nexport function each(object, callback) {\n Object.keys(object).forEach((key) => {\n callback(object[key], key);\n });\n}\n\n/**\n * @summary Returns if a valu is null or undefined\n * @memberOf PSV.utils\n * @param {*} val\n * @return {boolean}\n */\nexport function isNil(val) {\n return val === null || val === undefined;\n}\n\n/**\n * @summary Returns the first non null non undefined parameter\n * @memberOf PSV.utils\n * @param {*} values\n * @return {*}\n */\nexport function firstNonNull(...values) {\n for (const val of values) {\n if (!isNil(val)) {\n return val;\n }\n }\n\n return undefined;\n}\n","import * as THREE from 'three';\nimport { PSVError } from '../PSVError';\nimport { bound, loop } from './math';\n\n/**\n * @summary Returns the plugin constructor from the imported object\n * For retrocompatibility with previous default exports\n * @memberOf PSV.utils\n * @package\n */\nexport function pluginInterop(plugin, target) {\n if (plugin) {\n for (const [, p] of [['_', plugin], ...Object.entries(plugin)]) {\n if (p.prototype instanceof target) {\n return p;\n }\n }\n }\n return null;\n}\n\n/**\n * @summary Builds an Error with name 'AbortError'\n * @memberOf PSV.utils\n * @return {Error}\n */\nexport function getAbortError() {\n const error = new Error('Loading was aborted.');\n error.name = 'AbortError';\n return error;\n}\n\n/**\n * @summary Tests if an Error has name 'AbortError'\n * @memberOf PSV.utils\n * @param {Error} err\n * @return {boolean}\n */\nexport function isAbortError(err) {\n return err?.name === 'AbortError';\n}\n\n/**\n * @summary Displays a warning in the console\n * @memberOf PSV.utils\n * @param {string} message\n */\nexport function logWarn(message) {\n console.warn(`PhotoSphereViewer: ${message}`);\n}\n\n/**\n * @summary Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude\n * @memberOf PSV.utils\n * @param {object} object\n * @returns {boolean}\n */\nexport function isExtendedPosition(object) {\n return [['x', 'y'], ['longitude', 'latitude']].some(([key1, key2]) => {\n return object[key1] !== undefined && object[key2] !== undefined;\n });\n}\n\n/**\n * @summary Returns the value of a given attribute in the panorama metadata\n * @memberOf PSV.utils\n * @param {string} data\n * @param {string} attr\n * @returns (number)\n */\nexport function getXMPValue(data, attr) {\n // XMP data are stored in children\n let result = data.match('(.*)');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n // XMP data are stored in attributes\n result = data.match('GPano:' + attr + '=\"(.*?)\"');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n return null;\n}\n\n/**\n * @readonly\n * @private\n * @type {{top: string, left: string, bottom: string, center: string, right: string}}\n */\nconst CSS_POSITIONS = {\n top : '0%',\n bottom: '100%',\n left : '0%',\n right : '100%',\n center: '50%',\n};\n\n/**\n * @summary Translate CSS values like \"top center\" or \"10% 50%\" as top and left positions\n * @memberOf PSV.utils\n * @description The implementation is as close as possible to the \"background-position\" specification\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}\n * @param {string|PSV.Point} value\n * @returns {PSV.Point}\n */\nexport function parsePosition(value) {\n if (!value) {\n return { x: 0.5, y: 0.5 };\n }\n\n if (typeof value === 'object') {\n return value;\n }\n\n let tokens = value.toLocaleLowerCase().split(' ').slice(0, 2);\n\n if (tokens.length === 1) {\n if (CSS_POSITIONS[tokens[0]] !== undefined) {\n tokens = [tokens[0], 'center'];\n }\n else {\n tokens = [tokens[0], tokens[0]];\n }\n }\n\n const xFirst = tokens[1] !== 'left' && tokens[1] !== 'right' && tokens[0] !== 'top' && tokens[0] !== 'bottom';\n\n tokens = tokens.map(token => CSS_POSITIONS[token] || token);\n\n if (!xFirst) {\n tokens.reverse();\n }\n\n const parsed = tokens.join(' ').match(/^([0-9.]+)% ([0-9.]+)%$/);\n\n if (parsed) {\n return {\n x: parseFloat(parsed[1]) / 100,\n y: parseFloat(parsed[2]) / 100,\n };\n }\n else {\n return { x: 0.5, y: 0.5 };\n }\n}\n\n/**\n * @readonly\n * @private\n */\nconst LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' };\n/**\n * @readonly\n * @private\n */\nconst TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' };\n\n/**\n * @summary Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center\n * @memberOf PSV.utils\n * @param {string | string[]} value\n * @param {string} defaultValue\n * @param {boolean} [allowCenter=true]\n * @return {string[]}\n */\nexport function cleanPosition(value, defaultValue, allowCenter = true) {\n if (!value) {\n return defaultValue.split(' ');\n }\n\n if (typeof value === 'string') {\n const tempPos = parsePosition(value);\n\n if (!(tempPos.x in LEFT_MAP) || !(tempPos.y in TOP_MAP)) {\n throw new PSVError(`Unable to parse position \"${value}\"`);\n }\n\n value = [TOP_MAP[tempPos.y], LEFT_MAP[tempPos.x]];\n }\n\n if (!allowCenter && value[0] === 'center' && value[1] === 'center') {\n throw new PSVError('Unable to parse position \"center center\"');\n }\n\n return value;\n}\n\n/**\n * @summary Parses an speed\n * @memberOf PSV.utils\n * @param {string|number} speed - The speed, in radians/degrees/revolutions per second/minute\n * @returns {number} radians per second\n * @throws {PSV.PSVError} when the speed cannot be parsed\n */\nexport function parseSpeed(speed) {\n let parsed;\n\n if (typeof speed === 'string') {\n const speedStr = speed.toString().trim();\n\n // Speed extraction\n let speedValue = parseFloat(speedStr.replace(/^(-?[0-9]+(?:\\.[0-9]*)?).*$/, '$1'));\n const speedUnit = speedStr.replace(/^-?[0-9]+(?:\\.[0-9]*)?(.*)$/, '$1').trim();\n\n // \"per minute\" -> \"per second\"\n if (speedUnit.match(/(pm|per minute)$/)) {\n speedValue /= 60;\n }\n\n // Which unit?\n switch (speedUnit) {\n // Degrees per minute / second\n case 'dpm':\n case 'degrees per minute':\n case 'dps':\n case 'degrees per second':\n parsed = THREE.MathUtils.degToRad(speedValue);\n break;\n\n // Radians per minute / second\n case 'rdpm':\n case 'radians per minute':\n case 'rdps':\n case 'radians per second':\n parsed = speedValue;\n break;\n\n // Revolutions per minute / second\n case 'rpm':\n case 'revolutions per minute':\n case 'rps':\n case 'revolutions per second':\n parsed = speedValue * Math.PI * 2;\n break;\n\n // Unknown unit\n default:\n throw new PSVError('Unknown speed unit \"' + speedUnit + '\"');\n }\n }\n else {\n parsed = speed;\n }\n\n return parsed;\n}\n\n/**\n * @summary Parses an angle value in radians or degrees and returns a normalized value in radians\n * @memberOf PSV.utils\n * @param {string|number} angle - eg: 3.14, 3.14rad, 180deg\n * @param {boolean} [zeroCenter=false] - normalize between -Pi - Pi instead of 0 - 2*Pi\n * @param {boolean} [halfCircle=zeroCenter] - normalize between -Pi/2 - Pi/2 instead of -Pi - Pi\n * @returns {number}\n * @throws {PSV.PSVError} when the angle cannot be parsed\n */\nexport function parseAngle(angle, zeroCenter = false, halfCircle = zeroCenter) {\n let parsed;\n\n if (typeof angle === 'string') {\n const match = angle.toLowerCase().trim().match(/^(-?[0-9]+(?:\\.[0-9]*)?)(.*)$/);\n\n if (!match) {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n const value = parseFloat(match[1]);\n const unit = match[2];\n\n if (unit) {\n switch (unit) {\n case 'deg':\n case 'degs':\n parsed = THREE.MathUtils.degToRad(value);\n break;\n case 'rad':\n case 'rads':\n parsed = value;\n break;\n default:\n throw new PSVError('Unknown angle unit \"' + unit + '\"');\n }\n }\n else {\n parsed = value;\n }\n }\n else if (typeof angle === 'number' && !isNaN(angle)) {\n parsed = angle;\n }\n else {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n parsed = loop(zeroCenter ? parsed + Math.PI : parsed, Math.PI * 2);\n\n return zeroCenter ? bound(parsed - Math.PI, -Math.PI / (halfCircle ? 2 : 1), Math.PI / (halfCircle ? 2 : 1)) : parsed;\n}\n\n/**\n * @summary Creates a THREE texture from an image\n * @memberOf PSV.utils\n * @param {HTMLImageElement | HTMLCanvasElement} img\n * @return {external:THREE.Texture}\n */\nexport function createTexture(img) {\n const texture = new THREE.Texture(img);\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n return texture;\n}\n\nconst quaternion = new THREE.Quaternion();\n\n/**\n * @summary Applies the inverse of Euler angles to a vector\n * @memberOf PSV.utils\n * @param {external:THREE.Vector3} vector\n * @param {external:THREE.Euler} euler\n */\nexport function applyEulerInverse(vector, euler) {\n quaternion.setFromEuler(euler).invert();\n vector.applyQuaternion(quaternion);\n}\n","import { EASINGS } from '../data/constants';\nimport { each } from './misc';\nimport { logWarn } from './psv';\n\n/**\n * @callback OnTick\n * @summary Function called for each animation frame with computed properties\n * @memberOf PSV.utils.Animation\n * @param {Object.} properties - current values\n * @param {float} progress - 0 to 1\n */\n\n/**\n * @summary Interpolation helper for animations\n * @memberOf PSV.utils\n * @description\n * Implements the Promise API with an additional \"cancel\" method.\n * The promise is resolved with `true` when the animation is completed and `false` if the animation is cancelled.\n * @example\n * const anim = new Animation({\n * properties: {\n * width: {start: 100, end: 200}\n * },\n * duration: 5000,\n * onTick: (properties) => element.style.width = `${properties.width}px`;\n * });\n *\n * anim.then((completed) => ...);\n *\n * anim.cancel()\n */\nexport class Animation {\n\n /**\n * @param {Object} options\n * @param {Object.} options.properties\n * @param {number} options.properties[].start\n * @param {number} options.properties[].end\n * @param {number} options.duration\n * @param {number} [options.delay=0]\n * @param {string} [options.easing='linear']\n * @param {PSV.utils.Animation.OnTick} options.onTick - called on each frame\n */\n constructor(options) {\n this.__callbacks = [];\n\n if (options) {\n if (!options.easing || typeof options.easing === 'string') {\n options.easing = EASINGS[options.easing || 'linear'];\n }\n\n this.__start = null;\n this.options = options;\n\n if (options.delay) {\n this.__delayTimeout = setTimeout(() => {\n this.__delayTimeout = null;\n this.__animationFrame = window.requestAnimationFrame(t => this.__run(t));\n }, options.delay);\n }\n else {\n this.__animationFrame = window.requestAnimationFrame(t => this.__run(t));\n }\n }\n else {\n this.__resolved = true;\n }\n }\n\n /**\n * @summary Main loop for the animation\n * @param {number} timestamp\n * @private\n */\n __run(timestamp) {\n // first iteration\n if (this.__start === null) {\n this.__start = timestamp;\n }\n\n // compute progress\n const progress = (timestamp - this.__start) / this.options.duration;\n const current = {};\n\n if (progress < 1.0) {\n // interpolate properties\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.start + (prop.end - prop.start) * this.options.easing(progress);\n }\n });\n this.options.onTick(current, progress);\n\n this.__animationFrame = window.requestAnimationFrame(t => this.__run(t));\n }\n else {\n // call onTick one last time with final values\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.end;\n }\n });\n this.options.onTick(current, 1.0);\n\n this.__animationFrame = window.requestAnimationFrame(() => {\n this.__resolved = true;\n this.__resolve(true);\n });\n }\n }\n\n /**\n * @private\n */\n __resolve(value) {\n this.__callbacks.forEach(cb => cb(value));\n this.__callbacks.length = 0;\n }\n\n /**\n * @summary Promise chaining\n * @param {Function} [onFulfilled] - Called when the animation is complete (true) or cancelled (false)\n * @param {Function} [onRejected] - deprecated\n * @returns {Promise}\n */\n then(onFulfilled = null, onRejected = null) {\n if (onRejected) {\n logWarn('Animation#then does not accept a rejection handler anymore');\n }\n\n if (this.__resolved || this.__cancelled) {\n return Promise.resolve(this.__resolved)\n .then(onFulfilled);\n }\n\n return new Promise((resolve) => {\n this.__callbacks.push(resolve);\n })\n .then(onFulfilled);\n }\n\n /**\n * @summary Cancels the animation\n */\n cancel() {\n if (!this.__cancelled && !this.__resolved) {\n this.__cancelled = true;\n this.__resolve(false);\n\n if (this.__delayTimeout) {\n window.clearTimeout(this.__delayTimeout);\n this.__delayTimeout = null;\n }\n if (this.__animationFrame) {\n window.cancelAnimationFrame(this.__animationFrame);\n this.__animationFrame = null;\n }\n }\n }\n\n /**\n * @deprecated not supported anymore\n */\n catch() {\n logWarn('Animation#catch is not supported anymore');\n return this.then();\n }\n\n /**\n * @deprecated not supported anymore\n */\n finally(onFinally) {\n logWarn('Animation#finally is not supported anymore');\n return this.then(onFinally);\n }\n\n /**\n * @deprecated not supported anymore\n */\n static resolve() {\n logWarn('Animation.resolve is not supported anymore');\n }\n\n}\n","import { PSVError } from '../PSVError';\nimport { bound, loop } from './math';\n\n/**\n * @summary Represents a variable that can dynamically change with time (using requestAnimationFrame)\n * @memberOf PSV.utils\n */\nexport class Dynamic {\n\n static STOP = 0;\n static INFINITE = 1;\n static POSITION = 2;\n\n /**\n * @param {Function} [fn] Callback function\n * @param {number} [defaultValue] Default position\n * @param {number} [min] Minimum position\n * @param {number} [max] Maximum position\n * @param {boolean} [loopValue] Loop value between min and max\n */\n constructor(fn, defaultValue = 0, min = -Infinity, max = Infinity, loopValue = false) {\n /**\n * @type {Function}\n * @private\n * @readonly\n */\n this.fn = fn;\n\n /**\n * @type {number}\n * @private\n */\n this.mode = Dynamic.STOP;\n\n /**\n * @type {number}\n * @private\n */\n this.speed = 0;\n\n /**\n * @type {number}\n * @private\n */\n this.speedMult = 1;\n\n /**\n * @type {number}\n * @private\n */\n this.currentSpeed = 0;\n\n /**\n * @type {number}\n * @private\n */\n this.target = 0;\n\n /**\n * @type {number}\n * @readonly\n */\n this.current = defaultValue;\n\n /**\n * @type {number}\n * @private\n */\n this.min = min;\n\n /**\n * @type {number}\n * @private\n */\n this.max = max;\n\n /**\n * @type {boolean}\n * @private\n */\n this.loopValue = loopValue;\n\n if (loopValue && min !== 0) {\n throw new PSVError('invalid config');\n }\n\n if (this.fn) {\n this.fn(defaultValue);\n }\n }\n\n /**\n * Changes base speed\n * @param {number} speed\n */\n setSpeed(speed) {\n this.speed = speed;\n }\n\n /**\n * Defines the target position\n * @param {number} position\n * @param {number} [speedMult=1]\n */\n goto(position, speedMult = 1) {\n this.mode = Dynamic.POSITION;\n this.target = this.loopValue ? loop(position, this.max) : bound(position, this.min, this.max);\n this.speedMult = speedMult;\n }\n\n /**\n * Increase/decrease the target position\n * @param {number} step\n * @param {number} [speedMult=1]\n */\n step(step, speedMult = 1) {\n if (this.mode !== Dynamic.POSITION) {\n this.target = this.current;\n }\n this.goto(this.target + step, speedMult);\n }\n\n /**\n * Starts infinite movement\n * @param {boolean} [invert=false]\n * @param {number} [speedMult=1]\n */\n roll(invert = false, speedMult = 1) {\n this.mode = Dynamic.INFINITE;\n this.target = invert ? -Infinity : Infinity;\n this.speedMult = speedMult;\n }\n\n /**\n * Stops movement\n */\n stop() {\n this.mode = Dynamic.STOP;\n }\n\n /**\n * Defines the current position and immediately stops movement\n * @param {number} value\n */\n setValue(value) {\n this.target = this.loopValue ? loop(value, this.max) : bound(value, this.min, this.max);\n this.mode = Dynamic.STOP;\n if (this.target !== this.current) {\n this.current = this.target;\n if (this.fn) {\n this.fn(this.current);\n }\n return true;\n }\n return false;\n }\n\n /**\n * @package\n */\n update(elapsed) {\n // in position mode switch to stop mode when in the decceleration window\n if (this.mode === Dynamic.POSITION) {\n // in loop mode, alter \"current\" to avoid crossing the origin\n if (this.loopValue && Math.abs(this.target - this.current) > this.max / 2) {\n this.current = this.current < this.target ? this.current + this.max : this.current - this.max;\n }\n\n const dstStop = this.currentSpeed * this.currentSpeed / (this.speed * this.speedMult * 4);\n if (Math.abs(this.target - this.current) <= dstStop) {\n this.mode = Dynamic.STOP;\n }\n }\n\n // compute speed\n let targetSpeed = this.mode === Dynamic.STOP ? 0 : this.speed * this.speedMult;\n if (this.target < this.current) {\n targetSpeed = -targetSpeed;\n }\n if (this.currentSpeed < targetSpeed) {\n this.currentSpeed = Math.min(targetSpeed, this.currentSpeed + elapsed / 1000 * this.speed * this.speedMult * 2);\n }\n else if (this.currentSpeed > targetSpeed) {\n this.currentSpeed = Math.max(targetSpeed, this.currentSpeed - elapsed / 1000 * this.speed * this.speedMult * 2);\n }\n\n // compute new position\n let next = null;\n if (this.current > this.target && this.currentSpeed) {\n next = Math.max(this.target, this.current + this.currentSpeed * elapsed / 1000);\n }\n else if (this.current < this.target && this.currentSpeed) {\n next = Math.min(this.target, this.current + this.currentSpeed * elapsed / 1000);\n }\n\n // apply value\n if (next !== null) {\n next = this.loopValue ? loop(next, this.max) : bound(next, this.min, this.max);\n if (next !== this.current) {\n this.current = next;\n if (this.fn) {\n this.fn(this.current);\n }\n return true;\n }\n }\n\n return false;\n }\n\n}\n","import { each } from './misc';\n\n/**\n * @summary Wrapper for multiple {@link PSV.utils.Dynamic} evolving together\n * @memberOf PSV.utils\n */\nexport class MultiDynamic {\n\n /**\n * @type {Object}\n * @readonly\n */\n get current() {\n const values = {};\n each(this.dynamics, (dynamic, name) => {\n values[name] = dynamic.current;\n });\n return values;\n }\n\n /**\n * @param {Record} dynamics\n * @param {Function} [fn] Callback function\n */\n constructor(dynamics, fn) {\n /**\n * @type {Function}\n * @private\n * @readonly\n */\n this.fn = fn;\n\n /**\n * @type {Record}\n * @private\n * @readonly\n */\n this.dynamics = dynamics;\n\n if (this.fn) {\n this.fn(this.current);\n }\n }\n\n /**\n * Changes base speed\n * @param {number} speed\n */\n setSpeed(speed) {\n each(this.dynamics, (d) => {\n d.setSpeed(speed);\n });\n }\n\n /**\n * Defines the target positions\n * @param {Record} positions\n * @param {number} [speedMult=1]\n */\n goto(positions, speedMult = 1) {\n each(positions, (position, name) => {\n this.dynamics[name].goto(position, speedMult);\n });\n }\n\n /**\n * Increase/decrease the target positions\n * @param {Record} steps\n * @param {number} [speedMult=1]\n */\n step(steps, speedMult = 1) {\n each(steps, (step, name) => {\n this.dynamics[name].step(step, speedMult);\n });\n }\n\n /**\n * Starts infinite movements\n * @param {Record} rolls\n * @param {number} [speedMult=1]\n */\n roll(rolls, speedMult = 1) {\n each(rolls, (roll, name) => {\n this.dynamics[name].roll(roll, speedMult);\n });\n }\n\n /**\n * Stops movements\n */\n stop() {\n each(this.dynamics, d => d.stop());\n }\n\n /**\n * Defines the current positions and immediately stops movements\n * @param {Record} values\n */\n setValue(values) {\n let hasUpdates = false;\n each(values, (value, name) => {\n hasUpdates |= this.dynamics[name].setValue(value);\n });\n\n if (hasUpdates && this.fn) {\n this.fn(this.current);\n }\n\n return hasUpdates;\n }\n\n /**\n * @package\n */\n update(elapsed) {\n let hasUpdates = false;\n each(this.dynamics, (dynamic) => {\n hasUpdates |= dynamic.update(elapsed);\n });\n\n if (hasUpdates && this.fn) {\n this.fn(this.current);\n }\n\n return hasUpdates;\n }\n\n}\n","import { EventEmitter } from 'uevent';\n\n/**\n * @summary Helper to make sliders elements\n * @memberOf PSV.utils\n */\nexport class Slider extends EventEmitter {\n\n static VERTICAL = 1;\n static HORIZONTAL = 2;\n\n /**\n * @type {boolean}\n * @readonly\n */\n get vertical() {\n return this.prop.direction === Slider.VERTICAL;\n }\n\n constructor({ psv, container, direction, onUpdate }) {\n super();\n\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = container;\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} mousedown\n * @property {number} mediaMinWidth\n */\n this.prop = {\n onUpdate : onUpdate,\n direction: direction,\n mousedown: false,\n mouseover: false,\n };\n\n this.container.addEventListener('click', this);\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('mouseenter', this);\n this.container.addEventListener('mouseleave', this);\n this.container.addEventListener('touchstart', this);\n this.container.addEventListener('mousemove', this, true);\n this.container.addEventListener('touchmove', this, true);\n window.addEventListener('mouseup', this);\n window.addEventListener('touchend', this);\n }\n\n /**\n * @protected\n */\n destroy() {\n window.removeEventListener('mouseup', this);\n window.removeEventListener('touchend', this);\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'click': e.stopPropagation(); break;\n case 'mousedown': this.__onMouseDown(e); break;\n case 'mouseenter': this.__onMouseEnter(e); break;\n case 'mouseleave': this.__onMouseLeave(e); break;\n case 'touchstart': this.__onTouchStart(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'touchmove': this.__onTouchMove(e); break;\n case 'mouseup': this.__onMouseUp(e); break;\n case 'touchend': this.__onTouchEnd(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @private\n */\n __onMouseDown(evt) {\n this.prop.mousedown = true;\n this.__update(evt, true);\n }\n\n /**\n * @private\n */\n __onMouseEnter(evt) {\n this.prop.mouseover = true;\n this.__update(evt, true);\n }\n\n /**\n * @private\n */\n __onTouchStart(evt) {\n this.prop.mouseover = true;\n this.prop.mousedown = true;\n this.__update(evt.changedTouches[0], true);\n }\n\n /**\n * @private\n */\n __onMouseMove(evt) {\n if (this.prop.mousedown || this.prop.mouseover) {\n evt.stopPropagation();\n this.__update(evt, true);\n }\n }\n\n /**\n * @private\n */\n __onTouchMove(evt) {\n if (this.prop.mousedown || this.prop.mouseover) {\n evt.stopPropagation();\n this.__update(evt.changedTouches[0], true);\n }\n }\n\n /**\n * @private\n */\n __onMouseUp(evt) {\n if (this.prop.mousedown) {\n this.prop.mousedown = false;\n this.__update(evt, false);\n }\n }\n\n /**\n * @private\n */\n __onMouseLeave(evt) {\n if (this.prop.mouseover) {\n this.prop.mouseover = false;\n this.__update(evt, true);\n }\n }\n\n /**\n * @private\n */\n __onTouchEnd(evt) {\n if (this.prop.mousedown) {\n this.prop.mouseover = false;\n this.prop.mousedown = false;\n this.__update(evt.changedTouches[0], false);\n }\n }\n\n /**\n * @private\n */\n __update(evt, moving) {\n const boundingClientRect = this.container.getBoundingClientRect();\n const cursor = evt[this.vertical ? 'clientY' : 'clientX'];\n const pos = boundingClientRect[this.vertical ? 'bottom' : 'left'];\n const size = boundingClientRect[this.vertical ? 'height' : 'width'];\n const val = Math.abs((pos - cursor) / size);\n\n this.prop.onUpdate({\n value : val,\n click : !moving,\n mousedown: this.prop.mousedown,\n mouseover: this.prop.mouseover,\n cursor : evt,\n });\n }\n\n}\n","/**\n * @namespace PSV.utils\n */\n\nexport * from './browser';\nexport * from './math';\nexport * from './misc';\nexport * from './psv';\n\nexport * from './Animation';\nexport * from './Dynamic';\nexport * from './MultiDynamic';\nexport * from './Slider';\n","import * as THREE from 'three';\nimport { SPHERE_RADIUS } from '../../data/constants';\nimport { SYSTEM } from '../../data/system';\nimport { PSVError } from '../../PSVError';\nimport { createTexture, firstNonNull, getXMPValue, isPowerOfTwo, logWarn } from '../../utils';\nimport { AbstractAdapter } from '../AbstractAdapter';\n\n\n/**\n * @typedef {Object} PSV.adapters.EquirectangularAdapter.Options\n * @property {number} [resolution=64] - number of faces of the sphere geometry, higher values may decrease performances\n */\n\n\n/**\n * @summary Adapter for equirectangular panoramas\n * @memberof PSV.adapters\n * @extends PSV.adapters.AbstractAdapter\n */\nexport class EquirectangularAdapter extends AbstractAdapter {\n\n static id = 'equirectangular';\n static supportsDownload = true;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.adapters.EquirectangularAdapter.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.adapters.EquirectangularAdapter.Options}\n * @private\n */\n this.config = {\n resolution: 64,\n ...options,\n };\n\n if (!isPowerOfTwo(this.config.resolution)) {\n throw new PSVError('EquirectangularAdapter resolution must be power of two');\n }\n\n this.SPHERE_SEGMENTS = this.config.resolution;\n this.SPHERE_HORIZONTAL_SEGMENTS = this.SPHERE_SEGMENTS / 2;\n }\n\n /**\n * @override\n */\n supportsTransition() {\n return true;\n }\n\n /**\n * @override\n */\n supportsPreload() {\n return true;\n }\n\n /**\n * @override\n * @param {string} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData) {\n if (typeof panorama !== 'string') {\n if (Array.isArray(panorama) || typeof panorama === 'object' && !!panorama.left) {\n logWarn('Cubemap support now requires an additional adapter, see https://photo-sphere-viewer.js.org/guide/adapters');\n }\n return Promise.reject(new PSVError('Invalid panorama url, are you using the right adapter?'));\n }\n\n return (\n !this.psv.config.useXmpData\n ? this.psv.textureLoader.loadImage(panorama, p => this.psv.loader.setProgress(p))\n .then(img => ({ img: img, xmpPanoData: null }))\n : this.__loadXMP(panorama, p => this.psv.loader.setProgress(p))\n .then(xmpPanoData => this.psv.textureLoader.loadImage(panorama).then(img => ({ img, xmpPanoData })))\n )\n .then(({ img, xmpPanoData }) => {\n if (typeof newPanoData === 'function') {\n newPanoData = newPanoData(img);\n }\n\n const panoData = {\n fullWidth : firstNonNull(newPanoData?.fullWidth, xmpPanoData?.fullWidth, img.width),\n fullHeight : firstNonNull(newPanoData?.fullHeight, xmpPanoData?.fullHeight, img.height),\n croppedWidth : firstNonNull(newPanoData?.croppedWidth, xmpPanoData?.croppedWidth, img.width),\n croppedHeight: firstNonNull(newPanoData?.croppedHeight, xmpPanoData?.croppedHeight, img.height),\n croppedX : firstNonNull(newPanoData?.croppedX, xmpPanoData?.croppedX, 0),\n croppedY : firstNonNull(newPanoData?.croppedY, xmpPanoData?.croppedY, 0),\n poseHeading : firstNonNull(newPanoData?.poseHeading, xmpPanoData?.poseHeading, 0),\n posePitch : firstNonNull(newPanoData?.posePitch, xmpPanoData?.posePitch, 0),\n poseRoll : firstNonNull(newPanoData?.poseRoll, xmpPanoData?.poseRoll, 0),\n };\n\n if (panoData.croppedWidth !== img.width || panoData.croppedHeight !== img.height) {\n logWarn(`Invalid panoData, croppedWidth and/or croppedHeight is not coherent with loaded image.\n panoData: ${panoData.croppedWidth}x${panoData.croppedHeight}, image: ${img.width}x${img.height}`);\n }\n if ((newPanoData || xmpPanoData) && panoData.fullWidth !== panoData.fullHeight * 2) {\n logWarn('Invalid panoData, fullWidth should be twice fullHeight');\n }\n\n const texture = this.__createEquirectangularTexture(img, panoData);\n\n return { panorama, texture, panoData };\n });\n }\n\n /**\n * @summary Loads the XMP data of an image\n * @param {string} panorama\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadXMP(panorama, onProgress) {\n return this.psv.textureLoader.loadFile(panorama, onProgress)\n .then(blob => this.__loadBlobAsString(blob))\n .then((binary) => {\n const a = binary.indexOf('');\n const data = binary.substring(a, b);\n\n if (a !== -1 && b !== -1 && data.includes('GPano:')) {\n return {\n fullWidth : getXMPValue(data, 'FullPanoWidthPixels'),\n fullHeight : getXMPValue(data, 'FullPanoHeightPixels'),\n croppedWidth : getXMPValue(data, 'CroppedAreaImageWidthPixels'),\n croppedHeight: getXMPValue(data, 'CroppedAreaImageHeightPixels'),\n croppedX : getXMPValue(data, 'CroppedAreaLeftPixels'),\n croppedY : getXMPValue(data, 'CroppedAreaTopPixels'),\n poseHeading : getXMPValue(data, 'PoseHeadingDegrees'),\n posePitch : getXMPValue(data, 'PosePitchDegrees'),\n poseRoll : getXMPValue(data, 'PoseRollDegrees'),\n };\n }\n\n return null;\n });\n }\n\n /**\n * @summmary read a Blob as string\n * @param {Blob} blob\n * @returns {Promise}\n * @private\n */\n __loadBlobAsString(blob) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result);\n reader.onerror = reject;\n reader.readAsText(blob);\n });\n }\n\n /**\n * @summary Creates the final texture from image and panorama data\n * @param {Image} img\n * @param {PSV.PanoData} panoData\n * @returns {external:THREE.Texture}\n * @private\n */\n __createEquirectangularTexture(img, panoData) {\n // resize image / fill cropped parts with black\n if (panoData.fullWidth > SYSTEM.maxTextureWidth\n || panoData.croppedWidth !== panoData.fullWidth\n || panoData.croppedHeight !== panoData.fullHeight\n ) {\n const ratio = SYSTEM.getMaxCanvasWidth() / panoData.fullWidth;\n\n const resizedPanoData = { ...panoData };\n if (ratio < 1) {\n resizedPanoData.fullWidth *= ratio;\n resizedPanoData.fullHeight *= ratio;\n resizedPanoData.croppedWidth *= ratio;\n resizedPanoData.croppedHeight *= ratio;\n resizedPanoData.croppedX *= ratio;\n resizedPanoData.croppedY *= ratio;\n }\n\n const buffer = document.createElement('canvas');\n buffer.width = resizedPanoData.fullWidth;\n buffer.height = resizedPanoData.fullHeight;\n\n const ctx = buffer.getContext('2d');\n ctx.drawImage(img,\n resizedPanoData.croppedX, resizedPanoData.croppedY,\n resizedPanoData.croppedWidth, resizedPanoData.croppedHeight);\n\n return createTexture(buffer);\n }\n\n return createTexture(img);\n }\n\n /**\n * @override\n */\n createMesh(scale = 1) {\n // The middle of the panorama is placed at longitude=0\n const geometry = new THREE.SphereGeometry(\n SPHERE_RADIUS * scale,\n this.SPHERE_SEGMENTS,\n this.SPHERE_HORIZONTAL_SEGMENTS,\n -Math.PI / 2\n )\n .scale(-1, 1, 1);\n\n const material = new THREE.MeshBasicMaterial();\n\n return new THREE.Mesh(geometry, material);\n }\n\n /**\n * @override\n */\n setTexture(mesh, textureData) {\n mesh.material.map?.dispose();\n mesh.material.map = textureData.texture;\n }\n\n /**\n * @override\n */\n setTextureOpacity(mesh, opacity) {\n mesh.material.opacity = opacity;\n mesh.material.transparent = opacity < 1;\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n textureData.texture?.dispose();\n }\n\n}\n","/**\n * @namespace PSV.components\n */\n\n/**\n * @summary Base component class\n * @memberof PSV.components\n * @abstract\n */\nexport class AbstractComponent {\n\n /**\n * @param {PSV.Viewer | PSV.components.AbstractComponent} parent\n * @param {string} className - CSS class added to the component's container\n */\n constructor(parent, className) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = parent.psv || parent;\n\n /**\n * @member {PSV.Viewer|PSV.components.AbstractComponent}\n * @readonly\n */\n this.parent = parent;\n this.parent.children.push(this);\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} visible - Visibility of the component\n */\n this.prop = {\n visible: true,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = className;\n this.parent.container.appendChild(this.container);\n }\n\n /**\n * @summary Destroys the component\n * @protected\n */\n destroy() {\n this.parent.container.removeChild(this.container);\n\n const childIdx = this.parent.children.indexOf(this);\n if (childIdx !== -1) {\n this.parent.children.splice(childIdx, 1);\n }\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n delete this.container;\n delete this.parent;\n delete this.psv;\n delete this.prop;\n }\n\n /**\n * @summary Refresh UI\n * @description Must be be a very lightweight operation\n * @package\n */\n refreshUi() {\n this.children.every((child) => {\n child.refreshUi();\n return this.psv.prop.uiRefresh === true;\n });\n }\n\n /**\n * @summary Displays or hides the component\n */\n toggle() {\n if (this.isVisible()) {\n this.hide();\n }\n else {\n this.show();\n }\n }\n\n /**\n * @summary Hides the component\n */\n hide() {\n this.container.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @summary Displays the component\n */\n show() {\n this.container.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @summary Checks if the component is visible\n * @returns {boolean}\n */\n isVisible() {\n return this.prop.visible;\n }\n\n}\n","import { AbstractComponent } from '../components/AbstractComponent';\nimport { KEY_CODES } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { isPlainObject, toggleClass } from '../utils';\n\n/**\n * @namespace PSV.buttons\n */\n\n/**\n * @summary Base navbar button class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.buttons\n * @abstract\n */\nexport class AbstractButton extends AbstractComponent {\n\n /**\n * @summary Unique identifier of the button\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @summary Identifier to declare a group of buttons\n * @member {string}\n * @readonly\n * @static\n */\n static groupId = null;\n\n /**\n * @summary SVG icon name injected in the button\n * @member {string}\n * @readonly\n * @static\n */\n static icon = null;\n\n /**\n * @summary SVG icon name injected in the button when it is active\n * @member {string}\n * @readonly\n * @static\n */\n static iconActive = null;\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} [className] - Additional CSS classes\n * @param {boolean} [collapsable=false] - `true` if the button can be moved to menu when the navbar is too small\n * @param {boolean} [tabbable=true] - `true` if the button is accessible with the keyboard\n */\n constructor(navbar, className = '', collapsable = false, tabbable = true) {\n super(navbar, 'psv-button ' + className);\n\n /**\n * @override\n * @property {string} id - Unique identifier of the button\n * @property {boolean} enabled\n * @property {boolean} supported\n * @property {boolean} collapsed\n * @property {boolean} active\n * @property {number} width\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable: collapsable,\n enabled : true,\n supported : true,\n collapsed : false,\n active : false,\n width : this.container.offsetWidth,\n };\n\n if (this.constructor.icon) {\n this.__setIcon(this.constructor.icon);\n }\n\n if (this.prop.id && this.psv.config.lang[this.prop.id]) {\n this.container.title = this.psv.config.lang[this.prop.id];\n }\n\n if (tabbable) {\n this.container.tabIndex = 0;\n }\n\n this.container.addEventListener('click', (e) => {\n if (this.prop.enabled) {\n this.onClick();\n }\n e.stopPropagation();\n });\n\n this.container.addEventListener('keydown', (e) => {\n if (e.key === KEY_CODES.Enter && this.prop.enabled) {\n this.onClick();\n e.stopPropagation();\n }\n });\n }\n\n /**\n * @package\n */\n checkSupported() {\n const supportedOrObject = this.isSupported();\n if (isPlainObject(supportedOrObject)) {\n if (supportedOrObject.initial === false) {\n this.hide();\n this.prop.supported = false;\n }\n\n supportedOrObject.promise.then((supported) => {\n if (!this.prop) {\n return; // the component has been destroyed\n }\n this.prop.supported = supported;\n if (!supported) {\n this.hide();\n }\n else {\n this.show();\n }\n });\n }\n else {\n this.prop.supported = supportedOrObject;\n if (!supportedOrObject) {\n this.hide();\n }\n }\n }\n\n /**\n * @summary Checks if the button can be displayed\n * @returns {boolean|{initial: boolean, promise: Promise}}\n */\n isSupported() {\n return true;\n }\n\n /**\n * @summary Changes the active state of the button\n * @param {boolean} [active] - forced state\n */\n toggleActive(active) {\n this.prop.active = active !== undefined ? active : !this.prop.active;\n toggleClass(this.container, 'psv-button--active', this.prop.active);\n\n if (this.constructor.iconActive) {\n this.__setIcon(this.prop.active ? this.constructor.iconActive : this.constructor.icon);\n }\n }\n\n /**\n * @override\n */\n show(refresh = true) {\n if (!this.isVisible()) {\n this.prop.visible = true;\n if (!this.prop.collapsed) {\n this.container.style.display = '';\n }\n if (refresh) {\n this.psv.refreshUi(`show button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @override\n */\n hide(refresh = true) {\n if (this.isVisible()) {\n this.prop.visible = false;\n this.container.style.display = 'none';\n if (refresh) {\n this.psv.refreshUi(`hide button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @summary Disables the button\n */\n disable() {\n this.container.classList.add('psv-button--disabled');\n this.prop.enabled = false;\n }\n\n /**\n * @summary Enables the button\n */\n enable() {\n this.container.classList.remove('psv-button--disabled');\n this.prop.enabled = true;\n }\n\n /**\n * @summary Collapses the button in the navbar menu\n */\n collapse() {\n this.prop.collapsed = true;\n this.container.style.display = 'none';\n }\n\n /**\n * @summary Uncollapses the button from the navbar menu\n */\n uncollapse() {\n this.prop.collapsed = false;\n if (this.prop.visible) {\n this.container.style.display = '';\n }\n }\n\n /**\n * @summary Set the button icon\n * @param {string} icon SVG\n * @param {HTMLElement} [container] - default is the main button container\n * @private\n */\n __setIcon(icon, container = this.container) {\n if (icon) {\n container.innerHTML = icon;\n // className is read-only on SVGElement\n container.querySelector('svg').classList.add('psv-button-svg');\n }\n else {\n container.innerHTML = '';\n }\n }\n\n /**\n * @summary Action when the button is clicked\n * @private\n * @abstract\n */\n onClick() {\n throw new PSVError(`onClick not implemented for button \"${this.prop.id}\".`);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport playActive from '../icons/play-active.svg';\nimport play from '../icons/play.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar autorotate button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AutorotateButton extends AbstractButton {\n\n static id = 'autorotate';\n static icon = play;\n static iconActive = playActive;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-autorotate-button', true);\n\n this.psv.on(EVENTS.AUTOROTATE, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.AUTOROTATE, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.AUTOROTATE: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles autorotate\n */\n onClick() {\n if (this.psv.isAutorotateEnabled()) {\n this.psv.config.autorotateIdle = false;\n this.psv.resetIdleTimer();\n }\n this.psv.toggleAutorotate();\n }\n\n}\n","import { addClasses } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar custom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class CustomButton extends AbstractButton {\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {PSV.NavbarCustomButton} config\n */\n constructor(navbar, config) {\n super(navbar, 'psv-custom-button', config.collapsable !== false, config.tabbable !== false);\n\n /**\n * @member {Object}\n * @readonly\n * @private\n */\n this.config = config;\n\n if (this.config.id) {\n this.prop.id = this.config.id;\n }\n else {\n this.prop.id = 'psvButton-' + Math.random().toString(36).substr(2, 9);\n }\n\n if (this.config.className) {\n addClasses(this.container, this.config.className);\n }\n\n if (this.config.title) {\n this.container.title = this.config.title;\n }\n\n if (this.config.content) {\n this.container.innerHTML = this.config.content;\n }\n\n this.prop.width = this.container.offsetWidth;\n\n if (this.config.enabled === false) {\n this.disable();\n }\n\n if (this.config.visible === false) {\n this.hide();\n }\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.config;\n\n super.destroy();\n }\n\n /**\n * @override\n * @description Calls user method\n */\n onClick() {\n if (this.config.onClick) {\n this.config.onClick.apply(this.psv);\n }\n }\n\n}\n","import { EVENTS, IDS } from '../data/constants';\nimport info from '../icons/info.svg';\nimport { AbstractButton } from './AbstractButton';\n\nconst MODE_NOTIF = 1;\nconst MODE_PANEL = 2;\n\n/**\n * @summary Navigation bar description button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class DescriptionButton extends AbstractButton {\n\n static id = 'description';\n static icon = info;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-description-button');\n\n /**\n * @override\n * @property {string} mode - notification or panel\n */\n this.prop = {\n ...this.prop,\n mode: null,\n };\n\n this.psv.on(EVENTS.HIDE_NOTIFICATION, this);\n this.psv.on(EVENTS.SHOW_NOTIFICATION, this);\n this.psv.on(EVENTS.CLOSE_PANEL, this);\n this.psv.on(EVENTS.OPEN_PANEL, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.HIDE_NOTIFICATION, this);\n this.psv.off(EVENTS.SHOW_NOTIFICATION, this);\n this.psv.off(EVENTS.CLOSE_PANEL, this);\n this.psv.off(EVENTS.OPEN_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (!this.prop.mode) {\n return;\n }\n\n let closed = false;\n switch (e.type) {\n case EVENTS.HIDE_NOTIFICATION:\n closed = this.prop.mode === MODE_NOTIF;\n break;\n\n case EVENTS.SHOW_NOTIFICATION:\n closed = this.prop.mode === MODE_NOTIF && e.args[0] !== IDS.DESCRIPTION;\n break;\n\n case EVENTS.CLOSE_PANEL:\n closed = this.prop.mode === MODE_PANEL;\n break;\n\n case EVENTS.OPEN_PANEL:\n closed = this.prop.mode === MODE_PANEL && e.args[0] !== IDS.DESCRIPTION;\n break;\n\n default:\n }\n\n if (closed) {\n this.toggleActive(false);\n this.prop.mode = null;\n }\n }\n\n /**\n * @override\n */\n hide(refresh) {\n super.hide(refresh);\n\n if (this.prop.mode) {\n this.__close();\n }\n }\n\n /**\n * This button can only be refresh from NavbarCaption\n * @override\n */\n refreshUi(refresh = false) {\n if (refresh) {\n const caption = this.psv.navbar.getButton('caption', false);\n const captionHidden = caption && !caption.isVisible();\n const hasDescription = !!this.psv.config.description;\n\n if (captionHidden || hasDescription) {\n this.show(false);\n }\n else {\n this.hide(false);\n }\n }\n }\n\n /**\n * @override\n * @description Toggles caption\n */\n onClick() {\n if (this.prop.mode) {\n this.__close();\n }\n else {\n this.__open();\n }\n }\n\n /**\n * @private\n */\n __close() {\n switch (this.prop.mode) {\n case MODE_NOTIF:\n this.psv.notification.hide(IDS.DESCRIPTION);\n break;\n case MODE_PANEL:\n this.psv.panel.hide(IDS.DESCRIPTION);\n break;\n default:\n }\n }\n\n /**\n * @private\n */\n __open() {\n this.toggleActive(true);\n\n if (this.psv.config.description) {\n this.prop.mode = MODE_PANEL;\n this.psv.panel.show({\n id : IDS.DESCRIPTION,\n content: `${this.psv.config.caption ? `

${this.psv.config.caption}

` : ''}${this.psv.config.description}`,\n });\n }\n else {\n this.prop.mode = MODE_NOTIF;\n this.psv.notification.show({\n id : IDS.DESCRIPTION,\n content: this.psv.config.caption,\n });\n }\n }\n\n}\n","import download from '../icons/download.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar download button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class DownloadButton extends AbstractButton {\n\n static id = 'download';\n static icon = download;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-download-button', true);\n }\n\n /**\n * @override\n * @description Asks the browser to download the panorama source file\n */\n onClick() {\n const link = document.createElement('a');\n link.href = this.psv.config.downloadUrl || this.psv.config.panorama;\n link.download = link.href.split('/').pop();\n this.psv.container.appendChild(link);\n link.click();\n\n setTimeout(() => {\n this.psv.container.removeChild(link);\n }, 100);\n }\n\n /**\n * @override\n */\n refreshUi() {\n const supported = this.psv.adapter.constructor.supportsDownload || this.psv.config.downloadUrl;\n if (supported && !this.prop.visible) {\n this.show();\n }\n else if (!supported && this.prop.visible) {\n this.hide();\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport fullscreenIn from '../icons/fullscreen-in.svg';\nimport fullscreenOut from '../icons/fullscreen-out.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar fullscreen button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class FullscreenButton extends AbstractButton {\n\n static id = 'fullscreen';\n static icon = fullscreenIn;\n static iconActive = fullscreenOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-fullscreen-button');\n\n this.psv.on(EVENTS.FULLSCREEN_UPDATED, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.FULLSCREEN_UPDATED, this);\n\n super.destroy();\n }\n\n /**\n * Handle events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.FULLSCREEN_UPDATED: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles fullscreen\n */\n onClick() {\n this.psv.toggleFullscreen();\n }\n\n}\n","import { EVENTS, IDS } from '../data/constants';\nimport menuIcon from '../icons/menu.svg';\nimport { dasherize, getClosest } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar menu button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MenuButton extends AbstractButton {\n\n static id = 'menu';\n static icon = menuIcon;\n\n /**\n * @summary Property name added to buttons list\n * @type {string}\n * @constant\n */\n static BUTTON_DATA = 'psvButton';\n\n /**\n * @summary Menu template\n * @param {AbstractButton[]} buttons\n * @param {PSV.Viewer} psv\n * @param {string} dataKey\n * @returns {string}\n */\n static MENU_TEMPLATE = (buttons, psv, dataKey) => `\n
\n

${menuIcon} ${psv.config.lang.menu}

\n
    \n ${buttons.map(button => `\n
  • \n ${button.container.innerHTML}\n ${button.container.title}\n
  • \n `).join('')}\n
\n
\n`;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-menu-button');\n\n this.psv.on(EVENTS.OPEN_PANEL, this);\n this.psv.on(EVENTS.CLOSE_PANEL, this);\n\n super.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.OPEN_PANEL, this);\n this.psv.off(EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === IDS.MENU); break;\n case EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n hide(refresh) {\n super.hide(refresh);\n this.__hideMenu();\n }\n\n /**\n * @override\n */\n show(refresh) {\n super.show(refresh);\n\n if (this.prop.active) {\n this.__showMenu();\n }\n }\n\n /**\n * @override\n * @description Toggles menu\n */\n onClick() {\n if (this.prop.active) {\n this.__hideMenu();\n }\n else {\n this.__showMenu();\n }\n }\n\n __showMenu() {\n this.psv.panel.show({\n id : IDS.MENU,\n content : MenuButton.MENU_TEMPLATE(this.parent.collapsed, this.psv, dasherize(MenuButton.BUTTON_DATA)),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? getClosest(e.target, 'li') : undefined;\n const buttonId = li ? li.dataset[MenuButton.BUTTON_DATA] : undefined;\n\n if (buttonId) {\n this.parent.getButton(buttonId).onClick();\n this.__hideMenu();\n }\n },\n });\n }\n\n __hideMenu() {\n this.psv.panel.hide(IDS.MENU);\n }\n\n}\n","/**\n * @summary Helper for pressable things (buttons, keyboard)\n * @description When the pressed thing goes up and was not pressed long enough, wait a bit more before execution\n * @private\n */\nexport class PressHandler {\n\n constructor(delay = 200) {\n this.delay = delay;\n this.time = 0;\n this.timeout = null;\n }\n\n down() {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n this.time = new Date().getTime();\n }\n\n up(cb) {\n if (!this.time) {\n return;\n }\n\n const elapsed = new Date().getTime() - this.time;\n if (elapsed < this.delay) {\n this.timeout = setTimeout(() => {\n cb();\n this.timeout = null;\n this.time = 0;\n }, this.delay);\n }\n else {\n cb();\n this.time = 0;\n }\n }\n\n}\n","import { KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport arrow from '../icons/arrow.svg';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractButton } from './AbstractButton';\n\nexport function getOrientedArrow(direction) {\n let angle = 0;\n switch (direction) {\n // @formatter:off\n case 'up': angle = 90; break;\n case 'right': angle = 180; break;\n case 'down': angle = -90; break;\n default: angle = 0; break;\n // @formatter:on\n }\n\n return arrow.replace('rotate(0', `rotate(${angle}`);\n}\n\n/**\n * @summary Navigation bar move button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AbstractMoveButton extends AbstractButton {\n\n static groupId = 'move';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {number} value\n */\n constructor(navbar, value) {\n super(navbar, 'psv-button--hover-scale psv-move-button');\n\n this.container.title = this.psv.config.lang.move;\n\n /**\n * @override\n * @property {{longitude: boolean, latitude: boolean}} value\n * @property {PressHandler} handler\n */\n this.prop = {\n ...this.prop,\n value : value,\n handler: new PressHandler(),\n };\n\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('keydown', this);\n this.container.addEventListener('keyup', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.__onMouseUp();\n\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(); break;\n case 'mouseup': this.__onMouseUp(); break;\n case 'touchend': this.__onMouseUp(); break;\n case 'keydown': e.key === KEY_CODES.Enter && this.__onMouseDown(); break;\n case 'keyup': e.key === KEY_CODES.Enter && this.__onMouseUp(); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return {\n initial: !SYSTEM.isTouchEnabled.initial,\n promise: SYSTEM.isTouchEnabled.promise.then(enabled => !enabled),\n };\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @private\n */\n __onMouseDown() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.psv.__stopAll();\n this.psv.dynamics.position.roll(this.prop.value);\n this.prop.handler.down();\n }\n\n /**\n * @private\n */\n __onMouseUp() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.handler.up(() => {\n this.psv.dynamics.position.stop();\n this.psv.resetIdleTimer();\n });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move down button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveDownButton extends AbstractMoveButton {\n\n static id = 'moveDown';\n static icon = getOrientedArrow('down');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { latitude: true });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move left button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveLeftButton extends AbstractMoveButton {\n\n static id = 'moveLeft';\n static icon = getOrientedArrow('left');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { longitude: true });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move right button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveRightButton extends AbstractMoveButton {\n\n static id = 'moveRight';\n static icon = getOrientedArrow('right');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { longitude: false });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move up button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveUpButton extends AbstractMoveButton {\n\n static id = 'moveUp';\n static icon = getOrientedArrow('up');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { latitude: false });\n }\n\n}\n","import { KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AbstractZoomButton extends AbstractButton {\n\n static groupId = 'zoom';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {number} value\n */\n constructor(navbar, value) {\n super(navbar, 'psv-button--hover-scale psv-zoom-button');\n\n /**\n * @override\n * @property {boolean} value\n * @property {PressHandler} handler\n */\n this.prop = {\n ...this.prop,\n value : value,\n handler: new PressHandler(),\n };\n\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('keydown', this);\n this.container.addEventListener('keyup', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.__onMouseUp();\n\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(); break;\n case 'mouseup': this.__onMouseUp(); break;\n case 'touchend': this.__onMouseUp(); break;\n case 'keydown': e.key === KEY_CODES.Enter && this.__onMouseDown(); break;\n case 'keyup': e.key === KEY_CODES.Enter && this.__onMouseUp(); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return {\n initial: !SYSTEM.isTouchEnabled.initial,\n promise: SYSTEM.isTouchEnabled.promise.then(enabled => !enabled),\n };\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @private\n */\n __onMouseDown() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.psv.dynamics.zoom.roll(this.prop.value);\n this.prop.handler.down();\n }\n\n /**\n * @private\n */\n __onMouseUp() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.handler.up(() => this.psv.dynamics.zoom.stop());\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomIn from '../icons/zoom-in.svg';\n\n/**\n * @summary Navigation bar zoom-in button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomInButton extends AbstractZoomButton {\n\n static id = 'zoomIn';\n static icon = zoomIn;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, false);\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomOut from '../icons/zoom-out.svg';\n\n/**\n * @summary Navigation bar zoom-out button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomOutButton extends AbstractZoomButton {\n\n static id = 'zoomOut';\n static icon = zoomOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, true);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { getStyle, Slider } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class ZoomRangeButton extends AbstractButton {\n\n static id = 'zoomRange';\n static groupId = 'zoom';\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-zoom-range', false, false);\n\n /**\n * @override\n * @property {number} mediaMinWidth\n */\n this.prop = {\n ...this.prop,\n mediaMinWidth: 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomRange = document.createElement('div');\n this.zoomRange.className = 'psv-zoom-range-line';\n this.container.appendChild(this.zoomRange);\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomValue = document.createElement('div');\n this.zoomValue.className = 'psv-zoom-range-handle';\n this.zoomRange.appendChild(this.zoomValue);\n\n /**\n * @member {PSV.Slider}\n * @readonly\n * @private\n */\n this.slider = new Slider({\n container: this.container,\n direction: Slider.HORIZONTAL,\n onUpdate : e => this.__onSliderUpdate(e),\n });\n\n this.prop.mediaMinWidth = parseInt(getStyle(this.container, 'maxWidth'), 10);\n\n this.psv.on(EVENTS.ZOOM_UPDATED, this);\n if (this.psv.prop.ready) {\n this.__moveZoomValue(this.psv.getZoomLevel());\n }\n else {\n this.psv.once(EVENTS.READY, this);\n }\n\n this.refreshUi();\n }\n\n /**\n * @override\n */\n destroy() {\n this.slider.destroy();\n\n delete this.zoomRange;\n delete this.zoomValue;\n\n this.psv.off(EVENTS.ZOOM_UPDATED, this);\n this.psv.off(EVENTS.READY, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.ZOOM_UPDATED: this.__moveZoomValue(e.args[0]); break;\n case EVENTS.READY: this.__moveZoomValue(this.psv.getZoomLevel()); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return {\n initial: !SYSTEM.isTouchEnabled.initial,\n promise: SYSTEM.isTouchEnabled.promise.then(enabled => !enabled),\n };\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.supported) {\n if (this.psv.prop.size.width <= this.prop.mediaMinWidth && this.prop.visible) {\n this.hide();\n }\n else if (this.psv.prop.size.width > this.prop.mediaMinWidth && !this.prop.visible) {\n this.show();\n }\n }\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @summary Moves the zoom cursor\n * @param {number} level\n * @private\n */\n __moveZoomValue(level) {\n this.zoomValue.style.left = (level / 100 * this.zoomRange.offsetWidth - this.zoomValue.offsetWidth / 2) + 'px';\n }\n\n\n /**\n * @summary Zoom change\n * @private\n */\n __onSliderUpdate(e) {\n if (e.mousedown) {\n this.psv.zoom(e.value * 100);\n }\n }\n\n}\n","import { EventEmitter } from 'uevent';\n\n/**\n * @namespace PSV.plugins\n */\n\n/**\n * @summary Base plugins class\n * @memberof PSV.plugins\n * @abstract\n */\nexport class AbstractPlugin extends EventEmitter {\n\n /**\n * @summary Unique identifier of the plugin\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super();\n\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n }\n\n /**\n * @summary Initializes the plugin\n * @package\n */\n init() {\n }\n\n /**\n * @summary Destroys the plugin\n * @package\n */\n destroy() {\n delete this.psv;\n }\n\n}\n","import { AbstractAdapter } from '../adapters/AbstractAdapter';\nimport { EquirectangularAdapter } from '../adapters/equirectangular';\nimport { AbstractPlugin } from '../plugins/AbstractPlugin';\nimport { PSVError } from '../PSVError';\nimport { bound, clone, deepmerge, each, isNil, logWarn, parseAngle, parseSpeed, pluginInterop } from '../utils';\nimport { ACTIONS, KEY_CODES } from './constants';\n\n/**\n * @summary Default options\n * @type {PSV.Options}\n * @memberOf PSV\n * @constant\n */\nexport const DEFAULTS = {\n panorama : null,\n container : null,\n adapter : null,\n plugins : [],\n caption : null,\n description : null,\n downloadUrl : null,\n loadingImg : null,\n loadingTxt : 'Loading...',\n size : null,\n fisheye : false,\n minFov : 30,\n maxFov : 90,\n defaultZoomLvl : 50,\n defaultLong : 0,\n defaultLat : 0,\n sphereCorrection : null,\n moveSpeed : 1,\n zoomSpeed : 1,\n autorotateDelay : null,\n autorotateIdle : false,\n autorotateSpeed : '2rpm',\n autorotateLat : null,\n moveInertia : true,\n mousewheel : true,\n mousemove : true,\n captureCursor : false,\n mousewheelCtrlKey : false,\n touchmoveTwoFingers: false,\n useXmpData : true,\n panoData : null,\n requestHeaders : null,\n canvasBackground : '#000',\n withCredentials : false,\n navbar : [\n 'autorotate',\n 'zoom',\n 'move',\n 'download',\n 'description',\n 'caption',\n 'fullscreen',\n ],\n lang : {\n autorotate: 'Automatic rotation',\n zoom : 'Zoom',\n zoomOut : 'Zoom out',\n zoomIn : 'Zoom in',\n move : 'Move',\n download : 'Download',\n fullscreen: 'Fullscreen',\n menu : 'Menu',\n twoFingers: 'Use two fingers to navigate',\n ctrlZoom : 'Use ctrl + scroll to zoom the image',\n loadError : 'The panorama can\\'t be loaded',\n },\n keyboard : {\n [KEY_CODES.ArrowUp] : ACTIONS.ROTATE_LAT_UP,\n [KEY_CODES.ArrowDown] : ACTIONS.ROTATE_LAT_DOWN,\n [KEY_CODES.ArrowRight]: ACTIONS.ROTATE_LONG_RIGHT,\n [KEY_CODES.ArrowLeft] : ACTIONS.ROTATE_LONG_LEFT,\n [KEY_CODES.PageUp] : ACTIONS.ZOOM_IN,\n [KEY_CODES.PageDown] : ACTIONS.ZOOM_OUT,\n [KEY_CODES.Plus] : ACTIONS.ZOOM_IN,\n [KEY_CODES.Minus] : ACTIONS.ZOOM_OUT,\n [KEY_CODES.Space] : ACTIONS.TOGGLE_AUTOROTATE,\n },\n};\n\n/**\n * @summary List of unmodifiable options and their error messages\n * @private\n */\nexport const READONLY_OPTIONS = {\n panorama : 'Use setPanorama method to change the panorama',\n panoData : 'Use setPanorama method to change the panorama',\n container: 'Cannot change viewer container',\n adapter : 'Cannot change adapter',\n plugins : 'Cannot change plugins',\n};\n\n/**\n * @summary List of deprecated options and their warning messages\n * @private\n */\nexport const DEPRECATED_OPTIONS = {\n zoomButtonIncrement : 'zoomButtonIncrement is deprecated, use zoomSpeed',\n mousewheelSpeed : 'mousewheelSpeed is deprecated, use zoomSpeed',\n sphereCorrectionReorder: 'sphereCorrectionReorder is deprecated',\n};\n\n/**\n * @summary Parsers/validators for each option\n * @private\n */\nexport const CONFIG_PARSERS = {\n container : (container) => {\n if (!container) {\n throw new PSVError('No value given for container.');\n }\n return container;\n },\n adapter : (adapter) => {\n if (!adapter) {\n adapter = [EquirectangularAdapter];\n }\n else if (Array.isArray(adapter)) {\n adapter = [pluginInterop(adapter[0], AbstractAdapter), adapter[1]];\n }\n else {\n adapter = [pluginInterop(adapter, AbstractAdapter)];\n }\n if (!adapter[0]) {\n throw new PSVError('Un undefined value with given for adapter.');\n }\n return adapter;\n },\n defaultLong : (defaultLong) => {\n // defaultLat is between 0 and PI\n return parseAngle(defaultLong);\n },\n defaultLat : (defaultLat) => {\n // defaultLat is between -PI/2 and PI/2\n return parseAngle(defaultLat, true);\n },\n minFov : (minFov, config) => {\n // minFov and maxFov must be ordered\n if (config.maxFov < minFov) {\n logWarn('maxFov cannot be lower than minFov');\n minFov = config.maxFov;\n }\n // minFov between 1 and 179\n return bound(minFov, 1, 179);\n },\n maxFov : (maxFov, config) => {\n // minFov and maxFov must be ordered\n if (maxFov < config.minFov) {\n maxFov = config.minFov;\n }\n // maxFov between 1 and 179\n return bound(maxFov, 1, 179);\n },\n lang : (lang) => {\n if (Array.isArray(lang.twoFingers)) {\n logWarn('lang.twoFingers must not be an array');\n lang.twoFingers = lang.twoFingers[0];\n }\n return {\n ...DEFAULTS.lang,\n ...lang,\n };\n },\n keyboard : (keyboard) => {\n // keyboard=true becomes the default map\n if (keyboard === true) {\n return clone(DEFAULTS.keyboard);\n }\n return keyboard;\n },\n autorotateLat : (autorotateLat, config) => {\n // default autorotateLat is defaultLat\n if (autorotateLat === null) {\n return parseAngle(config.defaultLat, true);\n }\n // autorotateLat is between -PI/2 and PI/2\n else {\n return parseAngle(autorotateLat, true);\n }\n },\n autorotateSpeed: (autorotateSpeed) => {\n return parseSpeed(autorotateSpeed);\n },\n autorotateIdle : (autorotateIdle, config) => {\n if (autorotateIdle && isNil(config.autorotateDelay)) {\n logWarn('autorotateIdle requires a non null autorotateDelay');\n return false;\n }\n return autorotateIdle;\n },\n fisheye : (fisheye) => {\n // translate boolean fisheye to amount\n if (fisheye === true) {\n return 1;\n }\n else if (fisheye === false) {\n return 0;\n }\n return fisheye;\n },\n plugins : (plugins) => {\n return plugins\n .map((plugin) => {\n if (Array.isArray(plugin)) {\n plugin = [pluginInterop(plugin[0], AbstractPlugin), plugin[1]];\n }\n else {\n plugin = [pluginInterop(plugin, AbstractPlugin)];\n }\n if (!plugin[0]) {\n throw new PSVError('Un undefined value was given for plugins.');\n }\n return plugin;\n });\n },\n};\n\n/**\n * @summary Merge user config with default config and performs validation\n * @param {PSV.Options} options\n * @returns {PSV.Options}\n * @memberOf PSV\n * @private\n */\nexport function getConfig(options) {\n const tempConfig = clone(DEFAULTS);\n deepmerge(tempConfig, options);\n\n const config = {};\n\n each(tempConfig, (value, key) => {\n if (DEPRECATED_OPTIONS[key]) {\n logWarn(DEPRECATED_OPTIONS[key]);\n return;\n }\n\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (CONFIG_PARSERS[key]) {\n config[key] = CONFIG_PARSERS[key](value, tempConfig);\n }\n else {\n config[key] = value;\n }\n });\n\n return config;\n}\n","import { DescriptionButton } from '../buttons/DescriptionButton';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Navbar caption class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class NavbarCaption extends AbstractComponent {\n\n static id = 'caption';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} caption\n */\n constructor(navbar, caption) {\n super(navbar, 'psv-caption');\n\n /**\n * @override\n * @property {string} id\n * @property {boolean} collapsable\n * @property {number} width\n * @property {number} contentWidth - width of the caption content\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable : false,\n width : 0,\n contentWidth: 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-caption-content';\n this.container.appendChild(this.content);\n\n this.setCaption(caption);\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n this.show();\n this.content.innerHTML = html;\n this.prop.contentWidth = html ? this.content.offsetWidth : 0;\n this.refreshUi();\n }\n\n /**\n * @summary Toggles content and icon depending on available space\n * @private\n */\n refreshUi() {\n const availableWidth = this.container.offsetWidth;\n if (availableWidth >= this.prop.contentWidth) {\n this.show();\n }\n else if (availableWidth < this.prop.contentWidth) {\n this.hide();\n }\n this.__refreshButton();\n }\n\n /**\n * @override\n */\n hide() {\n this.content.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @override\n */\n show() {\n this.content.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @private\n */\n __refreshButton() {\n this.psv.navbar.getButton(DescriptionButton.id, false)?.refreshUi(true);\n }\n\n}\n","import { AutorotateButton } from '../buttons/AutorotateButton';\nimport { CustomButton } from '../buttons/CustomButton';\nimport { DescriptionButton } from '../buttons/DescriptionButton';\nimport { DownloadButton } from '../buttons/DownloadButton';\nimport { FullscreenButton } from '../buttons/FullscreenButton';\nimport { MenuButton } from '../buttons/MenuButton';\nimport { MoveDownButton } from '../buttons/MoveDownButton';\nimport { MoveLeftButton } from '../buttons/MoveLeftButton';\nimport { MoveRightButton } from '../buttons/MoveRightButton';\nimport { MoveUpButton } from '../buttons/MoveUpButton';\nimport { ZoomInButton } from '../buttons/ZoomInButton';\nimport { ZoomOutButton } from '../buttons/ZoomOutButton';\nimport { ZoomRangeButton } from '../buttons/ZoomRangeButton';\nimport { DEFAULTS } from '../data/config';\nimport { PSVError } from '../PSVError';\nimport { clone, logWarn } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\nimport { NavbarCaption } from './NavbarCaption';\n\n/**\n * @summary List of available buttons\n * @type {Object>}\n * @private\n */\nconst AVAILABLE_BUTTONS = {};\n\n/**\n * @summary List of available buttons\n * @type {Object>>}\n * @private\n */\nconst AVAILABLE_GROUPS = {};\n\n/**\n * @summary Register a new button available for all viewers\n * @param {Class} button\n * @param {'start' | 'end' | '[id]:left' | '[id]:right'} [defaultPosition]\n * If provided the default configuration of the navbar will be modified.\n * @memberOf PSV\n */\nexport function registerButton(button, defaultPosition) {\n if (!button.id) {\n throw new PSVError('Button ID is required');\n }\n\n AVAILABLE_BUTTONS[button.id] = button;\n\n if (button.groupId) {\n AVAILABLE_GROUPS[button.groupId] = AVAILABLE_GROUPS[button.groupId] || [];\n AVAILABLE_GROUPS[button.groupId].push(button);\n }\n\n if (typeof defaultPosition === 'string') {\n switch (defaultPosition) {\n case 'start':\n DEFAULTS.navbar.unshift(button.id);\n break;\n case 'end':\n DEFAULTS.navbar.push(button.id);\n break;\n default:\n const [id, pos] = defaultPosition.split(':');\n DEFAULTS.navbar.splice(DEFAULTS.navbar.indexOf(id) + (pos === 'right' ? 1 : 0), 0, button.id);\n }\n }\n}\n\n[\n AutorotateButton,\n ZoomOutButton,\n ZoomRangeButton,\n ZoomInButton,\n DescriptionButton,\n DownloadButton,\n FullscreenButton,\n MoveLeftButton,\n MoveRightButton,\n MoveUpButton,\n MoveDownButton,\n].forEach(registerButton);\n\n/**\n * @summary Navigation bar component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Navbar extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-navbar');\n\n /**\n * @summary List of buttons of the navbar\n * @member {PSV.buttons.AbstractButton[]}\n * @override\n */\n this.children = [];\n\n /**\n * @summary List of collapsed buttons\n * @member {PSV.buttons.AbstractButton[]}\n * @private\n */\n this.collapsed = [];\n }\n\n /**\n * @summary Change the buttons visible on the navbar\n * @param {string|Array} buttons\n * @throws {PSV.PSVError} when a button is unknown\n */\n setButtons(buttons) {\n this.children.slice().forEach(item => item.destroy());\n this.children.length = 0;\n\n const cleanedButtons = this.__cleanButtons(buttons);\n\n // force description button if caption is present (used on narrow screens)\n if (cleanedButtons.indexOf(NavbarCaption.id) !== -1 && cleanedButtons.indexOf(DescriptionButton.id) === -1) {\n cleanedButtons.splice(cleanedButtons.indexOf(NavbarCaption.id), 0, DescriptionButton.id);\n }\n\n /* eslint-disable no-new */\n cleanedButtons.forEach((button) => {\n if (typeof button === 'object') {\n new CustomButton(this, button);\n }\n else if (AVAILABLE_BUTTONS[button]) {\n new AVAILABLE_BUTTONS[button](this);\n }\n else if (AVAILABLE_GROUPS[button]) {\n AVAILABLE_GROUPS[button].forEach(buttonCtor => new buttonCtor(this)); // eslint-disable-line new-cap\n }\n else if (button === NavbarCaption.id) {\n new NavbarCaption(this, this.psv.config.caption);\n }\n else {\n throw new PSVError('Unknown button ' + button);\n }\n });\n\n new MenuButton(this);\n /* eslint-enable no-new */\n\n this.children.forEach((item) => {\n if (typeof item.checkSupported === 'function') {\n item.checkSupported();\n }\n });\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n const caption = this.getButton(NavbarCaption.id, false);\n caption?.setCaption(html);\n }\n\n /**\n * @summary Returns a button by its identifier\n * @param {string} id\n * @param {boolean} [warnNotFound=true]\n * @returns {PSV.buttons.AbstractButton}\n */\n getButton(id, warnNotFound = true) {\n let button = null;\n\n this.children.some((item) => {\n if (item.prop.id === id) {\n button = item;\n return true;\n }\n else {\n return false;\n }\n });\n\n if (!button && warnNotFound) {\n logWarn(`button \"${id}\" not found in the navbar`);\n }\n\n return button;\n }\n\n /**\n * @summary Shows the navbar\n */\n show() {\n this.container.classList.add('psv-navbar--open');\n this.prop.visible = true;\n }\n\n /**\n * @summary Hides the navbar\n */\n hide() {\n this.container.classList.remove('psv-navbar--open');\n this.prop.visible = false;\n }\n\n /**\n * @override\n */\n refreshUi() {\n super.refreshUi();\n\n if (this.psv.prop.uiRefresh === true) {\n const availableWidth = this.container.offsetWidth;\n\n let totalWidth = 0;\n const visibleButtons = [];\n const collapsableButtons = [];\n\n this.children.forEach((item) => {\n if (item.prop.visible) {\n totalWidth += item.prop.width;\n visibleButtons.push(item);\n if (item.prop.collapsable) {\n collapsableButtons.push(item);\n }\n }\n });\n\n if (!visibleButtons.length) {\n return;\n }\n\n if (availableWidth < totalWidth && collapsableButtons.length > 0) {\n collapsableButtons.forEach(item => item.collapse());\n this.collapsed = collapsableButtons;\n\n this.getButton(MenuButton.id).show(false);\n }\n else if (availableWidth >= totalWidth && this.collapsed.length > 0) {\n this.collapsed.forEach(item => item.uncollapse());\n this.collapsed = [];\n\n this.getButton(MenuButton.id).hide(false);\n }\n\n const caption = this.getButton(NavbarCaption.id, false);\n if (caption) {\n caption.refreshUi();\n }\n }\n }\n\n /**\n * @summary Ensure the buttons configuration is correct\n * @private\n */\n __cleanButtons(buttons) {\n // true becomes the default array\n if (buttons === true) {\n return clone(DEFAULTS.navbar);\n }\n // can be a space or coma separated list\n else if (typeof buttons === 'string') {\n return buttons.split(/[ ,]/);\n }\n else {\n return buttons || [];\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { bound, getStyle } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Loader component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Loader extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-loader-container');\n\n /**\n * @summary Inner container for vertical center\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.loader = document.createElement('div');\n this.loader.className = 'psv-loader';\n this.container.appendChild(this.loader);\n\n /**\n * @summary Animation canvas\n * @member {HTMLCanvasElement}\n * @readonly\n * @private\n */\n this.canvas = document.createElement('canvas');\n this.canvas.className = 'psv-loader-canvas';\n\n this.canvas.width = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.canvas.height = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.loader.appendChild(this.canvas);\n\n /**\n * @override\n * @property {number} thickness\n * @property {string} current\n */\n this.prop = {\n ...this.prop,\n tickness: (this.loader.offsetWidth - this.loader.clientWidth) / 2 * SYSTEM.pixelRatio,\n current : null,\n };\n\n this.refreshUi();\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.loader;\n delete this.canvas;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.current !== (this.psv.config.loadingImg || this.psv.config.loadingTxt)) {\n if (this.prop.current) {\n this.loader.removeChild(this.loader.lastChild);\n }\n\n let inner;\n if (this.psv.config.loadingImg) {\n inner = document.createElement('img');\n inner.className = 'psv-loader-image';\n inner.src = this.psv.config.loadingImg;\n }\n else if (this.psv.config.loadingTxt) {\n inner = document.createElement('div');\n inner.className = 'psv-loader-text';\n inner.innerHTML = this.psv.config.loadingTxt;\n }\n if (inner) {\n const size = Math.round(Math.sqrt(2 * Math.pow((this.canvas.width / 2 - this.prop.tickness / 2) / SYSTEM.pixelRatio, 2)));\n inner.style.maxWidth = size + 'px';\n inner.style.maxHeight = size + 'px';\n this.loader.appendChild(inner);\n }\n\n this.prop.current = this.psv.config.loadingImg || this.psv.config.loadingTxt;\n }\n }\n\n /**\n * @summary Sets the loader progression\n * @param {number} value - from 0 to 100\n */\n setProgress(value) {\n const context = this.canvas.getContext('2d');\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n context.lineWidth = this.prop.tickness;\n context.strokeStyle = getStyle(this.loader, 'color');\n\n context.beginPath();\n context.arc(\n this.canvas.width / 2, this.canvas.height / 2,\n this.canvas.width / 2 - this.prop.tickness / 2,\n -Math.PI / 2, bound(value, 0, 100) / 100 * 2 * Math.PI - Math.PI / 2\n );\n context.stroke();\n\n this.psv.trigger(EVENTS.LOAD_PROGRESS, Math.round(value));\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Notification component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Notification extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-notification');\n\n /**\n * @override\n * @property {*} timeout\n */\n this.prop = {\n ...this.prop,\n visible : false,\n contentId: undefined,\n timeout : null,\n };\n\n /**\n * Notification content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-notification-content';\n this.container.appendChild(this.content);\n\n this.content.addEventListener('click', () => this.hide());\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Notification cannot be toggled');\n }\n\n /**\n * @summary Displays a notification on the viewer\n * @param {Object|string} config\n * @param {string} [config.id] - unique identifier to use with \"hide\"\n * @param {string} config.content\n * @param {number} [config.timeout]\n * @fires PSV.show-notification\n *\n * @example\n * viewer.showNotification({ content: 'Hello world', timeout: 5000 })\n * @example\n * viewer.showNotification('Hello world')\n */\n show(config) {\n if (this.prop.timeout) {\n clearTimeout(this.prop.timeout);\n this.prop.timeout = null;\n }\n\n if (typeof config === 'string') {\n config = { content: config };\n }\n\n this.prop.contentId = config.id;\n this.content.innerHTML = config.content;\n\n this.container.classList.add('psv-notification--visible');\n this.prop.visible = true;\n\n this.psv.trigger(EVENTS.SHOW_NOTIFICATION, config.id);\n\n if (config.timeout) {\n this.prop.timeout = setTimeout(() => this.hide(config.id), config.timeout);\n }\n }\n\n /**\n * @summary Hides the notification\n * @param {string} [id]\n * @fires PSV.hide-notification\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n this.container.classList.remove('psv-notification--visible');\n this.prop.visible = false;\n\n this.prop.contentId = undefined;\n\n this.psv.trigger(EVENTS.HIDE_NOTIFICATION, contentId);\n }\n }\n\n}\n","import { EVENTS, KEY_CODES } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Overlay component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Overlay extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-overlay');\n\n /**\n * @override\n * @property {string} contentId\n * @property {boolean} dissmisable\n */\n this.prop = {\n ...this.prop,\n contentId : undefined,\n dissmisable: true,\n };\n\n /**\n * Image container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.image = document.createElement('div');\n this.image.className = 'psv-overlay-image';\n this.container.appendChild(this.image);\n\n /**\n * Text container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.text = document.createElement('div');\n this.text.className = 'psv-overlay-text';\n this.container.appendChild(this.text);\n\n /**\n * Subtext container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.subtext = document.createElement('div');\n this.subtext.className = 'psv-overlay-subtext';\n this.container.appendChild(this.subtext);\n\n this.psv.on(EVENTS.CLICK, this);\n this.psv.on(EVENTS.KEY_PRESS, this);\n\n super.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.CLICK, this);\n this.psv.off(EVENTS.KEY_PRESS, this);\n\n delete this.image;\n delete this.text;\n delete this.subtext;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case EVENTS.CLICK:\n if (this.isVisible() && this.prop.dissmisable) {\n this.hide();\n e.stopPropagation();\n }\n break;\n case EVENTS.KEY_PRESS:\n if (this.isVisible() && this.prop.dissmisable && e.args[0] === KEY_CODES.Escape) {\n this.hide();\n e.preventDefault();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Overlay cannot be toggled');\n }\n\n /**\n * @summary Displays an overlay on the viewer\n * @param {Object|string} config\n * @param {string} [config.id] - unique identifier to use with \"hide\"\n * @param {string} config.image - SVG image/icon displayed above the text\n * @param {string} config.text - main message\n * @param {string} [config.subtext] - secondary message\n * @param {boolean} [config.dissmisable=true] - if the user can hide the overlay by clicking\n * @fires PSV.show-overlay\n */\n show(config) {\n if (typeof config === 'string') {\n config = { text: config };\n }\n\n this.prop.contentId = config.id;\n this.prop.dissmisable = config.dissmisable !== false;\n this.image.innerHTML = config.image || '';\n this.text.innerHTML = config.text || '';\n this.subtext.innerHTML = config.subtext || '';\n\n super.show();\n\n this.psv.trigger(EVENTS.SHOW_OVERLAY, config.id);\n }\n\n /**\n * @summary Hides the overlay\n * @param {string} [id]\n * @fires PSV.hide-overlay\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n super.hide();\n\n this.prop.contentId = undefined;\n\n this.psv.trigger(EVENTS.HIDE_OVERLAY, contentId);\n }\n }\n\n}\n","import { EVENTS, KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PSVError } from '../PSVError';\nimport { toggleClass } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Minimum width of the panel\n * @type {number}\n * @constant\n * @private\n */\nconst PANEL_MIN_WIDTH = 200;\n\n/**\n * @summary Panel component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Panel extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-panel');\n\n /**\n * @override\n * @property {string} contentId\n * @property {number} mouseX\n * @property {number} mouseY\n * @property {boolean} mousedown\n * @property {function} clickHandler\n * @property {function} keyHandler\n */\n this.prop = {\n ...this.prop,\n visible : false,\n contentId : undefined,\n mouseX : 0,\n mouseY : 0,\n mousedown : false,\n clickHandler: null,\n keyHandler : null,\n width : {},\n };\n\n const resizer = document.createElement('div');\n resizer.className = 'psv-panel-resizer';\n this.container.appendChild(resizer);\n\n const closeBtn = document.createElement('div');\n closeBtn.className = 'psv-panel-close-button';\n this.container.appendChild(closeBtn);\n\n /**\n * @summary Content container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-panel-content';\n this.container.appendChild(this.content);\n\n // Stop wheel event bubbling from panel\n this.container.addEventListener(SYSTEM.mouseWheelEvent, e => e.stopPropagation());\n\n closeBtn.addEventListener('click', () => this.hide());\n\n // Event for panel resizing + stop bubling\n resizer.addEventListener('mousedown', this);\n resizer.addEventListener('touchstart', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n\n this.psv.on(EVENTS.KEY_PRESS, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.KEY_PRESS, this);\n\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n delete this.prop;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(e); break;\n case 'touchstart': this.__onTouchStart(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'touchmove': this.__onTouchMove(e); break;\n case 'mouseup': this.__onMouseUp(e); break;\n case 'touchend': this.__onMouseUp(e); break;\n case EVENTS.KEY_PRESS:\n if (this.isVisible() && e.args[0] === KEY_CODES.Escape) {\n this.hide();\n e.preventDefault();\n }\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Panel cannot be toggled');\n }\n\n /**\n * @summary Shows the panel\n * @param {string|Object} config\n * @param {string} [config.id] - unique identifier to use with \"hide\" and to store the user desired width\n * @param {string} config.content - HTML content of the panel\n * @param {boolean} [config.noMargin=false] - remove the default margins\n * @param {string} [config.width] - initial width\n * @param {Function} [config.clickHandler] - called when the user clicks inside the panel or presses the Enter key while an element focused\n * @fires PSV.open-panel\n */\n show(config) {\n const wasVisible = this.isVisible(config.id);\n\n if (typeof config === 'string') {\n config = { content: config };\n }\n\n this.prop.contentId = config.id;\n this.prop.visible = true;\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.content.removeEventListener('keydown', this.prop.keyHandler);\n this.prop.clickHandler = null;\n this.prop.keyHandler = null;\n }\n\n if (config.id && this.prop.width[config.id]) {\n this.container.style.width = this.prop.width[config.id];\n }\n else if (config.width) {\n this.container.style.width = config.width;\n }\n else {\n this.container.style.width = null;\n }\n\n this.content.innerHTML = config.content;\n this.content.scrollTop = 0;\n this.container.classList.add('psv-panel--open');\n\n toggleClass(this.content, 'psv-panel-content--no-margin', config.noMargin === true);\n\n if (config.clickHandler) {\n this.prop.clickHandler = config.clickHandler;\n this.prop.keyHandler = (e) => {\n if (e.key === KEY_CODES.Enter) {\n config.clickHandler(e);\n }\n };\n this.content.addEventListener('click', this.prop.clickHandler);\n this.content.addEventListener('keydown', this.prop.keyHandler);\n\n // focus the first element if possible, after animation ends\n if (!wasVisible) {\n setTimeout(() => {\n this.content.querySelector('a,button,[tabindex]')?.focus();\n }, 300);\n }\n }\n\n this.psv.trigger(EVENTS.OPEN_PANEL, config.id);\n }\n\n /**\n * @summary Hides the panel\n * @param {string} [id]\n * @fires PSV.close-panel\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n this.prop.visible = false;\n this.prop.contentId = undefined;\n\n this.content.innerHTML = null;\n this.container.classList.remove('psv-panel--open');\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.prop.clickHandler = null;\n }\n\n this.psv.trigger(EVENTS.CLOSE_PANEL, contentId);\n }\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n evt.stopPropagation();\n this.__startResize(evt);\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n evt.stopPropagation();\n this.__startResize(evt.changedTouches[0]);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.prop.mousedown = false;\n this.content.classList.remove('psv-panel-content--no-interaction');\n }\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.__resize(evt);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (this.prop.mousedown) {\n this.__resize(evt.touches[0]);\n }\n }\n\n /**\n * @summary Initializes the panel resize\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startResize(evt) {\n this.prop.mouseX = evt.clientX;\n this.prop.mouseY = evt.clientY;\n this.prop.mousedown = true;\n this.content.classList.add('psv-panel-content--no-interaction');\n }\n\n /**\n * @summary Resizes the panel\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __resize(evt) {\n const x = evt.clientX;\n const y = evt.clientY;\n const width = Math.max(PANEL_MIN_WIDTH, this.container.offsetWidth - (x - this.prop.mouseX)) + 'px';\n\n if (this.prop.contentId) {\n this.prop.width[this.prop.contentId] = width;\n }\n\n this.container.style.width = width;\n\n this.prop.mouseX = x;\n this.prop.mouseY = y;\n }\n\n}\n","/**\n * @namespace PSV.services\n */\n\n/**\n * @summary Base services class\n * @memberof PSV.services\n * @abstract\n */\nexport class AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = psv.config;\n\n /**\n * @summary Properties holder\n * @type {Object}\n * @readonly\n */\n this.prop = psv.prop;\n }\n\n /**\n * @summary Destroys the service\n */\n destroy() {\n delete this.psv;\n delete this.config;\n delete this.prop;\n }\n\n}\n","import * as THREE from 'three';\nimport { MESH_USER_DATA, SPHERE_RADIUS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { applyEulerInverse, parseAngle, parseSpeed } from '../utils';\nimport { AbstractService } from './AbstractService';\n\nconst vector2 = new THREE.Vector2();\nconst vector3 = new THREE.Vector3();\nconst eulerZero = new THREE.Euler(0, 0, 0, 'ZXY');\n\n/**\n * @summary Collections of data converters for the current viewer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class DataHelper extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n }\n\n /**\n * @summary Converts vertical FOV to zoom level\n * @param {number} fov\n * @returns {number}\n */\n fovToZoomLevel(fov) {\n const temp = Math.round((fov - this.config.minFov) / (this.config.maxFov - this.config.minFov) * 100);\n return temp - 2 * (temp - 50);\n }\n\n /**\n * @summary Converts zoom level to vertical FOV\n * @param {number} level\n * @returns {number}\n */\n zoomLevelToFov(level) {\n return this.config.maxFov + (level / 100) * (this.config.minFov - this.config.maxFov);\n }\n\n /**\n * @summary Convert vertical FOV to horizontal FOV\n * @param {number} vFov\n * @returns {number}\n */\n vFovToHFov(vFov) {\n return THREE.MathUtils.radToDeg(2 * Math.atan(Math.tan(THREE.MathUtils.degToRad(vFov) / 2) * this.prop.aspect));\n }\n\n /**\n * @summary Converts a speed into a duration from current position to a new position\n * @param {string|number} value\n * @param {number} angle\n * @returns {number}\n */\n speedToDuration(value, angle) {\n if (!value || typeof value !== 'number') {\n // desired radial speed\n const speed = value ? parseSpeed(value) : this.config.autorotateSpeed;\n // compute duration\n return angle / Math.abs(speed) * 1000;\n }\n else {\n return Math.abs(value);\n }\n }\n\n /**\n * @summary Converts pixel texture coordinates to spherical radians coordinates\n * @param {PSV.Point} point\n * @returns {PSV.Position}\n * @throws {PSV.PSVError} when the current adapter does not support texture coordinates\n */\n textureCoordsToSphericalCoords(point) {\n const panoData = this.prop.panoData;\n if (!panoData) {\n throw new PSVError('Current adapter does not support texture coordinates.');\n }\n\n const relativeX = (point.x + panoData.croppedX) / panoData.fullWidth * Math.PI * 2;\n const relativeY = (point.y + panoData.croppedY) / panoData.fullHeight * Math.PI;\n\n const result = {\n longitude: relativeX >= Math.PI ? relativeX - Math.PI : relativeX + Math.PI,\n latitude : Math.PI / 2 - relativeY,\n };\n\n // Apply panoData pose and sphereCorrection\n if (!eulerZero.equals(this.psv.renderer.mesh.rotation) || !eulerZero.equals(this.psv.renderer.meshContainer.rotation)) {\n this.sphericalCoordsToVector3(result, vector3);\n vector3.applyEuler(this.psv.renderer.mesh.rotation);\n vector3.applyEuler(this.psv.renderer.meshContainer.rotation);\n return this.vector3ToSphericalCoords(vector3);\n }\n else {\n return result;\n }\n }\n\n /**\n * @summary Converts spherical radians coordinates to pixel texture coordinates\n * @param {PSV.Position} position\n * @returns {PSV.Point}\n * @throws {PSV.PSVError} when the current adapter does not support texture coordinates\n */\n sphericalCoordsToTextureCoords(position) {\n const panoData = this.prop.panoData;\n if (!panoData) {\n throw new PSVError('Current adapter does not support texture coordinates.');\n }\n\n // Apply panoData pose and sphereCorrection\n if (!eulerZero.equals(this.psv.renderer.mesh.rotation) || !eulerZero.equals(this.psv.renderer.meshContainer.rotation)) {\n this.sphericalCoordsToVector3(position, vector3);\n applyEulerInverse(vector3, this.psv.renderer.meshContainer.rotation);\n applyEulerInverse(vector3, this.psv.renderer.mesh.rotation);\n position = this.vector3ToSphericalCoords(vector3);\n }\n\n const relativeLong = position.longitude / Math.PI / 2 * panoData.fullWidth;\n const relativeLat = position.latitude / Math.PI * panoData.fullHeight;\n\n return {\n x: Math.round(position.longitude < Math.PI ? relativeLong + panoData.fullWidth / 2 : relativeLong - panoData.fullWidth / 2) - panoData.croppedX,\n y: Math.round(panoData.fullHeight / 2 - relativeLat) - panoData.croppedY,\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to a THREE.Vector3\n * @param {PSV.Position} position\n * @param {external:THREE.Vector3} [vector]\n * @returns {external:THREE.Vector3}\n */\n sphericalCoordsToVector3(position, vector) {\n if (!vector) {\n vector = new THREE.Vector3();\n }\n vector.x = SPHERE_RADIUS * -Math.cos(position.latitude) * Math.sin(position.longitude);\n vector.y = SPHERE_RADIUS * Math.sin(position.latitude);\n vector.z = SPHERE_RADIUS * Math.cos(position.latitude) * Math.cos(position.longitude);\n return vector;\n }\n\n /**\n * @summary Converts a THREE.Vector3 to spherical radians coordinates\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Position}\n */\n vector3ToSphericalCoords(vector) {\n const phi = Math.acos(vector.y / Math.sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z));\n const theta = Math.atan2(vector.x, vector.z);\n\n return {\n longitude: theta < 0 ? -theta : Math.PI * 2 - theta,\n latitude : Math.PI / 2 - phi,\n };\n }\n\n /**\n * @summary Converts position on the viewer to a THREE.Vector3\n * @param {PSV.Point} viewerPoint\n * @returns {external:THREE.Vector3}\n */\n viewerCoordsToVector3(viewerPoint) {\n const sphereIntersect = this.getIntersections(viewerPoint).filter(i => i.object.userData[MESH_USER_DATA]);\n\n if (sphereIntersect.length) {\n return sphereIntersect[0].point;\n }\n else {\n return null;\n }\n }\n\n /**\n * @summary Converts a THREE.Vector3 to position on the viewer\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Point}\n */\n vector3ToViewerCoords(vector) {\n const vectorClone = vector.clone();\n vectorClone.project(this.psv.renderer.camera);\n\n return {\n x: Math.round((vectorClone.x + 1) / 2 * this.prop.size.width),\n y: Math.round((1 - vectorClone.y) / 2 * this.prop.size.height),\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to position on the viewer\n * @param {PSV.Position} position\n * @returns {PSV.Point}\n */\n sphericalCoordsToViewerCoords(position) {\n return this.vector3ToViewerCoords(this.sphericalCoordsToVector3(position, vector3));\n }\n\n /**\n * @summary Returns intersections with objects in the scene\n * @param {PSV.Point} viewerPoint\n * @return {external:THREE.Intersection[]}\n */\n getIntersections(viewerPoint) {\n vector2.x = 2 * viewerPoint.x / this.prop.size.width - 1;\n vector2.y = -2 * viewerPoint.y / this.prop.size.height + 1;\n\n this.psv.renderer.raycaster.setFromCamera(vector2, this.psv.renderer.camera);\n\n return this.psv.renderer.raycaster.intersectObjects(this.psv.renderer.scene.children, true)\n .filter(i => !!i.object.userData);\n }\n\n /**\n * @summary Converts x/y to latitude/longitude if present and ensure boundaries\n * @param {PSV.ExtendedPosition} position\n * @returns {PSV.Position}\n */\n cleanPosition(position) {\n if (position.x !== undefined && position.y !== undefined) {\n return this.textureCoordsToSphericalCoords(position);\n }\n else {\n return {\n longitude: parseAngle(position.longitude),\n latitude : parseAngle(position.latitude, true),\n };\n }\n }\n\n /**\n * @summary Ensure a SphereCorrection object is valid\n * @param {PSV.SphereCorrection} sphereCorrection\n * @returns {PSV.SphereCorrection}\n */\n cleanSphereCorrection(sphereCorrection) {\n return {\n pan : parseAngle(sphereCorrection?.pan || 0),\n tilt: parseAngle(sphereCorrection?.tilt || 0, true),\n roll: parseAngle(sphereCorrection?.roll || 0, true, false),\n };\n }\n\n /**\n * @summary Parse the pose angles of the pano data\n * @param {PSV.PanoData} panoData\n * @returns {PSV.SphereCorrection}\n */\n cleanPanoramaPose(panoData) {\n return {\n pan : THREE.MathUtils.degToRad(panoData?.poseHeading || 0),\n tilt: THREE.MathUtils.degToRad(panoData?.posePitch || 0),\n roll: THREE.MathUtils.degToRad(panoData?.poseRoll || 0),\n };\n }\n\n}\n","import * as THREE from 'three';\nimport {\n ACTIONS,\n CTRLZOOM_TIMEOUT,\n DBLCLICK_DELAY,\n EVENTS,\n IDS,\n INERTIA_WINDOW,\n KEY_CODES,\n LONGTOUCH_DELAY,\n MOVE_THRESHOLD,\n OBJECT_EVENTS,\n TWOFINGERSOVERLAY_DELAY\n} from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport gestureIcon from '../icons/gesture.svg';\nimport mousewheelIcon from '../icons/mousewheel.svg';\nimport { clone, distance, each, getClosest, getPosition, isEmpty, isFullscreenEnabled, normalizeWheel, throttle } from '../utils';\nimport { Animation } from '../utils/Animation';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Events handler\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class EventsHandler extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @property {number} moveThreshold - computed threshold based on device pixel ratio\n * @property {boolean} moving - is the user moving\n * @property {boolean} zooming - is the user zooming\n * @property {number} startMouseX - start x position of the click/touch\n * @property {number} startMouseY - start y position of the click/touch\n * @property {number} mouseX - current x position of the cursor\n * @property {number} mouseY - current y position of the cursor\n * @property {number[][]} mouseHistory - list of latest positions of the cursor, [time, x, y]\n * @property {number} pinchDist - distance between fingers when zooming\n * @property {PressHandler} keyHandler\n * @property {boolean} ctrlKeyDown - when the Ctrl key is pressed\n * @property {PSV.ClickData} dblclickData - temporary storage of click data between two clicks\n * @property {number} dblclickTimeout - timeout id for double click\n * @property {number} twofingersTimeout - timeout id for \"two fingers\" overlay\n * @property {number} ctrlZoomTimeout - timeout id for \"ctrol zoom\" overlay\n * @protected\n */\n this.state = {\n moveThreshold : MOVE_THRESHOLD * SYSTEM.pixelRatio,\n keyboardEnabled : false,\n moving : false,\n zooming : false,\n startMouseX : 0,\n startMouseY : 0,\n mouseX : 0,\n mouseY : 0,\n mouseHistory : [],\n pinchDist : 0,\n keyHandler : new PressHandler(),\n ctrlKeyDown : false,\n dblclickData : null,\n dblclickTimeout : null,\n longtouchTimeout : null,\n twofingersTimeout: null,\n ctrlZoomTimeout : null,\n };\n\n /**\n * @summary Throttled wrapper of {@link PSV.Viewer#autoSize}\n * @type {Function}\n * @private\n */\n this.__onResize = throttle(() => this.psv.autoSize(), 50);\n }\n\n /**\n * @summary Initializes event handlers\n * @protected\n */\n init() {\n window.addEventListener('resize', this);\n window.addEventListener('keydown', this);\n window.addEventListener('keyup', this);\n this.psv.container.addEventListener('mouseenter', this);\n this.psv.container.addEventListener('mousedown', this);\n this.psv.container.addEventListener('mouseleave', this);\n this.psv.container.addEventListener('mousemove', this);\n window.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchstart', this);\n this.psv.container.addEventListener('touchmove', this);\n window.addEventListener('touchend', this);\n this.psv.container.addEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.addEventListener(SYSTEM.fullscreenEvent, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n window.removeEventListener('resize', this);\n window.removeEventListener('keydown', this);\n window.removeEventListener('keyup', this);\n this.psv.container.removeEventListener('mouseenter', this);\n this.psv.container.removeEventListener('mousedown', this);\n this.psv.container.removeEventListener('mouseleave', this);\n this.psv.container.removeEventListener('mousemove', this);\n window.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchstart', this);\n this.psv.container.removeEventListener('touchmove', this);\n window.removeEventListener('touchend', this);\n this.psv.container.removeEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.removeEventListener(SYSTEM.fullscreenEvent, this);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n clearTimeout(this.state.longtouchTimeout);\n clearTimeout(this.state.twofingersTimeout);\n clearTimeout(this.state.ctrlZoomTimeout);\n\n delete this.state;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} evt\n * @private\n */\n handleEvent(evt) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'resize': this.__onResize(); break;\n case 'keydown': this.__onKeyDown(evt); break;\n case 'keyup': this.__onKeyUp(); break;\n case 'mouseup': this.__onMouseUp(evt); break;\n case 'touchend': this.__onTouchEnd(evt); break;\n case SYSTEM.fullscreenEvent: this.__fullscreenToggled(); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n if (!getClosest(evt.target, '.psv-navbar') && !getClosest(evt.target, '.psv-panel')) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(evt); break;\n case 'mouseenter': this.__onMouseEnter(evt); break;\n case 'mouseleave': this.__onMouseLeave(evt); break;\n case 'mousemove': this.__onMouseMove(evt); break;\n case 'touchstart': this.__onTouchStart(evt); break;\n case 'touchmove': this.__onTouchMove(evt); break;\n case SYSTEM.mouseWheelEvent: this.__onMouseWheel(evt); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n }\n\n /**\n * @summary Enables the keyboard controls\n * @protected\n */\n enableKeyboard() {\n this.state.keyboardEnabled = true;\n }\n\n /**\n * @summary Disables the keyboard controls\n * @protected\n */\n disableKeyboard() {\n this.state.keyboardEnabled = false;\n }\n\n /**\n * @summary Handles keyboard events\n * @param {KeyboardEvent} e\n * @private\n */\n __onKeyDown(e) {\n if (this.config.mousewheelCtrlKey) {\n this.state.ctrlKeyDown = e.key === KEY_CODES.Control;\n\n if (this.state.ctrlKeyDown) {\n clearTimeout(this.state.ctrlZoomTimeout);\n this.psv.overlay.hide(IDS.CTRL_ZOOM);\n }\n }\n\n const e2 = this.psv.trigger(EVENTS.KEY_PRESS, e.key);\n if (e2.isDefaultPrevented()) {\n return;\n }\n\n if (!this.state.keyboardEnabled) {\n return;\n }\n\n const action = this.config.keyboard[e.key];\n if (action === ACTIONS.TOGGLE_AUTOROTATE) {\n this.psv.toggleAutorotate();\n }\n else if (action && !this.state.keyHandler.time) {\n if (action !== ACTIONS.ZOOM_IN && action !== ACTIONS.ZOOM_OUT) {\n this.psv.__stopAll();\n }\n\n /* eslint-disable */\n switch (action) {\n // @formatter:off\n case ACTIONS.ROTATE_LAT_UP: this.psv.dynamics.position.roll({latitude: false}); break;\n case ACTIONS.ROTATE_LAT_DOWN: this.psv.dynamics.position.roll({latitude: true}); break;\n case ACTIONS.ROTATE_LONG_RIGHT: this.psv.dynamics.position.roll({longitude: false}); break;\n case ACTIONS.ROTATE_LONG_LEFT: this.psv.dynamics.position.roll({longitude: true}); break;\n case ACTIONS.ZOOM_IN: this.psv.dynamics.zoom.roll(false); break;\n case ACTIONS.ZOOM_OUT: this.psv.dynamics.zoom.roll(true); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n this.state.keyHandler.down();\n }\n }\n\n /**\n * @summary Handles keyboard events\n * @private\n */\n __onKeyUp() {\n this.state.ctrlKeyDown = false;\n\n if (!this.state.keyboardEnabled) {\n return;\n }\n\n this.state.keyHandler.up(() => {\n this.psv.dynamics.position.stop();\n this.psv.dynamics.zoom.stop();\n this.psv.resetIdleTimer();\n });\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse enter events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseEnter(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse leave events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseLeave(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.config.mousemove) {\n if (evt.buttons !== 0) {\n evt.preventDefault();\n this.__move(evt);\n }\n else if (this.config.captureCursor) {\n this.__moveAbsolute(evt);\n }\n }\n\n if (!isEmpty(this.prop.objectsObservers)) {\n const viewerPos = getPosition(this.psv.container);\n\n const viewerPoint = {\n x: evt.clientX - viewerPos.left,\n y: evt.clientY - viewerPos.top,\n };\n\n const intersections = this.psv.dataHelper.getIntersections(viewerPoint);\n\n const emit = (observer, key, type) => {\n observer.listener.handleEvent(new CustomEvent(type, {\n detail: {\n originalEvent: evt,\n object : observer.object,\n data : observer.object.userData[key],\n viewerPoint : viewerPoint,\n },\n }));\n };\n\n each(this.prop.objectsObservers, (observer, key) => {\n const intersection = intersections.find(i => i.object.userData[key]);\n\n if (intersection) {\n if (observer.object && intersection.object !== observer.object) {\n emit(observer, key, OBJECT_EVENTS.LEAVE_OBJECT);\n delete observer.object;\n }\n\n if (!observer.object) {\n observer.object = intersection.object;\n emit(observer, key, OBJECT_EVENTS.ENTER_OBJECT);\n }\n else {\n emit(observer, key, OBJECT_EVENTS.HOVER_OBJECT);\n }\n }\n else if (observer.object) {\n emit(observer, key, OBJECT_EVENTS.LEAVE_OBJECT);\n delete observer.object;\n }\n });\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (!this.config.touchmoveTwoFingers) {\n this.__startMove(evt.touches[0]);\n evt.preventDefault(); // prevent mouse events emulation\n }\n\n if (!this.prop.longtouchTimeout) {\n this.prop.longtouchTimeout = setTimeout(() => {\n this.__click(evt.touches[0], true);\n this.prop.longtouchTimeout = null;\n }, LONGTOUCH_DELAY);\n }\n }\n else if (evt.touches.length === 2) {\n this.__cancelLongTouch();\n this.__cancelTwoFingersOverlay();\n this.__startMoveZoom(evt);\n evt.preventDefault();\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchEnd(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n this.__cancelLongTouch();\n this.__cancelTwoFingersOverlay();\n\n if (evt.touches.length === 1) {\n this.__stopMoveZoom();\n }\n else if (evt.touches.length === 0) {\n this.__stopMove(evt.changedTouches[0]);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n this.__cancelLongTouch();\n\n if (evt.touches.length === 1) {\n if (this.config.touchmoveTwoFingers) {\n if (!this.prop.twofingersTimeout) {\n this.prop.twofingersTimeout = setTimeout(() => {\n this.psv.overlay.show({\n id : IDS.TWO_FINGERS,\n image: gestureIcon,\n text : this.config.lang.twoFingers,\n });\n }, TWOFINGERSOVERLAY_DELAY);\n }\n }\n else {\n evt.preventDefault();\n this.__move(evt.touches[0]);\n }\n }\n else if (evt.touches.length === 2) {\n evt.preventDefault();\n this.__moveZoom(evt);\n this.__cancelTwoFingersOverlay();\n }\n }\n\n /**\n * @summary Cancel the long touch timer if any\n * @private\n */\n __cancelLongTouch() {\n if (this.prop.longtouchTimeout) {\n clearTimeout(this.prop.longtouchTimeout);\n this.prop.longtouchTimeout = null;\n }\n }\n\n /**\n * @summary Cancel the two fingers overlay timer if any\n * @private\n */\n __cancelTwoFingersOverlay() {\n if (this.prop.twofingersTimeout) {\n clearTimeout(this.prop.twofingersTimeout);\n this.prop.twofingersTimeout = null;\n }\n this.psv.overlay.hide(IDS.TWO_FINGERS);\n }\n\n /**\n * @summary Handles mouse wheel events\n * @param {WheelEvent} evt\n * @private\n */\n __onMouseWheel(evt) {\n if (!this.config.mousewheel) {\n return;\n }\n\n if (this.config.mousewheelCtrlKey && !this.state.ctrlKeyDown) {\n this.psv.overlay.show({\n id : IDS.CTRL_ZOOM,\n image: mousewheelIcon,\n text : this.config.lang.ctrlZoom,\n });\n\n clearTimeout(this.state.ctrlZoomTimeout);\n this.state.ctrlZoomTimeout = setTimeout(() => this.psv.overlay.hide(IDS.CTRL_ZOOM), CTRLZOOM_TIMEOUT);\n\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n const delta = normalizeWheel(evt).spinY * 5 * this.config.zoomSpeed;\n if (delta !== 0) {\n this.psv.dynamics.zoom.step(-delta, 5);\n }\n }\n\n /**\n * @summary Handles fullscreen events\n * @param {boolean} [force] force state\n * @fires PSV.fullscreen-updated\n * @package\n */\n __fullscreenToggled(force) {\n this.prop.fullscreen = force !== undefined ? force : isFullscreenEnabled(this.psv.container);\n\n if (this.config.keyboard) {\n if (this.prop.fullscreen) {\n this.psv.startKeyboardControl();\n }\n else {\n this.psv.stopKeyboardControl();\n }\n }\n\n this.psv.trigger(EVENTS.FULLSCREEN_UPDATED, this.prop.fullscreen);\n }\n\n /**\n * @summary Initializes the movement\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startMove(evt) {\n this.psv.__stopAll()\n .then(() => {\n this.state.mouseX = evt.clientX;\n this.state.mouseY = evt.clientY;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = false;\n\n this.state.mouseHistory.length = 0;\n this.__logMouseMove(evt);\n });\n }\n\n /**\n * @summary Initializes the combines move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __startMoveZoom(evt) {\n this.psv.__stopAll()\n .then(() => {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n this.state.pinchDist = distance(p1, p2);\n this.state.mouseX = (p1.x + p2.x) / 2;\n this.state.mouseY = (p1.y + p2.y) / 2;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = true;\n });\n }\n\n /**\n * @summary Stops the movement\n * @description If the move threshold was not reached a click event is triggered, otherwise an animation is launched to simulate inertia\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMove(evt) {\n this.psv.resetIdleTimer();\n\n if (!getClosest(evt.target, '.psv-container')) {\n this.state.moving = false;\n this.state.mouseHistory.length = 0;\n return;\n }\n\n if (this.state.moving) {\n // move threshold to trigger a click\n if (Math.abs(evt.clientX - this.state.startMouseX) < this.state.moveThreshold\n && Math.abs(evt.clientY - this.state.startMouseY) < this.state.moveThreshold) {\n this.__click(evt);\n this.state.moving = false;\n }\n // inertia animation\n else if (this.config.moveInertia) {\n this.__logMouseMove(evt);\n this.__stopMoveInertia(evt);\n }\n else {\n this.state.moving = false;\n }\n\n this.state.mouseHistory.length = 0;\n }\n }\n\n /**\n * @summary Stops the combined move and zoom\n * @private\n */\n __stopMoveZoom() {\n this.psv.resetIdleTimer();\n this.state.mouseHistory.length = 0;\n this.state.moving = false;\n this.state.zooming = false;\n }\n\n /**\n * @summary Performs an animation to simulate inertia when the movement stops\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMoveInertia(evt) {\n const direction = {\n x: evt.clientX - this.state.mouseHistory[0][1],\n y: evt.clientY - this.state.mouseHistory[0][2],\n };\n\n const norm = Math.sqrt(direction.x * direction.x + direction.y * direction.y);\n\n this.prop.animationPromise = new Animation({\n properties: {\n clientX: { start: evt.clientX, end: evt.clientX + direction.x },\n clientY: { start: evt.clientY, end: evt.clientY + direction.y },\n },\n duration : norm * INERTIA_WINDOW / 100,\n easing : 'outCirc',\n onTick : (properties) => {\n this.__move(properties, false);\n },\n });\n\n this.prop.animationPromise\n .then(() => {\n this.state.moving = false;\n });\n }\n\n /**\n * @summary Triggers an event with all coordinates when a simple click is performed\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [longtouch=false]\n * @fires PSV.click\n * @fires PSV.dblclick\n * @private\n */\n __click(evt, longtouch = false) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n /**\n * @type {PSV.ClickData}\n */\n const data = {\n rightclick: longtouch || evt.button === 2,\n target : evt.target,\n clientX : evt.clientX,\n clientY : evt.clientY,\n viewerX : evt.clientX - boundingRect.left,\n viewerY : evt.clientY - boundingRect.top,\n };\n\n const intersections = this.psv.dataHelper.getIntersections({\n x: data.viewerX,\n y: data.viewerY,\n });\n\n const sphereIntersection = intersections.find(i => i.object.userData.psvSphere);\n\n if (sphereIntersection) {\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(sphereIntersection.point);\n data.longitude = sphericalCoords.longitude;\n data.latitude = sphericalCoords.latitude;\n\n data.objects = intersections.map(i => i.object).filter(o => !o.userData.psvSphere);\n\n try {\n const textureCoords = this.psv.dataHelper.sphericalCoordsToTextureCoords(data);\n data.textureX = textureCoords.x;\n data.textureY = textureCoords.y;\n }\n catch (e) {\n data.textureX = NaN;\n data.textureY = NaN;\n }\n\n if (!this.state.dblclickTimeout) {\n this.psv.trigger(EVENTS.CLICK, data);\n\n this.state.dblclickData = clone(data);\n this.state.dblclickTimeout = setTimeout(() => {\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }, DBLCLICK_DELAY);\n }\n else {\n if (Math.abs(this.state.dblclickData.clientX - data.clientX) < this.state.moveThreshold\n && Math.abs(this.state.dblclickData.clientY - data.clientY) < this.state.moveThreshold) {\n this.psv.trigger(EVENTS.DOUBLE_CLICK, this.state.dblclickData);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }\n }\n }\n\n /**\n * @summary Performs movement\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [log=true]\n * @private\n */\n __move(evt, log) {\n if (this.state.moving) {\n const x = evt.clientX;\n const y = evt.clientY;\n\n const rotation = {\n longitude: (x - this.state.mouseX) / this.prop.size.width * this.config.moveSpeed * THREE.MathUtils.degToRad(this.prop.hFov),\n latitude : (y - this.state.mouseY) / this.prop.size.height * this.config.moveSpeed * THREE.MathUtils.degToRad(this.prop.vFov),\n };\n\n const currentPosition = this.psv.getPosition();\n this.psv.rotate({\n longitude: currentPosition.longitude - rotation.longitude,\n latitude : currentPosition.latitude + rotation.latitude,\n });\n\n this.state.mouseX = x;\n this.state.mouseY = y;\n\n if (log !== false) {\n this.__logMouseMove(evt);\n }\n }\n }\n\n /**\n * @summary Performs movement absolute to cursor position in viewer\n * @param {MouseEvent} evt\n * @private\n */\n __moveAbsolute(evt) {\n if (this.state.moving) {\n const containerRect = this.psv.container.getBoundingClientRect();\n this.psv.dynamics.position.goto({\n longitude: ((evt.clientX - containerRect.left) / containerRect.width - 0.5) * Math.PI * 2,\n latitude : -((evt.clientY - containerRect.top) / containerRect.height - 0.5) * Math.PI,\n }, 10);\n }\n }\n\n /**\n * @summary Perfoms combined move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __moveZoom(evt) {\n if (this.state.zooming && this.state.moving) {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n const p = distance(p1, p2);\n const delta = 80 * (p - this.state.pinchDist) / this.prop.size.width * this.config.zoomSpeed;\n\n this.psv.zoom(this.psv.getZoomLevel() + delta);\n\n this.__move({\n clientX: (p1.x + p2.x) / 2,\n clientY: (p1.y + p2.y) / 2,\n });\n\n this.state.pinchDist = p;\n }\n }\n\n /**\n * @summary Stores each mouse position during a mouse move\n * @description Positions older than \"INERTIA_WINDOW\" are removed
\n * Positions before a pause of \"INERTIA_WINDOW\" / 10 are removed\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __logMouseMove(evt) {\n const now = Date.now();\n this.state.mouseHistory.push([now, evt.clientX, evt.clientY]);\n\n let previous = null;\n\n for (let i = 0; i < this.state.mouseHistory.length;) {\n if (this.state.mouseHistory[0][i] < now - INERTIA_WINDOW) {\n this.state.mouseHistory.splice(i, 1);\n }\n else if (previous && this.state.mouseHistory[0][i] - previous > INERTIA_WINDOW / 10) {\n this.state.mouseHistory.splice(0, i);\n i = 0;\n previous = this.state.mouseHistory[0][i];\n }\n else {\n i++;\n previous = this.state.mouseHistory[0][i];\n }\n }\n }\n\n}\n","import * as THREE from 'three';\nimport { Animation } from '../utils/Animation';\nimport { EVENTS, MESH_USER_DATA, SPHERE_RADIUS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { each, isExtendedPosition } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Viewer and renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class Renderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @member {external:THREE.WebGLRenderer}\n * @readonly\n * @protected\n */\n this.renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });\n this.renderer.setPixelRatio(SYSTEM.pixelRatio);\n this.renderer.domElement.className = 'psv-canvas';\n\n /**\n * @member {external:THREE.Scene}\n * @readonly\n * @protected\n */\n this.scene = new THREE.Scene();\n\n /**\n * @member {external:THREE.PerspectiveCamera}\n * @readonly\n * @protected\n */\n this.camera = new THREE.PerspectiveCamera(50, 16 / 9, 1, 2 * SPHERE_RADIUS);\n\n /**\n * @member {external:THREE.Mesh}\n * @readonly\n * @protected\n */\n this.mesh = this.psv.adapter.createMesh();\n this.mesh.userData = { [MESH_USER_DATA]: true };\n\n /**\n * @member {external:THREE.Group}\n * @readonly\n * @private\n */\n this.meshContainer = new THREE.Group();\n this.meshContainer.add(this.mesh);\n this.scene.add(this.meshContainer);\n\n /**\n * @member {external:THREE.Raycaster}\n * @readonly\n * @protected\n */\n this.raycaster = new THREE.Raycaster();\n\n /**\n * @member {number}\n * @private\n */\n this.timestamp = null;\n\n /**\n * @member {boolean}\n * @private\n */\n this.ready = false;\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @package\n */\n this.canvasContainer = document.createElement('div');\n this.canvasContainer.className = 'psv-canvas-container';\n this.canvasContainer.style.background = this.psv.config.canvasBackground;\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n this.canvasContainer.appendChild(this.renderer.domElement);\n this.psv.container.appendChild(this.canvasContainer);\n\n psv.on(EVENTS.SIZE_UPDATED, this);\n psv.on(EVENTS.ZOOM_UPDATED, this);\n psv.on(EVENTS.POSITION_UPDATED, this);\n psv.on(EVENTS.CONFIG_CHANGED, this);\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n // cancel render loop\n this.renderer.setAnimationLoop(null);\n\n // destroy ThreeJS view\n this.__cleanTHREEScene(this.scene);\n\n // remove container\n this.psv.container.removeChild(this.canvasContainer);\n\n delete this.canvasContainer;\n delete this.renderer;\n delete this.scene;\n delete this.camera;\n delete this.mesh;\n delete this.meshContainer;\n delete this.raycaster;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} evt\n * @private\n */\n handleEvent(evt) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case EVENTS.SIZE_UPDATED: this.__onSizeUpdated(); break;\n case EVENTS.ZOOM_UPDATED: this.__onZoomUpdated(); break;\n case EVENTS.POSITION_UPDATED: this.__onPositionUpdated(); break;\n case EVENTS.CONFIG_CHANGED:\n if (evt.args[0].includes('fisheye')) {\n this.__onPositionUpdated();\n }\n if (evt.args[0].includes('mousemove')) {\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n }\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @summary Hides the viewer\n */\n hide() {\n this.canvasContainer.style.opacity = 0;\n }\n\n /**\n * @summary Shows the viewer\n */\n show() {\n this.canvasContainer.style.opacity = 1;\n }\n\n /**\n * @summary Updates the size of the renderer and the aspect of the camera\n * @private\n */\n __onSizeUpdated() {\n this.renderer.setSize(this.prop.size.width, this.prop.size.height);\n this.camera.aspect = this.prop.aspect;\n this.camera.updateProjectionMatrix();\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Updates the fov of the camera\n * @private\n */\n __onZoomUpdated() {\n this.camera.fov = this.prop.vFov;\n this.camera.updateProjectionMatrix();\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Updates the position of the camera\n * @private\n */\n __onPositionUpdated() {\n this.camera.position.set(0, 0, 0);\n this.camera.lookAt(this.prop.direction);\n if (this.config.fisheye) {\n this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye / 2).negate();\n }\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Main event loop, calls {@link render} if `prop.needsUpdate` is true\n * @param {number} timestamp\n * @fires PSV.before-render\n * @private\n */\n __renderLoop(timestamp) {\n const elapsed = this.timestamp !== null ? timestamp - this.timestamp : 0;\n this.timestamp = timestamp;\n\n this.psv.trigger(EVENTS.BEFORE_RENDER, timestamp, elapsed);\n each(this.psv.dynamics, d => d.update(elapsed));\n\n if (this.prop.idleTime > 0 && timestamp - this.prop.idleTime > this.config.autorotateDelay) {\n this.psv.startAutorotate();\n }\n\n if (this.prop.needsUpdate) {\n this.render();\n this.prop.needsUpdate = false;\n }\n }\n\n /**\n * @summary Performs a render\n * @description Do not call this method directly, instead call\n * {@link PSV.Viewer#needsUpdate} on {@link PSV.event:before-render}.\n * @fires PSV.render\n */\n render() {\n this.renderer.render(this.scene, this.camera);\n this.psv.trigger(EVENTS.RENDER);\n }\n\n /**\n * @summary Applies the texture to the scene, creates the scene if needed\n * @param {PSV.TextureData} textureData\n * @fires PSV.panorama-loaded\n * @package\n */\n setTexture(textureData) {\n this.prop.panoData = textureData.panoData;\n\n this.psv.adapter.setTexture(this.mesh, textureData);\n\n if (!this.ready) {\n this.renderer.setAnimationLoop(t => this.__renderLoop(t));\n this.ready = true;\n }\n\n this.psv.needsUpdate();\n\n this.psv.trigger(EVENTS.PANORAMA_LOADED, textureData);\n }\n\n /**\n * @summary Apply a panorama data pose to a Mesh\n * @param {PSV.PanoData} [panoData]\n * @param {external:THREE.Mesh} [mesh=this.mesh]\n * @package\n */\n setPanoramaPose(panoData, mesh = this.mesh) {\n // By Google documentation the angles are applied on the camera in order : heading, pitch, roll\n // here we apply the reverse transformation on the sphere\n const cleanCorrection = this.psv.dataHelper.cleanPanoramaPose(panoData);\n\n mesh.rotation.set(\n -cleanCorrection.tilt,\n -cleanCorrection.pan,\n -cleanCorrection.roll,\n 'ZXY'\n );\n }\n\n /**\n * @summary Apply a SphereCorrection to a Mesh\n * @param {PSV.SphereCorrection} [sphereCorrection]\n * @param {external:THREE.Mesh} [mesh=this.meshContainer]\n * @package\n */\n setSphereCorrection(sphereCorrection, mesh = this.meshContainer) {\n const cleanCorrection = this.psv.dataHelper.cleanSphereCorrection(sphereCorrection);\n\n mesh.rotation.set(\n cleanCorrection.tilt,\n cleanCorrection.pan,\n cleanCorrection.roll,\n 'ZXY'\n );\n }\n\n /**\n * @summary Performs transition between the current and a new texture\n * @param {PSV.TextureData} textureData\n * @param {PSV.PanoramaOptions} options\n * @returns {PSV.Animation}\n * @package\n */\n transition(textureData, options) {\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n // create temp group and new mesh, half size to be in \"front\" of the first one\n const group = new THREE.Group();\n const mesh = this.psv.adapter.createMesh(0.5);\n this.psv.adapter.setTexture(mesh, textureData, true);\n this.psv.adapter.setTextureOpacity(mesh, 0);\n this.setPanoramaPose(textureData.panoData, mesh);\n this.setSphereCorrection(options.sphereCorrection, group);\n\n // rotate the new sphere to make the target position face the camera\n if (positionProvided) {\n const cleanPosition = this.psv.dataHelper.cleanPosition(options);\n const currentPosition = this.psv.getPosition();\n\n // Longitude rotation along the vertical axis\n const verticalAxis = new THREE.Vector3(0, 1, 0);\n group.rotateOnWorldAxis(verticalAxis, cleanPosition.longitude - currentPosition.longitude);\n\n // Latitude rotation along the camera horizontal axis\n const horizontalAxis = new THREE.Vector3(0, 1, 0).cross(this.camera.getWorldDirection(new THREE.Vector3())).normalize();\n group.rotateOnWorldAxis(horizontalAxis, cleanPosition.latitude - currentPosition.latitude);\n }\n\n group.add(mesh);\n this.scene.add(group);\n\n const animation = new Animation({\n properties: {\n opacity: { start: 0.0, end: 1.0 },\n zoom : zoomProvided ? { start: this.psv.getZoomLevel(), end: options.zoom } : undefined,\n },\n duration : options.transition,\n easing : 'outCubic',\n onTick : (properties) => {\n this.psv.adapter.setTextureOpacity(mesh, properties.opacity);\n this.psv.adapter.setTextureOpacity(this.mesh, 1 - properties.opacity);\n\n if (zoomProvided) {\n this.psv.zoom(properties.zoom);\n }\n\n this.psv.needsUpdate();\n },\n });\n\n animation\n .then((completed) => {\n if (completed) {\n // remove temp sphere and transfer the texture to the main mesh\n this.setTexture(textureData);\n this.psv.adapter.setTextureOpacity(this.mesh, 1);\n this.setPanoramaPose(textureData.panoData);\n this.setSphereCorrection(options.sphereCorrection);\n\n // actually rotate the camera\n if (positionProvided) {\n this.psv.rotate(options);\n }\n }\n else {\n this.psv.adapter.disposeTexture(textureData);\n }\n\n this.scene.remove(group);\n mesh.geometry.dispose();\n mesh.geometry = null;\n });\n\n return animation;\n }\n\n /**\n * @summary Calls `dispose` on all objects and textures\n * @param {external:THREE.Object3D} object\n * @private\n */\n __cleanTHREEScene(object) {\n object.traverse((item) => {\n if (item.geometry) {\n item.geometry.dispose();\n }\n\n if (item.material) {\n if (Array.isArray(item.material)) {\n item.material.forEach((material) => {\n if (material.map) {\n material.map.dispose();\n }\n\n material.dispose();\n });\n }\n else {\n if (item.material.map) {\n item.material.map.dispose();\n }\n\n item.material.dispose();\n }\n }\n\n if (item.dispose && !(item instanceof THREE.Scene)) {\n item.dispose();\n }\n\n if (item !== object) {\n this.__cleanTHREEScene(item);\n }\n });\n }\n\n}\n","import * as THREE from 'three';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Texture loader\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TextureLoader extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary THREE file loader\n * @type {external:THREE:FileLoader}\n * @private\n */\n this.loader = new THREE.FileLoader();\n this.loader.setResponseType('blob');\n if (this.config.withCredentials) {\n this.loader.setWithCredentials(true);\n }\n if (this.config.requestHeaders && typeof this.config.requestHeaders === 'object') {\n this.loader.setRequestHeader(this.config.requestHeaders);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n this.abortLoading();\n super.destroy();\n }\n\n /**\n * @summary Loads the panorama texture(s)\n * @param {*} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @package\n * @deprecated\n */\n loadTexture(panorama, newPanoData) {\n return this.psv.adapter.loadTexture(panorama, newPanoData);\n }\n\n /**\n * @summary Cancels current HTTP requests\n * @package\n */\n abortLoading() {\n // noop implementation waiting for https://github.com/mrdoob/three.js/pull/23070\n }\n\n /**\n * @summary Loads a Blob with FileLoader\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n */\n loadFile(url, onProgress) {\n if (this.config.requestHeaders && typeof this.config.requestHeaders === 'function') {\n this.loader.setRequestHeader(this.config.requestHeaders(url));\n }\n\n return new Promise((resolve, reject) => {\n let progress = 0;\n onProgress && onProgress(progress);\n\n this.loader.load(\n url,\n (result) => {\n progress = 100;\n onProgress && onProgress(progress);\n resolve(result);\n },\n (e) => {\n if (e.lengthComputable) {\n const newProgress = e.loaded / e.total * 100;\n if (newProgress > progress) {\n progress = newProgress;\n onProgress && onProgress(progress);\n }\n }\n },\n (err) => {\n reject(err);\n }\n );\n });\n }\n\n /**\n * @summary Loads an Image using FileLoader to have progress events\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n */\n loadImage(url, onProgress) {\n return this.loadFile(url, onProgress)\n .then(result => new Promise((resolve, reject) => {\n const img = document.createElementNS('http://www.w3.org/1999/xhtml', 'img');\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve(img);\n };\n img.onerror = reject;\n img.src = URL.createObjectURL(result);\n }));\n }\n\n /**\n * @summary Preload a panorama file without displaying it\n * @param {*} panorama\n * @returns {Promise}\n */\n preloadPanorama(panorama) {\n if (this.psv.adapter.supportsPreload(panorama)) {\n return this.psv.adapter.loadTexture(panorama);\n }\n else {\n return Promise.resolve();\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { addClasses, cleanPosition } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\nconst STATE = { NONE: 0, SHOWING: 1, HIDING: 2, READY: 3 };\n\n/**\n * @typedef {Object} PSV.components.Tooltip.Position\n * @summary Object defining the tooltip position\n * @property {number} top - Position of the tip of the arrow of the tooltip, in pixels\n * @property {number} left - Position of the tip of the arrow of the tooltip, in pixels\n * @property {string|string[]} [position='top center'] - Tooltip position toward it's arrow tip.\n * Accepted values are combinations of `top`, `center`, `bottom` and `left`, `center`, `right`\n * @property {Object} [box] - Used when displaying a tooltip on a marker\n * @property {number} [box.width=0]\n * @property {number} [box.height=0]\n */\n\n/**\n * @typedef {PSV.components.Tooltip.Position} PSV.components.Tooltip.Config\n * @summary Object defining the tooltip configuration\n * @property {string} content - HTML content of the tooltip\n * @property {string} [className] - Additional CSS class added to the tooltip\n * @property {*} [data] - Userdata associated to the tooltip\n */\n\n/**\n * @summary Tooltip component\n * @description Never instanciate tooltips directly use {@link PSV.services.TooltipRenderer} instead\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Tooltip extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n * @param {{arrow: number, offset: number}} size\n */\n constructor(psv, size) {\n super(psv, 'psv-tooltip');\n\n /**\n * @override\n * @property {number} arrow\n * @property {number} offset\n * @property {number} width\n * @property {number} height\n * @property {string} pos\n * @property {string} state\n * @property {*} data\n */\n this.prop = {\n ...this.prop,\n ...size,\n state : STATE.NONE,\n width : 0,\n height: 0,\n pos : '',\n data : null,\n };\n\n /**\n * Tooltip content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-tooltip-content';\n this.container.appendChild(this.content);\n\n /**\n * Tooltip arrow\n * @member {HTMLElement}\n * @readonly\n * @package\n */\n this.arrow = document.createElement('div');\n this.arrow.className = 'psv-tooltip-arrow';\n this.container.appendChild(this.arrow);\n\n this.container.addEventListener('transitionend', this);\n\n this.container.style.top = '-1000px';\n this.container.style.left = '-1000px';\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.arrow;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'transitionend': this.__onTransitionEnd(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Tooltip cannot be toggled');\n }\n\n /**\n * @summary Displays the tooltip on the viewer\n * Do not call this method directly, use {@link PSV.services.TooltipRenderer} instead.\n * @param {PSV.components.Tooltip.Config} config\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @package\n */\n show(config) {\n if (this.prop.state !== STATE.NONE) {\n throw new PSVError('Initialized tooltip cannot be re-initialized');\n }\n\n if (config.className) {\n addClasses(this.container, config.className);\n }\n\n this.content.innerHTML = config.content;\n\n const rect = this.container.getBoundingClientRect();\n this.prop.width = rect.right - rect.left;\n this.prop.height = rect.bottom - rect.top;\n\n this.prop.state = STATE.READY;\n\n this.move(config);\n\n this.prop.data = config.data;\n this.prop.state = STATE.SHOWING;\n\n this.psv.trigger(EVENTS.SHOW_TOOLTIP, this.prop.data, this);\n }\n\n /**\n * @summary Moves the tooltip to a new position\n * @param {PSV.components.Tooltip.Position} config\n *\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n move(config) {\n if (this.prop.state !== STATE.SHOWING && this.prop.state !== STATE.READY) {\n throw new PSVError('Uninitialized tooltip cannot be moved');\n }\n\n const t = this.container;\n const a = this.arrow;\n\n // compute size\n const style = {\n posClass : cleanPosition(config.position, 'top center', false),\n width : this.prop.width,\n height : this.prop.height,\n top : 0,\n left : 0,\n arrowTop : 0,\n arrowLeft: 0,\n };\n\n // set initial position\n this.__computeTooltipPosition(style, config);\n\n // correct position if overflow\n let refresh = false;\n if (style.top < this.prop.offset) {\n style.posClass[0] = 'bottom';\n refresh = true;\n }\n else if (style.top + style.height > this.psv.prop.size.height - this.prop.offset) {\n style.posClass[0] = 'top';\n refresh = true;\n }\n if (style.left < this.prop.offset) {\n style.posClass[1] = 'right';\n refresh = true;\n }\n else if (style.left + style.width > this.psv.prop.size.width - this.prop.offset) {\n style.posClass[1] = 'left';\n refresh = true;\n }\n if (refresh) {\n this.__computeTooltipPosition(style, config);\n }\n\n // apply position\n t.style.top = style.top + 'px';\n t.style.left = style.left + 'px';\n\n a.style.top = style.arrowTop + 'px';\n a.style.left = style.arrowLeft + 'px';\n\n const newPos = style.posClass.join('-');\n if (newPos !== this.prop.pos) {\n t.classList.remove(`psv-tooltip--${this.prop.pos}`);\n\n this.prop.pos = newPos;\n t.classList.add(`psv-tooltip--${this.prop.pos}`);\n }\n }\n\n /**\n * @summary Hides the tooltip\n * @fires PSV.hide-tooltip\n */\n hide() {\n this.container.classList.remove('psv-tooltip--visible');\n this.prop.state = STATE.HIDING;\n\n this.psv.trigger(EVENTS.HIDE_TOOLTIP, this.prop.data);\n }\n\n /**\n * @summary Finalize transition\n * @param {TransitionEvent} e\n * @private\n */\n __onTransitionEnd(e) {\n if (e.propertyName === 'transform') {\n switch (this.prop.state) {\n case STATE.SHOWING:\n this.container.classList.add('psv-tooltip--visible');\n this.prop.state = STATE.READY;\n break;\n\n case STATE.HIDING:\n this.prop.state = STATE.NONE;\n this.destroy();\n break;\n\n default:\n // nothing\n }\n }\n }\n\n /**\n * @summary Computes the position of the tooltip and its arrow\n * @param {Object} style\n * @param {Object} config\n * @private\n */\n __computeTooltipPosition(style, config) {\n let topBottom = false;\n\n if (!config.box) {\n config.box = {\n width : 0,\n height: 0,\n };\n }\n\n switch (style.posClass[0]) {\n case 'bottom':\n style.top = config.top + config.box.height + this.prop.offset + this.prop.arrow;\n style.arrowTop = -this.prop.arrow * 2;\n topBottom = true;\n break;\n\n case 'center':\n style.top = config.top + config.box.height / 2 - style.height / 2;\n style.arrowTop = style.height / 2 - this.prop.arrow;\n break;\n\n case 'top':\n style.top = config.top - style.height - this.prop.offset - this.prop.arrow;\n style.arrowTop = style.height;\n topBottom = true;\n break;\n\n // no default\n }\n\n switch (style.posClass[1]) {\n case 'right':\n if (topBottom) {\n style.left = config.left + config.box.width / 2 - this.prop.offset - this.prop.arrow;\n style.arrowLeft = this.prop.offset;\n }\n else {\n style.left = config.left + config.box.width + this.prop.offset + this.prop.arrow;\n style.arrowLeft = -this.prop.arrow * 2;\n }\n break;\n\n case 'center':\n style.left = config.left + config.box.width / 2 - style.width / 2;\n style.arrowLeft = style.width / 2 - this.prop.arrow;\n break;\n\n case 'left':\n if (topBottom) {\n style.left = config.left - style.width + config.box.width / 2 + this.prop.offset + this.prop.arrow;\n style.arrowLeft = style.width - this.prop.offset - this.prop.arrow * 2;\n }\n else {\n style.left = config.left - style.width - this.prop.offset - this.prop.arrow;\n style.arrowLeft = style.width;\n }\n break;\n\n // no default\n }\n }\n\n}\n","import { Tooltip } from '../components/Tooltip';\nimport { getStyle } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Tooltip renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TooltipRenderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n const testTooltip = new Tooltip(this.psv);\n\n /**\n * @summary Computed static sizes\n * @member {Object}\n * @package\n * @property {number} arrowSize\n * @property {number} offset\n */\n this.size = {\n arrow : parseInt(getStyle(testTooltip.arrow, 'borderTopWidth'), 10),\n offset: parseInt(getStyle(testTooltip.container, 'outlineWidth'), 10),\n };\n\n testTooltip.destroy();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.size;\n\n super.destroy();\n }\n\n /**\n * @summary Displays a tooltip on the viewer\n * @param {PSV.components.Tooltip.Config} config\n * @returns {PSV.components.Tooltip}\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @example\n * viewer.tooltip.create({ content: 'Hello world', top: 200, left: 450, position: 'center bottom'})\n */\n create(config) {\n const tooltip = new Tooltip(this.psv, this.size);\n tooltip.show(config);\n\n return tooltip;\n }\n\n}\n","import * as THREE from 'three';\nimport { EventEmitter } from 'uevent';\nimport { Loader } from './components/Loader';\nimport { Navbar } from './components/Navbar';\nimport { Notification } from './components/Notification';\nimport { Overlay } from './components/Overlay';\nimport { Panel } from './components/Panel';\nimport { CONFIG_PARSERS, DEFAULTS, DEPRECATED_OPTIONS, getConfig, READONLY_OPTIONS } from './data/config';\nimport { CHANGE_EVENTS, DEFAULT_TRANSITION, EVENTS, IDS, SPHERE_RADIUS, VIEWER_DATA } from './data/constants';\nimport { SYSTEM } from './data/system';\nimport errorIcon from './icons/error.svg';\nimport { AbstractPlugin } from './plugins/AbstractPlugin';\nimport { PSVError } from './PSVError';\nimport { DataHelper } from './services/DataHelper';\nimport { EventsHandler } from './services/EventsHandler';\nimport { Renderer } from './services/Renderer';\nimport { TextureLoader } from './services/TextureLoader';\nimport { TooltipRenderer } from './services/TooltipRenderer';\nimport {\n Animation,\n Dynamic,\n each,\n exitFullscreen,\n getAbortError,\n getAngle,\n getShortestArc,\n isAbortError,\n isExtendedPosition,\n isFullscreenEnabled,\n isNil,\n logWarn,\n MultiDynamic,\n pluginInterop,\n requestFullscreen,\n throttle,\n toggleClass\n} from './utils';\n\nTHREE.Cache.enabled = true;\n\n/**\n * @summary Main class\n * @memberOf PSV\n * @extends {external:uEvent.EventEmitter}\n */\nexport class Viewer extends EventEmitter {\n\n /**\n * @param {PSV.Options} options\n * @fires PSV.ready\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(options) {\n super();\n\n SYSTEM.load();\n\n // must support WebGL\n if (!SYSTEM.isWebGLSupported) {\n throw new PSVError('WebGL is not supported.');\n }\n\n if (SYSTEM.maxTextureWidth === 0) {\n throw new PSVError('Unable to detect system capabilities');\n }\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} ready - when all components are loaded\n * @property {boolean} uiRefresh - if the UI needs to be renderer\n * @property {boolean} needsUpdate - if the view needs to be renderer\n * @property {boolean} fullscreen - if the viewer is currently fullscreen\n * @property {external:THREE.Vector3} direction - direction of the camera\n * @property {number} vFov - vertical FOV\n * @property {number} hFov - horizontal FOV\n * @property {number} aspect - viewer aspect ratio\n * @property {boolean} autorotateEnabled - automatic rotation is enabled\n * @property {PSV.Animation} animationPromise - promise of the current animation\n * @property {Promise} loadingPromise - promise of the setPanorama method\n * @property {number} idleTime - time of the last user action\n * @property {object} objectsObservers\n * @property {PSV.Size} size - size of the container\n * @property {PSV.PanoData} panoData - panorama metadata, if supported\n */\n this.prop = {\n ready : false,\n uiRefresh : false,\n needsUpdate : false,\n fullscreen : false,\n direction : new THREE.Vector3(0, 0, SPHERE_RADIUS),\n vFov : null,\n hFov : null,\n aspect : null,\n autorotateEnabled: false,\n animationPromise : null,\n loadingPromise : null,\n idleTime : -1,\n objectsObservers : {},\n size : {\n width : 0,\n height: 0,\n },\n panoData : {\n fullWidth : 0,\n fullHeight : 0,\n croppedWidth : 0,\n croppedHeight: 0,\n croppedX : 0,\n croppedY : 0,\n poseHeading : 0,\n posePitch : 0,\n poseRoll : 0,\n },\n };\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = getConfig(options);\n\n /**\n * @summary Top most parent\n * @member {HTMLElement}\n * @readonly\n */\n this.parent = (typeof options.container === 'string') ? document.getElementById(options.container) : options.container;\n this.parent[VIEWER_DATA] = this;\n\n /**\n * @summary Main container\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.classList.add('psv-container');\n this.parent.appendChild(this.container);\n\n /**\n * @summary Render adapter\n * @type {PSV.adapters.AbstractAdapter}\n * @readonly\n * @package\n */\n this.adapter = new this.config.adapter[0](this, this.config.adapter[1]); // eslint-disable-line new-cap\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary All plugins\n * @type {Object}\n * @readonly\n * @package\n */\n this.plugins = {};\n\n /**\n * @type {PSV.services.Renderer}\n * @readonly\n */\n this.renderer = new Renderer(this);\n\n /**\n * @type {PSV.services.TextureLoader}\n * @readonly\n */\n this.textureLoader = new TextureLoader(this);\n\n /**\n * @type {PSV.services.EventsHandler}\n * @readonly\n */\n this.eventsHandler = new EventsHandler(this);\n\n /**\n * @type {PSV.services.DataHelper}\n * @readonly\n */\n this.dataHelper = new DataHelper(this);\n\n /**\n * @member {PSV.components.Loader}\n * @readonly\n */\n this.loader = new Loader(this);\n\n /**\n * @member {PSV.components.Navbar}\n * @readonly\n */\n this.navbar = new Navbar(this);\n\n /**\n * @member {PSV.components.Panel}\n * @readonly\n */\n this.panel = new Panel(this);\n\n /**\n * @member {PSV.services.TooltipRenderer}\n * @readonly\n */\n this.tooltip = new TooltipRenderer(this);\n\n /**\n * @member {PSV.components.Notification}\n * @readonly\n */\n this.notification = new Notification(this);\n\n /**\n * @member {PSV.components.Overlay}\n * @readonly\n */\n this.overlay = new Overlay(this);\n\n /**\n * @member {Record}\n * @package\n */\n this.dynamics = {\n zoom: new Dynamic((value) => {\n this.prop.vFov = this.dataHelper.zoomLevelToFov(value);\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n this.trigger(EVENTS.ZOOM_UPDATED, value);\n }, this.config.defaultZoomLvl, 0, 100),\n\n position: new MultiDynamic({\n longitude: new Dynamic(null, this.config.defaultLong, 0, 2 * Math.PI, true),\n latitude : new Dynamic(null, this.config.defaultLat, -Math.PI / 2, Math.PI / 2),\n }, (position) => {\n this.dataHelper.sphericalCoordsToVector3(position, this.prop.direction);\n this.trigger(EVENTS.POSITION_UPDATED, position);\n }),\n };\n\n this.__updateSpeeds();\n\n this.eventsHandler.init();\n\n this.__resizeRefresh = throttle(() => this.refreshUi('resize'), 500);\n\n // apply container size\n this.resize(this.config.size);\n\n // init plugins\n this.config.plugins.forEach(([plugin, opts]) => {\n this.plugins[plugin.id] = new plugin(this, opts); // eslint-disable-line new-cap\n });\n each(this.plugins, plugin => plugin.init?.());\n\n // init buttons\n this.navbar.setButtons(this.config.navbar);\n\n // load panorama\n if (this.config.panorama) {\n this.setPanorama(this.config.panorama);\n }\n\n toggleClass(this.container, 'psv--is-touch', SYSTEM.isTouchEnabled.initial);\n SYSTEM.isTouchEnabled.promise.then(enabled => toggleClass(this.container, 'psv--is-touch', enabled));\n\n // enable GUI after first render\n this.once(EVENTS.RENDER, () => {\n if (this.config.navbar) {\n this.container.classList.add('psv--has-navbar');\n this.navbar.show();\n }\n\n // Queue autorotate\n if (!isNil(this.config.autorotateDelay)) {\n this.prop.idleTime = performance.now();\n }\n\n this.prop.ready = true;\n\n setTimeout(() => {\n this.refreshUi('init');\n\n this.trigger(EVENTS.READY);\n }, 0);\n });\n }\n\n /**\n * @summary Destroys the viewer\n * @description The memory used by the ThreeJS context is not totally cleared. This will be fixed as soon as possible.\n */\n destroy() {\n this.__stopAll();\n this.stopKeyboardControl();\n this.exitFullscreen();\n\n each(this.plugins, plugin => plugin.destroy());\n delete this.plugins;\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n this.eventsHandler.destroy();\n this.renderer.destroy();\n this.textureLoader.destroy();\n this.dataHelper.destroy();\n this.adapter.destroy();\n\n this.parent.removeChild(this.container);\n delete this.parent[VIEWER_DATA];\n\n delete this.parent;\n delete this.container;\n\n delete this.loader;\n delete this.navbar;\n delete this.panel;\n delete this.tooltip;\n delete this.notification;\n delete this.overlay;\n delete this.dynamics;\n\n delete this.config;\n }\n\n /**\n * @summary Refresh UI\n * @package\n */\n refreshUi(reason) {\n if (!this.prop.ready) {\n return;\n }\n\n if (!this.prop.uiRefresh) {\n // console.log(`PhotoSphereViewer: UI Refresh, ${reason}`);\n\n this.prop.uiRefresh = true;\n\n this.children.every((child) => {\n child.refreshUi();\n return this.prop.uiRefresh === true;\n });\n\n this.prop.uiRefresh = false;\n }\n else if (this.prop.uiRefresh !== 'new') {\n this.prop.uiRefresh = 'new';\n\n // wait for current refresh to cancel\n setTimeout(() => {\n this.prop.uiRefresh = false;\n this.refreshUi(reason);\n });\n }\n }\n\n /**\n * @summary Returns the instance of a plugin if it exists\n * @param {Class|string} pluginId\n * @returns {PSV.plugins.AbstractPlugin}\n */\n getPlugin(pluginId) {\n if (typeof pluginId === 'string') {\n return this.plugins[pluginId];\n }\n else {\n const pluginCtor = pluginInterop(pluginId, AbstractPlugin);\n return pluginCtor ? this.plugins[pluginCtor.id] : undefined;\n }\n }\n\n /**\n * @summary Returns the current position of the camera\n * @returns {PSV.Position}\n */\n getPosition() {\n return this.dataHelper.cleanPosition(this.dynamics.position.current);\n }\n\n /**\n * @summary Returns the current zoom level\n * @returns {number}\n */\n getZoomLevel() {\n return this.dynamics.zoom.current;\n }\n\n /**\n * @summary Returns the current viewer size\n * @returns {PSV.Size}\n */\n getSize() {\n return { ...this.prop.size };\n }\n\n /**\n * @summary Checks if the automatic rotation is enabled\n * @returns {boolean}\n */\n isAutorotateEnabled() {\n return this.prop.autorotateEnabled;\n }\n\n /**\n * @summary Checks if the viewer is in fullscreen\n * @returns {boolean}\n */\n isFullscreenEnabled() {\n if (SYSTEM.fullscreenEvent) {\n return isFullscreenEnabled(this.container);\n }\n else {\n return this.prop.fullscreen;\n }\n }\n\n /**\n * @summary Flags the view has changed for the next render\n */\n needsUpdate() {\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Resizes the canvas when the window is resized\n * @fires PSV.size-updated\n */\n autoSize() {\n if (this.container.clientWidth !== this.prop.size.width || this.container.clientHeight !== this.prop.size.height) {\n this.prop.size.width = Math.round(this.container.clientWidth);\n this.prop.size.height = Math.round(this.container.clientHeight);\n this.prop.aspect = this.prop.size.width / this.prop.size.height;\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n\n this.trigger(EVENTS.SIZE_UPDATED, this.getSize());\n this.__resizeRefresh();\n }\n }\n\n /**\n * @summary Loads a new panorama file\n * @description Loads a new panorama file, optionally changing the camera position/zoom and activating the transition animation.
\n * If the \"options\" parameter is not defined, the camera will not move and the ongoing animation will continue.
\n * If another loading is already in progress it will be aborted.\n * @param {*} path - URL of the new panorama file\n * @param {PSV.PanoramaOptions} [options]\n * @returns {Promise} resolves false if the loading was aborted by another call\n */\n setPanorama(path, options = {}) {\n this.textureLoader.abortLoading();\n this.prop.transitionAnimation?.cancel();\n\n // apply default parameters on first load\n if (!this.prop.ready) {\n if (!('sphereCorrection' in options)) {\n options.sphereCorrection = this.config.sphereCorrection;\n }\n if (!('panoData' in options)) {\n options.panoData = this.config.panoData;\n }\n }\n\n if (options.transition === undefined || options.transition === true) {\n options.transition = DEFAULT_TRANSITION;\n }\n if (options.showLoader === undefined) {\n options.showLoader = true;\n }\n if (options.caption === undefined) {\n options.caption = this.config.caption;\n }\n if (options.description === undefined) {\n options.description = this.config.description;\n }\n\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n if (positionProvided || zoomProvided) {\n this.__stopAll();\n }\n\n this.hideError();\n\n this.config.panorama = path;\n this.config.caption = options.caption;\n this.config.description = options.description;\n\n const done = (err) => {\n this.loader.hide();\n\n this.prop.loadingPromise = null;\n\n if (isAbortError(err)) {\n return false;\n }\n else if (err) {\n this.navbar.setCaption('');\n this.showError(this.config.lang.loadError);\n console.error(err);\n throw err;\n }\n else {\n this.resetIdleTimer();\n this.navbar.setCaption(this.config.caption);\n return true;\n }\n };\n\n this.navbar.setCaption(`${this.config.loadingTxt || ''}`);\n if (options.showLoader || !this.prop.ready) {\n this.loader.show();\n }\n\n const loadingPromise = this.adapter.loadTexture(this.config.panorama, options.panoData)\n .then((textureData) => {\n // check if another panorama was requested\n if (textureData.panorama !== this.config.panorama) {\n this.adapter.disposeTexture(textureData);\n throw getAbortError();\n }\n return textureData;\n });\n\n if (!options.transition || !this.prop.ready || !this.adapter.supportsTransition(this.config.panorama)) {\n this.prop.loadingPromise = loadingPromise\n .then((textureData) => {\n this.renderer.show();\n this.renderer.setTexture(textureData);\n this.renderer.setPanoramaPose(textureData.panoData);\n this.renderer.setSphereCorrection(options.sphereCorrection);\n\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n if (positionProvided) {\n this.rotate(options);\n }\n })\n .then(done, done);\n }\n else {\n this.prop.loadingPromise = loadingPromise\n .then((textureData) => {\n this.loader.hide();\n\n this.prop.transitionAnimation = this.renderer.transition(textureData, options);\n return this.prop.transitionAnimation\n .then((completed) => {\n this.prop.transitionAnimation = null;\n if (!completed) {\n throw getAbortError();\n }\n });\n })\n .then(done, done);\n }\n\n return this.prop.loadingPromise;\n }\n\n /**\n * @summary Update options\n * @param {PSV.Options} options\n * @fires PSV.config-changed\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n setOptions(options) {\n const rawConfig = {\n ...this.config,\n ...options,\n };\n\n each(options, (value, key) => {\n if (DEPRECATED_OPTIONS[key]) {\n logWarn(DEPRECATED_OPTIONS[key]);\n return;\n }\n\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (READONLY_OPTIONS[key]) {\n throw new PSVError(READONLY_OPTIONS[key]);\n }\n\n if (CONFIG_PARSERS[key]) {\n this.config[key] = CONFIG_PARSERS[key](value, rawConfig);\n }\n else {\n this.config[key] = value;\n }\n\n switch (key) {\n case 'caption':\n case 'description':\n this.navbar.setCaption(this.config.caption);\n break;\n\n case 'size':\n this.resize(value);\n break;\n\n case 'sphereCorrection':\n this.renderer.setSphereCorrection(value);\n break;\n\n case 'navbar':\n case 'lang':\n this.navbar.setButtons(this.config.navbar);\n break;\n\n case 'moveSpeed':\n case 'zoomSpeed':\n this.__updateSpeeds();\n break;\n\n case 'minFov':\n case 'maxFov':\n this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.prop.vFov));\n this.trigger(EVENTS.ZOOM_UPDATED, this.getZoomLevel());\n break;\n\n case 'canvasBackground':\n this.renderer.canvasContainer.style.background = this.config.canvasBackground;\n break;\n\n case 'autorotateIdle':\n this.resetIdleTimer();\n break;\n\n default:\n break;\n }\n });\n\n this.needsUpdate();\n this.refreshUi('set options');\n\n this.trigger(EVENTS.CONFIG_CHANGED, Object.keys(options));\n }\n\n /**\n * @summary Update options\n * @param {string} option\n * @param {any} value\n * @fires PSV.config-changed\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n setOption(option, value) {\n this.setOptions({ [option]: value });\n }\n\n /**\n * @summary Restarts the idle timer (if `autorotateIdle=true`)\n * @package\n */\n resetIdleTimer() {\n this.prop.idleTime = this.config.autorotateIdle ? performance.now() : -1;\n }\n\n /**\n * @summary Stops the idle timer\n * @package\n */\n disableIdleTimer() {\n this.prop.idleTime = -1;\n }\n\n /**\n * @summary Starts the automatic rotation\n * @fires PSV.autorotate\n */\n startAutorotate(refresh = false) {\n if (refresh && !this.isAutorotateEnabled()) {\n return;\n }\n if (!refresh && this.isAutorotateEnabled()) {\n return;\n }\n\n if (!refresh) {\n this.__stopAll();\n }\n\n this.dynamics.position.roll({\n longitude: this.config.autorotateSpeed < 0,\n }, Math.abs(this.config.autorotateSpeed / this.config.moveSpeed));\n\n this.dynamics.position.goto({\n latitude: this.config.autorotateLat,\n }, Math.abs(this.config.autorotateSpeed / this.config.moveSpeed));\n\n this.prop.autorotateEnabled = true;\n\n if (!refresh) {\n this.trigger(EVENTS.AUTOROTATE, true);\n }\n }\n\n /**\n * @summary Stops the automatic rotation\n * @fires PSV.autorotate\n */\n stopAutorotate() {\n if (this.isAutorotateEnabled()) {\n this.dynamics.position.stop();\n\n this.prop.autorotateEnabled = false;\n\n this.trigger(EVENTS.AUTOROTATE, false);\n }\n }\n\n /**\n * @summary Starts or stops the automatic rotation\n * @fires PSV.autorotate\n */\n toggleAutorotate() {\n if (this.isAutorotateEnabled()) {\n this.stopAutorotate();\n }\n else {\n this.startAutorotate();\n }\n }\n\n /**\n * @summary Displays an error message over the viewer\n * @param {string} message\n */\n showError(message) {\n this.overlay.show({\n id : IDS.ERROR,\n image : errorIcon,\n text : message,\n dissmisable: false,\n });\n }\n\n /**\n * @summary Hides the error message\n */\n hideError() {\n this.overlay.hide(IDS.ERROR);\n }\n\n /**\n * @summary Rotates the view to specific longitude and latitude\n * @param {PSV.ExtendedPosition} position\n * @fires PSV.before-rotate\n * @fires PSV.position-updated\n */\n rotate(position) {\n const e = this.trigger(EVENTS.BEFORE_ROTATE, position);\n if (e.isDefaultPrevented()) {\n return;\n }\n\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ROTATE_POSITION, this.dataHelper.cleanPosition(position));\n this.dynamics.position.setValue(cleanPosition);\n }\n\n /**\n * @summary Rotates and zooms the view with a smooth animation\n * @param {PSV.AnimateOptions} options - position and/or zoom level\n * @returns {PSV.Animation}\n */\n animate(options) {\n this.__stopAll();\n\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n const animProperties = {};\n let duration;\n\n // clean/filter position and compute duration\n if (positionProvided) {\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ANIMATE_POSITION, this.dataHelper.cleanPosition(options));\n const currentPosition = this.getPosition();\n\n // longitude offset for shortest arc\n const tOffset = getShortestArc(currentPosition.longitude, cleanPosition.longitude);\n\n animProperties.longitude = { start: currentPosition.longitude, end: currentPosition.longitude + tOffset };\n animProperties.latitude = { start: currentPosition.latitude, end: cleanPosition.latitude };\n\n duration = this.dataHelper.speedToDuration(options.speed, getAngle(currentPosition, cleanPosition));\n }\n\n // clean/filter zoom and compute duration\n if (zoomProvided) {\n const dZoom = Math.abs(options.zoom - this.getZoomLevel());\n\n animProperties.zoom = { start: this.getZoomLevel(), end: options.zoom };\n\n if (!duration) {\n // if animating zoom only and a speed is given, use an arbitrary PI/4 to compute the duration\n duration = this.dataHelper.speedToDuration(options.speed, Math.PI / 4 * dZoom / 100);\n }\n }\n\n // if no animation needed\n if (!duration) {\n if (positionProvided) {\n this.rotate(options);\n }\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n\n return new Animation();\n }\n\n this.prop.animationPromise = new Animation({\n properties: animProperties,\n duration : duration,\n easing : 'inOutSine',\n onTick : (properties) => {\n if (positionProvided) {\n this.rotate(properties);\n }\n if (zoomProvided) {\n this.zoom(properties.zoom);\n }\n },\n });\n\n this.prop.animationPromise.then(() => {\n this.prop.animationPromise = null;\n this.resetIdleTimer();\n });\n\n return this.prop.animationPromise;\n }\n\n /**\n * @summary Stops the ongoing animation\n * @description The return value is a Promise because the is no guaranty the animation can be stopped synchronously.\n * @returns {Promise} Resolved when the animation has ben cancelled\n */\n stopAnimation() {\n if (this.prop.animationPromise) {\n return new Promise((resolve) => {\n this.prop.animationPromise.then(resolve);\n this.prop.animationPromise.cancel();\n this.prop.animationPromise = null;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n\n /**\n * @summary Zooms to a specific level between `max_fov` and `min_fov`\n * @param {number} level - new zoom level from 0 to 100\n * @fires PSV.zoom-updated\n */\n zoom(level) {\n this.dynamics.zoom.setValue(level);\n }\n\n /**\n * @summary Increases the zoom level\n * @param {number} [step=1]\n */\n zoomIn(step = 1) {\n this.dynamics.zoom.step(step);\n }\n\n /**\n * @summary Decreases the zoom level\n * @param {number} [step=1]\n */\n zoomOut(step = 1) {\n this.dynamics.zoom.step(-step);\n }\n\n /**\n * @summary Resizes the viewer\n * @param {PSV.CssSize} size\n */\n resize(size) {\n ['width', 'height'].forEach((dim) => {\n if (size && size[dim]) {\n if (/^[0-9.]+$/.test(size[dim])) {\n size[dim] += 'px';\n }\n this.parent.style[dim] = size[dim];\n }\n });\n\n this.autoSize();\n }\n\n /**\n * @summary Enters the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n enterFullscreen() {\n if (SYSTEM.fullscreenEvent) {\n requestFullscreen(this.container);\n }\n else {\n this.container.classList.add('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(true);\n }\n }\n\n /**\n * @summary Exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n exitFullscreen() {\n if (this.isFullscreenEnabled()) {\n if (SYSTEM.fullscreenEvent) {\n exitFullscreen();\n }\n else {\n this.container.classList.remove('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(false);\n }\n }\n }\n\n /**\n * @summary Enters or exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n toggleFullscreen() {\n if (!this.isFullscreenEnabled()) {\n this.enterFullscreen();\n }\n else {\n this.exitFullscreen();\n }\n }\n\n /**\n * @summary Enables the keyboard controls (done automatically when entering fullscreen)\n */\n startKeyboardControl() {\n this.eventsHandler.enableKeyboard();\n }\n\n /**\n * @summary Disables the keyboard controls (done automatically when exiting fullscreen)\n */\n stopKeyboardControl() {\n this.eventsHandler.disableKeyboard();\n }\n\n /**\n * @summary Subscribes to events on objects in the scene\n * @param {string} userDataKey - only objects with the following `userData` will be emitted\n * @param {EventListener} listener - must implement `handleEvent\n * @return {function} call to stop the subscription\n * @package\n */\n observeObjects(userDataKey, listener) {\n this.prop.objectsObservers[userDataKey] = { listener };\n\n return () => {\n delete this.prop.objectsObservers[userDataKey];\n };\n }\n\n /**\n * @summary Stops all current animations\n * @returns {Promise}\n * @package\n */\n __stopAll() {\n this.trigger(EVENTS.STOP_ALL);\n\n this.disableIdleTimer();\n this.stopAutorotate();\n return this.stopAnimation();\n }\n\n /**\n * @summary Recomputes dynamics speeds\n * @private\n */\n __updateSpeeds() {\n this.dynamics.zoom.setSpeed(this.config.zoomSpeed * 50);\n this.dynamics.position.setSpeed(THREE.MathUtils.degToRad(this.config.moveSpeed * 50));\n }\n\n}\n"],"names":["PSVError","message","Error","captureStackTrace","stack","prototype","Object","create","name","constructor","AbstractAdapter","psv","destroy","supportsTransition","panorama","supportsPreload","loadTexture","newPanoData","createMesh","scale","setTexture","mesh","textureData","transition","setTextureOpacity","opacity","disposeTexture","id","supportsDownload","DEFAULT_TRANSITION","MOVE_THRESHOLD","DBLCLICK_DELAY","LONGTOUCH_DELAY","TWOFINGERSOVERLAY_DELAY","CTRLZOOM_TIMEOUT","INERTIA_WINDOW","SPHERE_RADIUS","VIEWER_DATA","MESH_USER_DATA","ACTIONS","ROTATE_LAT_UP","ROTATE_LAT_DOWN","ROTATE_LONG_RIGHT","ROTATE_LONG_LEFT","ZOOM_IN","ZOOM_OUT","TOGGLE_AUTOROTATE","EVENTS","AUTOROTATE","BEFORE_RENDER","BEFORE_ROTATE","CLICK","CLOSE_PANEL","CONFIG_CHANGED","DOUBLE_CLICK","FULLSCREEN_UPDATED","HIDE_NOTIFICATION","HIDE_OVERLAY","HIDE_TOOLTIP","KEY_PRESS","LOAD_PROGRESS","OPEN_PANEL","PANORAMA_LOADED","POSITION_UPDATED","READY","RENDER","SHOW_NOTIFICATION","SHOW_OVERLAY","SHOW_TOOLTIP","SIZE_UPDATED","STOP_ALL","ZOOM_UPDATED","CHANGE_EVENTS","GET_ANIMATE_POSITION","GET_ROTATE_POSITION","OBJECT_EVENTS","ENTER_OBJECT","HOVER_OBJECT","LEAVE_OBJECT","IDS","MENU","TWO_FINGERS","CTRL_ZOOM","ERROR","DESCRIPTION","EASINGS","linear","t","inQuad","outQuad","inOutQuad","inCubic","outCubic","inOutCubic","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","Math","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","KEY_CODES","Enter","Control","Escape","Space","PageUp","PageDown","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Delete","Plus","Minus","LOCALSTORAGE_TOUCH_SUPPORT","SYSTEM","loaded","pixelRatio","isWebGLSupported","isTouchEnabled","maxTextureWidth","mouseWheelEvent","fullscreenEvent","load","ctx","getWebGLCtx","window","devicePixelRatio","getMaxTextureWidth","getMouseWheelEvent","getFullscreenEvent","maxCanvasWidth","getMaxCanvasWidth","canvas","document","createElement","names","context","getContext","some","e","initial","navigator","maxTouchPoints","localStorage","promise","Promise","resolve","clear","listenerMouse","listenerTouch","listenerTimeout","addEventListener","listenerTimeoutId","setTimeout","removeEventListener","clearTimeout","getParameter","MAX_TEXTURE_SIZE","maxWidth","width","height","fillStyle","fillRect","getImageData","data","onmousewheel","undefined","FULLSCREEN_EVT_MAP","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","validExits","keys","filter","exit","length","toggleClass","element","className","active","classList","toggle","contains","add","remove","addClasses","split","forEach","removeClasses","hasParent","el","parent","test","parentNode","getClosest","selector","matches","SVGElement","parentElement","getPosition","left","top","offsetLeft","scrollLeft","clientLeft","offsetTop","scrollTop","clientTop","offsetParent","isFullscreenEnabled","elt","fullscreenElement","webkitFullscreenElement","requestFullscreen","webkitRequestFullscreen","call","getStyle","prop","getComputedStyle","normalizeWheel","event","PIXEL_STEP","LINE_HEIGHT","PAGE_HEIGHT","spinX","spinY","pixelX","pixelY","detail","wheelDelta","wheelDeltaY","wheelDeltaX","axis","HORIZONTAL_AXIS","deltaY","deltaX","deltaMode","bound","x","min","max","loop","value","result","isInteger","Number","isFinite","floor","isPowerOfTwo","log","sum","array","reduce","a","b","distance","p1","p2","y","getShortestArc","from","to","tCandidates","candidate","newCandidate","abs","Infinity","getAngle","position1","position2","acos","latitude","longitude","greatArcDistance","λ1","φ1","λ2","φ2","dasherize","str","replace","s","i","toLowerCase","throttle","func","wait","self","args","timeout","previous","later","Date","now","apply","remaining","arguments","isPlainObject","obj","getPrototypeOf","proto","toString","deepmerge","target","src","first","merge","Array","isArray","key","clone","isEmpty","each","object","callback","isNil","val","firstNonNull","values","pluginInterop","plugin","entries","p","getAbortError","error","isAbortError","err","logWarn","console","warn","isExtendedPosition","key1","key2","getXMPValue","attr","match","parseInt","isNaN","CSS_POSITIONS","bottom","right","center","parsePosition","tokens","toLocaleLowerCase","slice","xFirst","map","token","reverse","parsed","join","parseFloat","LEFT_MAP","TOP_MAP","cleanPosition","defaultValue","allowCenter","tempPos","parseSpeed","speed","speedStr","trim","speedValue","speedUnit","THREE","MathUtils","degToRad","parseAngle","angle","zeroCenter","halfCircle","unit","createTexture","img","texture","Texture","needsUpdate","minFilter","LinearFilter","generateMipmaps","quaternion","Quaternion","applyEulerInverse","vector","euler","setFromEuler","invert","applyQuaternion","Animation","options","__callbacks","easing","__start","delay","__delayTimeout","__animationFrame","requestAnimationFrame","__run","__resolved","timestamp","progress","duration","current","properties","start","end","onTick","__resolve","cb","then","onFulfilled","onRejected","__cancelled","push","cancel","cancelAnimationFrame","catch","finally","onFinally","Dynamic","fn","loopValue","mode","STOP","speedMult","currentSpeed","setSpeed","goto","position","POSITION","step","roll","INFINITE","stop","setValue","update","elapsed","dstStop","targetSpeed","next","MultiDynamic","dynamics","d","positions","steps","rolls","hasUpdates","dynamic","Slider","container","direction","onUpdate","mousedown","mouseover","handleEvent","type","stopPropagation","__onMouseDown","__onMouseEnter","__onMouseLeave","__onTouchStart","__onMouseMove","__onTouchMove","__onMouseUp","__onTouchEnd","evt","__update","changedTouches","moving","boundingClientRect","getBoundingClientRect","cursor","vertical","pos","size","click","VERTICAL","EventEmitter","HORIZONTAL","EquirectangularAdapter","config","resolution","SPHERE_SEGMENTS","SPHERE_HORIZONTAL_SEGMENTS","reject","useXmpData","textureLoader","loadImage","loader","setProgress","xmpPanoData","__loadXMP","panoData","fullWidth","fullHeight","croppedWidth","croppedHeight","croppedX","croppedY","poseHeading","posePitch","poseRoll","__createEquirectangularTexture","onProgress","loadFile","blob","__loadBlobAsString","binary","indexOf","substring","includes","reader","FileReader","onload","onerror","readAsText","ratio","resizedPanoData","buffer","drawImage","geometry","SphereGeometry","material","MeshBasicMaterial","Mesh","dispose","transparent","AbstractComponent","children","visible","appendChild","removeChild","childIdx","splice","child","refreshUi","every","uiRefresh","isVisible","hide","show","style","display","AbstractButton","navbar","collapsable","tabbable","enabled","supported","collapsed","offsetWidth","icon","__setIcon","lang","title","tabIndex","onClick","checkSupported","supportedOrObject","isSupported","toggleActive","iconActive","refresh","disable","enable","collapse","uncollapse","innerHTML","querySelector","groupId","AutorotateButton","on","off","isAutorotateEnabled","autorotateIdle","resetIdleTimer","toggleAutorotate","play","playActive","CustomButton","random","substr","content","MODE_NOTIF","MODE_PANEL","DescriptionButton","closed","__close","caption","getButton","captionHidden","hasDescription","description","__open","notification","panel","info","DownloadButton","link","href","downloadUrl","download","pop","adapter","FullscreenButton","toggleFullscreen","fullscreenIn","fullscreenOut","MenuButton","__hideMenu","__showMenu","MENU_TEMPLATE","BUTTON_DATA","noMargin","clickHandler","li","buttonId","dataset","menuIcon","buttons","dataKey","menu","button","PressHandler","time","down","getTime","up","getOrientedArrow","arrow","AbstractMoveButton","move","handler","__stopAll","MoveDownButton","MoveLeftButton","MoveRightButton","MoveUpButton","AbstractZoomButton","zoom","ZoomInButton","zoomIn","ZoomOutButton","zoomOut","ZoomRangeButton","mediaMinWidth","zoomRange","zoomValue","slider","__onSliderUpdate","ready","__moveZoomValue","getZoomLevel","once","level","AbstractPlugin","init","DEFAULTS","plugins","loadingImg","loadingTxt","fisheye","minFov","maxFov","defaultZoomLvl","defaultLong","defaultLat","sphereCorrection","moveSpeed","zoomSpeed","autorotateDelay","autorotateSpeed","autorotateLat","moveInertia","mousewheel","mousemove","captureCursor","mousewheelCtrlKey","touchmoveTwoFingers","requestHeaders","canvasBackground","withCredentials","autorotate","fullscreen","twoFingers","ctrlZoom","loadError","keyboard","READONLY_OPTIONS","DEPRECATED_OPTIONS","zoomButtonIncrement","mousewheelSpeed","sphereCorrectionReorder","CONFIG_PARSERS","getConfig","tempConfig","hasOwnProperty","NavbarCaption","contentWidth","setCaption","html","availableWidth","__refreshButton","AVAILABLE_BUTTONS","AVAILABLE_GROUPS","registerButton","defaultPosition","unshift","Navbar","setButtons","item","cleanedButtons","__cleanButtons","buttonCtor","warnNotFound","totalWidth","visibleButtons","collapsableButtons","Loader","clientWidth","tickness","lastChild","inner","round","maxHeight","clearRect","lineWidth","strokeStyle","beginPath","arc","stroke","trigger","Notification","contentId","Overlay","dissmisable","image","text","subtext","preventDefault","PANEL_MIN_WIDTH","Panel","mouseX","mouseY","keyHandler","resizer","closeBtn","wasVisible","focus","__startResize","__resize","touches","clientX","clientY","AbstractService","vector2","Vector2","vector3","Vector3","eulerZero","Euler","DataHelper","fovToZoomLevel","fov","temp","zoomLevelToFov","vFovToHFov","vFov","radToDeg","atan","tan","aspect","speedToDuration","textureCoordsToSphericalCoords","point","relativeX","relativeY","equals","renderer","rotation","meshContainer","sphericalCoordsToVector3","applyEuler","vector3ToSphericalCoords","sphericalCoordsToTextureCoords","relativeLong","relativeLat","z","phi","theta","atan2","viewerCoordsToVector3","viewerPoint","sphereIntersect","getIntersections","userData","vector3ToViewerCoords","vectorClone","project","camera","sphericalCoordsToViewerCoords","raycaster","setFromCamera","intersectObjects","scene","cleanSphereCorrection","pan","tilt","cleanPanoramaPose","EventsHandler","state","moveThreshold","keyboardEnabled","zooming","startMouseX","startMouseY","mouseHistory","pinchDist","ctrlKeyDown","dblclickData","dblclickTimeout","longtouchTimeout","twofingersTimeout","ctrlZoomTimeout","__onResize","autoSize","__onKeyDown","__onKeyUp","__fullscreenToggled","__onMouseWheel","enableKeyboard","disableKeyboard","overlay","e2","isDefaultPrevented","action","__startMove","__stopMove","__move","__moveAbsolute","objectsObservers","viewerPos","intersections","dataHelper","emit","observer","listener","CustomEvent","originalEvent","intersection","find","__click","__cancelLongTouch","__cancelTwoFingersOverlay","__startMoveZoom","__stopMoveZoom","gestureIcon","__moveZoom","mousewheelIcon","delta","force","startKeyboardControl","stopKeyboardControl","__logMouseMove","__stopMoveInertia","norm","animationPromise","longtouch","boundingRect","rightclick","viewerX","viewerY","sphereIntersection","psvSphere","sphericalCoords","objects","o","textureCoords","textureX","textureY","NaN","hFov","currentPosition","rotate","containerRect","Renderer","WebGLRenderer","alpha","antialias","setPixelRatio","domElement","Scene","PerspectiveCamera","Group","Raycaster","canvasContainer","background","setAnimationLoop","__cleanTHREEScene","__onSizeUpdated","__onZoomUpdated","__onPositionUpdated","setSize","updateProjectionMatrix","set","lookAt","copy","multiplyScalar","negate","__renderLoop","idleTime","startAutorotate","render","setPanoramaPose","cleanCorrection","setSphereCorrection","positionProvided","zoomProvided","group","verticalAxis","rotateOnWorldAxis","horizontalAxis","cross","getWorldDirection","normalize","animation","completed","traverse","TextureLoader","FileLoader","setResponseType","setWithCredentials","setRequestHeader","abortLoading","url","lengthComputable","newProgress","total","createElementNS","URL","revokeObjectURL","createObjectURL","preloadPanorama","STATE","NONE","SHOWING","HIDING","Tooltip","__onTransitionEnd","rect","posClass","arrowTop","arrowLeft","__computeTooltipPosition","offset","newPos","propertyName","topBottom","box","TooltipRenderer","testTooltip","tooltip","Cache","Viewer","autorotateEnabled","loadingPromise","getElementById","eventsHandler","__updateSpeeds","__resizeRefresh","resize","opts","setPanorama","performance","reason","getPlugin","pluginId","pluginCtor","getSize","clientHeight","path","transitionAnimation","showLoader","hideError","done","showError","setOptions","rawConfig","setOption","option","disableIdleTimer","stopAutorotate","errorIcon","change","animate","animProperties","tOffset","dZoom","stopAnimation","dim","enterFullscreen","observeObjects","userDataKey"],"mappings":";;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA,SAASA,QAAT,CAAkBC,OAAlB,EAA2B;EACzB,EAAA,IAAA,CAAKA,OAAL,GAAeA,OAAf,CADyB;;IAIzB,IAAI,mBAAA,IAAuBC,KAA3B,EAAkC;EAChCA,IAAAA,KAAK,CAACC,iBAAN,CAAwB,IAAxB,EAA8BH,QAA9B,CAAA,CAA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EACA;EACA;EACA;EACA;EACEC,EAAAA,WAAW,EAAS,aApCA;;EAqCpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,cAAc,EAAM,gBA3CA;;EA4CpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,UAlDA;;EAmDpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,kBAAkB,EAAE,oBAzDA;;EA0DpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,iBAAiB,EAAG,mBAhEA;;EAiEpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cAvEA;;EAwEpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cA9EA;;EA+EpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,SAAS,EAAW,WArFA;;EAsFpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,aAAa,EAAO,eA5FA;;EA6FpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,UAAU,EAAU,YAnGA;;EAoGpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,eAAe,EAAK,iBA1GA;;EA2GpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,gBAAgB,EAAI,kBAjHA;;EAkHpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,KAAK,EAAe,OAvHA;;EAwHpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,MAAM,EAAc,QA7HA;;EA8HpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,iBAAiB,EAAG,mBApIA;;EAqIpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cA3IA;;EA4IpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cAnJA;;EAoJpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cA1JA;;EA2JpB;EACF;EACA;EACA;EACA;EACEC,EAAA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AKsD,MAAL,CAAY6L,SAAZ,GAAwB,EAApD,CAAA,CAAA;EACA,IAAA,IAAA,CAAKpO,QAAL,CAAcb,QAAd,CAAuBF,QAAvB,CAAgC9D,KAAK,CAACC,SAAN,CAAgBC,QAAhB,CAAyB,IAAKkH,CAAAA,MAAL,CAAY4L,SAAZ,GAAwB,EAAjD,CAAhC,CAAA,CAAA;KAz7BJ,CAAA;;EAAA,EAAA,OAAA,MAAA,CAAA;EAAA,CAAA,CAA4B/L,mBAA5B;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"photo-sphere-viewer.js","sources":["../src/PSVError.js","../src/adapters/AbstractAdapter.js","../src/data/constants.js","../src/data/system.js","../src/utils/browser.js","../src/utils/math.js","../src/utils/misc.js","../src/utils/psv.js","../src/utils/Animation.js","../src/utils/Dynamic.js","../src/utils/MultiDynamic.js","../src/utils/Slider.js","../src/utils/index.js","../src/adapters/equirectangular/index.js","../src/components/AbstractComponent.js","../src/buttons/AbstractButton.js","../src/buttons/AutorotateButton.js","../src/buttons/CustomButton.js","../src/buttons/DescriptionButton.js","../src/buttons/DownloadButton.js","../src/buttons/FullscreenButton.js","../src/buttons/MenuButton.js","../src/utils/PressHandler.js","../src/buttons/AbstractMoveButton.js","../src/buttons/MoveDownButton.js","../src/buttons/MoveLeftButton.js","../src/buttons/MoveRightButton.js","../src/buttons/MoveUpButton.js","../src/buttons/AbstractZoomButton.js","../src/buttons/ZoomInButton.js","../src/buttons/ZoomOutButton.js","../src/buttons/ZoomRangeButton.js","../src/plugins/AbstractPlugin.js","../src/data/config.js","../src/components/NavbarCaption.js","../src/components/Navbar.js","../src/components/Loader.js","../src/components/Notification.js","../src/components/Overlay.js","../src/components/Panel.js","../src/services/AbstractService.js","../src/services/DataHelper.js","../src/services/EventsHandler.js","../src/services/Renderer.js","../src/services/TextureLoader.js","../src/components/Tooltip.js","../src/services/TooltipRenderer.js","../src/Viewer.js"],"sourcesContent":["/**\n * @summary Custom error used in the lib\n * @param {string} message\n * @constructor\n * @memberOf PSV\n */\nfunction PSVError(message) {\n this.message = message;\n\n // Use V8's native method if available, otherwise fallback\n if ('captureStackTrace' in Error) {\n Error.captureStackTrace(this, PSVError);\n }\n else {\n this.stack = (new Error()).stack;\n }\n}\n\nPSVError.prototype = Object.create(Error.prototype);\nPSVError.prototype.name = 'PSVError';\nPSVError.prototype.constructor = PSVError;\n\nexport { PSVError };\n","import { PSVError } from '../PSVError';\n\n/**\n * @namespace PSV.adapters\n */\n\n/**\n * @summary Base adapters class\n * @memberof PSV.adapters\n * @abstract\n */\nexport class AbstractAdapter {\n\n /**\n * @summary Unique identifier of the adapter\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @summary Indicates if the adapter supports panorama download natively\n * @type {boolean}\n * @readonly\n * @static\n */\n static supportsDownload = false;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n }\n\n /**\n * @summary Destroys the adapter\n */\n destroy() {\n delete this.psv;\n }\n\n /**\n * @summary Indicates if the adapter supports transitions between panoramas\n * @param {*} panorama\n * @return {boolean}\n */\n supportsTransition(panorama) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n * @summary Indicates if the adapter supports preload of a panorama\n * @param {*} panorama\n * @return {boolean}\n */\n supportsPreload(panorama) { // eslint-disable-line no-unused-vars\n return false;\n }\n\n /**\n * @abstract\n * @summary Loads the panorama texture(s)\n * @param {*} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData) { // eslint-disable-line no-unused-vars\n throw new PSVError('loadTexture not implemented');\n }\n\n /**\n * @abstract\n * @summary Creates the cube mesh\n * @param {number} [scale=1]\n * @returns {external:THREE.Mesh}\n */\n createMesh(scale = 1) { // eslint-disable-line no-unused-vars\n throw new PSVError('createMesh not implemented');\n }\n\n /**\n * @abstract\n * @summary Applies the texture to the mesh\n * @param {external:THREE.Mesh} mesh\n * @param {PSV.TextureData} textureData\n * @param {boolean} [transition=false]\n */\n setTexture(mesh, textureData, transition = false) { // eslint-disable-line no-unused-vars\n throw new PSVError('setTexture not implemented');\n }\n\n /**\n * @abstract\n * @summary Changes the opacity of the mesh\n * @param {external:THREE.Mesh} mesh\n * @param {number} opacity\n */\n setTextureOpacity(mesh, opacity) { // eslint-disable-line no-unused-vars\n throw new PSVError('setTextureOpacity not implemented');\n }\n\n /**\n * @abstract\n * @summary Clear a loaded texture from memory\n * @param {PSV.TextureData} textureData\n */\n disposeTexture(textureData) { // eslint-disable-line no-unused-vars\n throw new PSVError('disposeTexture not implemented');\n }\n\n}\n","/**\n * @namespace PSV.constants\n */\n\n/**\n * @summary Default duration of the transition between panoramas\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const DEFAULT_TRANSITION = 1500;\n\n/**\n * @summary Number of pixels bellow which a mouse move will be considered as a click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const MOVE_THRESHOLD = 4;\n\n/**\n * @summary Delay in milliseconds between two clicks to consider a double click\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const DBLCLICK_DELAY = 300;\n\n/**\n * @summary Delay in milliseconds to emulate a long touch\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const LONGTOUCH_DELAY = 500;\n\n/**\n * @summary Delay in milliseconds to for the two fingers overlay to appear\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const TWOFINGERSOVERLAY_DELAY = 100;\n\n/**\n * @summary Duration in milliseconds of the \"ctrl zoom\" overlay\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const CTRLZOOM_TIMEOUT = 2000;\n\n/**\n * @summary Time size of the mouse position history used to compute inertia\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const INERTIA_WINDOW = 300;\n\n/**\n * @summary Radius of the THREE.SphereGeometry, Half-length of the THREE.BoxGeometry\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const SPHERE_RADIUS = 10;\n\n/**\n * @summary Property name added to viewer element\n * @memberOf PSV.constants\n * @type {string}\n * @constant\n */\nexport const VIEWER_DATA = 'photoSphereViewer';\n\n/**\n * @summary Property added the the main Mesh object\n * @memberOf PSV.constants\n * @type {string}\n * @constant\n */\nexport const MESH_USER_DATA = 'psvSphere';\n\n/**\n * @summary Available actions\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const ACTIONS = {\n ROTATE_LAT_UP : 'rotateLatitudeUp',\n ROTATE_LAT_DOWN : 'rotateLatitudeDown',\n ROTATE_LONG_RIGHT: 'rotateLongitudeRight',\n ROTATE_LONG_LEFT : 'rotateLongitudeLeft',\n ZOOM_IN : 'zoomIn',\n ZOOM_OUT : 'zoomOut',\n TOGGLE_AUTOROTATE: 'toggleAutorotate',\n};\n\n/**\n * @summary Available events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event autorotate\n * @memberof PSV\n * @summary Triggered when the automatic rotation is enabled/disabled\n * @param {boolean} enabled\n */\n AUTOROTATE : 'autorotate',\n /**\n * @event before-render\n * @memberof PSV\n * @summary Triggered before a render, used to modify the view\n * @param {number} timestamp - time provided by requestAnimationFrame\n * @param {number} elapsed - time elapsed from the previous frame\n */\n BEFORE_RENDER : 'before-render',\n /**\n * @event before-rotate\n * @memberOf PSV\n * @summary Triggered before a rotate operation, can be cancelled\n * @param {PSV.ExtendedPosition}\n */\n BEFORE_ROTATE : 'before-rotate',\n /**\n * @event click\n * @memberof PSV\n * @summary Triggered when the user clicks on the viewer (everywhere excluding the navbar and the side panel)\n * @param {PSV.ClickData} data\n */\n CLICK : 'click',\n /**\n * @event close-panel\n * @memberof PSV\n * @summary Triggered when the panel is closed\n * @param {string} [id]\n */\n CLOSE_PANEL : 'close-panel',\n /**\n * @event config-changed\n * @memberOf PSV\n * @summary Triggered after a call to setOption/setOptions\n * @param {string[]} name of changed options\n */\n CONFIG_CHANGED : 'config-changed',\n /**\n * @event dblclick\n * @memberof PSV\n * @summary Triggered when the user double clicks on the viewer. The simple `click` event is always fired before `dblclick`\n * @param {PSV.ClickData} data\n */\n DOUBLE_CLICK : 'dblclick',\n /**\n * @event fullscreen-updated\n * @memberof PSV\n * @summary Triggered when the fullscreen mode is enabled/disabled\n * @param {boolean} enabled\n */\n FULLSCREEN_UPDATED: 'fullscreen-updated',\n /**\n * @event hide-notification\n * @memberof PSV\n * @summary Triggered when the notification is hidden\n * @param {string} [id]\n */\n HIDE_NOTIFICATION : 'hide-notification',\n /**\n * @event hide-overlay\n * @memberof PSV\n * @summary Triggered when the overlay is hidden\n * @param {string} [id]\n */\n HIDE_OVERLAY : 'hide-overlay',\n /**\n * @event hide-tooltip\n * @memberof PSV\n * @summary Triggered when the tooltip is hidden\n * @param {*} Data associated to this tooltip\n */\n HIDE_TOOLTIP : 'hide-tooltip',\n /**\n * @event key-press\n * @memberof PSV\n * @summary Triggered when a key is pressed, can be cancelled\n * @param {string} key\n */\n KEY_PRESS : 'key-press',\n /**\n * @event load-progress\n * @memberof PSV\n * @summary Triggered when the loader value changes\n * @param {number} value from 0 to 100\n */\n LOAD_PROGRESS : 'load-progress',\n /**\n * @event open-panel\n * @memberof PSV\n * @summary Triggered when the panel is opened\n * @param {string} [id]\n */\n OPEN_PANEL : 'open-panel',\n /**\n * @event panorama-loaded\n * @memberof PSV\n * @summary Triggered when a panorama image has been loaded\n * @param {PSV.TextureData} textureData\n */\n PANORAMA_LOADED : 'panorama-loaded',\n /**\n * @event position-updated\n * @memberof PSV\n * @summary Triggered when the view longitude and/or latitude changes\n * @param {PSV.Position} position\n */\n POSITION_UPDATED : 'position-updated',\n /**\n * @event ready\n * @memberof PSV\n * @summary Triggered when the panorama image has been loaded and the viewer is ready to perform the first render\n */\n READY : 'ready',\n /**\n * @event render\n * @memberof PSV\n * @summary Triggered on each viewer render, **this event is triggered very often**\n */\n RENDER : 'render',\n /**\n * @event show-notification\n * @memberof PSV\n * @summary Triggered when the notification is shown\n * @param {string} [id]\n */\n SHOW_NOTIFICATION : 'show-notification',\n /**\n * @event show-overlay\n * @memberof PSV\n * @summary Triggered when the overlay is shown\n * @param {string} [id]\n */\n SHOW_OVERLAY : 'show-overlay',\n /**\n * @event show-tooltip\n * @memberof PSV\n * @summary Triggered when the tooltip is shown\n * @param {*} Data associated to this tooltip\n * @param {PSV.components.Tooltip} Instance of the tooltip\n */\n SHOW_TOOLTIP : 'show-tooltip',\n /**\n * @event size-updated\n * @memberof PSV\n * @summary Triggered when the viewer size changes\n * @param {PSV.Size} size\n */\n SIZE_UPDATED : 'size-updated',\n /**\n * @event stop-all\n * @memberof PSV\n * @summary Triggered when all current animations are stopped\n */\n STOP_ALL : 'stop-all',\n /**\n * @event zoom-updated\n * @memberof PSV\n * @summary Triggered when the zoom level changes\n * @param {number} zoomLevel\n */\n ZOOM_UPDATED : 'zoom-updated',\n};\n\n/**\n * @summary Available change events names\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const CHANGE_EVENTS = {\n /**\n * @event get-animate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of an animation\n */\n GET_ANIMATE_POSITION: 'get-animate-position',\n /**\n * @event get-rotate-position\n * @memberof PSV\n * @param {Position} position\n * @returns {Position}\n * @summary Called to alter the target position of a rotation\n */\n GET_ROTATE_POSITION : 'get-rotate-position',\n};\n\n/**\n * @summary Special events emitted to listener using {@link Viewer#observeObjects}\n * @memberOf PSV.constants\n * @constant\n * @package\n */\nexport const OBJECT_EVENTS = {\n ENTER_OBJECT: 'enter-object',\n HOVER_OBJECT: 'hover-object',\n LEAVE_OBJECT: 'leave-object',\n};\n\n/**\n * @summary Internal identifiers for various stuff\n * @memberOf PSV.constants\n * @enum {string}\n * @constant\n */\nexport const IDS = {\n MENU : 'menu',\n TWO_FINGERS: 'twoFingers',\n CTRL_ZOOM : 'ctrlZoom',\n ERROR : 'error',\n DESCRIPTION: 'description',\n};\n\n/* eslint-disable */\n// @formatter:off\n/**\n * @summary Collection of easing functions\n * @memberOf PSV.constants\n * @see {@link https://gist.github.com/frederickk/6165768}\n * @type {Object}\n * @constant\n */\nexport const EASINGS = {\n linear : (t) => t,\n\n inQuad : (t) => t*t,\n outQuad : (t) => t*(2-t),\n inOutQuad : (t) => t<.5 ? 2*t*t : -1+(4-2*t)*t,\n\n inCubic : (t) => t*t*t,\n outCubic : (t) => (--t)*t*t+1,\n inOutCubic: (t) => t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1,\n\n inQuart : (t) => t*t*t*t,\n outQuart : (t) => 1-(--t)*t*t*t,\n inOutQuart: (t) => t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t,\n\n inQuint : (t) => t*t*t*t*t,\n outQuint : (t) => 1+(--t)*t*t*t*t,\n inOutQuint: (t) => t<.5 ? 16*t*t*t*t*t : 1+16*(--t)*t*t*t*t,\n\n inSine : (t) => 1-Math.cos(t*(Math.PI/2)),\n outSine : (t) => Math.sin(t*(Math.PI/2)),\n inOutSine : (t) => .5-.5*Math.cos(Math.PI*t),\n\n inExpo : (t) => Math.pow(2, 10*(t-1)),\n outExpo : (t) => 1-Math.pow(2, -10*t),\n inOutExpo : (t) => (t=t*2-1)<0 ? .5*Math.pow(2, 10*t) : 1-.5*Math.pow(2, -10*t),\n\n inCirc : (t) => 1-Math.sqrt(1-t*t),\n outCirc : (t) => Math.sqrt(1-(t-1)*(t-1)),\n inOutCirc : (t) => (t*=2)<1 ? .5-.5*Math.sqrt(1-t*t) : .5+.5*Math.sqrt(1-(t-=2)*t)\n};\n// @formatter:on\n/* eslint-enable */\n\n/**\n * @summary Subset of key codes\n * @memberOf PSV.constants\n * @type {Object}\n * @constant\n */\nexport const KEY_CODES = {\n Enter : 'Enter',\n Control : 'Control',\n Escape : 'Escape',\n Space : ' ',\n PageUp : 'PageUp',\n PageDown : 'PageDown',\n ArrowLeft : 'ArrowLeft',\n ArrowUp : 'ArrowUp',\n ArrowRight: 'ArrowRight',\n ArrowDown : 'ArrowDown',\n Delete : 'Delete',\n Plus : '+',\n Minus : '-',\n};\n","import { PSVError } from '../PSVError';\nimport { VIEWER_DATA } from './constants';\n\nconst LOCALSTORAGE_TOUCH_SUPPORT = `${VIEWER_DATA}_touchSupport`;\n\n/**\n * @summary General information about the system\n * @constant\n * @memberOf PSV\n * @property {boolean} loaded - Indicates if the system data has been loaded\n * @property {Function} load - Loads the system if not already loaded\n * @property {number} pixelRatio\n * @property {boolean} isWebGLSupported\n * @property {number} maxCanvasWidth\n * @property {string} mouseWheelEvent\n * @property {string} fullscreenEvent\n * @property {Function} getMaxCanvasWidth - Returns the max width of a canvas allowed by the browser\n * @property {{initial: boolean, promise: Promise}} isTouchEnabled\n */\nexport const SYSTEM = {\n loaded : false,\n pixelRatio : 1,\n isWebGLSupported: false,\n isTouchEnabled : null,\n maxTextureWidth : 0,\n mouseWheelEvent : null,\n fullscreenEvent : null,\n};\n\n/**\n * @summary Loads the system if not already loaded\n */\nSYSTEM.load = () => {\n if (!SYSTEM.loaded) {\n const ctx = getWebGLCtx();\n\n SYSTEM.loaded = true;\n SYSTEM.pixelRatio = window.devicePixelRatio || 1;\n SYSTEM.isWebGLSupported = ctx != null;\n SYSTEM.isTouchEnabled = isTouchEnabled();\n SYSTEM.maxTextureWidth = getMaxTextureWidth(ctx);\n SYSTEM.mouseWheelEvent = getMouseWheelEvent();\n SYSTEM.fullscreenEvent = getFullscreenEvent();\n }\n};\n\nlet maxCanvasWidth = null;\nSYSTEM.getMaxCanvasWidth = () => {\n if (maxCanvasWidth === null) {\n maxCanvasWidth = getMaxCanvasWidth(SYSTEM.maxTextureWidth);\n }\n return maxCanvasWidth;\n};\n\n/**\n * @summary Tries to return a canvas webgl context\n * @returns {WebGLRenderingContext}\n * @private\n */\nfunction getWebGLCtx() {\n const canvas = document.createElement('canvas');\n const names = ['webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'];\n let context = null;\n\n if (!canvas.getContext) {\n return null;\n }\n\n if (names.some((name) => {\n try {\n context = canvas.getContext(name);\n return context !== null;\n }\n catch (e) {\n return false;\n }\n })) {\n return context;\n }\n else {\n return null;\n }\n}\n\n/**\n * @summary Detects if the user is using a touch screen\n * @returns {{initial: boolean, promise: Promise}}\n * @private\n */\nfunction isTouchEnabled() {\n let initial = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);\n if (LOCALSTORAGE_TOUCH_SUPPORT in localStorage) {\n initial = localStorage[LOCALSTORAGE_TOUCH_SUPPORT] === 'true';\n }\n\n const promise = new Promise((resolve) => {\n let clear;\n\n const listenerMouse = () => {\n clear();\n localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = false;\n resolve(false);\n };\n\n const listenerTouch = () => {\n clear();\n localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = true;\n resolve(true);\n };\n\n const listenerTimeout = () => {\n clear();\n localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = initial;\n resolve(initial);\n };\n\n window.addEventListener('mousedown', listenerMouse, false);\n window.addEventListener('touchstart', listenerTouch, false);\n const listenerTimeoutId = setTimeout(listenerTimeout, 10000);\n\n clear = () => {\n window.removeEventListener('mousedown', listenerMouse);\n window.removeEventListener('touchstart', listenerTouch);\n clearTimeout(listenerTimeoutId);\n };\n });\n\n return { initial, promise };\n}\n\n/**\n * @summary Gets max texture width in WebGL context\n * @returns {number}\n * @private\n */\nfunction getMaxTextureWidth(ctx) {\n if (ctx !== null) {\n return ctx.getParameter(ctx.MAX_TEXTURE_SIZE);\n }\n else {\n return 0;\n }\n}\n\n/**\n * @summary Gets max canvas width supported by the browser.\n * We only test powers of 2 and height = width / 2 because that's what we need to generate WebGL textures\n * @param maxWidth\n * @return {number}\n * @private\n */\nfunction getMaxCanvasWidth(maxWidth) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = maxWidth;\n canvas.height = maxWidth / 2;\n\n while (canvas.width > 1024) {\n ctx.fillStyle = 'white';\n ctx.fillRect(0, 0, 1, 1);\n\n try {\n if (ctx.getImageData(0, 0, 1, 1).data[0] > 0) {\n return canvas.width;\n }\n }\n catch (e) {\n // continue\n }\n\n canvas.width /= 2;\n canvas.height /= 2;\n }\n\n throw new PSVError('Unable to detect system capabilities');\n}\n\n/**\n * @summary Gets the event name for mouse wheel\n * @returns {string}\n * @private\n */\nfunction getMouseWheelEvent() {\n if ('onwheel' in document.createElement('div')) { // Modern browsers support \"wheel\"\n return 'wheel';\n }\n else if (document.onmousewheel !== undefined) { // Webkit and IE support at least \"mousewheel\"\n return 'mousewheel';\n }\n else { // let's assume that remaining browsers are older Firefox\n return 'DOMMouseScroll';\n }\n}\n\n/**\n * @summary Map between fullsceen method and fullscreen event name\n * @type {Object}\n * @readonly\n * @private\n */\nconst FULLSCREEN_EVT_MAP = {\n exitFullscreen : 'fullscreenchange',\n webkitExitFullscreen: 'webkitfullscreenchange',\n mozCancelFullScreen : 'mozfullscreenchange',\n msExitFullscreen : 'MSFullscreenChange',\n};\n\n\n/**\n * @summary Gets the event name for fullscreen\n * @returns {string}\n * @private\n */\nfunction getFullscreenEvent() {\n const validExits = Object.keys(FULLSCREEN_EVT_MAP).filter(exit => exit in document);\n\n if (validExits.length) {\n return FULLSCREEN_EVT_MAP[validExits[0]];\n }\n else {\n return null;\n }\n}\n","/**\n * @summary Toggles a CSS class\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} element\n * @param {string} className\n * @param {boolean} [active] - forced state\n */\nexport function toggleClass(element, className, active) {\n if (active === undefined) {\n element.classList.toggle(className);\n }\n else if (active && !element.classList.contains(className)) {\n element.classList.add(className);\n }\n else if (!active) {\n element.classList.remove(className);\n }\n}\n\n/**\n * @summary Adds one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function addClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, true);\n });\n }\n}\n\n/**\n * @summary Removes one or several CSS classes to an element\n * @memberOf PSV.utils\n * @param {HTMLElement} element\n * @param {string} className\n */\nexport function removeClasses(element, className) {\n if (className) {\n className.split(' ').forEach((name) => {\n toggleClass(element, name, false);\n });\n }\n}\n\n/**\n * @summary Searches if an element has a particular parent at any level including itself\n * @memberOf PSV.utils\n * @param {HTMLElement} el\n * @param {HTMLElement} parent\n * @returns {boolean}\n */\nexport function hasParent(el, parent) {\n let test = el;\n\n do {\n if (test === parent) {\n return true;\n }\n test = test.parentNode;\n } while (test);\n\n return false;\n}\n\n/**\n * @summary Gets the closest parent (can by itself)\n * @memberOf PSV.utils\n * @param {HTMLElement|SVGElement} el\n * @param {string} selector\n * @returns {HTMLElement}\n */\nexport function getClosest(el, selector) {\n // When el is document or window, the matches does not exist\n if (!el.matches) {\n return null;\n }\n\n let test = el;\n\n do {\n if (test.matches(selector)) {\n return test;\n }\n test = test instanceof SVGElement ? test.parentNode : test.parentElement;\n } while (test);\n\n return null;\n}\n\n/**\n * @summary Gets the position of an element in the viewer without reflow\n * @description Will gives the same result as getBoundingClientRect() as soon as there are no CSS transforms\n * @memberOf PSV.utils\n * @param {HTMLElement} el\n * @return {{left: number, top: number}}\n */\nexport function getPosition(el) {\n let left = 0;\n let top = 0;\n let test = el;\n\n while (test) {\n left += (test.offsetLeft - test.scrollLeft + test.clientLeft);\n top += (test.offsetTop - test.scrollTop + test.clientTop);\n test = test.offsetParent;\n }\n\n return { left, top };\n}\n\n/**\n * @summary Detects if fullscreen is enabled\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @returns {boolean}\n */\nexport function isFullscreenEnabled(elt) {\n return (document.fullscreenElement || document.webkitFullscreenElement) === elt;\n}\n\n/**\n * @summary Enters fullscreen mode\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n */\nexport function requestFullscreen(elt) {\n (elt.requestFullscreen || elt.webkitRequestFullscreen).call(elt);\n}\n\n/**\n * @summary Exits fullscreen mode\n * @memberOf PSV.utils\n */\nexport function exitFullscreen() {\n (document.exitFullscreen || document.webkitExitFullscreen).call(document);\n}\n\n/**\n * @summary Gets an element style\n * @memberOf PSV.utils\n * @param {HTMLElement} elt\n * @param {string} prop\n * @returns {*}\n */\nexport function getStyle(elt, prop) {\n return window.getComputedStyle(elt, null)[prop];\n}\n\n/**\n * @summary Normalize mousewheel values accross browsers\n * @memberOf PSV.utils\n * @description From Facebook's Fixed Data Table\n * {@link https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js}\n * @copyright Facebook\n * @param {WheelEvent} event\n * @returns {{spinX: number, spinY: number, pixelX: number, pixelY: number}}\n */\nexport function normalizeWheel(event) {\n const PIXEL_STEP = 10;\n const LINE_HEIGHT = 40;\n const PAGE_HEIGHT = 800;\n\n let spinX = 0;\n let spinY = 0;\n let pixelX = 0;\n let pixelY = 0;\n\n // Legacy\n if ('detail' in event) {\n spinY = event.detail;\n }\n if ('wheelDelta' in event) {\n spinY = -event.wheelDelta / 120;\n }\n if ('wheelDeltaY' in event) {\n spinY = -event.wheelDeltaY / 120;\n }\n if ('wheelDeltaX' in event) {\n spinX = -event.wheelDeltaX / 120;\n }\n\n // side scrolling on FF with DOMMouseScroll\n if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {\n spinX = spinY;\n spinY = 0;\n }\n\n pixelX = spinX * PIXEL_STEP;\n pixelY = spinY * PIXEL_STEP;\n\n if ('deltaY' in event) {\n pixelY = event.deltaY;\n }\n if ('deltaX' in event) {\n pixelX = event.deltaX;\n }\n\n if ((pixelX || pixelY) && event.deltaMode) {\n // delta in LINE units\n if (event.deltaMode === 1) {\n pixelX *= LINE_HEIGHT;\n pixelY *= LINE_HEIGHT;\n }\n // delta in PAGE units\n else {\n pixelX *= PAGE_HEIGHT;\n pixelY *= PAGE_HEIGHT;\n }\n }\n\n // Fall-back if spin cannot be determined\n if (pixelX && !spinX) {\n spinX = (pixelX < 1) ? -1 : 1;\n }\n if (pixelY && !spinY) {\n spinY = (pixelY < 1) ? -1 : 1;\n }\n\n return { spinX, spinY, pixelX, pixelY };\n}\n","/**\n * @summary Ensures that a number is in a given interval\n * @memberOf PSV.utils\n * @param {number} x\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport function bound(x, min, max) {\n return Math.max(min, Math.min(max, x));\n}\n\n/**\n * @summary Ensure a value is within 0 and `max`\n * @param {number} value\n * @param {number} max\n * @return {number}\n */\nexport function loop(value, max) {\n let result = value % max;\n\n if (result < 0) {\n result += max;\n }\n\n return result;\n}\n\n/**\n * @summary Checks if a value is an integer\n * @memberOf PSV.utils\n * @param {*} value\n * @returns {boolean}\n */\nexport function isInteger(value) {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value;\n}\n\n/**\n * @summary Tests if a number is power of two\n * @memberOf PSV.utils\n * @param {number} x\n * @return {boolean}\n */\nexport function isPowerOfTwo(x) {\n return (Math.log(x) / Math.log(2)) % 1 === 0;\n}\n\n/**\n * @summary Computes the sum of an array\n * @memberOf PSV.utils\n * @param {number[]} array\n * @returns {number}\n */\nexport function sum(array) {\n return array.reduce((a, b) => a + b, 0);\n}\n\n/**\n * @summary Computes the distance between two points\n * @memberOf PSV.utils\n * @param {PSV.Point} p1\n * @param {PSV.Point} p2\n * @returns {number}\n */\nexport function distance(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\n\n/**\n * @summary Compute the shortest offset between two longitudes\n * @memberOf PSV.utils\n * @param {number} from\n * @param {number} to\n * @returns {number}\n */\nexport function getShortestArc(from, to) {\n const tCandidates = [\n 0, // direct\n Math.PI * 2, // clock-wise cross zero\n -Math.PI * 2, // counter-clock-wise cross zero\n ];\n\n return tCandidates.reduce((value, candidate) => {\n const newCandidate = to - from + candidate;\n return Math.abs(newCandidate) < Math.abs(value) ? newCandidate : value;\n }, Infinity);\n}\n\n/**\n * @summary Computes the angle between the current position and a target position\n * @memberOf PSV.utils\n * @param {PSV.Position} position1\n * @param {PSV.Position} position2\n * @returns {number}\n */\nexport function getAngle(position1, position2) {\n return Math.acos(\n Math.cos(position1.latitude)\n * Math.cos(position2.latitude)\n * Math.cos(position1.longitude - position2.longitude)\n + Math.sin(position1.latitude)\n * Math.sin(position2.latitude)\n );\n}\n\n/**\n * @summary Returns the distance between two points on a sphere of radius one\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @memberOf PSV.utils\n * @param {number[]} p1\n * @param {number[]} p2\n * @returns {number}\n */\nexport function greatArcDistance(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const x = (λ2 - λ1) * Math.cos((φ1 + φ2) / 2);\n const y = (φ2 - φ1);\n return Math.sqrt(x * x + y * y);\n}\n","/**\n * @summary Transforms a string to dash-case {@link https://github.com/shahata/dasherize}\n * @memberOf PSV.utils\n * @param {string} str\n * @returns {string}\n */\nexport function dasherize(str) {\n return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (s, i) => {\n return (i > 0 ? '-' : '') + s.toLowerCase();\n });\n}\n\n/**\n * @summary Returns a function, that, when invoked, will only be triggered at most once during a given window of time.\n * @memberOf PSV.utils\n * @copyright underscore.js - modified by Clément Prévost {@link http://stackoverflow.com/a/27078401}\n * @param {Function} func\n * @param {number} wait\n * @returns {Function}\n */\nexport function throttle(func, wait) {\n /* eslint-disable */\n let self, args, result;\n let timeout;\n let previous = 0;\n const later = function() {\n previous = Date.now();\n timeout = undefined;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n };\n return function() {\n const now = Date.now();\n if (!previous) {\n previous = now;\n }\n const remaining = wait - (now - previous);\n self = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n previous = now;\n result = func.apply(self, args);\n if (!timeout) {\n self = args = null;\n }\n }\n else if (!timeout) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n /* eslint-enable */\n}\n\n/**\n * @summary Test if an object is a plain object\n * @memberOf PSV.utils\n * @description Test if an object is a plain object, i.e. is constructed\n * by the built-in Object constructor and inherits directly from Object.prototype\n * or null. Some built-in objects pass the test, e.g. Math which is a plain object\n * and some host or exotic objects may pass also.\n * {@link http://stackoverflow.com/a/5878101/1207670}\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isPlainObject(obj) {\n // Basic check for Type object that's not null\n if (typeof obj === 'object' && obj !== null) {\n // If Object.getPrototypeOf supported, use it\n if (typeof Object.getPrototypeOf === 'function') {\n const proto = Object.getPrototypeOf(obj);\n return proto === Object.prototype || proto === null;\n }\n\n // Otherwise, use internal class\n // This should be reliable as if getPrototypeOf not supported, is pre-ES5\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n // Not an object\n return false;\n}\n\n/**\n * @summary Merges the enumerable attributes of two objects\n * @memberOf PSV.utils\n * @description Replaces arrays and alters the target object.\n * @copyright Nicholas Fisher \n * @param {Object} target\n * @param {Object} src\n * @returns {Object} target\n */\nexport function deepmerge(target, src) {\n /* eslint-disable */\n let first = src;\n\n return (function merge(target, src) {\n if (Array.isArray(src)) {\n if (!target || !Array.isArray(target)) {\n target = [];\n }\n else {\n target.length = 0;\n }\n src.forEach(function(e, i) {\n target[i] = merge(null, e);\n });\n }\n else if (typeof src === 'object') {\n if (!target || Array.isArray(target)) {\n target = {};\n }\n Object.keys(src).forEach(function(key) {\n if (typeof src[key] !== 'object' || !src[key] || !isPlainObject(src[key])) {\n target[key] = src[key];\n }\n else if (src[key] != first) {\n if (!target[key]) {\n target[key] = merge(null, src[key]);\n }\n else {\n merge(target[key], src[key]);\n }\n }\n });\n }\n else {\n target = src;\n }\n\n return target;\n }(target, src));\n /* eslint-enable */\n}\n\n/**\n * @summary Deeply clones an object\n * @memberOf PSV.utils\n * @param {Object} src\n * @returns {Object}\n */\nexport function clone(src) {\n return deepmerge(null, src);\n}\n\n/**\n * @summery Test of an object is empty\n * @memberOf PSV.utils\n * @param {object} obj\n * @returns {boolean}\n */\nexport function isEmpty(obj) {\n return !obj || (Object.keys(obj).length === 0 && obj.constructor === Object);\n}\n\n/**\n * @summary Loops over enumerable properties of an object\n * @memberOf PSV.utils\n * @param {Object} object\n * @param {Function} callback\n */\nexport function each(object, callback) {\n Object.keys(object).forEach((key) => {\n callback(object[key], key);\n });\n}\n\n/**\n * @summary Returns if a valu is null or undefined\n * @memberOf PSV.utils\n * @param {*} val\n * @return {boolean}\n */\nexport function isNil(val) {\n return val === null || val === undefined;\n}\n\n/**\n * @summary Returns the first non null non undefined parameter\n * @memberOf PSV.utils\n * @param {*} values\n * @return {*}\n */\nexport function firstNonNull(...values) {\n for (const val of values) {\n if (!isNil(val)) {\n return val;\n }\n }\n\n return undefined;\n}\n\n/**\n * @summary Returns deep equality between objects\n * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9}\n * @param obj1\n * @param obj2\n * @return {boolean}\n * @private\n */\nexport function deepEqual(obj1, obj2) {\n if (obj1 === obj2) {\n return true;\n }\n else if (isObject(obj1) && isObject(obj2)) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop of Object.keys(obj1)) {\n if (!deepEqual(obj1[prop], obj2[prop])) {\n return false;\n }\n }\n return true;\n }\n else {\n return false;\n }\n}\n\nfunction isObject(obj) {\n return typeof obj === 'object' && obj != null;\n}\n\n","import * as THREE from 'three';\nimport { PSVError } from '../PSVError';\nimport { bound, loop } from './math';\n\n/**\n * @summary Returns the plugin constructor from the imported object\n * For retrocompatibility with previous default exports\n * @memberOf PSV.utils\n * @package\n */\nexport function pluginInterop(plugin, target) {\n if (plugin) {\n for (const [, p] of [['_', plugin], ...Object.entries(plugin)]) {\n if (p.prototype instanceof target) {\n return p;\n }\n }\n }\n return null;\n}\n\n/**\n * @summary Builds an Error with name 'AbortError'\n * @memberOf PSV.utils\n * @return {Error}\n */\nexport function getAbortError() {\n const error = new Error('Loading was aborted.');\n error.name = 'AbortError';\n return error;\n}\n\n/**\n * @summary Tests if an Error has name 'AbortError'\n * @memberOf PSV.utils\n * @param {Error} err\n * @return {boolean}\n */\nexport function isAbortError(err) {\n return err?.name === 'AbortError';\n}\n\n/**\n * @summary Displays a warning in the console\n * @memberOf PSV.utils\n * @param {string} message\n */\nexport function logWarn(message) {\n console.warn(`PhotoSphereViewer: ${message}`);\n}\n\n/**\n * @summary Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude\n * @memberOf PSV.utils\n * @param {object} object\n * @returns {boolean}\n */\nexport function isExtendedPosition(object) {\n return [['x', 'y'], ['longitude', 'latitude']].some(([key1, key2]) => {\n return object[key1] !== undefined && object[key2] !== undefined;\n });\n}\n\n/**\n * @summary Returns the value of a given attribute in the panorama metadata\n * @memberOf PSV.utils\n * @param {string} data\n * @param {string} attr\n * @returns (number)\n */\nexport function getXMPValue(data, attr) {\n // XMP data are stored in children\n let result = data.match('(.*)');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n // XMP data are stored in attributes\n result = data.match('GPano:' + attr + '=\"(.*?)\"');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n return null;\n}\n\n/**\n * @readonly\n * @private\n * @type {{top: string, left: string, bottom: string, center: string, right: string}}\n */\nconst CSS_POSITIONS = {\n top : '0%',\n bottom: '100%',\n left : '0%',\n right : '100%',\n center: '50%',\n};\n\n/**\n * @summary Translate CSS values like \"top center\" or \"10% 50%\" as top and left positions\n * @memberOf PSV.utils\n * @description The implementation is as close as possible to the \"background-position\" specification\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}\n * @param {string|PSV.Point} value\n * @returns {PSV.Point}\n */\nexport function parsePosition(value) {\n if (!value) {\n return { x: 0.5, y: 0.5 };\n }\n\n if (typeof value === 'object') {\n return value;\n }\n\n let tokens = value.toLocaleLowerCase().split(' ').slice(0, 2);\n\n if (tokens.length === 1) {\n if (CSS_POSITIONS[tokens[0]] !== undefined) {\n tokens = [tokens[0], 'center'];\n }\n else {\n tokens = [tokens[0], tokens[0]];\n }\n }\n\n const xFirst = tokens[1] !== 'left' && tokens[1] !== 'right' && tokens[0] !== 'top' && tokens[0] !== 'bottom';\n\n tokens = tokens.map(token => CSS_POSITIONS[token] || token);\n\n if (!xFirst) {\n tokens.reverse();\n }\n\n const parsed = tokens.join(' ').match(/^([0-9.]+)% ([0-9.]+)%$/);\n\n if (parsed) {\n return {\n x: parseFloat(parsed[1]) / 100,\n y: parseFloat(parsed[2]) / 100,\n };\n }\n else {\n return { x: 0.5, y: 0.5 };\n }\n}\n\n/**\n * @readonly\n * @private\n */\nconst LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' };\n/**\n * @readonly\n * @private\n */\nconst TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' };\n\n/**\n * @summary Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center\n * @memberOf PSV.utils\n * @param {string | string[]} value\n * @param {string} defaultValue\n * @param {boolean} [allowCenter=true]\n * @return {string[]}\n */\nexport function cleanPosition(value, defaultValue, allowCenter = true) {\n if (!value) {\n return defaultValue.split(' ');\n }\n\n if (typeof value === 'string') {\n const tempPos = parsePosition(value);\n\n if (!(tempPos.x in LEFT_MAP) || !(tempPos.y in TOP_MAP)) {\n throw new PSVError(`Unable to parse position \"${value}\"`);\n }\n\n value = [TOP_MAP[tempPos.y], LEFT_MAP[tempPos.x]];\n }\n\n if (!allowCenter && value[0] === 'center' && value[1] === 'center') {\n throw new PSVError('Unable to parse position \"center center\"');\n }\n\n return value;\n}\n\n/**\n * @summary Parses an speed\n * @memberOf PSV.utils\n * @param {string|number} speed - The speed, in radians/degrees/revolutions per second/minute\n * @returns {number} radians per second\n * @throws {PSV.PSVError} when the speed cannot be parsed\n */\nexport function parseSpeed(speed) {\n let parsed;\n\n if (typeof speed === 'string') {\n const speedStr = speed.toString().trim();\n\n // Speed extraction\n let speedValue = parseFloat(speedStr.replace(/^(-?[0-9]+(?:\\.[0-9]*)?).*$/, '$1'));\n const speedUnit = speedStr.replace(/^-?[0-9]+(?:\\.[0-9]*)?(.*)$/, '$1').trim();\n\n // \"per minute\" -> \"per second\"\n if (speedUnit.match(/(pm|per minute)$/)) {\n speedValue /= 60;\n }\n\n // Which unit?\n switch (speedUnit) {\n // Degrees per minute / second\n case 'dpm':\n case 'degrees per minute':\n case 'dps':\n case 'degrees per second':\n parsed = THREE.MathUtils.degToRad(speedValue);\n break;\n\n // Radians per minute / second\n case 'rdpm':\n case 'radians per minute':\n case 'rdps':\n case 'radians per second':\n parsed = speedValue;\n break;\n\n // Revolutions per minute / second\n case 'rpm':\n case 'revolutions per minute':\n case 'rps':\n case 'revolutions per second':\n parsed = speedValue * Math.PI * 2;\n break;\n\n // Unknown unit\n default:\n throw new PSVError('Unknown speed unit \"' + speedUnit + '\"');\n }\n }\n else {\n parsed = speed;\n }\n\n return parsed;\n}\n\n/**\n * @summary Parses an angle value in radians or degrees and returns a normalized value in radians\n * @memberOf PSV.utils\n * @param {string|number} angle - eg: 3.14, 3.14rad, 180deg\n * @param {boolean} [zeroCenter=false] - normalize between -Pi - Pi instead of 0 - 2*Pi\n * @param {boolean} [halfCircle=zeroCenter] - normalize between -Pi/2 - Pi/2 instead of -Pi - Pi\n * @returns {number}\n * @throws {PSV.PSVError} when the angle cannot be parsed\n */\nexport function parseAngle(angle, zeroCenter = false, halfCircle = zeroCenter) {\n let parsed;\n\n if (typeof angle === 'string') {\n const match = angle.toLowerCase().trim().match(/^(-?[0-9]+(?:\\.[0-9]*)?)(.*)$/);\n\n if (!match) {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n const value = parseFloat(match[1]);\n const unit = match[2];\n\n if (unit) {\n switch (unit) {\n case 'deg':\n case 'degs':\n parsed = THREE.MathUtils.degToRad(value);\n break;\n case 'rad':\n case 'rads':\n parsed = value;\n break;\n default:\n throw new PSVError('Unknown angle unit \"' + unit + '\"');\n }\n }\n else {\n parsed = value;\n }\n }\n else if (typeof angle === 'number' && !isNaN(angle)) {\n parsed = angle;\n }\n else {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n parsed = loop(zeroCenter ? parsed + Math.PI : parsed, Math.PI * 2);\n\n return zeroCenter ? bound(parsed - Math.PI, -Math.PI / (halfCircle ? 2 : 1), Math.PI / (halfCircle ? 2 : 1)) : parsed;\n}\n\n/**\n * @summary Creates a THREE texture from an image\n * @memberOf PSV.utils\n * @param {HTMLImageElement | HTMLCanvasElement} img\n * @return {external:THREE.Texture}\n */\nexport function createTexture(img) {\n const texture = new THREE.Texture(img);\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n return texture;\n}\n\nconst quaternion = new THREE.Quaternion();\n\n/**\n * @summary Applies the inverse of Euler angles to a vector\n * @memberOf PSV.utils\n * @param {external:THREE.Vector3} vector\n * @param {external:THREE.Euler} euler\n */\nexport function applyEulerInverse(vector, euler) {\n quaternion.setFromEuler(euler).invert();\n vector.applyQuaternion(quaternion);\n}\n","import { EASINGS } from '../data/constants';\nimport { each } from './misc';\nimport { logWarn } from './psv';\n\n/**\n * @callback OnTick\n * @summary Function called for each animation frame with computed properties\n * @memberOf PSV.utils.Animation\n * @param {Object.} properties - current values\n * @param {float} progress - 0 to 1\n */\n\n/**\n * @summary Interpolation helper for animations\n * @memberOf PSV.utils\n * @description\n * Implements the Promise API with an additional \"cancel\" method.\n * The promise is resolved with `true` when the animation is completed and `false` if the animation is cancelled.\n * @example\n * const anim = new Animation({\n * properties: {\n * width: {start: 100, end: 200}\n * },\n * duration: 5000,\n * onTick: (properties) => element.style.width = `${properties.width}px`;\n * });\n *\n * anim.then((completed) => ...);\n *\n * anim.cancel()\n */\nexport class Animation {\n\n /**\n * @param {Object} options\n * @param {Object.} options.properties\n * @param {number} options.properties[].start\n * @param {number} options.properties[].end\n * @param {number} options.duration\n * @param {number} [options.delay=0]\n * @param {string} [options.easing='linear']\n * @param {PSV.utils.Animation.OnTick} options.onTick - called on each frame\n */\n constructor(options) {\n this.__callbacks = [];\n\n if (options) {\n if (!options.easing || typeof options.easing === 'string') {\n options.easing = EASINGS[options.easing || 'linear'];\n }\n\n this.__start = null;\n this.options = options;\n\n if (options.delay) {\n this.__delayTimeout = setTimeout(() => {\n this.__delayTimeout = null;\n this.__animationFrame = window.requestAnimationFrame(t => this.__run(t));\n }, options.delay);\n }\n else {\n this.__animationFrame = window.requestAnimationFrame(t => this.__run(t));\n }\n }\n else {\n this.__resolved = true;\n }\n }\n\n /**\n * @summary Main loop for the animation\n * @param {number} timestamp\n * @private\n */\n __run(timestamp) {\n // first iteration\n if (this.__start === null) {\n this.__start = timestamp;\n }\n\n // compute progress\n const progress = (timestamp - this.__start) / this.options.duration;\n const current = {};\n\n if (progress < 1.0) {\n // interpolate properties\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.start + (prop.end - prop.start) * this.options.easing(progress);\n }\n });\n this.options.onTick(current, progress);\n\n this.__animationFrame = window.requestAnimationFrame(t => this.__run(t));\n }\n else {\n // call onTick one last time with final values\n each(this.options.properties, (prop, name) => {\n if (prop) {\n current[name] = prop.end;\n }\n });\n this.options.onTick(current, 1.0);\n\n this.__animationFrame = window.requestAnimationFrame(() => {\n this.__resolved = true;\n this.__resolve(true);\n });\n }\n }\n\n /**\n * @private\n */\n __resolve(value) {\n this.__callbacks.forEach(cb => cb(value));\n this.__callbacks.length = 0;\n }\n\n /**\n * @summary Promise chaining\n * @param {Function} [onFulfilled] - Called when the animation is complete (true) or cancelled (false)\n * @param {Function} [onRejected] - deprecated\n * @returns {Promise}\n */\n then(onFulfilled = null, onRejected = null) {\n if (onRejected) {\n logWarn('Animation#then does not accept a rejection handler anymore');\n }\n\n if (this.__resolved || this.__cancelled) {\n return Promise.resolve(this.__resolved)\n .then(onFulfilled);\n }\n\n return new Promise((resolve) => {\n this.__callbacks.push(resolve);\n })\n .then(onFulfilled);\n }\n\n /**\n * @summary Cancels the animation\n */\n cancel() {\n if (!this.__cancelled && !this.__resolved) {\n this.__cancelled = true;\n this.__resolve(false);\n\n if (this.__delayTimeout) {\n window.clearTimeout(this.__delayTimeout);\n this.__delayTimeout = null;\n }\n if (this.__animationFrame) {\n window.cancelAnimationFrame(this.__animationFrame);\n this.__animationFrame = null;\n }\n }\n }\n\n /**\n * @deprecated not supported anymore\n */\n catch() {\n logWarn('Animation#catch is not supported anymore');\n return this.then();\n }\n\n /**\n * @deprecated not supported anymore\n */\n finally(onFinally) {\n logWarn('Animation#finally is not supported anymore');\n return this.then(onFinally);\n }\n\n /**\n * @deprecated not supported anymore\n */\n static resolve() {\n logWarn('Animation.resolve is not supported anymore');\n }\n\n}\n","import { PSVError } from '../PSVError';\nimport { bound, loop } from './math';\n\n/**\n * @summary Represents a variable that can dynamically change with time (using requestAnimationFrame)\n * @memberOf PSV.utils\n */\nexport class Dynamic {\n\n static STOP = 0;\n static INFINITE = 1;\n static POSITION = 2;\n\n /**\n * @param {Function} [fn] Callback function\n * @param {number} [defaultValue] Default position\n * @param {number} [min] Minimum position\n * @param {number} [max] Maximum position\n * @param {boolean} [loopValue] Loop value between min and max\n */\n constructor(fn, defaultValue = 0, min = -Infinity, max = Infinity, loopValue = false) {\n /**\n * @type {Function}\n * @private\n * @readonly\n */\n this.fn = fn;\n\n /**\n * @type {number}\n * @private\n */\n this.mode = Dynamic.STOP;\n\n /**\n * @type {number}\n * @private\n */\n this.speed = 0;\n\n /**\n * @type {number}\n * @private\n */\n this.speedMult = 1;\n\n /**\n * @type {number}\n * @private\n */\n this.currentSpeed = 0;\n\n /**\n * @type {number}\n * @private\n */\n this.target = 0;\n\n /**\n * @type {number}\n * @readonly\n */\n this.current = defaultValue;\n\n /**\n * @type {number}\n * @private\n */\n this.min = min;\n\n /**\n * @type {number}\n * @private\n */\n this.max = max;\n\n /**\n * @type {boolean}\n * @private\n */\n this.loopValue = loopValue;\n\n if (loopValue && min !== 0) {\n throw new PSVError('invalid config');\n }\n\n if (this.fn) {\n this.fn(defaultValue);\n }\n }\n\n /**\n * Changes base speed\n * @param {number} speed\n */\n setSpeed(speed) {\n this.speed = speed;\n }\n\n /**\n * Defines the target position\n * @param {number} position\n * @param {number} [speedMult=1]\n */\n goto(position, speedMult = 1) {\n this.mode = Dynamic.POSITION;\n this.target = this.loopValue ? loop(position, this.max) : bound(position, this.min, this.max);\n this.speedMult = speedMult;\n }\n\n /**\n * Increase/decrease the target position\n * @param {number} step\n * @param {number} [speedMult=1]\n */\n step(step, speedMult = 1) {\n if (this.mode !== Dynamic.POSITION) {\n this.target = this.current;\n }\n this.goto(this.target + step, speedMult);\n }\n\n /**\n * Starts infinite movement\n * @param {boolean} [invert=false]\n * @param {number} [speedMult=1]\n */\n roll(invert = false, speedMult = 1) {\n this.mode = Dynamic.INFINITE;\n this.target = invert ? -Infinity : Infinity;\n this.speedMult = speedMult;\n }\n\n /**\n * Stops movement\n */\n stop() {\n this.mode = Dynamic.STOP;\n }\n\n /**\n * Defines the current position and immediately stops movement\n * @param {number} value\n */\n setValue(value) {\n this.target = this.loopValue ? loop(value, this.max) : bound(value, this.min, this.max);\n this.mode = Dynamic.STOP;\n if (this.target !== this.current) {\n this.current = this.target;\n if (this.fn) {\n this.fn(this.current);\n }\n return true;\n }\n return false;\n }\n\n /**\n * @package\n */\n update(elapsed) {\n // in position mode switch to stop mode when in the decceleration window\n if (this.mode === Dynamic.POSITION) {\n // in loop mode, alter \"current\" to avoid crossing the origin\n if (this.loopValue && Math.abs(this.target - this.current) > this.max / 2) {\n this.current = this.current < this.target ? this.current + this.max : this.current - this.max;\n }\n\n const dstStop = this.currentSpeed * this.currentSpeed / (this.speed * this.speedMult * 4);\n if (Math.abs(this.target - this.current) <= dstStop) {\n this.mode = Dynamic.STOP;\n }\n }\n\n // compute speed\n let targetSpeed = this.mode === Dynamic.STOP ? 0 : this.speed * this.speedMult;\n if (this.target < this.current) {\n targetSpeed = -targetSpeed;\n }\n if (this.currentSpeed < targetSpeed) {\n this.currentSpeed = Math.min(targetSpeed, this.currentSpeed + elapsed / 1000 * this.speed * this.speedMult * 2);\n }\n else if (this.currentSpeed > targetSpeed) {\n this.currentSpeed = Math.max(targetSpeed, this.currentSpeed - elapsed / 1000 * this.speed * this.speedMult * 2);\n }\n\n // compute new position\n let next = null;\n if (this.current > this.target && this.currentSpeed) {\n next = Math.max(this.target, this.current + this.currentSpeed * elapsed / 1000);\n }\n else if (this.current < this.target && this.currentSpeed) {\n next = Math.min(this.target, this.current + this.currentSpeed * elapsed / 1000);\n }\n\n // apply value\n if (next !== null) {\n next = this.loopValue ? loop(next, this.max) : bound(next, this.min, this.max);\n if (next !== this.current) {\n this.current = next;\n if (this.fn) {\n this.fn(this.current);\n }\n return true;\n }\n }\n\n return false;\n }\n\n}\n","import { each } from './misc';\n\n/**\n * @summary Wrapper for multiple {@link PSV.utils.Dynamic} evolving together\n * @memberOf PSV.utils\n */\nexport class MultiDynamic {\n\n /**\n * @type {Object}\n * @readonly\n */\n get current() {\n const values = {};\n each(this.dynamics, (dynamic, name) => {\n values[name] = dynamic.current;\n });\n return values;\n }\n\n /**\n * @param {Record} dynamics\n * @param {Function} [fn] Callback function\n */\n constructor(dynamics, fn) {\n /**\n * @type {Function}\n * @private\n * @readonly\n */\n this.fn = fn;\n\n /**\n * @type {Record}\n * @private\n * @readonly\n */\n this.dynamics = dynamics;\n\n if (this.fn) {\n this.fn(this.current);\n }\n }\n\n /**\n * Changes base speed\n * @param {number} speed\n */\n setSpeed(speed) {\n each(this.dynamics, (d) => {\n d.setSpeed(speed);\n });\n }\n\n /**\n * Defines the target positions\n * @param {Record} positions\n * @param {number} [speedMult=1]\n */\n goto(positions, speedMult = 1) {\n each(positions, (position, name) => {\n this.dynamics[name].goto(position, speedMult);\n });\n }\n\n /**\n * Increase/decrease the target positions\n * @param {Record} steps\n * @param {number} [speedMult=1]\n */\n step(steps, speedMult = 1) {\n each(steps, (step, name) => {\n this.dynamics[name].step(step, speedMult);\n });\n }\n\n /**\n * Starts infinite movements\n * @param {Record} rolls\n * @param {number} [speedMult=1]\n */\n roll(rolls, speedMult = 1) {\n each(rolls, (roll, name) => {\n this.dynamics[name].roll(roll, speedMult);\n });\n }\n\n /**\n * Stops movements\n */\n stop() {\n each(this.dynamics, d => d.stop());\n }\n\n /**\n * Defines the current positions and immediately stops movements\n * @param {Record} values\n */\n setValue(values) {\n let hasUpdates = false;\n each(values, (value, name) => {\n hasUpdates |= this.dynamics[name].setValue(value);\n });\n\n if (hasUpdates && this.fn) {\n this.fn(this.current);\n }\n\n return hasUpdates;\n }\n\n /**\n * @package\n */\n update(elapsed) {\n let hasUpdates = false;\n each(this.dynamics, (dynamic) => {\n hasUpdates |= dynamic.update(elapsed);\n });\n\n if (hasUpdates && this.fn) {\n this.fn(this.current);\n }\n\n return hasUpdates;\n }\n\n}\n","import { EventEmitter } from 'uevent';\n\n/**\n * @summary Helper to make sliders elements\n * @memberOf PSV.utils\n */\nexport class Slider extends EventEmitter {\n\n static VERTICAL = 1;\n static HORIZONTAL = 2;\n\n /**\n * @type {boolean}\n * @readonly\n */\n get vertical() {\n return this.prop.direction === Slider.VERTICAL;\n }\n\n constructor({ psv, container, direction, onUpdate }) {\n super();\n\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = container;\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} mousedown\n * @property {number} mediaMinWidth\n */\n this.prop = {\n onUpdate : onUpdate,\n direction: direction,\n mousedown: false,\n mouseover: false,\n };\n\n this.container.addEventListener('click', this);\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('mouseenter', this);\n this.container.addEventListener('mouseleave', this);\n this.container.addEventListener('touchstart', this);\n this.container.addEventListener('mousemove', this, true);\n this.container.addEventListener('touchmove', this, true);\n window.addEventListener('mouseup', this);\n window.addEventListener('touchend', this);\n }\n\n /**\n * @protected\n */\n destroy() {\n window.removeEventListener('mouseup', this);\n window.removeEventListener('touchend', this);\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'click': e.stopPropagation(); break;\n case 'mousedown': this.__onMouseDown(e); break;\n case 'mouseenter': this.__onMouseEnter(e); break;\n case 'mouseleave': this.__onMouseLeave(e); break;\n case 'touchstart': this.__onTouchStart(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'touchmove': this.__onTouchMove(e); break;\n case 'mouseup': this.__onMouseUp(e); break;\n case 'touchend': this.__onTouchEnd(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @private\n */\n __onMouseDown(evt) {\n this.prop.mousedown = true;\n this.__update(evt, true);\n }\n\n /**\n * @private\n */\n __onMouseEnter(evt) {\n this.prop.mouseover = true;\n this.__update(evt, true);\n }\n\n /**\n * @private\n */\n __onTouchStart(evt) {\n this.prop.mouseover = true;\n this.prop.mousedown = true;\n this.__update(evt.changedTouches[0], true);\n }\n\n /**\n * @private\n */\n __onMouseMove(evt) {\n if (this.prop.mousedown || this.prop.mouseover) {\n evt.stopPropagation();\n this.__update(evt, true);\n }\n }\n\n /**\n * @private\n */\n __onTouchMove(evt) {\n if (this.prop.mousedown || this.prop.mouseover) {\n evt.stopPropagation();\n this.__update(evt.changedTouches[0], true);\n }\n }\n\n /**\n * @private\n */\n __onMouseUp(evt) {\n if (this.prop.mousedown) {\n this.prop.mousedown = false;\n this.__update(evt, false);\n }\n }\n\n /**\n * @private\n */\n __onMouseLeave(evt) {\n if (this.prop.mouseover) {\n this.prop.mouseover = false;\n this.__update(evt, true);\n }\n }\n\n /**\n * @private\n */\n __onTouchEnd(evt) {\n if (this.prop.mousedown) {\n this.prop.mouseover = false;\n this.prop.mousedown = false;\n this.__update(evt.changedTouches[0], false);\n }\n }\n\n /**\n * @private\n */\n __update(evt, moving) {\n const boundingClientRect = this.container.getBoundingClientRect();\n const cursor = evt[this.vertical ? 'clientY' : 'clientX'];\n const pos = boundingClientRect[this.vertical ? 'bottom' : 'left'];\n const size = boundingClientRect[this.vertical ? 'height' : 'width'];\n const val = Math.abs((pos - cursor) / size);\n\n this.prop.onUpdate({\n value : val,\n click : !moving,\n mousedown: this.prop.mousedown,\n mouseover: this.prop.mouseover,\n cursor : evt,\n });\n }\n\n}\n","/**\n * @namespace PSV.utils\n */\n\nexport * from './browser';\nexport * from './math';\nexport * from './misc';\nexport * from './psv';\n\nexport * from './Animation';\nexport * from './Dynamic';\nexport * from './MultiDynamic';\nexport * from './Slider';\n","import * as THREE from 'three';\nimport { SPHERE_RADIUS } from '../../data/constants';\nimport { SYSTEM } from '../../data/system';\nimport { PSVError } from '../../PSVError';\nimport { createTexture, firstNonNull, getXMPValue, isPowerOfTwo, logWarn } from '../../utils';\nimport { AbstractAdapter } from '../AbstractAdapter';\n\n\n/**\n * @typedef {Object} PSV.adapters.EquirectangularAdapter.Options\n * @property {number} [resolution=64] - number of faces of the sphere geometry, higher values may decrease performances\n */\n\n\n/**\n * @summary Adapter for equirectangular panoramas\n * @memberof PSV.adapters\n * @extends PSV.adapters.AbstractAdapter\n */\nexport class EquirectangularAdapter extends AbstractAdapter {\n\n static id = 'equirectangular';\n static supportsDownload = true;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.adapters.EquirectangularAdapter.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.adapters.EquirectangularAdapter.Options}\n * @private\n */\n this.config = {\n resolution: 64,\n ...options,\n };\n\n if (!isPowerOfTwo(this.config.resolution)) {\n throw new PSVError('EquirectangularAdapter resolution must be power of two');\n }\n\n this.SPHERE_SEGMENTS = this.config.resolution;\n this.SPHERE_HORIZONTAL_SEGMENTS = this.SPHERE_SEGMENTS / 2;\n }\n\n /**\n * @override\n */\n supportsTransition() {\n return true;\n }\n\n /**\n * @override\n */\n supportsPreload() {\n return true;\n }\n\n /**\n * @override\n * @param {string} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData) {\n if (typeof panorama !== 'string') {\n if (Array.isArray(panorama) || typeof panorama === 'object' && !!panorama.left) {\n logWarn('Cubemap support now requires an additional adapter, see https://photo-sphere-viewer.js.org/guide/adapters');\n }\n return Promise.reject(new PSVError('Invalid panorama url, are you using the right adapter?'));\n }\n\n return (\n !this.psv.config.useXmpData\n ? this.psv.textureLoader.loadImage(panorama, p => this.psv.loader.setProgress(p))\n .then(img => ({ img: img, xmpPanoData: null }))\n : this.__loadXMP(panorama, p => this.psv.loader.setProgress(p))\n .then(xmpPanoData => this.psv.textureLoader.loadImage(panorama).then(img => ({ img, xmpPanoData })))\n )\n .then(({ img, xmpPanoData }) => {\n if (typeof newPanoData === 'function') {\n newPanoData = newPanoData(img);\n }\n\n const panoData = {\n fullWidth : firstNonNull(newPanoData?.fullWidth, xmpPanoData?.fullWidth, img.width),\n fullHeight : firstNonNull(newPanoData?.fullHeight, xmpPanoData?.fullHeight, img.height),\n croppedWidth : firstNonNull(newPanoData?.croppedWidth, xmpPanoData?.croppedWidth, img.width),\n croppedHeight: firstNonNull(newPanoData?.croppedHeight, xmpPanoData?.croppedHeight, img.height),\n croppedX : firstNonNull(newPanoData?.croppedX, xmpPanoData?.croppedX, 0),\n croppedY : firstNonNull(newPanoData?.croppedY, xmpPanoData?.croppedY, 0),\n poseHeading : firstNonNull(newPanoData?.poseHeading, xmpPanoData?.poseHeading, 0),\n posePitch : firstNonNull(newPanoData?.posePitch, xmpPanoData?.posePitch, 0),\n poseRoll : firstNonNull(newPanoData?.poseRoll, xmpPanoData?.poseRoll, 0),\n };\n\n if (panoData.croppedWidth !== img.width || panoData.croppedHeight !== img.height) {\n logWarn(`Invalid panoData, croppedWidth and/or croppedHeight is not coherent with loaded image.\n panoData: ${panoData.croppedWidth}x${panoData.croppedHeight}, image: ${img.width}x${img.height}`);\n }\n if ((newPanoData || xmpPanoData) && panoData.fullWidth !== panoData.fullHeight * 2) {\n logWarn('Invalid panoData, fullWidth should be twice fullHeight');\n }\n\n const texture = this.__createEquirectangularTexture(img, panoData);\n\n return { panorama, texture, panoData };\n });\n }\n\n /**\n * @summary Loads the XMP data of an image\n * @param {string} panorama\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @private\n */\n __loadXMP(panorama, onProgress) {\n return this.psv.textureLoader.loadFile(panorama, onProgress)\n .then(blob => this.__loadBlobAsString(blob))\n .then((binary) => {\n const a = binary.indexOf('');\n const data = binary.substring(a, b);\n\n if (a !== -1 && b !== -1 && data.includes('GPano:')) {\n return {\n fullWidth : getXMPValue(data, 'FullPanoWidthPixels'),\n fullHeight : getXMPValue(data, 'FullPanoHeightPixels'),\n croppedWidth : getXMPValue(data, 'CroppedAreaImageWidthPixels'),\n croppedHeight: getXMPValue(data, 'CroppedAreaImageHeightPixels'),\n croppedX : getXMPValue(data, 'CroppedAreaLeftPixels'),\n croppedY : getXMPValue(data, 'CroppedAreaTopPixels'),\n poseHeading : getXMPValue(data, 'PoseHeadingDegrees'),\n posePitch : getXMPValue(data, 'PosePitchDegrees'),\n poseRoll : getXMPValue(data, 'PoseRollDegrees'),\n };\n }\n\n return null;\n });\n }\n\n /**\n * @summmary read a Blob as string\n * @param {Blob} blob\n * @returns {Promise}\n * @private\n */\n __loadBlobAsString(blob) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result);\n reader.onerror = reject;\n reader.readAsText(blob);\n });\n }\n\n /**\n * @summary Creates the final texture from image and panorama data\n * @param {Image} img\n * @param {PSV.PanoData} panoData\n * @returns {external:THREE.Texture}\n * @private\n */\n __createEquirectangularTexture(img, panoData) {\n // resize image / fill cropped parts with black\n if (panoData.fullWidth > SYSTEM.maxTextureWidth\n || panoData.croppedWidth !== panoData.fullWidth\n || panoData.croppedHeight !== panoData.fullHeight\n ) {\n const ratio = SYSTEM.getMaxCanvasWidth() / panoData.fullWidth;\n\n const resizedPanoData = { ...panoData };\n if (ratio < 1) {\n resizedPanoData.fullWidth *= ratio;\n resizedPanoData.fullHeight *= ratio;\n resizedPanoData.croppedWidth *= ratio;\n resizedPanoData.croppedHeight *= ratio;\n resizedPanoData.croppedX *= ratio;\n resizedPanoData.croppedY *= ratio;\n }\n\n const buffer = document.createElement('canvas');\n buffer.width = resizedPanoData.fullWidth;\n buffer.height = resizedPanoData.fullHeight;\n\n const ctx = buffer.getContext('2d');\n ctx.drawImage(img,\n resizedPanoData.croppedX, resizedPanoData.croppedY,\n resizedPanoData.croppedWidth, resizedPanoData.croppedHeight);\n\n return createTexture(buffer);\n }\n\n return createTexture(img);\n }\n\n /**\n * @override\n */\n createMesh(scale = 1) {\n // The middle of the panorama is placed at longitude=0\n const geometry = new THREE.SphereGeometry(\n SPHERE_RADIUS * scale,\n this.SPHERE_SEGMENTS,\n this.SPHERE_HORIZONTAL_SEGMENTS,\n -Math.PI / 2\n )\n .scale(-1, 1, 1);\n\n const material = new THREE.MeshBasicMaterial();\n\n return new THREE.Mesh(geometry, material);\n }\n\n /**\n * @override\n */\n setTexture(mesh, textureData) {\n mesh.material.map?.dispose();\n mesh.material.map = textureData.texture;\n }\n\n /**\n * @override\n */\n setTextureOpacity(mesh, opacity) {\n mesh.material.opacity = opacity;\n mesh.material.transparent = opacity < 1;\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n textureData.texture?.dispose();\n }\n\n}\n","/**\n * @namespace PSV.components\n */\n\n/**\n * @summary Base component class\n * @memberof PSV.components\n * @abstract\n */\nexport class AbstractComponent {\n\n /**\n * @param {PSV.Viewer | PSV.components.AbstractComponent} parent\n * @param {string} className - CSS class added to the component's container\n */\n constructor(parent, className) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = parent.psv || parent;\n\n /**\n * @member {PSV.Viewer|PSV.components.AbstractComponent}\n * @readonly\n */\n this.parent = parent;\n this.parent.children.push(this);\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} visible - Visibility of the component\n */\n this.prop = {\n visible: true,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = className;\n this.parent.container.appendChild(this.container);\n }\n\n /**\n * @summary Destroys the component\n * @protected\n */\n destroy() {\n this.parent.container.removeChild(this.container);\n\n const childIdx = this.parent.children.indexOf(this);\n if (childIdx !== -1) {\n this.parent.children.splice(childIdx, 1);\n }\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n delete this.container;\n delete this.parent;\n delete this.psv;\n delete this.prop;\n }\n\n /**\n * @summary Refresh UI\n * @description Must be be a very lightweight operation\n * @package\n */\n refreshUi() {\n this.children.every((child) => {\n child.refreshUi();\n return this.psv.prop.uiRefresh === true;\n });\n }\n\n /**\n * @summary Displays or hides the component\n */\n toggle() {\n if (this.isVisible()) {\n this.hide();\n }\n else {\n this.show();\n }\n }\n\n /**\n * @summary Hides the component\n */\n hide() {\n this.container.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @summary Displays the component\n */\n show() {\n this.container.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @summary Checks if the component is visible\n * @returns {boolean}\n */\n isVisible() {\n return this.prop.visible;\n }\n\n}\n","import { AbstractComponent } from '../components/AbstractComponent';\nimport { KEY_CODES } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { isPlainObject, toggleClass } from '../utils';\n\n/**\n * @namespace PSV.buttons\n */\n\n/**\n * @summary Base navbar button class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.buttons\n * @abstract\n */\nexport class AbstractButton extends AbstractComponent {\n\n /**\n * @summary Unique identifier of the button\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @summary Identifier to declare a group of buttons\n * @member {string}\n * @readonly\n * @static\n */\n static groupId = null;\n\n /**\n * @summary SVG icon name injected in the button\n * @member {string}\n * @readonly\n * @static\n */\n static icon = null;\n\n /**\n * @summary SVG icon name injected in the button when it is active\n * @member {string}\n * @readonly\n * @static\n */\n static iconActive = null;\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} [className] - Additional CSS classes\n * @param {boolean} [collapsable=false] - `true` if the button can be moved to menu when the navbar is too small\n * @param {boolean} [tabbable=true] - `true` if the button is accessible with the keyboard\n */\n constructor(navbar, className = '', collapsable = false, tabbable = true) {\n super(navbar, 'psv-button ' + className);\n\n /**\n * @override\n * @property {string} id - Unique identifier of the button\n * @property {boolean} enabled\n * @property {boolean} supported\n * @property {boolean} collapsed\n * @property {boolean} active\n * @property {number} width\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable: collapsable,\n enabled : true,\n supported : true,\n collapsed : false,\n active : false,\n width : this.container.offsetWidth,\n };\n\n if (this.constructor.icon) {\n this.__setIcon(this.constructor.icon);\n }\n\n if (this.prop.id && this.psv.config.lang[this.prop.id]) {\n this.container.title = this.psv.config.lang[this.prop.id];\n }\n\n if (tabbable) {\n this.container.tabIndex = 0;\n }\n\n this.container.addEventListener('click', (e) => {\n if (this.prop.enabled) {\n this.onClick();\n }\n e.stopPropagation();\n });\n\n this.container.addEventListener('keydown', (e) => {\n if (e.key === KEY_CODES.Enter && this.prop.enabled) {\n this.onClick();\n e.stopPropagation();\n }\n });\n }\n\n /**\n * @package\n */\n checkSupported() {\n const supportedOrObject = this.isSupported();\n if (isPlainObject(supportedOrObject)) {\n if (supportedOrObject.initial === false) {\n this.hide();\n this.prop.supported = false;\n }\n\n supportedOrObject.promise.then((supported) => {\n if (!this.prop) {\n return; // the component has been destroyed\n }\n this.prop.supported = supported;\n if (!supported) {\n this.hide();\n }\n else {\n this.show();\n }\n });\n }\n else {\n this.prop.supported = supportedOrObject;\n if (!supportedOrObject) {\n this.hide();\n }\n }\n }\n\n /**\n * @summary Checks if the button can be displayed\n * @returns {boolean|{initial: boolean, promise: Promise}}\n */\n isSupported() {\n return true;\n }\n\n /**\n * @summary Changes the active state of the button\n * @param {boolean} [active] - forced state\n */\n toggleActive(active) {\n this.prop.active = active !== undefined ? active : !this.prop.active;\n toggleClass(this.container, 'psv-button--active', this.prop.active);\n\n if (this.constructor.iconActive) {\n this.__setIcon(this.prop.active ? this.constructor.iconActive : this.constructor.icon);\n }\n }\n\n /**\n * @override\n */\n show(refresh = true) {\n if (!this.isVisible()) {\n this.prop.visible = true;\n if (!this.prop.collapsed) {\n this.container.style.display = '';\n }\n if (refresh) {\n this.psv.refreshUi(`show button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @override\n */\n hide(refresh = true) {\n if (this.isVisible()) {\n this.prop.visible = false;\n this.container.style.display = 'none';\n if (refresh) {\n this.psv.refreshUi(`hide button ${this.prop.id}`);\n }\n }\n }\n\n /**\n * @summary Disables the button\n */\n disable() {\n this.container.classList.add('psv-button--disabled');\n this.prop.enabled = false;\n }\n\n /**\n * @summary Enables the button\n */\n enable() {\n this.container.classList.remove('psv-button--disabled');\n this.prop.enabled = true;\n }\n\n /**\n * @summary Collapses the button in the navbar menu\n */\n collapse() {\n this.prop.collapsed = true;\n this.container.style.display = 'none';\n }\n\n /**\n * @summary Uncollapses the button from the navbar menu\n */\n uncollapse() {\n this.prop.collapsed = false;\n if (this.prop.visible) {\n this.container.style.display = '';\n }\n }\n\n /**\n * @summary Set the button icon\n * @param {string} icon SVG\n * @param {HTMLElement} [container] - default is the main button container\n * @private\n */\n __setIcon(icon, container = this.container) {\n if (icon) {\n container.innerHTML = icon;\n // className is read-only on SVGElement\n container.querySelector('svg').classList.add('psv-button-svg');\n }\n else {\n container.innerHTML = '';\n }\n }\n\n /**\n * @summary Action when the button is clicked\n * @private\n * @abstract\n */\n onClick() {\n throw new PSVError(`onClick not implemented for button \"${this.prop.id}\".`);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport playActive from '../icons/play-active.svg';\nimport play from '../icons/play.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar autorotate button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AutorotateButton extends AbstractButton {\n\n static id = 'autorotate';\n static icon = play;\n static iconActive = playActive;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-autorotate-button', true);\n\n this.psv.on(EVENTS.AUTOROTATE, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.AUTOROTATE, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.AUTOROTATE: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles autorotate\n */\n onClick() {\n if (this.psv.isAutorotateEnabled()) {\n this.psv.config.autorotateIdle = false;\n this.psv.resetIdleTimer();\n }\n this.psv.toggleAutorotate();\n }\n\n}\n","import { addClasses } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar custom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class CustomButton extends AbstractButton {\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {PSV.NavbarCustomButton} config\n */\n constructor(navbar, config) {\n super(navbar, 'psv-custom-button', config.collapsable !== false, config.tabbable !== false);\n\n /**\n * @member {Object}\n * @readonly\n * @private\n */\n this.config = config;\n\n if (this.config.id) {\n this.prop.id = this.config.id;\n }\n else {\n this.prop.id = 'psvButton-' + Math.random().toString(36).substr(2, 9);\n }\n\n if (this.config.className) {\n addClasses(this.container, this.config.className);\n }\n\n if (this.config.title) {\n this.container.title = this.config.title;\n }\n\n if (this.config.content) {\n this.container.innerHTML = this.config.content;\n }\n\n this.prop.width = this.container.offsetWidth;\n\n if (this.config.enabled === false) {\n this.disable();\n }\n\n if (this.config.visible === false) {\n this.hide();\n }\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.config;\n\n super.destroy();\n }\n\n /**\n * @override\n * @description Calls user method\n */\n onClick() {\n if (this.config.onClick) {\n this.config.onClick.apply(this.psv);\n }\n }\n\n}\n","import { EVENTS, IDS } from '../data/constants';\nimport info from '../icons/info.svg';\nimport { AbstractButton } from './AbstractButton';\n\nconst MODE_NOTIF = 1;\nconst MODE_PANEL = 2;\n\n/**\n * @summary Navigation bar description button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class DescriptionButton extends AbstractButton {\n\n static id = 'description';\n static icon = info;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-description-button');\n\n /**\n * @override\n * @property {string} mode - notification or panel\n */\n this.prop = {\n ...this.prop,\n mode: null,\n };\n\n this.psv.on(EVENTS.HIDE_NOTIFICATION, this);\n this.psv.on(EVENTS.SHOW_NOTIFICATION, this);\n this.psv.on(EVENTS.CLOSE_PANEL, this);\n this.psv.on(EVENTS.OPEN_PANEL, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.HIDE_NOTIFICATION, this);\n this.psv.off(EVENTS.SHOW_NOTIFICATION, this);\n this.psv.off(EVENTS.CLOSE_PANEL, this);\n this.psv.off(EVENTS.OPEN_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (!this.prop.mode) {\n return;\n }\n\n let closed = false;\n switch (e.type) {\n case EVENTS.HIDE_NOTIFICATION:\n closed = this.prop.mode === MODE_NOTIF;\n break;\n\n case EVENTS.SHOW_NOTIFICATION:\n closed = this.prop.mode === MODE_NOTIF && e.args[0] !== IDS.DESCRIPTION;\n break;\n\n case EVENTS.CLOSE_PANEL:\n closed = this.prop.mode === MODE_PANEL;\n break;\n\n case EVENTS.OPEN_PANEL:\n closed = this.prop.mode === MODE_PANEL && e.args[0] !== IDS.DESCRIPTION;\n break;\n\n default:\n }\n\n if (closed) {\n this.toggleActive(false);\n this.prop.mode = null;\n }\n }\n\n /**\n * @override\n */\n hide(refresh) {\n super.hide(refresh);\n\n if (this.prop.mode) {\n this.__close();\n }\n }\n\n /**\n * This button can only be refresh from NavbarCaption\n * @override\n */\n refreshUi(refresh = false) {\n if (refresh) {\n const caption = this.psv.navbar.getButton('caption', false);\n const captionHidden = caption && !caption.isVisible();\n const hasDescription = !!this.psv.config.description;\n\n if (captionHidden || hasDescription) {\n this.show(false);\n }\n else {\n this.hide(false);\n }\n }\n }\n\n /**\n * @override\n * @description Toggles caption\n */\n onClick() {\n if (this.prop.mode) {\n this.__close();\n }\n else {\n this.__open();\n }\n }\n\n /**\n * @private\n */\n __close() {\n switch (this.prop.mode) {\n case MODE_NOTIF:\n this.psv.notification.hide(IDS.DESCRIPTION);\n break;\n case MODE_PANEL:\n this.psv.panel.hide(IDS.DESCRIPTION);\n break;\n default:\n }\n }\n\n /**\n * @private\n */\n __open() {\n this.toggleActive(true);\n\n if (this.psv.config.description) {\n this.prop.mode = MODE_PANEL;\n this.psv.panel.show({\n id : IDS.DESCRIPTION,\n content: `${this.psv.config.caption ? `

${this.psv.config.caption}

` : ''}${this.psv.config.description}`,\n });\n }\n else {\n this.prop.mode = MODE_NOTIF;\n this.psv.notification.show({\n id : IDS.DESCRIPTION,\n content: this.psv.config.caption,\n });\n }\n }\n\n}\n","import download from '../icons/download.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar download button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class DownloadButton extends AbstractButton {\n\n static id = 'download';\n static icon = download;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-download-button', true);\n }\n\n /**\n * @override\n * @description Asks the browser to download the panorama source file\n */\n onClick() {\n const link = document.createElement('a');\n link.href = this.psv.config.downloadUrl || this.psv.config.panorama;\n link.download = link.href.split('/').pop();\n this.psv.container.appendChild(link);\n link.click();\n\n setTimeout(() => {\n this.psv.container.removeChild(link);\n }, 100);\n }\n\n /**\n * @override\n */\n refreshUi() {\n const supported = this.psv.adapter.constructor.supportsDownload || this.psv.config.downloadUrl;\n if (supported && !this.prop.visible) {\n this.show();\n }\n else if (!supported && this.prop.visible) {\n this.hide();\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport fullscreenIn from '../icons/fullscreen-in.svg';\nimport fullscreenOut from '../icons/fullscreen-out.svg';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar fullscreen button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class FullscreenButton extends AbstractButton {\n\n static id = 'fullscreen';\n static icon = fullscreenIn;\n static iconActive = fullscreenOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-fullscreen-button');\n\n this.psv.on(EVENTS.FULLSCREEN_UPDATED, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.FULLSCREEN_UPDATED, this);\n\n super.destroy();\n }\n\n /**\n * Handle events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.FULLSCREEN_UPDATED: this.toggleActive(e.args[0]); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles fullscreen\n */\n onClick() {\n this.psv.toggleFullscreen();\n }\n\n}\n","import { EVENTS, IDS } from '../data/constants';\nimport menuIcon from '../icons/menu.svg';\nimport { dasherize, getClosest } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar menu button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MenuButton extends AbstractButton {\n\n static id = 'menu';\n static icon = menuIcon;\n\n /**\n * @summary Property name added to buttons list\n * @type {string}\n * @constant\n */\n static BUTTON_DATA = 'psvButton';\n\n /**\n * @summary Menu template\n * @param {AbstractButton[]} buttons\n * @param {PSV.Viewer} psv\n * @param {string} dataKey\n * @returns {string}\n */\n static MENU_TEMPLATE = (buttons, psv, dataKey) => `\n
\n

${menuIcon} ${psv.config.lang.menu}

\n
    \n ${buttons.map(button => `\n
  • \n ${button.container.innerHTML}\n ${button.container.title}\n
  • \n `).join('')}\n
\n
\n`;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-menu-button');\n\n this.psv.on(EVENTS.OPEN_PANEL, this);\n this.psv.on(EVENTS.CLOSE_PANEL, this);\n\n super.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.OPEN_PANEL, this);\n this.psv.off(EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === IDS.MENU); break;\n case EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n hide(refresh) {\n super.hide(refresh);\n this.__hideMenu();\n }\n\n /**\n * @override\n */\n show(refresh) {\n super.show(refresh);\n\n if (this.prop.active) {\n this.__showMenu();\n }\n }\n\n /**\n * @override\n * @description Toggles menu\n */\n onClick() {\n if (this.prop.active) {\n this.__hideMenu();\n }\n else {\n this.__showMenu();\n }\n }\n\n __showMenu() {\n this.psv.panel.show({\n id : IDS.MENU,\n content : MenuButton.MENU_TEMPLATE(this.parent.collapsed, this.psv, dasherize(MenuButton.BUTTON_DATA)),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? getClosest(e.target, 'li') : undefined;\n const buttonId = li ? li.dataset[MenuButton.BUTTON_DATA] : undefined;\n\n if (buttonId) {\n this.parent.getButton(buttonId).onClick();\n this.__hideMenu();\n }\n },\n });\n }\n\n __hideMenu() {\n this.psv.panel.hide(IDS.MENU);\n }\n\n}\n","/**\n * @summary Helper for pressable things (buttons, keyboard)\n * @description When the pressed thing goes up and was not pressed long enough, wait a bit more before execution\n * @private\n */\nexport class PressHandler {\n\n constructor(delay = 200) {\n this.delay = delay;\n this.time = 0;\n this.timeout = null;\n }\n\n down() {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n this.time = new Date().getTime();\n }\n\n up(cb) {\n if (!this.time) {\n return;\n }\n\n const elapsed = new Date().getTime() - this.time;\n if (elapsed < this.delay) {\n this.timeout = setTimeout(() => {\n cb();\n this.timeout = null;\n this.time = 0;\n }, this.delay);\n }\n else {\n cb();\n this.time = 0;\n }\n }\n\n}\n","import { KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport arrow from '../icons/arrow.svg';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractButton } from './AbstractButton';\n\nexport function getOrientedArrow(direction) {\n let angle = 0;\n switch (direction) {\n // @formatter:off\n case 'up': angle = 90; break;\n case 'right': angle = 180; break;\n case 'down': angle = -90; break;\n default: angle = 0; break;\n // @formatter:on\n }\n\n return arrow.replace('rotate(0', `rotate(${angle}`);\n}\n\n/**\n * @summary Navigation bar move button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AbstractMoveButton extends AbstractButton {\n\n static groupId = 'move';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {number} value\n */\n constructor(navbar, value) {\n super(navbar, 'psv-button--hover-scale psv-move-button');\n\n this.container.title = this.psv.config.lang.move;\n\n /**\n * @override\n * @property {{longitude: boolean, latitude: boolean}} value\n * @property {PressHandler} handler\n */\n this.prop = {\n ...this.prop,\n value : value,\n handler: new PressHandler(),\n };\n\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('keydown', this);\n this.container.addEventListener('keyup', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.__onMouseUp();\n\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(); break;\n case 'mouseup': this.__onMouseUp(); break;\n case 'touchend': this.__onMouseUp(); break;\n case 'keydown': e.key === KEY_CODES.Enter && this.__onMouseDown(); break;\n case 'keyup': e.key === KEY_CODES.Enter && this.__onMouseUp(); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return {\n initial: !SYSTEM.isTouchEnabled.initial,\n promise: SYSTEM.isTouchEnabled.promise.then(enabled => !enabled),\n };\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @private\n */\n __onMouseDown() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.psv.__stopAll();\n this.psv.dynamics.position.roll(this.prop.value);\n this.prop.handler.down();\n }\n\n /**\n * @private\n */\n __onMouseUp() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.handler.up(() => {\n this.psv.dynamics.position.stop();\n this.psv.resetIdleTimer();\n });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move down button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveDownButton extends AbstractMoveButton {\n\n static id = 'moveDown';\n static icon = getOrientedArrow('down');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { latitude: true });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move left button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveLeftButton extends AbstractMoveButton {\n\n static id = 'moveLeft';\n static icon = getOrientedArrow('left');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { longitude: true });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move right button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveRightButton extends AbstractMoveButton {\n\n static id = 'moveRight';\n static icon = getOrientedArrow('right');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { longitude: false });\n }\n\n}\n","import { AbstractMoveButton, getOrientedArrow } from './AbstractMoveButton';\n\n/**\n * @summary Navigation bar move up button class\n * @extends PSV.buttons.AbstractMoveButton\n * @memberof PSV.buttons\n */\nexport class MoveUpButton extends AbstractMoveButton {\n\n static id = 'moveUp';\n static icon = getOrientedArrow('up');\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, { latitude: false });\n }\n\n}\n","import { KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class AbstractZoomButton extends AbstractButton {\n\n static groupId = 'zoom';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {number} value\n */\n constructor(navbar, value) {\n super(navbar, 'psv-button--hover-scale psv-zoom-button');\n\n /**\n * @override\n * @property {boolean} value\n * @property {PressHandler} handler\n */\n this.prop = {\n ...this.prop,\n value : value,\n handler: new PressHandler(),\n };\n\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('keydown', this);\n this.container.addEventListener('keyup', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.__onMouseUp();\n\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(); break;\n case 'mouseup': this.__onMouseUp(); break;\n case 'touchend': this.__onMouseUp(); break;\n case 'keydown': e.key === KEY_CODES.Enter && this.__onMouseDown(); break;\n case 'keyup': e.key === KEY_CODES.Enter && this.__onMouseUp(); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return {\n initial: !SYSTEM.isTouchEnabled.initial,\n promise: SYSTEM.isTouchEnabled.promise.then(enabled => !enabled),\n };\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @private\n */\n __onMouseDown() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.psv.dynamics.zoom.roll(this.prop.value);\n this.prop.handler.down();\n }\n\n /**\n * @private\n */\n __onMouseUp() {\n if (!this.prop.enabled) {\n return;\n }\n\n this.prop.handler.up(() => this.psv.dynamics.zoom.stop());\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomIn from '../icons/zoom-in.svg';\n\n/**\n * @summary Navigation bar zoom-in button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomInButton extends AbstractZoomButton {\n\n static id = 'zoomIn';\n static icon = zoomIn;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, false);\n }\n\n}\n","import { AbstractZoomButton } from './AbstractZoomButton';\nimport zoomOut from '../icons/zoom-out.svg';\n\n/**\n * @summary Navigation bar zoom-out button class\n * @extends PSV.buttons.AbstractZoomButton\n * @memberof PSV.buttons\n */\nexport class ZoomOutButton extends AbstractZoomButton {\n\n static id = 'zoomOut';\n static icon = zoomOut;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, true);\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { getStyle, Slider } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\n/**\n * @summary Navigation bar zoom button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class ZoomRangeButton extends AbstractButton {\n\n static id = 'zoomRange';\n static groupId = 'zoom';\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-zoom-range', false, false);\n\n /**\n * @override\n * @property {number} mediaMinWidth\n */\n this.prop = {\n ...this.prop,\n mediaMinWidth: 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomRange = document.createElement('div');\n this.zoomRange.className = 'psv-zoom-range-line';\n this.container.appendChild(this.zoomRange);\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.zoomValue = document.createElement('div');\n this.zoomValue.className = 'psv-zoom-range-handle';\n this.zoomRange.appendChild(this.zoomValue);\n\n /**\n * @member {PSV.Slider}\n * @readonly\n * @private\n */\n this.slider = new Slider({\n container: this.container,\n direction: Slider.HORIZONTAL,\n onUpdate : e => this.__onSliderUpdate(e),\n });\n\n this.prop.mediaMinWidth = parseInt(getStyle(this.container, 'maxWidth'), 10);\n\n this.psv.on(EVENTS.ZOOM_UPDATED, this);\n if (this.psv.prop.ready) {\n this.__moveZoomValue(this.psv.getZoomLevel());\n }\n else {\n this.psv.once(EVENTS.READY, this);\n }\n\n this.refreshUi();\n }\n\n /**\n * @override\n */\n destroy() {\n this.slider.destroy();\n\n delete this.zoomRange;\n delete this.zoomValue;\n\n this.psv.off(EVENTS.ZOOM_UPDATED, this);\n this.psv.off(EVENTS.READY, this);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.ZOOM_UPDATED: this.__moveZoomValue(e.args[0]); break;\n case EVENTS.READY: this.__moveZoomValue(this.psv.getZoomLevel()); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n isSupported() {\n return {\n initial: !SYSTEM.isTouchEnabled.initial,\n promise: SYSTEM.isTouchEnabled.promise.then(enabled => !enabled),\n };\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.supported) {\n if (this.psv.prop.size.width <= this.prop.mediaMinWidth && this.prop.visible) {\n this.hide();\n }\n else if (this.psv.prop.size.width > this.prop.mediaMinWidth && !this.prop.visible) {\n this.show();\n }\n }\n }\n\n /**\n * @override\n */\n onClick() {\n // nothing\n }\n\n /**\n * @summary Moves the zoom cursor\n * @param {number} level\n * @private\n */\n __moveZoomValue(level) {\n this.zoomValue.style.left = (level / 100 * this.zoomRange.offsetWidth - this.zoomValue.offsetWidth / 2) + 'px';\n }\n\n\n /**\n * @summary Zoom change\n * @private\n */\n __onSliderUpdate(e) {\n if (e.mousedown) {\n this.psv.zoom(e.value * 100);\n }\n }\n\n}\n","import { EventEmitter } from 'uevent';\n\n/**\n * @namespace PSV.plugins\n */\n\n/**\n * @summary Base plugins class\n * @memberof PSV.plugins\n * @abstract\n */\nexport class AbstractPlugin extends EventEmitter {\n\n /**\n * @summary Unique identifier of the plugin\n * @member {string}\n * @readonly\n * @static\n */\n static id = null;\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super();\n\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n }\n\n /**\n * @summary Initializes the plugin\n * @package\n */\n init() {\n }\n\n /**\n * @summary Destroys the plugin\n * @package\n */\n destroy() {\n delete this.psv;\n }\n\n}\n","import { AbstractAdapter } from '../adapters/AbstractAdapter';\nimport { EquirectangularAdapter } from '../adapters/equirectangular';\nimport { AbstractPlugin } from '../plugins/AbstractPlugin';\nimport { PSVError } from '../PSVError';\nimport { bound, clone, deepmerge, each, isNil, logWarn, parseAngle, parseSpeed, pluginInterop } from '../utils';\nimport { ACTIONS, KEY_CODES } from './constants';\n\n/**\n * @summary Default options\n * @type {PSV.Options}\n * @memberOf PSV\n * @constant\n */\nexport const DEFAULTS = {\n panorama : null,\n container : null,\n adapter : null,\n plugins : [],\n caption : null,\n description : null,\n downloadUrl : null,\n loadingImg : null,\n loadingTxt : 'Loading...',\n size : null,\n fisheye : false,\n minFov : 30,\n maxFov : 90,\n defaultZoomLvl : 50,\n defaultLong : 0,\n defaultLat : 0,\n sphereCorrection : null,\n moveSpeed : 1,\n zoomSpeed : 1,\n autorotateDelay : null,\n autorotateIdle : false,\n autorotateSpeed : '2rpm',\n autorotateLat : null,\n moveInertia : true,\n mousewheel : true,\n mousemove : true,\n captureCursor : false,\n mousewheelCtrlKey : false,\n touchmoveTwoFingers: false,\n useXmpData : true,\n panoData : null,\n requestHeaders : null,\n canvasBackground : '#000',\n withCredentials : false,\n navbar : [\n 'autorotate',\n 'zoom',\n 'move',\n 'download',\n 'description',\n 'caption',\n 'fullscreen',\n ],\n lang : {\n autorotate: 'Automatic rotation',\n zoom : 'Zoom',\n zoomOut : 'Zoom out',\n zoomIn : 'Zoom in',\n move : 'Move',\n download : 'Download',\n fullscreen: 'Fullscreen',\n menu : 'Menu',\n twoFingers: 'Use two fingers to navigate',\n ctrlZoom : 'Use ctrl + scroll to zoom the image',\n loadError : 'The panorama can\\'t be loaded',\n },\n keyboard : {\n [KEY_CODES.ArrowUp] : ACTIONS.ROTATE_LAT_UP,\n [KEY_CODES.ArrowDown] : ACTIONS.ROTATE_LAT_DOWN,\n [KEY_CODES.ArrowRight]: ACTIONS.ROTATE_LONG_RIGHT,\n [KEY_CODES.ArrowLeft] : ACTIONS.ROTATE_LONG_LEFT,\n [KEY_CODES.PageUp] : ACTIONS.ZOOM_IN,\n [KEY_CODES.PageDown] : ACTIONS.ZOOM_OUT,\n [KEY_CODES.Plus] : ACTIONS.ZOOM_IN,\n [KEY_CODES.Minus] : ACTIONS.ZOOM_OUT,\n [KEY_CODES.Space] : ACTIONS.TOGGLE_AUTOROTATE,\n },\n};\n\n/**\n * @summary List of unmodifiable options and their error messages\n * @private\n */\nexport const READONLY_OPTIONS = {\n panorama : 'Use setPanorama method to change the panorama',\n panoData : 'Use setPanorama method to change the panorama',\n container: 'Cannot change viewer container',\n adapter : 'Cannot change adapter',\n plugins : 'Cannot change plugins',\n};\n\n/**\n * @summary List of deprecated options and their warning messages\n * @private\n */\nexport const DEPRECATED_OPTIONS = {\n zoomButtonIncrement : 'zoomButtonIncrement is deprecated, use zoomSpeed',\n mousewheelSpeed : 'mousewheelSpeed is deprecated, use zoomSpeed',\n sphereCorrectionReorder: 'sphereCorrectionReorder is deprecated',\n};\n\n/**\n * @summary Parsers/validators for each option\n * @private\n */\nexport const CONFIG_PARSERS = {\n container : (container) => {\n if (!container) {\n throw new PSVError('No value given for container.');\n }\n return container;\n },\n adapter : (adapter) => {\n if (!adapter) {\n adapter = [EquirectangularAdapter];\n }\n else if (Array.isArray(adapter)) {\n adapter = [pluginInterop(adapter[0], AbstractAdapter), adapter[1]];\n }\n else {\n adapter = [pluginInterop(adapter, AbstractAdapter)];\n }\n if (!adapter[0]) {\n throw new PSVError('Un undefined value with given for adapter.');\n }\n return adapter;\n },\n defaultLong : (defaultLong) => {\n // defaultLat is between 0 and PI\n return parseAngle(defaultLong);\n },\n defaultLat : (defaultLat) => {\n // defaultLat is between -PI/2 and PI/2\n return parseAngle(defaultLat, true);\n },\n minFov : (minFov, config) => {\n // minFov and maxFov must be ordered\n if (config.maxFov < minFov) {\n logWarn('maxFov cannot be lower than minFov');\n minFov = config.maxFov;\n }\n // minFov between 1 and 179\n return bound(minFov, 1, 179);\n },\n maxFov : (maxFov, config) => {\n // minFov and maxFov must be ordered\n if (maxFov < config.minFov) {\n maxFov = config.minFov;\n }\n // maxFov between 1 and 179\n return bound(maxFov, 1, 179);\n },\n lang : (lang) => {\n if (Array.isArray(lang.twoFingers)) {\n logWarn('lang.twoFingers must not be an array');\n lang.twoFingers = lang.twoFingers[0];\n }\n return {\n ...DEFAULTS.lang,\n ...lang,\n };\n },\n keyboard : (keyboard) => {\n // keyboard=true becomes the default map\n if (keyboard === true) {\n return clone(DEFAULTS.keyboard);\n }\n return keyboard;\n },\n autorotateLat : (autorotateLat, config) => {\n // default autorotateLat is defaultLat\n if (autorotateLat === null) {\n return parseAngle(config.defaultLat, true);\n }\n // autorotateLat is between -PI/2 and PI/2\n else {\n return parseAngle(autorotateLat, true);\n }\n },\n autorotateSpeed: (autorotateSpeed) => {\n return parseSpeed(autorotateSpeed);\n },\n autorotateIdle : (autorotateIdle, config) => {\n if (autorotateIdle && isNil(config.autorotateDelay)) {\n logWarn('autorotateIdle requires a non null autorotateDelay');\n return false;\n }\n return autorotateIdle;\n },\n fisheye : (fisheye) => {\n // translate boolean fisheye to amount\n if (fisheye === true) {\n return 1;\n }\n else if (fisheye === false) {\n return 0;\n }\n return fisheye;\n },\n plugins : (plugins) => {\n return plugins\n .map((plugin) => {\n if (Array.isArray(plugin)) {\n plugin = [pluginInterop(plugin[0], AbstractPlugin), plugin[1]];\n }\n else {\n plugin = [pluginInterop(plugin, AbstractPlugin)];\n }\n if (!plugin[0]) {\n throw new PSVError('Un undefined value was given for plugins.');\n }\n return plugin;\n });\n },\n};\n\n/**\n * @summary Merge user config with default config and performs validation\n * @param {PSV.Options} options\n * @returns {PSV.Options}\n * @memberOf PSV\n * @private\n */\nexport function getConfig(options) {\n const tempConfig = clone(DEFAULTS);\n deepmerge(tempConfig, options);\n\n const config = {};\n\n each(tempConfig, (value, key) => {\n if (DEPRECATED_OPTIONS[key]) {\n logWarn(DEPRECATED_OPTIONS[key]);\n return;\n }\n\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (CONFIG_PARSERS[key]) {\n config[key] = CONFIG_PARSERS[key](value, tempConfig);\n }\n else {\n config[key] = value;\n }\n });\n\n return config;\n}\n","import { DescriptionButton } from '../buttons/DescriptionButton';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Navbar caption class\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class NavbarCaption extends AbstractComponent {\n\n static id = 'caption';\n\n /**\n * @param {PSV.components.Navbar} navbar\n * @param {string} caption\n */\n constructor(navbar, caption) {\n super(navbar, 'psv-caption');\n\n /**\n * @override\n * @property {string} id\n * @property {boolean} collapsable\n * @property {number} width\n * @property {number} contentWidth - width of the caption content\n */\n this.prop = {\n ...this.prop,\n id : this.constructor.id,\n collapsable : false,\n width : 0,\n contentWidth: 0,\n };\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-caption-content';\n this.container.appendChild(this.content);\n\n this.setCaption(caption);\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n this.show();\n this.content.innerHTML = html;\n this.prop.contentWidth = html ? this.content.offsetWidth : 0;\n this.refreshUi();\n }\n\n /**\n * @summary Toggles content and icon depending on available space\n * @private\n */\n refreshUi() {\n const availableWidth = this.container.offsetWidth;\n if (availableWidth >= this.prop.contentWidth) {\n this.show();\n }\n else if (availableWidth < this.prop.contentWidth) {\n this.hide();\n }\n this.__refreshButton();\n }\n\n /**\n * @override\n */\n hide() {\n this.content.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @override\n */\n show() {\n this.content.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @private\n */\n __refreshButton() {\n this.psv.navbar.getButton(DescriptionButton.id, false)?.refreshUi(true);\n }\n\n}\n","import { AutorotateButton } from '../buttons/AutorotateButton';\nimport { CustomButton } from '../buttons/CustomButton';\nimport { DescriptionButton } from '../buttons/DescriptionButton';\nimport { DownloadButton } from '../buttons/DownloadButton';\nimport { FullscreenButton } from '../buttons/FullscreenButton';\nimport { MenuButton } from '../buttons/MenuButton';\nimport { MoveDownButton } from '../buttons/MoveDownButton';\nimport { MoveLeftButton } from '../buttons/MoveLeftButton';\nimport { MoveRightButton } from '../buttons/MoveRightButton';\nimport { MoveUpButton } from '../buttons/MoveUpButton';\nimport { ZoomInButton } from '../buttons/ZoomInButton';\nimport { ZoomOutButton } from '../buttons/ZoomOutButton';\nimport { ZoomRangeButton } from '../buttons/ZoomRangeButton';\nimport { DEFAULTS } from '../data/config';\nimport { PSVError } from '../PSVError';\nimport { clone, logWarn } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\nimport { NavbarCaption } from './NavbarCaption';\n\n/**\n * @summary List of available buttons\n * @type {Object>}\n * @private\n */\nconst AVAILABLE_BUTTONS = {};\n\n/**\n * @summary List of available buttons\n * @type {Object>>}\n * @private\n */\nconst AVAILABLE_GROUPS = {};\n\n/**\n * @summary Register a new button available for all viewers\n * @param {Class} button\n * @param {'start' | 'end' | '[id]:left' | '[id]:right'} [defaultPosition]\n * If provided the default configuration of the navbar will be modified.\n * @memberOf PSV\n */\nexport function registerButton(button, defaultPosition) {\n if (!button.id) {\n throw new PSVError('Button ID is required');\n }\n\n AVAILABLE_BUTTONS[button.id] = button;\n\n if (button.groupId) {\n AVAILABLE_GROUPS[button.groupId] = AVAILABLE_GROUPS[button.groupId] || [];\n AVAILABLE_GROUPS[button.groupId].push(button);\n }\n\n if (typeof defaultPosition === 'string') {\n switch (defaultPosition) {\n case 'start':\n DEFAULTS.navbar.unshift(button.id);\n break;\n case 'end':\n DEFAULTS.navbar.push(button.id);\n break;\n default:\n const [id, pos] = defaultPosition.split(':');\n DEFAULTS.navbar.splice(DEFAULTS.navbar.indexOf(id) + (pos === 'right' ? 1 : 0), 0, button.id);\n }\n }\n}\n\n[\n AutorotateButton,\n ZoomOutButton,\n ZoomRangeButton,\n ZoomInButton,\n DescriptionButton,\n DownloadButton,\n FullscreenButton,\n MoveLeftButton,\n MoveRightButton,\n MoveUpButton,\n MoveDownButton,\n].forEach(registerButton);\n\n/**\n * @summary Navigation bar component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Navbar extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-navbar psv--capture-event');\n\n /**\n * @summary List of buttons of the navbar\n * @member {PSV.buttons.AbstractButton[]}\n * @override\n */\n this.children = [];\n\n /**\n * @summary List of collapsed buttons\n * @member {PSV.buttons.AbstractButton[]}\n * @private\n */\n this.collapsed = [];\n }\n\n /**\n * @summary Change the buttons visible on the navbar\n * @param {string|Array} buttons\n * @throws {PSV.PSVError} when a button is unknown\n */\n setButtons(buttons) {\n this.children.slice().forEach(item => item.destroy());\n this.children.length = 0;\n\n const cleanedButtons = this.__cleanButtons(buttons);\n\n // force description button if caption is present (used on narrow screens)\n if (cleanedButtons.indexOf(NavbarCaption.id) !== -1 && cleanedButtons.indexOf(DescriptionButton.id) === -1) {\n cleanedButtons.splice(cleanedButtons.indexOf(NavbarCaption.id), 0, DescriptionButton.id);\n }\n\n /* eslint-disable no-new */\n cleanedButtons.forEach((button) => {\n if (typeof button === 'object') {\n new CustomButton(this, button);\n }\n else if (AVAILABLE_BUTTONS[button]) {\n new AVAILABLE_BUTTONS[button](this);\n }\n else if (AVAILABLE_GROUPS[button]) {\n AVAILABLE_GROUPS[button].forEach(buttonCtor => new buttonCtor(this)); // eslint-disable-line new-cap\n }\n else if (button === NavbarCaption.id) {\n new NavbarCaption(this, this.psv.config.caption);\n }\n else {\n throw new PSVError('Unknown button ' + button);\n }\n });\n\n new MenuButton(this);\n /* eslint-enable no-new */\n\n this.children.forEach((item) => {\n if (typeof item.checkSupported === 'function') {\n item.checkSupported();\n }\n });\n }\n\n /**\n * @summary Sets the bar caption\n * @param {string} html\n */\n setCaption(html) {\n const caption = this.getButton(NavbarCaption.id, false);\n caption?.setCaption(html);\n }\n\n /**\n * @summary Returns a button by its identifier\n * @param {string} id\n * @param {boolean} [warnNotFound=true]\n * @returns {PSV.buttons.AbstractButton}\n */\n getButton(id, warnNotFound = true) {\n let button = null;\n\n this.children.some((item) => {\n if (item.prop.id === id) {\n button = item;\n return true;\n }\n else {\n return false;\n }\n });\n\n if (!button && warnNotFound) {\n logWarn(`button \"${id}\" not found in the navbar`);\n }\n\n return button;\n }\n\n /**\n * @summary Shows the navbar\n */\n show() {\n this.container.classList.add('psv-navbar--open');\n this.prop.visible = true;\n }\n\n /**\n * @summary Hides the navbar\n */\n hide() {\n this.container.classList.remove('psv-navbar--open');\n this.prop.visible = false;\n }\n\n /**\n * @override\n */\n refreshUi() {\n super.refreshUi();\n\n if (this.psv.prop.uiRefresh === true) {\n const availableWidth = this.container.offsetWidth;\n\n let totalWidth = 0;\n const visibleButtons = [];\n const collapsableButtons = [];\n\n this.children.forEach((item) => {\n if (item.prop.visible) {\n totalWidth += item.prop.width;\n visibleButtons.push(item);\n if (item.prop.collapsable) {\n collapsableButtons.push(item);\n }\n }\n });\n\n if (!visibleButtons.length) {\n return;\n }\n\n if (availableWidth < totalWidth && collapsableButtons.length > 0) {\n collapsableButtons.forEach(item => item.collapse());\n this.collapsed = collapsableButtons;\n\n this.getButton(MenuButton.id).show(false);\n }\n else if (availableWidth >= totalWidth && this.collapsed.length > 0) {\n this.collapsed.forEach(item => item.uncollapse());\n this.collapsed = [];\n\n this.getButton(MenuButton.id).hide(false);\n }\n\n const caption = this.getButton(NavbarCaption.id, false);\n if (caption) {\n caption.refreshUi();\n }\n }\n }\n\n /**\n * @summary Ensure the buttons configuration is correct\n * @private\n */\n __cleanButtons(buttons) {\n // true becomes the default array\n if (buttons === true) {\n return clone(DEFAULTS.navbar);\n }\n // can be a space or coma separated list\n else if (typeof buttons === 'string') {\n return buttons.split(/[ ,]/);\n }\n else {\n return buttons || [];\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { bound, getStyle } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Loader component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Loader extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-loader-container');\n\n /**\n * @summary Inner container for vertical center\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.loader = document.createElement('div');\n this.loader.className = 'psv-loader';\n this.container.appendChild(this.loader);\n\n /**\n * @summary Animation canvas\n * @member {HTMLCanvasElement}\n * @readonly\n * @private\n */\n this.canvas = document.createElement('canvas');\n this.canvas.className = 'psv-loader-canvas';\n\n this.canvas.width = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.canvas.height = this.loader.clientWidth * SYSTEM.pixelRatio;\n this.loader.appendChild(this.canvas);\n\n /**\n * @override\n * @property {number} thickness\n * @property {string} current\n */\n this.prop = {\n ...this.prop,\n tickness: (this.loader.offsetWidth - this.loader.clientWidth) / 2 * SYSTEM.pixelRatio,\n current : null,\n };\n\n this.refreshUi();\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.loader;\n delete this.canvas;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n refreshUi() {\n if (this.prop.current !== (this.psv.config.loadingImg || this.psv.config.loadingTxt)) {\n if (this.prop.current) {\n this.loader.removeChild(this.loader.lastChild);\n }\n\n let inner;\n if (this.psv.config.loadingImg) {\n inner = document.createElement('img');\n inner.className = 'psv-loader-image';\n inner.src = this.psv.config.loadingImg;\n }\n else if (this.psv.config.loadingTxt) {\n inner = document.createElement('div');\n inner.className = 'psv-loader-text';\n inner.innerHTML = this.psv.config.loadingTxt;\n }\n if (inner) {\n const size = Math.round(Math.sqrt(2 * Math.pow((this.canvas.width / 2 - this.prop.tickness / 2) / SYSTEM.pixelRatio, 2)));\n inner.style.maxWidth = size + 'px';\n inner.style.maxHeight = size + 'px';\n this.loader.appendChild(inner);\n }\n\n this.prop.current = this.psv.config.loadingImg || this.psv.config.loadingTxt;\n }\n }\n\n /**\n * @summary Sets the loader progression\n * @param {number} value - from 0 to 100\n */\n setProgress(value) {\n const context = this.canvas.getContext('2d');\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n context.lineWidth = this.prop.tickness;\n context.strokeStyle = getStyle(this.loader, 'color');\n\n context.beginPath();\n context.arc(\n this.canvas.width / 2, this.canvas.height / 2,\n this.canvas.width / 2 - this.prop.tickness / 2,\n -Math.PI / 2, bound(value, 0, 100) / 100 * 2 * Math.PI - Math.PI / 2\n );\n context.stroke();\n\n this.psv.trigger(EVENTS.LOAD_PROGRESS, Math.round(value));\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Notification component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Notification extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-notification');\n\n /**\n * @override\n * @property {*} timeout\n */\n this.prop = {\n ...this.prop,\n visible : false,\n contentId: undefined,\n timeout : null,\n };\n\n /**\n * Notification content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-notification-content';\n this.container.appendChild(this.content);\n\n this.content.addEventListener('click', () => this.hide());\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Notification cannot be toggled');\n }\n\n /**\n * @summary Displays a notification on the viewer\n * @param {Object|string} config\n * @param {string} [config.id] - unique identifier to use with \"hide\"\n * @param {string} config.content\n * @param {number} [config.timeout]\n * @fires PSV.show-notification\n *\n * @example\n * viewer.showNotification({ content: 'Hello world', timeout: 5000 })\n * @example\n * viewer.showNotification('Hello world')\n */\n show(config) {\n if (this.prop.timeout) {\n clearTimeout(this.prop.timeout);\n this.prop.timeout = null;\n }\n\n if (typeof config === 'string') {\n config = { content: config };\n }\n\n this.prop.contentId = config.id;\n this.content.innerHTML = config.content;\n\n this.container.classList.add('psv-notification--visible');\n this.prop.visible = true;\n\n this.psv.trigger(EVENTS.SHOW_NOTIFICATION, config.id);\n\n if (config.timeout) {\n this.prop.timeout = setTimeout(() => this.hide(config.id), config.timeout);\n }\n }\n\n /**\n * @summary Hides the notification\n * @param {string} [id]\n * @fires PSV.hide-notification\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n this.container.classList.remove('psv-notification--visible');\n this.prop.visible = false;\n\n this.prop.contentId = undefined;\n\n this.psv.trigger(EVENTS.HIDE_NOTIFICATION, contentId);\n }\n }\n\n}\n","import { EVENTS, KEY_CODES } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Overlay component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Overlay extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-overlay');\n\n /**\n * @override\n * @property {string} contentId\n * @property {boolean} dissmisable\n */\n this.prop = {\n ...this.prop,\n contentId : undefined,\n dissmisable: true,\n };\n\n /**\n * Image container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.image = document.createElement('div');\n this.image.className = 'psv-overlay-image';\n this.container.appendChild(this.image);\n\n /**\n * Text container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.text = document.createElement('div');\n this.text.className = 'psv-overlay-text';\n this.container.appendChild(this.text);\n\n /**\n * Subtext container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.subtext = document.createElement('div');\n this.subtext.className = 'psv-overlay-subtext';\n this.container.appendChild(this.subtext);\n\n this.psv.on(EVENTS.CLICK, this);\n this.psv.on(EVENTS.KEY_PRESS, this);\n\n super.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.CLICK, this);\n this.psv.off(EVENTS.KEY_PRESS, this);\n\n delete this.image;\n delete this.text;\n delete this.subtext;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case EVENTS.CLICK:\n if (this.isVisible() && this.prop.dissmisable) {\n this.hide();\n e.stopPropagation();\n }\n break;\n case EVENTS.KEY_PRESS:\n if (this.isVisible() && this.prop.dissmisable && e.args[0] === KEY_CODES.Escape) {\n this.hide();\n e.preventDefault();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Overlay cannot be toggled');\n }\n\n /**\n * @summary Displays an overlay on the viewer\n * @param {Object|string} config\n * @param {string} [config.id] - unique identifier to use with \"hide\"\n * @param {string} config.image - SVG image/icon displayed above the text\n * @param {string} config.text - main message\n * @param {string} [config.subtext] - secondary message\n * @param {boolean} [config.dissmisable=true] - if the user can hide the overlay by clicking\n * @fires PSV.show-overlay\n */\n show(config) {\n if (typeof config === 'string') {\n config = { text: config };\n }\n\n this.prop.contentId = config.id;\n this.prop.dissmisable = config.dissmisable !== false;\n this.image.innerHTML = config.image || '';\n this.text.innerHTML = config.text || '';\n this.subtext.innerHTML = config.subtext || '';\n\n super.show();\n\n this.psv.trigger(EVENTS.SHOW_OVERLAY, config.id);\n }\n\n /**\n * @summary Hides the overlay\n * @param {string} [id]\n * @fires PSV.hide-overlay\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n super.hide();\n\n this.prop.contentId = undefined;\n\n this.psv.trigger(EVENTS.HIDE_OVERLAY, contentId);\n }\n }\n\n}\n","import { EVENTS, KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { PSVError } from '../PSVError';\nimport { toggleClass } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * @summary Minimum width of the panel\n * @type {number}\n * @constant\n * @private\n */\nconst PANEL_MIN_WIDTH = 200;\n\n/**\n * @summary Panel component\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Panel extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv, 'psv-panel psv--capture-event');\n\n /**\n * @override\n * @property {string} contentId\n * @property {number} mouseX\n * @property {number} mouseY\n * @property {boolean} mousedown\n * @property {function} clickHandler\n * @property {function} keyHandler\n */\n this.prop = {\n ...this.prop,\n visible : false,\n contentId : undefined,\n mouseX : 0,\n mouseY : 0,\n mousedown : false,\n clickHandler: null,\n keyHandler : null,\n width : {},\n };\n\n const resizer = document.createElement('div');\n resizer.className = 'psv-panel-resizer';\n this.container.appendChild(resizer);\n\n const closeBtn = document.createElement('div');\n closeBtn.className = 'psv-panel-close-button';\n this.container.appendChild(closeBtn);\n\n /**\n * @summary Content container\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-panel-content';\n this.container.appendChild(this.content);\n\n // Stop wheel event bubbling from panel\n this.container.addEventListener(SYSTEM.mouseWheelEvent, e => e.stopPropagation());\n\n closeBtn.addEventListener('click', () => this.hide());\n\n // Event for panel resizing + stop bubling\n resizer.addEventListener('mousedown', this);\n resizer.addEventListener('touchstart', this);\n this.psv.container.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchend', this);\n this.psv.container.addEventListener('mousemove', this);\n this.psv.container.addEventListener('touchmove', this);\n\n this.psv.on(EVENTS.KEY_PRESS, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(EVENTS.KEY_PRESS, this);\n\n this.psv.container.removeEventListener('mousemove', this);\n this.psv.container.removeEventListener('touchmove', this);\n this.psv.container.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchend', this);\n\n delete this.prop;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(e); break;\n case 'touchstart': this.__onTouchStart(e); break;\n case 'mousemove': this.__onMouseMove(e); break;\n case 'touchmove': this.__onTouchMove(e); break;\n case 'mouseup': this.__onMouseUp(e); break;\n case 'touchend': this.__onMouseUp(e); break;\n case EVENTS.KEY_PRESS:\n if (this.isVisible() && e.args[0] === KEY_CODES.Escape) {\n this.hide();\n e.preventDefault();\n }\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {string} [id]\n */\n isVisible(id) {\n return this.prop.visible && (!id || !this.prop.contentId || this.prop.contentId === id);\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Panel cannot be toggled');\n }\n\n /**\n * @summary Shows the panel\n * @param {string|Object} config\n * @param {string} [config.id] - unique identifier to use with \"hide\" and to store the user desired width\n * @param {string} config.content - HTML content of the panel\n * @param {boolean} [config.noMargin=false] - remove the default margins\n * @param {string} [config.width] - initial width\n * @param {Function} [config.clickHandler] - called when the user clicks inside the panel or presses the Enter key while an element focused\n * @fires PSV.open-panel\n */\n show(config) {\n const wasVisible = this.isVisible(config.id);\n\n if (typeof config === 'string') {\n config = { content: config };\n }\n\n this.prop.contentId = config.id;\n this.prop.visible = true;\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.content.removeEventListener('keydown', this.prop.keyHandler);\n this.prop.clickHandler = null;\n this.prop.keyHandler = null;\n }\n\n if (config.id && this.prop.width[config.id]) {\n this.container.style.width = this.prop.width[config.id];\n }\n else if (config.width) {\n this.container.style.width = config.width;\n }\n else {\n this.container.style.width = null;\n }\n\n this.content.innerHTML = config.content;\n this.content.scrollTop = 0;\n this.container.classList.add('psv-panel--open');\n\n toggleClass(this.content, 'psv-panel-content--no-margin', config.noMargin === true);\n\n if (config.clickHandler) {\n this.prop.clickHandler = config.clickHandler;\n this.prop.keyHandler = (e) => {\n if (e.key === KEY_CODES.Enter) {\n config.clickHandler(e);\n }\n };\n this.content.addEventListener('click', this.prop.clickHandler);\n this.content.addEventListener('keydown', this.prop.keyHandler);\n\n // focus the first element if possible, after animation ends\n if (!wasVisible) {\n setTimeout(() => {\n this.content.querySelector('a,button,[tabindex]')?.focus();\n }, 300);\n }\n }\n\n this.psv.trigger(EVENTS.OPEN_PANEL, config.id);\n }\n\n /**\n * @summary Hides the panel\n * @param {string} [id]\n * @fires PSV.close-panel\n */\n hide(id) {\n if (this.isVisible(id)) {\n const contentId = this.prop.contentId;\n\n this.prop.visible = false;\n this.prop.contentId = undefined;\n\n this.content.innerHTML = null;\n this.container.classList.remove('psv-panel--open');\n\n if (this.prop.clickHandler) {\n this.content.removeEventListener('click', this.prop.clickHandler);\n this.prop.clickHandler = null;\n }\n\n this.psv.trigger(EVENTS.CLOSE_PANEL, contentId);\n }\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n evt.stopPropagation();\n this.__startResize(evt);\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n evt.stopPropagation();\n this.__startResize(evt.changedTouches[0]);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.prop.mousedown = false;\n this.content.classList.remove('psv-panel-content--no-interaction');\n }\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.prop.mousedown) {\n evt.stopPropagation();\n this.__resize(evt);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (this.prop.mousedown) {\n this.__resize(evt.touches[0]);\n }\n }\n\n /**\n * @summary Initializes the panel resize\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startResize(evt) {\n this.prop.mouseX = evt.clientX;\n this.prop.mouseY = evt.clientY;\n this.prop.mousedown = true;\n this.content.classList.add('psv-panel-content--no-interaction');\n }\n\n /**\n * @summary Resizes the panel\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __resize(evt) {\n const x = evt.clientX;\n const y = evt.clientY;\n const width = Math.max(PANEL_MIN_WIDTH, this.container.offsetWidth - (x - this.prop.mouseX)) + 'px';\n\n if (this.prop.contentId) {\n this.prop.width[this.prop.contentId] = width;\n }\n\n this.container.style.width = width;\n\n this.prop.mouseX = x;\n this.prop.mouseY = y;\n }\n\n}\n","/**\n * @namespace PSV.services\n */\n\n/**\n * @summary Base services class\n * @memberof PSV.services\n * @abstract\n */\nexport class AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n /**\n * @summary Reference to main controller\n * @type {PSV.Viewer}\n * @readonly\n */\n this.psv = psv;\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = psv.config;\n\n /**\n * @summary Properties holder\n * @type {Object}\n * @readonly\n */\n this.prop = psv.prop;\n }\n\n /**\n * @summary Destroys the service\n */\n destroy() {\n delete this.psv;\n delete this.config;\n delete this.prop;\n }\n\n}\n","import * as THREE from 'three';\nimport { MESH_USER_DATA, SPHERE_RADIUS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { applyEulerInverse, parseAngle, parseSpeed } from '../utils';\nimport { AbstractService } from './AbstractService';\n\nconst vector2 = new THREE.Vector2();\nconst vector3 = new THREE.Vector3();\nconst eulerZero = new THREE.Euler(0, 0, 0, 'ZXY');\n\n/**\n * @summary Collections of data converters for the current viewer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class DataHelper extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n }\n\n /**\n * @summary Converts vertical FOV to zoom level\n * @param {number} fov\n * @returns {number}\n */\n fovToZoomLevel(fov) {\n const temp = Math.round((fov - this.config.minFov) / (this.config.maxFov - this.config.minFov) * 100);\n return temp - 2 * (temp - 50);\n }\n\n /**\n * @summary Converts zoom level to vertical FOV\n * @param {number} level\n * @returns {number}\n */\n zoomLevelToFov(level) {\n return this.config.maxFov + (level / 100) * (this.config.minFov - this.config.maxFov);\n }\n\n /**\n * @summary Convert vertical FOV to horizontal FOV\n * @param {number} vFov\n * @returns {number}\n */\n vFovToHFov(vFov) {\n return THREE.MathUtils.radToDeg(2 * Math.atan(Math.tan(THREE.MathUtils.degToRad(vFov) / 2) * this.prop.aspect));\n }\n\n /**\n * @summary Converts a speed into a duration from current position to a new position\n * @param {string|number} value\n * @param {number} angle\n * @returns {number}\n */\n speedToDuration(value, angle) {\n if (!value || typeof value !== 'number') {\n // desired radial speed\n const speed = value ? parseSpeed(value) : this.config.autorotateSpeed;\n // compute duration\n return angle / Math.abs(speed) * 1000;\n }\n else {\n return Math.abs(value);\n }\n }\n\n /**\n * @summary Converts pixel texture coordinates to spherical radians coordinates\n * @param {PSV.Point} point\n * @returns {PSV.Position}\n * @throws {PSV.PSVError} when the current adapter does not support texture coordinates\n */\n textureCoordsToSphericalCoords(point) {\n const panoData = this.prop.panoData;\n if (!panoData) {\n throw new PSVError('Current adapter does not support texture coordinates.');\n }\n\n const relativeX = (point.x + panoData.croppedX) / panoData.fullWidth * Math.PI * 2;\n const relativeY = (point.y + panoData.croppedY) / panoData.fullHeight * Math.PI;\n\n const result = {\n longitude: relativeX >= Math.PI ? relativeX - Math.PI : relativeX + Math.PI,\n latitude : Math.PI / 2 - relativeY,\n };\n\n // Apply panoData pose and sphereCorrection\n if (!eulerZero.equals(this.psv.renderer.mesh.rotation) || !eulerZero.equals(this.psv.renderer.meshContainer.rotation)) {\n this.sphericalCoordsToVector3(result, vector3);\n vector3.applyEuler(this.psv.renderer.mesh.rotation);\n vector3.applyEuler(this.psv.renderer.meshContainer.rotation);\n return this.vector3ToSphericalCoords(vector3);\n }\n else {\n return result;\n }\n }\n\n /**\n * @summary Converts spherical radians coordinates to pixel texture coordinates\n * @param {PSV.Position} position\n * @returns {PSV.Point}\n * @throws {PSV.PSVError} when the current adapter does not support texture coordinates\n */\n sphericalCoordsToTextureCoords(position) {\n const panoData = this.prop.panoData;\n if (!panoData) {\n throw new PSVError('Current adapter does not support texture coordinates.');\n }\n\n // Apply panoData pose and sphereCorrection\n if (!eulerZero.equals(this.psv.renderer.mesh.rotation) || !eulerZero.equals(this.psv.renderer.meshContainer.rotation)) {\n this.sphericalCoordsToVector3(position, vector3);\n applyEulerInverse(vector3, this.psv.renderer.meshContainer.rotation);\n applyEulerInverse(vector3, this.psv.renderer.mesh.rotation);\n position = this.vector3ToSphericalCoords(vector3);\n }\n\n const relativeLong = position.longitude / Math.PI / 2 * panoData.fullWidth;\n const relativeLat = position.latitude / Math.PI * panoData.fullHeight;\n\n return {\n x: Math.round(position.longitude < Math.PI ? relativeLong + panoData.fullWidth / 2 : relativeLong - panoData.fullWidth / 2) - panoData.croppedX,\n y: Math.round(panoData.fullHeight / 2 - relativeLat) - panoData.croppedY,\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to a THREE.Vector3\n * @param {PSV.Position} position\n * @param {external:THREE.Vector3} [vector]\n * @returns {external:THREE.Vector3}\n */\n sphericalCoordsToVector3(position, vector) {\n if (!vector) {\n vector = new THREE.Vector3();\n }\n vector.x = SPHERE_RADIUS * -Math.cos(position.latitude) * Math.sin(position.longitude);\n vector.y = SPHERE_RADIUS * Math.sin(position.latitude);\n vector.z = SPHERE_RADIUS * Math.cos(position.latitude) * Math.cos(position.longitude);\n return vector;\n }\n\n /**\n * @summary Converts a THREE.Vector3 to spherical radians coordinates\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Position}\n */\n vector3ToSphericalCoords(vector) {\n const phi = Math.acos(vector.y / Math.sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z));\n const theta = Math.atan2(vector.x, vector.z);\n\n return {\n longitude: theta < 0 ? -theta : Math.PI * 2 - theta,\n latitude : Math.PI / 2 - phi,\n };\n }\n\n /**\n * @summary Converts position on the viewer to a THREE.Vector3\n * @param {PSV.Point} viewerPoint\n * @returns {external:THREE.Vector3}\n */\n viewerCoordsToVector3(viewerPoint) {\n const sphereIntersect = this.getIntersections(viewerPoint).filter(i => i.object.userData[MESH_USER_DATA]);\n\n if (sphereIntersect.length) {\n return sphereIntersect[0].point;\n }\n else {\n return null;\n }\n }\n\n /**\n * @summary Converts a THREE.Vector3 to position on the viewer\n * @param {external:THREE.Vector3} vector\n * @returns {PSV.Point}\n */\n vector3ToViewerCoords(vector) {\n const vectorClone = vector.clone();\n vectorClone.project(this.psv.renderer.camera);\n\n return {\n x: Math.round((vectorClone.x + 1) / 2 * this.prop.size.width),\n y: Math.round((1 - vectorClone.y) / 2 * this.prop.size.height),\n };\n }\n\n /**\n * @summary Converts spherical radians coordinates to position on the viewer\n * @param {PSV.Position} position\n * @returns {PSV.Point}\n */\n sphericalCoordsToViewerCoords(position) {\n return this.vector3ToViewerCoords(this.sphericalCoordsToVector3(position, vector3));\n }\n\n /**\n * @summary Returns intersections with objects in the scene\n * @param {PSV.Point} viewerPoint\n * @return {external:THREE.Intersection[]}\n */\n getIntersections(viewerPoint) {\n vector2.x = 2 * viewerPoint.x / this.prop.size.width - 1;\n vector2.y = -2 * viewerPoint.y / this.prop.size.height + 1;\n\n this.psv.renderer.raycaster.setFromCamera(vector2, this.psv.renderer.camera);\n\n return this.psv.renderer.raycaster.intersectObjects(this.psv.renderer.scene.children, true)\n .filter(i => !!i.object.userData);\n }\n\n /**\n * @summary Converts x/y to latitude/longitude if present and ensure boundaries\n * @param {PSV.ExtendedPosition} position\n * @returns {PSV.Position}\n */\n cleanPosition(position) {\n if (position.x !== undefined && position.y !== undefined) {\n return this.textureCoordsToSphericalCoords(position);\n }\n else {\n return {\n longitude: parseAngle(position.longitude),\n latitude : parseAngle(position.latitude, true),\n };\n }\n }\n\n /**\n * @summary Ensure a SphereCorrection object is valid\n * @param {PSV.SphereCorrection} sphereCorrection\n * @returns {PSV.SphereCorrection}\n */\n cleanSphereCorrection(sphereCorrection) {\n return {\n pan : parseAngle(sphereCorrection?.pan || 0),\n tilt: parseAngle(sphereCorrection?.tilt || 0, true),\n roll: parseAngle(sphereCorrection?.roll || 0, true, false),\n };\n }\n\n /**\n * @summary Parse the pose angles of the pano data\n * @param {PSV.PanoData} panoData\n * @returns {PSV.SphereCorrection}\n */\n cleanPanoramaPose(panoData) {\n return {\n pan : THREE.MathUtils.degToRad(panoData?.poseHeading || 0),\n tilt: THREE.MathUtils.degToRad(panoData?.posePitch || 0),\n roll: THREE.MathUtils.degToRad(panoData?.poseRoll || 0),\n };\n }\n\n}\n","import * as THREE from 'three';\nimport {\n ACTIONS,\n CTRLZOOM_TIMEOUT,\n DBLCLICK_DELAY,\n EVENTS,\n IDS,\n INERTIA_WINDOW,\n KEY_CODES,\n LONGTOUCH_DELAY,\n MOVE_THRESHOLD,\n OBJECT_EVENTS,\n TWOFINGERSOVERLAY_DELAY\n} from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport gestureIcon from '../icons/gesture.svg';\nimport mousewheelIcon from '../icons/mousewheel.svg';\nimport { clone, distance, each, getClosest, getPosition, isEmpty, isFullscreenEnabled, normalizeWheel, throttle } from '../utils';\nimport { Animation } from '../utils/Animation';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Events handler\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class EventsHandler extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @property {number} moveThreshold - computed threshold based on device pixel ratio\n * @property {boolean} moving - is the user moving\n * @property {boolean} zooming - is the user zooming\n * @property {number} startMouseX - start x position of the click/touch\n * @property {number} startMouseY - start y position of the click/touch\n * @property {number} mouseX - current x position of the cursor\n * @property {number} mouseY - current y position of the cursor\n * @property {number[][]} mouseHistory - list of latest positions of the cursor, [time, x, y]\n * @property {number} pinchDist - distance between fingers when zooming\n * @property {PressHandler} keyHandler\n * @property {boolean} ctrlKeyDown - when the Ctrl key is pressed\n * @property {PSV.ClickData} dblclickData - temporary storage of click data between two clicks\n * @property {number} dblclickTimeout - timeout id for double click\n * @property {number} twofingersTimeout - timeout id for \"two fingers\" overlay\n * @property {number} ctrlZoomTimeout - timeout id for \"ctrol zoom\" overlay\n * @protected\n */\n this.state = {\n moveThreshold : MOVE_THRESHOLD * SYSTEM.pixelRatio,\n keyboardEnabled : false,\n moving : false,\n zooming : false,\n startMouseX : 0,\n startMouseY : 0,\n mouseX : 0,\n mouseY : 0,\n mouseHistory : [],\n pinchDist : 0,\n keyHandler : new PressHandler(),\n ctrlKeyDown : false,\n dblclickData : null,\n dblclickTimeout : null,\n longtouchTimeout : null,\n twofingersTimeout: null,\n ctrlZoomTimeout : null,\n };\n\n /**\n * @summary Throttled wrapper of {@link PSV.Viewer#autoSize}\n * @type {Function}\n * @private\n */\n this.__onResize = throttle(() => this.psv.autoSize(), 50);\n }\n\n /**\n * @summary Initializes event handlers\n * @protected\n */\n init() {\n window.addEventListener('resize', this);\n window.addEventListener('keydown', this);\n window.addEventListener('keyup', this);\n this.psv.container.addEventListener('mouseenter', this);\n this.psv.container.addEventListener('mousedown', this);\n this.psv.container.addEventListener('mouseleave', this);\n this.psv.container.addEventListener('mousemove', this);\n window.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchstart', this);\n this.psv.container.addEventListener('touchmove', this);\n window.addEventListener('touchend', this);\n this.psv.container.addEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.addEventListener(SYSTEM.fullscreenEvent, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n window.removeEventListener('resize', this);\n window.removeEventListener('keydown', this);\n window.removeEventListener('keyup', this);\n this.psv.container.removeEventListener('mouseenter', this);\n this.psv.container.removeEventListener('mousedown', this);\n this.psv.container.removeEventListener('mouseleave', this);\n this.psv.container.removeEventListener('mousemove', this);\n window.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchstart', this);\n this.psv.container.removeEventListener('touchmove', this);\n window.removeEventListener('touchend', this);\n this.psv.container.removeEventListener(SYSTEM.mouseWheelEvent, this);\n\n if (SYSTEM.fullscreenEvent) {\n document.removeEventListener(SYSTEM.fullscreenEvent, this);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n clearTimeout(this.state.longtouchTimeout);\n clearTimeout(this.state.twofingersTimeout);\n clearTimeout(this.state.ctrlZoomTimeout);\n\n delete this.state;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} evt\n * @private\n */\n handleEvent(evt) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'resize': this.__onResize(); break;\n case 'keydown': this.__onKeyDown(evt); break;\n case 'keyup': this.__onKeyUp(); break;\n case 'mouseup': this.__onMouseUp(evt); break;\n case 'touchend': this.__onTouchEnd(evt); break;\n case SYSTEM.fullscreenEvent: this.__fullscreenToggled(); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n if (!getClosest(evt.target, '.psv--capture-event')) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case 'mousedown': this.__onMouseDown(evt); break;\n case 'mouseenter': this.__onMouseEnter(evt); break;\n case 'mouseleave': this.__onMouseLeave(evt); break;\n case 'mousemove': this.__onMouseMove(evt); break;\n case 'touchstart': this.__onTouchStart(evt); break;\n case 'touchmove': this.__onTouchMove(evt); break;\n case SYSTEM.mouseWheelEvent: this.__onMouseWheel(evt); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n }\n\n /**\n * @summary Enables the keyboard controls\n * @protected\n */\n enableKeyboard() {\n this.state.keyboardEnabled = true;\n }\n\n /**\n * @summary Disables the keyboard controls\n * @protected\n */\n disableKeyboard() {\n this.state.keyboardEnabled = false;\n }\n\n /**\n * @summary Handles keyboard events\n * @param {KeyboardEvent} e\n * @private\n */\n __onKeyDown(e) {\n if (this.config.mousewheelCtrlKey) {\n this.state.ctrlKeyDown = e.key === KEY_CODES.Control;\n\n if (this.state.ctrlKeyDown) {\n clearTimeout(this.state.ctrlZoomTimeout);\n this.psv.overlay.hide(IDS.CTRL_ZOOM);\n }\n }\n\n const e2 = this.psv.trigger(EVENTS.KEY_PRESS, e.key);\n if (e2.isDefaultPrevented()) {\n return;\n }\n\n if (!this.state.keyboardEnabled) {\n return;\n }\n\n const action = this.config.keyboard[e.key];\n if (action === ACTIONS.TOGGLE_AUTOROTATE) {\n this.psv.toggleAutorotate();\n }\n else if (action && !this.state.keyHandler.time) {\n if (action !== ACTIONS.ZOOM_IN && action !== ACTIONS.ZOOM_OUT) {\n this.psv.__stopAll();\n }\n\n /* eslint-disable */\n switch (action) {\n // @formatter:off\n case ACTIONS.ROTATE_LAT_UP: this.psv.dynamics.position.roll({latitude: false}); break;\n case ACTIONS.ROTATE_LAT_DOWN: this.psv.dynamics.position.roll({latitude: true}); break;\n case ACTIONS.ROTATE_LONG_RIGHT: this.psv.dynamics.position.roll({longitude: false}); break;\n case ACTIONS.ROTATE_LONG_LEFT: this.psv.dynamics.position.roll({longitude: true}); break;\n case ACTIONS.ZOOM_IN: this.psv.dynamics.zoom.roll(false); break;\n case ACTIONS.ZOOM_OUT: this.psv.dynamics.zoom.roll(true); break;\n // @formatter:on\n }\n /* eslint-enable */\n\n this.state.keyHandler.down();\n }\n }\n\n /**\n * @summary Handles keyboard events\n * @private\n */\n __onKeyUp() {\n this.state.ctrlKeyDown = false;\n\n if (!this.state.keyboardEnabled) {\n return;\n }\n\n this.state.keyHandler.up(() => {\n this.psv.dynamics.position.stop();\n this.psv.dynamics.zoom.stop();\n this.psv.resetIdleTimer();\n });\n }\n\n /**\n * @summary Handles mouse down events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseDown(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse enter events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseEnter(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__startMove(evt);\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (!this.config.mousemove || this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse leave events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseLeave(evt) {\n if (!this.config.mousemove || !this.config.captureCursor) {\n return;\n }\n\n this.__stopMove(evt);\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.config.mousemove) {\n if (evt.buttons !== 0) {\n evt.preventDefault();\n this.__move(evt);\n }\n else if (this.config.captureCursor) {\n this.__moveAbsolute(evt);\n }\n }\n\n if (!isEmpty(this.prop.objectsObservers)) {\n const viewerPos = getPosition(this.psv.container);\n\n const viewerPoint = {\n x: evt.clientX - viewerPos.left,\n y: evt.clientY - viewerPos.top,\n };\n\n const intersections = this.psv.dataHelper.getIntersections(viewerPoint);\n\n const emit = (observer, key, type) => {\n observer.listener.handleEvent(new CustomEvent(type, {\n detail: {\n originalEvent: evt,\n object : observer.object,\n data : observer.object.userData[key],\n viewerPoint : viewerPoint,\n },\n }));\n };\n\n each(this.prop.objectsObservers, (observer, key) => {\n const intersection = intersections.find(i => i.object.userData[key]);\n\n if (intersection) {\n if (observer.object && intersection.object !== observer.object) {\n emit(observer, key, OBJECT_EVENTS.LEAVE_OBJECT);\n delete observer.object;\n }\n\n if (!observer.object) {\n observer.object = intersection.object;\n emit(observer, key, OBJECT_EVENTS.ENTER_OBJECT);\n }\n else {\n emit(observer, key, OBJECT_EVENTS.HOVER_OBJECT);\n }\n }\n else if (observer.object) {\n emit(observer, key, OBJECT_EVENTS.LEAVE_OBJECT);\n delete observer.object;\n }\n });\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchStart(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (!this.config.touchmoveTwoFingers) {\n this.__startMove(evt.touches[0]);\n evt.preventDefault(); // prevent mouse events emulation\n }\n\n if (!this.prop.longtouchTimeout) {\n this.prop.longtouchTimeout = setTimeout(() => {\n this.__click(evt.touches[0], true);\n this.prop.longtouchTimeout = null;\n }, LONGTOUCH_DELAY);\n }\n }\n else if (evt.touches.length === 2) {\n this.__cancelLongTouch();\n this.__cancelTwoFingersOverlay();\n this.__startMoveZoom(evt);\n evt.preventDefault();\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchEnd(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n this.__cancelLongTouch();\n this.__cancelTwoFingersOverlay();\n\n if (evt.touches.length === 1) {\n this.__stopMoveZoom();\n }\n else if (evt.touches.length === 0) {\n this.__stopMove(evt.changedTouches[0]);\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n if (!this.config.mousemove) {\n return;\n }\n\n this.__cancelLongTouch();\n\n if (evt.touches.length === 1) {\n if (this.config.touchmoveTwoFingers) {\n if (!this.prop.twofingersTimeout) {\n this.prop.twofingersTimeout = setTimeout(() => {\n this.psv.overlay.show({\n id : IDS.TWO_FINGERS,\n image: gestureIcon,\n text : this.config.lang.twoFingers,\n });\n }, TWOFINGERSOVERLAY_DELAY);\n }\n }\n else {\n evt.preventDefault();\n this.__move(evt.touches[0]);\n }\n }\n else if (evt.touches.length === 2) {\n evt.preventDefault();\n this.__moveZoom(evt);\n this.__cancelTwoFingersOverlay();\n }\n }\n\n /**\n * @summary Cancel the long touch timer if any\n * @private\n */\n __cancelLongTouch() {\n if (this.prop.longtouchTimeout) {\n clearTimeout(this.prop.longtouchTimeout);\n this.prop.longtouchTimeout = null;\n }\n }\n\n /**\n * @summary Cancel the two fingers overlay timer if any\n * @private\n */\n __cancelTwoFingersOverlay() {\n if (this.prop.twofingersTimeout) {\n clearTimeout(this.prop.twofingersTimeout);\n this.prop.twofingersTimeout = null;\n }\n this.psv.overlay.hide(IDS.TWO_FINGERS);\n }\n\n /**\n * @summary Handles mouse wheel events\n * @param {WheelEvent} evt\n * @private\n */\n __onMouseWheel(evt) {\n if (!this.config.mousewheel) {\n return;\n }\n\n if (this.config.mousewheelCtrlKey && !this.state.ctrlKeyDown) {\n this.psv.overlay.show({\n id : IDS.CTRL_ZOOM,\n image: mousewheelIcon,\n text : this.config.lang.ctrlZoom,\n });\n\n clearTimeout(this.state.ctrlZoomTimeout);\n this.state.ctrlZoomTimeout = setTimeout(() => this.psv.overlay.hide(IDS.CTRL_ZOOM), CTRLZOOM_TIMEOUT);\n\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n const delta = normalizeWheel(evt).spinY * 5 * this.config.zoomSpeed;\n if (delta !== 0) {\n this.psv.dynamics.zoom.step(-delta, 5);\n }\n }\n\n /**\n * @summary Handles fullscreen events\n * @param {boolean} [force] force state\n * @fires PSV.fullscreen-updated\n * @package\n */\n __fullscreenToggled(force) {\n this.prop.fullscreen = force !== undefined ? force : isFullscreenEnabled(this.psv.container);\n\n if (this.config.keyboard) {\n if (this.prop.fullscreen) {\n this.psv.startKeyboardControl();\n }\n else {\n this.psv.stopKeyboardControl();\n }\n }\n\n this.psv.trigger(EVENTS.FULLSCREEN_UPDATED, this.prop.fullscreen);\n }\n\n /**\n * @summary Initializes the movement\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __startMove(evt) {\n this.psv.__stopAll()\n .then(() => {\n this.state.mouseX = evt.clientX;\n this.state.mouseY = evt.clientY;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = false;\n\n this.state.mouseHistory.length = 0;\n this.__logMouseMove(evt);\n });\n }\n\n /**\n * @summary Initializes the combines move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __startMoveZoom(evt) {\n this.psv.__stopAll()\n .then(() => {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n this.state.pinchDist = distance(p1, p2);\n this.state.mouseX = (p1.x + p2.x) / 2;\n this.state.mouseY = (p1.y + p2.y) / 2;\n this.state.startMouseX = this.state.mouseX;\n this.state.startMouseY = this.state.mouseY;\n this.state.moving = true;\n this.state.zooming = true;\n });\n }\n\n /**\n * @summary Stops the movement\n * @description If the move threshold was not reached a click event is triggered, otherwise an animation is launched to simulate inertia\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMove(evt) {\n this.psv.resetIdleTimer();\n\n if (!getClosest(evt.target, '.psv-container')) {\n this.state.moving = false;\n this.state.mouseHistory.length = 0;\n return;\n }\n\n if (this.state.moving) {\n // move threshold to trigger a click\n if (Math.abs(evt.clientX - this.state.startMouseX) < this.state.moveThreshold\n && Math.abs(evt.clientY - this.state.startMouseY) < this.state.moveThreshold) {\n this.__click(evt);\n this.state.moving = false;\n }\n // inertia animation\n else if (this.config.moveInertia) {\n this.__logMouseMove(evt);\n this.__stopMoveInertia(evt);\n }\n else {\n this.state.moving = false;\n }\n\n this.state.mouseHistory.length = 0;\n }\n }\n\n /**\n * @summary Stops the combined move and zoom\n * @private\n */\n __stopMoveZoom() {\n this.psv.resetIdleTimer();\n this.state.mouseHistory.length = 0;\n this.state.moving = false;\n this.state.zooming = false;\n }\n\n /**\n * @summary Performs an animation to simulate inertia when the movement stops\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __stopMoveInertia(evt) {\n const direction = {\n x: evt.clientX - this.state.mouseHistory[0][1],\n y: evt.clientY - this.state.mouseHistory[0][2],\n };\n\n const norm = Math.sqrt(direction.x * direction.x + direction.y * direction.y);\n\n this.prop.animationPromise = new Animation({\n properties: {\n clientX: { start: evt.clientX, end: evt.clientX + direction.x },\n clientY: { start: evt.clientY, end: evt.clientY + direction.y },\n },\n duration : norm * INERTIA_WINDOW / 100,\n easing : 'outCirc',\n onTick : (properties) => {\n this.__move(properties, false);\n },\n });\n\n this.prop.animationPromise\n .then(() => {\n this.state.moving = false;\n });\n }\n\n /**\n * @summary Triggers an event with all coordinates when a simple click is performed\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [longtouch=false]\n * @fires PSV.click\n * @fires PSV.dblclick\n * @private\n */\n __click(evt, longtouch = false) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n /**\n * @type {PSV.ClickData}\n */\n const data = {\n rightclick: longtouch || evt.button === 2,\n target : evt.target,\n clientX : evt.clientX,\n clientY : evt.clientY,\n viewerX : evt.clientX - boundingRect.left,\n viewerY : evt.clientY - boundingRect.top,\n };\n\n const intersections = this.psv.dataHelper.getIntersections({\n x: data.viewerX,\n y: data.viewerY,\n });\n\n const sphereIntersection = intersections.find(i => i.object.userData.psvSphere);\n\n if (sphereIntersection) {\n const sphericalCoords = this.psv.dataHelper.vector3ToSphericalCoords(sphereIntersection.point);\n data.longitude = sphericalCoords.longitude;\n data.latitude = sphericalCoords.latitude;\n\n data.objects = intersections.map(i => i.object).filter(o => !o.userData.psvSphere);\n\n try {\n const textureCoords = this.psv.dataHelper.sphericalCoordsToTextureCoords(data);\n data.textureX = textureCoords.x;\n data.textureY = textureCoords.y;\n }\n catch (e) {\n data.textureX = NaN;\n data.textureY = NaN;\n }\n\n if (!this.state.dblclickTimeout) {\n this.psv.trigger(EVENTS.CLICK, data);\n\n this.state.dblclickData = clone(data);\n this.state.dblclickTimeout = setTimeout(() => {\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }, DBLCLICK_DELAY);\n }\n else {\n if (Math.abs(this.state.dblclickData.clientX - data.clientX) < this.state.moveThreshold\n && Math.abs(this.state.dblclickData.clientY - data.clientY) < this.state.moveThreshold) {\n this.psv.trigger(EVENTS.DOUBLE_CLICK, this.state.dblclickData);\n }\n\n clearTimeout(this.state.dblclickTimeout);\n this.state.dblclickTimeout = null;\n this.state.dblclickData = null;\n }\n }\n }\n\n /**\n * @summary Performs movement\n * @param {MouseEvent|Touch} evt\n * @param {boolean} [log=true]\n * @private\n */\n __move(evt, log) {\n if (this.state.moving) {\n const x = evt.clientX;\n const y = evt.clientY;\n\n const rotation = {\n longitude: (x - this.state.mouseX) / this.prop.size.width * this.config.moveSpeed * THREE.MathUtils.degToRad(this.prop.hFov),\n latitude : (y - this.state.mouseY) / this.prop.size.height * this.config.moveSpeed * THREE.MathUtils.degToRad(this.prop.vFov),\n };\n\n const currentPosition = this.psv.getPosition();\n this.psv.rotate({\n longitude: currentPosition.longitude - rotation.longitude,\n latitude : currentPosition.latitude + rotation.latitude,\n });\n\n this.state.mouseX = x;\n this.state.mouseY = y;\n\n if (log !== false) {\n this.__logMouseMove(evt);\n }\n }\n }\n\n /**\n * @summary Performs movement absolute to cursor position in viewer\n * @param {MouseEvent} evt\n * @private\n */\n __moveAbsolute(evt) {\n if (this.state.moving) {\n const containerRect = this.psv.container.getBoundingClientRect();\n this.psv.dynamics.position.goto({\n longitude: ((evt.clientX - containerRect.left) / containerRect.width - 0.5) * Math.PI * 2,\n latitude : -((evt.clientY - containerRect.top) / containerRect.height - 0.5) * Math.PI,\n }, 10);\n }\n }\n\n /**\n * @summary Perfoms combined move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __moveZoom(evt) {\n if (this.state.zooming && this.state.moving) {\n const p1 = { x: evt.touches[0].clientX, y: evt.touches[0].clientY };\n const p2 = { x: evt.touches[1].clientX, y: evt.touches[1].clientY };\n\n const p = distance(p1, p2);\n const delta = 80 * (p - this.state.pinchDist) / this.prop.size.width * this.config.zoomSpeed;\n\n this.psv.zoom(this.psv.getZoomLevel() + delta);\n\n this.__move({\n clientX: (p1.x + p2.x) / 2,\n clientY: (p1.y + p2.y) / 2,\n });\n\n this.state.pinchDist = p;\n }\n }\n\n /**\n * @summary Stores each mouse position during a mouse move\n * @description Positions older than \"INERTIA_WINDOW\" are removed
\n * Positions before a pause of \"INERTIA_WINDOW\" / 10 are removed\n * @param {MouseEvent|Touch} evt\n * @private\n */\n __logMouseMove(evt) {\n const now = Date.now();\n this.state.mouseHistory.push([now, evt.clientX, evt.clientY]);\n\n let previous = null;\n\n for (let i = 0; i < this.state.mouseHistory.length;) {\n if (this.state.mouseHistory[0][i] < now - INERTIA_WINDOW) {\n this.state.mouseHistory.splice(i, 1);\n }\n else if (previous && this.state.mouseHistory[0][i] - previous > INERTIA_WINDOW / 10) {\n this.state.mouseHistory.splice(0, i);\n i = 0;\n previous = this.state.mouseHistory[0][i];\n }\n else {\n i++;\n previous = this.state.mouseHistory[0][i];\n }\n }\n }\n\n}\n","import * as THREE from 'three';\nimport { Animation } from '../utils/Animation';\nimport { EVENTS, MESH_USER_DATA, SPHERE_RADIUS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { each, isExtendedPosition } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Viewer and renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class Renderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @member {external:THREE.WebGLRenderer}\n * @readonly\n * @protected\n */\n this.renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });\n this.renderer.setPixelRatio(SYSTEM.pixelRatio);\n this.renderer.domElement.className = 'psv-canvas';\n\n /**\n * @member {external:THREE.Scene}\n * @readonly\n * @protected\n */\n this.scene = new THREE.Scene();\n\n /**\n * @member {external:THREE.PerspectiveCamera}\n * @readonly\n * @protected\n */\n this.camera = new THREE.PerspectiveCamera(50, 16 / 9, 1, 2 * SPHERE_RADIUS);\n\n /**\n * @member {external:THREE.Mesh}\n * @readonly\n * @protected\n */\n this.mesh = this.psv.adapter.createMesh();\n this.mesh.userData = { [MESH_USER_DATA]: true };\n\n /**\n * @member {external:THREE.Group}\n * @readonly\n * @private\n */\n this.meshContainer = new THREE.Group();\n this.meshContainer.add(this.mesh);\n this.scene.add(this.meshContainer);\n\n /**\n * @member {external:THREE.Raycaster}\n * @readonly\n * @protected\n */\n this.raycaster = new THREE.Raycaster();\n\n /**\n * @member {number}\n * @private\n */\n this.timestamp = null;\n\n /**\n * @member {boolean}\n * @private\n */\n this.ready = false;\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @package\n */\n this.canvasContainer = document.createElement('div');\n this.canvasContainer.className = 'psv-canvas-container';\n this.canvasContainer.style.background = this.psv.config.canvasBackground;\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n this.canvasContainer.appendChild(this.renderer.domElement);\n this.psv.container.appendChild(this.canvasContainer);\n\n psv.on(EVENTS.SIZE_UPDATED, this);\n psv.on(EVENTS.ZOOM_UPDATED, this);\n psv.on(EVENTS.POSITION_UPDATED, this);\n psv.on(EVENTS.CONFIG_CHANGED, this);\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n // cancel render loop\n this.renderer.setAnimationLoop(null);\n\n // destroy ThreeJS view\n this.__cleanTHREEScene(this.scene);\n\n // remove container\n this.psv.container.removeChild(this.canvasContainer);\n\n delete this.canvasContainer;\n delete this.renderer;\n delete this.scene;\n delete this.camera;\n delete this.mesh;\n delete this.meshContainer;\n delete this.raycaster;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} evt\n * @private\n */\n handleEvent(evt) {\n /* eslint-disable */\n switch (evt.type) {\n // @formatter:off\n case EVENTS.SIZE_UPDATED: this.__onSizeUpdated(); break;\n case EVENTS.ZOOM_UPDATED: this.__onZoomUpdated(); break;\n case EVENTS.POSITION_UPDATED: this.__onPositionUpdated(); break;\n case EVENTS.CONFIG_CHANGED:\n if (evt.args[0].includes('fisheye')) {\n this.__onPositionUpdated();\n }\n if (evt.args[0].includes('mousemove')) {\n this.canvasContainer.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n }\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @summary Hides the viewer\n */\n hide() {\n this.canvasContainer.style.opacity = 0;\n }\n\n /**\n * @summary Shows the viewer\n */\n show() {\n this.canvasContainer.style.opacity = 1;\n }\n\n /**\n * @summary Updates the size of the renderer and the aspect of the camera\n * @private\n */\n __onSizeUpdated() {\n this.renderer.setSize(this.prop.size.width, this.prop.size.height);\n this.camera.aspect = this.prop.aspect;\n this.camera.updateProjectionMatrix();\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Updates the fov of the camera\n * @private\n */\n __onZoomUpdated() {\n this.camera.fov = this.prop.vFov;\n this.camera.updateProjectionMatrix();\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Updates the position of the camera\n * @private\n */\n __onPositionUpdated() {\n this.camera.position.set(0, 0, 0);\n this.camera.lookAt(this.prop.direction);\n if (this.config.fisheye) {\n this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye / 2).negate();\n }\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Main event loop, calls {@link render} if `prop.needsUpdate` is true\n * @param {number} timestamp\n * @fires PSV.before-render\n * @private\n */\n __renderLoop(timestamp) {\n const elapsed = this.timestamp !== null ? timestamp - this.timestamp : 0;\n this.timestamp = timestamp;\n\n this.psv.trigger(EVENTS.BEFORE_RENDER, timestamp, elapsed);\n each(this.psv.dynamics, d => d.update(elapsed));\n\n if (this.prop.idleTime > 0 && timestamp - this.prop.idleTime > this.config.autorotateDelay) {\n this.psv.startAutorotate();\n }\n\n if (this.prop.needsUpdate) {\n this.render();\n this.prop.needsUpdate = false;\n }\n }\n\n /**\n * @summary Performs a render\n * @description Do not call this method directly, instead call\n * {@link PSV.Viewer#needsUpdate} on {@link PSV.event:before-render}.\n * @fires PSV.render\n */\n render() {\n this.renderer.render(this.scene, this.camera);\n this.psv.trigger(EVENTS.RENDER);\n }\n\n /**\n * @summary Applies the texture to the scene, creates the scene if needed\n * @param {PSV.TextureData} textureData\n * @fires PSV.panorama-loaded\n * @package\n */\n setTexture(textureData) {\n this.prop.panoData = textureData.panoData;\n\n this.psv.adapter.setTexture(this.mesh, textureData);\n\n if (!this.ready) {\n this.renderer.setAnimationLoop(t => this.__renderLoop(t));\n this.ready = true;\n }\n\n this.psv.needsUpdate();\n\n this.psv.trigger(EVENTS.PANORAMA_LOADED, textureData);\n }\n\n /**\n * @summary Apply a panorama data pose to a Mesh\n * @param {PSV.PanoData} [panoData]\n * @param {external:THREE.Mesh} [mesh=this.mesh]\n * @package\n */\n setPanoramaPose(panoData, mesh = this.mesh) {\n // By Google documentation the angles are applied on the camera in order : heading, pitch, roll\n // here we apply the reverse transformation on the sphere\n const cleanCorrection = this.psv.dataHelper.cleanPanoramaPose(panoData);\n\n mesh.rotation.set(\n -cleanCorrection.tilt,\n -cleanCorrection.pan,\n -cleanCorrection.roll,\n 'ZXY'\n );\n }\n\n /**\n * @summary Apply a SphereCorrection to a Mesh\n * @param {PSV.SphereCorrection} [sphereCorrection]\n * @param {external:THREE.Mesh} [mesh=this.meshContainer]\n * @package\n */\n setSphereCorrection(sphereCorrection, mesh = this.meshContainer) {\n const cleanCorrection = this.psv.dataHelper.cleanSphereCorrection(sphereCorrection);\n\n mesh.rotation.set(\n cleanCorrection.tilt,\n cleanCorrection.pan,\n cleanCorrection.roll,\n 'ZXY'\n );\n }\n\n /**\n * @summary Performs transition between the current and a new texture\n * @param {PSV.TextureData} textureData\n * @param {PSV.PanoramaOptions} options\n * @returns {PSV.Animation}\n * @package\n */\n transition(textureData, options) {\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n // create temp group and new mesh, half size to be in \"front\" of the first one\n const group = new THREE.Group();\n const mesh = this.psv.adapter.createMesh(0.5);\n this.psv.adapter.setTexture(mesh, textureData, true);\n this.psv.adapter.setTextureOpacity(mesh, 0);\n this.setPanoramaPose(textureData.panoData, mesh);\n this.setSphereCorrection(options.sphereCorrection, group);\n\n // rotate the new sphere to make the target position face the camera\n if (positionProvided) {\n const cleanPosition = this.psv.dataHelper.cleanPosition(options);\n const currentPosition = this.psv.getPosition();\n\n // Longitude rotation along the vertical axis\n const verticalAxis = new THREE.Vector3(0, 1, 0);\n group.rotateOnWorldAxis(verticalAxis, cleanPosition.longitude - currentPosition.longitude);\n\n // Latitude rotation along the camera horizontal axis\n const horizontalAxis = new THREE.Vector3(0, 1, 0).cross(this.camera.getWorldDirection(new THREE.Vector3())).normalize();\n group.rotateOnWorldAxis(horizontalAxis, cleanPosition.latitude - currentPosition.latitude);\n }\n\n group.add(mesh);\n this.scene.add(group);\n\n const animation = new Animation({\n properties: {\n opacity: { start: 0.0, end: 1.0 },\n zoom : zoomProvided ? { start: this.psv.getZoomLevel(), end: options.zoom } : undefined,\n },\n duration : options.transition,\n easing : 'outCubic',\n onTick : (properties) => {\n this.psv.adapter.setTextureOpacity(mesh, properties.opacity);\n this.psv.adapter.setTextureOpacity(this.mesh, 1 - properties.opacity);\n\n if (zoomProvided) {\n this.psv.zoom(properties.zoom);\n }\n\n this.psv.needsUpdate();\n },\n });\n\n animation\n .then((completed) => {\n if (completed) {\n // remove temp sphere and transfer the texture to the main mesh\n this.setTexture(textureData);\n this.psv.adapter.setTextureOpacity(this.mesh, 1);\n this.setPanoramaPose(textureData.panoData);\n this.setSphereCorrection(options.sphereCorrection);\n\n // actually rotate the camera\n if (positionProvided) {\n this.psv.rotate(options);\n }\n }\n else {\n this.psv.adapter.disposeTexture(textureData);\n }\n\n this.scene.remove(group);\n mesh.geometry.dispose();\n mesh.geometry = null;\n });\n\n return animation;\n }\n\n /**\n * @summary Calls `dispose` on all objects and textures\n * @param {external:THREE.Object3D} object\n * @private\n */\n __cleanTHREEScene(object) {\n object.traverse((item) => {\n if (item.geometry) {\n item.geometry.dispose();\n }\n\n if (item.material) {\n if (Array.isArray(item.material)) {\n item.material.forEach((material) => {\n if (material.map) {\n material.map.dispose();\n }\n\n material.dispose();\n });\n }\n else {\n if (item.material.map) {\n item.material.map.dispose();\n }\n\n item.material.dispose();\n }\n }\n\n if (item.dispose && !(item instanceof THREE.Scene)) {\n item.dispose();\n }\n\n if (item !== object) {\n this.__cleanTHREEScene(item);\n }\n });\n }\n\n}\n","import * as THREE from 'three';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Texture loader\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TextureLoader extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n /**\n * @summary THREE file loader\n * @type {external:THREE:FileLoader}\n * @private\n */\n this.loader = new THREE.FileLoader();\n this.loader.setResponseType('blob');\n if (this.config.withCredentials) {\n this.loader.setWithCredentials(true);\n }\n if (this.config.requestHeaders && typeof this.config.requestHeaders === 'object') {\n this.loader.setRequestHeader(this.config.requestHeaders);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n this.abortLoading();\n super.destroy();\n }\n\n /**\n * @summary Loads the panorama texture(s)\n * @param {*} panorama\n * @param {PSV.PanoData | PSV.PanoDataProvider} [newPanoData]\n * @returns {Promise.}\n * @throws {PSV.PSVError} when the image cannot be loaded\n * @package\n * @deprecated\n */\n loadTexture(panorama, newPanoData) {\n return this.psv.adapter.loadTexture(panorama, newPanoData);\n }\n\n /**\n * @summary Cancels current HTTP requests\n * @package\n */\n abortLoading() {\n // noop implementation waiting for https://github.com/mrdoob/three.js/pull/23070\n }\n\n /**\n * @summary Loads a Blob with FileLoader\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n */\n loadFile(url, onProgress) {\n if (this.config.requestHeaders && typeof this.config.requestHeaders === 'function') {\n this.loader.setRequestHeader(this.config.requestHeaders(url));\n }\n\n return new Promise((resolve, reject) => {\n let progress = 0;\n onProgress && onProgress(progress);\n\n this.loader.load(\n url,\n (result) => {\n progress = 100;\n onProgress && onProgress(progress);\n resolve(result);\n },\n (e) => {\n if (e.lengthComputable) {\n const newProgress = e.loaded / e.total * 100;\n if (newProgress > progress) {\n progress = newProgress;\n onProgress && onProgress(progress);\n }\n }\n },\n (err) => {\n reject(err);\n }\n );\n });\n }\n\n /**\n * @summary Loads an Image using FileLoader to have progress events\n * @param {string} url\n * @param {function(number)} [onProgress]\n * @returns {Promise}\n */\n loadImage(url, onProgress) {\n return this.loadFile(url, onProgress)\n .then(result => new Promise((resolve, reject) => {\n const img = document.createElementNS('http://www.w3.org/1999/xhtml', 'img');\n img.onload = () => {\n URL.revokeObjectURL(img.src);\n resolve(img);\n };\n img.onerror = reject;\n img.src = URL.createObjectURL(result);\n }));\n }\n\n /**\n * @summary Preload a panorama file without displaying it\n * @param {*} panorama\n * @returns {Promise}\n */\n preloadPanorama(panorama) {\n if (this.psv.adapter.supportsPreload(panorama)) {\n return this.psv.adapter.loadTexture(panorama);\n }\n else {\n return Promise.resolve();\n }\n }\n\n}\n","import { EVENTS } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { addClasses, cleanPosition } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\nconst STATE = { NONE: 0, SHOWING: 1, HIDING: 2, READY: 3 };\n\n/**\n * @typedef {Object} PSV.components.Tooltip.Position\n * @summary Object defining the tooltip position\n * @property {number} top - Position of the tip of the arrow of the tooltip, in pixels\n * @property {number} left - Position of the tip of the arrow of the tooltip, in pixels\n * @property {string|string[]} [position='top center'] - Tooltip position toward it's arrow tip.\n * Accepted values are combinations of `top`, `center`, `bottom` and `left`, `center`, `right`\n * @property {Object} [box] - Used when displaying a tooltip on a marker\n * @property {number} [box.width=0]\n * @property {number} [box.height=0]\n */\n\n/**\n * @typedef {PSV.components.Tooltip.Position} PSV.components.Tooltip.Config\n * @summary Object defining the tooltip configuration\n * @property {string} content - HTML content of the tooltip\n * @property {string} [className] - Additional CSS class added to the tooltip\n * @property {*} [data] - Userdata associated to the tooltip\n */\n\n/**\n * @summary Tooltip component\n * @description Never instanciate tooltips directly use {@link PSV.services.TooltipRenderer} instead\n * @extends PSV.components.AbstractComponent\n * @memberof PSV.components\n */\nexport class Tooltip extends AbstractComponent {\n\n /**\n * @param {PSV.Viewer} psv\n * @param {{arrow: number, offset: number}} size\n */\n constructor(psv, size) {\n super(psv, 'psv-tooltip');\n\n /**\n * @override\n * @property {number} arrow\n * @property {number} offset\n * @property {number} width\n * @property {number} height\n * @property {string} pos\n * @property {string} state\n * @property {*} data\n */\n this.prop = {\n ...this.prop,\n ...size,\n state : STATE.NONE,\n width : 0,\n height: 0,\n pos : '',\n config: null,\n data : null,\n };\n\n /**\n * Tooltip content\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.content = document.createElement('div');\n this.content.className = 'psv-tooltip-content';\n this.container.appendChild(this.content);\n\n /**\n * Tooltip arrow\n * @member {HTMLElement}\n * @readonly\n * @package\n */\n this.arrow = document.createElement('div');\n this.arrow.className = 'psv-tooltip-arrow';\n this.container.appendChild(this.arrow);\n\n this.container.addEventListener('transitionend', this);\n\n this.container.style.top = '-1000px';\n this.container.style.left = '-1000px';\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.arrow;\n delete this.content;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'transitionend': this.__onTransitionEnd(e); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @summary This method is not supported\n * @throws {PSV.PSVError} always\n */\n toggle() {\n throw new PSVError('Tooltip cannot be toggled');\n }\n\n /**\n * @summary Displays the tooltip on the viewer\n * Do not call this method directly, use {@link PSV.services.TooltipRenderer} instead.\n * @param {PSV.components.Tooltip.Config} config\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @package\n */\n show(config) {\n if (this.prop.state !== STATE.NONE) {\n throw new PSVError('Initialized tooltip cannot be re-initialized');\n }\n\n if (config.className) {\n addClasses(this.container, config.className);\n }\n\n this.content.innerHTML = config.content;\n\n const rect = this.container.getBoundingClientRect();\n this.prop.width = rect.right - rect.left;\n this.prop.height = rect.bottom - rect.top;\n\n this.prop.state = STATE.READY;\n\n this.move(config);\n\n this.prop.data = config.data;\n this.prop.state = STATE.SHOWING;\n\n this.psv.trigger(EVENTS.SHOW_TOOLTIP, this.prop.data, this);\n\n this.__waitImages();\n }\n\n /**\n * @summary Moves the tooltip to a new position\n * @param {PSV.components.Tooltip.Position} config\n *\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n move(config) {\n if (this.prop.state !== STATE.SHOWING && this.prop.state !== STATE.READY) {\n throw new PSVError('Uninitialized tooltip cannot be moved');\n }\n\n this.config = config;\n\n const t = this.container;\n const a = this.arrow;\n\n // compute size\n const style = {\n posClass : cleanPosition(config.position, 'top center', false),\n width : this.prop.width,\n height : this.prop.height,\n top : 0,\n left : 0,\n arrowTop : 0,\n arrowLeft: 0,\n };\n\n // set initial position\n this.__computeTooltipPosition(style, config);\n\n // correct position if overflow\n let refresh = false;\n if (style.top < this.prop.offset) {\n style.posClass[0] = 'bottom';\n refresh = true;\n }\n else if (style.top + style.height > this.psv.prop.size.height - this.prop.offset) {\n style.posClass[0] = 'top';\n refresh = true;\n }\n if (style.left < this.prop.offset) {\n style.posClass[1] = 'right';\n refresh = true;\n }\n else if (style.left + style.width > this.psv.prop.size.width - this.prop.offset) {\n style.posClass[1] = 'left';\n refresh = true;\n }\n if (refresh) {\n this.__computeTooltipPosition(style, config);\n }\n\n // apply position\n t.style.top = style.top + 'px';\n t.style.left = style.left + 'px';\n\n a.style.top = style.arrowTop + 'px';\n a.style.left = style.arrowLeft + 'px';\n\n const newPos = style.posClass.join('-');\n if (newPos !== this.prop.pos) {\n t.classList.remove(`psv-tooltip--${this.prop.pos}`);\n\n this.prop.pos = newPos;\n t.classList.add(`psv-tooltip--${this.prop.pos}`);\n }\n }\n\n /**\n * @summary Hides the tooltip\n * @fires PSV.hide-tooltip\n */\n hide() {\n this.container.classList.remove('psv-tooltip--visible');\n this.prop.state = STATE.HIDING;\n\n this.psv.trigger(EVENTS.HIDE_TOOLTIP, this.prop.data);\n }\n\n /**\n * @summary Finalize transition\n * @param {TransitionEvent} e\n * @private\n */\n __onTransitionEnd(e) {\n if (e.propertyName === 'transform') {\n switch (this.prop.state) {\n case STATE.SHOWING:\n this.container.classList.add('psv-tooltip--visible');\n this.prop.state = STATE.READY;\n break;\n\n case STATE.HIDING:\n this.prop.state = STATE.NONE;\n this.destroy();\n break;\n\n default:\n // nothing\n }\n }\n }\n\n /**\n * @summary Computes the position of the tooltip and its arrow\n * @param {Object} style\n * @param {Object} config\n * @private\n */\n __computeTooltipPosition(style, config) {\n let topBottom = false;\n\n if (!config.box) {\n config.box = {\n width : 0,\n height: 0,\n };\n }\n\n switch (style.posClass[0]) {\n case 'bottom':\n style.top = config.top + config.box.height + this.prop.offset + this.prop.arrow;\n style.arrowTop = -this.prop.arrow * 2;\n topBottom = true;\n break;\n\n case 'center':\n style.top = config.top + config.box.height / 2 - style.height / 2;\n style.arrowTop = style.height / 2 - this.prop.arrow;\n break;\n\n case 'top':\n style.top = config.top - style.height - this.prop.offset - this.prop.arrow;\n style.arrowTop = style.height;\n topBottom = true;\n break;\n\n // no default\n }\n\n switch (style.posClass[1]) {\n case 'right':\n if (topBottom) {\n style.left = config.left + config.box.width / 2 - this.prop.offset - this.prop.arrow;\n style.arrowLeft = this.prop.offset;\n }\n else {\n style.left = config.left + config.box.width + this.prop.offset + this.prop.arrow;\n style.arrowLeft = -this.prop.arrow * 2;\n }\n break;\n\n case 'center':\n style.left = config.left + config.box.width / 2 - style.width / 2;\n style.arrowLeft = style.width / 2 - this.prop.arrow;\n break;\n\n case 'left':\n if (topBottom) {\n style.left = config.left - style.width + config.box.width / 2 + this.prop.offset + this.prop.arrow;\n style.arrowLeft = style.width - this.prop.offset - this.prop.arrow * 2;\n }\n else {\n style.left = config.left - style.width - this.prop.offset - this.prop.arrow;\n style.arrowLeft = style.width;\n }\n break;\n\n // no default\n }\n }\n\n /**\n * @summary If the tooltip contains images, recompute its size once they are loaded\n * @private\n */\n __waitImages() {\n const images = this.content.querySelectorAll('img');\n\n if (images.length > 0) {\n const promises = [];\n\n images.forEach((image) => {\n promises.push(new Promise((resolve) => {\n image.onload = resolve;\n image.onerror = resolve;\n }));\n });\n\n Promise.all(promises)\n .then(() => {\n if (this.prop.state === STATE.SHOWING || this.prop.state === STATE.READY) {\n const rect = this.container.getBoundingClientRect();\n this.prop.width = rect.right - rect.left;\n this.prop.height = rect.bottom - rect.top;\n this.move(this.config);\n }\n });\n }\n }\n\n}\n","import { Tooltip } from '../components/Tooltip';\nimport { getStyle } from '../utils';\nimport { AbstractService } from './AbstractService';\n\n/**\n * @summary Tooltip renderer\n * @extends PSV.services.AbstractService\n * @memberof PSV.services\n */\nexport class TooltipRenderer extends AbstractService {\n\n /**\n * @param {PSV.Viewer} psv\n */\n constructor(psv) {\n super(psv);\n\n const testTooltip = new Tooltip(this.psv);\n\n /**\n * @summary Computed static sizes\n * @member {Object}\n * @package\n * @property {number} arrowSize\n * @property {number} offset\n */\n this.size = {\n arrow : parseInt(getStyle(testTooltip.arrow, 'borderTopWidth'), 10),\n offset: parseInt(getStyle(testTooltip.container, 'outlineWidth'), 10),\n };\n\n testTooltip.destroy();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.size;\n\n super.destroy();\n }\n\n /**\n * @summary Displays a tooltip on the viewer\n * @param {PSV.components.Tooltip.Config} config\n * @returns {PSV.components.Tooltip}\n *\n * @fires PSV.show-tooltip\n * @throws {PSV.PSVError} when the configuration is incorrect\n *\n * @example\n * viewer.tooltip.create({ content: 'Hello world', top: 200, left: 450, position: 'center bottom'})\n */\n create(config) {\n const tooltip = new Tooltip(this.psv, this.size);\n tooltip.show(config);\n\n return tooltip;\n }\n\n}\n","import * as THREE from 'three';\nimport { EventEmitter } from 'uevent';\nimport { Loader } from './components/Loader';\nimport { Navbar } from './components/Navbar';\nimport { Notification } from './components/Notification';\nimport { Overlay } from './components/Overlay';\nimport { Panel } from './components/Panel';\nimport { CONFIG_PARSERS, DEFAULTS, DEPRECATED_OPTIONS, getConfig, READONLY_OPTIONS } from './data/config';\nimport { CHANGE_EVENTS, DEFAULT_TRANSITION, EVENTS, IDS, SPHERE_RADIUS, VIEWER_DATA } from './data/constants';\nimport { SYSTEM } from './data/system';\nimport errorIcon from './icons/error.svg';\nimport { AbstractPlugin } from './plugins/AbstractPlugin';\nimport { PSVError } from './PSVError';\nimport { DataHelper } from './services/DataHelper';\nimport { EventsHandler } from './services/EventsHandler';\nimport { Renderer } from './services/Renderer';\nimport { TextureLoader } from './services/TextureLoader';\nimport { TooltipRenderer } from './services/TooltipRenderer';\nimport {\n Animation,\n Dynamic,\n each,\n exitFullscreen,\n getAbortError,\n getAngle,\n getShortestArc,\n isAbortError,\n isExtendedPosition,\n isFullscreenEnabled,\n isNil,\n logWarn,\n MultiDynamic,\n pluginInterop,\n requestFullscreen,\n throttle,\n toggleClass\n} from './utils';\n\nTHREE.Cache.enabled = true;\n\n/**\n * @summary Main class\n * @memberOf PSV\n * @extends {external:uEvent.EventEmitter}\n */\nexport class Viewer extends EventEmitter {\n\n /**\n * @param {PSV.Options} options\n * @fires PSV.ready\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(options) {\n super();\n\n SYSTEM.load();\n\n // must support WebGL\n if (!SYSTEM.isWebGLSupported) {\n throw new PSVError('WebGL is not supported.');\n }\n\n if (SYSTEM.maxTextureWidth === 0) {\n throw new PSVError('Unable to detect system capabilities');\n }\n\n /**\n * @summary Internal properties\n * @member {Object}\n * @protected\n * @property {boolean} ready - when all components are loaded\n * @property {boolean} uiRefresh - if the UI needs to be renderer\n * @property {boolean} needsUpdate - if the view needs to be renderer\n * @property {boolean} fullscreen - if the viewer is currently fullscreen\n * @property {external:THREE.Vector3} direction - direction of the camera\n * @property {number} vFov - vertical FOV\n * @property {number} hFov - horizontal FOV\n * @property {number} aspect - viewer aspect ratio\n * @property {boolean} autorotateEnabled - automatic rotation is enabled\n * @property {PSV.Animation} animationPromise - promise of the current animation\n * @property {Promise} loadingPromise - promise of the setPanorama method\n * @property {number} idleTime - time of the last user action\n * @property {object} objectsObservers\n * @property {PSV.Size} size - size of the container\n * @property {PSV.PanoData} panoData - panorama metadata, if supported\n */\n this.prop = {\n ready : false,\n uiRefresh : false,\n needsUpdate : false,\n fullscreen : false,\n direction : new THREE.Vector3(0, 0, SPHERE_RADIUS),\n vFov : null,\n hFov : null,\n aspect : null,\n autorotateEnabled: false,\n animationPromise : null,\n loadingPromise : null,\n idleTime : -1,\n objectsObservers : {},\n size : {\n width : 0,\n height: 0,\n },\n panoData : {\n fullWidth : 0,\n fullHeight : 0,\n croppedWidth : 0,\n croppedHeight: 0,\n croppedX : 0,\n croppedY : 0,\n poseHeading : 0,\n posePitch : 0,\n poseRoll : 0,\n },\n };\n\n /**\n * @summary Configuration holder\n * @type {PSV.Options}\n * @readonly\n */\n this.config = getConfig(options);\n\n /**\n * @summary Top most parent\n * @member {HTMLElement}\n * @readonly\n */\n this.parent = (typeof options.container === 'string') ? document.getElementById(options.container) : options.container;\n this.parent[VIEWER_DATA] = this;\n\n /**\n * @summary Main container\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.classList.add('psv-container');\n this.parent.appendChild(this.container);\n\n /**\n * @summary Render adapter\n * @type {PSV.adapters.AbstractAdapter}\n * @readonly\n * @package\n */\n this.adapter = new this.config.adapter[0](this, this.config.adapter[1]); // eslint-disable-line new-cap\n\n /**\n * @summary All child components\n * @type {PSV.components.AbstractComponent[]}\n * @readonly\n * @package\n */\n this.children = [];\n\n /**\n * @summary All plugins\n * @type {Object}\n * @readonly\n * @package\n */\n this.plugins = {};\n\n /**\n * @type {PSV.services.Renderer}\n * @readonly\n */\n this.renderer = new Renderer(this);\n\n /**\n * @type {PSV.services.TextureLoader}\n * @readonly\n */\n this.textureLoader = new TextureLoader(this);\n\n /**\n * @type {PSV.services.EventsHandler}\n * @readonly\n */\n this.eventsHandler = new EventsHandler(this);\n\n /**\n * @type {PSV.services.DataHelper}\n * @readonly\n */\n this.dataHelper = new DataHelper(this);\n\n /**\n * @member {PSV.components.Loader}\n * @readonly\n */\n this.loader = new Loader(this);\n\n /**\n * @member {PSV.components.Navbar}\n * @readonly\n */\n this.navbar = new Navbar(this);\n\n /**\n * @member {PSV.components.Panel}\n * @readonly\n */\n this.panel = new Panel(this);\n\n /**\n * @member {PSV.services.TooltipRenderer}\n * @readonly\n */\n this.tooltip = new TooltipRenderer(this);\n\n /**\n * @member {PSV.components.Notification}\n * @readonly\n */\n this.notification = new Notification(this);\n\n /**\n * @member {PSV.components.Overlay}\n * @readonly\n */\n this.overlay = new Overlay(this);\n\n /**\n * @member {Record}\n * @package\n */\n this.dynamics = {\n zoom: new Dynamic((value) => {\n this.prop.vFov = this.dataHelper.zoomLevelToFov(value);\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n this.trigger(EVENTS.ZOOM_UPDATED, value);\n }, this.config.defaultZoomLvl, 0, 100),\n\n position: new MultiDynamic({\n longitude: new Dynamic(null, this.config.defaultLong, 0, 2 * Math.PI, true),\n latitude : new Dynamic(null, this.config.defaultLat, -Math.PI / 2, Math.PI / 2),\n }, (position) => {\n this.dataHelper.sphericalCoordsToVector3(position, this.prop.direction);\n this.trigger(EVENTS.POSITION_UPDATED, position);\n }),\n };\n\n this.__updateSpeeds();\n\n this.eventsHandler.init();\n\n this.__resizeRefresh = throttle(() => this.refreshUi('resize'), 500);\n\n // apply container size\n this.resize(this.config.size);\n\n // init plugins\n this.config.plugins.forEach(([plugin, opts]) => {\n this.plugins[plugin.id] = new plugin(this, opts); // eslint-disable-line new-cap\n });\n each(this.plugins, plugin => plugin.init?.());\n\n // init buttons\n this.navbar.setButtons(this.config.navbar);\n\n // load panorama\n if (this.config.panorama) {\n this.setPanorama(this.config.panorama);\n }\n\n toggleClass(this.container, 'psv--is-touch', SYSTEM.isTouchEnabled.initial);\n SYSTEM.isTouchEnabled.promise.then(enabled => toggleClass(this.container, 'psv--is-touch', enabled));\n\n // enable GUI after first render\n this.once(EVENTS.RENDER, () => {\n if (this.config.navbar) {\n this.container.classList.add('psv--has-navbar');\n this.navbar.show();\n }\n\n // Queue autorotate\n if (!isNil(this.config.autorotateDelay)) {\n this.prop.idleTime = performance.now();\n }\n\n this.prop.ready = true;\n\n setTimeout(() => {\n this.refreshUi('init');\n\n this.trigger(EVENTS.READY);\n }, 0);\n });\n }\n\n /**\n * @summary Destroys the viewer\n * @description The memory used by the ThreeJS context is not totally cleared. This will be fixed as soon as possible.\n */\n destroy() {\n this.__stopAll();\n this.stopKeyboardControl();\n this.exitFullscreen();\n\n each(this.plugins, plugin => plugin.destroy());\n delete this.plugins;\n\n this.children.slice().forEach(child => child.destroy());\n this.children.length = 0;\n\n this.eventsHandler.destroy();\n this.renderer.destroy();\n this.textureLoader.destroy();\n this.dataHelper.destroy();\n this.adapter.destroy();\n\n this.parent.removeChild(this.container);\n delete this.parent[VIEWER_DATA];\n\n delete this.parent;\n delete this.container;\n\n delete this.loader;\n delete this.navbar;\n delete this.panel;\n delete this.tooltip;\n delete this.notification;\n delete this.overlay;\n delete this.dynamics;\n\n delete this.config;\n }\n\n /**\n * @summary Refresh UI\n * @package\n */\n refreshUi(reason) {\n if (!this.prop.ready) {\n return;\n }\n\n if (!this.prop.uiRefresh) {\n // console.log(`PhotoSphereViewer: UI Refresh, ${reason}`);\n\n this.prop.uiRefresh = true;\n\n this.children.every((child) => {\n child.refreshUi();\n return this.prop.uiRefresh === true;\n });\n\n this.prop.uiRefresh = false;\n }\n else if (this.prop.uiRefresh !== 'new') {\n this.prop.uiRefresh = 'new';\n\n // wait for current refresh to cancel\n setTimeout(() => {\n this.prop.uiRefresh = false;\n this.refreshUi(reason);\n });\n }\n }\n\n /**\n * @summary Returns the instance of a plugin if it exists\n * @param {Class|string} pluginId\n * @returns {PSV.plugins.AbstractPlugin}\n */\n getPlugin(pluginId) {\n if (typeof pluginId === 'string') {\n return this.plugins[pluginId];\n }\n else {\n const pluginCtor = pluginInterop(pluginId, AbstractPlugin);\n return pluginCtor ? this.plugins[pluginCtor.id] : undefined;\n }\n }\n\n /**\n * @summary Returns the current position of the camera\n * @returns {PSV.Position}\n */\n getPosition() {\n return this.dataHelper.cleanPosition(this.dynamics.position.current);\n }\n\n /**\n * @summary Returns the current zoom level\n * @returns {number}\n */\n getZoomLevel() {\n return this.dynamics.zoom.current;\n }\n\n /**\n * @summary Returns the current viewer size\n * @returns {PSV.Size}\n */\n getSize() {\n return { ...this.prop.size };\n }\n\n /**\n * @summary Checks if the automatic rotation is enabled\n * @returns {boolean}\n */\n isAutorotateEnabled() {\n return this.prop.autorotateEnabled;\n }\n\n /**\n * @summary Checks if the viewer is in fullscreen\n * @returns {boolean}\n */\n isFullscreenEnabled() {\n if (SYSTEM.fullscreenEvent) {\n return isFullscreenEnabled(this.container);\n }\n else {\n return this.prop.fullscreen;\n }\n }\n\n /**\n * @summary Flags the view has changed for the next render\n */\n needsUpdate() {\n this.prop.needsUpdate = true;\n }\n\n /**\n * @summary Resizes the canvas when the window is resized\n * @fires PSV.size-updated\n */\n autoSize() {\n if (this.container.clientWidth !== this.prop.size.width || this.container.clientHeight !== this.prop.size.height) {\n this.prop.size.width = Math.round(this.container.clientWidth);\n this.prop.size.height = Math.round(this.container.clientHeight);\n this.prop.aspect = this.prop.size.width / this.prop.size.height;\n this.prop.hFov = this.dataHelper.vFovToHFov(this.prop.vFov);\n\n this.trigger(EVENTS.SIZE_UPDATED, this.getSize());\n this.__resizeRefresh();\n }\n }\n\n /**\n * @summary Loads a new panorama file\n * @description Loads a new panorama file, optionally changing the camera position/zoom and activating the transition animation.
\n * If the \"options\" parameter is not defined, the camera will not move and the ongoing animation will continue.
\n * If another loading is already in progress it will be aborted.\n * @param {*} path - URL of the new panorama file\n * @param {PSV.PanoramaOptions} [options]\n * @returns {Promise} resolves false if the loading was aborted by another call\n */\n setPanorama(path, options = {}) {\n this.textureLoader.abortLoading();\n this.prop.transitionAnimation?.cancel();\n\n // apply default parameters on first load\n if (!this.prop.ready) {\n if (!('sphereCorrection' in options)) {\n options.sphereCorrection = this.config.sphereCorrection;\n }\n if (!('panoData' in options)) {\n options.panoData = this.config.panoData;\n }\n }\n\n if (options.transition === undefined || options.transition === true) {\n options.transition = DEFAULT_TRANSITION;\n }\n if (options.showLoader === undefined) {\n options.showLoader = true;\n }\n if (options.caption === undefined) {\n options.caption = this.config.caption;\n }\n if (options.description === undefined) {\n options.description = this.config.description;\n }\n\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n if (positionProvided || zoomProvided) {\n this.__stopAll();\n }\n\n this.hideError();\n\n this.config.panorama = path;\n this.config.caption = options.caption;\n this.config.description = options.description;\n\n const done = (err) => {\n this.loader.hide();\n\n this.prop.loadingPromise = null;\n\n if (isAbortError(err)) {\n return false;\n }\n else if (err) {\n this.navbar.setCaption('');\n this.showError(this.config.lang.loadError);\n console.error(err);\n throw err;\n }\n else {\n this.resetIdleTimer();\n this.navbar.setCaption(this.config.caption);\n return true;\n }\n };\n\n this.navbar.setCaption(`${this.config.loadingTxt || ''}`);\n if (options.showLoader || !this.prop.ready) {\n this.loader.show();\n }\n\n const loadingPromise = this.adapter.loadTexture(this.config.panorama, options.panoData)\n .then((textureData) => {\n // check if another panorama was requested\n if (textureData.panorama !== this.config.panorama) {\n this.adapter.disposeTexture(textureData);\n throw getAbortError();\n }\n return textureData;\n });\n\n if (!options.transition || !this.prop.ready || !this.adapter.supportsTransition(this.config.panorama)) {\n this.prop.loadingPromise = loadingPromise\n .then((textureData) => {\n this.renderer.show();\n this.renderer.setTexture(textureData);\n this.renderer.setPanoramaPose(textureData.panoData);\n this.renderer.setSphereCorrection(options.sphereCorrection);\n\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n if (positionProvided) {\n this.rotate(options);\n }\n })\n .then(done, done);\n }\n else {\n this.prop.loadingPromise = loadingPromise\n .then((textureData) => {\n this.loader.hide();\n\n this.prop.transitionAnimation = this.renderer.transition(textureData, options);\n return this.prop.transitionAnimation\n .then((completed) => {\n this.prop.transitionAnimation = null;\n if (!completed) {\n throw getAbortError();\n }\n });\n })\n .then(done, done);\n }\n\n return this.prop.loadingPromise;\n }\n\n /**\n * @summary Update options\n * @param {PSV.Options} options\n * @fires PSV.config-changed\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n setOptions(options) {\n const rawConfig = {\n ...this.config,\n ...options,\n };\n\n each(options, (value, key) => {\n if (DEPRECATED_OPTIONS[key]) {\n logWarn(DEPRECATED_OPTIONS[key]);\n return;\n }\n\n if (!Object.prototype.hasOwnProperty.call(DEFAULTS, key)) {\n throw new PSVError(`Unknown option ${key}`);\n }\n\n if (READONLY_OPTIONS[key]) {\n throw new PSVError(READONLY_OPTIONS[key]);\n }\n\n if (CONFIG_PARSERS[key]) {\n this.config[key] = CONFIG_PARSERS[key](value, rawConfig);\n }\n else {\n this.config[key] = value;\n }\n\n switch (key) {\n case 'caption':\n case 'description':\n this.navbar.setCaption(this.config.caption);\n break;\n\n case 'size':\n this.resize(value);\n break;\n\n case 'sphereCorrection':\n this.renderer.setSphereCorrection(value);\n break;\n\n case 'navbar':\n case 'lang':\n this.navbar.setButtons(this.config.navbar);\n break;\n\n case 'moveSpeed':\n case 'zoomSpeed':\n this.__updateSpeeds();\n break;\n\n case 'minFov':\n case 'maxFov':\n this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.prop.vFov));\n this.trigger(EVENTS.ZOOM_UPDATED, this.getZoomLevel());\n break;\n\n case 'canvasBackground':\n this.renderer.canvasContainer.style.background = this.config.canvasBackground;\n break;\n\n case 'autorotateIdle':\n this.resetIdleTimer();\n break;\n\n default:\n break;\n }\n });\n\n this.needsUpdate();\n this.refreshUi('set options');\n\n this.trigger(EVENTS.CONFIG_CHANGED, Object.keys(options));\n }\n\n /**\n * @summary Update options\n * @param {string} option\n * @param {any} value\n * @fires PSV.config-changed\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n setOption(option, value) {\n this.setOptions({ [option]: value });\n }\n\n /**\n * @summary Restarts the idle timer (if `autorotateIdle=true`)\n * @package\n */\n resetIdleTimer() {\n this.prop.idleTime = this.config.autorotateIdle ? performance.now() : -1;\n }\n\n /**\n * @summary Stops the idle timer\n * @package\n */\n disableIdleTimer() {\n this.prop.idleTime = -1;\n }\n\n /**\n * @summary Starts the automatic rotation\n * @fires PSV.autorotate\n */\n startAutorotate(refresh = false) {\n if (refresh && !this.isAutorotateEnabled()) {\n return;\n }\n if (!refresh && this.isAutorotateEnabled()) {\n return;\n }\n\n if (!refresh) {\n this.__stopAll();\n }\n\n this.dynamics.position.roll({\n longitude: this.config.autorotateSpeed < 0,\n }, Math.abs(this.config.autorotateSpeed / this.config.moveSpeed));\n\n this.dynamics.position.goto({\n latitude: this.config.autorotateLat,\n }, Math.abs(this.config.autorotateSpeed / this.config.moveSpeed));\n\n this.prop.autorotateEnabled = true;\n\n if (!refresh) {\n this.trigger(EVENTS.AUTOROTATE, true);\n }\n }\n\n /**\n * @summary Stops the automatic rotation\n * @fires PSV.autorotate\n */\n stopAutorotate() {\n if (this.isAutorotateEnabled()) {\n this.dynamics.position.stop();\n\n this.prop.autorotateEnabled = false;\n\n this.trigger(EVENTS.AUTOROTATE, false);\n }\n }\n\n /**\n * @summary Starts or stops the automatic rotation\n * @fires PSV.autorotate\n */\n toggleAutorotate() {\n if (this.isAutorotateEnabled()) {\n this.stopAutorotate();\n }\n else {\n this.startAutorotate();\n }\n }\n\n /**\n * @summary Displays an error message over the viewer\n * @param {string} message\n */\n showError(message) {\n this.overlay.show({\n id : IDS.ERROR,\n image : errorIcon,\n text : message,\n dissmisable: false,\n });\n }\n\n /**\n * @summary Hides the error message\n */\n hideError() {\n this.overlay.hide(IDS.ERROR);\n }\n\n /**\n * @summary Rotates the view to specific longitude and latitude\n * @param {PSV.ExtendedPosition} position\n * @fires PSV.before-rotate\n * @fires PSV.position-updated\n */\n rotate(position) {\n const e = this.trigger(EVENTS.BEFORE_ROTATE, position);\n if (e.isDefaultPrevented()) {\n return;\n }\n\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ROTATE_POSITION, this.dataHelper.cleanPosition(position));\n this.dynamics.position.setValue(cleanPosition);\n }\n\n /**\n * @summary Rotates and zooms the view with a smooth animation\n * @param {PSV.AnimateOptions} options - position and/or zoom level\n * @returns {PSV.Animation}\n */\n animate(options) {\n this.__stopAll();\n\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = 'zoom' in options;\n\n const animProperties = {};\n let duration;\n\n // clean/filter position and compute duration\n if (positionProvided) {\n const cleanPosition = this.change(CHANGE_EVENTS.GET_ANIMATE_POSITION, this.dataHelper.cleanPosition(options));\n const currentPosition = this.getPosition();\n\n // longitude offset for shortest arc\n const tOffset = getShortestArc(currentPosition.longitude, cleanPosition.longitude);\n\n animProperties.longitude = { start: currentPosition.longitude, end: currentPosition.longitude + tOffset };\n animProperties.latitude = { start: currentPosition.latitude, end: cleanPosition.latitude };\n\n duration = this.dataHelper.speedToDuration(options.speed, getAngle(currentPosition, cleanPosition));\n }\n\n // clean/filter zoom and compute duration\n if (zoomProvided) {\n const dZoom = Math.abs(options.zoom - this.getZoomLevel());\n\n animProperties.zoom = { start: this.getZoomLevel(), end: options.zoom };\n\n if (!duration) {\n // if animating zoom only and a speed is given, use an arbitrary PI/4 to compute the duration\n duration = this.dataHelper.speedToDuration(options.speed, Math.PI / 4 * dZoom / 100);\n }\n }\n\n // if no animation needed\n if (!duration) {\n if (positionProvided) {\n this.rotate(options);\n }\n if (zoomProvided) {\n this.zoom(options.zoom);\n }\n\n return new Animation();\n }\n\n this.prop.animationPromise = new Animation({\n properties: animProperties,\n duration : duration,\n easing : 'inOutSine',\n onTick : (properties) => {\n if (positionProvided) {\n this.rotate(properties);\n }\n if (zoomProvided) {\n this.zoom(properties.zoom);\n }\n },\n });\n\n this.prop.animationPromise.then(() => {\n this.prop.animationPromise = null;\n this.resetIdleTimer();\n });\n\n return this.prop.animationPromise;\n }\n\n /**\n * @summary Stops the ongoing animation\n * @description The return value is a Promise because the is no guaranty the animation can be stopped synchronously.\n * @returns {Promise} Resolved when the animation has ben cancelled\n */\n stopAnimation() {\n if (this.prop.animationPromise) {\n return new Promise((resolve) => {\n this.prop.animationPromise.then(resolve);\n this.prop.animationPromise.cancel();\n this.prop.animationPromise = null;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n\n /**\n * @summary Zooms to a specific level between `max_fov` and `min_fov`\n * @param {number} level - new zoom level from 0 to 100\n * @fires PSV.zoom-updated\n */\n zoom(level) {\n this.dynamics.zoom.setValue(level);\n }\n\n /**\n * @summary Increases the zoom level\n * @param {number} [step=1]\n */\n zoomIn(step = 1) {\n this.dynamics.zoom.step(step);\n }\n\n /**\n * @summary Decreases the zoom level\n * @param {number} [step=1]\n */\n zoomOut(step = 1) {\n this.dynamics.zoom.step(-step);\n }\n\n /**\n * @summary Resizes the viewer\n * @param {PSV.CssSize} size\n */\n resize(size) {\n ['width', 'height'].forEach((dim) => {\n if (size && size[dim]) {\n if (/^[0-9.]+$/.test(size[dim])) {\n size[dim] += 'px';\n }\n this.parent.style[dim] = size[dim];\n }\n });\n\n this.autoSize();\n }\n\n /**\n * @summary Enters the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n enterFullscreen() {\n if (SYSTEM.fullscreenEvent) {\n requestFullscreen(this.container);\n }\n else {\n this.container.classList.add('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(true);\n }\n }\n\n /**\n * @summary Exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n exitFullscreen() {\n if (this.isFullscreenEnabled()) {\n if (SYSTEM.fullscreenEvent) {\n exitFullscreen();\n }\n else {\n this.container.classList.remove('psv-container--fullscreen');\n this.autoSize();\n this.eventsHandler.__fullscreenToggled(false);\n }\n }\n }\n\n /**\n * @summary Enters or exits the fullscreen mode\n * @fires PSV.fullscreen-updated\n */\n toggleFullscreen() {\n if (!this.isFullscreenEnabled()) {\n this.enterFullscreen();\n }\n else {\n this.exitFullscreen();\n }\n }\n\n /**\n * @summary Enables the keyboard controls (done automatically when entering fullscreen)\n */\n startKeyboardControl() {\n this.eventsHandler.enableKeyboard();\n }\n\n /**\n * @summary Disables the keyboard controls (done automatically when exiting fullscreen)\n */\n stopKeyboardControl() {\n this.eventsHandler.disableKeyboard();\n }\n\n /**\n * @summary Subscribes to events on objects in the scene\n * @param {string} userDataKey - only objects with the following `userData` will be emitted\n * @param {EventListener} listener - must implement `handleEvent\n * @return {function} call to stop the subscription\n * @package\n */\n observeObjects(userDataKey, listener) {\n this.prop.objectsObservers[userDataKey] = { listener };\n\n return () => {\n delete this.prop.objectsObservers[userDataKey];\n };\n }\n\n /**\n * @summary Stops all current animations\n * @returns {Promise}\n * @package\n */\n __stopAll() {\n this.trigger(EVENTS.STOP_ALL);\n\n this.disableIdleTimer();\n this.stopAutorotate();\n return this.stopAnimation();\n }\n\n /**\n * @summary Recomputes dynamics speeds\n * @private\n */\n __updateSpeeds() {\n this.dynamics.zoom.setSpeed(this.config.zoomSpeed * 50);\n this.dynamics.position.setSpeed(THREE.MathUtils.degToRad(this.config.moveSpeed * 50));\n }\n\n}\n"],"names":["PSVError","message","Error","captureStackTrace","stack","prototype","Object","create","name","constructor","AbstractAdapter","psv","destroy","supportsTransition","panorama","supportsPreload","loadTexture","newPanoData","createMesh","scale","setTexture","mesh","textureData","transition","setTextureOpacity","opacity","disposeTexture","id","supportsDownload","DEFAULT_TRANSITION","MOVE_THRESHOLD","DBLCLICK_DELAY","LONGTOUCH_DELAY","TWOFINGERSOVERLAY_DELAY","CTRLZOOM_TIMEOUT","INERTIA_WINDOW","SPHERE_RADIUS","VIEWER_DATA","MESH_USER_DATA","ACTIONS","ROTATE_LAT_UP","ROTATE_LAT_DOWN","ROTATE_LONG_RIGHT","ROTATE_LONG_LEFT","ZOOM_IN","ZOOM_OUT","TOGGLE_AUTOROTATE","EVENTS","AUTOROTATE","BEFORE_RENDER","BEFORE_ROTATE","CLICK","CLOSE_PANEL","CONFIG_CHANGED","DOUBLE_CLICK","FULLSCREEN_UPDATED","HIDE_NOTIFICATION","HIDE_OVERLAY","HIDE_TOOLTIP","KEY_PRESS","LOAD_PROGRESS","OPEN_PANEL","PANORAMA_LOADED","POSITION_UPDATED","READY","RENDER","SHOW_NOTIFICATION","SHOW_OVERLAY","SHOW_TOOLTIP","SIZE_UPDATED","STOP_ALL","ZOOM_UPDATED","CHANGE_EVENTS","GET_ANIMATE_POSITION","GET_ROTATE_POSITION","OBJECT_EVENTS","ENTER_OBJECT","HOVER_OBJECT","LEAVE_OBJECT","IDS","MENU","TWO_FINGERS","CTRL_ZOOM","ERROR","DESCRIPTION","EASINGS","linear","t","inQuad","outQuad","inOutQuad","inCubic","outCubic","inOutCubic","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","Math","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","KEY_CODES","Enter","Control","Escape","Space","PageUp","PageDown","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Delete","Plus","Minus","LOCALSTORAGE_TOUCH_SUPPORT","SYSTEM","loaded","pixelRatio","isWebGLSupported","isTouchEnabled","maxTextureWidth","mouseWheelEvent","fullscreenEvent","load","ctx","getWebGLCtx","window","devicePixelRatio","getMaxTextureWidth","getMouseWheelEvent","getFullscreenEvent","maxCanvasWidth","getMaxCanvasWidth","canvas","document","createElement","names","context","getContext","some","e","initial","navigator","maxTouchPoints","localStorage","promise","Promise","resolve","clear","listenerMouse","listenerTouch","listenerTimeout","addEventListener","listenerTimeoutId","setTimeout","removeEventListener","clearTimeout","getParameter","MAX_TEXTURE_SIZE","maxWidth","width","height","fillStyle","fillRect","getImageData","data","onmousewheel","undefined","FULLSCREEN_EVT_MAP","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","validExits","keys","filter","exit","length","toggleClass","element","className","active","classList","toggle","contains","add","remove","addClasses","split","forEach","removeClasses","hasParent","el","parent","test","parentNode","getClosest","selector","matches","SVGElement","parentElement","getPosition","left","top","offsetLeft","scrollLeft","clientLeft","offsetTop","scrollTop","clientTop","offsetParent","isFullscreenEnabled","elt","fullscreenElement","webkitFullscreenElement","requestFullscreen","webkitRequestFullscreen","call","getStyle","prop","getComputedStyle","normalizeWheel","event","PIXEL_STEP","LINE_HEIGHT","PAGE_HEIGHT","spinX","spinY","pixelX","pixelY","detail","wheelDelta","wheelDeltaY","wheelDeltaX","axis","HORIZONTAL_AXIS","deltaY","deltaX","deltaMode","bound","x","min","max","loop","value","result","isInteger","Number","isFinite","floor","isPowerOfTwo","log","sum","array","reduce","a","b","distance","p1","p2","y","getShortestArc","from","to","tCandidates","candidate","newCandidate","abs","Infinity","getAngle","position1","position2","acos","latitude","longitude","greatArcDistance","λ1","φ1","λ2","φ2","dasherize","str","replace","s","i","toLowerCase","throttle","func","wait","self","args","timeout","previous","later","Date","now","apply","remaining","arguments","isPlainObject","obj","getPrototypeOf","proto","toString","deepmerge","target","src","first","merge","Array","isArray","key","clone","isEmpty","each","object","callback","isNil","val","firstNonNull","values","deepEqual","obj1","obj2","isObject","pluginInterop","plugin","entries","p","getAbortError","error","isAbortError","err","logWarn","console","warn","isExtendedPosition","key1","key2","getXMPValue","attr","match","parseInt","isNaN","CSS_POSITIONS","bottom","right","center","parsePosition","tokens","toLocaleLowerCase","slice","xFirst","map","token","reverse","parsed","join","parseFloat","LEFT_MAP","TOP_MAP","cleanPosition","defaultValue","allowCenter","tempPos","parseSpeed","speed","speedStr","trim","speedValue","speedUnit","THREE","MathUtils","degToRad","parseAngle","angle","zeroCenter","halfCircle","unit","createTexture","img","texture","Texture","needsUpdate","minFilter","LinearFilter","generateMipmaps","quaternion","Quaternion","applyEulerInverse","vector","euler","setFromEuler","invert","applyQuaternion","Animation","options","__callbacks","easing","__start","delay","__delayTimeout","__animationFrame","requestAnimationFrame","__run","__resolved","timestamp","progress","duration","current","properties","start","end","onTick","__resolve","cb","then","onFulfilled","onRejected","__cancelled","push","cancel","cancelAnimationFrame","catch","finally","onFinally","Dynamic","fn","loopValue","mode","STOP","speedMult","currentSpeed","setSpeed","goto","position","POSITION","step","roll","INFINITE","stop","setValue","update","elapsed","dstStop","targetSpeed","next","MultiDynamic","dynamics","d","positions","steps","rolls","hasUpdates","dynamic","Slider","container","direction","onUpdate","mousedown","mouseover","handleEvent","type","stopPropagation","__onMouseDown","__onMouseEnter","__onMouseLeave","__onTouchStart","__onMouseMove","__onTouchMove","__onMouseUp","__onTouchEnd","evt","__update","changedTouches","moving","boundingClientRect","getBoundingClientRect","cursor","vertical","pos","size","click","VERTICAL","EventEmitter","HORIZONTAL","EquirectangularAdapter","config","resolution","SPHERE_SEGMENTS","SPHERE_HORIZONTAL_SEGMENTS","reject","useXmpData","textureLoader","loadImage","loader","setProgress","xmpPanoData","__loadXMP","panoData","fullWidth","fullHeight","croppedWidth","croppedHeight","croppedX","croppedY","poseHeading","posePitch","poseRoll","__createEquirectangularTexture","onProgress","loadFile","blob","__loadBlobAsString","binary","indexOf","substring","includes","reader","FileReader","onload","onerror","readAsText","ratio","resizedPanoData","buffer","drawImage","geometry","SphereGeometry","material","MeshBasicMaterial","Mesh","dispose","transparent","AbstractComponent","children","visible","appendChild","removeChild","childIdx","splice","child","refreshUi","every","uiRefresh","isVisible","hide","show","style","display","AbstractButton","navbar","collapsable","tabbable","enabled","supported","collapsed","offsetWidth","icon","__setIcon","lang","title","tabIndex","onClick","checkSupported","supportedOrObject","isSupported","toggleActive","iconActive","refresh","disable","enable","collapse","uncollapse","innerHTML","querySelector","groupId","AutorotateButton","on","off","isAutorotateEnabled","autorotateIdle","resetIdleTimer","toggleAutorotate","play","playActive","CustomButton","random","substr","content","MODE_NOTIF","MODE_PANEL","DescriptionButton","closed","__close","caption","getButton","captionHidden","hasDescription","description","__open","notification","panel","info","DownloadButton","link","href","downloadUrl","download","pop","adapter","FullscreenButton","toggleFullscreen","fullscreenIn","fullscreenOut","MenuButton","__hideMenu","__showMenu","MENU_TEMPLATE","BUTTON_DATA","noMargin","clickHandler","li","buttonId","dataset","menuIcon","buttons","dataKey","menu","button","PressHandler","time","down","getTime","up","getOrientedArrow","arrow","AbstractMoveButton","move","handler","__stopAll","MoveDownButton","MoveLeftButton","MoveRightButton","MoveUpButton","AbstractZoomButton","zoom","ZoomInButton","zoomIn","ZoomOutButton","zoomOut","ZoomRangeButton","mediaMinWidth","zoomRange","zoomValue","slider","__onSliderUpdate","ready","__moveZoomValue","getZoomLevel","once","level","AbstractPlugin","init","DEFAULTS","plugins","loadingImg","loadingTxt","fisheye","minFov","maxFov","defaultZoomLvl","defaultLong","defaultLat","sphereCorrection","moveSpeed","zoomSpeed","autorotateDelay","autorotateSpeed","autorotateLat","moveInertia","mousewheel","mousemove","captureCursor","mousewheelCtrlKey","touchmoveTwoFingers","requestHeaders","canvasBackground","withCredentials","autorotate","fullscreen","twoFingers","ctrlZoom","loadError","keyboard","READONLY_OPTIONS","DEPRECATED_OPTIONS","zoomButtonIncrement","mousewheelSpeed","sphereCorrectionReorder","CONFIG_PARSERS","getConfig","tempConfig","hasOwnProperty","NavbarCaption","contentWidth","setCaption","html","availableWidth","__refreshButton","AVAILABLE_BUTTONS","AVAILABLE_GROUPS","registerButton","defaultPosition","unshift","Navbar","setButtons","item","cleanedButtons","__cleanButtons","buttonCtor","warnNotFound","totalWidth","visibleButtons","collapsableButtons","Loader","clientWidth","tickness","lastChild","inner","round","maxHeight","clearRect","lineWidth","strokeStyle","beginPath","arc","stroke","trigger","Notification","contentId","Overlay","dissmisable","image","text","subtext","preventDefault","PANEL_MIN_WIDTH","Panel","mouseX","mouseY","keyHandler","resizer","closeBtn","wasVisible","focus","__startResize","__resize","touches","clientX","clientY","AbstractService","vector2","Vector2","vector3","Vector3","eulerZero","Euler","DataHelper","fovToZoomLevel","fov","temp","zoomLevelToFov","vFovToHFov","vFov","radToDeg","atan","tan","aspect","speedToDuration","textureCoordsToSphericalCoords","point","relativeX","relativeY","equals","renderer","rotation","meshContainer","sphericalCoordsToVector3","applyEuler","vector3ToSphericalCoords","sphericalCoordsToTextureCoords","relativeLong","relativeLat","z","phi","theta","atan2","viewerCoordsToVector3","viewerPoint","sphereIntersect","getIntersections","userData","vector3ToViewerCoords","vectorClone","project","camera","sphericalCoordsToViewerCoords","raycaster","setFromCamera","intersectObjects","scene","cleanSphereCorrection","pan","tilt","cleanPanoramaPose","EventsHandler","state","moveThreshold","keyboardEnabled","zooming","startMouseX","startMouseY","mouseHistory","pinchDist","ctrlKeyDown","dblclickData","dblclickTimeout","longtouchTimeout","twofingersTimeout","ctrlZoomTimeout","__onResize","autoSize","__onKeyDown","__onKeyUp","__fullscreenToggled","__onMouseWheel","enableKeyboard","disableKeyboard","overlay","e2","isDefaultPrevented","action","__startMove","__stopMove","__move","__moveAbsolute","objectsObservers","viewerPos","intersections","dataHelper","emit","observer","listener","CustomEvent","originalEvent","intersection","find","__click","__cancelLongTouch","__cancelTwoFingersOverlay","__startMoveZoom","__stopMoveZoom","gestureIcon","__moveZoom","mousewheelIcon","delta","force","startKeyboardControl","stopKeyboardControl","__logMouseMove","__stopMoveInertia","norm","animationPromise","longtouch","boundingRect","rightclick","viewerX","viewerY","sphereIntersection","psvSphere","sphericalCoords","objects","o","textureCoords","textureX","textureY","NaN","hFov","currentPosition","rotate","containerRect","Renderer","WebGLRenderer","alpha","antialias","setPixelRatio","domElement","Scene","PerspectiveCamera","Group","Raycaster","canvasContainer","background","setAnimationLoop","__cleanTHREEScene","__onSizeUpdated","__onZoomUpdated","__onPositionUpdated","setSize","updateProjectionMatrix","set","lookAt","copy","multiplyScalar","negate","__renderLoop","idleTime","startAutorotate","render","setPanoramaPose","cleanCorrection","setSphereCorrection","positionProvided","zoomProvided","group","verticalAxis","rotateOnWorldAxis","horizontalAxis","cross","getWorldDirection","normalize","animation","completed","traverse","TextureLoader","FileLoader","setResponseType","setWithCredentials","setRequestHeader","abortLoading","url","lengthComputable","newProgress","total","createElementNS","URL","revokeObjectURL","createObjectURL","preloadPanorama","STATE","NONE","SHOWING","HIDING","Tooltip","__onTransitionEnd","rect","__waitImages","posClass","arrowTop","arrowLeft","__computeTooltipPosition","offset","newPos","propertyName","topBottom","box","images","querySelectorAll","promises","all","TooltipRenderer","testTooltip","tooltip","Cache","Viewer","autorotateEnabled","loadingPromise","getElementById","eventsHandler","__updateSpeeds","__resizeRefresh","resize","opts","setPanorama","performance","reason","getPlugin","pluginId","pluginCtor","getSize","clientHeight","path","transitionAnimation","showLoader","hideError","done","showError","setOptions","rawConfig","setOption","option","disableIdleTimer","stopAutorotate","errorIcon","change","animate","animProperties","tOffset","dZoom","stopAnimation","dim","enterFullscreen","observeObjects","userDataKey"],"mappings":";;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA,SAASA,QAAT,CAAkBC,OAAlB,EAA2B;EACzB,EAAA,IAAA,CAAKA,OAAL,GAAeA,OAAf,CADyB;;IAIzB,IAAI,mBAAA,IAAuBC,KAA3B,EAAkC;EAChCA,IAAAA,KAAK,CAACC,iBAAN,CAAwB,IAAxB,EAA8BH,QAA9B,CAAA,CAAA;EACD,GAFD,MAGK;EACH,IAAA,IAAA,CAAKI,KAAL,GAAc,IAAIF,KAAJ,EAAD,CAAcE,KAA3B,CAAA;EACD,GAAA;EACF,CAAA;;EAEDJ,QAAQ,CAACK,SAAT,GAAqBC,MAAM,CAACC,MAAP,CAAcL,KAAK,CAACG,SAApB,CAArB,CAAA;EACAL,QAAQ,CAACK,SAAT,CAAmBG,IAAnB,GAA0B,UAA1B,CAAA;EACAR,QAAQ,CAACK,SAAT,CAAmBI,WAAnB,GAAiCT,QAAjC;;EClBA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;AACA,MAAaU,e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AvEA;;EAwEpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cA9EA;;EA+EpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,SAAS,EAAW,WArFA;;EAsFpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,aAAa,EAAO,eA5FA;;EA6FpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,UAAU,EAAU,YAnGA;;EAoGpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,eAAe,EAAK,iBA1GA;;EA2GpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,gBAAgB,EAAI,kBAjHA;;EAkHpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,KAAK,EAAe,OAvHA;;EAwHpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,MAAM,EAAc,QA7HA;;EA8HpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,iBAAiB,EAAG,mBApIA;;EAqIpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cA3IA;;EA4IpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cAnJA;;EAoJpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cA1JA;;EA2JpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,QAAQ,EAAY,UAhKA;;EAiKpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAQ,cAAA;EAvKA,CAAf,CAAA;EA0KP;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,aAAa,GAAG;EAC3B;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,oBAAoB,EAAE,sBARK;;EAS3B;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,mBAAmB,EAAG,qBAAA;EAhBK,CAAtB,CAAA;EAmBP;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,aAAa,GAAG;EA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K,QAA5B,EAAsC;EAAA,IAAA,IAAA,MAAA,GAAA,IAAA,CAAA;;EACpC,IAAA,IAAA,CAAK1nB,IAAL,CAAUonB,gBAAV,CAA2BuK,WAA3B,CAA0C,GAAA;EAAEjK,MAAAA,QAAQ,EAARA,QAAAA;OAA5C,CAAA;EAEA,IAAA,OAAO,YAAM;EACX,MAAA,OAAO,MAAI,CAAC1nB,IAAL,CAAUonB,gBAAV,CAA2BuK,WAA3B,CAAP,CAAA;OADF,CAAA;EAGD,GAAA;EAED;EACF;EACA;EACA;EACA;EA16BA,GAAA;;IAAA,MA26BEtX,CAAAA,SA36BF,GA26BE,SAAY,SAAA,GAAA;EACV,IAAA,IAAA,CAAKkG,OAAL,CAAalsB,MAAM,CAACuB,QAApB,CAAA,CAAA;EAEA,IAAA,IAAA,CAAKm7B,gBAAL,EAAA,CAAA;EACA,IAAA,IAAA,CAAKC,cAAL,EAAA,CAAA;MACA,OAAO,IAAA,CAAKO,aAAL,EAAP,CAAA;EACD,GAAA;EAED;EACF;EACA;EACA;EAt7BA,GAAA;;IAAA,MAu7BE9B,CAAAA,cAv7BF,GAu7BE,SAAiB,cAAA,GAAA;MACf,IAAKphB,CAAAA,QAAL,CAAcsM,IAAd,CAAmBrN,QAAnB,CAA4B,IAAA,CAAKsD,MAAL,CAAY6L,SAAZ,GAAwB,EAApD,CAAA,CAAA;EACA,IAAA,IAAA,CAAKpO,QAAL,CAAcb,QAAd,CAAuBF,QAAvB,CAAgC9D,KAAK,CAACC,SAAN,CAAgBC,QAAhB,CAAyB,IAAKkH,CAAAA,MAAL,CAAY4L,SAAZ,GAAwB,EAAjD,CAAhC,CAAA,CAAA;KAz7BJ,CAAA;;EAAA,EAAA,OAAA,MAAA,CAAA;EAAA,CAAA,CAA4B/L,mBAA5B;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/autorotate-keypoints.js b/dist/plugins/autorotate-keypoints.js index 6c6e153f4..5902b1b18 100644 --- a/dist/plugins/autorotate-keypoints.js +++ b/dist/plugins/autorotate-keypoints.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/compass.css b/dist/plugins/compass.css index 404a78177..5ccdd2879 100644 --- a/dist/plugins/compass.css +++ b/dist/plugins/compass.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.6.5 + * Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/compass.js b/dist/plugins/compass.js index cfc1f6d2e..3415bd40c 100644 --- a/dist/plugins/compass.js +++ b/dist/plugins/compass.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -125,7 +125,7 @@ */ _this.container = document.createElement('div'); - photoSphereViewer.utils.addClasses(_this.container, "psv-compass psv-compass--" + _this.config.position.join('-')); + _this.container.className = "psv-compass psv-compass--" + _this.config.position.join('-'); _this.container.innerHTML = _this.config.backgroundSvg; _this.container.style.width = _this.config.size; _this.container.style.height = _this.config.size; diff --git a/dist/plugins/compass.js.map b/dist/plugins/compass.js.map index 433ca239f..e07bfb733 100644 --- a/dist/plugins/compass.js.map +++ b/dist/plugins/compass.js.map @@ -1 +1 @@ -{"version":3,"file":"compass.js","sources":["../../src/plugins/compass/index.js"],"sourcesContent":["import * as THREE from 'three';\nimport { AbstractPlugin, CONSTANTS, SYSTEM, utils } from '../..';\nimport compass from './compass.svg';\nimport './style.scss';\n\n\n/**\n * @typedef {Object} PSV.plugins.CompassPlugin.Options\n * @property {string} [size='120px'] - size of the compass\n * @property {string} [position='top left'] - position of the compass\n * @property {string} [backgroundSvg] - SVG used as background of the compass\n * @property {string} [coneColor='rgba(255, 255, 255, 0.5)'] - color of the cone of the compass\n * @property {boolean} [navigation=true] - allows to click on the compass to rotate the viewer\n * @property {string} [navigationColor='rgba(255, 0, 0, 0.2)'] - color of the navigation cone\n * @property {PSV.plugins.CompassPlugin.Hotspot[]} [hotspots] - small dots visible on the compass (will contain every marker with the \"compass\" data)\n * @property {string} [hotspotColor='rgba(0, 0, 0, 0.5)'] - default color of hotspots\n */\n\n/**\n * @typedef {PSV.ExtendedPosition} PSV.plugins.CompassPlugin.Hotspot\n * @type {string} [color] - override the global \"hotspotColor\"\n */\n\n\nconst HOTSPOT_SIZE_RATIO = 1 / 40;\n\n\n/**\n * @summary Adds a compass on the viewer\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class CompassPlugin extends AbstractPlugin {\n\n static id = 'compass';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.CompassPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.plugins.CompassPlugin.Options}\n * @private\n */\n this.config = {\n size : '120px',\n position : 'top left',\n backgroundSvg : compass,\n coneColor : 'rgba(255, 255, 255, 0.5)',\n navigation : true,\n navigationColor: 'rgba(255, 0, 0, 0.2)',\n hotspotColor : 'rgba(0, 0, 0, 0.5)',\n ...options,\n };\n this.config.position = utils.cleanPosition(this.config.position, 'top left');\n\n /**\n * @private\n */\n this.prop = {\n visible : true,\n mouse : null,\n mouseDown: false,\n markers : [],\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = null;\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.container = document.createElement('div');\n utils.addClasses(this.container, `psv-compass psv-compass--${this.config.position.join('-')}`);\n this.container.innerHTML = this.config.backgroundSvg;\n\n this.container.style.width = this.config.size;\n this.container.style.height = this.config.size;\n if (this.config.position[0] === 'center') {\n this.container.style.marginTop = `calc(-${this.config.size} / 2)`;\n }\n if (this.config.position[1] === 'center') {\n this.container.style.marginLeft = `calc(-${this.config.size} / 2)`;\n }\n\n /**\n * @member {HTMLCanvasElement}\n * @readonly\n * @private\n */\n this.canvas = document.createElement('canvas');\n\n this.container.appendChild(this.canvas);\n\n if (this.config.navigation) {\n this.container.addEventListener('mouseenter', this);\n this.container.addEventListener('mouseleave', this);\n this.container.addEventListener('mousemove', this);\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('mouseup', this);\n this.container.addEventListener('touchstart', this);\n this.container.addEventListener('touchmove', this);\n this.container.addEventListener('touchend', this);\n }\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.markers = this.psv.getPlugin('markers');\n\n this.psv.container.appendChild(this.container);\n\n this.canvas.width = this.container.clientWidth * SYSTEM.pixelRatio;\n this.canvas.height = this.container.clientWidth * SYSTEM.pixelRatio;\n\n this.psv.on(CONSTANTS.EVENTS.RENDER, this);\n\n if (this.markers) {\n this.markers.on('set-markers', this);\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.RENDER, this);\n\n if (this.markers) {\n this.markers.off('set-markers', this);\n }\n\n this.psv.container.removeChild(this.container);\n\n delete this.canvas;\n delete this.container;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n switch (e.type) {\n case CONSTANTS.EVENTS.RENDER:\n this.__update();\n break;\n case 'set-markers':\n this.prop.markers = e.args[0].filter(m => m.data?.compass);\n this.__update();\n break;\n case 'mouseenter':\n case 'mousemove':\n case 'touchmove':\n this.prop.mouse = e.changedTouches?.[0] || e;\n if (this.prop.mouseDown) {\n this.__click();\n }\n else {\n this.__update();\n }\n e.stopPropagation();\n e.preventDefault();\n break;\n case 'mousedown':\n case 'touchstart':\n this.prop.mouseDown = true;\n e.stopPropagation();\n e.preventDefault();\n break;\n case 'mouseup':\n case 'touchend':\n this.prop.mouse = e.changedTouches?.[0] || e;\n this.prop.mouseDown = false;\n this.__click();\n if (e.changedTouches) {\n this.prop.mouse = null;\n this.__update();\n }\n e.stopPropagation();\n e.preventDefault();\n break;\n case 'mouseleave':\n this.prop.mouse = null;\n this.prop.mouseDown = false;\n this.__update();\n break;\n default:\n break;\n }\n }\n\n /**\n * @summary Hides the compass\n */\n hide() {\n this.container.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @summary Shows the compass\n */\n show() {\n this.container.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @summary Changes the hotspots on the compass\n * @param {PSV.plugins.CompassPlugin.Hotspot[]} hotspots\n */\n setHotspots(hotspots) {\n this.config.hotspots = hotspots;\n this.__update();\n }\n\n /**\n * @summary Removes all hotspots\n */\n clearHotspots() {\n this.setHotspots(null);\n }\n\n /**\n * @summary Updates the compass for current zoom and position\n * @private\n */\n __update() {\n const context = this.canvas.getContext('2d');\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n const longitude = this.psv.getPosition().longitude;\n const fov = THREE.MathUtils.degToRad(this.psv.prop.hFov);\n\n this.__drawCone(context, this.config.coneColor, longitude, fov);\n\n const mouseAngle = this.__getMouseAngle();\n if (mouseAngle !== null) {\n this.__drawCone(context, this.config.navigationColor, mouseAngle, fov);\n }\n\n this.prop.markers.forEach((marker) => {\n this.__drawMarker(context, marker);\n });\n this.config.hotspots?.forEach((spot) => {\n if ('longitude' in spot && !('latitude' in spot)) {\n spot.latitude = 0;\n }\n const pos = this.psv.dataHelper.cleanPosition(spot);\n this.__drawPoint(context, spot.color || this.config.hotspotColor, pos.longitude, pos.latitude);\n });\n }\n\n /**\n * @summary Rotates the viewer depending on the position of the mouse on the compass\n * @private\n */\n __click() {\n const mouseAngle = this.__getMouseAngle();\n\n if (mouseAngle !== null) {\n this.psv.rotate({\n longitude: mouseAngle,\n latitude : 0,\n });\n }\n }\n\n /**\n * @summary Draw a cone\n * @param {CanvasRenderingContext2D} context\n * @param {string} color\n * @param {number} longitude - in viewer reference\n * @param {number} fov\n * @private\n */\n __drawCone(context, color, longitude, fov) {\n const a1 = longitude - Math.PI / 2 - fov / 2;\n const a2 = a1 + fov;\n const c = this.canvas.width / 2;\n\n context.beginPath();\n context.moveTo(c, c);\n context.lineTo(c + Math.cos(a1) * c, c + Math.sin(a1) * c);\n context.arc(c, c, c, a1, a2, false);\n context.lineTo(c, c);\n context.fillStyle = color;\n context.fill();\n }\n\n /**\n * @summary Draw a Marker\n * @param {CanvasRenderingContext2D} context\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @private\n */\n __drawMarker(context, marker) {\n let color = this.config.hotspotColor;\n if (typeof marker.data.compass === 'string') {\n color = marker.data.compass;\n }\n\n if (marker.isPoly()) {\n context.beginPath();\n marker.props.def.forEach(([longitude, latitude], i) => {\n const a = longitude - Math.PI / 2;\n const d = (latitude + Math.PI / 2) / Math.PI;\n const c = this.canvas.width / 2;\n\n context[i === 0 ? 'moveTo' : 'lineTo'](c + Math.cos(a) * c * d, c + Math.sin(a) * c * d);\n });\n if (marker.isPolygon()) {\n context.fillStyle = color;\n context.fill();\n }\n else {\n context.strokeStyle = color;\n context.lineWidth = Math.max(1, this.canvas.width * HOTSPOT_SIZE_RATIO / 2);\n context.stroke();\n }\n }\n else {\n const pos = marker.props.position;\n this.__drawPoint(context, color, pos.longitude, pos.latitude);\n }\n }\n\n /**\n * @summary Draw a point\n * @param {CanvasRenderingContext2D} context\n * @param {string} color\n * @param {number} longitude - in viewer reference\n * @param {number} latitude - in viewer reference\n * @private\n */\n __drawPoint(context, color, longitude, latitude) {\n const a = longitude - Math.PI / 2;\n const d = (latitude + Math.PI / 2) / Math.PI;\n const c = this.canvas.width / 2;\n const r = Math.max(2, this.canvas.width * HOTSPOT_SIZE_RATIO);\n\n context.beginPath();\n context.ellipse(\n c + Math.cos(a) * c * d, c + Math.sin(a) * c * d,\n r, r,\n 0, 0, Math.PI * 2\n );\n context.fillStyle = color;\n context.fill();\n }\n\n /**\n * @summary Gets the longitude corresponding to the mouse position on the compass\n * @return {number | null}\n * @private\n */\n __getMouseAngle() {\n if (!this.prop.mouse) {\n return null;\n }\n\n const boundingRect = this.container.getBoundingClientRect();\n const mouseX = this.prop.mouse.clientX - boundingRect.left - boundingRect.width / 2;\n const mouseY = this.prop.mouse.clientY - boundingRect.top - boundingRect.width / 2;\n\n if (Math.sqrt(mouseX * mouseX + mouseY * mouseY) > boundingRect.width / 2) {\n return null;\n }\n\n return Math.atan2(mouseY, mouseX) + Math.PI / 2;\n }\n\n}\n"],"names":["HOTSPOT_SIZE_RATIO","CompassPlugin","psv","options","config","size","position","backgroundSvg","compass","coneColor","navigation","navigationColor","hotspotColor","utils","cleanPosition","prop","visible","mouse","mouseDown","markers","container","document","createElement","addClasses","join","innerHTML","style","width","height","marginTop","marginLeft","canvas","appendChild","addEventListener","init","getPlugin","clientWidth","SYSTEM","pixelRatio","on","CONSTANTS","EVENTS","RENDER","destroy","off","removeChild","handleEvent","e","type","__update","args","filter","m","data","changedTouches","__click","stopPropagation","preventDefault","hide","display","show","setHotspots","hotspots","clearHotspots","context","getContext","clearRect","longitude","getPosition","fov","THREE","MathUtils","degToRad","hFov","__drawCone","mouseAngle","__getMouseAngle","forEach","marker","__drawMarker","spot","latitude","pos","dataHelper","__drawPoint","color","rotate","a1","Math","PI","a2","c","beginPath","moveTo","lineTo","cos","sin","arc","fillStyle","fill","isPoly","props","def","i","a","d","isPolygon","strokeStyle","lineWidth","max","stroke","r","ellipse","boundingRect","getBoundingClientRect","mouseX","clientX","left","mouseY","clientY","top","sqrt","atan2","AbstractPlugin","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAGA,IAAMA,kBAAkB,GAAG,CAAA,GAAI,EAA/B,CAAA;EAGA;EACA;EACA;EACA;EACA;;AACA,MAAaC,aAAb,gBA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6D,IAAI,CAACkC,KAAL,CAAWJ,MAAX,EAAmBH,MAAnB,CAAA,GAA6B3B,IAAI,CAACC,EAAL,GAAU,CAA9C,CAAA;KA/VJ,CAAA;;EAAA,EAAA,OAAA,aAAA,CAAA;EAAA,CAAA,CAAmCkC,gCAAnC,EAAA;EAAa1H,cAEJ2H,KAAK;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"compass.js","sources":["../../src/plugins/compass/index.js"],"sourcesContent":["import * as THREE from 'three';\nimport { AbstractPlugin, CONSTANTS, SYSTEM, utils } from '../..';\nimport compass from './compass.svg';\nimport './style.scss';\n\n\n/**\n * @typedef {Object} PSV.plugins.CompassPlugin.Options\n * @property {string} [size='120px'] - size of the compass\n * @property {string} [position='top left'] - position of the compass\n * @property {string} [backgroundSvg] - SVG used as background of the compass\n * @property {string} [coneColor='rgba(255, 255, 255, 0.5)'] - color of the cone of the compass\n * @property {boolean} [navigation=true] - allows to click on the compass to rotate the viewer\n * @property {string} [navigationColor='rgba(255, 0, 0, 0.2)'] - color of the navigation cone\n * @property {PSV.plugins.CompassPlugin.Hotspot[]} [hotspots] - small dots visible on the compass (will contain every marker with the \"compass\" data)\n * @property {string} [hotspotColor='rgba(0, 0, 0, 0.5)'] - default color of hotspots\n */\n\n/**\n * @typedef {PSV.ExtendedPosition} PSV.plugins.CompassPlugin.Hotspot\n * @type {string} [color] - override the global \"hotspotColor\"\n */\n\n\nconst HOTSPOT_SIZE_RATIO = 1 / 40;\n\n\n/**\n * @summary Adds a compass on the viewer\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class CompassPlugin extends AbstractPlugin {\n\n static id = 'compass';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.CompassPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.plugins.CompassPlugin.Options}\n * @private\n */\n this.config = {\n size : '120px',\n position : 'top left',\n backgroundSvg : compass,\n coneColor : 'rgba(255, 255, 255, 0.5)',\n navigation : true,\n navigationColor: 'rgba(255, 0, 0, 0.2)',\n hotspotColor : 'rgba(0, 0, 0, 0.5)',\n ...options,\n };\n this.config.position = utils.cleanPosition(this.config.position, 'top left');\n\n /**\n * @private\n */\n this.prop = {\n visible : true,\n mouse : null,\n mouseDown: false,\n markers : [],\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = null;\n\n /**\n * @member {HTMLElement}\n * @readonly\n * @private\n */\n this.container = document.createElement('div');\n this.container.className = `psv-compass psv-compass--${this.config.position.join('-')}`;\n this.container.innerHTML = this.config.backgroundSvg;\n\n this.container.style.width = this.config.size;\n this.container.style.height = this.config.size;\n if (this.config.position[0] === 'center') {\n this.container.style.marginTop = `calc(-${this.config.size} / 2)`;\n }\n if (this.config.position[1] === 'center') {\n this.container.style.marginLeft = `calc(-${this.config.size} / 2)`;\n }\n\n /**\n * @member {HTMLCanvasElement}\n * @readonly\n * @private\n */\n this.canvas = document.createElement('canvas');\n\n this.container.appendChild(this.canvas);\n\n if (this.config.navigation) {\n this.container.addEventListener('mouseenter', this);\n this.container.addEventListener('mouseleave', this);\n this.container.addEventListener('mousemove', this);\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('mouseup', this);\n this.container.addEventListener('touchstart', this);\n this.container.addEventListener('touchmove', this);\n this.container.addEventListener('touchend', this);\n }\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.markers = this.psv.getPlugin('markers');\n\n this.psv.container.appendChild(this.container);\n\n this.canvas.width = this.container.clientWidth * SYSTEM.pixelRatio;\n this.canvas.height = this.container.clientWidth * SYSTEM.pixelRatio;\n\n this.psv.on(CONSTANTS.EVENTS.RENDER, this);\n\n if (this.markers) {\n this.markers.on('set-markers', this);\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.RENDER, this);\n\n if (this.markers) {\n this.markers.off('set-markers', this);\n }\n\n this.psv.container.removeChild(this.container);\n\n delete this.canvas;\n delete this.container;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n switch (e.type) {\n case CONSTANTS.EVENTS.RENDER:\n this.__update();\n break;\n case 'set-markers':\n this.prop.markers = e.args[0].filter(m => m.data?.compass);\n this.__update();\n break;\n case 'mouseenter':\n case 'mousemove':\n case 'touchmove':\n this.prop.mouse = e.changedTouches?.[0] || e;\n if (this.prop.mouseDown) {\n this.__click();\n }\n else {\n this.__update();\n }\n e.stopPropagation();\n e.preventDefault();\n break;\n case 'mousedown':\n case 'touchstart':\n this.prop.mouseDown = true;\n e.stopPropagation();\n e.preventDefault();\n break;\n case 'mouseup':\n case 'touchend':\n this.prop.mouse = e.changedTouches?.[0] || e;\n this.prop.mouseDown = false;\n this.__click();\n if (e.changedTouches) {\n this.prop.mouse = null;\n this.__update();\n }\n e.stopPropagation();\n e.preventDefault();\n break;\n case 'mouseleave':\n this.prop.mouse = null;\n this.prop.mouseDown = false;\n this.__update();\n break;\n default:\n break;\n }\n }\n\n /**\n * @summary Hides the compass\n */\n hide() {\n this.container.style.display = 'none';\n this.prop.visible = false;\n }\n\n /**\n * @summary Shows the compass\n */\n show() {\n this.container.style.display = '';\n this.prop.visible = true;\n }\n\n /**\n * @summary Changes the hotspots on the compass\n * @param {PSV.plugins.CompassPlugin.Hotspot[]} hotspots\n */\n setHotspots(hotspots) {\n this.config.hotspots = hotspots;\n this.__update();\n }\n\n /**\n * @summary Removes all hotspots\n */\n clearHotspots() {\n this.setHotspots(null);\n }\n\n /**\n * @summary Updates the compass for current zoom and position\n * @private\n */\n __update() {\n const context = this.canvas.getContext('2d');\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n const longitude = this.psv.getPosition().longitude;\n const fov = THREE.MathUtils.degToRad(this.psv.prop.hFov);\n\n this.__drawCone(context, this.config.coneColor, longitude, fov);\n\n const mouseAngle = this.__getMouseAngle();\n if (mouseAngle !== null) {\n this.__drawCone(context, this.config.navigationColor, mouseAngle, fov);\n }\n\n this.prop.markers.forEach((marker) => {\n this.__drawMarker(context, marker);\n });\n this.config.hotspots?.forEach((spot) => {\n if ('longitude' in spot && !('latitude' in spot)) {\n spot.latitude = 0;\n }\n const pos = this.psv.dataHelper.cleanPosition(spot);\n this.__drawPoint(context, spot.color || this.config.hotspotColor, pos.longitude, pos.latitude);\n });\n }\n\n /**\n * @summary Rotates the viewer depending on the position of the mouse on the compass\n * @private\n */\n __click() {\n const mouseAngle = this.__getMouseAngle();\n\n if (mouseAngle !== null) {\n this.psv.rotate({\n longitude: mouseAngle,\n latitude : 0,\n });\n }\n }\n\n /**\n * @summary Draw a cone\n * @param {CanvasRenderingContext2D} context\n * @param {string} color\n * @param {number} longitude - in viewer reference\n * @param {number} fov\n * @private\n */\n __drawCone(context, color, longitude, fov) {\n const a1 = longitude - Math.PI / 2 - fov / 2;\n const a2 = a1 + fov;\n const c = this.canvas.width / 2;\n\n context.beginPath();\n context.moveTo(c, c);\n context.lineTo(c + Math.cos(a1) * c, c + Math.sin(a1) * c);\n context.arc(c, c, c, a1, a2, false);\n context.lineTo(c, c);\n context.fillStyle = color;\n context.fill();\n }\n\n /**\n * @summary Draw a Marker\n * @param {CanvasRenderingContext2D} context\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @private\n */\n __drawMarker(context, marker) {\n let color = this.config.hotspotColor;\n if (typeof marker.data.compass === 'string') {\n color = marker.data.compass;\n }\n\n if (marker.isPoly()) {\n context.beginPath();\n marker.props.def.forEach(([longitude, latitude], i) => {\n const a = longitude - Math.PI / 2;\n const d = (latitude + Math.PI / 2) / Math.PI;\n const c = this.canvas.width / 2;\n\n context[i === 0 ? 'moveTo' : 'lineTo'](c + Math.cos(a) * c * d, c + Math.sin(a) * c * d);\n });\n if (marker.isPolygon()) {\n context.fillStyle = color;\n context.fill();\n }\n else {\n context.strokeStyle = color;\n context.lineWidth = Math.max(1, this.canvas.width * HOTSPOT_SIZE_RATIO / 2);\n context.stroke();\n }\n }\n else {\n const pos = marker.props.position;\n this.__drawPoint(context, color, pos.longitude, pos.latitude);\n }\n }\n\n /**\n * @summary Draw a point\n * @param {CanvasRenderingContext2D} context\n * @param {string} color\n * @param {number} longitude - in viewer reference\n * @param {number} latitude - in viewer reference\n * @private\n */\n __drawPoint(context, color, longitude, latitude) {\n const a = longitude - Math.PI / 2;\n const d = (latitude + Math.PI / 2) / Math.PI;\n const c = this.canvas.width / 2;\n const r = Math.max(2, this.canvas.width * HOTSPOT_SIZE_RATIO);\n\n context.beginPath();\n context.ellipse(\n c + Math.cos(a) * c * d, c + Math.sin(a) * c * d,\n r, r,\n 0, 0, Math.PI * 2\n );\n context.fillStyle = color;\n context.fill();\n }\n\n /**\n * @summary Gets the longitude corresponding to the mouse position on the compass\n * @return {number | null}\n * @private\n */\n __getMouseAngle() {\n if (!this.prop.mouse) {\n return null;\n }\n\n const boundingRect = this.container.getBoundingClientRect();\n const mouseX = this.prop.mouse.clientX - boundingRect.left - boundingRect.width / 2;\n const mouseY = this.prop.mouse.clientY - boundingRect.top - boundingRect.width / 2;\n\n if (Math.sqrt(mouseX * mouseX + mouseY * mouseY) > boundingRect.width / 2) {\n return null;\n }\n\n return Math.atan2(mouseY, mouseX) + Math.PI / 2;\n }\n\n}\n"],"names":["HOTSPOT_SIZE_RATIO","CompassPlugin","psv","options","config","size","position","backgroundSvg","compass","coneColor","navigation","navigationColor","hotspotColor","utils","cleanPosition","prop","visible","mouse","mouseDown","markers","container","document","createElement","className","join","innerHTML","style","width","height","marginTop","marginLeft","canvas","appendChild","addEventListener","init","getPlugin","clientWidth","SYSTEM","pixelRatio","on","CONSTANTS","EVENTS","RENDER","destroy","off","removeChild","handleEvent","e","type","__update","args","filter","m","data","changedTouches","__click","stopPropagation","preventDefault","hide","display","show","setHotspots","hotspots","clearHotspots","context","getContext","clearRect","longitude","getPosition","fov","THREE","MathUtils","degToRad","hFov","__drawCone","mouseAngle","__getMouseAngle","forEach","marker","__drawMarker","spot","latitude","pos","dataHelper","__drawPoint","color","rotate","a1","Math","PI","a2","c","beginPath","moveTo","lineTo","cos","sin","arc","fillStyle","fill","isPoly","props","def","i","a","d","isPolygon","strokeStyle","lineWidth","max","stroke","r","ellipse","boundingRect","getBoundingClientRect","mouseX","clientX","left","mouseY","clientY","top","sqrt","atan2","AbstractPlugin","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAGA,IAAMA,kBAAkB,GAAG,CAAA,GAAI,EAA/B,CAAA;EAGA;EACA;EACA;EACA;EACA;;AACA,MAAaC,aAAb,gBAAA,UAAA,eAAA,EAAA;EAAA,EAAA,cAAA,CAAA,aAAA,EAAA,eAAA,CAAA,CAAA;;EAIE;EACF;EACA;EACA;IACE,SAAYC,aAAAA,CAAAA,GAAZ,EAAiBC,OAAjB,EAA0B;EAAA,IAAA,IAAA,KAAA,CAAA;;EACxB,IAAA,KAAA,GAAA,eAAA,CAAA,IAAA,CAAA,IAAA,EAAMD,GAAN,CAAA,IAAA,IAAA,CAAA;EAEA;EACJ;EACA;EACA;;EACI,IAAA,KAAA,CAAKE,MAAL,GAAA,QAAA,CAAA;EACEC,MAAAA,IAAI,EAAa,OADnB;EAEEC,MAAAA,QAAQ,EAAS,UAFnB;EAGEC,MAAAA,aAAa,EAAIC,OAHnB;EAIEC,MAAAA,SAAS,EAAQ,0BAJnB;EAKEC,MAAAA,UAAU,EAAO,IALnB;EAMEC,MAAAA,eAAe,EAAE,sBANnB;EAOEC,MAAAA,YAAY,EAAK,oBAAA;EAPnB,KAAA,EAQKT,OARL,CAAA,CAAA;EAUA,IAAA,KAAA,CAAKC,MAAL,CAAYE,QAAZ,GAAuBO,uBAAK,CAACC,aAAN,CAAoB,KAAA,CAAKV,MAAL,CAAYE,QAAhC,EAA0C,UAA1C,CAAvB,CAAA;EAEA;EACJ;EACA;;EACI,IAAA,KAAA,CAA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,YAAY,CAACtF,KAAb,GAAqB,CAAlF,CAAA;EACA,IAAA,IAAM2F,MAAM,GAAG,IAAA,CAAKvG,IAAL,CAAUE,KAAV,CAAgBsG,OAAhB,GAA0BN,YAAY,CAACO,GAAvC,GAA6CP,YAAY,CAACtF,KAAb,GAAqB,CAAjF,CAAA;;EAEA,IAAA,IAAI6D,IAAI,CAACiC,IAAL,CAAUN,MAAM,GAAGA,MAAT,GAAkBG,MAAM,GAAGA,MAArC,CAA+CL,GAAAA,YAAY,CAACtF,KAAb,GAAqB,CAAxE,EAA2E;EACzE,MAAA,OAAO,IAAP,CAAA;EACD,KAAA;;EAED,IAAA,OAAO6D,IAAI,CAACkC,KAAL,CAAWJ,MAAX,EAAmBH,MAAnB,CAAA,GAA6B3B,IAAI,CAACC,EAAL,GAAU,CAA9C,CAAA;KA/VJ,CAAA;;EAAA,EAAA,OAAA,aAAA,CAAA;EAAA,CAAA,CAAmCkC,gCAAnC,EAAA;EAAa1H,cAEJ2H,KAAK;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/gallery.css b/dist/plugins/gallery.css new file mode 100644 index 000000000..36dc0389d --- /dev/null +++ b/dist/plugins/gallery.css @@ -0,0 +1,117 @@ +/*! + * Photo Sphere Viewer 4.7.0 + * @copyright 2014-2015 Jérémy Heleine + * @copyright 2015-2022 Damien "Mistic" Sorel + * @licence MIT (https://opensource.org/licenses/MIT) + */ +.psv-gallery { + position: absolute; + left: 0; + bottom: calc(-100px - 30px - 20px); + width: 100%; + background: rgba(61, 61, 61, 0.5); + border-bottom: 1px solid rgba(255, 255, 255, 0.7); + overflow-x: auto; + overflow-y: hidden; + -webkit-transition: bottom ease-in-out 0.1s; + transition: bottom ease-in-out 0.1s; + z-index: 90; +} +.psv-gallery--open { + bottom: 0; +} +.psv--has-navbar .psv-gallery--open { + bottom: 40px; +} + +.psv-gallery-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding: 15px; +} +.psv-gallery-item { + -webkit-box-flex: 0; + -ms-flex: none; + flex: none; + position: relative; + margin-right: 15px; + width: 200px; + height: 100px; + border-radius: 5px; + overflow: hidden; +} +.psv-gallery-item-title { + position: absolute; + top: 0; + left: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 2.2em; + padding: 0.5em; + background: rgba(0, 0, 0, 0.6); + font: 16px sans-serif; + line-height: 1.2em; + color: rgba(255, 255, 255, 0.7); + z-index: 2; + -webkit-transition: height ease-in-out 0.2s; + transition: height ease-in-out 0.2s; +} +.psv-gallery-item-title span { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.psv-gallery-item-thumb { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-position: center center; + background-size: cover; + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + -webkit-transition: -webkit-transform ease-in-out 0.2s; + transition: -webkit-transform ease-in-out 0.2s; + transition: transform ease-in-out 0.2s; + transition: transform ease-in-out 0.2s, -webkit-transform ease-in-out 0.2s; + z-index: 1; +} +.psv-gallery-item:hover .psv-gallery-item-title { + height: 100%; +} +.psv-gallery-item:hover .psv-gallery-item-title span { + white-space: normal; +} +.psv-gallery-item:hover .psv-gallery-item-thumb { + -webkit-transform: scale3d(1.2, 1.2, 1); + transform: scale3d(1.2, 1.2, 1); +} +.psv-gallery-item--active::after { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + -webkit-box-sizing: border-box; + box-sizing: border-box; + border: 3px solid white; + z-index: 3; +} +/*# sourceMappingURL=gallery.css.map */ \ No newline at end of file diff --git a/dist/plugins/gallery.css.map b/dist/plugins/gallery.css.map new file mode 100644 index 000000000..ae1ac0096 --- /dev/null +++ b/dist/plugins/gallery.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["","style.scss"],"names":[],"mappings":"AAAA;;;;;GAAA;ACAA;EACE,kBAAkB;EAClB,OAAO;EACP,kCAAkC;EAClC,WAAW;EACX,iCAAiC;EACjC,iDAAiD;EACjD,gBAAgB;EAChB,kBAAkB;EAClB,2CAAmC;EAAnC,mCAAmC;EACnC,WAAW;AACb;AACA;EACE,SAAS;AACX;AACA;EACE,YAAY;AACd;;AAEA;EACE,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,aAAa;AACf;AACA;EACE,mBAAU;MAAV,cAAU;UAAV,UAAU;EACV,kBAAkB;EAClB,kBAAkB;EAClB,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,oBAAa;EAAb,oBAAa;EAAb,aAAa;EACb,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,wBAAuB;MAAvB,qBAAuB;UAAvB,uBAAuB;EACvB,8BAAsB;UAAtB,sBAAsB;EACtB,WAAW;EACX,aAAa;EACb,cAAc;EACd,8BAA8B;EAC9B,qBAAqB;EACrB,kBAAkB;EAClB,+BAA+B;EAC/B,UAAU;EACV,2CAAmC;EAAnC,mCAAmC;AACrC;AACA;EACE,mBAAmB;EACnB,uBAAuB;EACvB,gBAAgB;EAChB,yBAAiB;KAAjB,sBAAiB;MAAjB,qBAAiB;UAAjB,iBAAiB;AACnB;AACA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,kCAAkC;EAClC,sBAAsB;EACtB,mCAA2B;UAA3B,2BAA2B;EAC3B,sDAAsC;EAAtC,8CAAsC;EAAtC,sCAAsC;EAAtC,0EAAsC;EACtC,UAAU;AACZ;AACA;EACE,YAAY;AACd;AACA;EACE,mBAAmB;AACrB;AACA;EACE,uCAA+B;UAA/B,+BAA+B;AACjC;AACA;EACE,WAAW;EACX,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,8BAAsB;UAAtB,sBAAsB;EACtB,uBAAuB;EACvB,UAAU;AACZ","file":"gallery.css","sourcesContent":[null,".psv-gallery {\n position: absolute;\n left: 0;\n bottom: calc(-100px - 30px - 20px);\n width: 100%;\n background: rgba(61, 61, 61, 0.5);\n border-bottom: 1px solid rgba(255, 255, 255, 0.7);\n overflow-x: auto;\n overflow-y: hidden;\n transition: bottom ease-in-out 0.1s;\n z-index: 90;\n}\n.psv-gallery--open {\n bottom: 0;\n}\n.psv--has-navbar .psv-gallery--open {\n bottom: 40px;\n}\n\n.psv-gallery-container {\n display: flex;\n padding: 15px;\n}\n.psv-gallery-item {\n flex: none;\n position: relative;\n margin-right: 15px;\n width: 200px;\n height: 100px;\n border-radius: 5px;\n overflow: hidden;\n}\n.psv-gallery-item-title {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: flex-start;\n box-sizing: border-box;\n width: 100%;\n height: 2.2em;\n padding: 0.5em;\n background: rgba(0, 0, 0, 0.6);\n font: 16px sans-serif;\n line-height: 1.2em;\n color: rgba(255, 255, 255, 0.7);\n z-index: 2;\n transition: height ease-in-out 0.2s;\n}\n.psv-gallery-item-title span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n user-select: none;\n}\n.psv-gallery-item-thumb {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-position: center center;\n background-size: cover;\n transform: scale3d(1, 1, 1);\n transition: transform ease-in-out 0.2s;\n z-index: 1;\n}\n.psv-gallery-item:hover .psv-gallery-item-title {\n height: 100%;\n}\n.psv-gallery-item:hover .psv-gallery-item-title span {\n white-space: normal;\n}\n.psv-gallery-item:hover .psv-gallery-item-thumb {\n transform: scale3d(1.2, 1.2, 1);\n}\n.psv-gallery-item--active::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n border: 3px solid white;\n z-index: 3;\n}"]} \ No newline at end of file diff --git a/dist/plugins/gallery.d.ts b/dist/plugins/gallery.d.ts new file mode 100644 index 000000000..7862da340 --- /dev/null +++ b/dist/plugins/gallery.d.ts @@ -0,0 +1,62 @@ +import { PanoramaOptions, AbstractPlugin, Viewer } from 'photo-sphere-viewer'; + +type GalleryPluginOptions = { + items?: GalleryPluginItem[]; + visibleOnLoad?: boolean; +}; + +type GalleryPluginItem = { + id: number | string; + panorama: any; + thumbnail?: string; + name?: string; + options?: PanoramaOptions; +}; + +declare const EVENTS: { + SHOW_GALLERY: 'show-gallery', + HIDE_GALLERY: 'hide-gallery', +}; + +/** + * @summary Adds a compass on the viewer + */ +declare class CompassPlugin extends AbstractPlugin { + + static EVENTS: typeof EVENTS; + + constructor(psv: Viewer, options: GalleryPluginOptions); + + /** + * @summary Hides the gallery + */ + hide(); + + /** + * @summary Shows the gallery + */ + show(); + + /** + * @summary Hides or shows the gallery + */ + toggle(); + + /** + * @summary Sets the list of items + */ + setItems(items?: GalleryPluginItem[]); + + /** + * @summary Triggered when the gallery is shown + */ + on(e: 'show-gallery'): this; + + /** + * @summary Triggered when the gallery is hidden + */ + on(e: 'hide-gallery'): this; + +} + +export { CompassPlugin, EVENTS, GalleryPluginItem, GalleryPluginOptions }; diff --git a/dist/plugins/gallery.js b/dist/plugins/gallery.js new file mode 100644 index 000000000..8f49fa6c0 --- /dev/null +++ b/dist/plugins/gallery.js @@ -0,0 +1,632 @@ +/*! +* Photo Sphere Viewer 4.7.0 +* @copyright 2014-2015 Jérémy Heleine +* @copyright 2015-2022 Damien "Mistic" Sorel +* @licence MIT (https://opensource.org/licenses/MIT) +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('photo-sphere-viewer')) : + typeof define === 'function' && define.amd ? define(['exports', 'photo-sphere-viewer'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.PhotoSphereViewer = global.PhotoSphereViewer || {}, global.PhotoSphereViewer.GalleryPlugin = {}), global.PhotoSphereViewer)); +})(this, (function (exports, photoSphereViewer) { 'use strict'; + + function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + return _extends.apply(this, arguments); + } + + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + + _setPrototypeOf(subClass, superClass); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + /** + * @summary Available events + * @enum {string} + * @memberof PSV.plugins.GalleryPlugin + * @constant + */ + + var EVENTS = { + /** + * @event show-gallery + * @memberof PSV.plugins.GalleryPlugin + * @summary Triggered when the gallery is shown + */ + SHOW_GALLERY: 'show-gallery', + + /** + * @event hide-gallery + * @memberof PSV.plugins.GalleryPlugin + * @summary Triggered when the gallery is hidden + */ + HIDE_GALLERY: 'hide-gallery' + }; + var GALLERY_ITEM_DATA = 'psvGalleryItem'; + var GALLERY_ITEM_DATA_KEY = photoSphereViewer.utils.dasherize(GALLERY_ITEM_DATA); + var ITEMS_TEMPLATE = function ITEMS_TEMPLATE(items, dataKey) { + return "\n\n"; + }; + + var gallery = "\n"; + + /** + * @summary Navigation bar gallery button class + * @extends PSV.buttons.AbstractButton + * @memberof PSV.buttons + */ + + var GalleryButton = /*#__PURE__*/function (_AbstractButton) { + _inheritsLoose(GalleryButton, _AbstractButton); + + /** + * @param {PSV.components.Navbar} navbar + */ + function GalleryButton(navbar) { + var _this; + + _this = _AbstractButton.call(this, navbar, 'psv-button--hover-scale psv-gallery-button', true) || this; + /** + * @type {PSV.plugins.GalleryPlugin} + * @readonly + * @private + */ + + _this.plugin = _this.psv.getPlugin('gallery'); + + if (_this.plugin) { + _this.plugin.on(EVENTS.SHOW_GALLERY, _assertThisInitialized(_this)); + + _this.plugin.on(EVENTS.HIDE_GALLERY, _assertThisInitialized(_this)); + } + + return _this; + } + /** + * @override + */ + + + var _proto = GalleryButton.prototype; + + _proto.destroy = function destroy() { + if (this.plugin) { + this.plugin.off(EVENTS.SHOW_GALLERY, this); + this.plugin.off(EVENTS.HIDE_GALLERY, this); + } + + delete this.plugin; + + _AbstractButton.prototype.destroy.call(this); + } + /** + * @summary Handles events + * @param {Event} e + * @private + */ + ; + + _proto.handleEvent = function handleEvent(e) { + if (e.type === EVENTS.SHOW_GALLERY) { + this.toggleActive(true); + } else if (e.type === EVENTS.HIDE_GALLERY) { + this.toggleActive(false); + } + } + /** + * @override + */ + ; + + _proto.isSupported = function isSupported() { + return !!this.plugin; + } + /** + * @override + * @description Toggles gallery + */ + ; + + _proto.onClick = function onClick() { + this.plugin.toggle(); + }; + + return GalleryButton; + }(photoSphereViewer.AbstractButton); + GalleryButton.id = 'gallery'; + GalleryButton.icon = gallery; + + var blankIcon = "\n \n \n \n \n \n \n \n \n \n \n\n"; + + var ACTIVE_CLASS = 'psv-gallery-item--active'; + /** + * @private + */ + + var GalleryComponent = /*#__PURE__*/function (_AbstractComponent) { + _inheritsLoose(GalleryComponent, _AbstractComponent); + + function GalleryComponent(plugin) { + var _this; + + _this = _AbstractComponent.call(this, plugin.psv, 'psv-gallery psv--capture-event') || this; + /** + * @type {SVGElement} + * @private + * @readonly + */ + + _this.blankIcon = function () { + var temp = document.createElement('div'); + temp.innerHTML = blankIcon; + return temp.firstChild; + }(); + + _this.blankIcon.style.display = 'none'; + + _this.psv.container.appendChild(_this.blankIcon); + + if ('IntersectionObserver' in window) { + /** + * @type {IntersectionObserver} + * @private + * @readonly + */ + _this.observer = new IntersectionObserver(function (entries) { + entries.forEach(function (entry) { + if (entry.intersectionRatio > 0) { + entry.target.style.backgroundImage = "url(" + entry.target.dataset.src + ")"; + delete entry.target.dataset.src; + + _this.observer.unobserve(entry.target); + } + }); + }, { + root: _this.psv.container + }); + } + /** + * @type {PSV.plugins.GalleryPlugin} + * @private + * @readonly + */ + + + _this.plugin = plugin; + /** + * @type {Object} + * @private + */ + + _this.prop = _extends({}, _this.prop, { + mousedown: false, + initMouseX: null, + mouseX: null + }); + + _this.container.addEventListener(photoSphereViewer.SYSTEM.mouseWheelEvent, _assertThisInitialized(_this)); + + _this.container.addEventListener('mousedown', _assertThisInitialized(_this)); + + _this.container.addEventListener('mousemove', _assertThisInitialized(_this)); + + _this.container.addEventListener('click', _assertThisInitialized(_this)); + + window.addEventListener('mouseup', _assertThisInitialized(_this)); + + _this.hide(); + + return _this; + } + /** + * @override + */ + + + var _proto = GalleryComponent.prototype; + + _proto.destroy = function destroy() { + var _this$observer; + + this.psv.container.removeChild(this.blankIcon); + window.removeEventListener('mouseup', this); + (_this$observer = this.observer) == null ? void 0 : _this$observer.disconnect(); + delete this.plugin; + delete this.blankIcon; + delete this.observer; + + _AbstractComponent.prototype.destroy.call(this); + } + /** + * @private + */ + ; + + _proto.handleEvent = function handleEvent(e) { + /* eslint-disable */ + switch (e.type) { + case photoSphereViewer.SYSTEM.mouseWheelEvent: + var spinY = photoSphereViewer.utils.normalizeWheel(e).spinY; + this.container.scrollLeft += spinY * 50; + e.preventDefault(); + break; + + case 'mousedown': + this.prop.mousedown = true; + this.prop.initMouseX = e.clientX; + this.prop.mouseX = e.clientX; + break; + + case 'mousemove': + if (this.prop.mousedown) { + var delta = this.prop.mouseX - e.clientX; + this.container.scrollLeft += delta; + this.prop.mouseX = e.clientX; + } + + break; + + case 'mouseup': + this.prop.mousedown = false; + this.prop.mouseX = null; + e.preventDefault(); + break; + + case 'click': + // prevent click on drag + if (Math.abs(this.prop.initMouseX - e.clientX) < 10) { + var item = photoSphereViewer.utils.getClosest(e.target, "[data-" + GALLERY_ITEM_DATA_KEY + "]"); + + if (item) { + this.plugin.__click(item.dataset[GALLERY_ITEM_DATA]); + } + } + + break; + } + /* eslint-enable */ + + } + /** + * @override + */ + ; + + _proto.show = function show() { + this.container.classList.add('psv-gallery--open'); + this.prop.visible = true; + } + /** + * @override + */ + ; + + _proto.hide = function hide() { + this.container.classList.remove('psv-gallery--open'); + this.prop.visible = false; + } + /** + * @summary Sets the list of items + * @param {PSV.plugins.GalleryPlugin.Item[]} items + */ + ; + + _proto.setItems = function setItems(items) { + this.container.innerHTML = ITEMS_TEMPLATE(items, GALLERY_ITEM_DATA_KEY); + + if (this.observer) { + this.observer.disconnect(); + + for (var _iterator = _createForOfIteratorHelperLoose(this.container.querySelectorAll('[data-src]')), _step; !(_step = _iterator()).done;) { + var child = _step.value; + this.observer.observe(child); + } + } + } + /** + * @param {number | string} id + */ + ; + + _proto.setActive = function setActive(id) { + var currentActive = this.container.querySelector('.' + ACTIVE_CLASS); + currentActive == null ? void 0 : currentActive.classList.remove(ACTIVE_CLASS); + + if (id) { + var nextActive = this.container.querySelector("[data-" + GALLERY_ITEM_DATA_KEY + "=\"" + id + "\"]"); + nextActive == null ? void 0 : nextActive.classList.add(ACTIVE_CLASS); + } + }; + + return GalleryComponent; + }(photoSphereViewer.AbstractComponent); + + /** + * @typedef {Object} PSV.plugins.GalleryPlugin.Item + * @property {number|string} id - Unique identifier of the item + * @property {*} panorama + * @property {string} [thumbnail] - URL of the thumbnail + * @property {string} [name] - Text visible over the thumbnail + * @property {PSV.PanoramaOptions} [options] - Any option supported by the `setPanorama()` method + */ + + /** + * @typedef {Object} PSV.plugins.GalleryPlugin.Options + * @property {PSV.plugins.GalleryPlugin.Item[]} [items] + * @property {boolean} [visibleOnLoad=false] - Displays the gallery when loading the first panorama + */ + // add gallery button + + photoSphereViewer.DEFAULTS.lang[GalleryButton.id] = 'Gallery'; + photoSphereViewer.registerButton(GalleryButton, 'caption:left'); + /** + * @summary Adds a gallery of multiple panoramas + * @extends PSV.plugins.AbstractPlugin + * @memberof PSV.plugins + */ + + var GalleryPlugin = /*#__PURE__*/function (_AbstractPlugin) { + _inheritsLoose(GalleryPlugin, _AbstractPlugin); + + /** + * @param {PSV.Viewer} psv + * @param {PSV.plugins.GalleryPlugin.Options} options + */ + function GalleryPlugin(psv, options) { + var _this; + + _this = _AbstractPlugin.call(this, psv) || this; + /** + * @member {PSV.plugins.GalleryPlugin.Options} + * @private + */ + + _this.config = _extends({ + items: null, + visibleOnLoad: false + }, options); + /** + * @type {Object} + * @private + */ + + _this.prop = { + handler: null, + currentId: null + }; + /** + * @type {GalleryComponent} + * @private + * @readonly + */ + + _this.gallery = new GalleryComponent(_assertThisInitialized(_this)); + /** + * @type {PSV.plugins.GalleryPlugin.Item[]} + * @private + */ + + _this.items = []; + return _this; + } + /** + * @package + */ + + + var _proto = GalleryPlugin.prototype; + + _proto.init = function init() { + var _this2 = this; + + _AbstractPlugin.prototype.init.call(this); + + this.psv.on(photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED, this); + + if (this.config.visibleOnLoad) { + this.psv.once(photoSphereViewer.CONSTANTS.EVENTS.READY, function () { + _this2.show(); + }); + } + + this.setItems(this.config.items); + delete this.config.items; + } + /** + * @package + */ + ; + + _proto.destroy = function destroy() { + this.psv.off(photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED, this); + this.gallery.destroy(); + + _AbstractPlugin.prototype.destroy.call(this); + } + /** + * @private + */ + ; + + _proto.handleEvent = function handleEvent(e) { + /* eslint-disable */ + switch (e.type) { + case photoSphereViewer.CONSTANTS.EVENTS.PANORAMA_LOADED: + var item = this.items.find(function (i) { + return photoSphereViewer.utils.deepEqual(i.panorama, e.args[0].panorama); + }); + this.prop.currentId = item == null ? void 0 : item.id; + this.gallery.setActive(item == null ? void 0 : item.id); + break; + } + /* eslint-enable */ + + } + /** + * @summary Shows the gallery + * @fires PSV.plugins.GalleryPlugin.show-gallery + */ + ; + + _proto.show = function show() { + this.trigger(EVENTS.SHOW_GALLERY); + return this.gallery.show(); + } + /** + * @summary Hides the carousem + * @fires PSV.plugins.GalleryPlugin.hide-gallery + */ + ; + + _proto.hide = function hide() { + this.trigger(EVENTS.HIDE_GALLERY); + return this.gallery.hide(); + } + /** + * @summary Hides or shows the gallery + */ + ; + + _proto.toggle = function toggle() { + return this.gallery.toggle(); + } + /** + * @summary Sets the list of items + * @param {PSV.plugins.GalleryPlugin.Item[]} items + * @param {function} [handler] function that will be called when an item is clicked instead of the default behavior + */ + ; + + _proto.setItems = function setItems(items, handler) { + var _items; + + if (!((_items = items) != null && _items.length)) { + items = []; + } else { + items.forEach(function (item, i) { + if (!item.id) { + throw new photoSphereViewer.PSVError("Item " + i + " has no \"id\"."); + } + + if (!item.panorama) { + throw new photoSphereViewer.PSVError("Item " + item.id + " has no \"panorama\"."); + } + }); + } + + this.prop.handler = handler; + this.items = items.map(function (item) { + return _extends({}, item, { + id: "" + item.id + }); + }); + this.gallery.setItems(items); + } + /** + * @param {string} id + * @package + */ + ; + + _proto.__click = function __click(id) { + if (id === this.prop.currentId) { + return; + } + + if (this.prop.handler) { + this.prop.handler(id); + } else { + var item = this.items.find(function (i) { + return i.id === id; + }); + this.psv.setPanorama(item.panorama, _extends({ + caption: item.name + }, item.options)); + } + + this.prop.currentId = id; + this.gallery.setActive(id); + }; + + return GalleryPlugin; + }(photoSphereViewer.AbstractPlugin); + GalleryPlugin.id = 'gallery'; + GalleryPlugin.EVENTS = EVENTS; + + exports.EVENTS = EVENTS; + exports.GalleryPlugin = GalleryPlugin; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=gallery.js.map diff --git a/dist/plugins/gallery.js.map b/dist/plugins/gallery.js.map new file mode 100644 index 000000000..0ed62c98e --- /dev/null +++ b/dist/plugins/gallery.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gallery.js","sources":["../../src/plugins/gallery/constants.js","../../src/plugins/gallery/GalleryButton.js","../../src/plugins/gallery/GalleryComponent.js","../../src/plugins/gallery/index.js"],"sourcesContent":["import { utils } from '../..';\n\n/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.GalleryPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event show-gallery\n * @memberof PSV.plugins.GalleryPlugin\n * @summary Triggered when the gallery is shown\n */\n SHOW_GALLERY: 'show-gallery',\n /**\n * @event hide-gallery\n * @memberof PSV.plugins.GalleryPlugin\n * @summary Triggered when the gallery is hidden\n */\n HIDE_GALLERY: 'hide-gallery',\n};\n\nexport const GALLERY_ITEM_DATA = 'psvGalleryItem';\nexport const GALLERY_ITEM_DATA_KEY = utils.dasherize(GALLERY_ITEM_DATA);\n\nexport const ITEMS_TEMPLATE = (items, dataKey) => `\n\n`;\n","import { AbstractButton } from '../..';\nimport { EVENTS } from './constants';\nimport gallery from './gallery.svg';\n\n/**\n * @summary Navigation bar gallery button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class GalleryButton extends AbstractButton {\n\n static id = 'gallery';\n static icon = gallery;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-gallery-button', true);\n\n /**\n * @type {PSV.plugins.GalleryPlugin}\n * @readonly\n * @private\n */\n this.plugin = this.psv.getPlugin('gallery');\n\n if (this.plugin) {\n this.plugin.on(EVENTS.SHOW_GALLERY, this);\n this.plugin.on(EVENTS.HIDE_GALLERY, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(EVENTS.SHOW_GALLERY, this);\n this.plugin.off(EVENTS.HIDE_GALLERY, this);\n }\n\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === EVENTS.SHOW_GALLERY) {\n this.toggleActive(true);\n }\n else if (e.type === EVENTS.HIDE_GALLERY) {\n this.toggleActive(false);\n }\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @override\n * @description Toggles gallery\n */\n onClick() {\n this.plugin.toggle();\n }\n\n}\n","import { AbstractComponent, SYSTEM, utils } from '../..';\nimport blankIcon from './blank.svg';\nimport { GALLERY_ITEM_DATA, GALLERY_ITEM_DATA_KEY, ITEMS_TEMPLATE } from './constants';\n\nconst ACTIVE_CLASS = 'psv-gallery-item--active';\n\n/**\n * @private\n */\nexport class GalleryComponent extends AbstractComponent {\n\n constructor(plugin) {\n super(plugin.psv, 'psv-gallery psv--capture-event');\n\n /**\n * @type {SVGElement}\n * @private\n * @readonly\n */\n this.blankIcon = (() => {\n const temp = document.createElement('div');\n temp.innerHTML = blankIcon;\n return temp.firstChild;\n })();\n this.blankIcon.style.display = 'none';\n this.psv.container.appendChild(this.blankIcon);\n\n if ('IntersectionObserver' in window) {\n /**\n * @type {IntersectionObserver}\n * @private\n * @readonly\n */\n this.observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry.intersectionRatio > 0) {\n entry.target.style.backgroundImage = `url(${entry.target.dataset.src})`;\n delete entry.target.dataset.src;\n this.observer.unobserve(entry.target);\n }\n });\n }, {\n root: this.psv.container,\n });\n }\n\n /**\n * @type {PSV.plugins.GalleryPlugin}\n * @private\n * @readonly\n */\n this.plugin = plugin;\n\n /**\n * @type {Object}\n * @private\n */\n this.prop = {\n ...this.prop,\n mousedown : false,\n initMouseX: null,\n mouseX : null,\n };\n\n this.container.addEventListener(SYSTEM.mouseWheelEvent, this);\n this.container.addEventListener('mousedown', this);\n this.container.addEventListener('mousemove', this);\n this.container.addEventListener('click', this);\n window.addEventListener('mouseup', this);\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.container.removeChild(this.blankIcon);\n\n window.removeEventListener('mouseup', this);\n\n this.observer?.disconnect();\n\n delete this.plugin;\n delete this.blankIcon;\n delete this.observer;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case SYSTEM.mouseWheelEvent:\n const spinY = utils.normalizeWheel(e).spinY;\n this.container.scrollLeft += spinY * 50;\n e.preventDefault();\n break;\n\n case 'mousedown':\n this.prop.mousedown = true;\n this.prop.initMouseX = e.clientX;\n this.prop.mouseX = e.clientX;\n break;\n\n case 'mousemove':\n if (this.prop.mousedown) {\n const delta = this.prop.mouseX - e.clientX;\n this.container.scrollLeft += delta;\n this.prop.mouseX = e.clientX;\n }\n break;\n\n case 'mouseup':\n this.prop.mousedown = false;\n this.prop.mouseX = null;\n e.preventDefault();\n break;\n\n case 'click':\n // prevent click on drag\n if (Math.abs(this.prop.initMouseX - e.clientX) < 10) {\n const item = utils.getClosest(e.target, `[data-${GALLERY_ITEM_DATA_KEY}]`);\n if (item) {\n this.plugin.__click(item.dataset[GALLERY_ITEM_DATA]);\n }\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n show() {\n this.container.classList.add('psv-gallery--open');\n this.prop.visible = true;\n }\n\n /**\n * @override\n */\n hide() {\n this.container.classList.remove('psv-gallery--open');\n this.prop.visible = false;\n }\n\n /**\n * @summary Sets the list of items\n * @param {PSV.plugins.GalleryPlugin.Item[]} items\n */\n setItems(items) {\n this.container.innerHTML = ITEMS_TEMPLATE(items, GALLERY_ITEM_DATA_KEY);\n\n if (this.observer) {\n this.observer.disconnect();\n\n for (const child of this.container.querySelectorAll('[data-src]')) {\n this.observer.observe(child);\n }\n }\n }\n\n /**\n * @param {number | string} id\n */\n setActive(id) {\n const currentActive = this.container.querySelector('.' + ACTIVE_CLASS);\n currentActive?.classList.remove(ACTIVE_CLASS);\n\n if (id) {\n const nextActive = this.container.querySelector(`[data-${GALLERY_ITEM_DATA_KEY}=\"${id}\"]`);\n nextActive?.classList.add(ACTIVE_CLASS);\n }\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..';\nimport { EVENTS } from './constants';\nimport { GalleryButton } from './GalleryButton';\nimport { GalleryComponent } from './GalleryComponent';\nimport './style.scss';\n\n/**\n * @typedef {Object} PSV.plugins.GalleryPlugin.Item\n * @property {number|string} id - Unique identifier of the item\n * @property {*} panorama\n * @property {string} [thumbnail] - URL of the thumbnail\n * @property {string} [name] - Text visible over the thumbnail\n * @property {PSV.PanoramaOptions} [options] - Any option supported by the `setPanorama()` method\n */\n\n/**\n * @typedef {Object} PSV.plugins.GalleryPlugin.Options\n * @property {PSV.plugins.GalleryPlugin.Item[]} [items]\n * @property {boolean} [visibleOnLoad=false] - Displays the gallery when loading the first panorama\n */\n\n\n// add gallery button\nDEFAULTS.lang[GalleryButton.id] = 'Gallery';\nregisterButton(GalleryButton, 'caption:left');\n\n\nexport { EVENTS } from './constants';\n\n\n/**\n * @summary Adds a gallery of multiple panoramas\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class GalleryPlugin extends AbstractPlugin {\n\n static id = 'gallery';\n\n static EVENTS = EVENTS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.GalleryPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.plugins.GalleryPlugin.Options}\n * @private\n */\n this.config = {\n items : null,\n visibleOnLoad: false,\n ...options,\n };\n\n /**\n * @type {Object}\n * @private\n */\n this.prop = {\n handler : null,\n currentId: null,\n };\n\n /**\n * @type {GalleryComponent}\n * @private\n * @readonly\n */\n this.gallery = new GalleryComponent(this);\n\n /**\n * @type {PSV.plugins.GalleryPlugin.Item[]}\n * @private\n */\n this.items = [];\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n if (this.config.visibleOnLoad) {\n this.psv.once(CONSTANTS.EVENTS.READY, () => {\n this.show();\n });\n }\n\n this.setItems(this.config.items);\n delete this.config.items;\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n this.gallery.destroy();\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case CONSTANTS.EVENTS.PANORAMA_LOADED:\n const item = this.items.find(i => utils.deepEqual(i.panorama, e.args[0].panorama));\n this.prop.currentId = item?.id;\n this.gallery.setActive(item?.id);\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @summary Shows the gallery\n * @fires PSV.plugins.GalleryPlugin.show-gallery\n */\n show() {\n this.trigger(EVENTS.SHOW_GALLERY);\n return this.gallery.show();\n }\n\n /**\n * @summary Hides the carousem\n * @fires PSV.plugins.GalleryPlugin.hide-gallery\n */\n hide() {\n this.trigger(EVENTS.HIDE_GALLERY);\n return this.gallery.hide();\n }\n\n /**\n * @summary Hides or shows the gallery\n */\n toggle() {\n return this.gallery.toggle();\n }\n\n /**\n * @summary Sets the list of items\n * @param {PSV.plugins.GalleryPlugin.Item[]} items\n * @param {function} [handler] function that will be called when an item is clicked instead of the default behavior\n */\n setItems(items, handler) {\n if (!items?.length) {\n items = [];\n }\n else {\n items.forEach((item, i) => {\n if (!item.id) {\n throw new PSVError(`Item ${i} has no \"id\".`);\n }\n if (!item.panorama) {\n throw new PSVError(`Item ${item.id} has no \"panorama\".`);\n }\n });\n }\n\n this.prop.handler = handler;\n this.items = items.map(item => ({\n ...item,\n id: `${item.id}`,\n }));\n\n this.gallery.setItems(items);\n }\n\n /**\n * @param {string} id\n * @package\n */\n __click(id) {\n if (id === this.prop.currentId) {\n return;\n }\n\n if (this.prop.handler) {\n this.prop.handler(id);\n }\n else {\n const item = this.items.find(i => i.id === id);\n this.psv.setPanorama(item.panorama, {\n caption: item.name,\n ...item.options,\n });\n }\n\n this.prop.currentId = id;\n this.gallery.setActive(id);\n }\n\n}\n"],"names":["EVENTS","SHOW_GALLERY","HIDE_GALLERY","GALLERY_ITEM_DATA","GALLERY_ITEM_DATA_KEY","utils","dasherize","ITEMS_TEMPLATE","items","dataKey","map","item","id","name","thumbnail","join","GalleryButton","navbar","plugin","psv","getPlugin","on","destroy","off","handleEvent","e","type","toggleActive","isSupported","onClick","toggle","AbstractButton","icon","gallery","ACTIVE_CLASS","GalleryComponent","blankIcon","temp","document","createElement","innerHTML","firstChild","style","display","container","appendChild","window","observer","IntersectionObserver","entries","forEach","entry","intersectionRatio","target","backgroundImage","dataset","src","unobserve","root","prop","mousedown","initMouseX","mouseX","addEventListener","SYSTEM","mouseWheelEvent","hide","removeChild","removeEventListener","disconnect","spinY","normalizeWheel","scrollLeft","preventDefault","clientX","delta","Math","abs","getClosest","__click","show","classList","add","visible","remove","setItems","querySelectorAll","child","observe","setActive","currentActive","querySelector","nextActive","AbstractComponent","DEFAULTS","lang","registerButton","GalleryPlugin","options","config","visibleOnLoad","handler","currentId","init","CONSTANTS","PANORAMA_LOADED","once","READY","find","i","deepEqual","panorama","args","trigger","length","PSVError","setPanorama","caption","A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;EAAA,OAAjB,CAAb,CAAA;EACA,MAAA,IAAA,CAAKO,GAAL,CAASiG,WAAT,CAAqBzG,IAAI,CAACoG,QAA1B,EAAA,QAAA,CAAA;UACEM,OAAO,EAAE1G,IAAI,CAACE,IAAAA;SACXF,EAAAA,IAAI,CAACuF,OAFV,CAAA,CAAA,CAAA;EAID,KAAA;;EAED,IAAA,IAAA,CAAKvC,IAAL,CAAU2C,SAAV,GAAsB1F,EAAtB,CAAA;EACA,IAAA,IAAA,CAAKqB,OAAL,CAAawD,SAAb,CAAuB7E,EAAvB,CAAA,CAAA;KArKJ,CAAA;;EAAA,EAAA,OAAA,aAAA,CAAA;EAAA,CAAA,CAAmC0G,gCAAnC,EAAA;EAAarB,cAEJrF,KAAK;EAFDqF,cAIJjG,SAASA;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/gyroscope.js b/dist/plugins/gyroscope.js index 3e7772aa9..7b75735cc 100644 --- a/dist/plugins/gyroscope.js +++ b/dist/plugins/gyroscope.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/markers.css b/dist/plugins/markers.css index 2f159d811..77528c465 100644 --- a/dist/plugins/markers.css +++ b/dist/plugins/markers.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.6.5 + * Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/markers.d.ts b/dist/plugins/markers.d.ts index 4cbea0591..1103a6a11 100644 --- a/dist/plugins/markers.d.ts +++ b/dist/plugins/markers.d.ts @@ -43,7 +43,7 @@ type MarkerProperties = Partial & { svgStyle?: Record; anchor?: string; visible?: boolean; - tooltip?: string | { content: string, position?: string }; + tooltip?: string | { content: string, position?: string, className?: string, trigger?: 'hover' | 'click' }; content?: string; hideList?: boolean; data?: any; @@ -118,6 +118,7 @@ declare class Marker { } declare const EVENTS: { + MARKER_VISIBILITY : 'marker-visibility', GOTO_MARKER_DONE: 'goto-marker-done', LEAVE_MARKER: 'leave-marker', OVER_MARKER: 'over-marker', @@ -228,6 +229,16 @@ declare class MarkersPlugin extends AbstractPlugin { */ toggleMarker(markerId: string); + /** + * @summary Forces the display of the tooltip + */ + showMarkerTooltip(markerId: string); + + /** + * @summary Hides the tooltip + */ + hideMarkerTooltip(markerId: string); + /** * @summary Opens the panel with the content of the marker */ @@ -253,6 +264,11 @@ declare class MarkersPlugin extends AbstractPlugin { */ renderMarkers(); + /** + * @summary Triggered when the visibility of a marker changes + */ + on(e: 'marker-visibility', cb: (e: Event, marker: Marker, visible: boolean) => void): this; + /** * @summary Triggered when the animation to a marker is done */ diff --git a/dist/plugins/markers.js b/dist/plugins/markers.js index 81dbfc8a4..0e13c3aac 100644 --- a/dist/plugins/markers.js +++ b/dist/plugins/markers.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -60,6 +60,15 @@ */ var EVENTS = { + /** + * @event marker-visibility + * @memberof PSV.plugins.MarkersPlugin + * @summary Triggered when the visibility of a marker changes + * @param {PSV.plugins.MarkersPlugin.Marker} marker + * @param {boolean} visible + */ + MARKER_VISIBILITY: 'marker-visibility', + /** * @event goto-marker-done * @memberof PSV.plugins.MarkersPlugin @@ -141,6 +150,18 @@ */ SHOW_MARKERS: 'show-markers' }; + /** + * @summary Types of tooltip events + * @memberOf PSV.plugins.MarkersPlugin + * @enum {string} + * @constant + * @private + */ + + var MARKER_TOOLTIP_TRIGGER = { + click: 'click', + hover: 'hover' + }; /** * @summary Namespace for SVG creation * @type {string} @@ -436,6 +457,8 @@ * @protected * @property {boolean} dynamicSize * @property {PSV.Point} anchor + * @property {boolean} visible - actually visible in the view + * @property {boolean} staticTooltip - the tooltip must always be shown * @property {PSV.Position} position - position in spherical coordinates * @property {PSV.Point} position2D - position in viewer coordinates * @property {external:THREE.Vector3[]} positions3D - positions in 3D space @@ -447,6 +470,8 @@ this.props = { dynamicSize: false, anchor: null, + visible: false, + staticTooltip: false, position: null, position2D: null, positions3D: null, @@ -622,11 +647,9 @@ ; _proto.getListContent = function getListContent() { - var _this$config$tooltip; - if (this.config.listContent) { return this.config.listContent; - } else if ((_this$config$tooltip = this.config.tooltip) != null && _this$config$tooltip.content) { + } else if (this.config.tooltip.content) { return this.config.tooltip.content; } else if (this.config.html) { return this.config.html; @@ -641,14 +664,10 @@ ; _proto.showTooltip = function showTooltip(mousePosition) { - var _this$config$tooltip2; - - if (this.visible && (_this$config$tooltip2 = this.config.tooltip) != null && _this$config$tooltip2.content && this.props.position2D) { - var config = { - content: this.config.tooltip.content, - position: this.config.tooltip.position, + if (this.props.visible && this.config.tooltip.content && this.props.position2D) { + var config = _extends({}, this.config.tooltip, { data: this - }; + }); if (this.isPoly()) { var viewerPos = photoSphereViewer.utils.getPosition(this.psv.container); @@ -681,6 +700,16 @@ } } } + /** + * @summary Recompute the position of the tooltip + */ + ; + + _proto.refreshTooltip = function refreshTooltip() { + if (this.tooltip) { + this.showTooltip(); + } + } /** * @summary Hides the tooltip of this marker */ @@ -714,6 +743,14 @@ }; } + if (!this.config.tooltip) { + this.config.tooltip = {}; + } + + if (!this.config.tooltip.trigger) { + this.config.tooltip.trigger = MARKER_TOOLTIP_TRIGGER.hover; + } + this.data = this.config.data; this.visible = this.config.visible !== false; @@ -1533,8 +1570,11 @@ ; _proto.toggleAllTooltips = function toggleAllTooltips() { - this.prop.showAllTooltips = !this.prop.showAllTooltips; - this.renderMarkers(); + if (this.prop.showAllTooltips) { + this.hideAllTooltips(); + } else { + this.showAllTooltips(); + } } /** * @summary Displays all tooltips @@ -1543,7 +1583,10 @@ _proto.showAllTooltips = function showAllTooltips() { this.prop.showAllTooltips = true; - this.renderMarkers(); + photoSphereViewer.utils.each(this.markers, function (marker) { + marker.props.staticTooltip = true; + marker.showTooltip(); + }); } /** * @summary Hides all tooltips @@ -1552,7 +1595,10 @@ _proto.hideAllTooltips = function hideAllTooltips() { this.prop.showAllTooltips = false; - this.renderMarkers(); + photoSphereViewer.utils.each(this.markers, function (marker) { + marker.props.staticTooltip = false; + marker.hideTooltip(); + }); } /** * @summary Returns the total number of markers @@ -1833,6 +1879,28 @@ _proto.showMarker = function showMarker(markerId) { this.toggleMarker(markerId, true); } + /** + * @summary Forces the display of the tooltip + * @param {string} markerId + */ + ; + + _proto.showMarkerTooltip = function showMarkerTooltip(markerId) { + var marker = this.getMarker(markerId); + marker.props.staticTooltip = true; + marker.showTooltip(); + } + /** + * @summary Hides the tooltip + * @param {string} markerId + */ + ; + + _proto.hideMarkerTooltip = function hideMarkerTooltip(markerId) { + var marker = this.getMarker(markerId); + marker.props.staticTooltip = false; + marker.hideTooltip(); + } /** * @summary Toggles a marker * @param {string} markerId @@ -1942,6 +2010,7 @@ var viewerPosition = this.psv.getPosition(); photoSphereViewer.utils.each(this.markers, function (marker) { var isVisible = _this8.prop.visible && marker.visible; + var visibilityChanged = false; var position = null; if (isVisible && marker.is3d()) { @@ -1982,17 +2051,27 @@ } } + visibilityChanged = marker.props.visible !== isVisible; + marker.props.visible = isVisible; marker.props.position2D = isVisible ? position : null; if (!marker.is3d()) { photoSphereViewer.utils.toggleClass(marker.$el, 'psv-marker--visible', isVisible); } - if (isVisible && (_this8.prop.showAllTooltips || marker === _this8.prop.hoveringMarker && !marker.isPoly())) { + if (!isVisible) { + marker.hideTooltip(); + } else if (marker.props.staticTooltip) { marker.showTooltip(); - } else if (!isVisible || marker !== _this8.prop.hoveringMarker) { + } else if (marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.click || marker === _this8.prop.hoveringMarker && !marker.isPoly()) { + marker.refreshTooltip(); + } else if (marker !== _this8.prop.hoveringMarker) { marker.hideTooltip(); } + + if (visibilityChanged) { + _this8.trigger(EVENTS.MARKER_VISIBILITY, marker, isVisible); + } }); } /** @@ -2179,7 +2258,7 @@ this.prop.hoveringMarker = marker; this.trigger(EVENTS.OVER_MARKER, marker); - if (!this.prop.showAllTooltips) { + if (!marker.props.staticTooltip && marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.hover) { marker.showTooltip(e); } } @@ -2199,7 +2278,7 @@ this.trigger(EVENTS.LEAVE_MARKER, marker); this.prop.hoveringMarker = null; - if (!this.prop.showAllTooltips) { + if (!marker.props.staticTooltip && marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.hover) { marker.hideTooltip(); } } @@ -2232,13 +2311,13 @@ this.prop.hoveringMarker = marker; } - if (!this.prop.showAllTooltips) { + if (!marker.props.staticTooltip) { marker.showTooltip(e); } } else if ((_this$prop$hoveringMa = this.prop.hoveringMarker) != null && _this$prop$hoveringMa.isPoly()) { this.trigger(EVENTS.LEAVE_MARKER, this.prop.hoveringMarker); - if (!this.prop.showAllTooltips) { + if (!this.prop.hoveringMarker.props.staticTooltip) { this.prop.hoveringMarker.hideTooltip(); } @@ -2267,6 +2346,17 @@ marker = this.__getTargetMarker(data.target, true); } + if (this.prop.currentMarker && this.prop.currentMarker !== marker) { + this.trigger(EVENTS.UNSELECT_MARKER, this.prop.currentMarker); + this.psv.panel.hide(ID_PANEL_MARKER); + + if (!this.prop.showAllTooltips && this.prop.currentMarker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.click) { + this.hideMarkerTooltip(this.prop.currentMarker); + } + + this.prop.currentMarker = null; + } + if (marker) { this.prop.currentMarker = marker; this.trigger(EVENTS.SELECT_MARKER, marker, { @@ -2283,12 +2373,16 @@ if (this.markers[marker.id]) { - this.showMarkerPanel(marker.id); + if (marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.click) { + if (marker.tooltip) { + this.hideMarkerTooltip(marker); + } else { + this.showMarkerTooltip(marker); + } + } else { + this.showMarkerPanel(marker.id); + } } - } else if (this.prop.currentMarker) { - this.trigger(EVENTS.UNSELECT_MARKER, this.prop.currentMarker); - this.psv.panel.hide(ID_PANEL_MARKER); - this.prop.currentMarker = null; } } /** diff --git a/dist/plugins/markers.js.map b/dist/plugins/markers.js.map index 7b1e16257..2fe7a5ee3 100644 --- a/dist/plugins/markers.js.map +++ b/dist/plugins/markers.js.map @@ -1 +1 @@ -{"version":3,"file":"markers.js","sources":["../../src/plugins/markers/constants.js","../../src/utils/math.js","../../src/PSVError.js","../../src/utils/psv.js","../../src/plugins/markers/utils.js","../../src/plugins/markers/Marker.js","../../src/plugins/markers/MarkersButton.js","../../src/plugins/markers/MarkersListButton.js","../../src/plugins/markers/index.js"],"sourcesContent":["import icon from './pin-list.svg';\n\n/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.MarkersPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event goto-marker-done\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the animation to a marker is done\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n GOTO_MARKER_DONE : 'goto-marker-done',\n /**\n * @event leave-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor away from a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n LEAVE_MARKER : 'leave-marker',\n /**\n * @event over-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor hover a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n OVER_MARKER : 'over-marker',\n /**\n * @event filter:render-markers-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Used to alter the list of markers displayed on the side-panel\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @returns {PSV.plugins.MarkersPlugin.Marker[]}\n */\n RENDER_MARKERS_LIST: 'render-markers-list',\n /**\n * @event select-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user clicks on a marker. The marker can be retrieved from outside the event handler\n * with {@link PSV.plugins.MarkersPlugin.getCurrentMarker}\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.plugins.MarkersPlugin.SelectMarkerData} data\n */\n SELECT_MARKER : 'select-marker',\n /**\n * @event select-marker-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker is selected from the side panel\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n SELECT_MARKER_LIST : 'select-marker-list',\n /**\n * @event unselect-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker was selected and the user clicks elsewhere\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n UNSELECT_MARKER : 'unselect-marker',\n /**\n * @event hide-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are hidden\n */\n HIDE_MARKERS : 'hide-markers',\n /**\n * @event set-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the list of markers changes\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n */\n SET_MARKERS : 'set-markers',\n /**\n * @event show-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are shown\n */\n SHOW_MARKERS : 'show-markers',\n};\n\n/**\n * @summary Namespace for SVG creation\n * @type {string}\n * @constant\n * @private\n */\nexport const SVG_NS = 'http://www.w3.org/2000/svg';\n\n/**\n * @summary Property name added to marker elements\n * @type {string}\n * @constant\n * @private\n */\nexport const MARKER_DATA = 'psvMarker';\n\n/**\n * @summary Panel identifier for marker content\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL_MARKER = 'marker';\n\n/**\n * @summary Panel identifier for markers list\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL_MARKERS_LIST = 'markersList';\n\n/**\n * @summary Markers list template\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @param {string} title\n * @param {string} dataKey\n * @returns {string}\n * @constant\n * @private\n */\nexport const MARKERS_LIST_TEMPLATE = (markers, title, dataKey) => `\n
\n

${icon} ${title}

\n
    \n ${markers.map(marker => `\n
  • \n ${marker.type === 'image' ? `` : ''}\n ${marker.getListContent()}\n
  • \n `).join('')}\n
\n
\n`;\n","/**\n * @summary Ensures that a number is in a given interval\n * @memberOf PSV.utils\n * @param {number} x\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport function bound(x, min, max) {\n return Math.max(min, Math.min(max, x));\n}\n\n/**\n * @summary Ensure a value is within 0 and `max`\n * @param {number} value\n * @param {number} max\n * @return {number}\n */\nexport function loop(value, max) {\n let result = value % max;\n\n if (result < 0) {\n result += max;\n }\n\n return result;\n}\n\n/**\n * @summary Checks if a value is an integer\n * @memberOf PSV.utils\n * @param {*} value\n * @returns {boolean}\n */\nexport function isInteger(value) {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value;\n}\n\n/**\n * @summary Tests if a number is power of two\n * @memberOf PSV.utils\n * @param {number} x\n * @return {boolean}\n */\nexport function isPowerOfTwo(x) {\n return (Math.log(x) / Math.log(2)) % 1 === 0;\n}\n\n/**\n * @summary Computes the sum of an array\n * @memberOf PSV.utils\n * @param {number[]} array\n * @returns {number}\n */\nexport function sum(array) {\n return array.reduce((a, b) => a + b, 0);\n}\n\n/**\n * @summary Computes the distance between two points\n * @memberOf PSV.utils\n * @param {PSV.Point} p1\n * @param {PSV.Point} p2\n * @returns {number}\n */\nexport function distance(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\n\n/**\n * @summary Compute the shortest offset between two longitudes\n * @memberOf PSV.utils\n * @param {number} from\n * @param {number} to\n * @returns {number}\n */\nexport function getShortestArc(from, to) {\n const tCandidates = [\n 0, // direct\n Math.PI * 2, // clock-wise cross zero\n -Math.PI * 2, // counter-clock-wise cross zero\n ];\n\n return tCandidates.reduce((value, candidate) => {\n const newCandidate = to - from + candidate;\n return Math.abs(newCandidate) < Math.abs(value) ? newCandidate : value;\n }, Infinity);\n}\n\n/**\n * @summary Computes the angle between the current position and a target position\n * @memberOf PSV.utils\n * @param {PSV.Position} position1\n * @param {PSV.Position} position2\n * @returns {number}\n */\nexport function getAngle(position1, position2) {\n return Math.acos(\n Math.cos(position1.latitude)\n * Math.cos(position2.latitude)\n * Math.cos(position1.longitude - position2.longitude)\n + Math.sin(position1.latitude)\n * Math.sin(position2.latitude)\n );\n}\n\n/**\n * @summary Returns the distance between two points on a sphere of radius one\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @memberOf PSV.utils\n * @param {number[]} p1\n * @param {number[]} p2\n * @returns {number}\n */\nexport function greatArcDistance(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const x = (λ2 - λ1) * Math.cos((φ1 + φ2) / 2);\n const y = (φ2 - φ1);\n return Math.sqrt(x * x + y * y);\n}\n","/**\n * @summary Custom error used in the lib\n * @param {string} message\n * @constructor\n * @memberOf PSV\n */\nfunction PSVError(message) {\n this.message = message;\n\n // Use V8's native method if available, otherwise fallback\n if ('captureStackTrace' in Error) {\n Error.captureStackTrace(this, PSVError);\n }\n else {\n this.stack = (new Error()).stack;\n }\n}\n\nPSVError.prototype = Object.create(Error.prototype);\nPSVError.prototype.name = 'PSVError';\nPSVError.prototype.constructor = PSVError;\n\nexport { PSVError };\n","import * as THREE from 'three';\nimport { PSVError } from '../PSVError';\nimport { bound, loop } from './math';\n\n/**\n * @summary Returns the plugin constructor from the imported object\n * For retrocompatibility with previous default exports\n * @memberOf PSV.utils\n * @package\n */\nexport function pluginInterop(plugin, target) {\n if (plugin) {\n for (const [, p] of [['_', plugin], ...Object.entries(plugin)]) {\n if (p.prototype instanceof target) {\n return p;\n }\n }\n }\n return null;\n}\n\n/**\n * @summary Builds an Error with name 'AbortError'\n * @memberOf PSV.utils\n * @return {Error}\n */\nexport function getAbortError() {\n const error = new Error('Loading was aborted.');\n error.name = 'AbortError';\n return error;\n}\n\n/**\n * @summary Tests if an Error has name 'AbortError'\n * @memberOf PSV.utils\n * @param {Error} err\n * @return {boolean}\n */\nexport function isAbortError(err) {\n return err?.name === 'AbortError';\n}\n\n/**\n * @summary Displays a warning in the console\n * @memberOf PSV.utils\n * @param {string} message\n */\nexport function logWarn(message) {\n console.warn(`PhotoSphereViewer: ${message}`);\n}\n\n/**\n * @summary Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude\n * @memberOf PSV.utils\n * @param {object} object\n * @returns {boolean}\n */\nexport function isExtendedPosition(object) {\n return [['x', 'y'], ['longitude', 'latitude']].some(([key1, key2]) => {\n return object[key1] !== undefined && object[key2] !== undefined;\n });\n}\n\n/**\n * @summary Returns the value of a given attribute in the panorama metadata\n * @memberOf PSV.utils\n * @param {string} data\n * @param {string} attr\n * @returns (number)\n */\nexport function getXMPValue(data, attr) {\n // XMP data are stored in children\n let result = data.match('(.*)');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n // XMP data are stored in attributes\n result = data.match('GPano:' + attr + '=\"(.*?)\"');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n return null;\n}\n\n/**\n * @readonly\n * @private\n * @type {{top: string, left: string, bottom: string, center: string, right: string}}\n */\nconst CSS_POSITIONS = {\n top : '0%',\n bottom: '100%',\n left : '0%',\n right : '100%',\n center: '50%',\n};\n\n/**\n * @summary Translate CSS values like \"top center\" or \"10% 50%\" as top and left positions\n * @memberOf PSV.utils\n * @description The implementation is as close as possible to the \"background-position\" specification\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}\n * @param {string|PSV.Point} value\n * @returns {PSV.Point}\n */\nexport function parsePosition(value) {\n if (!value) {\n return { x: 0.5, y: 0.5 };\n }\n\n if (typeof value === 'object') {\n return value;\n }\n\n let tokens = value.toLocaleLowerCase().split(' ').slice(0, 2);\n\n if (tokens.length === 1) {\n if (CSS_POSITIONS[tokens[0]] !== undefined) {\n tokens = [tokens[0], 'center'];\n }\n else {\n tokens = [tokens[0], tokens[0]];\n }\n }\n\n const xFirst = tokens[1] !== 'left' && tokens[1] !== 'right' && tokens[0] !== 'top' && tokens[0] !== 'bottom';\n\n tokens = tokens.map(token => CSS_POSITIONS[token] || token);\n\n if (!xFirst) {\n tokens.reverse();\n }\n\n const parsed = tokens.join(' ').match(/^([0-9.]+)% ([0-9.]+)%$/);\n\n if (parsed) {\n return {\n x: parseFloat(parsed[1]) / 100,\n y: parseFloat(parsed[2]) / 100,\n };\n }\n else {\n return { x: 0.5, y: 0.5 };\n }\n}\n\n/**\n * @readonly\n * @private\n */\nconst LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' };\n/**\n * @readonly\n * @private\n */\nconst TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' };\n\n/**\n * @summary Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center\n * @memberOf PSV.utils\n * @param {string | string[]} value\n * @param {string} defaultValue\n * @param {boolean} [allowCenter=true]\n * @return {string[]}\n */\nexport function cleanPosition(value, defaultValue, allowCenter = true) {\n if (!value) {\n return defaultValue.split(' ');\n }\n\n if (typeof value === 'string') {\n const tempPos = parsePosition(value);\n\n if (!(tempPos.x in LEFT_MAP) || !(tempPos.y in TOP_MAP)) {\n throw new PSVError(`Unable to parse position \"${value}\"`);\n }\n\n value = [TOP_MAP[tempPos.y], LEFT_MAP[tempPos.x]];\n }\n\n if (!allowCenter && value[0] === 'center' && value[1] === 'center') {\n throw new PSVError('Unable to parse position \"center center\"');\n }\n\n return value;\n}\n\n/**\n * @summary Parses an speed\n * @memberOf PSV.utils\n * @param {string|number} speed - The speed, in radians/degrees/revolutions per second/minute\n * @returns {number} radians per second\n * @throws {PSV.PSVError} when the speed cannot be parsed\n */\nexport function parseSpeed(speed) {\n let parsed;\n\n if (typeof speed === 'string') {\n const speedStr = speed.toString().trim();\n\n // Speed extraction\n let speedValue = parseFloat(speedStr.replace(/^(-?[0-9]+(?:\\.[0-9]*)?).*$/, '$1'));\n const speedUnit = speedStr.replace(/^-?[0-9]+(?:\\.[0-9]*)?(.*)$/, '$1').trim();\n\n // \"per minute\" -> \"per second\"\n if (speedUnit.match(/(pm|per minute)$/)) {\n speedValue /= 60;\n }\n\n // Which unit?\n switch (speedUnit) {\n // Degrees per minute / second\n case 'dpm':\n case 'degrees per minute':\n case 'dps':\n case 'degrees per second':\n parsed = THREE.MathUtils.degToRad(speedValue);\n break;\n\n // Radians per minute / second\n case 'rdpm':\n case 'radians per minute':\n case 'rdps':\n case 'radians per second':\n parsed = speedValue;\n break;\n\n // Revolutions per minute / second\n case 'rpm':\n case 'revolutions per minute':\n case 'rps':\n case 'revolutions per second':\n parsed = speedValue * Math.PI * 2;\n break;\n\n // Unknown unit\n default:\n throw new PSVError('Unknown speed unit \"' + speedUnit + '\"');\n }\n }\n else {\n parsed = speed;\n }\n\n return parsed;\n}\n\n/**\n * @summary Parses an angle value in radians or degrees and returns a normalized value in radians\n * @memberOf PSV.utils\n * @param {string|number} angle - eg: 3.14, 3.14rad, 180deg\n * @param {boolean} [zeroCenter=false] - normalize between -Pi - Pi instead of 0 - 2*Pi\n * @param {boolean} [halfCircle=zeroCenter] - normalize between -Pi/2 - Pi/2 instead of -Pi - Pi\n * @returns {number}\n * @throws {PSV.PSVError} when the angle cannot be parsed\n */\nexport function parseAngle(angle, zeroCenter = false, halfCircle = zeroCenter) {\n let parsed;\n\n if (typeof angle === 'string') {\n const match = angle.toLowerCase().trim().match(/^(-?[0-9]+(?:\\.[0-9]*)?)(.*)$/);\n\n if (!match) {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n const value = parseFloat(match[1]);\n const unit = match[2];\n\n if (unit) {\n switch (unit) {\n case 'deg':\n case 'degs':\n parsed = THREE.MathUtils.degToRad(value);\n break;\n case 'rad':\n case 'rads':\n parsed = value;\n break;\n default:\n throw new PSVError('Unknown angle unit \"' + unit + '\"');\n }\n }\n else {\n parsed = value;\n }\n }\n else if (typeof angle === 'number' && !isNaN(angle)) {\n parsed = angle;\n }\n else {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n parsed = loop(zeroCenter ? parsed + Math.PI : parsed, Math.PI * 2);\n\n return zeroCenter ? bound(parsed - Math.PI, -Math.PI / (halfCircle ? 2 : 1), Math.PI / (halfCircle ? 2 : 1)) : parsed;\n}\n\n/**\n * @summary Creates a THREE texture from an image\n * @memberOf PSV.utils\n * @param {HTMLImageElement | HTMLCanvasElement} img\n * @return {external:THREE.Texture}\n */\nexport function createTexture(img) {\n const texture = new THREE.Texture(img);\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n return texture;\n}\n\nconst quaternion = new THREE.Quaternion();\n\n/**\n * @summary Applies the inverse of Euler angles to a vector\n * @memberOf PSV.utils\n * @param {external:THREE.Vector3} vector\n * @param {external:THREE.Euler} euler\n */\nexport function applyEulerInverse(vector, euler) {\n quaternion.setFromEuler(euler).invert();\n vector.applyQuaternion(quaternion);\n}\n","import { CONSTANTS, utils } from '../..';\n\n/**\n * Returns intermediary point between two points on the sphere\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @param {number[]} p1\n * @param {number[]} p2\n * @param {number} f\n * @returns {number[]}\n * @private\n */\nexport function greatArcIntermediaryPoint(p1, p2, f) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const r = utils.greatArcDistance(p1, p2);\n const a = Math.sin((1 - f) * r) / Math.sin(r);\n const b = Math.sin(f * r) / Math.sin(r);\n const x = a * Math.cos(φ1) * Math.cos(λ1) + b * Math.cos(φ2) * Math.cos(λ2);\n const y = a * Math.cos(φ1) * Math.sin(λ1) + b * Math.cos(φ2) * Math.sin(λ2);\n const z = a * Math.sin(φ1) + b * Math.sin(φ2);\n\n return [\n Math.atan2(y, x),\n Math.atan2(z, Math.sqrt(x * x + y * y)),\n ];\n}\n\n/**\n * @summary Computes the center point of a polygon\n * @todo Get \"visual center\" (https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual-center-of-a-polygon-7c77e6492fbc)\n * @param {number[][]} polygon\n * @returns {number[]}\n * @private\n */\nexport function getPolygonCenter(polygon) {\n // apply offsets to avoid crossing the origin\n const workPoints = [polygon[0]];\n\n let k = 0;\n for (let i = 1; i < polygon.length; i++) {\n const d = polygon[i - 1][0] - polygon[i][0];\n if (d > Math.PI) { // crossed the origin left to right\n k += 1;\n }\n else if (d < -Math.PI) { // crossed the origin right to left\n k -= 1;\n }\n workPoints.push([polygon[i][0] + k * 2 * Math.PI, polygon[i][1]]);\n }\n\n const sum = workPoints.reduce((intermediary, point) => [intermediary[0] + point[0], intermediary[1] + point[1]]);\n return [utils.parseAngle(sum[0] / polygon.length), sum[1] / polygon.length];\n}\n\n/**\n * @summary Computes the middle point of a polyline\n * @param {number[][]} polyline\n * @returns {number[]}\n * @private\n */\nexport function getPolylineCenter(polyline) {\n // compute each segment length + total length\n let length = 0;\n const lengths = [];\n\n for (let i = 0; i < polyline.length - 1; i++) {\n const l = utils.greatArcDistance(polyline[i], polyline[i + 1]) * CONSTANTS.SPHERE_RADIUS;\n\n lengths.push(l);\n length += l;\n }\n\n // iterate until length / 2\n let consumed = 0;\n\n for (let j = 0; j < polyline.length - 1; j++) {\n // once the segment containing the middle point is found, computes the intermediary point\n if (consumed + lengths[j] > length / 2) {\n const r = (length / 2 - consumed) / lengths[j];\n return greatArcIntermediaryPoint(polyline[j], polyline[j + 1], r);\n }\n\n consumed += lengths[j];\n }\n\n // this never happens\n return polyline[Math.round(polyline.length / 2)];\n}\n","import * as THREE from 'three';\nimport { CONSTANTS, PSVError, utils } from '../..';\nimport { getShortestArc, logWarn } from '../../utils';\nimport { MARKER_DATA, SVG_NS } from './constants';\nimport { getPolygonCenter, getPolylineCenter } from './utils';\n\n/**\n * @summary Types of marker\n * @memberOf PSV.plugins.MarkersPlugin\n * @enum {string}\n * @constant\n * @private\n */\nconst MARKER_TYPES = {\n image : 'image',\n imageLayer : 'imageLayer',\n html : 'html',\n polygonPx : 'polygonPx',\n polygonRad : 'polygonRad',\n polylinePx : 'polylinePx',\n polylineRad: 'polylineRad',\n square : 'square',\n rect : 'rect',\n circle : 'circle',\n ellipse : 'ellipse',\n path : 'path',\n};\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Properties\n * @summary Marker properties, see {@link https://photo-sphere-viewer.js.org/plugins/plugin-markers.html#markers-options}\n */\n\n/**\n * @summary Object representing a marker\n * @memberOf PSV.plugins.MarkersPlugin\n */\nexport class Marker {\n\n /**\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {PSV.Viewer} psv\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(properties, psv) {\n if (!properties.id) {\n throw new PSVError('missing marker id');\n }\n\n /**\n * @member {PSV.Viewer}\n * @readonly\n * @protected\n */\n this.psv = psv;\n\n /**\n * @member {string}\n * @readonly\n */\n this.id = properties.id;\n\n /**\n * @member {string}\n * @readonly\n */\n this.type = Marker.getType(properties, false);\n\n /**\n * @member {boolean}\n * @protected\n */\n this.visible = true;\n\n /**\n * @member {HTMLElement|SVGElement|THREE.Object3D}\n * @readonly\n */\n this.$el = null;\n\n /**\n * @summary Original configuration of the marker\n * @member {PSV.plugins.MarkersPlugin.Properties}\n * @readonly\n */\n this.config = {};\n\n /**\n * @summary User data associated to the marker\n * @member {any}\n */\n this.data = undefined;\n\n /**\n * @summary Tooltip instance for this marker\n * @member {PSV.components.Tooltip}\n */\n this.tooltip = null;\n\n /**\n * @summary Computed properties\n * @member {Object}\n * @protected\n * @property {boolean} dynamicSize\n * @property {PSV.Point} anchor\n * @property {PSV.Position} position - position in spherical coordinates\n * @property {PSV.Point} position2D - position in viewer coordinates\n * @property {external:THREE.Vector3[]} positions3D - positions in 3D space\n * @property {number} width\n * @property {number} height\n * @property {*} def\n */\n this.props = {\n dynamicSize: false,\n anchor : null,\n position : null,\n position2D : null,\n positions3D: null,\n width : null,\n height : null,\n def : null,\n };\n\n /**\n * @summary THREE file loader\n * @type {THREE:TextureLoader}\n * @private\n */\n this.loader = null;\n\n if (this.is3d()) {\n this.loader = new THREE.TextureLoader();\n if (this.psv.config.withCredentials) {\n this.loader.setWithCredentials(true);\n }\n if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'object') {\n this.loader.setRequestHeader(this.psv.config.requestHeaders);\n }\n }\n\n // create element\n if (this.isNormal()) {\n this.$el = document.createElement('div');\n }\n else if (this.isPolygon()) {\n this.$el = document.createElementNS(SVG_NS, 'polygon');\n }\n else if (this.isPolyline()) {\n this.$el = document.createElementNS(SVG_NS, 'polyline');\n }\n else if (this.isSvg()) {\n this.$el = document.createElementNS(SVG_NS, this.type);\n }\n\n if (!this.is3d()) {\n this.$el.id = `psv-marker-${this.id}`;\n this.$el[MARKER_DATA] = this;\n }\n\n this.update(properties);\n }\n\n /**\n * @summary Destroys the marker\n */\n destroy() {\n delete this.$el[MARKER_DATA];\n delete this.$el;\n delete this.config;\n delete this.props;\n delete this.psv;\n }\n\n /**\n * @summary Checks if it is a 3D marker (imageLayer)\n * @returns {boolean}\n */\n is3d() {\n return this.type === MARKER_TYPES.imageLayer;\n }\n\n /**\n * @summary Checks if it is a normal marker (image or html)\n * @returns {boolean}\n */\n isNormal() {\n return this.type === MARKER_TYPES.image\n || this.type === MARKER_TYPES.html;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline marker\n * @returns {boolean}\n */\n isPoly() {\n return this.isPolygon()\n || this.isPolyline();\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using pixel coordinates\n * @returns {boolean}\n */\n isPolyPx() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polylinePx;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using radian coordinates\n * @returns {boolean}\n */\n isPolyRad() {\n return this.type === MARKER_TYPES.polygonRad\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is a polygon marker\n * @returns {boolean}\n */\n isPolygon() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polygonRad;\n }\n\n /**\n * @summary Checks if it is a polyline marker\n * @returns {boolean}\n */\n isPolyline() {\n return this.type === MARKER_TYPES.polylinePx\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is an SVG marker\n * @returns {boolean}\n */\n isSvg() {\n return this.type === MARKER_TYPES.square\n || this.type === MARKER_TYPES.rect\n || this.type === MARKER_TYPES.circle\n || this.type === MARKER_TYPES.ellipse\n || this.type === MARKER_TYPES.path;\n }\n\n /**\n * @summary Computes marker scale from zoom level\n * @param {number} zoomLevel\n * @param {PSV.Position} position\n * @returns {number}\n */\n getScale(zoomLevel, position) {\n if (!this.config.scale) {\n return 1;\n }\n if (typeof this.config.scale === 'function') {\n return this.config.scale(zoomLevel, position);\n }\n\n let scale = 1;\n if (Array.isArray(this.config.scale.zoom)) {\n const bounds = this.config.scale.zoom;\n scale *= bounds[0] + (bounds[1] - bounds[0]) * CONSTANTS.EASINGS.inQuad(zoomLevel / 100);\n }\n if (Array.isArray(this.config.scale.longitude)) {\n const bounds = this.config.scale.longitude;\n const halfFov = THREE.MathUtils.degToRad(this.psv.prop.hFov) / 2;\n const arc = Math.abs(getShortestArc(this.props.position.longitude, position.longitude));\n scale *= bounds[1] + (bounds[0] - bounds[1]) * CONSTANTS.EASINGS.outQuad(Math.max(0, (halfFov - arc) / halfFov));\n }\n return scale;\n }\n\n /**\n * @summary Returns the markers list content for the marker, it can be either :\n * - the `listContent`\n * - the `tooltip.content`\n * - the `html`\n * - the `id`\n * @returns {*}\n */\n getListContent() {\n if (this.config.listContent) {\n return this.config.listContent;\n }\n else if (this.config.tooltip?.content) {\n return this.config.tooltip.content;\n }\n else if (this.config.html) {\n return this.config.html;\n }\n else {\n return this.id;\n }\n }\n\n /**\n * @summary Display the tooltip of this marker\n * @param {{clientX: number, clientY: number}} [mousePosition]\n */\n showTooltip(mousePosition) {\n if (this.visible && this.config.tooltip?.content && this.props.position2D) {\n const config = {\n content : this.config.tooltip.content,\n position: this.config.tooltip.position,\n data : this,\n };\n\n if (this.isPoly()) {\n const viewerPos = utils.getPosition(this.psv.container);\n\n config.box = { // separate the tooltip from the cursor\n width : this.psv.tooltip.size.arrow * 2,\n height: this.psv.tooltip.size.arrow * 2,\n };\n\n if (mousePosition) {\n config.top = mousePosition.clientY - viewerPos.top - this.psv.tooltip.size.arrow / 2;\n config.left = mousePosition.clientX - viewerPos.left - this.psv.tooltip.size.arrow;\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n }\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n config.box = {\n width : this.props.width,\n height: this.props.height,\n };\n }\n\n if (this.tooltip) {\n this.tooltip.move(config);\n }\n else {\n this.tooltip = this.psv.tooltip.create(config);\n }\n }\n }\n\n /**\n * @summary Hides the tooltip of this marker\n */\n hideTooltip() {\n if (this.tooltip) {\n this.tooltip.hide();\n this.tooltip = null;\n }\n }\n\n /**\n * @summary Updates the marker with new properties\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n update(properties) {\n const newType = Marker.getType(properties, true);\n\n if (newType !== undefined && newType !== this.type) {\n throw new PSVError('cannot change marker type');\n }\n\n utils.deepmerge(this.config, properties);\n if (typeof this.config.tooltip === 'string') {\n this.config.tooltip = { content: this.config.tooltip };\n }\n\n this.data = this.config.data;\n this.visible = this.config.visible !== false;\n\n if (!this.is3d()) {\n // reset CSS class\n if (this.isNormal()) {\n this.$el.setAttribute('class', 'psv-marker psv-marker--normal');\n }\n else {\n this.$el.setAttribute('class', 'psv-marker psv-marker--svg');\n }\n\n // add CSS classes\n if (this.config.className) {\n utils.addClasses(this.$el, this.config.className);\n }\n\n if (this.config.tooltip) {\n utils.addClasses(this.$el, 'psv-marker--has-tooltip');\n }\n if (this.config.content) {\n utils.addClasses(this.$el, 'psv-marler--has-content');\n }\n\n // apply style\n this.$el.style.opacity = this.config.opacity ?? 1;\n if (this.config.style) {\n utils.deepmerge(this.$el.style, this.config.style);\n }\n }\n\n // parse anchor\n this.props.anchor = utils.parsePosition(this.config.anchor);\n\n // clean scale\n if (this.config.scale) {\n if (typeof this.config.scale === 'number') {\n logWarn('Single value marker scale is deprecated, please use an array of two values.');\n this.config.scale = { zoom: [0, this.config.scale] };\n }\n if (Array.isArray(this.config.scale)) {\n this.config.scale = { zoom: this.config.scale };\n }\n }\n\n if (this.isNormal()) {\n this.__updateNormal();\n }\n else if (this.isPoly()) {\n this.__updatePoly();\n }\n else if (this.isSvg()) {\n this.__updateSvg();\n }\n else if (this.is3d()) {\n this.__update3d();\n }\n }\n\n /**\n * @summary Updates a normal marker\n * @private\n */\n __updateNormal() {\n if (!utils.isExtendedPosition(this.config)) {\n throw new PSVError('missing marker position, latitude/longitude or x/y');\n }\n\n if (this.config.image && (!this.config.width || !this.config.height)) {\n throw new PSVError('missing marker width/height');\n }\n\n if (this.config.width && this.config.height) {\n this.props.dynamicSize = false;\n this.props.width = this.config.width;\n this.props.height = this.config.height;\n this.$el.style.width = this.config.width + 'px';\n this.$el.style.height = this.config.height + 'px';\n }\n else {\n this.props.dynamicSize = true;\n }\n\n if (this.config.image) {\n this.props.def = this.config.image;\n this.$el.style.backgroundImage = `url(${this.config.image})`;\n }\n else if (this.config.html) {\n this.props.def = this.config.html;\n this.$el.innerHTML = this.config.html;\n }\n\n // set anchor\n this.$el.style.transformOrigin = `${this.props.anchor.x * 100}% ${this.props.anchor.y * 100}%`;\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates an SVG marker\n * @private\n */\n __updateSvg() {\n if (!utils.isExtendedPosition(this.config)) {\n throw new PSVError('missing marker position, latitude/longitude or x/y');\n }\n\n this.props.dynamicSize = true;\n\n // set content\n switch (this.type) {\n case MARKER_TYPES.square:\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.square,\n height: this.config.square,\n };\n break;\n\n case MARKER_TYPES.rect:\n if (Array.isArray(this.config.rect)) {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect[0],\n height: this.config.rect[1],\n };\n }\n else {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect.width,\n height: this.config.rect.height,\n };\n }\n break;\n\n case MARKER_TYPES.circle:\n this.props.def = {\n cx: this.config.circle,\n cy: this.config.circle,\n r : this.config.circle,\n };\n break;\n\n case MARKER_TYPES.ellipse:\n if (Array.isArray(this.config.ellipse)) {\n this.props.def = {\n cx: this.config.ellipse[0],\n cy: this.config.ellipse[1],\n rx: this.config.ellipse[0],\n ry: this.config.ellipse[1],\n };\n }\n else {\n this.props.def = {\n cx: this.config.ellipse.rx,\n cy: this.config.ellipse.ry,\n rx: this.config.ellipse.rx,\n ry: this.config.ellipse.ry,\n };\n }\n break;\n\n case MARKER_TYPES.path:\n this.props.def = {\n d: this.config.path,\n };\n break;\n\n // no default\n }\n\n utils.each(this.props.def, (value, prop) => {\n this.$el.setAttributeNS(null, prop, value);\n });\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n }\n else {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates a polygon marker\n * @private\n */\n __updatePoly() {\n this.props.dynamicSize = true;\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n\n if (this.isPolyline() && !this.config.svgStyle.fill) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n }\n }\n else if (this.isPolygon()) {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n else if (this.isPolyline()) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n this.$el.setAttributeNS(null, 'stroke', 'rgb(0,0,0)');\n }\n\n // fold arrays: [1,2,3,4] => [[1,2],[3,4]]\n const actualPoly = this.config.polygonPx || this.config.polygonRad || this.config.polylinePx || this.config.polylineRad;\n if (!Array.isArray(actualPoly[0])) {\n for (let i = 0; i < actualPoly.length; i++) {\n actualPoly.splice(i, 2, [actualPoly[i], actualPoly[i + 1]]);\n }\n }\n\n // convert texture coordinates to spherical coordinates\n if (this.isPolyPx()) {\n this.props.def = actualPoly.map((coord) => {\n const sphericalCoords = this.psv.dataHelper.textureCoordsToSphericalCoords({ x: coord[0], y: coord[1] });\n return [sphericalCoords.longitude, sphericalCoords.latitude];\n });\n }\n // clean angles\n else {\n this.props.def = actualPoly.map((coord) => {\n return [utils.parseAngle(coord[0]), utils.parseAngle(coord[1], true)];\n });\n }\n\n const centroid = this.isPolygon()\n ? getPolygonCenter(this.props.def)\n : getPolylineCenter(this.props.def);\n\n this.props.position = {\n longitude: centroid[0],\n latitude : centroid[1],\n };\n\n // compute x/y/z positions\n this.props.positions3D = this.props.def.map((coord) => {\n return this.psv.dataHelper.sphericalCoordsToVector3({ longitude: coord[0], latitude : coord[1] });\n });\n }\n\n /**\n * @summary Updates a 3D marker\n * @private\n */\n __update3d() {\n if (!this.config.width || !this.config.height) {\n throw new PSVError('missing marker width/height');\n }\n\n this.props.dynamicSize = false;\n this.props.width = this.config.width;\n this.props.height = this.config.height;\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n\n switch (this.type) {\n case MARKER_TYPES.imageLayer:\n if (!this.$el) {\n const material = new THREE.MeshBasicMaterial({\n transparent: true,\n opacity : this.config.opacity ?? 1,\n depthTest : false,\n });\n const geometry = new THREE.PlaneGeometry(1, 1);\n const mesh = new THREE.Mesh(geometry, material);\n mesh.userData = { [MARKER_DATA]: this };\n this.$el = new THREE.Group().add(mesh);\n\n // overwrite the visible property to be tied to the Marker instance\n // and do it without context bleed\n Object.defineProperty(this.$el, 'visible', {\n enumerable: true,\n get : function () {\n return this.children[0].userData[MARKER_DATA].visible;\n },\n set : function (visible) {\n this.children[0].userData[MARKER_DATA].visible = visible;\n },\n });\n }\n\n if (this.props.def !== this.config.imageLayer) {\n if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'function') {\n this.loader.setRequestHeader(this.psv.config.requestHeaders(this.config.imageLayer));\n }\n this.$el.children[0].material.map = this.loader.load(this.config.imageLayer, (texture) => {\n texture.anisotropy = 4;\n this.psv.needsUpdate();\n });\n this.props.def = this.config.imageLayer;\n }\n\n this.$el.children[0].position.set(\n this.props.anchor.x - 0.5,\n this.props.anchor.y - 0.5,\n 0\n );\n\n this.$el.position.copy(this.props.positions3D[0]);\n\n switch (this.config.orientation) {\n case 'horizontal':\n this.$el.lookAt(0, this.$el.position.y, 0);\n this.$el.rotateX(this.props.position.latitude < 0 ? -Math.PI / 2 : Math.PI / 2);\n break;\n case 'vertical-left':\n this.$el.lookAt(0, 0, 0);\n this.$el.rotateY(-Math.PI * 0.4);\n break;\n case 'vertical-right':\n this.$el.lookAt(0, 0, 0);\n this.$el.rotateY(Math.PI * 0.4);\n break;\n default:\n this.$el.lookAt(0, 0, 0);\n break;\n }\n\n // 100 is magic number that gives a coherent size at default zoom level\n this.$el.scale.set(this.config.width / 100, this.config.height / 100, 1);\n break;\n\n // no default\n }\n }\n\n /**\n * @summary Determines the type of a marker by the available properties\n * @param {Marker.Properties} properties\n * @param {boolean} [allowNone=false]\n * @returns {string}\n * @throws {PSV.PSVError} when the marker's type cannot be found\n */\n static getType(properties, allowNone = false) {\n const found = [];\n\n utils.each(MARKER_TYPES, (type) => {\n if (properties[type]) {\n found.push(type);\n }\n });\n\n if (found.length === 0 && !allowNone) {\n throw new PSVError(`missing marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n else if (found.length > 1) {\n throw new PSVError(`multiple marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n\n return found[0];\n }\n\n}\n","import { AbstractButton } from '../..';\nimport { EVENTS } from './constants';\nimport pin from './pin.svg';\n\n/**\n * @summary Navigation bar markers button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersButton extends AbstractButton {\n\n static id = 'markers';\n static icon = pin;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin('markers');\n\n if (this.plugin) {\n this.plugin.on(EVENTS.SHOW_MARKERS, this);\n this.plugin.on(EVENTS.HIDE_MARKERS, this);\n\n this.toggleActive(true);\n }\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(EVENTS.SHOW_MARKERS, this);\n this.plugin.off(EVENTS.HIDE_MARKERS, this);\n }\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.SHOW_MARKERS: this.toggleActive(true); break;\n case EVENTS.HIDE_MARKERS: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers\n */\n onClick() {\n if (this.plugin.prop.visible) {\n this.plugin.hide();\n }\n else {\n this.plugin.show();\n }\n }\n\n}\n","import { AbstractButton, CONSTANTS } from '../..';\nimport { ID_PANEL_MARKERS_LIST } from './constants';\nimport pinList from './pin-list.svg';\n\n/**\n * @summary Navigation bar markers list button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersListButton extends AbstractButton {\n\n static id = 'markersList';\n static icon = pinList;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-list-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin('markers');\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === ID_PANEL_MARKERS_LIST); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers list\n */\n onClick() {\n this.plugin.toggleMarkersList();\n }\n\n}\n","import * as THREE from 'three';\nimport { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..';\nimport {\n EVENTS,\n ID_PANEL_MARKER,\n ID_PANEL_MARKERS_LIST,\n MARKER_DATA,\n MARKERS_LIST_TEMPLATE,\n SVG_NS\n} from './constants';\nimport { Marker } from './Marker';\nimport { MarkersButton } from './MarkersButton';\nimport { MarkersListButton } from './MarkersListButton';\nimport './style.scss';\n\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Options\n * @property {boolean} [clickEventOnMarker=false] If a `click` event is triggered on the viewer additionally to the `select-marker` event.\n * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers]\n */\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.SelectMarkerData\n * @summary Data of the `select-marker` event\n * @property {boolean} dblclick - if the selection originated from a double click, the simple click is always fired before the double click\n * @property {boolean} rightclick - if the selection originated from a right click\n */\n\n\n// add markers buttons\nDEFAULTS.lang[MarkersButton.id] = 'Markers';\nDEFAULTS.lang[MarkersListButton.id] = 'Markers list';\nregisterButton(MarkersButton, 'caption:left');\nregisterButton(MarkersListButton, 'caption:left');\n\n\nexport { EVENTS } from './constants';\n\n\n/**\n * @summary Displays various markers on the viewer\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class MarkersPlugin extends AbstractPlugin {\n\n static id = 'markers';\n\n static EVENTS = EVENTS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.MarkersPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @summary All registered markers\n * @member {Object}\n */\n this.markers = {};\n\n /**\n * @type {Object}\n * @property {boolean} visible - Visibility of the component\n * @property {PSV.plugins.MarkersPlugin.Marker} currentMarker - Last selected marker\n * @property {PSV.plugins.MarkersPlugin.Marker} hoveringMarker - Marker under the cursor\n * @private\n */\n this.prop = {\n visible : true,\n currentMarker : null,\n hoveringMarker: null,\n stopObserver : null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin.Options}\n */\n this.config = {\n clickEventOnMarker: false,\n ...options,\n };\n\n if (options?.listButton === false || options?.hideButton === false) {\n utils.logWarn('MarkersPlugin: listButton and hideButton options are deprecated. '\n + 'Please define the global navbar options according to your needs.');\n }\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = 'psv-markers';\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n\n /**\n * @member {SVGElement}\n * @readonly\n */\n this.svgContainer = document.createElementNS(SVG_NS, 'svg');\n this.svgContainer.setAttribute('class', 'psv-markers-svg-container');\n this.container.appendChild(this.svgContainer);\n\n // Markers events via delegation\n this.container.addEventListener('mouseenter', this, true);\n this.container.addEventListener('mouseleave', this, true);\n this.container.addEventListener('mousemove', this, true);\n this.container.addEventListener('contextmenu', this);\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.psv.container.appendChild(this.container);\n\n // Viewer events\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.RENDER, this);\n this.psv.on(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n if (this.config.markers) {\n this.psv.once(CONSTANTS.EVENTS.READY, () => {\n this.setMarkers(this.config.markers);\n delete this.config.markers;\n });\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.clearMarkers(false);\n\n this.prop.stopObserver?.();\n\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.RENDER, this);\n this.psv.off(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n this.psv.container.removeChild(this.container);\n\n delete this.svgContainer;\n delete this.markers;\n delete this.container;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mouseenter': this.__onMouseEnter(e, this.__getTargetMarker(e.target)); break;\n case 'mouseleave': this.__onMouseLeave(e, this.__getTargetMarker(e.target)); break;\n case 'mousemove': this.__onMouseMove(e, this.__getTargetMarker(e.target)); break;\n case 'contextmenu': e.preventDefault(); break;\n case CONSTANTS.EVENTS.CLICK: this.__onClick(e, e.args[0], false); break;\n case CONSTANTS.EVENTS.DOUBLE_CLICK: this.__onClick(e, e.args[0], true); break;\n case CONSTANTS.EVENTS.RENDER: this.renderMarkers(); break;\n case CONSTANTS.OBJECT_EVENTS.ENTER_OBJECT: this.__onMouseEnter(e.detail.originalEvent, e.detail.data); break;\n case CONSTANTS.OBJECT_EVENTS.LEAVE_OBJECT: this.__onMouseLeave(e.detail.originalEvent, e.detail.data); break;\n case CONSTANTS.OBJECT_EVENTS.HOVER_OBJECT: this.__onMouseMove(e.detail.originalEvent, e.detail.data); break;\n case CONSTANTS.EVENTS.CONFIG_CHANGED:\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @summary Shows all markers\n * @fires PSV.plugins.MarkersPlugin.show-markers\n */\n show() {\n this.prop.visible = true;\n\n this.renderMarkers();\n\n this.trigger(EVENTS.SHOW_MARKERS);\n }\n\n /**\n * @summary Hides all markers\n * @fires PSV.plugins.MarkersPlugin.hide-markers\n */\n hide() {\n this.prop.visible = false;\n\n this.renderMarkers();\n\n this.trigger(EVENTS.HIDE_MARKERS);\n }\n\n /**\n * @summary Toggles the visibility of all tooltips\n */\n toggleAllTooltips() {\n this.prop.showAllTooltips = !this.prop.showAllTooltips;\n this.renderMarkers();\n }\n\n /**\n * @summary Displays all tooltips\n */\n showAllTooltips() {\n this.prop.showAllTooltips = true;\n this.renderMarkers();\n }\n\n /**\n * @summary Hides all tooltips\n */\n hideAllTooltips() {\n this.prop.showAllTooltips = false;\n this.renderMarkers();\n }\n\n /**\n * @summary Returns the total number of markers\n * @returns {number}\n */\n getNbMarkers() {\n return Object.keys(this.markers).length;\n }\n\n /**\n * @summary Returns all the markers\n * @return {PSV.plugins.MarkersPlugin.Marker[]}\n */\n getMarkers() {\n return Object.values(this.markers);\n }\n\n /**\n * @summary Adds a new marker to viewer\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker's id is missing or already exists\n */\n addMarker(properties, render = true) {\n if (this.markers[properties.id]) {\n throw new PSVError(`marker \"${properties.id}\" already exists`);\n }\n\n const marker = new Marker(properties, this.psv);\n\n if (marker.isNormal()) {\n this.container.appendChild(marker.$el);\n }\n else if (marker.isPoly() || marker.isSvg()) {\n this.svgContainer.appendChild(marker.$el);\n }\n else if (marker.is3d()) {\n this.psv.renderer.scene.add(marker.$el);\n }\n\n this.markers[marker.id] = marker;\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n\n return marker;\n }\n\n /**\n * @summary Returns the internal marker object for a marker id\n * @param {string} markerId\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker cannot be found\n */\n getMarker(markerId) {\n const id = typeof markerId === 'object' ? markerId.id : markerId;\n\n if (!this.markers[id]) {\n throw new PSVError(`cannot find marker \"${id}\"`);\n }\n\n return this.markers[id];\n }\n\n /**\n * @summary Returns the last marker selected by the user\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n getCurrentMarker() {\n return this.prop.currentMarker;\n }\n\n /**\n * @summary Updates the existing marker with the same id\n * @description Every property can be changed but you can't change its type (Eg: `image` to `html`).\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n updateMarker(properties, render = true) {\n const marker = this.getMarker(properties.id);\n\n marker.update(properties);\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n\n if (marker.is3d()) {\n this.psv.needsUpdate();\n }\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n\n return marker;\n }\n\n /**\n * @summary Removes a marker from the viewer\n * @param {string} markerId\n * @param {boolean} [render=true] - renders the marker immediately\n */\n removeMarker(markerId, render = true) {\n const marker = this.getMarker(markerId);\n\n if (marker.isNormal()) {\n this.container.removeChild(marker.$el);\n }\n else if (marker.isPoly() || marker.isSvg()) {\n this.svgContainer.removeChild(marker.$el);\n }\n else if (marker.is3d()) {\n this.psv.renderer.scene.remove(marker.$el);\n this.psv.needsUpdate();\n }\n\n if (this.prop.hoveringMarker === marker) {\n this.prop.hoveringMarker = null;\n }\n\n if (this.prop.currentMarker === marker) {\n this.prop.currentMarker = null;\n }\n\n marker.hideTooltip();\n\n marker.destroy();\n delete this.markers[marker.id];\n\n if (render) {\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Removes multiple markers\n * @param {string[]} markerIds\n * @param {boolean} [render=true] - renders the markers immediately\n */\n removeMarkers(markerIds, render = true) {\n markerIds.forEach(markerId => this.removeMarker(markerId, false));\n\n if (render) {\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Replaces all markers\n * @param {PSV.plugins.MarkersPlugin.Properties[]} markers\n * @param {boolean} [render=true] - renders the marker immediately\n */\n setMarkers(markers, render = true) {\n this.clearMarkers(false);\n\n utils.each(markers, marker => this.addMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Removes all markers\n * @param {boolean} [render=true] - renders the markers immediately\n */\n clearMarkers(render = true) {\n utils.each(this.markers, marker => this.removeMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Rotate the view to face the marker\n * @param {string} markerId\n * @param {string|number} [speed] - rotates smoothy, see {@link PSV.Viewer#animate}\n * @fires PSV.plugins.MarkersPlugin.goto-marker-done\n * @return {PSV.Animation} A promise that will be resolved when the animation finishes\n */\n gotoMarker(markerId, speed) {\n const marker = this.getMarker(markerId);\n\n return this.psv.animate({\n ...marker.props.position,\n speed,\n })\n .then(() => {\n this.trigger(EVENTS.GOTO_MARKER_DONE, marker);\n });\n }\n\n /**\n * @summary Hides a marker\n * @param {string} markerId\n */\n hideMarker(markerId) {\n this.toggleMarker(markerId, false);\n }\n\n /**\n * @summary Shows a marker\n * @param {string} markerId\n */\n showMarker(markerId) {\n this.toggleMarker(markerId, true);\n }\n\n /**\n * @summary Toggles a marker\n * @param {string} markerId\n * @param {boolean} [visible]\n */\n toggleMarker(markerId, visible = null) {\n const marker = this.getMarker(markerId);\n marker.visible = visible === null ? !marker.visible : visible;\n if (marker.is3d()) {\n this.psv.needsUpdate();\n }\n else {\n this.renderMarkers();\n }\n }\n\n /**\n * @summary Opens the panel with the content of the marker\n * @param {string} markerId\n */\n showMarkerPanel(markerId) {\n const marker = this.getMarker(markerId);\n\n if (marker?.config?.content) {\n this.psv.panel.show({\n id : ID_PANEL_MARKER,\n content: marker.config.content,\n });\n }\n else {\n this.psv.panel.hide(ID_PANEL_MARKER);\n }\n }\n\n /**\n * @summary Toggles the visibility of the list of markers\n */\n toggleMarkersList() {\n if (this.psv.panel.prop.contentId === ID_PANEL_MARKERS_LIST) {\n this.hideMarkersList();\n }\n else {\n this.showMarkersList();\n }\n }\n\n /**\n * @summary Opens side panel with the list of markers\n * @fires PSV.plugins.MarkersPlugin.filter:render-markers-list\n */\n showMarkersList() {\n let markers = [];\n utils.each(this.markers, (marker) => {\n if (marker.visible && !marker.config.hideList) {\n markers.push(marker);\n }\n });\n\n markers = this.change(EVENTS.RENDER_MARKERS_LIST, markers);\n\n this.psv.panel.show({\n id : ID_PANEL_MARKERS_LIST,\n content : MARKERS_LIST_TEMPLATE(\n markers,\n this.psv.config.lang[MarkersButton.id],\n utils.dasherize(MARKER_DATA)\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const markerId = li ? li.dataset[MARKER_DATA] : undefined;\n\n if (markerId) {\n const marker = this.getMarker(markerId);\n\n this.trigger(EVENTS.SELECT_MARKER_LIST, marker);\n\n this.gotoMarker(marker, 1000);\n this.hideMarkersList();\n }\n },\n });\n }\n\n /**\n * @summary Closes side panel if it contains the list of markers\n */\n hideMarkersList() {\n this.psv.panel.hide(ID_PANEL_MARKERS_LIST);\n }\n\n /**\n * @summary Updates the visibility and the position of all markers\n */\n renderMarkers() {\n const zoomLevel = this.psv.getZoomLevel();\n const viewerPosition = this.psv.getPosition();\n\n utils.each(this.markers, (marker) => {\n let isVisible = this.prop.visible && marker.visible;\n let position = null;\n\n if (isVisible && marker.is3d()) {\n position = this.__getMarkerPosition(marker);\n isVisible = this.__isMarkerVisible(marker, position);\n }\n else if (isVisible && marker.isPoly()) {\n const positions = this.__getPolyPositions(marker);\n isVisible = positions.length > (marker.isPolygon() ? 2 : 1);\n\n if (isVisible) {\n position = this.__getMarkerPosition(marker);\n\n const points = positions.map(pos => (pos.x - position.x) + ',' + (pos.y - position.y)).join(' ');\n\n marker.$el.setAttributeNS(null, 'points', points);\n marker.$el.setAttributeNS(null, 'transform', `translate(${position.x} ${position.y})`);\n }\n }\n else if (isVisible) {\n if (marker.props.dynamicSize) {\n this.__updateMarkerSize(marker);\n }\n\n position = this.__getMarkerPosition(marker);\n isVisible = this.__isMarkerVisible(marker, position);\n\n if (isVisible) {\n const scale = marker.getScale(zoomLevel, viewerPosition);\n\n if (marker.isSvg()) {\n // simulate transform-origin relative to SVG element\n const x = position.x + marker.props.width * marker.props.anchor.x * (1 - scale);\n const y = position.y + marker.props.width * marker.props.anchor.y * (1 - scale);\n marker.$el.setAttributeNS(null, 'transform', `translate(${x}, ${y}) scale(${scale}, ${scale})`);\n }\n else {\n marker.$el.style.transform = `translate3D(${position.x}px, ${position.y}px, 0px) scale(${scale}, ${scale})`;\n }\n }\n }\n\n marker.props.position2D = isVisible ? position : null;\n\n if (!marker.is3d()) {\n utils.toggleClass(marker.$el, 'psv-marker--visible', isVisible);\n }\n\n if (isVisible && (this.prop.showAllTooltips || (marker === this.prop.hoveringMarker && !marker.isPoly()))) {\n marker.showTooltip();\n }\n else if (!isVisible || marker !== this.prop.hoveringMarker) {\n marker.hideTooltip();\n }\n });\n }\n\n /**\n * @summary Determines if a point marker is visible
\n * It tests if the point is in the general direction of the camera, then check if it's in the viewport\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.Point} position\n * @returns {boolean}\n * @private\n */\n __isMarkerVisible(marker, position) {\n return marker.props.positions3D[0].dot(this.psv.prop.direction) > 0\n && position.x + marker.props.width >= 0\n && position.x - marker.props.width <= this.psv.prop.size.width\n && position.y + marker.props.height >= 0\n && position.y - marker.props.height <= this.psv.prop.size.height;\n }\n\n /**\n * @summary Computes the real size of a marker\n * @description This is done by removing all it's transformations (if any) and making it visible\n * before querying its bounding rect\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @private\n */\n __updateMarkerSize(marker) {\n utils.addClasses(marker.$el, 'psv-marker--transparent');\n\n let transform;\n if (marker.isSvg()) {\n transform = marker.$el.getAttributeNS(null, 'transform');\n marker.$el.removeAttributeNS(null, 'transform');\n }\n else {\n transform = marker.$el.style.transform;\n marker.$el.style.transform = '';\n }\n\n const rect = marker.$el.getBoundingClientRect();\n marker.props.width = rect.width;\n marker.props.height = rect.height;\n\n utils.removeClasses(marker.$el, 'psv-marker--transparent');\n\n if (transform) {\n if (marker.isSvg()) {\n marker.$el.setAttributeNS(null, 'transform', transform);\n }\n else {\n marker.$el.style.transform = transform;\n }\n }\n\n // the size is no longer dynamic once known\n marker.props.dynamicSize = false;\n }\n\n /**\n * @summary Computes viewer coordinates of a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @returns {PSV.Point}\n * @private\n */\n __getMarkerPosition(marker) {\n if (marker.isPoly()) {\n return this.psv.dataHelper.sphericalCoordsToViewerCoords(marker.props.position);\n }\n else {\n const position = this.psv.dataHelper.vector3ToViewerCoords(marker.props.positions3D[0]);\n\n position.x -= marker.props.width * marker.props.anchor.x;\n position.y -= marker.props.height * marker.props.anchor.y;\n\n return position;\n }\n }\n\n /**\n * @summary Computes viewer coordinates of each point of a polygon/polyline
\n * It handles points behind the camera by creating intermediary points suitable for the projector\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @returns {PSV.Point[]}\n * @private\n */\n __getPolyPositions(marker) {\n const nbVectors = marker.props.positions3D.length;\n\n // compute if each vector is visible\n const positions3D = marker.props.positions3D.map((vector) => {\n return {\n vector : vector,\n visible: vector.dot(this.psv.prop.direction) > 0,\n };\n });\n\n // get pairs of visible/invisible vectors for each invisible vector connected to a visible vector\n const toBeComputed = [];\n positions3D.forEach((pos, i) => {\n if (!pos.visible) {\n const neighbours = [\n i === 0 ? positions3D[nbVectors - 1] : positions3D[i - 1],\n i === nbVectors - 1 ? positions3D[0] : positions3D[i + 1],\n ];\n\n neighbours.forEach((neighbour) => {\n if (neighbour.visible) {\n toBeComputed.push({\n visible : neighbour,\n invisible: pos,\n index : i,\n });\n }\n });\n }\n });\n\n // compute intermediary vector for each pair (the loop is reversed for splice to insert at the right place)\n toBeComputed.reverse().forEach((pair) => {\n positions3D.splice(pair.index, 0, {\n vector : this.__getPolyIntermediaryPoint(pair.visible.vector, pair.invisible.vector),\n visible: true,\n });\n });\n\n // translate vectors to screen pos\n return positions3D\n .filter(pos => pos.visible)\n .map(pos => this.psv.dataHelper.vector3ToViewerCoords(pos.vector));\n }\n\n /**\n * Given one point in the same direction of the camera and one point behind the camera,\n * computes an intermediary point on the great circle delimiting the half sphere visible by the camera.\n * The point is shifted by .01 rad because the projector cannot handle points exactly on this circle.\n * TODO : does not work with fisheye view (must not use the great circle)\n * {@link http://math.stackexchange.com/a/1730410/327208}\n * @param P1 {external:THREE.Vector3}\n * @param P2 {external:THREE.Vector3}\n * @returns {external:THREE.Vector3}\n * @private\n */\n __getPolyIntermediaryPoint(P1, P2) {\n const C = this.psv.prop.direction.clone().normalize();\n const N = new THREE.Vector3().crossVectors(P1, P2).normalize();\n const V = new THREE.Vector3().crossVectors(N, P1).normalize();\n const X = P1.clone().multiplyScalar(-C.dot(V));\n const Y = V.clone().multiplyScalar(C.dot(P1));\n const H = new THREE.Vector3().addVectors(X, Y).normalize();\n const a = new THREE.Vector3().crossVectors(H, C);\n return H.applyAxisAngle(a, 0.01).multiplyScalar(CONSTANTS.SPHERE_RADIUS);\n }\n\n /**\n * @summary Returns the marker associated to an event target\n * @param {EventTarget} target\n * @param {boolean} [closest=false]\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @private\n */\n __getTargetMarker(target, closest = false) {\n const target2 = closest ? utils.getClosest(target, '.psv-marker') : target;\n return target2 ? target2[MARKER_DATA] : undefined;\n }\n\n /**\n * @summary Checks if an event target is in the tooltip\n * @param {EventTarget} target\n * @param {PSV.components.Tooltip} tooltip\n * @returns {boolean}\n * @private\n */\n __targetOnTooltip(target, tooltip) {\n return target && tooltip ? utils.hasParent(target, tooltip.container) : false;\n }\n\n /**\n * @summary Handles mouse enter events, show the tooltip for non polygon markers\n * @param {MouseEvent} e\n * @param {PSV.plugins.MarkersPlugin.Marker} [marker]\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseEnter(e, marker) {\n if (marker && !marker.isPoly()) {\n this.prop.hoveringMarker = marker;\n\n this.trigger(EVENTS.OVER_MARKER, marker);\n\n if (!this.prop.showAllTooltips) {\n marker.showTooltip(e);\n }\n }\n }\n\n /**\n * @summary Handles mouse leave events, hide the tooltip\n * @param {MouseEvent} e\n * @param {PSV.plugins.MarkersPlugin.Marker} [marker]\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @private\n */\n __onMouseLeave(e, marker) {\n // do not hide if we enter the tooltip itself while hovering a polygon\n if (marker && !(marker.isPoly() && this.__targetOnTooltip(e.relatedTarget, marker.tooltip))) {\n this.trigger(EVENTS.LEAVE_MARKER, marker);\n\n this.prop.hoveringMarker = null;\n\n if (!this.prop.showAllTooltips) {\n marker.hideTooltip();\n }\n }\n }\n\n /**\n * @summary Handles mouse move events, refreshUi the tooltip for polygon markers\n * @param {MouseEvent} e\n * @param {PSV.plugins.MarkersPlugin.Marker} [targetMarker]\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseMove(e, targetMarker) {\n let marker;\n\n if (targetMarker?.isPoly()) {\n marker = targetMarker;\n }\n // do not hide if we enter the tooltip itself while hovering a polygon\n else if (this.prop.hoveringMarker && this.__targetOnTooltip(e.target, this.prop.hoveringMarker.tooltip)) {\n marker = this.prop.hoveringMarker;\n }\n\n if (marker) {\n if (!this.prop.hoveringMarker) {\n this.trigger(EVENTS.OVER_MARKER, marker);\n\n this.prop.hoveringMarker = marker;\n }\n\n if (!this.prop.showAllTooltips) {\n marker.showTooltip(e);\n }\n }\n else if (this.prop.hoveringMarker?.isPoly()) {\n this.trigger(EVENTS.LEAVE_MARKER, this.prop.hoveringMarker);\n\n if (!this.prop.showAllTooltips) {\n this.prop.hoveringMarker.hideTooltip();\n }\n\n this.prop.hoveringMarker = null;\n }\n }\n\n /**\n * @summary Handles mouse click events, select the marker and open the panel if necessary\n * @param {Event} e\n * @param {Object} data\n * @param {boolean} dblclick\n * @fires PSV.plugins.MarkersPlugin.select-marker\n * @fires PSV.plugins.MarkersPlugin.unselect-marker\n * @private\n */\n __onClick(e, data, dblclick) {\n let marker = data.objects.find(o => o.userData[MARKER_DATA])?.userData[MARKER_DATA];\n\n if (!marker) {\n marker = this.__getTargetMarker(data.target, true);\n }\n\n if (marker) {\n this.prop.currentMarker = marker;\n\n this.trigger(EVENTS.SELECT_MARKER, marker, {\n dblclick : dblclick,\n rightclick: data.rightclick,\n });\n\n if (this.config.clickEventOnMarker) {\n // add the marker to event data\n data.marker = marker;\n }\n else {\n e.stopPropagation();\n }\n\n // the marker could have been deleted in an event handler\n if (this.markers[marker.id]) {\n this.showMarkerPanel(marker.id);\n }\n }\n else if (this.prop.currentMarker) {\n this.trigger(EVENTS.UNSELECT_MARKER, this.prop.currentMarker);\n\n this.psv.panel.hide(ID_PANEL_MARKER);\n\n this.prop.currentMarker = null;\n }\n }\n\n /**\n * @summary Updates the visiblity of the panel and the buttons\n * @private\n */\n __refreshUi() {\n const nbMarkers = Object.values(this.markers).filter(m => !m.config.hideList).length;\n const markersButton = this.psv.navbar.getButton(MarkersButton.id, false);\n const markersListButton = this.psv.navbar.getButton(MarkersListButton.id, false);\n\n if (nbMarkers === 0) {\n markersButton?.hide();\n markersListButton?.hide();\n\n if (this.psv.panel.isVisible(ID_PANEL_MARKERS_LIST)) {\n this.psv.panel.hide();\n }\n else if (this.psv.panel.isVisible(ID_PANEL_MARKER)) {\n this.psv.panel.hide();\n }\n }\n else {\n markersButton?.show();\n markersListButton?.show();\n\n if (this.psv.panel.isVisible(ID_PANEL_MARKERS_LIST)) {\n this.showMarkersList();\n }\n else if (this.psv.panel.isVisible(ID_PANEL_MARKER)) {\n this.prop.currentMarker ? this.showMarkerPanel(this.prop.currentMarker) : this.psv.panel.hide();\n }\n }\n }\n\n /**\n * @summary Adds or remove the objects observer if there are 3D markers\n * @private\n */\n __checkObjectsObserver() {\n const has3d = Object.values(this.markers).some(marker => marker.is3d());\n\n if (!has3d && this.prop.stopObserver) {\n this.prop.stopObserver();\n this.prop.stopObserver = null;\n }\n else if (has3d && !this.prop.stopObserver) {\n this.prop.stopObserver = this.psv.observeObjects(MARKER_DATA, this);\n }\n }\n\n}\n"],"names":["EVENTS","GOTO_MARKER_DONE","LEAVE_MARKER","OVER_MARKER","RENDER_MARKERS_LIST","SELECT_MARKER","SELECT_MARKER_LIST","UNSELECT_MARKER","HIDE_MARKERS","SET_MARKERS","SHOW_MARKERS","SVG_NS","MARKER_DATA","ID_PANEL_MARKER","ID_PANEL_MARKERS_LIST","MARKERS_LIST_TEMPLATE","markers","title","dataKey","icon","map","marker","config","id","type","image","getListContent","join","getShortestArc","from","to","tCandidates","Math","PI","reduce","value","candidate","newCandidate","abs","Infinity","PSVError","message","Error","captureStackTrace","stack","prototype","Object","create","name","constructor","logWarn","console","warn","THREE","Quaternion","greatArcIntermediaryPoint","p1","p2","f","λ1","φ1","λ2","φ2","r","utils","greatArcDistance","a","sin","b","x","cos","y","z","atan2","sqrt","getPolygonCenter","polygon","workPoints","k","i","length","d","push","sum","intermediary","point","parseAngle","getPolylineCenter","polyline","lengths","l","CONSTANTS","SPHERE_RADIUS","consumed","j","round","MARKER_TYPES","imageLayer","html","polygonPx","polygonRad","polylinePx","polylineRad","square","rect","circle","ellipse","path","Marker","properties","psv","getType","visible","$el","data","undefined","tooltip","props","dynamicSize","anchor","position","position2D","positions3D","width","height","def","loader","is3d","TextureLoader","withCredentials","setWithCredentials","requestHeaders","setRequestHeader","isNormal","document","createElement","isPolygon","createElementNS","isPolyline","isSvg","update","destroy","isPoly","isPolyPx","isPolyRad","getScale","zoomLevel","scale","Array","isArray","zoom","bounds","EASINGS","inQuad","longitude","halfFov","MathUtils","degToRad","prop","hFov","arc","outQuad","max","listContent","content","showTooltip","mousePosition","viewerPos","getPosition","container","box","size","arrow","top","clientY","left","clientX","move","hideTooltip","hide","newType","deepmerge","setAttribute","className","addClasses","style","opacity","parsePosition","__updateNormal","__updatePoly","__updateSvg","__update3d","isExtendedPosition","backgroundImage","innerHTML","transformOrigin","dataHelper","cleanPosition","sphericalCoordsToVector3","cx","cy","rx","ry","each","setAttributeNS","svgStyle","dasherize","fill","actualPoly","splice","coord","sphericalCoords","textureCoordsToSphericalCoords","latitude","centroid","material","MeshBasicMaterial","transparent","depthTest","geometry","PlaneGeometry","mesh","Mesh","userData","Group","add","defineProperty","enumerable","get","children","set","load","texture","anisotropy","needsUpdate","copy","orientation","lookAt","rotateX","rotateY","allowNone","found","keys","MarkersButton","navbar","plugin","getPlugin","on","toggleActive","off","isSupported","handleEvent","e","onClick","show","AbstractButton","pin","MarkersListButton","OPEN_PANEL","CLOSE_PANEL","args","toggleMarkersList","pinList","DEFAULTS","lang","registerButton","MarkersPlugin","options","currentMarker","hoveringMarker","stopObserver","clickEventOnMarker","listButton","hideButton","cursor","mousemove","svgContainer","appendChild","addEventListener","init","CLICK","DOUBLE_CLICK","RENDER","CONFIG_CHANGED","once","READY","setMarkers","clearMarkers","removeChild","__onMouseEnter","__getTargetMarker","target","__onMouseLeave","__onMouseMove","preventDefault","__onClick","renderMarkers","OBJECT_EVENTS","ENTER_OBJECT","detail","originalEvent","LEAVE_OBJECT","HOVER_OBJECT","trigger","toggleAllTooltips","showAllTooltips","hideAllTooltips","getNbMarkers","getMarkers","values","addMarker","render","renderer","scene","__refreshUi","__checkObjectsObserver","getMarker","markerId","getCurrentMarker","updateMarker","removeMarker","remove","removeMarkers","markerIds","forEach","gotoMarker","speed","animate","then","hideMarker","toggleMarker","showMarker","showMarkerPanel","panel","contentId","hideMarkersList","showMarkersList","hideList","change","noMargin","clickHandler","li","getClosest","dataset","getZoomLevel","viewerPosition","isVisible","__getMarkerPosition","__isMarkerVisible","positions","__getPolyPositions","points","pos","__updateMarkerSize","transform","toggleClass","dot","direction","getAttributeNS","removeAttributeNS","getBoundingClientRect","removeClasses","sphericalCoordsToViewerCoords","vector3ToViewerCoords","nbVectors","vector","toBeComputed","neighbours","neighbour","invisible","index","reverse","pair","__getPolyIntermediaryPoint","filter","P1","P2","C","clone","normalize","N","Vector3","crossVectors","V","X","multiplyScalar","Y","H","addVectors","applyAxisAngle","closest","target2","__targetOnTooltip","hasParent","relatedTarget","targetMarker","dblclick","objects","find","o","rightclick","stopPropagation","nbMarkers","m","markersButton","getButton","markersListButton","has3d","some","observeObjects","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;;AACO,MAAMA,MAAM,GAAG;EACpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,gBAAgB,EAAK,kBAPD;;EAQpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAS,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N,KAAT,CAAea,SAAf,CAAyB7U,eAAzB,CAAJ,EAA+C;EAClD,QAAA,IAAA,CAAKiJ,IAAL,CAAU8G,aAAV,GAA0B,IAAKgE,CAAAA,eAAL,CAAqB,IAAK9K,CAAAA,IAAL,CAAU8G,aAA/B,CAA1B,GAA0E,IAAK9J,CAAAA,GAAL,CAAS+N,KAAT,CAAe1J,IAAf,EAA1E,CAAA;EACD,OAAA;EACF,KAAA;EACF,GAAA;EAED;EACF;EACA;EACA;EA74BA,GAAA;;IAAA,MA84BEwI,CAAAA,sBA94BF,GA84BE,SAAyB,sBAAA,GAAA;EACvB,IAAA,IAAM4F,KAAK,GAAGzW,MAAM,CAACuQ,MAAP,CAAc,IAAKrS,CAAAA,OAAnB,CAA4BwY,CAAAA,IAA5B,CAAiC,UAAAnY,MAAM,EAAA;QAAA,OAAIA,MAAM,CAAC0G,IAAP,EAAJ,CAAA;EAAA,KAAvC,CAAd,CAAA;;EAEA,IAAA,IAAI,CAACwR,KAAD,IAAU,KAAKzP,IAAL,CAAUgH,YAAxB,EAAsC;QACpC,IAAKhH,CAAAA,IAAL,CAAUgH,YAAV,EAAA,CAAA;EACA,MAAA,IAAA,CAAKhH,IAAL,CAAUgH,YAAV,GAAyB,IAAzB,CAAA;OAFF,MAIK,IAAIyI,KAAK,IAAI,CAAC,IAAKzP,CAAAA,IAAL,CAAUgH,YAAxB,EAAsC;EACzC,MAAA,IAAA,CAAKhH,IAAL,CAAUgH,YAAV,GAAyB,IAAKhK,CAAAA,GAAL,CAAS2S,cAAT,CAAwB7Y,WAAxB,EAAqC,IAArC,CAAzB,CAAA;EACD,KAAA;KAv5BL,CAAA;;EAAA,EAAA,OAAA,aAAA,CAAA;EAAA,CAAA,CAAmC8Y,gCAAnC,EAAA;EAAahJ,cAEJnP,KAAK;EAFDmP,cAIJ1Q,SAASA;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"markers.js","sources":["../../src/plugins/markers/constants.js","../../src/utils/math.js","../../src/PSVError.js","../../src/utils/psv.js","../../src/plugins/markers/utils.js","../../src/plugins/markers/Marker.js","../../src/plugins/markers/MarkersButton.js","../../src/plugins/markers/MarkersListButton.js","../../src/plugins/markers/index.js"],"sourcesContent":["import icon from './pin-list.svg';\n\n/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.MarkersPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event marker-visibility\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the visibility of a marker changes\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {boolean} visible\n */\n MARKER_VISIBILITY : 'marker-visibility',\n /**\n * @event goto-marker-done\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the animation to a marker is done\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n GOTO_MARKER_DONE : 'goto-marker-done',\n /**\n * @event leave-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor away from a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n LEAVE_MARKER : 'leave-marker',\n /**\n * @event over-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user puts the cursor hover a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n OVER_MARKER : 'over-marker',\n /**\n * @event filter:render-markers-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Used to alter the list of markers displayed on the side-panel\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @returns {PSV.plugins.MarkersPlugin.Marker[]}\n */\n RENDER_MARKERS_LIST: 'render-markers-list',\n /**\n * @event select-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the user clicks on a marker. The marker can be retrieved from outside the event handler\n * with {@link PSV.plugins.MarkersPlugin.getCurrentMarker}\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.plugins.MarkersPlugin.SelectMarkerData} data\n */\n SELECT_MARKER : 'select-marker',\n /**\n * @event select-marker-list\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker is selected from the side panel\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n SELECT_MARKER_LIST : 'select-marker-list',\n /**\n * @event unselect-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when a marker was selected and the user clicks elsewhere\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n */\n UNSELECT_MARKER : 'unselect-marker',\n /**\n * @event hide-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are hidden\n */\n HIDE_MARKERS : 'hide-markers',\n /**\n * @event set-marker\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the list of markers changes\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n */\n SET_MARKERS : 'set-markers',\n /**\n * @event show-markers\n * @memberof PSV.plugins.MarkersPlugin\n * @summary Triggered when the markers are shown\n */\n SHOW_MARKERS : 'show-markers',\n};\n\n/**\n * @summary Types of tooltip events\n * @memberOf PSV.plugins.MarkersPlugin\n * @enum {string}\n * @constant\n * @private\n */\nexport const MARKER_TOOLTIP_TRIGGER = {\n click: 'click',\n hover: 'hover',\n};\n\n/**\n * @summary Namespace for SVG creation\n * @type {string}\n * @constant\n * @private\n */\nexport const SVG_NS = 'http://www.w3.org/2000/svg';\n\n/**\n * @summary Property name added to marker elements\n * @type {string}\n * @constant\n * @private\n */\nexport const MARKER_DATA = 'psvMarker';\n\n/**\n * @summary Panel identifier for marker content\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL_MARKER = 'marker';\n\n/**\n * @summary Panel identifier for markers list\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL_MARKERS_LIST = 'markersList';\n\n/**\n * @summary Markers list template\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @param {string} title\n * @param {string} dataKey\n * @returns {string}\n * @constant\n * @private\n */\nexport const MARKERS_LIST_TEMPLATE = (markers, title, dataKey) => `\n
\n

${icon} ${title}

\n
    \n ${markers.map(marker => `\n
  • \n ${marker.type === 'image' ? `` : ''}\n ${marker.getListContent()}\n
  • \n `).join('')}\n
\n
\n`;\n","/**\n * @summary Ensures that a number is in a given interval\n * @memberOf PSV.utils\n * @param {number} x\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport function bound(x, min, max) {\n return Math.max(min, Math.min(max, x));\n}\n\n/**\n * @summary Ensure a value is within 0 and `max`\n * @param {number} value\n * @param {number} max\n * @return {number}\n */\nexport function loop(value, max) {\n let result = value % max;\n\n if (result < 0) {\n result += max;\n }\n\n return result;\n}\n\n/**\n * @summary Checks if a value is an integer\n * @memberOf PSV.utils\n * @param {*} value\n * @returns {boolean}\n */\nexport function isInteger(value) {\n if (Number.isInteger) {\n return Number.isInteger(value);\n }\n return typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value;\n}\n\n/**\n * @summary Tests if a number is power of two\n * @memberOf PSV.utils\n * @param {number} x\n * @return {boolean}\n */\nexport function isPowerOfTwo(x) {\n return (Math.log(x) / Math.log(2)) % 1 === 0;\n}\n\n/**\n * @summary Computes the sum of an array\n * @memberOf PSV.utils\n * @param {number[]} array\n * @returns {number}\n */\nexport function sum(array) {\n return array.reduce((a, b) => a + b, 0);\n}\n\n/**\n * @summary Computes the distance between two points\n * @memberOf PSV.utils\n * @param {PSV.Point} p1\n * @param {PSV.Point} p2\n * @returns {number}\n */\nexport function distance(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\n\n/**\n * @summary Compute the shortest offset between two longitudes\n * @memberOf PSV.utils\n * @param {number} from\n * @param {number} to\n * @returns {number}\n */\nexport function getShortestArc(from, to) {\n const tCandidates = [\n 0, // direct\n Math.PI * 2, // clock-wise cross zero\n -Math.PI * 2, // counter-clock-wise cross zero\n ];\n\n return tCandidates.reduce((value, candidate) => {\n const newCandidate = to - from + candidate;\n return Math.abs(newCandidate) < Math.abs(value) ? newCandidate : value;\n }, Infinity);\n}\n\n/**\n * @summary Computes the angle between the current position and a target position\n * @memberOf PSV.utils\n * @param {PSV.Position} position1\n * @param {PSV.Position} position2\n * @returns {number}\n */\nexport function getAngle(position1, position2) {\n return Math.acos(\n Math.cos(position1.latitude)\n * Math.cos(position2.latitude)\n * Math.cos(position1.longitude - position2.longitude)\n + Math.sin(position1.latitude)\n * Math.sin(position2.latitude)\n );\n}\n\n/**\n * @summary Returns the distance between two points on a sphere of radius one\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @memberOf PSV.utils\n * @param {number[]} p1\n * @param {number[]} p2\n * @returns {number}\n */\nexport function greatArcDistance(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const x = (λ2 - λ1) * Math.cos((φ1 + φ2) / 2);\n const y = (φ2 - φ1);\n return Math.sqrt(x * x + y * y);\n}\n","/**\n * @summary Custom error used in the lib\n * @param {string} message\n * @constructor\n * @memberOf PSV\n */\nfunction PSVError(message) {\n this.message = message;\n\n // Use V8's native method if available, otherwise fallback\n if ('captureStackTrace' in Error) {\n Error.captureStackTrace(this, PSVError);\n }\n else {\n this.stack = (new Error()).stack;\n }\n}\n\nPSVError.prototype = Object.create(Error.prototype);\nPSVError.prototype.name = 'PSVError';\nPSVError.prototype.constructor = PSVError;\n\nexport { PSVError };\n","import * as THREE from 'three';\nimport { PSVError } from '../PSVError';\nimport { bound, loop } from './math';\n\n/**\n * @summary Returns the plugin constructor from the imported object\n * For retrocompatibility with previous default exports\n * @memberOf PSV.utils\n * @package\n */\nexport function pluginInterop(plugin, target) {\n if (plugin) {\n for (const [, p] of [['_', plugin], ...Object.entries(plugin)]) {\n if (p.prototype instanceof target) {\n return p;\n }\n }\n }\n return null;\n}\n\n/**\n * @summary Builds an Error with name 'AbortError'\n * @memberOf PSV.utils\n * @return {Error}\n */\nexport function getAbortError() {\n const error = new Error('Loading was aborted.');\n error.name = 'AbortError';\n return error;\n}\n\n/**\n * @summary Tests if an Error has name 'AbortError'\n * @memberOf PSV.utils\n * @param {Error} err\n * @return {boolean}\n */\nexport function isAbortError(err) {\n return err?.name === 'AbortError';\n}\n\n/**\n * @summary Displays a warning in the console\n * @memberOf PSV.utils\n * @param {string} message\n */\nexport function logWarn(message) {\n console.warn(`PhotoSphereViewer: ${message}`);\n}\n\n/**\n * @summary Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude\n * @memberOf PSV.utils\n * @param {object} object\n * @returns {boolean}\n */\nexport function isExtendedPosition(object) {\n return [['x', 'y'], ['longitude', 'latitude']].some(([key1, key2]) => {\n return object[key1] !== undefined && object[key2] !== undefined;\n });\n}\n\n/**\n * @summary Returns the value of a given attribute in the panorama metadata\n * @memberOf PSV.utils\n * @param {string} data\n * @param {string} attr\n * @returns (number)\n */\nexport function getXMPValue(data, attr) {\n // XMP data are stored in children\n let result = data.match('(.*)');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n // XMP data are stored in attributes\n result = data.match('GPano:' + attr + '=\"(.*?)\"');\n if (result !== null) {\n const val = parseInt(result[1], 10);\n return isNaN(val) ? null : val;\n }\n\n return null;\n}\n\n/**\n * @readonly\n * @private\n * @type {{top: string, left: string, bottom: string, center: string, right: string}}\n */\nconst CSS_POSITIONS = {\n top : '0%',\n bottom: '100%',\n left : '0%',\n right : '100%',\n center: '50%',\n};\n\n/**\n * @summary Translate CSS values like \"top center\" or \"10% 50%\" as top and left positions\n * @memberOf PSV.utils\n * @description The implementation is as close as possible to the \"background-position\" specification\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}\n * @param {string|PSV.Point} value\n * @returns {PSV.Point}\n */\nexport function parsePosition(value) {\n if (!value) {\n return { x: 0.5, y: 0.5 };\n }\n\n if (typeof value === 'object') {\n return value;\n }\n\n let tokens = value.toLocaleLowerCase().split(' ').slice(0, 2);\n\n if (tokens.length === 1) {\n if (CSS_POSITIONS[tokens[0]] !== undefined) {\n tokens = [tokens[0], 'center'];\n }\n else {\n tokens = [tokens[0], tokens[0]];\n }\n }\n\n const xFirst = tokens[1] !== 'left' && tokens[1] !== 'right' && tokens[0] !== 'top' && tokens[0] !== 'bottom';\n\n tokens = tokens.map(token => CSS_POSITIONS[token] || token);\n\n if (!xFirst) {\n tokens.reverse();\n }\n\n const parsed = tokens.join(' ').match(/^([0-9.]+)% ([0-9.]+)%$/);\n\n if (parsed) {\n return {\n x: parseFloat(parsed[1]) / 100,\n y: parseFloat(parsed[2]) / 100,\n };\n }\n else {\n return { x: 0.5, y: 0.5 };\n }\n}\n\n/**\n * @readonly\n * @private\n */\nconst LEFT_MAP = { 0: 'left', 0.5: 'center', 1: 'right' };\n/**\n * @readonly\n * @private\n */\nconst TOP_MAP = { 0: 'top', 0.5: 'center', 1: 'bottom' };\n\n/**\n * @summary Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center\n * @memberOf PSV.utils\n * @param {string | string[]} value\n * @param {string} defaultValue\n * @param {boolean} [allowCenter=true]\n * @return {string[]}\n */\nexport function cleanPosition(value, defaultValue, allowCenter = true) {\n if (!value) {\n return defaultValue.split(' ');\n }\n\n if (typeof value === 'string') {\n const tempPos = parsePosition(value);\n\n if (!(tempPos.x in LEFT_MAP) || !(tempPos.y in TOP_MAP)) {\n throw new PSVError(`Unable to parse position \"${value}\"`);\n }\n\n value = [TOP_MAP[tempPos.y], LEFT_MAP[tempPos.x]];\n }\n\n if (!allowCenter && value[0] === 'center' && value[1] === 'center') {\n throw new PSVError('Unable to parse position \"center center\"');\n }\n\n return value;\n}\n\n/**\n * @summary Parses an speed\n * @memberOf PSV.utils\n * @param {string|number} speed - The speed, in radians/degrees/revolutions per second/minute\n * @returns {number} radians per second\n * @throws {PSV.PSVError} when the speed cannot be parsed\n */\nexport function parseSpeed(speed) {\n let parsed;\n\n if (typeof speed === 'string') {\n const speedStr = speed.toString().trim();\n\n // Speed extraction\n let speedValue = parseFloat(speedStr.replace(/^(-?[0-9]+(?:\\.[0-9]*)?).*$/, '$1'));\n const speedUnit = speedStr.replace(/^-?[0-9]+(?:\\.[0-9]*)?(.*)$/, '$1').trim();\n\n // \"per minute\" -> \"per second\"\n if (speedUnit.match(/(pm|per minute)$/)) {\n speedValue /= 60;\n }\n\n // Which unit?\n switch (speedUnit) {\n // Degrees per minute / second\n case 'dpm':\n case 'degrees per minute':\n case 'dps':\n case 'degrees per second':\n parsed = THREE.MathUtils.degToRad(speedValue);\n break;\n\n // Radians per minute / second\n case 'rdpm':\n case 'radians per minute':\n case 'rdps':\n case 'radians per second':\n parsed = speedValue;\n break;\n\n // Revolutions per minute / second\n case 'rpm':\n case 'revolutions per minute':\n case 'rps':\n case 'revolutions per second':\n parsed = speedValue * Math.PI * 2;\n break;\n\n // Unknown unit\n default:\n throw new PSVError('Unknown speed unit \"' + speedUnit + '\"');\n }\n }\n else {\n parsed = speed;\n }\n\n return parsed;\n}\n\n/**\n * @summary Parses an angle value in radians or degrees and returns a normalized value in radians\n * @memberOf PSV.utils\n * @param {string|number} angle - eg: 3.14, 3.14rad, 180deg\n * @param {boolean} [zeroCenter=false] - normalize between -Pi - Pi instead of 0 - 2*Pi\n * @param {boolean} [halfCircle=zeroCenter] - normalize between -Pi/2 - Pi/2 instead of -Pi - Pi\n * @returns {number}\n * @throws {PSV.PSVError} when the angle cannot be parsed\n */\nexport function parseAngle(angle, zeroCenter = false, halfCircle = zeroCenter) {\n let parsed;\n\n if (typeof angle === 'string') {\n const match = angle.toLowerCase().trim().match(/^(-?[0-9]+(?:\\.[0-9]*)?)(.*)$/);\n\n if (!match) {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n const value = parseFloat(match[1]);\n const unit = match[2];\n\n if (unit) {\n switch (unit) {\n case 'deg':\n case 'degs':\n parsed = THREE.MathUtils.degToRad(value);\n break;\n case 'rad':\n case 'rads':\n parsed = value;\n break;\n default:\n throw new PSVError('Unknown angle unit \"' + unit + '\"');\n }\n }\n else {\n parsed = value;\n }\n }\n else if (typeof angle === 'number' && !isNaN(angle)) {\n parsed = angle;\n }\n else {\n throw new PSVError('Unknown angle \"' + angle + '\"');\n }\n\n parsed = loop(zeroCenter ? parsed + Math.PI : parsed, Math.PI * 2);\n\n return zeroCenter ? bound(parsed - Math.PI, -Math.PI / (halfCircle ? 2 : 1), Math.PI / (halfCircle ? 2 : 1)) : parsed;\n}\n\n/**\n * @summary Creates a THREE texture from an image\n * @memberOf PSV.utils\n * @param {HTMLImageElement | HTMLCanvasElement} img\n * @return {external:THREE.Texture}\n */\nexport function createTexture(img) {\n const texture = new THREE.Texture(img);\n texture.needsUpdate = true;\n texture.minFilter = THREE.LinearFilter;\n texture.generateMipmaps = false;\n return texture;\n}\n\nconst quaternion = new THREE.Quaternion();\n\n/**\n * @summary Applies the inverse of Euler angles to a vector\n * @memberOf PSV.utils\n * @param {external:THREE.Vector3} vector\n * @param {external:THREE.Euler} euler\n */\nexport function applyEulerInverse(vector, euler) {\n quaternion.setFromEuler(euler).invert();\n vector.applyQuaternion(quaternion);\n}\n","import { CONSTANTS, utils } from '../..';\n\n/**\n * Returns intermediary point between two points on the sphere\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @param {number[]} p1\n * @param {number[]} p2\n * @param {number} f\n * @returns {number[]}\n * @private\n */\nexport function greatArcIntermediaryPoint(p1, p2, f) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const r = utils.greatArcDistance(p1, p2);\n const a = Math.sin((1 - f) * r) / Math.sin(r);\n const b = Math.sin(f * r) / Math.sin(r);\n const x = a * Math.cos(φ1) * Math.cos(λ1) + b * Math.cos(φ2) * Math.cos(λ2);\n const y = a * Math.cos(φ1) * Math.sin(λ1) + b * Math.cos(φ2) * Math.sin(λ2);\n const z = a * Math.sin(φ1) + b * Math.sin(φ2);\n\n return [\n Math.atan2(y, x),\n Math.atan2(z, Math.sqrt(x * x + y * y)),\n ];\n}\n\n/**\n * @summary Computes the center point of a polygon\n * @todo Get \"visual center\" (https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual-center-of-a-polygon-7c77e6492fbc)\n * @param {number[][]} polygon\n * @returns {number[]}\n * @private\n */\nexport function getPolygonCenter(polygon) {\n // apply offsets to avoid crossing the origin\n const workPoints = [polygon[0]];\n\n let k = 0;\n for (let i = 1; i < polygon.length; i++) {\n const d = polygon[i - 1][0] - polygon[i][0];\n if (d > Math.PI) { // crossed the origin left to right\n k += 1;\n }\n else if (d < -Math.PI) { // crossed the origin right to left\n k -= 1;\n }\n workPoints.push([polygon[i][0] + k * 2 * Math.PI, polygon[i][1]]);\n }\n\n const sum = workPoints.reduce((intermediary, point) => [intermediary[0] + point[0], intermediary[1] + point[1]]);\n return [utils.parseAngle(sum[0] / polygon.length), sum[1] / polygon.length];\n}\n\n/**\n * @summary Computes the middle point of a polyline\n * @param {number[][]} polyline\n * @returns {number[]}\n * @private\n */\nexport function getPolylineCenter(polyline) {\n // compute each segment length + total length\n let length = 0;\n const lengths = [];\n\n for (let i = 0; i < polyline.length - 1; i++) {\n const l = utils.greatArcDistance(polyline[i], polyline[i + 1]) * CONSTANTS.SPHERE_RADIUS;\n\n lengths.push(l);\n length += l;\n }\n\n // iterate until length / 2\n let consumed = 0;\n\n for (let j = 0; j < polyline.length - 1; j++) {\n // once the segment containing the middle point is found, computes the intermediary point\n if (consumed + lengths[j] > length / 2) {\n const r = (length / 2 - consumed) / lengths[j];\n return greatArcIntermediaryPoint(polyline[j], polyline[j + 1], r);\n }\n\n consumed += lengths[j];\n }\n\n // this never happens\n return polyline[Math.round(polyline.length / 2)];\n}\n","import * as THREE from 'three';\nimport { CONSTANTS, PSVError, utils } from '../..';\nimport { getShortestArc, logWarn } from '../../utils';\nimport { MARKER_DATA, MARKER_TOOLTIP_TRIGGER, SVG_NS } from './constants';\nimport { getPolygonCenter, getPolylineCenter } from './utils';\n\n/**\n * @summary Types of marker\n * @memberOf PSV.plugins.MarkersPlugin\n * @enum {string}\n * @constant\n * @private\n */\nconst MARKER_TYPES = {\n image : 'image',\n imageLayer : 'imageLayer',\n html : 'html',\n polygonPx : 'polygonPx',\n polygonRad : 'polygonRad',\n polylinePx : 'polylinePx',\n polylineRad: 'polylineRad',\n square : 'square',\n rect : 'rect',\n circle : 'circle',\n ellipse : 'ellipse',\n path : 'path',\n};\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Properties\n * @summary Marker properties, see {@link https://photo-sphere-viewer.js.org/plugins/plugin-markers.html#markers-options}\n */\n\n/**\n * @summary Object representing a marker\n * @memberOf PSV.plugins.MarkersPlugin\n */\nexport class Marker {\n\n /**\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {PSV.Viewer} psv\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n constructor(properties, psv) {\n if (!properties.id) {\n throw new PSVError('missing marker id');\n }\n\n /**\n * @member {PSV.Viewer}\n * @readonly\n * @protected\n */\n this.psv = psv;\n\n /**\n * @member {string}\n * @readonly\n */\n this.id = properties.id;\n\n /**\n * @member {string}\n * @readonly\n */\n this.type = Marker.getType(properties, false);\n\n /**\n * @member {boolean}\n * @protected\n */\n this.visible = true;\n\n /**\n * @member {HTMLElement|SVGElement|THREE.Object3D}\n * @readonly\n */\n this.$el = null;\n\n /**\n * @summary Original configuration of the marker\n * @member {PSV.plugins.MarkersPlugin.Properties}\n * @readonly\n */\n this.config = {};\n\n /**\n * @summary User data associated to the marker\n * @member {any}\n */\n this.data = undefined;\n\n /**\n * @summary Tooltip instance for this marker\n * @member {PSV.components.Tooltip}\n */\n this.tooltip = null;\n\n /**\n * @summary Computed properties\n * @member {Object}\n * @protected\n * @property {boolean} dynamicSize\n * @property {PSV.Point} anchor\n * @property {boolean} visible - actually visible in the view\n * @property {boolean} staticTooltip - the tooltip must always be shown\n * @property {PSV.Position} position - position in spherical coordinates\n * @property {PSV.Point} position2D - position in viewer coordinates\n * @property {external:THREE.Vector3[]} positions3D - positions in 3D space\n * @property {number} width\n * @property {number} height\n * @property {*} def\n */\n this.props = {\n dynamicSize : false,\n anchor : null,\n visible : false,\n staticTooltip: false,\n position : null,\n position2D : null,\n positions3D : null,\n width : null,\n height : null,\n def : null,\n };\n\n /**\n * @summary THREE file loader\n * @type {THREE:TextureLoader}\n * @private\n */\n this.loader = null;\n\n if (this.is3d()) {\n this.loader = new THREE.TextureLoader();\n if (this.psv.config.withCredentials) {\n this.loader.setWithCredentials(true);\n }\n if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'object') {\n this.loader.setRequestHeader(this.psv.config.requestHeaders);\n }\n }\n\n // create element\n if (this.isNormal()) {\n this.$el = document.createElement('div');\n }\n else if (this.isPolygon()) {\n this.$el = document.createElementNS(SVG_NS, 'polygon');\n }\n else if (this.isPolyline()) {\n this.$el = document.createElementNS(SVG_NS, 'polyline');\n }\n else if (this.isSvg()) {\n this.$el = document.createElementNS(SVG_NS, this.type);\n }\n\n if (!this.is3d()) {\n this.$el.id = `psv-marker-${this.id}`;\n this.$el[MARKER_DATA] = this;\n }\n\n this.update(properties);\n }\n\n /**\n * @summary Destroys the marker\n */\n destroy() {\n delete this.$el[MARKER_DATA];\n delete this.$el;\n delete this.config;\n delete this.props;\n delete this.psv;\n }\n\n /**\n * @summary Checks if it is a 3D marker (imageLayer)\n * @returns {boolean}\n */\n is3d() {\n return this.type === MARKER_TYPES.imageLayer;\n }\n\n /**\n * @summary Checks if it is a normal marker (image or html)\n * @returns {boolean}\n */\n isNormal() {\n return this.type === MARKER_TYPES.image\n || this.type === MARKER_TYPES.html;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline marker\n * @returns {boolean}\n */\n isPoly() {\n return this.isPolygon()\n || this.isPolyline();\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using pixel coordinates\n * @returns {boolean}\n */\n isPolyPx() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polylinePx;\n }\n\n /**\n * @summary Checks if it is a polygon/polyline using radian coordinates\n * @returns {boolean}\n */\n isPolyRad() {\n return this.type === MARKER_TYPES.polygonRad\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is a polygon marker\n * @returns {boolean}\n */\n isPolygon() {\n return this.type === MARKER_TYPES.polygonPx\n || this.type === MARKER_TYPES.polygonRad;\n }\n\n /**\n * @summary Checks if it is a polyline marker\n * @returns {boolean}\n */\n isPolyline() {\n return this.type === MARKER_TYPES.polylinePx\n || this.type === MARKER_TYPES.polylineRad;\n }\n\n /**\n * @summary Checks if it is an SVG marker\n * @returns {boolean}\n */\n isSvg() {\n return this.type === MARKER_TYPES.square\n || this.type === MARKER_TYPES.rect\n || this.type === MARKER_TYPES.circle\n || this.type === MARKER_TYPES.ellipse\n || this.type === MARKER_TYPES.path;\n }\n\n /**\n * @summary Computes marker scale from zoom level\n * @param {number} zoomLevel\n * @param {PSV.Position} position\n * @returns {number}\n */\n getScale(zoomLevel, position) {\n if (!this.config.scale) {\n return 1;\n }\n if (typeof this.config.scale === 'function') {\n return this.config.scale(zoomLevel, position);\n }\n\n let scale = 1;\n if (Array.isArray(this.config.scale.zoom)) {\n const bounds = this.config.scale.zoom;\n scale *= bounds[0] + (bounds[1] - bounds[0]) * CONSTANTS.EASINGS.inQuad(zoomLevel / 100);\n }\n if (Array.isArray(this.config.scale.longitude)) {\n const bounds = this.config.scale.longitude;\n const halfFov = THREE.MathUtils.degToRad(this.psv.prop.hFov) / 2;\n const arc = Math.abs(getShortestArc(this.props.position.longitude, position.longitude));\n scale *= bounds[1] + (bounds[0] - bounds[1]) * CONSTANTS.EASINGS.outQuad(Math.max(0, (halfFov - arc) / halfFov));\n }\n return scale;\n }\n\n /**\n * @summary Returns the markers list content for the marker, it can be either :\n * - the `listContent`\n * - the `tooltip.content`\n * - the `html`\n * - the `id`\n * @returns {*}\n */\n getListContent() {\n if (this.config.listContent) {\n return this.config.listContent;\n }\n else if (this.config.tooltip.content) {\n return this.config.tooltip.content;\n }\n else if (this.config.html) {\n return this.config.html;\n }\n else {\n return this.id;\n }\n }\n\n /**\n * @summary Display the tooltip of this marker\n * @param {{clientX: number, clientY: number}} [mousePosition]\n */\n showTooltip(mousePosition) {\n if (this.props.visible && this.config.tooltip.content && this.props.position2D) {\n const config = {\n ...this.config.tooltip,\n data: this,\n };\n\n if (this.isPoly()) {\n const viewerPos = utils.getPosition(this.psv.container);\n\n config.box = { // separate the tooltip from the cursor\n width : this.psv.tooltip.size.arrow * 2,\n height: this.psv.tooltip.size.arrow * 2,\n };\n\n if (mousePosition) {\n config.top = mousePosition.clientY - viewerPos.top - this.psv.tooltip.size.arrow / 2;\n config.left = mousePosition.clientX - viewerPos.left - this.psv.tooltip.size.arrow;\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n }\n }\n else {\n config.top = this.props.position2D.y;\n config.left = this.props.position2D.x;\n config.box = {\n width : this.props.width,\n height: this.props.height,\n };\n }\n\n if (this.tooltip) {\n this.tooltip.move(config);\n }\n else {\n this.tooltip = this.psv.tooltip.create(config);\n }\n }\n }\n\n /**\n * @summary Recompute the position of the tooltip\n */\n refreshTooltip() {\n if (this.tooltip) {\n this.showTooltip();\n }\n }\n\n /**\n * @summary Hides the tooltip of this marker\n */\n hideTooltip() {\n if (this.tooltip) {\n this.tooltip.hide();\n this.tooltip = null;\n }\n }\n\n /**\n * @summary Updates the marker with new properties\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n update(properties) {\n const newType = Marker.getType(properties, true);\n\n if (newType !== undefined && newType !== this.type) {\n throw new PSVError('cannot change marker type');\n }\n\n utils.deepmerge(this.config, properties);\n if (typeof this.config.tooltip === 'string') {\n this.config.tooltip = { content: this.config.tooltip };\n }\n if (!this.config.tooltip) {\n this.config.tooltip = {};\n }\n if (!this.config.tooltip.trigger) {\n this.config.tooltip.trigger = MARKER_TOOLTIP_TRIGGER.hover;\n }\n\n this.data = this.config.data;\n this.visible = this.config.visible !== false;\n\n if (!this.is3d()) {\n // reset CSS class\n if (this.isNormal()) {\n this.$el.setAttribute('class', 'psv-marker psv-marker--normal');\n }\n else {\n this.$el.setAttribute('class', 'psv-marker psv-marker--svg');\n }\n\n // add CSS classes\n if (this.config.className) {\n utils.addClasses(this.$el, this.config.className);\n }\n\n if (this.config.tooltip) {\n utils.addClasses(this.$el, 'psv-marker--has-tooltip');\n }\n if (this.config.content) {\n utils.addClasses(this.$el, 'psv-marler--has-content');\n }\n\n // apply style\n this.$el.style.opacity = this.config.opacity ?? 1;\n if (this.config.style) {\n utils.deepmerge(this.$el.style, this.config.style);\n }\n }\n\n // parse anchor\n this.props.anchor = utils.parsePosition(this.config.anchor);\n\n // clean scale\n if (this.config.scale) {\n if (typeof this.config.scale === 'number') {\n logWarn('Single value marker scale is deprecated, please use an array of two values.');\n this.config.scale = { zoom: [0, this.config.scale] };\n }\n if (Array.isArray(this.config.scale)) {\n this.config.scale = { zoom: this.config.scale };\n }\n }\n\n if (this.isNormal()) {\n this.__updateNormal();\n }\n else if (this.isPoly()) {\n this.__updatePoly();\n }\n else if (this.isSvg()) {\n this.__updateSvg();\n }\n else if (this.is3d()) {\n this.__update3d();\n }\n }\n\n /**\n * @summary Updates a normal marker\n * @private\n */\n __updateNormal() {\n if (!utils.isExtendedPosition(this.config)) {\n throw new PSVError('missing marker position, latitude/longitude or x/y');\n }\n\n if (this.config.image && (!this.config.width || !this.config.height)) {\n throw new PSVError('missing marker width/height');\n }\n\n if (this.config.width && this.config.height) {\n this.props.dynamicSize = false;\n this.props.width = this.config.width;\n this.props.height = this.config.height;\n this.$el.style.width = this.config.width + 'px';\n this.$el.style.height = this.config.height + 'px';\n }\n else {\n this.props.dynamicSize = true;\n }\n\n if (this.config.image) {\n this.props.def = this.config.image;\n this.$el.style.backgroundImage = `url(${this.config.image})`;\n }\n else if (this.config.html) {\n this.props.def = this.config.html;\n this.$el.innerHTML = this.config.html;\n }\n\n // set anchor\n this.$el.style.transformOrigin = `${this.props.anchor.x * 100}% ${this.props.anchor.y * 100}%`;\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates an SVG marker\n * @private\n */\n __updateSvg() {\n if (!utils.isExtendedPosition(this.config)) {\n throw new PSVError('missing marker position, latitude/longitude or x/y');\n }\n\n this.props.dynamicSize = true;\n\n // set content\n switch (this.type) {\n case MARKER_TYPES.square:\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.square,\n height: this.config.square,\n };\n break;\n\n case MARKER_TYPES.rect:\n if (Array.isArray(this.config.rect)) {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect[0],\n height: this.config.rect[1],\n };\n }\n else {\n this.props.def = {\n x : 0,\n y : 0,\n width : this.config.rect.width,\n height: this.config.rect.height,\n };\n }\n break;\n\n case MARKER_TYPES.circle:\n this.props.def = {\n cx: this.config.circle,\n cy: this.config.circle,\n r : this.config.circle,\n };\n break;\n\n case MARKER_TYPES.ellipse:\n if (Array.isArray(this.config.ellipse)) {\n this.props.def = {\n cx: this.config.ellipse[0],\n cy: this.config.ellipse[1],\n rx: this.config.ellipse[0],\n ry: this.config.ellipse[1],\n };\n }\n else {\n this.props.def = {\n cx: this.config.ellipse.rx,\n cy: this.config.ellipse.ry,\n rx: this.config.ellipse.rx,\n ry: this.config.ellipse.ry,\n };\n }\n break;\n\n case MARKER_TYPES.path:\n this.props.def = {\n d: this.config.path,\n };\n break;\n\n // no default\n }\n\n utils.each(this.props.def, (value, prop) => {\n this.$el.setAttributeNS(null, prop, value);\n });\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n }\n else {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n }\n\n /**\n * @summary Updates a polygon marker\n * @private\n */\n __updatePoly() {\n this.props.dynamicSize = true;\n\n // set style\n if (this.config.svgStyle) {\n utils.each(this.config.svgStyle, (value, prop) => {\n this.$el.setAttributeNS(null, utils.dasherize(prop), value);\n });\n\n if (this.isPolyline() && !this.config.svgStyle.fill) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n }\n }\n else if (this.isPolygon()) {\n this.$el.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n }\n else if (this.isPolyline()) {\n this.$el.setAttributeNS(null, 'fill', 'none');\n this.$el.setAttributeNS(null, 'stroke', 'rgb(0,0,0)');\n }\n\n // fold arrays: [1,2,3,4] => [[1,2],[3,4]]\n const actualPoly = this.config.polygonPx || this.config.polygonRad || this.config.polylinePx || this.config.polylineRad;\n if (!Array.isArray(actualPoly[0])) {\n for (let i = 0; i < actualPoly.length; i++) {\n actualPoly.splice(i, 2, [actualPoly[i], actualPoly[i + 1]]);\n }\n }\n\n // convert texture coordinates to spherical coordinates\n if (this.isPolyPx()) {\n this.props.def = actualPoly.map((coord) => {\n const sphericalCoords = this.psv.dataHelper.textureCoordsToSphericalCoords({ x: coord[0], y: coord[1] });\n return [sphericalCoords.longitude, sphericalCoords.latitude];\n });\n }\n // clean angles\n else {\n this.props.def = actualPoly.map((coord) => {\n return [utils.parseAngle(coord[0]), utils.parseAngle(coord[1], true)];\n });\n }\n\n const centroid = this.isPolygon()\n ? getPolygonCenter(this.props.def)\n : getPolylineCenter(this.props.def);\n\n this.props.position = {\n longitude: centroid[0],\n latitude : centroid[1],\n };\n\n // compute x/y/z positions\n this.props.positions3D = this.props.def.map((coord) => {\n return this.psv.dataHelper.sphericalCoordsToVector3({ longitude: coord[0], latitude: coord[1] });\n });\n }\n\n /**\n * @summary Updates a 3D marker\n * @private\n */\n __update3d() {\n if (!this.config.width || !this.config.height) {\n throw new PSVError('missing marker width/height');\n }\n\n this.props.dynamicSize = false;\n this.props.width = this.config.width;\n this.props.height = this.config.height;\n\n // convert texture coordinates to spherical coordinates\n this.props.position = this.psv.dataHelper.cleanPosition(this.config);\n\n // compute x/y/z position\n this.props.positions3D = [this.psv.dataHelper.sphericalCoordsToVector3(this.props.position)];\n\n switch (this.type) {\n case MARKER_TYPES.imageLayer:\n if (!this.$el) {\n const material = new THREE.MeshBasicMaterial({\n transparent: true,\n opacity : this.config.opacity ?? 1,\n depthTest : false,\n });\n const geometry = new THREE.PlaneGeometry(1, 1);\n const mesh = new THREE.Mesh(geometry, material);\n mesh.userData = { [MARKER_DATA]: this };\n this.$el = new THREE.Group().add(mesh);\n\n // overwrite the visible property to be tied to the Marker instance\n // and do it without context bleed\n Object.defineProperty(this.$el, 'visible', {\n enumerable: true,\n get : function () {\n return this.children[0].userData[MARKER_DATA].visible;\n },\n set : function (visible) {\n this.children[0].userData[MARKER_DATA].visible = visible;\n },\n });\n }\n\n if (this.props.def !== this.config.imageLayer) {\n if (this.psv.config.requestHeaders && typeof this.psv.config.requestHeaders === 'function') {\n this.loader.setRequestHeader(this.psv.config.requestHeaders(this.config.imageLayer));\n }\n this.$el.children[0].material.map = this.loader.load(this.config.imageLayer, (texture) => {\n texture.anisotropy = 4;\n this.psv.needsUpdate();\n });\n this.props.def = this.config.imageLayer;\n }\n\n this.$el.children[0].position.set(\n this.props.anchor.x - 0.5,\n this.props.anchor.y - 0.5,\n 0\n );\n\n this.$el.position.copy(this.props.positions3D[0]);\n\n switch (this.config.orientation) {\n case 'horizontal':\n this.$el.lookAt(0, this.$el.position.y, 0);\n this.$el.rotateX(this.props.position.latitude < 0 ? -Math.PI / 2 : Math.PI / 2);\n break;\n case 'vertical-left':\n this.$el.lookAt(0, 0, 0);\n this.$el.rotateY(-Math.PI * 0.4);\n break;\n case 'vertical-right':\n this.$el.lookAt(0, 0, 0);\n this.$el.rotateY(Math.PI * 0.4);\n break;\n default:\n this.$el.lookAt(0, 0, 0);\n break;\n }\n\n // 100 is magic number that gives a coherent size at default zoom level\n this.$el.scale.set(this.config.width / 100, this.config.height / 100, 1);\n break;\n\n // no default\n }\n }\n\n /**\n * @summary Determines the type of a marker by the available properties\n * @param {Marker.Properties} properties\n * @param {boolean} [allowNone=false]\n * @returns {string}\n * @throws {PSV.PSVError} when the marker's type cannot be found\n */\n static getType(properties, allowNone = false) {\n const found = [];\n\n utils.each(MARKER_TYPES, (type) => {\n if (properties[type]) {\n found.push(type);\n }\n });\n\n if (found.length === 0 && !allowNone) {\n throw new PSVError(`missing marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n else if (found.length > 1) {\n throw new PSVError(`multiple marker content, either ${Object.keys(MARKER_TYPES).join(', ')}`);\n }\n\n return found[0];\n }\n\n}\n","import { AbstractButton } from '../..';\nimport { EVENTS } from './constants';\nimport pin from './pin.svg';\n\n/**\n * @summary Navigation bar markers button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersButton extends AbstractButton {\n\n static id = 'markers';\n static icon = pin;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin('markers');\n\n if (this.plugin) {\n this.plugin.on(EVENTS.SHOW_MARKERS, this);\n this.plugin.on(EVENTS.HIDE_MARKERS, this);\n\n this.toggleActive(true);\n }\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n if (this.plugin) {\n this.plugin.off(EVENTS.SHOW_MARKERS, this);\n this.plugin.off(EVENTS.HIDE_MARKERS, this);\n }\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case EVENTS.SHOW_MARKERS: this.toggleActive(true); break;\n case EVENTS.HIDE_MARKERS: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers\n */\n onClick() {\n if (this.plugin.prop.visible) {\n this.plugin.hide();\n }\n else {\n this.plugin.show();\n }\n }\n\n}\n","import { AbstractButton, CONSTANTS } from '../..';\nimport { ID_PANEL_MARKERS_LIST } from './constants';\nimport pinList from './pin-list.svg';\n\n/**\n * @summary Navigation bar markers list button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class MarkersListButton extends AbstractButton {\n\n static id = 'markersList';\n static icon = pinList;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-markers-list-button', true);\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n */\n this.plugin = this.psv.getPlugin('markers');\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === ID_PANEL_MARKERS_LIST); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles markers list\n */\n onClick() {\n this.plugin.toggleMarkersList();\n }\n\n}\n","import * as THREE from 'three';\nimport { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..';\nimport {\n EVENTS,\n ID_PANEL_MARKER,\n ID_PANEL_MARKERS_LIST,\n MARKER_DATA,\n MARKER_TOOLTIP_TRIGGER,\n MARKERS_LIST_TEMPLATE,\n SVG_NS\n} from './constants';\nimport { Marker } from './Marker';\nimport { MarkersButton } from './MarkersButton';\nimport { MarkersListButton } from './MarkersListButton';\nimport './style.scss';\n\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.Options\n * @property {boolean} [clickEventOnMarker=false] If a `click` event is triggered on the viewer additionally to the `select-marker` event.\n * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers]\n */\n\n/**\n * @typedef {Object} PSV.plugins.MarkersPlugin.SelectMarkerData\n * @summary Data of the `select-marker` event\n * @property {boolean} dblclick - if the selection originated from a double click, the simple click is always fired before the double click\n * @property {boolean} rightclick - if the selection originated from a right click\n */\n\n\n// add markers buttons\nDEFAULTS.lang[MarkersButton.id] = 'Markers';\nDEFAULTS.lang[MarkersListButton.id] = 'Markers list';\nregisterButton(MarkersButton, 'caption:left');\nregisterButton(MarkersListButton, 'caption:left');\n\n\nexport { EVENTS } from './constants';\n\n\n/**\n * @summary Displays various markers on the viewer\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class MarkersPlugin extends AbstractPlugin {\n\n static id = 'markers';\n\n static EVENTS = EVENTS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.MarkersPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @summary All registered markers\n * @member {Object}\n */\n this.markers = {};\n\n /**\n * @type {Object}\n * @property {boolean} visible - Visibility of the component\n * @property {PSV.plugins.MarkersPlugin.Marker} currentMarker - Last selected marker\n * @property {PSV.plugins.MarkersPlugin.Marker} hoveringMarker - Marker under the cursor\n * @private\n */\n this.prop = {\n visible : true,\n currentMarker : null,\n hoveringMarker: null,\n stopObserver : null,\n };\n\n /**\n * @type {PSV.plugins.MarkersPlugin.Options}\n */\n this.config = {\n clickEventOnMarker: false,\n ...options,\n };\n\n if (options?.listButton === false || options?.hideButton === false) {\n utils.logWarn('MarkersPlugin: listButton and hideButton options are deprecated. '\n + 'Please define the global navbar options according to your needs.');\n }\n\n /**\n * @member {HTMLElement}\n * @readonly\n */\n this.container = document.createElement('div');\n this.container.className = 'psv-markers';\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n\n /**\n * @member {SVGElement}\n * @readonly\n */\n this.svgContainer = document.createElementNS(SVG_NS, 'svg');\n this.svgContainer.setAttribute('class', 'psv-markers-svg-container');\n this.container.appendChild(this.svgContainer);\n\n // Markers events via delegation\n this.container.addEventListener('mouseenter', this, true);\n this.container.addEventListener('mouseleave', this, true);\n this.container.addEventListener('mousemove', this, true);\n this.container.addEventListener('contextmenu', this);\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.psv.container.appendChild(this.container);\n\n // Viewer events\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.RENDER, this);\n this.psv.on(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n if (this.config.markers) {\n this.psv.once(CONSTANTS.EVENTS.READY, () => {\n this.setMarkers(this.config.markers);\n delete this.config.markers;\n });\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.clearMarkers(false);\n\n this.prop.stopObserver?.();\n\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.DOUBLE_CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.RENDER, this);\n this.psv.off(CONSTANTS.EVENTS.CONFIG_CHANGED, this);\n\n this.psv.container.removeChild(this.container);\n\n delete this.svgContainer;\n delete this.markers;\n delete this.container;\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case 'mouseenter': this.__onMouseEnter(e, this.__getTargetMarker(e.target)); break;\n case 'mouseleave': this.__onMouseLeave(e, this.__getTargetMarker(e.target)); break;\n case 'mousemove': this.__onMouseMove(e, this.__getTargetMarker(e.target)); break;\n case 'contextmenu': e.preventDefault(); break;\n case CONSTANTS.EVENTS.CLICK: this.__onClick(e, e.args[0], false); break;\n case CONSTANTS.EVENTS.DOUBLE_CLICK: this.__onClick(e, e.args[0], true); break;\n case CONSTANTS.EVENTS.RENDER: this.renderMarkers(); break;\n case CONSTANTS.OBJECT_EVENTS.ENTER_OBJECT: this.__onMouseEnter(e.detail.originalEvent, e.detail.data); break;\n case CONSTANTS.OBJECT_EVENTS.LEAVE_OBJECT: this.__onMouseLeave(e.detail.originalEvent, e.detail.data); break;\n case CONSTANTS.OBJECT_EVENTS.HOVER_OBJECT: this.__onMouseMove(e.detail.originalEvent, e.detail.data); break;\n case CONSTANTS.EVENTS.CONFIG_CHANGED:\n this.container.style.cursor = this.psv.config.mousemove ? 'move' : 'default';\n break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @summary Shows all markers\n * @fires PSV.plugins.MarkersPlugin.show-markers\n */\n show() {\n this.prop.visible = true;\n\n this.renderMarkers();\n\n this.trigger(EVENTS.SHOW_MARKERS);\n }\n\n /**\n * @summary Hides all markers\n * @fires PSV.plugins.MarkersPlugin.hide-markers\n */\n hide() {\n this.prop.visible = false;\n\n this.renderMarkers();\n\n this.trigger(EVENTS.HIDE_MARKERS);\n }\n\n /**\n * @summary Toggles the visibility of all tooltips\n */\n toggleAllTooltips() {\n if (this.prop.showAllTooltips) {\n this.hideAllTooltips();\n }\n else {\n this.showAllTooltips();\n }\n }\n\n /**\n * @summary Displays all tooltips\n */\n showAllTooltips() {\n this.prop.showAllTooltips = true;\n utils.each(this.markers, (marker) => {\n marker.props.staticTooltip = true;\n marker.showTooltip();\n });\n }\n\n /**\n * @summary Hides all tooltips\n */\n hideAllTooltips() {\n this.prop.showAllTooltips = false;\n utils.each(this.markers, (marker) => {\n marker.props.staticTooltip = false;\n marker.hideTooltip();\n });\n }\n\n /**\n * @summary Returns the total number of markers\n * @returns {number}\n */\n getNbMarkers() {\n return Object.keys(this.markers).length;\n }\n\n /**\n * @summary Returns all the markers\n * @return {PSV.plugins.MarkersPlugin.Marker[]}\n */\n getMarkers() {\n return Object.values(this.markers);\n }\n\n /**\n * @summary Adds a new marker to viewer\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker's id is missing or already exists\n */\n addMarker(properties, render = true) {\n if (this.markers[properties.id]) {\n throw new PSVError(`marker \"${properties.id}\" already exists`);\n }\n\n const marker = new Marker(properties, this.psv);\n\n if (marker.isNormal()) {\n this.container.appendChild(marker.$el);\n }\n else if (marker.isPoly() || marker.isSvg()) {\n this.svgContainer.appendChild(marker.$el);\n }\n else if (marker.is3d()) {\n this.psv.renderer.scene.add(marker.$el);\n }\n\n this.markers[marker.id] = marker;\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n\n return marker;\n }\n\n /**\n * @summary Returns the internal marker object for a marker id\n * @param {string} markerId\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @throws {PSV.PSVError} when the marker cannot be found\n */\n getMarker(markerId) {\n const id = typeof markerId === 'object' ? markerId.id : markerId;\n\n if (!this.markers[id]) {\n throw new PSVError(`cannot find marker \"${id}\"`);\n }\n\n return this.markers[id];\n }\n\n /**\n * @summary Returns the last marker selected by the user\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n getCurrentMarker() {\n return this.prop.currentMarker;\n }\n\n /**\n * @summary Updates the existing marker with the same id\n * @description Every property can be changed but you can't change its type (Eg: `image` to `html`).\n * @param {PSV.plugins.MarkersPlugin.Properties} properties\n * @param {boolean} [render=true] - renders the marker immediately\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n */\n updateMarker(properties, render = true) {\n const marker = this.getMarker(properties.id);\n\n marker.update(properties);\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n\n if (marker.is3d()) {\n this.psv.needsUpdate();\n }\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n\n return marker;\n }\n\n /**\n * @summary Removes a marker from the viewer\n * @param {string} markerId\n * @param {boolean} [render=true] - renders the marker immediately\n */\n removeMarker(markerId, render = true) {\n const marker = this.getMarker(markerId);\n\n if (marker.isNormal()) {\n this.container.removeChild(marker.$el);\n }\n else if (marker.isPoly() || marker.isSvg()) {\n this.svgContainer.removeChild(marker.$el);\n }\n else if (marker.is3d()) {\n this.psv.renderer.scene.remove(marker.$el);\n this.psv.needsUpdate();\n }\n\n if (this.prop.hoveringMarker === marker) {\n this.prop.hoveringMarker = null;\n }\n\n if (this.prop.currentMarker === marker) {\n this.prop.currentMarker = null;\n }\n\n marker.hideTooltip();\n\n marker.destroy();\n delete this.markers[marker.id];\n\n if (render) {\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Removes multiple markers\n * @param {string[]} markerIds\n * @param {boolean} [render=true] - renders the markers immediately\n */\n removeMarkers(markerIds, render = true) {\n markerIds.forEach(markerId => this.removeMarker(markerId, false));\n\n if (render) {\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Replaces all markers\n * @param {PSV.plugins.MarkersPlugin.Properties[]} markers\n * @param {boolean} [render=true] - renders the marker immediately\n */\n setMarkers(markers, render = true) {\n this.clearMarkers(false);\n\n utils.each(markers, marker => this.addMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Removes all markers\n * @param {boolean} [render=true] - renders the markers immediately\n */\n clearMarkers(render = true) {\n utils.each(this.markers, marker => this.removeMarker(marker, false));\n\n if (render) {\n this.renderMarkers();\n this.__refreshUi();\n this.__checkObjectsObserver();\n\n this.trigger(EVENTS.SET_MARKERS, this.getMarkers());\n }\n }\n\n /**\n * @summary Rotate the view to face the marker\n * @param {string} markerId\n * @param {string|number} [speed] - rotates smoothy, see {@link PSV.Viewer#animate}\n * @fires PSV.plugins.MarkersPlugin.goto-marker-done\n * @return {PSV.Animation} A promise that will be resolved when the animation finishes\n */\n gotoMarker(markerId, speed) {\n const marker = this.getMarker(markerId);\n\n return this.psv.animate({\n ...marker.props.position,\n speed,\n })\n .then(() => {\n this.trigger(EVENTS.GOTO_MARKER_DONE, marker);\n });\n }\n\n /**\n * @summary Hides a marker\n * @param {string} markerId\n */\n hideMarker(markerId) {\n this.toggleMarker(markerId, false);\n }\n\n /**\n * @summary Shows a marker\n * @param {string} markerId\n */\n showMarker(markerId) {\n this.toggleMarker(markerId, true);\n }\n\n /**\n * @summary Forces the display of the tooltip\n * @param {string} markerId\n */\n showMarkerTooltip(markerId) {\n const marker = this.getMarker(markerId);\n marker.props.staticTooltip = true;\n marker.showTooltip();\n }\n\n /**\n * @summary Hides the tooltip\n * @param {string} markerId\n */\n hideMarkerTooltip(markerId) {\n const marker = this.getMarker(markerId);\n marker.props.staticTooltip = false;\n marker.hideTooltip();\n }\n\n /**\n * @summary Toggles a marker\n * @param {string} markerId\n * @param {boolean} [visible]\n */\n toggleMarker(markerId, visible = null) {\n const marker = this.getMarker(markerId);\n marker.visible = visible === null ? !marker.visible : visible;\n if (marker.is3d()) {\n this.psv.needsUpdate();\n }\n else {\n this.renderMarkers();\n }\n }\n\n /**\n * @summary Opens the panel with the content of the marker\n * @param {string} markerId\n */\n showMarkerPanel(markerId) {\n const marker = this.getMarker(markerId);\n\n if (marker?.config?.content) {\n this.psv.panel.show({\n id : ID_PANEL_MARKER,\n content: marker.config.content,\n });\n }\n else {\n this.psv.panel.hide(ID_PANEL_MARKER);\n }\n }\n\n /**\n * @summary Toggles the visibility of the list of markers\n */\n toggleMarkersList() {\n if (this.psv.panel.prop.contentId === ID_PANEL_MARKERS_LIST) {\n this.hideMarkersList();\n }\n else {\n this.showMarkersList();\n }\n }\n\n /**\n * @summary Opens side panel with the list of markers\n * @fires PSV.plugins.MarkersPlugin.filter:render-markers-list\n */\n showMarkersList() {\n let markers = [];\n utils.each(this.markers, (marker) => {\n if (marker.visible && !marker.config.hideList) {\n markers.push(marker);\n }\n });\n\n markers = this.change(EVENTS.RENDER_MARKERS_LIST, markers);\n\n this.psv.panel.show({\n id : ID_PANEL_MARKERS_LIST,\n content : MARKERS_LIST_TEMPLATE(\n markers,\n this.psv.config.lang[MarkersButton.id],\n utils.dasherize(MARKER_DATA)\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const markerId = li ? li.dataset[MARKER_DATA] : undefined;\n\n if (markerId) {\n const marker = this.getMarker(markerId);\n\n this.trigger(EVENTS.SELECT_MARKER_LIST, marker);\n\n this.gotoMarker(marker, 1000);\n this.hideMarkersList();\n }\n },\n });\n }\n\n /**\n * @summary Closes side panel if it contains the list of markers\n */\n hideMarkersList() {\n this.psv.panel.hide(ID_PANEL_MARKERS_LIST);\n }\n\n /**\n * @summary Updates the visibility and the position of all markers\n */\n renderMarkers() {\n const zoomLevel = this.psv.getZoomLevel();\n const viewerPosition = this.psv.getPosition();\n\n utils.each(this.markers, (marker) => {\n let isVisible = this.prop.visible && marker.visible;\n let visibilityChanged = false;\n let position = null;\n\n if (isVisible && marker.is3d()) {\n position = this.__getMarkerPosition(marker);\n isVisible = this.__isMarkerVisible(marker, position);\n }\n else if (isVisible && marker.isPoly()) {\n const positions = this.__getPolyPositions(marker);\n isVisible = positions.length > (marker.isPolygon() ? 2 : 1);\n\n if (isVisible) {\n position = this.__getMarkerPosition(marker);\n\n const points = positions.map(pos => (pos.x - position.x) + ',' + (pos.y - position.y)).join(' ');\n\n marker.$el.setAttributeNS(null, 'points', points);\n marker.$el.setAttributeNS(null, 'transform', `translate(${position.x} ${position.y})`);\n }\n }\n else if (isVisible) {\n if (marker.props.dynamicSize) {\n this.__updateMarkerSize(marker);\n }\n\n position = this.__getMarkerPosition(marker);\n isVisible = this.__isMarkerVisible(marker, position);\n\n if (isVisible) {\n const scale = marker.getScale(zoomLevel, viewerPosition);\n\n if (marker.isSvg()) {\n // simulate transform-origin relative to SVG element\n const x = position.x + marker.props.width * marker.props.anchor.x * (1 - scale);\n const y = position.y + marker.props.width * marker.props.anchor.y * (1 - scale);\n marker.$el.setAttributeNS(null, 'transform', `translate(${x}, ${y}) scale(${scale}, ${scale})`);\n }\n else {\n marker.$el.style.transform = `translate3D(${position.x}px, ${position.y}px, 0px) scale(${scale}, ${scale})`;\n }\n }\n }\n\n visibilityChanged = marker.props.visible !== isVisible;\n marker.props.visible = isVisible;\n marker.props.position2D = isVisible ? position : null;\n\n if (!marker.is3d()) {\n utils.toggleClass(marker.$el, 'psv-marker--visible', isVisible);\n }\n\n if (!isVisible) {\n marker.hideTooltip();\n }\n else if (marker.props.staticTooltip) {\n marker.showTooltip();\n }\n else if (marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.click || (marker === this.prop.hoveringMarker && !marker.isPoly())) {\n marker.refreshTooltip();\n }\n else if (marker !== this.prop.hoveringMarker) {\n marker.hideTooltip();\n }\n\n if (visibilityChanged) {\n this.trigger(EVENTS.MARKER_VISIBILITY, marker, isVisible);\n }\n });\n }\n\n /**\n * @summary Determines if a point marker is visible
\n * It tests if the point is in the general direction of the camera, then check if it's in the viewport\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @param {PSV.Point} position\n * @returns {boolean}\n * @private\n */\n __isMarkerVisible(marker, position) {\n return marker.props.positions3D[0].dot(this.psv.prop.direction) > 0\n && position.x + marker.props.width >= 0\n && position.x - marker.props.width <= this.psv.prop.size.width\n && position.y + marker.props.height >= 0\n && position.y - marker.props.height <= this.psv.prop.size.height;\n }\n\n /**\n * @summary Computes the real size of a marker\n * @description This is done by removing all it's transformations (if any) and making it visible\n * before querying its bounding rect\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @private\n */\n __updateMarkerSize(marker) {\n utils.addClasses(marker.$el, 'psv-marker--transparent');\n\n let transform;\n if (marker.isSvg()) {\n transform = marker.$el.getAttributeNS(null, 'transform');\n marker.$el.removeAttributeNS(null, 'transform');\n }\n else {\n transform = marker.$el.style.transform;\n marker.$el.style.transform = '';\n }\n\n const rect = marker.$el.getBoundingClientRect();\n marker.props.width = rect.width;\n marker.props.height = rect.height;\n\n utils.removeClasses(marker.$el, 'psv-marker--transparent');\n\n if (transform) {\n if (marker.isSvg()) {\n marker.$el.setAttributeNS(null, 'transform', transform);\n }\n else {\n marker.$el.style.transform = transform;\n }\n }\n\n // the size is no longer dynamic once known\n marker.props.dynamicSize = false;\n }\n\n /**\n * @summary Computes viewer coordinates of a marker\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @returns {PSV.Point}\n * @private\n */\n __getMarkerPosition(marker) {\n if (marker.isPoly()) {\n return this.psv.dataHelper.sphericalCoordsToViewerCoords(marker.props.position);\n }\n else {\n const position = this.psv.dataHelper.vector3ToViewerCoords(marker.props.positions3D[0]);\n\n position.x -= marker.props.width * marker.props.anchor.x;\n position.y -= marker.props.height * marker.props.anchor.y;\n\n return position;\n }\n }\n\n /**\n * @summary Computes viewer coordinates of each point of a polygon/polyline
\n * It handles points behind the camera by creating intermediary points suitable for the projector\n * @param {PSV.plugins.MarkersPlugin.Marker} marker\n * @returns {PSV.Point[]}\n * @private\n */\n __getPolyPositions(marker) {\n const nbVectors = marker.props.positions3D.length;\n\n // compute if each vector is visible\n const positions3D = marker.props.positions3D.map((vector) => {\n return {\n vector : vector,\n visible: vector.dot(this.psv.prop.direction) > 0,\n };\n });\n\n // get pairs of visible/invisible vectors for each invisible vector connected to a visible vector\n const toBeComputed = [];\n positions3D.forEach((pos, i) => {\n if (!pos.visible) {\n const neighbours = [\n i === 0 ? positions3D[nbVectors - 1] : positions3D[i - 1],\n i === nbVectors - 1 ? positions3D[0] : positions3D[i + 1],\n ];\n\n neighbours.forEach((neighbour) => {\n if (neighbour.visible) {\n toBeComputed.push({\n visible : neighbour,\n invisible: pos,\n index : i,\n });\n }\n });\n }\n });\n\n // compute intermediary vector for each pair (the loop is reversed for splice to insert at the right place)\n toBeComputed.reverse().forEach((pair) => {\n positions3D.splice(pair.index, 0, {\n vector : this.__getPolyIntermediaryPoint(pair.visible.vector, pair.invisible.vector),\n visible: true,\n });\n });\n\n // translate vectors to screen pos\n return positions3D\n .filter(pos => pos.visible)\n .map(pos => this.psv.dataHelper.vector3ToViewerCoords(pos.vector));\n }\n\n /**\n * Given one point in the same direction of the camera and one point behind the camera,\n * computes an intermediary point on the great circle delimiting the half sphere visible by the camera.\n * The point is shifted by .01 rad because the projector cannot handle points exactly on this circle.\n * TODO : does not work with fisheye view (must not use the great circle)\n * {@link http://math.stackexchange.com/a/1730410/327208}\n * @param P1 {external:THREE.Vector3}\n * @param P2 {external:THREE.Vector3}\n * @returns {external:THREE.Vector3}\n * @private\n */\n __getPolyIntermediaryPoint(P1, P2) {\n const C = this.psv.prop.direction.clone().normalize();\n const N = new THREE.Vector3().crossVectors(P1, P2).normalize();\n const V = new THREE.Vector3().crossVectors(N, P1).normalize();\n const X = P1.clone().multiplyScalar(-C.dot(V));\n const Y = V.clone().multiplyScalar(C.dot(P1));\n const H = new THREE.Vector3().addVectors(X, Y).normalize();\n const a = new THREE.Vector3().crossVectors(H, C);\n return H.applyAxisAngle(a, 0.01).multiplyScalar(CONSTANTS.SPHERE_RADIUS);\n }\n\n /**\n * @summary Returns the marker associated to an event target\n * @param {EventTarget} target\n * @param {boolean} [closest=false]\n * @returns {PSV.plugins.MarkersPlugin.Marker}\n * @private\n */\n __getTargetMarker(target, closest = false) {\n const target2 = closest ? utils.getClosest(target, '.psv-marker') : target;\n return target2 ? target2[MARKER_DATA] : undefined;\n }\n\n /**\n * @summary Checks if an event target is in the tooltip\n * @param {EventTarget} target\n * @param {PSV.components.Tooltip} tooltip\n * @returns {boolean}\n * @private\n */\n __targetOnTooltip(target, tooltip) {\n return target && tooltip ? utils.hasParent(target, tooltip.container) : false;\n }\n\n /**\n * @summary Handles mouse enter events, show the tooltip for non polygon markers\n * @param {MouseEvent} e\n * @param {PSV.plugins.MarkersPlugin.Marker} [marker]\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseEnter(e, marker) {\n if (marker && !marker.isPoly()) {\n this.prop.hoveringMarker = marker;\n\n this.trigger(EVENTS.OVER_MARKER, marker);\n\n if (!marker.props.staticTooltip && marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.hover) {\n marker.showTooltip(e);\n }\n }\n }\n\n /**\n * @summary Handles mouse leave events, hide the tooltip\n * @param {MouseEvent} e\n * @param {PSV.plugins.MarkersPlugin.Marker} [marker]\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @private\n */\n __onMouseLeave(e, marker) {\n // do not hide if we enter the tooltip itself while hovering a polygon\n if (marker && !(marker.isPoly() && this.__targetOnTooltip(e.relatedTarget, marker.tooltip))) {\n this.trigger(EVENTS.LEAVE_MARKER, marker);\n\n this.prop.hoveringMarker = null;\n\n if (!marker.props.staticTooltip && marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.hover) {\n marker.hideTooltip();\n }\n }\n }\n\n /**\n * @summary Handles mouse move events, refreshUi the tooltip for polygon markers\n * @param {MouseEvent} e\n * @param {PSV.plugins.MarkersPlugin.Marker} [targetMarker]\n * @fires PSV.plugins.MarkersPlugin.leave-marker\n * @fires PSV.plugins.MarkersPlugin.over-marker\n * @private\n */\n __onMouseMove(e, targetMarker) {\n let marker;\n\n if (targetMarker?.isPoly()) {\n marker = targetMarker;\n }\n // do not hide if we enter the tooltip itself while hovering a polygon\n else if (this.prop.hoveringMarker && this.__targetOnTooltip(e.target, this.prop.hoveringMarker.tooltip)) {\n marker = this.prop.hoveringMarker;\n }\n\n if (marker) {\n if (!this.prop.hoveringMarker) {\n this.trigger(EVENTS.OVER_MARKER, marker);\n\n this.prop.hoveringMarker = marker;\n }\n\n if (!marker.props.staticTooltip) {\n marker.showTooltip(e);\n }\n }\n else if (this.prop.hoveringMarker?.isPoly()) {\n this.trigger(EVENTS.LEAVE_MARKER, this.prop.hoveringMarker);\n\n if (!this.prop.hoveringMarker.props.staticTooltip) {\n this.prop.hoveringMarker.hideTooltip();\n }\n\n this.prop.hoveringMarker = null;\n }\n }\n\n /**\n * @summary Handles mouse click events, select the marker and open the panel if necessary\n * @param {Event} e\n * @param {Object} data\n * @param {boolean} dblclick\n * @fires PSV.plugins.MarkersPlugin.select-marker\n * @fires PSV.plugins.MarkersPlugin.unselect-marker\n * @private\n */\n __onClick(e, data, dblclick) {\n let marker = data.objects.find(o => o.userData[MARKER_DATA])?.userData[MARKER_DATA];\n\n if (!marker) {\n marker = this.__getTargetMarker(data.target, true);\n }\n\n if (this.prop.currentMarker && this.prop.currentMarker !== marker) {\n this.trigger(EVENTS.UNSELECT_MARKER, this.prop.currentMarker);\n\n this.psv.panel.hide(ID_PANEL_MARKER);\n\n if (!this.prop.showAllTooltips && this.prop.currentMarker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.click) {\n this.hideMarkerTooltip(this.prop.currentMarker);\n }\n\n this.prop.currentMarker = null;\n }\n\n if (marker) {\n this.prop.currentMarker = marker;\n\n this.trigger(EVENTS.SELECT_MARKER, marker, {\n dblclick : dblclick,\n rightclick: data.rightclick,\n });\n\n if (this.config.clickEventOnMarker) {\n // add the marker to event data\n data.marker = marker;\n }\n else {\n e.stopPropagation();\n }\n\n // the marker could have been deleted in an event handler\n if (this.markers[marker.id]) {\n if (marker.config.tooltip.trigger === MARKER_TOOLTIP_TRIGGER.click) {\n if (marker.tooltip) {\n this.hideMarkerTooltip(marker);\n }\n else {\n this.showMarkerTooltip(marker);\n }\n }\n else {\n this.showMarkerPanel(marker.id);\n }\n }\n }\n }\n\n /**\n * @summary Updates the visiblity of the panel and the buttons\n * @private\n */\n __refreshUi() {\n const nbMarkers = Object.values(this.markers).filter(m => !m.config.hideList).length;\n const markersButton = this.psv.navbar.getButton(MarkersButton.id, false);\n const markersListButton = this.psv.navbar.getButton(MarkersListButton.id, false);\n\n if (nbMarkers === 0) {\n markersButton?.hide();\n markersListButton?.hide();\n\n if (this.psv.panel.isVisible(ID_PANEL_MARKERS_LIST)) {\n this.psv.panel.hide();\n }\n else if (this.psv.panel.isVisible(ID_PANEL_MARKER)) {\n this.psv.panel.hide();\n }\n }\n else {\n markersButton?.show();\n markersListButton?.show();\n\n if (this.psv.panel.isVisible(ID_PANEL_MARKERS_LIST)) {\n this.showMarkersList();\n }\n else if (this.psv.panel.isVisible(ID_PANEL_MARKER)) {\n this.prop.currentMarker ? this.showMarkerPanel(this.prop.currentMarker) : this.psv.panel.hide();\n }\n }\n }\n\n /**\n * @summary Adds or remove the objects observer if there are 3D markers\n * @private\n */\n __checkObjectsObserver() {\n const has3d = Object.values(this.markers).some(marker => marker.is3d());\n\n if (!has3d && this.prop.stopObserver) {\n this.prop.stopObserver();\n this.prop.stopObserver = null;\n }\n else if (has3d && !this.prop.stopObserver) {\n this.prop.stopObserver = this.psv.observeObjects(MARKER_DATA, this);\n }\n }\n\n}\n"],"names":["EVENTS","MARKER_VISIBILITY","GOTO_MARKER_DONE","LEAVE_MARKER","OVER_MARKER","RENDER_MARKERS_LIST","SELECT_MARKER","SELECT_MARKER_LIST","UNSELECT_MARKER","HIDE_MARKERS","SET_MARKERS","SHOW_MARKERS","MARKER_TOOLTIP_TRIGGER","click","hover","SVG_NS","MARKER_DATA","ID_PANEL_MARKER","ID_PANEL_MARKERS_LIST","MARKERS_LIST_TEMPLATE","markers","title","dataKey","icon","map","marker","config","id","type","image","getListContent","join","getShortestArc","from","to","tCandidates","Math","PI","reduce","value","candidate","newCandidate","abs","Infinity","PSVError","message","Error","captureStackTrace","stack","prototype","Object","create","name","constructor","logWarn","console","warn","THREE","Quaternion","greatArcIntermediaryPoint","p1","p2","f","λ1","φ1","λ2","φ2","r","utils","greatArcDistance","a","sin","b","x","cos","y","z","atan2","sqrt","getPolygonCenter","polygon","workPoints","k","i","length","d","push","sum","intermediary","point","parseAngle","getPolylineCenter","polyline","lengths","l","CONSTANTS","SPHERE_RADIUS","consumed","j","round","MARKER_TYPES","imageLayer","html","polygonPx","polygonRad","polylinePx","polylineRad","square","rect","circle","ellipse","path","Marker","properties","psv","getType","visible","$el","data","undefined","tooltip","props","dynamicSize","anchor","staticTooltip","position","position2D","positions3D","width","height","def","loader","is3d","TextureLoader","withCredentials","setWithCredentials","requestHeaders","setRequestHeader","isNormal","document","createElement","isPolygon","createElementNS","isPolyline","isSvg","update","destroy","isPoly","isPolyPx","isPolyRad","getScale","zoomLevel","scale","Array","isArray","zoom","bounds","EASINGS","inQuad","longitude","halfFov","MathUtils","degToRad","prop","hFov","arc","outQuad","max","listContent","content","showTooltip","mousePosition","viewerPos","getPosition","container","box","size","arrow","top","clientY","left","clientX","move","refreshTooltip","hideTooltip","hide","newType","deepmerge","trigger","setAttribute","className","addClasses","style","opacity","parsePosition","__updateNormal","__updatePoly","__updateSvg","__update3d","isExtendedPosition","backgroundImage","innerHTML","transformOrigin","dataHelper","cleanPosition","sphericalCoordsToVector3","cx","cy","rx","ry","each","setAttributeNS","svgStyle","dasherize","fill","actualPoly","splice","coord","sphericalCoords","textureCoordsToSphericalCoords","latitude","centroid","material","MeshBasicMaterial","transparent","depthTest","geometry","PlaneGeometry","mesh","Mesh","userData","Group","add","defineProperty","enumerable","get","children","set","load","texture","anisotropy","needsUpdate","copy","orientation","lookAt","rotateX","rotateY","allowNone","found","keys","MarkersButton","navbar","plugin","getPlugin","on","toggleActive","off","isSupported","handleEvent","e","onClick","show","AbstractButton","pin","MarkersListButton","OPEN_PANEL","CLOSE_PANEL","args","toggleMarkersList","pinList","DEFAULTS","lang","registerButton","MarkersPlugin","options","currentMarker","hoveringMarker","stopObserver","clickEventOnMarker","listButton","hideButton","cursor","mousemove","svgContainer","appendChild","addEventListener","init","CLICK","DOUBLE_CLICK","RENDER","CONFIG_CHANGED","once","READY","setMarkers","clearMarkers","removeChild","__onMouseEnter","__getTargetMarker","target","__onMouseLeave","__onMouseMove","preventDefault","__onClick","renderMarkers","OBJECT_EVENTS","ENTER_OBJECT","detail","originalEvent","LEAVE_OBJECT","HOVER_OBJECT","toggleAllTooltips","showAllTooltips","hideAllTooltips","getNbMarkers","getMarkers","values","addMarker","render","renderer","scene","__refreshUi","__checkObjectsObserver","getMarker","markerId","getCurrentMarker","updateMarker","removeMarker","remove","removeMarkers","markerIds","forEach","gotoMarker","speed","animate","then","hideMarker","toggleMarker","showMarker","showMarkerTooltip","hideMarkerTooltip","showMarkerPanel","panel","contentId","hideMarkersList","showMarkersList","hideList","change","noMargin","clickHandler","li","getClosest","dataset","getZoomLevel","viewerPosition","isVisible","visibilityChanged","__getMarkerPosition","__isMarkerVisible","positions","__getPolyPositions","points","pos","__updateMarkerSize","transform","toggleClass","dot","direction","getAttributeNS","removeAttributeNS","getBoundingClientRect","removeClasses","sphericalCoordsToViewerCoords","vector3ToViewerCoords","nbVectors","vector","toBeComputed","neighbours","neighbour","invisible","index","reverse","pair","__getPolyIntermediaryPoint","filter","P1","P2","C","clone","normalize","N","Vector3","crossVectors","V","X","multiplyScalar","Y","H","addVectors","applyAxisAngle","closest","target2","__targetOnTooltip","hasParent","relatedTarget","targetMarker","dblclick","objects","find","o","rightclick","stopPropagation","nbMarkers","m","markersButton","getButton","markersListButton","has3d","some","observeObjects","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;;AACO,MAAMA,MAAM,GAAG;EACpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,iBAAiB,EAAI,mBARD;;EASpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,gBAAgB,EA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QACpC,IAAKlH,CAAAA,IAAL,CAAUkH,YAAV,EAAA,CAAA;EACA,MAAA,IAAA,CAAKlH,IAAL,CAAUkH,YAAV,GAAyB,IAAzB,CAAA;OAFF,MAIK,IAAI2I,KAAK,IAAI,CAAC,IAAK7P,CAAAA,IAAL,CAAUkH,YAAxB,EAAsC;EACzC,MAAA,IAAA,CAAKlH,IAAL,CAAUkH,YAAV,GAAyB,IAAKnK,CAAAA,GAAL,CAASgT,cAAT,CAAwBlZ,WAAxB,EAAqC,IAArC,CAAzB,CAAA;EACD,KAAA;KAj9BL,CAAA;;EAAA,EAAA,OAAA,aAAA,CAAA;EAAA,CAAA,CAAmCmZ,gCAAnC,EAAA;EAAalJ,cAEJtP,KAAK;EAFDsP,cAIJjR,SAASA;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/resolution.js b/dist/plugins/resolution.js index fab736c46..d0a3a2e10 100644 --- a/dist/plugins/resolution.js +++ b/dist/plugins/resolution.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -58,40 +58,6 @@ RESOLUTION_CHANGED: 'resolution-changed' }; - /** - * @summary Returns deep equality between objects - * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9} - * @param obj1 - * @param obj2 - * @return {boolean} - * @private - */ - function deepEqual(obj1, obj2) { - if (obj1 === obj2) { - return true; - } else if (isObject(obj1) && isObject(obj2)) { - if (Object.keys(obj1).length !== Object.keys(obj2).length) { - return false; - } - - for (var _i = 0, _Object$keys = Object.keys(obj1); _i < _Object$keys.length; _i++) { - var prop = _Object$keys[_i]; - - if (!deepEqual(obj1[prop], obj2[prop])) { - return false; - } - } - - return true; - } else { - return false; - } - } - - function isObject(obj) { - return typeof obj === 'object' && obj != null; - } - /** * @typedef {Object} PSV.plugins.ResolutionPlugin.Resolution * @property {string} id @@ -282,7 +248,7 @@ var _this4 = this; var resolution = this.resolutions.find(function (r) { - return deepEqual(_this4.psv.config.panorama, r.panorama); + return photoSphereViewer.utils.deepEqual(_this4.psv.config.panorama, r.panorama); }); if (this.prop.resolution !== (resolution == null ? void 0 : resolution.id)) { diff --git a/dist/plugins/resolution.js.map b/dist/plugins/resolution.js.map index ba849cb1d..b45e98a1b 100644 --- a/dist/plugins/resolution.js.map +++ b/dist/plugins/resolution.js.map @@ -1 +1 @@ -{"version":3,"file":"resolution.js","sources":["../../src/plugins/resolution/constants.js","../../src/plugins/resolution/utils.js","../../src/plugins/resolution/index.js"],"sourcesContent":["/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.ResolutionPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event resolution-changed\n * @memberof PSV.plugins.ResolutionPlugin\n * @summary Triggered when the resolution is changed\n * @param {string} resolutionId\n */\n RESOLUTION_CHANGED: 'resolution-changed',\n};\n","/**\n * @summary Returns deep equality between objects\n * {@link https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9}\n * @param obj1\n * @param obj2\n * @return {boolean}\n * @private\n */\nexport function deepEqual(obj1, obj2) {\n if (obj1 === obj2) {\n return true;\n }\n else if (isObject(obj1) && isObject(obj2)) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop of Object.keys(obj1)) {\n if (!deepEqual(obj1[prop], obj2[prop])) {\n return false;\n }\n }\n return true;\n }\n else {\n return false;\n }\n}\n\nfunction isObject(obj) {\n return typeof obj === 'object' && obj != null;\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError } from '../..';\nimport { EVENTS } from './constants';\nimport { deepEqual } from './utils';\n\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Resolution\n * @property {string} id\n * @property {string} label\n * @property {*} panorama\n */\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Options\n * @property {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions - list of available resolutions\n * @property {boolean} [showBadge=true] - show the resolution id as a badge on the settings button\n */\n\n\nDEFAULTS.lang.resolution = 'Quality';\n\n\nexport { EVENTS } from './constants';\n\n\n/**\n * @summary Adds a setting to choose between multiple resolutions of the panorama.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class ResolutionPlugin extends AbstractPlugin {\n\n static id = 'resolution';\n\n static EVENTS = EVENTS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.ResolutionPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @readonly\n * @private\n */\n this.settings = null;\n\n /**\n * @summary Available resolutions\n * @member {PSV.plugins.ResolutionPlugin.Resolution[]}\n */\n this.resolutions = [];\n\n /**\n * @summary Available resolutions\n * @member {Object.}\n * @private\n */\n this.resolutionsById = {};\n\n /**\n * @type {Object}\n * @property {string} resolution - Current resolution\n * @private\n */\n this.prop = {\n resolution: null,\n };\n\n /**\n * @type {PSV.plugins.ResolutionPlugin.Options}\n */\n this.config = {\n showBadge: true,\n ...options,\n };\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.settings = this.psv.getPlugin('settings');\n\n if (!this.settings) {\n throw new PSVError('Resolution plugin requires the Settings plugin');\n }\n\n this.settings.addSetting({\n id : ResolutionPlugin.id,\n type : 'options',\n label : this.psv.config.lang.resolution,\n current: () => this.prop.resolution,\n options: () => this.__getSettingsOptions(),\n apply : resolution => this.setResolution(resolution),\n badge : !this.config.showBadge ? null : () => this.prop.resolution,\n });\n\n this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n if (this.config.resolutions) {\n this.setResolutions(this.config.resolutions);\n delete this.config.resolutions;\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n this.settings.removeSetting(ResolutionPlugin.id);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === CONSTANTS.EVENTS.PANORAMA_LOADED) {\n this.__refreshResolution();\n }\n }\n\n /**\n * @summary Changes the available resolutions\n * @param {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions\n */\n setResolutions(resolutions) {\n this.resolutions = resolutions;\n this.resolutionsById = {};\n\n resolutions.forEach((resolution) => {\n if (!resolution.id) {\n throw new PSVError('Missing resolution id');\n }\n this.resolutionsById[resolution.id] = resolution;\n });\n\n this.__refreshResolution();\n }\n\n /**\n * @summary Changes the current resolution\n * @param {string} id\n */\n setResolution(id) {\n if (!this.resolutionsById[id]) {\n throw new PSVError(`Resolution ${id} unknown`);\n }\n\n return this.psv.setPanorama(this.resolutionsById[id].panorama, { transition: false, showLoader: false });\n }\n\n /**\n * @summary Returns the current resolution\n * @return {string}\n */\n getResolution() {\n return this.prop.resolution;\n }\n\n /**\n * @summary Updates current resolution on panorama load\n * @private\n */\n __refreshResolution() {\n const resolution = this.resolutions.find(r => deepEqual(this.psv.config.panorama, r.panorama));\n if (this.prop.resolution !== resolution?.id) {\n this.prop.resolution = resolution?.id;\n this.settings?.updateBadge();\n this.trigger(EVENTS.RESOLUTION_CHANGED, this.prop.resolution);\n }\n }\n\n /**\n * @summary Returns options for Settings plugin\n * @return {PSV.plugins.SettingsPlugin.Option[]}\n * @private\n */\n __getSettingsOptions() {\n return this.resolutions\n .map(resolution => ({\n id : resolution.id,\n label: resolution.label,\n }));\n }\n\n}\n"],"names":["EVENTS","RESOLUTION_CHANGED","deepEqual","obj1","obj2","isObject","Object","keys","length","prop","obj","DEFAULTS","lang","resolution","ResolutionPlugin","psv","options","settings","resolutions","resolutionsById","config","showBadge","init","getPlugin","PSVError","addSetting","id","type","label","current","__getSettingsOptions","apply","setResolution","badge","on","CONSTANTS","PANORAMA_LOADED","setResolutions","destroy","off","removeSetting","handleEvent","e","__refreshResolution","forEach","setPanorama","panorama","transition","showLoader","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AAUI,UAAV,GAAuBA,UAAvB,IAAuBA,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,UAAU,CAAEa,EAAnC,CAAA;QACA,CAAKT,cAAAA,GAAAA,IAAAA,CAAAA,QAAL,oCAAemC,WAAf,EAAA,CAAA;QACA,IAAKC,CAAAA,OAAL,CAAarD,MAAM,CAACC,kBAApB,EAAwC,IAAA,CAAKQ,IAAL,CAAUI,UAAlD,CAAA,CAAA;EACD,KAAA;EACF,GAAA;EAED;EACF;EACA;EACA;EACA;EA9JA,GAAA;;IAAA,MA+JEiB,CAAAA,oBA/JF,GA+JE,SAAuB,oBAAA,GAAA;EACrB,IAAA,OAAO,KAAKZ,WAAL,CACJoC,GADI,CACA,UAAAzC,UAAU,EAAA;QAAA,OAAK;UAClBa,EAAE,EAAKb,UAAU,CAACa,EADA;UAElBE,KAAK,EAAEf,UAAU,CAACe,KAAAA;SAFL,CAAA;EAAA,KADV,CAAP,CAAA;KAhKJ,CAAA;;EAAA,EAAA,OAAA,gBAAA,CAAA;EAAA,CAAA,CAAsC2B,gCAAtC,EAAA;EAAazC,iBAEJY,KAAK;EAFDZ,iBAIJd,SAASA;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"resolution.js","sources":["../../src/plugins/resolution/constants.js","../../src/plugins/resolution/index.js"],"sourcesContent":["/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.ResolutionPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event resolution-changed\n * @memberof PSV.plugins.ResolutionPlugin\n * @summary Triggered when the resolution is changed\n * @param {string} resolutionId\n */\n RESOLUTION_CHANGED: 'resolution-changed',\n};\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, utils } from '../..';\nimport { EVENTS } from './constants';\n\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Resolution\n * @property {string} id\n * @property {string} label\n * @property {*} panorama\n */\n\n/**\n * @typedef {Object} PSV.plugins.ResolutionPlugin.Options\n * @property {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions - list of available resolutions\n * @property {boolean} [showBadge=true] - show the resolution id as a badge on the settings button\n */\n\n\nDEFAULTS.lang.resolution = 'Quality';\n\n\nexport { EVENTS } from './constants';\n\n\n/**\n * @summary Adds a setting to choose between multiple resolutions of the panorama.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class ResolutionPlugin extends AbstractPlugin {\n\n static id = 'resolution';\n\n static EVENTS = EVENTS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.ResolutionPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @readonly\n * @private\n */\n this.settings = null;\n\n /**\n * @summary Available resolutions\n * @member {PSV.plugins.ResolutionPlugin.Resolution[]}\n */\n this.resolutions = [];\n\n /**\n * @summary Available resolutions\n * @member {Object.}\n * @private\n */\n this.resolutionsById = {};\n\n /**\n * @type {Object}\n * @property {string} resolution - Current resolution\n * @private\n */\n this.prop = {\n resolution: null,\n };\n\n /**\n * @type {PSV.plugins.ResolutionPlugin.Options}\n */\n this.config = {\n showBadge: true,\n ...options,\n };\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.settings = this.psv.getPlugin('settings');\n\n if (!this.settings) {\n throw new PSVError('Resolution plugin requires the Settings plugin');\n }\n\n this.settings.addSetting({\n id : ResolutionPlugin.id,\n type : 'options',\n label : this.psv.config.lang.resolution,\n current: () => this.prop.resolution,\n options: () => this.__getSettingsOptions(),\n apply : resolution => this.setResolution(resolution),\n badge : !this.config.showBadge ? null : () => this.prop.resolution,\n });\n\n this.psv.on(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n if (this.config.resolutions) {\n this.setResolutions(this.config.resolutions);\n delete this.config.resolutions;\n }\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.PANORAMA_LOADED, this);\n\n this.settings.removeSetting(ResolutionPlugin.id);\n\n super.destroy();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n if (e.type === CONSTANTS.EVENTS.PANORAMA_LOADED) {\n this.__refreshResolution();\n }\n }\n\n /**\n * @summary Changes the available resolutions\n * @param {PSV.plugins.ResolutionPlugin.Resolution[]} resolutions\n */\n setResolutions(resolutions) {\n this.resolutions = resolutions;\n this.resolutionsById = {};\n\n resolutions.forEach((resolution) => {\n if (!resolution.id) {\n throw new PSVError('Missing resolution id');\n }\n this.resolutionsById[resolution.id] = resolution;\n });\n\n this.__refreshResolution();\n }\n\n /**\n * @summary Changes the current resolution\n * @param {string} id\n */\n setResolution(id) {\n if (!this.resolutionsById[id]) {\n throw new PSVError(`Resolution ${id} unknown`);\n }\n\n return this.psv.setPanorama(this.resolutionsById[id].panorama, { transition: false, showLoader: false });\n }\n\n /**\n * @summary Returns the current resolution\n * @return {string}\n */\n getResolution() {\n return this.prop.resolution;\n }\n\n /**\n * @summary Updates current resolution on panorama load\n * @private\n */\n __refreshResolution() {\n const resolution = this.resolutions.find(r => utils.deepEqual(this.psv.config.panorama, r.panorama));\n if (this.prop.resolution !== resolution?.id) {\n this.prop.resolution = resolution?.id;\n this.settings?.updateBadge();\n this.trigger(EVENTS.RESOLUTION_CHANGED, this.prop.resolution);\n }\n }\n\n /**\n * @summary Returns options for Settings plugin\n * @return {PSV.plugins.SettingsPlugin.Option[]}\n * @private\n */\n __getSettingsOptions() {\n return this.resolutions\n .map(resolution => ({\n id : resolution.id,\n label: resolution.label,\n }));\n }\n\n}\n"],"names":["EVENTS","RESOLUTION_CHANGED","DEFAULTS","lang","resolution","ResolutionPlugin","psv","options","settings","resolutions","resolutionsById","prop","config","showBadge","init","getPlugin","PSVError","addSetting","id","type","label","current","__getSettingsOptions","apply","setResolution","badge","on","CONSTANTS","PANORAMA_LOADED","setResolutions","destroy","off","removeSetting","handleEvent","e","__refreshResolution","forEach","setPanorama","panorama","transition","showLoader","getResolution","find","r","utils","deepEq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A;;MACA,IAAI,IAAA,CAAK3B,IAAL,CAAUP,UAAV,MAAyBA,UAAzB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAyBA,UAAU,CAAEc,EAArC,CAAJ,EAA6C;EAAA,MAAA,IAAA,cAAA,CAAA;;QAC3C,IAAKP,CAAAA,IAAL,CAAUP,UAAV,GAAuBA,UAAvB,IAAuBA,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,UAAU,CAAEc,EAAnC,CAAA;QACA,CAAKV,cAAAA,GAAAA,IAAAA,CAAAA,QAAL,oCAAesC,WAAf,EAAA,CAAA;QACA,IAAKC,CAAAA,OAAL,CAAa/C,MAAM,CAACC,kBAApB,EAAwC,IAAA,CAAKU,IAAL,CAAUP,UAAlD,CAAA,CAAA;EACD,KAAA;EACF,GAAA;EAED;EACF;EACA;EACA;EACA;EA9JA,GAAA;;IAAA,MA+JEkB,CAAAA,oBA/JF,GA+JE,SAAuB,oBAAA,GAAA;EACrB,IAAA,OAAO,KAAKb,WAAL,CACJuC,GADI,CACA,UAAA5C,UAAU,EAAA;QAAA,OAAK;UAClBc,EAAE,EAAKd,UAAU,CAACc,EADA;UAElBE,KAAK,EAAEhB,UAAU,CAACgB,KAAAA;SAFL,CAAA;EAAA,KADV,CAAP,CAAA;KAhKJ,CAAA;;EAAA,EAAA,OAAA,gBAAA,CAAA;EAAA,CAAA,CAAsC6B,gCAAtC,EAAA;EAAa5C,iBAEJa,KAAK;EAFDb,iBAIJL,SAASA;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/settings.css b/dist/plugins/settings.css index c69f531da..2ae28e982 100644 --- a/dist/plugins/settings.css +++ b/dist/plugins/settings.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.6.5 + * Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/settings.js b/dist/plugins/settings.js index 31abc3344..197ad693e 100644 --- a/dist/plugins/settings.js +++ b/dist/plugins/settings.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/stereo.js b/dist/plugins/stereo.js index 6b46b9130..c113ae6eb 100644 --- a/dist/plugins/stereo.js +++ b/dist/plugins/stereo.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/video.css b/dist/plugins/video.css index fd1a906c2..bd0e837a2 100644 --- a/dist/plugins/video.css +++ b/dist/plugins/video.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.6.5 + * Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/video.js b/dist/plugins/video.js index a7952b52e..dcca65fdd 100644 --- a/dist/plugins/video.js +++ b/dist/plugins/video.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/virtual-tour.css b/dist/plugins/virtual-tour.css index 6d88d73e7..e99db0cbf 100644 --- a/dist/plugins/virtual-tour.css +++ b/dist/plugins/virtual-tour.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.6.5 + * Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/dist/plugins/virtual-tour.js b/dist/plugins/virtual-tour.js index 42e586e63..d7b688896 100644 --- a/dist/plugins/virtual-tour.js +++ b/dist/plugins/virtual-tour.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -466,7 +466,7 @@ ; _proto.isSupported = function isSupported() { - return !!this.plugin && !this.plugin.isServerSide(); + return !!this.plugin && !this.plugin.isServerSide() && !this.plugin.gallery; } /** * @summary Handles events @@ -752,6 +752,12 @@ */ _this.compass = null; + /** + * @type {PSV.plugins.GalleryPlugin} + * @private + */ + + _this.gallery = null; /** * @type {PSV.plugins.VirtualTourPlugin.AbstractDatasource} */ @@ -788,6 +794,7 @@ this.markers = this.psv.getPlugin('markers'); this.compass = this.psv.getPlugin('compass'); + this.gallery = this.psv.getPlugin('gallery'); if (!this.is3D() && !this.markers) { throw new photoSphereViewer.PSVError('Tour plugin requires the Markers plugin in markers mode'); @@ -849,6 +856,7 @@ delete this.datasource; delete this.markers; delete this.compass; + delete this.gallery; delete this.arrowsGroup; _AbstractPlugin.prototype.destroy.call(this); @@ -940,6 +948,8 @@ ; _proto.setNodes = function setNodes(nodes, startNodeId) { + var _this3 = this; + if (this.isServerSide()) { throw new photoSphereViewer.PSVError('Cannot set nodes in server side mode'); } @@ -954,6 +964,25 @@ } this.setCurrentNode(startNodeId); + + if (this.gallery) { + this.gallery.setItems(nodes.map(function (node) { + return { + id: node.id, + panorama: node.panorama, + name: node.name, + thumbnail: node.thumbnail, + options: { + caption: node.caption, + panoData: node.panoData, + sphereCorrection: node.sphereCorrection, + description: node.description + } + }; + }), function (id) { + return _this3.setCurrentNode(id); + }); + } } /** * @summary Changes the current node @@ -965,7 +994,7 @@ _proto.setCurrentNode = function setCurrentNode(nodeId, fromLink) { var _this$prop$currentNod, - _this3 = this; + _this4 = this; if (fromLink === void 0) { fromLink = null; @@ -981,49 +1010,49 @@ var fromLinkPosition = fromNode && fromLink ? this.__getLinkPosition(fromNode, fromLink) : null; return Promise.all([// if this node is already preloading, wait for it Promise.resolve(this.preload[nodeId]).then(function () { - if (_this3.prop.loadingNode !== nodeId) { + if (_this4.prop.loadingNode !== nodeId) { throw photoSphereViewer.utils.getAbortError(); } - return _this3.datasource.loadNode(nodeId); + return _this4.datasource.loadNode(nodeId); }), Promise.resolve(fromLinkPosition ? this.config.rotateSpeed : false).then(function (speed) { // eslint-disable-line consistent-return if (speed) { - return _this3.psv.animate(_extends({}, fromLinkPosition, { + return _this4.psv.animate(_extends({}, fromLinkPosition, { speed: speed })); } }).then(function () { - _this3.psv.loader.show(); + _this4.psv.loader.show(); })]).then(function (_ref) { - var _this3$markers, _this3$compass; + var _this4$markers, _this4$compass; var node = _ref[0]; - if (_this3.prop.loadingNode !== nodeId) { + if (_this4.prop.loadingNode !== nodeId) { throw photoSphereViewer.utils.getAbortError(); } - _this3.prop.currentNode = node; + _this4.prop.currentNode = node; - if (_this3.prop.currentTooltip) { - _this3.prop.currentTooltip.hide(); + if (_this4.prop.currentTooltip) { + _this4.prop.currentTooltip.hide(); - _this3.prop.currentTooltip = null; + _this4.prop.currentTooltip = null; } - if (_this3.is3D()) { - var _this3$arrowsGroup; + if (_this4.is3D()) { + var _this4$arrowsGroup; - (_this3$arrowsGroup = _this3.arrowsGroup).remove.apply(_this3$arrowsGroup, _this3.arrowsGroup.children.filter(function (o) { + (_this4$arrowsGroup = _this4.arrowsGroup).remove.apply(_this4$arrowsGroup, _this4.arrowsGroup.children.filter(function (o) { return o.type === 'Mesh'; })); } - (_this3$markers = _this3.markers) == null ? void 0 : _this3$markers.clearMarkers(); - (_this3$compass = _this3.compass) == null ? void 0 : _this3$compass.clearHotspots(); - return Promise.all([_this3.psv.setPanorama(node.panorama, { - transition: _this3.config.transition, + (_this4$markers = _this4.markers) == null ? void 0 : _this4$markers.clearMarkers(); + (_this4$compass = _this4.compass) == null ? void 0 : _this4$compass.clearHotspots(); + return Promise.all([_this4.psv.setPanorama(node.panorama, { + transition: _this4.config.transition, caption: node.caption, description: node.description, panoData: node.panoData, @@ -1032,25 +1061,25 @@ if (!completed) { throw photoSphereViewer.utils.getAbortError(); } - }), _this3.datasource.loadLinkedNodes(nodeId)]); + }), _this4.datasource.loadLinkedNodes(nodeId)]); }).then(function () { - if (_this3.prop.loadingNode !== nodeId) { + if (_this4.prop.loadingNode !== nodeId) { throw photoSphereViewer.utils.getAbortError(); } - var node = _this3.prop.currentNode; + var node = _this4.prop.currentNode; if (node.markers) { - if (_this3.markers) { - _this3.markers.setMarkers(node.markers); + if (_this4.markers) { + _this4.markers.setMarkers(node.markers); } else { photoSphereViewer.utils.logWarn("Node " + node.id + " markers ignored because the plugin is not loaded."); } } - _this3.__renderLinks(node); + _this4.__renderLinks(node); - _this3.__preload(node); + _this4.__preload(node); /** * @event node-changed * @memberof PSV.plugins.VirtualTourPlugin @@ -1060,26 +1089,26 @@ */ - _this3.trigger(EVENTS.NODE_CHANGED, nodeId, { + _this4.trigger(EVENTS.NODE_CHANGED, nodeId, { fromNode: fromNode, fromLink: fromLink, fromLinkPosition: fromLinkPosition }); - _this3.prop.loadingNode = null; + _this4.prop.loadingNode = null; return true; }).catch(function (err) { if (photoSphereViewer.utils.isAbortError(err)) { return false; } - _this3.psv.showError(_this3.psv.config.lang.loadError); + _this4.psv.showError(_this4.psv.config.lang.loadError); - _this3.psv.loader.hide(); + _this4.psv.loader.hide(); - _this3.psv.navbar.setCaption(''); + _this4.psv.navbar.setCaption(''); - _this3.prop.loadingNode = null; + _this4.prop.loadingNode = null; throw err; }); } @@ -1091,15 +1120,15 @@ ; _proto.__renderLinks = function __renderLinks(node) { - var _this4 = this; + var _this5 = this; var positions = []; node.links.forEach(function (link) { - var position = _this4.__getLinkPosition(node, link); + var position = _this5.__getLinkPosition(node, link); positions.push(position); - if (_this4.is3D()) { + if (_this5.is3D()) { var _mesh$userData, _link$arrowStyle, _link$arrowStyle2; var mesh = new THREE.Mesh(ARROW_GEOM, new THREE.MeshLambertMaterial()); @@ -1107,7 +1136,7 @@ mesh.rotation.order = 'YXZ'; mesh.rotateY(-position.longitude); - _this4.psv.dataHelper.sphericalCoordsToVector3({ + _this5.psv.dataHelper.sphericalCoordsToVector3({ longitude: position.longitude, latitude: 0 }, mesh.position).multiplyScalar(1 / photoSphereViewer.CONSTANTS.SPHERE_RADIUS); @@ -1117,20 +1146,20 @@ })); outlineMesh.position.copy(mesh.position); outlineMesh.rotation.copy(mesh.rotation); - setMeshColor(mesh, ((_link$arrowStyle = link.arrowStyle) == null ? void 0 : _link$arrowStyle.color) || _this4.config.arrowStyle.color); - setMeshColor(outlineMesh, ((_link$arrowStyle2 = link.arrowStyle) == null ? void 0 : _link$arrowStyle2.outlineColor) || _this4.config.arrowStyle.outlineColor); + setMeshColor(mesh, ((_link$arrowStyle = link.arrowStyle) == null ? void 0 : _link$arrowStyle.color) || _this5.config.arrowStyle.color); + setMeshColor(outlineMesh, ((_link$arrowStyle2 = link.arrowStyle) == null ? void 0 : _link$arrowStyle2.outlineColor) || _this5.config.arrowStyle.outlineColor); - _this4.arrowsGroup.add(mesh); + _this5.arrowsGroup.add(mesh); - _this4.arrowsGroup.add(outlineMesh); + _this5.arrowsGroup.add(outlineMesh); } else { var _data; - if (_this4.isGps()) { - position.latitude += _this4.config.markerLatOffset; + if (_this5.isGps()) { + position.latitude += _this5.config.markerLatOffset; } - _this4.markers.addMarker(_extends({}, _this4.config.markerStyle, link.markerStyle, { + _this5.markers.addMarker(_extends({}, _this5.config.markerStyle, link.markerStyle, { id: "tour-link-" + link.nodeId, tooltip: link.name, hideList: true, @@ -1253,7 +1282,7 @@ ; _proto.__preload = function __preload(node) { - var _this5 = this; + var _this6 = this; if (!this.config.preload) { return; @@ -1261,20 +1290,20 @@ this.preload[node.id] = true; this.prop.currentNode.links.filter(function (link) { - return !_this5.preload[link.nodeId]; + return !_this6.preload[link.nodeId]; }).filter(function (link) { - if (typeof _this5.config.preload === 'function') { - return _this5.config.preload(_this5.prop.currentNode, link); + if (typeof _this6.config.preload === 'function') { + return _this6.config.preload(_this6.prop.currentNode, link); } else { return true; } }).forEach(function (link) { - _this5.preload[link.nodeId] = _this5.datasource.loadNode(link.nodeId).then(function (linkNode) { - return _this5.psv.textureLoader.preloadPanorama(linkNode.panorama); + _this6.preload[link.nodeId] = _this6.datasource.loadNode(link.nodeId).then(function (linkNode) { + return _this6.psv.textureLoader.preloadPanorama(linkNode.panorama); }).then(function () { - _this5.preload[link.nodeId] = true; + _this6.preload[link.nodeId] = true; }).catch(function () { - delete _this5.preload[link.nodeId]; + delete _this6.preload[link.nodeId]; }); }); } @@ -1297,8 +1326,9 @@ _proto.showNodesList = function showNodesList() { var _this$prop$currentNod2, - _this6 = this; + _this7 = this; + photoSphereViewer.utils.logWarn("Starting from next version, the VirtualTourPlugin will require the GalleryPlugin to display the list of nodes."); var nodes = this.change(EVENTS.RENDER_NODES_LIST, Object.values(this.datasource.nodes)); this.psv.panel.show({ id: ID_PANEL_NODES_LIST, @@ -1309,9 +1339,9 @@ var nodeId = li ? li.dataset.nodeId : undefined; if (nodeId) { - _this6.setCurrentNode(nodeId); + _this7.setCurrentNode(nodeId); - _this6.hideNodesList(); + _this7.hideNodesList(); } } }); diff --git a/dist/plugins/virtual-tour.js.map b/dist/plugins/virtual-tour.js.map index d73c5d84c..735aa72fc 100644 --- a/dist/plugins/virtual-tour.js.map +++ b/dist/plugins/virtual-tour.js.map @@ -1 +1 @@ -{"version":3,"file":"virtual-tour.js","sources":["../../src/plugins/virtual-tour/AbstractDatasource.js","../../src/plugins/virtual-tour/utils.js","../../src/plugins/virtual-tour/ClientSideDatasource.js","../../src/plugins/virtual-tour/constants.js","../../src/plugins/virtual-tour/NodesListButton.js","../../src/plugins/virtual-tour/ServerSideDatasource.js","../../src/plugins/virtual-tour/index.js"],"sourcesContent":["import { PSVError } from 'photo-sphere-viewer';\n\n/**\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @private\n */\nexport class AbstractDatasource {\n\n /**\n * @type {Record}\n */\n nodes = {};\n\n /**\n * @param {PSV.plugins.VirtualTourPlugin} plugin\n */\n constructor(plugin) {\n this.plugin = plugin;\n }\n\n destroy() {\n delete this.plugin;\n }\n\n /**\n * @summary Loads a node\n * @param {string} nodeId\n * @return {Promise}\n */\n loadNode(nodeId) { // eslint-disable-line no-unused-vars\n throw new PSVError('loadNode not implemented');\n }\n\n /**\n * @summary Loades nodes linked to another node\n * @param {string} nodeId\n * @return {Promise}\n */\n loadLinkedNodes(nodeId) { // eslint-disable-line no-unused-vars\n throw new PSVError('loadLinkedNodes not implemented');\n }\n\n}\n","import { PSVError, utils } from 'photo-sphere-viewer';\n\n/**\n * @summary Checks the configuration of a node\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {boolean} isGps\n * @private\n */\nexport function checkNode(node, isGps) {\n if (!node.id) {\n throw new PSVError('No id given for node');\n }\n if (!node.panorama) {\n throw new PSVError(`No panorama provided for node ${node.id}`);\n }\n if (isGps && !(node.position?.length >= 2)) {\n throw new PSVError(`No position provided for node ${node.id}`);\n }\n}\n\n/**\n * @summary Checks the configuration of a link\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} link\n * @param {boolean} isGps\n * @private\n */\nexport function checkLink(node, link, isGps) {\n if (!link.nodeId) {\n throw new PSVError(`Link of node ${node.id} has no target id`);\n }\n if (!isGps && !utils.isExtendedPosition(link)) {\n throw new PSVError(`No position provided for link ${link.nodeId} of node ${node.id}`);\n }\n}\n\n/**\n * @summary Changes the color of a mesh\n * @param {external:THREE.Mesh} mesh\n * @param {*} color\n * @private\n */\nexport function setMeshColor(mesh, color) {\n mesh.material.color.set(color);\n}\n\n/**\n * @summary Returns the distance between two GPS points\n * @param {number[]} p1\n * @param {number[]} p2\n * @return {number}\n * @private\n */\nexport function distance(p1, p2) {\n return utils.greatArcDistance(p1, p2) * 6371e3;\n}\n\n/**\n * @summary Returns the bearing between two GPS points\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @param {number[]} p1\n * @param {number[]} p2\n * @return {number}\n * @private\n */\nexport function bearing(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const y = Math.sin(λ2 - λ1) * Math.cos(φ2);\n const x = Math.cos(φ1) * Math.sin(φ2) - Math.sin(φ1) * Math.cos(φ2) * Math.cos(λ2 - λ1);\n return Math.atan2(y, x);\n}\n","import { PSVError, utils } from 'photo-sphere-viewer';\nimport { AbstractDatasource } from './AbstractDatasource';\nimport { checkLink, checkNode } from './utils';\n\n/**\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @private\n */\nexport class ClientSideDatasource extends AbstractDatasource {\n\n loadNode(nodeId) {\n if (this.nodes[nodeId]) {\n return Promise.resolve(this.nodes[nodeId]);\n }\n else {\n return Promise.reject(new PSVError(`Node ${nodeId} not found`));\n }\n }\n\n loadLinkedNodes(nodeId) {\n if (!this.nodes[nodeId]) {\n return Promise.reject(new PSVError(`Node ${nodeId} not found`));\n }\n else {\n return Promise.resolve();\n }\n }\n\n setNodes(rawNodes) {\n if (!rawNodes?.length) {\n throw new PSVError('No nodes provided');\n }\n\n const nodes = {};\n const linkedNodes = {};\n\n rawNodes.forEach((node) => {\n checkNode(node, this.plugin.isGps());\n\n if (nodes[node.id]) {\n throw new PSVError(`Duplicate node ${node.id}`);\n }\n if (!node.links) {\n utils.logWarn(`Node ${node.id} has no links`);\n nodes.links = [];\n }\n\n nodes[node.id] = node;\n });\n\n rawNodes.forEach((node) => {\n node.links.forEach((link) => {\n checkLink(node, link, this.plugin.isGps());\n\n if (!nodes[link.nodeId]) {\n throw new PSVError(`Target node ${link.nodeId} of node ${node.id} does not exists`);\n }\n\n // copy essential data\n link.position = link.position || nodes[link.nodeId].position;\n link.name = link.name || nodes[link.nodeId].name;\n\n linkedNodes[link.nodeId] = true;\n });\n });\n\n rawNodes.forEach((node) => {\n if (!linkedNodes[node.id]) {\n utils.logWarn(`Node ${node.id} is never linked to`);\n }\n });\n\n this.nodes = nodes;\n }\n\n}\n","import * as THREE from 'three';\nimport arrowGeometryJson from './arrow.json';\nimport arrowIconSvg from './arrow.svg';\nimport arrowOutlineGeometryJson from './arrow_outline.json';\nimport nodesList from './nodes-list.svg';\n\n/**\n * @summary In client mode all the nodes are provided in the config or with the `setNodes` method\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_CLIENT = 'client';\n\n/**\n * @summary In server mode the nodes are fetched asynchronously\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_SERVER = 'server';\n\n/**\n * @summary In manual mode each link is positionned manually on the panorama\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_MANUAL = 'manual';\n\n/**\n * @summary In GPS mode each node is globally positionned and the links are automatically computed\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_GPS = 'gps';\n\n/**\n * @summaru In markers mode the links are represented using markers\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_MARKERS = 'markers';\n\n/**\n * @summaru In 3D mode the links are represented using 3d arrows\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_3D = '3d';\n\n/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event node-changed\n * @memberof PSV.plugins.VirtualTourPlugin\n * @summary Triggered when the current node changes\n * @param {string} nodeId\n */\n NODE_CHANGED : 'node-changed',\n /**\n * @event filter:render-nodes-list\n * @memberof PSV.plugins.VirtualTourPlugin\n * @summary Used to alter the list of nodes displayed on the side-panel\n * @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes\n * @returns {PSV.plugins.VirtualTourPlugin.Node[]}\n */\n RENDER_NODES_LIST: 'render-nodes-list',\n};\n\n/**\n * @summary Property name added to markers\n * @type {string}\n * @constant\n * @private\n */\nexport const LINK_DATA = 'tourLink';\n\n/**\n * @summary Default style of the link marker\n * @type {PSV.plugins.MarkersPlugin.Properties}\n * @constant\n * @private\n */\nexport const DEFAULT_MARKER = {\n html : arrowIconSvg,\n width : 80,\n height : 80,\n scale : [0.5, 2],\n anchor : 'top center',\n className: 'psv-virtual-tour__marker',\n style : {\n color: 'rgba(0, 208, 255, 0.8)',\n },\n};\n\n/**\n * @summary Default style of the link arrow\n * @type {PSV.plugins.VirtualTourPlugin.ArrowStyle}\n * @constant\n * @private\n */\nexport const DEFAULT_ARROW = {\n color : 0xaaaaaa,\n hoverColor : 0xaa5500,\n outlineColor: 0x000000,\n scale : [0.5, 2],\n};\n\n/**\n * @type {external:THREE.BufferedGeometry}\n * @constant\n * @private\n */\nexport const { ARROW_GEOM, ARROW_OUTLINE_GEOM } = (() => {\n const loader = new THREE.ObjectLoader();\n const geometries = loader.parseGeometries([arrowGeometryJson, arrowOutlineGeometryJson]);\n const arrow = geometries[arrowGeometryJson.uuid];\n const arrowOutline = geometries[arrowOutlineGeometryJson.uuid];\n const scale = 0.015;\n const rot = Math.PI / 2;\n arrow.scale(scale, scale, scale);\n arrow.rotateX(rot);\n arrowOutline.scale(scale, scale, scale);\n arrowOutline.rotateX(rot);\n return { ARROW_GEOM: arrow, ARROW_OUTLINE_GEOM: arrowOutline };\n})();\n\n/**\n * @summary Panel identifier for nodes list\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL_NODES_LIST = 'virtualTourNodesList';\n\n/**\n * @summary Nodes list template\n * @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes\n * @param {string} title\n * @param {string} currentNodeId\n * @returns {string}\n * @constant\n * @private\n */\nexport const NODES_LIST_TEMPLATE = (nodes, title, currentNodeId) => `\n
\n

${nodesList} ${title}

\n
    \n ${nodes.map(node => `\n
  • \n ${node.thumbnail ? `` : ''}\n ${node.caption || node.name}\n
  • \n `).join('')}\n
\n
\n`;\n","import { AbstractButton, CONSTANTS } from '../..';\nimport { ID_PANEL_NODES_LIST } from './constants';\nimport nodesList from './nodes-list.svg';\n\n/**\n * @summary Navigation bar markers list button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class NodesListButton extends AbstractButton {\n\n static id = 'nodesList';\n static icon = nodesList;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-nodes-list-button', true);\n\n /**\n * @type {PSV.plugins.VirtualTourPlugin}\n */\n this.plugin = this.psv.getPlugin('virtual-tour');\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin && !this.plugin.isServerSide();\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === ID_PANEL_NODES_LIST); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles nodes list\n */\n onClick() {\n this.plugin.toggleNodesList();\n }\n\n}\n","import { PSVError, utils } from 'photo-sphere-viewer';\nimport { AbstractDatasource } from './AbstractDatasource';\nimport { checkLink, checkNode } from './utils';\n\n/**\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @private\n */\nexport class ServerSideDatasource extends AbstractDatasource {\n\n constructor(plugin) {\n super(plugin);\n\n if (!plugin.config.getNode) {\n throw new PSVError('Missing getNode() option.');\n }\n\n this.nodeResolver = plugin.config.getNode;\n this.linksResolver = plugin.config.getLinks;\n }\n\n loadNode(nodeId) {\n if (this.nodes[nodeId]) {\n return Promise.resolve(this.nodes[nodeId]);\n }\n else {\n return Promise.resolve(this.nodeResolver(nodeId))\n .then((node) => {\n checkNode(node, this.plugin.isGps());\n this.nodes[nodeId] = node;\n return node;\n });\n }\n }\n\n loadLinkedNodes(nodeId) {\n if (!this.nodes[nodeId]) {\n return Promise.reject(new PSVError(`Node ${nodeId} not found`));\n }\n else if (this.nodes[nodeId].links) {\n return Promise.resolve();\n }\n else {\n if (!this.linksResolver) {\n this.nodes[nodeId].links = [];\n return Promise.resolve();\n }\n\n utils.logWarn(`getLinks() option is deprecated, instead make getNode() also return the node' links.`);\n\n return Promise.resolve(this.linksResolver(nodeId))\n .then(links => links || [])\n .then((links) => {\n const node = this.nodes[nodeId];\n\n links.forEach((link) => {\n checkLink(node, link, this.plugin.isGps());\n\n // copy essential data\n if (this.nodes[link.nodeId]) {\n link.position = link.position || this.nodes[link.nodeId].position;\n link.name = link.name || this.nodes[link.nodeId].name;\n }\n\n if (this.plugin.isGps() && !link.position) {\n throw new PSVError(`No GPS position provided for link ${link.nodeId} of node ${node.id}`);\n }\n });\n\n // store links\n node.links = links;\n });\n }\n }\n\n}\n","import * as THREE from 'three';\nimport { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..';\nimport { ClientSideDatasource } from './ClientSideDatasource';\nimport {\n ARROW_GEOM,\n ARROW_OUTLINE_GEOM,\n DEFAULT_ARROW,\n DEFAULT_MARKER,\n EVENTS,\n ID_PANEL_NODES_LIST,\n LINK_DATA,\n MODE_3D,\n MODE_CLIENT,\n MODE_GPS,\n MODE_MANUAL,\n MODE_MARKERS,\n MODE_SERVER,\n NODES_LIST_TEMPLATE\n} from './constants';\nimport { NodesListButton } from './NodesListButton';\nimport { ServerSideDatasource } from './ServerSideDatasource';\nimport './style.scss';\nimport { bearing, distance, setMeshColor } from './utils';\n\n\n/**\n * @callback GetNode\n * @summary Function to load a node\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @param {string} nodeId\n * @returns {PSV.plugins.VirtualTourPlugin.Node|Promise}\n */\n\n/**\n * @callback GetLinks\n * @summary Function to load the links of a node\n * @deprecated `getNode` must directly return the links of each node\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @param {string} nodeId\n * @returns {PSV.plugins.VirtualTourPlugin.NodeLink[]|Promise}\n */\n\n/**\n * @callback Preload\n * @summary Function to determine if a link must be preloaded\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} link\n * @returns {boolean}\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.Node\n * @summary Definition of a single node in the tour\n * @property {string} id - unique identifier of the node\n * @property {*} panorama\n * @property {PSV.plugins.VirtualTourPlugin.NodeLink[]} [links] - links to other nodes\n * @property {number[]} [position] - GPS position (longitude, latitude, optional altitude)\n * @property {PSV.PanoData | PSV.PanoDataProvider} [panoData] - data used for this panorama\n * @property {PSV.SphereCorrection} [sphereCorrection] - sphere correction to apply to this panorama\n * @property {string} [name] - short name of the node\n * @property {string} [caption] - caption visible in the navbar\n * @property {string} [description] - description visible in the side panel\n * @property {string} [thumbnail] - thumbnail for the nodes list in the side panel\n * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers] - additional markers to use on this node\n */\n\n/**\n * @typedef {PSV.ExtendedPosition} PSV.plugins.VirtualTourPlugin.NodeLink\n * @summary Definition of a link between two nodes\n * @property {string} nodeId - identifier of the target node\n * @property {string} [name] - override the name of the node (tooltip)\n * @property {number[]} [position] - override the GPS position of the node\n * @property {PSV.plugins.MarkersPlugin.Properties} [markerStyle] - override global marker style\n * @property {PSV.plugins.VirtualTourPlugin.ArrowStyle} [arrowStyle] - override global arrow style\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.ArrowStyle\n * @summary Style of the arrow in 3D mode\n * @property {string} [color=0xaaaaaa]\n * @property {string} [hoverColor=0xaa5500]\n * @property {number} [outlineColor=0x000000]\n * @property {number[]} [scale=[0.5,2]]\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.Options\n * @property {'client'|'server'} [dataMode='client'] - configure data mode\n * @property {'manual'|'gps'} [positionMode='manual'] - configure positioning mode\n * @property {'markers'|'3d'} [renderMode='3d'] - configure rendering mode of links\n * @property {PSV.plugins.VirtualTourPlugin.Node[]} [nodes] - initial nodes\n * @property {PSV.plugins.VirtualTourPlugin.GetNode} [getNode]\n * @property {PSV.plugins.VirtualTourPlugin.GetLinks} [getLinks] - Deprecated: `getNode` must directly return the links of each node\n * @property {string} [startNodeId] - id of the initial node, if not defined the first node will be used\n * @property {boolean|PSV.plugins.VirtualTourPlugin.Preload} [preload=false] - preload linked panoramas\n * @property {boolean|string|number} [rotateSpeed='20rpm'] - speed of rotation when clicking on a link, if 'false' the viewer won't rotate at all\n * @property {boolean|number} [transition=1500] - duration of the transition between nodes\n * @property {boolean} [linksOnCompass] - if the Compass plugin is enabled, displays the links on the compass, defaults to `true` on in markers render mode\n * @property {PSV.plugins.MarkersPlugin.Properties} [markerStyle] - global marker style\n * @property {PSV.plugins.VirtualTourPlugin.ArrowStyle} [arrowStyle] - global arrow style\n * @property {number} [markerLatOffset=-0.1] - (GPS & Markers mode) latitude offset applied to link markers, to compensate for viewer height\n * @property {'top'|'bottom'} [arrowPosition='bottom'] - (3D mode) arrows vertical position\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.NodeChangedData\n * @summary Data associated to the \"node-changed\" event\n * @type {PSV.plugins.VirtualTourPlugin.Node} [fromNode] - The previous node\n * @type {PSV.plugins.VirtualTourPlugin.NodeLink} [fromLink] - The link that was clicked in the previous node\n * @type {PSV.Position} [fromLinkPosition] - The position of the link on the previous node\n */\n\n// add markers buttons\nDEFAULTS.lang[NodesListButton.id] = 'Locations';\nregisterButton(NodesListButton, 'caption:left');\n\n\nexport { EVENTS, MODE_3D, MODE_CLIENT, MODE_GPS, MODE_MANUAL, MODE_MARKERS, MODE_SERVER } from './constants';\n\n\n/**\n * @summary Create virtual tours by linking multiple panoramas\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class VirtualTourPlugin extends AbstractPlugin {\n\n static id = 'virtual-tour';\n\n static EVENTS = EVENTS;\n static MODE_CLIENT = MODE_CLIENT;\n static MODE_SERVER = MODE_SERVER;\n static MODE_3D = MODE_3D;\n static MODE_MARKERS = MODE_MARKERS;\n static MODE_MANUAL = MODE_MANUAL;\n static MODE_GPS = MODE_GPS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.VirtualTourPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {Object}\n * @property {PSV.plugins.VirtualTourPlugin.Node} currentNode\n * @property {PSV.Tooltip} currentTooltip\n * @property {string} loadingNode\n * @property {function} stopObserver\n * @private\n */\n this.prop = {\n currentNode : null,\n currentTooltip: null,\n loadingNode : null,\n stopObserver : null,\n };\n\n /**\n * @type {Record}\n * @private\n */\n this.preload = {};\n\n /**\n * @member {PSV.plugins.VirtualTourPlugin.Options}\n * @private\n */\n this.config = {\n dataMode : MODE_CLIENT,\n positionMode : MODE_MANUAL,\n renderMode : MODE_3D,\n preload : false,\n rotateSpeed : '20rpm',\n transition : CONSTANTS.DEFAULT_TRANSITION,\n markerLatOffset: -0.1,\n arrowPosition : 'bottom',\n linksOnCompass : options?.renderMode === MODE_MARKERS,\n ...options,\n markerStyle : {\n ...DEFAULT_MARKER,\n ...options?.markerStyle,\n },\n arrowStyle : {\n ...DEFAULT_ARROW,\n ...options?.arrowStyle,\n },\n };\n\n if (options?.listButton === false) {\n utils.logWarn('VirtualTourPlugin: listButton option is deprecated. '\n + 'Please define the global navbar options according to your needs.');\n }\n if (options?.listButton === true && this.config.dataMode === MODE_SERVER) {\n utils.logWarn('VirtualTourPlugin: the list button is not supported in server mode.');\n }\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = null;\n\n /**\n * @type {PSV.plugins.CompassPlugin}\n * @private\n */\n this.compass = null;\n\n /**\n * @type {PSV.plugins.VirtualTourPlugin.AbstractDatasource}\n */\n this.datasource = null;\n\n /**\n * @type {external:THREE.Group}\n * @private\n */\n this.arrowsGroup = null;\n\n if (this.is3D()) {\n this.arrowsGroup = new THREE.Group();\n\n const localLight = new THREE.PointLight(0xffffff, 1, 0);\n localLight.position.set(0, this.config.arrowPosition === 'bottom' ? 2 : -2, 0);\n this.arrowsGroup.add(localLight);\n }\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.markers = this.psv.getPlugin('markers');\n this.compass = this.psv.getPlugin('compass');\n\n if (!this.is3D() && !this.markers) {\n throw new PSVError('Tour plugin requires the Markers plugin in markers mode');\n }\n\n this.datasource = this.isServerSide() ? new ServerSideDatasource(this) : new ClientSideDatasource(this);\n\n if (this.is3D()) {\n this.psv.once(CONSTANTS.EVENTS.READY, () => {\n this.__positionArrows();\n this.psv.renderer.scene.add(this.arrowsGroup);\n\n const ambientLight = new THREE.AmbientLight(0xffffff, 1);\n this.psv.renderer.scene.add(ambientLight);\n\n this.psv.needsUpdate();\n });\n\n this.psv.on(CONSTANTS.EVENTS.POSITION_UPDATED, this);\n this.psv.on(CONSTANTS.EVENTS.ZOOM_UPDATED, this);\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.prop.stopObserver = this.psv.observeObjects(LINK_DATA, this);\n }\n else {\n this.markers.on('select-marker', this);\n }\n\n if (this.isServerSide()) {\n if (this.config.startNodeId) {\n this.setCurrentNode(this.config.startNodeId);\n }\n }\n else if (this.config.nodes) {\n this.setNodes(this.config.nodes, this.config.startNodeId);\n delete this.config.nodes;\n }\n }\n\n /**\n * @package\n */\n destroy() {\n if (this.markers) {\n this.markers.off('select-marker', this);\n }\n if (this.arrowsGroup) {\n this.psv.renderer.scene.remove(this.arrowsGroup);\n }\n\n this.psv.off(CONSTANTS.EVENTS.POSITION_UPDATED, this);\n this.psv.off(CONSTANTS.EVENTS.ZOOM_UPDATED, this);\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.prop.stopObserver?.();\n\n this.datasource.destroy();\n\n delete this.preload;\n delete this.datasource;\n delete this.markers;\n delete this.compass;\n delete this.arrowsGroup;\n\n super.destroy();\n }\n\n handleEvent(e) {\n let link;\n switch (e.type) {\n case 'select-marker':\n link = e.args[0].data?.[LINK_DATA];\n if (link) {\n this.setCurrentNode(link.nodeId, link);\n }\n break;\n\n case CONSTANTS.EVENTS.POSITION_UPDATED:\n case CONSTANTS.EVENTS.ZOOM_UPDATED:\n if (this.arrowsGroup) {\n this.__positionArrows();\n }\n break;\n\n case CONSTANTS.EVENTS.CLICK:\n link = e.args[0].objects.find(o => o.userData[LINK_DATA])?.userData[LINK_DATA];\n if (link) {\n this.setCurrentNode(link.nodeId, link);\n }\n break;\n\n case CONSTANTS.OBJECT_EVENTS.ENTER_OBJECT:\n this.__onEnterObject(e.detail.object, e.detail.viewerPoint);\n break;\n case CONSTANTS.OBJECT_EVENTS.HOVER_OBJECT:\n this.__onHoverObject(e.detail.object, e.detail.viewerPoint);\n break;\n case CONSTANTS.OBJECT_EVENTS.LEAVE_OBJECT:\n this.__onLeaveObject(e.detail.object);\n break;\n\n default:\n }\n }\n\n /**\n * @summary Tests if running in server mode\n * @return {boolean}\n */\n isServerSide() {\n return this.config.dataMode === MODE_SERVER;\n }\n\n /**\n * @summary Tests if running in GPS mode\n * @return {boolean}\n */\n isGps() {\n return this.config.positionMode === MODE_GPS;\n }\n\n /**\n * @summary Tests if running in 3D mode\n * @return {boolean}\n */\n is3D() {\n return this.config.renderMode === MODE_3D;\n }\n\n /**\n * @summary Sets the nodes (client mode only)\n * @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes\n * @param {string} [startNodeId]\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n setNodes(nodes, startNodeId) {\n if (this.isServerSide()) {\n throw new PSVError('Cannot set nodes in server side mode');\n }\n\n this.datasource.setNodes(nodes);\n\n if (!startNodeId) {\n startNodeId = nodes[0].id;\n }\n else if (!this.datasource.nodes[startNodeId]) {\n startNodeId = nodes[0].id;\n utils.logWarn(`startNodeId not found is provided nodes, resetted to ${startNodeId}`);\n }\n\n this.setCurrentNode(startNodeId);\n }\n\n /**\n * @summary Changes the current node\n * @param {string} nodeId\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} [fromLink]\n * @returns {Promise} resolves false if the loading was aborted by another call\n */\n setCurrentNode(nodeId, fromLink = null) {\n if (nodeId === this.prop.currentNode?.id) {\n return Promise.resolve(true);\n }\n\n this.psv.hideError();\n\n this.prop.loadingNode = nodeId;\n\n const fromNode = this.prop.currentNode;\n const fromLinkPosition = fromNode && fromLink ? this.__getLinkPosition(fromNode, fromLink) : null;\n\n return Promise.all([\n // if this node is already preloading, wait for it\n Promise.resolve(this.preload[nodeId])\n .then(() => {\n if (this.prop.loadingNode !== nodeId) {\n throw utils.getAbortError();\n }\n\n return this.datasource.loadNode(nodeId);\n }),\n Promise.resolve(fromLinkPosition ? this.config.rotateSpeed : false)\n .then((speed) => { // eslint-disable-line consistent-return\n if (speed) {\n return this.psv.animate({ ...fromLinkPosition, speed });\n }\n })\n .then(() => {\n this.psv.loader.show();\n }),\n ])\n .then(([node]) => {\n if (this.prop.loadingNode !== nodeId) {\n throw utils.getAbortError();\n }\n\n this.prop.currentNode = node;\n\n if (this.prop.currentTooltip) {\n this.prop.currentTooltip.hide();\n this.prop.currentTooltip = null;\n }\n\n if (this.is3D()) {\n this.arrowsGroup.remove(...this.arrowsGroup.children.filter(o => o.type === 'Mesh'));\n }\n\n this.markers?.clearMarkers();\n this.compass?.clearHotspots();\n\n return Promise.all([\n this.psv.setPanorama(node.panorama, {\n transition : this.config.transition,\n caption : node.caption,\n description : node.description,\n panoData : node.panoData,\n sphereCorrection: node.sphereCorrection,\n })\n .then((completed) => {\n if (!completed) {\n throw utils.getAbortError();\n }\n }),\n this.datasource.loadLinkedNodes(nodeId),\n ]);\n })\n .then(() => {\n if (this.prop.loadingNode !== nodeId) {\n throw utils.getAbortError();\n }\n\n const node = this.prop.currentNode;\n\n if (node.markers) {\n if (this.markers) {\n this.markers.setMarkers(node.markers);\n }\n else {\n utils.logWarn(`Node ${node.id} markers ignored because the plugin is not loaded.`);\n }\n }\n\n this.__renderLinks(node);\n this.__preload(node);\n\n /**\n * @event node-changed\n * @memberof PSV.plugins.VirtualTourPlugin\n * @summary Triggered when the current node is changed\n * @param {string} nodeId\n * @param {PSV.plugins.VirtualTourPlugin.NodeChangedData} data\n */\n this.trigger(EVENTS.NODE_CHANGED, nodeId, {\n fromNode,\n fromLink,\n fromLinkPosition,\n });\n\n this.prop.loadingNode = null;\n\n return true;\n })\n .catch((err) => {\n if (utils.isAbortError(err)) {\n return false;\n }\n\n this.psv.showError(this.psv.config.lang.loadError);\n\n this.psv.loader.hide();\n this.psv.navbar.setCaption('');\n\n this.prop.loadingNode = null;\n\n throw err;\n });\n }\n\n /**\n * @summary Adds the links for the node\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @private\n */\n __renderLinks(node) {\n const positions = [];\n\n node.links.forEach((link) => {\n const position = this.__getLinkPosition(node, link);\n positions.push(position);\n\n if (this.is3D()) {\n const mesh = new THREE.Mesh(ARROW_GEOM, new THREE.MeshLambertMaterial());\n mesh.userData = { [LINK_DATA]: link, longitude: position.longitude };\n mesh.rotation.order = 'YXZ';\n mesh.rotateY(-position.longitude);\n this.psv.dataHelper\n .sphericalCoordsToVector3({ longitude: position.longitude, latitude: 0 }, mesh.position)\n .multiplyScalar(1 / CONSTANTS.SPHERE_RADIUS);\n\n const outlineMesh = new THREE.Mesh(ARROW_OUTLINE_GEOM, new THREE.MeshBasicMaterial({ side: THREE.BackSide }));\n outlineMesh.position.copy(mesh.position);\n outlineMesh.rotation.copy(mesh.rotation);\n\n setMeshColor(mesh, link.arrowStyle?.color || this.config.arrowStyle.color);\n setMeshColor(outlineMesh, link.arrowStyle?.outlineColor || this.config.arrowStyle.outlineColor);\n\n this.arrowsGroup.add(mesh);\n this.arrowsGroup.add(outlineMesh);\n }\n else {\n if (this.isGps()) {\n position.latitude += this.config.markerLatOffset;\n }\n\n this.markers.addMarker({\n ...this.config.markerStyle,\n ...link.markerStyle,\n id : `tour-link-${link.nodeId}`,\n tooltip : link.name,\n hideList: true,\n data : { [LINK_DATA]: link },\n ...position,\n }, false);\n }\n });\n\n if (this.is3D()) {\n this.__positionArrows();\n }\n else {\n this.markers.renderMarkers();\n }\n\n if (this.config.linksOnCompass && this.compass) {\n this.compass.setHotspots(positions);\n }\n }\n\n /**\n * @summary Computes the marker position for a link\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} link\n * @return {PSV.Position}\n * @private\n */\n __getLinkPosition(node, link) {\n if (this.isGps()) {\n const p1 = [THREE.MathUtils.degToRad(node.position[0]), THREE.MathUtils.degToRad(node.position[1])];\n const p2 = [THREE.MathUtils.degToRad(link.position[0]), THREE.MathUtils.degToRad(link.position[1])];\n const h1 = node.position[2] !== undefined ? node.position[2] : link.position[2] || 0;\n const h2 = link.position[2] !== undefined ? link.position[2] : node.position[2] || 0;\n\n let latitude = 0;\n if (h1 !== h2) {\n latitude = Math.atan((h2 - h1) / distance(p1, p2));\n }\n\n const longitude = bearing(p1, p2);\n\n return { longitude, latitude };\n }\n else {\n return this.psv.dataHelper.cleanPosition(link);\n }\n }\n\n /**\n * @private\n */\n __onEnterObject(mesh, viewerPoint) {\n const link = mesh.userData[LINK_DATA];\n\n setMeshColor(mesh, link.arrowStyle?.hoverColor || this.config.arrowStyle.hoverColor);\n\n if (link.name) {\n this.prop.currentTooltip = this.psv.tooltip.create({\n left : viewerPoint.x,\n top : viewerPoint.y,\n content: link.name,\n });\n }\n\n this.psv.needsUpdate();\n }\n\n\n /**\n * @private\n */\n __onHoverObject(mesh, viewerPoint) {\n if (this.prop.currentTooltip) {\n this.prop.currentTooltip.move({\n left: viewerPoint.x,\n top : viewerPoint.y,\n });\n }\n }\n\n\n /**\n * @private\n */\n __onLeaveObject(mesh) {\n const link = mesh.userData[LINK_DATA];\n\n setMeshColor(mesh, link.arrowStyle?.color || this.config.arrowStyle.color);\n\n if (this.prop.currentTooltip) {\n this.prop.currentTooltip.hide();\n this.prop.currentTooltip = null;\n }\n\n this.psv.needsUpdate();\n }\n\n /**\n * @summary Updates to position of the group of arrows\n * @private\n */\n __positionArrows() {\n this.arrowsGroup.position.copy(this.psv.prop.direction).multiplyScalar(0.5);\n const s = this.config.arrowStyle.scale;\n const f = s[1] + (s[0] - s[1]) * (this.psv.getZoomLevel() / 100);\n const y = 2.5 - (this.psv.getZoomLevel() / 100) * 1.5;\n this.arrowsGroup.position.y += this.config.arrowPosition === 'bottom' ? -y : y;\n this.arrowsGroup.scale.set(f, f, f);\n }\n\n /**\n * @summary Manage the preload of the linked panoramas\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @private\n */\n __preload(node) {\n if (!this.config.preload) {\n return;\n }\n\n this.preload[node.id] = true;\n\n this.prop.currentNode.links\n .filter(link => !this.preload[link.nodeId])\n .filter((link) => {\n if (typeof this.config.preload === 'function') {\n return this.config.preload(this.prop.currentNode, link);\n }\n else {\n return true;\n }\n })\n .forEach((link) => {\n this.preload[link.nodeId] = this.datasource.loadNode(link.nodeId)\n .then((linkNode) => {\n return this.psv.textureLoader.preloadPanorama(linkNode.panorama);\n })\n .then(() => {\n this.preload[link.nodeId] = true;\n })\n .catch(() => {\n delete this.preload[link.nodeId];\n });\n });\n }\n\n /**\n * @summary Toggles the visibility of the list of nodes\n */\n toggleNodesList() {\n if (this.psv.panel.prop.contentId === ID_PANEL_NODES_LIST) {\n this.hideNodesList();\n }\n else {\n this.showNodesList();\n }\n }\n\n /**\n * @summary Opens side panel with the list of nodes\n */\n showNodesList() {\n const nodes = this.change(EVENTS.RENDER_NODES_LIST, Object.values(this.datasource.nodes));\n\n this.psv.panel.show({\n id : ID_PANEL_NODES_LIST,\n content : NODES_LIST_TEMPLATE(\n nodes,\n this.psv.config.lang[NodesListButton.id],\n this.prop.currentNode?.id\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const nodeId = li ? li.dataset.nodeId : undefined;\n\n if (nodeId) {\n this.setCurrentNode(nodeId);\n this.hideNodesList();\n }\n },\n });\n }\n\n /**\n * @summary Closes side panel if it contains the list of nodes\n */\n hideNodesList() {\n this.psv.panel.hide(ID_PANEL_NODES_LIST);\n }\n\n}\n"],"names":["AbstractDatasource","plugin","nodes","destroy","loadNode","nodeId","PSVError","loadLinkedNodes","checkNode","node","isGps","id","panorama","position","length","checkLink","link","utils","isExtendedPosition","setMeshColor","mesh","color","material","set","distance","p1","p2","greatArcDistance","bearing","λ1","φ1","λ2","φ2","y","Math","sin","cos","x","atan2","ClientSideDatasource","Promise","resolve","reject","setNodes","rawNodes","linkedNodes","forEach","links","logWarn","name","MODE_CLIENT","MODE_SERVER","MODE_MANUAL","MODE_GPS","MODE_MARKERS","MODE_3D","EVENTS","NODE_CHANGED","RENDER_NODES_LIST","LINK_DATA","DEFAULT_MARKER","html","arrowIconSvg","width","height","scale","anchor","className","style","DEFAULT_ARROW","hoverColor","outlineColor","loader","THREE","ObjectLoader","geometries","parseGeometries","arrowGeometryJson","arrowOutlineGeometryJson","arrow","uuid","arrowOutline","rot","PI","rotateX","ARROW_GEOM","ARROW_OUTLINE_GEOM","ID_PANEL_NODES_LIST","NODES_LIST_TEMPLATE","title","currentNodeId","nodesList","map","thumbnail","caption","join","NodesListButton","navbar","psv","getPlugin","on","CONSTANTS","OPEN_PANEL","CLOSE_PANEL","off","isSupported","isServerSide","handleEvent","e","type","toggleActive","args","onClick","toggleNodesList","AbstractButton","icon","ServerSideDatasource","config","getNode","nodeResolver","linksResolver","getLinks","then","DEFAULTS","lang","registerButton","VirtualTourPlugin","options","prop","currentNode","currentTooltip","loadingNode","stopObserver","preload","dataMode","positionMode","renderMode","rotateSpeed","transition","DEFAULT_TRANSITION","markerLatOffset","arrowPosition","linksOnCompass","markerStyle","arrowStyle","listButton","markers","compass","datasource","arrowsGroup","is3D","Group","localLight","PointLight","add","init","once","READY","__positionArrows","renderer","scene","ambientLight","AmbientLight","needsUpdate","POSITION_UPDATED","ZOOM_UPDATED","CLICK","observeObjects","startNodeId","setCurrentNode","remove","data","objects","find","o","userData","OBJECT_EVENTS","ENTER_OBJECT","__onEnterObject","detail","object","viewerPoint","HOVER_OBJECT","__onHoverObject","LEAVE_OBJECT","__onLeaveObject","fromLink","hideError","fromNode","fromLinkPosition","__getLinkPosition","all","getAbortError","speed","animate","show","hide","children","filter","clearMarkers","clearHotspots","setPanorama","description","panoData","sphereCorrection","completed","setMarkers","__renderLinks","__preload","trigger","catch","err","isAbortError","showError","loadError","setCaption","positions","push","Mesh","MeshLambertMaterial","longitude","rotation","order","rotateY","dataHelper","sphericalCoordsToVector3","latitude","multiplyScalar","SPHERE_RADIUS","outlineMesh","MeshBasicMaterial","side","BackSide","copy","addMarker","tooltip","hideList","renderMarkers","setHotspots","MathUtils","degToRad","h1","undefined","h2","atan","cleanPosition","create","left","top","content","move","direction","s","f","getZoomLevel","linkNode","textureLoader","preloadPanorama","panel","contentId","hideNodesList","showNodesList","change","Object","values","noMargin","clickHandler","li","target","getClosest","dataset","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;;EACA,IAAaA,kBAAb,gBAAA,YAAA;EAEE;EACF;EACA;;EAGE;EACF;EACA;EACE,EAAA,SAAA,kBAAA,CAAYC,MAAZ,EAAoB;MAAA,IALpBC,CAAAA,KAKoB,GALZ,EAKY,CAAA;MAClB,IAAKD,CAAAA,MAAL,GAAcA,M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XwE,kBASJ1E,cAAcA;EATV0E,kBAUJzE,WAAWA;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"virtual-tour.js","sources":["../../src/plugins/virtual-tour/AbstractDatasource.js","../../src/plugins/virtual-tour/utils.js","../../src/plugins/virtual-tour/ClientSideDatasource.js","../../src/plugins/virtual-tour/constants.js","../../src/plugins/virtual-tour/NodesListButton.js","../../src/plugins/virtual-tour/ServerSideDatasource.js","../../src/plugins/virtual-tour/index.js"],"sourcesContent":["import { PSVError } from 'photo-sphere-viewer';\n\n/**\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @private\n */\nexport class AbstractDatasource {\n\n /**\n * @type {Record}\n */\n nodes = {};\n\n /**\n * @param {PSV.plugins.VirtualTourPlugin} plugin\n */\n constructor(plugin) {\n this.plugin = plugin;\n }\n\n destroy() {\n delete this.plugin;\n }\n\n /**\n * @summary Loads a node\n * @param {string} nodeId\n * @return {Promise}\n */\n loadNode(nodeId) { // eslint-disable-line no-unused-vars\n throw new PSVError('loadNode not implemented');\n }\n\n /**\n * @summary Loades nodes linked to another node\n * @param {string} nodeId\n * @return {Promise}\n */\n loadLinkedNodes(nodeId) { // eslint-disable-line no-unused-vars\n throw new PSVError('loadLinkedNodes not implemented');\n }\n\n}\n","import { PSVError, utils } from 'photo-sphere-viewer';\n\n/**\n * @summary Checks the configuration of a node\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {boolean} isGps\n * @private\n */\nexport function checkNode(node, isGps) {\n if (!node.id) {\n throw new PSVError('No id given for node');\n }\n if (!node.panorama) {\n throw new PSVError(`No panorama provided for node ${node.id}`);\n }\n if (isGps && !(node.position?.length >= 2)) {\n throw new PSVError(`No position provided for node ${node.id}`);\n }\n}\n\n/**\n * @summary Checks the configuration of a link\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} link\n * @param {boolean} isGps\n * @private\n */\nexport function checkLink(node, link, isGps) {\n if (!link.nodeId) {\n throw new PSVError(`Link of node ${node.id} has no target id`);\n }\n if (!isGps && !utils.isExtendedPosition(link)) {\n throw new PSVError(`No position provided for link ${link.nodeId} of node ${node.id}`);\n }\n}\n\n/**\n * @summary Changes the color of a mesh\n * @param {external:THREE.Mesh} mesh\n * @param {*} color\n * @private\n */\nexport function setMeshColor(mesh, color) {\n mesh.material.color.set(color);\n}\n\n/**\n * @summary Returns the distance between two GPS points\n * @param {number[]} p1\n * @param {number[]} p2\n * @return {number}\n * @private\n */\nexport function distance(p1, p2) {\n return utils.greatArcDistance(p1, p2) * 6371e3;\n}\n\n/**\n * @summary Returns the bearing between two GPS points\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n * @param {number[]} p1\n * @param {number[]} p2\n * @return {number}\n * @private\n */\nexport function bearing(p1, p2) {\n const [λ1, φ1] = p1;\n const [λ2, φ2] = p2;\n\n const y = Math.sin(λ2 - λ1) * Math.cos(φ2);\n const x = Math.cos(φ1) * Math.sin(φ2) - Math.sin(φ1) * Math.cos(φ2) * Math.cos(λ2 - λ1);\n return Math.atan2(y, x);\n}\n","import { PSVError, utils } from 'photo-sphere-viewer';\nimport { AbstractDatasource } from './AbstractDatasource';\nimport { checkLink, checkNode } from './utils';\n\n/**\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @private\n */\nexport class ClientSideDatasource extends AbstractDatasource {\n\n loadNode(nodeId) {\n if (this.nodes[nodeId]) {\n return Promise.resolve(this.nodes[nodeId]);\n }\n else {\n return Promise.reject(new PSVError(`Node ${nodeId} not found`));\n }\n }\n\n loadLinkedNodes(nodeId) {\n if (!this.nodes[nodeId]) {\n return Promise.reject(new PSVError(`Node ${nodeId} not found`));\n }\n else {\n return Promise.resolve();\n }\n }\n\n setNodes(rawNodes) {\n if (!rawNodes?.length) {\n throw new PSVError('No nodes provided');\n }\n\n const nodes = {};\n const linkedNodes = {};\n\n rawNodes.forEach((node) => {\n checkNode(node, this.plugin.isGps());\n\n if (nodes[node.id]) {\n throw new PSVError(`Duplicate node ${node.id}`);\n }\n if (!node.links) {\n utils.logWarn(`Node ${node.id} has no links`);\n nodes.links = [];\n }\n\n nodes[node.id] = node;\n });\n\n rawNodes.forEach((node) => {\n node.links.forEach((link) => {\n checkLink(node, link, this.plugin.isGps());\n\n if (!nodes[link.nodeId]) {\n throw new PSVError(`Target node ${link.nodeId} of node ${node.id} does not exists`);\n }\n\n // copy essential data\n link.position = link.position || nodes[link.nodeId].position;\n link.name = link.name || nodes[link.nodeId].name;\n\n linkedNodes[link.nodeId] = true;\n });\n });\n\n rawNodes.forEach((node) => {\n if (!linkedNodes[node.id]) {\n utils.logWarn(`Node ${node.id} is never linked to`);\n }\n });\n\n this.nodes = nodes;\n }\n\n}\n","import * as THREE from 'three';\nimport arrowGeometryJson from './arrow.json';\nimport arrowIconSvg from './arrow.svg';\nimport arrowOutlineGeometryJson from './arrow_outline.json';\nimport nodesList from './nodes-list.svg';\n\n/**\n * @summary In client mode all the nodes are provided in the config or with the `setNodes` method\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_CLIENT = 'client';\n\n/**\n * @summary In server mode the nodes are fetched asynchronously\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_SERVER = 'server';\n\n/**\n * @summary In manual mode each link is positionned manually on the panorama\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_MANUAL = 'manual';\n\n/**\n * @summary In GPS mode each node is globally positionned and the links are automatically computed\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_GPS = 'gps';\n\n/**\n * @summaru In markers mode the links are represented using markers\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_MARKERS = 'markers';\n\n/**\n * @summaru In 3D mode the links are represented using 3d arrows\n * @type {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const MODE_3D = '3d';\n\n/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.VirtualTourPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event node-changed\n * @memberof PSV.plugins.VirtualTourPlugin\n * @summary Triggered when the current node changes\n * @param {string} nodeId\n */\n NODE_CHANGED : 'node-changed',\n /**\n * @event filter:render-nodes-list\n * @memberof PSV.plugins.VirtualTourPlugin\n * @summary Used to alter the list of nodes displayed on the side-panel\n * @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes\n * @returns {PSV.plugins.VirtualTourPlugin.Node[]}\n */\n RENDER_NODES_LIST: 'render-nodes-list',\n};\n\n/**\n * @summary Property name added to markers\n * @type {string}\n * @constant\n * @private\n */\nexport const LINK_DATA = 'tourLink';\n\n/**\n * @summary Default style of the link marker\n * @type {PSV.plugins.MarkersPlugin.Properties}\n * @constant\n * @private\n */\nexport const DEFAULT_MARKER = {\n html : arrowIconSvg,\n width : 80,\n height : 80,\n scale : [0.5, 2],\n anchor : 'top center',\n className: 'psv-virtual-tour__marker',\n style : {\n color: 'rgba(0, 208, 255, 0.8)',\n },\n};\n\n/**\n * @summary Default style of the link arrow\n * @type {PSV.plugins.VirtualTourPlugin.ArrowStyle}\n * @constant\n * @private\n */\nexport const DEFAULT_ARROW = {\n color : 0xaaaaaa,\n hoverColor : 0xaa5500,\n outlineColor: 0x000000,\n scale : [0.5, 2],\n};\n\n/**\n * @type {external:THREE.BufferedGeometry}\n * @constant\n * @private\n */\nexport const { ARROW_GEOM, ARROW_OUTLINE_GEOM } = (() => {\n const loader = new THREE.ObjectLoader();\n const geometries = loader.parseGeometries([arrowGeometryJson, arrowOutlineGeometryJson]);\n const arrow = geometries[arrowGeometryJson.uuid];\n const arrowOutline = geometries[arrowOutlineGeometryJson.uuid];\n const scale = 0.015;\n const rot = Math.PI / 2;\n arrow.scale(scale, scale, scale);\n arrow.rotateX(rot);\n arrowOutline.scale(scale, scale, scale);\n arrowOutline.rotateX(rot);\n return { ARROW_GEOM: arrow, ARROW_OUTLINE_GEOM: arrowOutline };\n})();\n\n/**\n * @summary Panel identifier for nodes list\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL_NODES_LIST = 'virtualTourNodesList';\n\n/**\n * @summary Nodes list template\n * @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes\n * @param {string} title\n * @param {string} currentNodeId\n * @returns {string}\n * @constant\n * @private\n */\nexport const NODES_LIST_TEMPLATE = (nodes, title, currentNodeId) => `\n
\n

${nodesList} ${title}

\n
    \n ${nodes.map(node => `\n
  • \n ${node.thumbnail ? `` : ''}\n ${node.caption || node.name}\n
  • \n `).join('')}\n
\n
\n`;\n","import { AbstractButton, CONSTANTS } from '../..';\nimport { ID_PANEL_NODES_LIST } from './constants';\nimport nodesList from './nodes-list.svg';\n\n/**\n * @summary Navigation bar markers list button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class NodesListButton extends AbstractButton {\n\n static id = 'nodesList';\n static icon = nodesList;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-nodes-list-button', true);\n\n /**\n * @type {PSV.plugins.VirtualTourPlugin}\n */\n this.plugin = this.psv.getPlugin('virtual-tour');\n\n if (this.plugin) {\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.on(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n }\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n this.psv.off(CONSTANTS.EVENTS.CLOSE_PANEL, this);\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin && !this.plugin.isServerSide() && !this.plugin.gallery;\n }\n\n /**\n * @summary Handles events\n * @param {Event} e\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n // @formatter:off\n case CONSTANTS.EVENTS.OPEN_PANEL: this.toggleActive(e.args[0] === ID_PANEL_NODES_LIST); break;\n case CONSTANTS.EVENTS.CLOSE_PANEL: this.toggleActive(false); break;\n // @formatter:on\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @description Toggles nodes list\n */\n onClick() {\n this.plugin.toggleNodesList();\n }\n\n}\n","import { PSVError, utils } from 'photo-sphere-viewer';\nimport { AbstractDatasource } from './AbstractDatasource';\nimport { checkLink, checkNode } from './utils';\n\n/**\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @private\n */\nexport class ServerSideDatasource extends AbstractDatasource {\n\n constructor(plugin) {\n super(plugin);\n\n if (!plugin.config.getNode) {\n throw new PSVError('Missing getNode() option.');\n }\n\n this.nodeResolver = plugin.config.getNode;\n this.linksResolver = plugin.config.getLinks;\n }\n\n loadNode(nodeId) {\n if (this.nodes[nodeId]) {\n return Promise.resolve(this.nodes[nodeId]);\n }\n else {\n return Promise.resolve(this.nodeResolver(nodeId))\n .then((node) => {\n checkNode(node, this.plugin.isGps());\n this.nodes[nodeId] = node;\n return node;\n });\n }\n }\n\n loadLinkedNodes(nodeId) {\n if (!this.nodes[nodeId]) {\n return Promise.reject(new PSVError(`Node ${nodeId} not found`));\n }\n else if (this.nodes[nodeId].links) {\n return Promise.resolve();\n }\n else {\n if (!this.linksResolver) {\n this.nodes[nodeId].links = [];\n return Promise.resolve();\n }\n\n utils.logWarn(`getLinks() option is deprecated, instead make getNode() also return the node' links.`);\n\n return Promise.resolve(this.linksResolver(nodeId))\n .then(links => links || [])\n .then((links) => {\n const node = this.nodes[nodeId];\n\n links.forEach((link) => {\n checkLink(node, link, this.plugin.isGps());\n\n // copy essential data\n if (this.nodes[link.nodeId]) {\n link.position = link.position || this.nodes[link.nodeId].position;\n link.name = link.name || this.nodes[link.nodeId].name;\n }\n\n if (this.plugin.isGps() && !link.position) {\n throw new PSVError(`No GPS position provided for link ${link.nodeId} of node ${node.id}`);\n }\n });\n\n // store links\n node.links = links;\n });\n }\n }\n\n}\n","import * as THREE from 'three';\nimport { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..';\nimport { ClientSideDatasource } from './ClientSideDatasource';\nimport {\n ARROW_GEOM,\n ARROW_OUTLINE_GEOM,\n DEFAULT_ARROW,\n DEFAULT_MARKER,\n EVENTS,\n ID_PANEL_NODES_LIST,\n LINK_DATA,\n MODE_3D,\n MODE_CLIENT,\n MODE_GPS,\n MODE_MANUAL,\n MODE_MARKERS,\n MODE_SERVER,\n NODES_LIST_TEMPLATE\n} from './constants';\nimport { NodesListButton } from './NodesListButton';\nimport { ServerSideDatasource } from './ServerSideDatasource';\nimport './style.scss';\nimport { bearing, distance, setMeshColor } from './utils';\n\n\n/**\n * @callback GetNode\n * @summary Function to load a node\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @param {string} nodeId\n * @returns {PSV.plugins.VirtualTourPlugin.Node|Promise}\n */\n\n/**\n * @callback GetLinks\n * @summary Function to load the links of a node\n * @deprecated `getNode` must directly return the links of each node\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @param {string} nodeId\n * @returns {PSV.plugins.VirtualTourPlugin.NodeLink[]|Promise}\n */\n\n/**\n * @callback Preload\n * @summary Function to determine if a link must be preloaded\n * @memberOf PSV.plugins.VirtualTourPlugin\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} link\n * @returns {boolean}\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.Node\n * @summary Definition of a single node in the tour\n * @property {string} id - unique identifier of the node\n * @property {*} panorama\n * @property {PSV.plugins.VirtualTourPlugin.NodeLink[]} [links] - links to other nodes\n * @property {number[]} [position] - GPS position (longitude, latitude, optional altitude)\n * @property {PSV.PanoData | PSV.PanoDataProvider} [panoData] - data used for this panorama\n * @property {PSV.SphereCorrection} [sphereCorrection] - sphere correction to apply to this panorama\n * @property {string} [name] - short name of the node\n * @property {string} [caption] - caption visible in the navbar\n * @property {string} [description] - description visible in the side panel\n * @property {string} [thumbnail] - thumbnail for the nodes list in the side panel\n * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers] - additional markers to use on this node\n */\n\n/**\n * @typedef {PSV.ExtendedPosition} PSV.plugins.VirtualTourPlugin.NodeLink\n * @summary Definition of a link between two nodes\n * @property {string} nodeId - identifier of the target node\n * @property {string} [name] - override the name of the node (tooltip)\n * @property {number[]} [position] - override the GPS position of the node\n * @property {PSV.plugins.MarkersPlugin.Properties} [markerStyle] - override global marker style\n * @property {PSV.plugins.VirtualTourPlugin.ArrowStyle} [arrowStyle] - override global arrow style\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.ArrowStyle\n * @summary Style of the arrow in 3D mode\n * @property {string} [color=0xaaaaaa]\n * @property {string} [hoverColor=0xaa5500]\n * @property {number} [outlineColor=0x000000]\n * @property {number[]} [scale=[0.5,2]]\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.Options\n * @property {'client'|'server'} [dataMode='client'] - configure data mode\n * @property {'manual'|'gps'} [positionMode='manual'] - configure positioning mode\n * @property {'markers'|'3d'} [renderMode='3d'] - configure rendering mode of links\n * @property {PSV.plugins.VirtualTourPlugin.Node[]} [nodes] - initial nodes\n * @property {PSV.plugins.VirtualTourPlugin.GetNode} [getNode]\n * @property {PSV.plugins.VirtualTourPlugin.GetLinks} [getLinks] - Deprecated: `getNode` must directly return the links of each node\n * @property {string} [startNodeId] - id of the initial node, if not defined the first node will be used\n * @property {boolean|PSV.plugins.VirtualTourPlugin.Preload} [preload=false] - preload linked panoramas\n * @property {boolean|string|number} [rotateSpeed='20rpm'] - speed of rotation when clicking on a link, if 'false' the viewer won't rotate at all\n * @property {boolean|number} [transition=1500] - duration of the transition between nodes\n * @property {boolean} [linksOnCompass] - if the Compass plugin is enabled, displays the links on the compass, defaults to `true` on in markers render mode\n * @property {PSV.plugins.MarkersPlugin.Properties} [markerStyle] - global marker style\n * @property {PSV.plugins.VirtualTourPlugin.ArrowStyle} [arrowStyle] - global arrow style\n * @property {number} [markerLatOffset=-0.1] - (GPS & Markers mode) latitude offset applied to link markers, to compensate for viewer height\n * @property {'top'|'bottom'} [arrowPosition='bottom'] - (3D mode) arrows vertical position\n */\n\n/**\n * @typedef {Object} PSV.plugins.VirtualTourPlugin.NodeChangedData\n * @summary Data associated to the \"node-changed\" event\n * @type {PSV.plugins.VirtualTourPlugin.Node} [fromNode] - The previous node\n * @type {PSV.plugins.VirtualTourPlugin.NodeLink} [fromLink] - The link that was clicked in the previous node\n * @type {PSV.Position} [fromLinkPosition] - The position of the link on the previous node\n */\n\n// add markers buttons\nDEFAULTS.lang[NodesListButton.id] = 'Locations';\nregisterButton(NodesListButton, 'caption:left');\n\n\nexport { EVENTS, MODE_3D, MODE_CLIENT, MODE_GPS, MODE_MANUAL, MODE_MARKERS, MODE_SERVER } from './constants';\n\n\n/**\n * @summary Create virtual tours by linking multiple panoramas\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class VirtualTourPlugin extends AbstractPlugin {\n\n static id = 'virtual-tour';\n\n static EVENTS = EVENTS;\n static MODE_CLIENT = MODE_CLIENT;\n static MODE_SERVER = MODE_SERVER;\n static MODE_3D = MODE_3D;\n static MODE_MARKERS = MODE_MARKERS;\n static MODE_MANUAL = MODE_MANUAL;\n static MODE_GPS = MODE_GPS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.VirtualTourPlugin.Options} [options]\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {Object}\n * @property {PSV.plugins.VirtualTourPlugin.Node} currentNode\n * @property {PSV.Tooltip} currentTooltip\n * @property {string} loadingNode\n * @property {function} stopObserver\n * @private\n */\n this.prop = {\n currentNode : null,\n currentTooltip: null,\n loadingNode : null,\n stopObserver : null,\n };\n\n /**\n * @type {Record}\n * @private\n */\n this.preload = {};\n\n /**\n * @member {PSV.plugins.VirtualTourPlugin.Options}\n * @private\n */\n this.config = {\n dataMode : MODE_CLIENT,\n positionMode : MODE_MANUAL,\n renderMode : MODE_3D,\n preload : false,\n rotateSpeed : '20rpm',\n transition : CONSTANTS.DEFAULT_TRANSITION,\n markerLatOffset: -0.1,\n arrowPosition : 'bottom',\n linksOnCompass : options?.renderMode === MODE_MARKERS,\n ...options,\n markerStyle : {\n ...DEFAULT_MARKER,\n ...options?.markerStyle,\n },\n arrowStyle : {\n ...DEFAULT_ARROW,\n ...options?.arrowStyle,\n },\n };\n\n if (options?.listButton === false) {\n utils.logWarn('VirtualTourPlugin: listButton option is deprecated. '\n + 'Please define the global navbar options according to your needs.');\n }\n if (options?.listButton === true && this.config.dataMode === MODE_SERVER) {\n utils.logWarn('VirtualTourPlugin: the list button is not supported in server mode.');\n }\n\n /**\n * @type {PSV.plugins.MarkersPlugin}\n * @private\n */\n this.markers = null;\n\n /**\n * @type {PSV.plugins.CompassPlugin}\n * @private\n */\n this.compass = null;\n\n /**\n * @type {PSV.plugins.GalleryPlugin}\n * @private\n */\n this.gallery = null;\n\n /**\n * @type {PSV.plugins.VirtualTourPlugin.AbstractDatasource}\n */\n this.datasource = null;\n\n /**\n * @type {external:THREE.Group}\n * @private\n */\n this.arrowsGroup = null;\n\n if (this.is3D()) {\n this.arrowsGroup = new THREE.Group();\n\n const localLight = new THREE.PointLight(0xffffff, 1, 0);\n localLight.position.set(0, this.config.arrowPosition === 'bottom' ? 2 : -2, 0);\n this.arrowsGroup.add(localLight);\n }\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.markers = this.psv.getPlugin('markers');\n this.compass = this.psv.getPlugin('compass');\n this.gallery = this.psv.getPlugin('gallery');\n\n if (!this.is3D() && !this.markers) {\n throw new PSVError('Tour plugin requires the Markers plugin in markers mode');\n }\n\n this.datasource = this.isServerSide() ? new ServerSideDatasource(this) : new ClientSideDatasource(this);\n\n if (this.is3D()) {\n this.psv.once(CONSTANTS.EVENTS.READY, () => {\n this.__positionArrows();\n this.psv.renderer.scene.add(this.arrowsGroup);\n\n const ambientLight = new THREE.AmbientLight(0xffffff, 1);\n this.psv.renderer.scene.add(ambientLight);\n\n this.psv.needsUpdate();\n });\n\n this.psv.on(CONSTANTS.EVENTS.POSITION_UPDATED, this);\n this.psv.on(CONSTANTS.EVENTS.ZOOM_UPDATED, this);\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.prop.stopObserver = this.psv.observeObjects(LINK_DATA, this);\n }\n else {\n this.markers.on('select-marker', this);\n }\n\n if (this.isServerSide()) {\n if (this.config.startNodeId) {\n this.setCurrentNode(this.config.startNodeId);\n }\n }\n else if (this.config.nodes) {\n this.setNodes(this.config.nodes, this.config.startNodeId);\n delete this.config.nodes;\n }\n }\n\n /**\n * @package\n */\n destroy() {\n if (this.markers) {\n this.markers.off('select-marker', this);\n }\n if (this.arrowsGroup) {\n this.psv.renderer.scene.remove(this.arrowsGroup);\n }\n\n this.psv.off(CONSTANTS.EVENTS.POSITION_UPDATED, this);\n this.psv.off(CONSTANTS.EVENTS.ZOOM_UPDATED, this);\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.prop.stopObserver?.();\n\n this.datasource.destroy();\n\n delete this.preload;\n delete this.datasource;\n delete this.markers;\n delete this.compass;\n delete this.gallery;\n delete this.arrowsGroup;\n\n super.destroy();\n }\n\n handleEvent(e) {\n let link;\n switch (e.type) {\n case 'select-marker':\n link = e.args[0].data?.[LINK_DATA];\n if (link) {\n this.setCurrentNode(link.nodeId, link);\n }\n break;\n\n case CONSTANTS.EVENTS.POSITION_UPDATED:\n case CONSTANTS.EVENTS.ZOOM_UPDATED:\n if (this.arrowsGroup) {\n this.__positionArrows();\n }\n break;\n\n case CONSTANTS.EVENTS.CLICK:\n link = e.args[0].objects.find(o => o.userData[LINK_DATA])?.userData[LINK_DATA];\n if (link) {\n this.setCurrentNode(link.nodeId, link);\n }\n break;\n\n case CONSTANTS.OBJECT_EVENTS.ENTER_OBJECT:\n this.__onEnterObject(e.detail.object, e.detail.viewerPoint);\n break;\n case CONSTANTS.OBJECT_EVENTS.HOVER_OBJECT:\n this.__onHoverObject(e.detail.object, e.detail.viewerPoint);\n break;\n case CONSTANTS.OBJECT_EVENTS.LEAVE_OBJECT:\n this.__onLeaveObject(e.detail.object);\n break;\n\n default:\n }\n }\n\n /**\n * @summary Tests if running in server mode\n * @return {boolean}\n */\n isServerSide() {\n return this.config.dataMode === MODE_SERVER;\n }\n\n /**\n * @summary Tests if running in GPS mode\n * @return {boolean}\n */\n isGps() {\n return this.config.positionMode === MODE_GPS;\n }\n\n /**\n * @summary Tests if running in 3D mode\n * @return {boolean}\n */\n is3D() {\n return this.config.renderMode === MODE_3D;\n }\n\n /**\n * @summary Sets the nodes (client mode only)\n * @param {PSV.plugins.VirtualTourPlugin.Node[]} nodes\n * @param {string} [startNodeId]\n * @throws {PSV.PSVError} when the configuration is incorrect\n */\n setNodes(nodes, startNodeId) {\n if (this.isServerSide()) {\n throw new PSVError('Cannot set nodes in server side mode');\n }\n\n this.datasource.setNodes(nodes);\n\n if (!startNodeId) {\n startNodeId = nodes[0].id;\n }\n else if (!this.datasource.nodes[startNodeId]) {\n startNodeId = nodes[0].id;\n utils.logWarn(`startNodeId not found is provided nodes, resetted to ${startNodeId}`);\n }\n\n this.setCurrentNode(startNodeId);\n\n if (this.gallery) {\n this.gallery.setItems(\n nodes.map(node => ({\n id : node.id,\n panorama : node.panorama,\n name : node.name,\n thumbnail: node.thumbnail,\n options : {\n caption : node.caption,\n panoData : node.panoData,\n sphereCorrection: node.sphereCorrection,\n description : node.description,\n },\n })),\n id => this.setCurrentNode(id)\n );\n }\n }\n\n /**\n * @summary Changes the current node\n * @param {string} nodeId\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} [fromLink]\n * @returns {Promise} resolves false if the loading was aborted by another call\n */\n setCurrentNode(nodeId, fromLink = null) {\n if (nodeId === this.prop.currentNode?.id) {\n return Promise.resolve(true);\n }\n\n this.psv.hideError();\n\n this.prop.loadingNode = nodeId;\n\n const fromNode = this.prop.currentNode;\n const fromLinkPosition = fromNode && fromLink ? this.__getLinkPosition(fromNode, fromLink) : null;\n\n return Promise.all([\n // if this node is already preloading, wait for it\n Promise.resolve(this.preload[nodeId])\n .then(() => {\n if (this.prop.loadingNode !== nodeId) {\n throw utils.getAbortError();\n }\n\n return this.datasource.loadNode(nodeId);\n }),\n Promise.resolve(fromLinkPosition ? this.config.rotateSpeed : false)\n .then((speed) => { // eslint-disable-line consistent-return\n if (speed) {\n return this.psv.animate({ ...fromLinkPosition, speed });\n }\n })\n .then(() => {\n this.psv.loader.show();\n }),\n ])\n .then(([node]) => {\n if (this.prop.loadingNode !== nodeId) {\n throw utils.getAbortError();\n }\n\n this.prop.currentNode = node;\n\n if (this.prop.currentTooltip) {\n this.prop.currentTooltip.hide();\n this.prop.currentTooltip = null;\n }\n\n if (this.is3D()) {\n this.arrowsGroup.remove(...this.arrowsGroup.children.filter(o => o.type === 'Mesh'));\n }\n\n this.markers?.clearMarkers();\n this.compass?.clearHotspots();\n\n return Promise.all([\n this.psv.setPanorama(node.panorama, {\n transition : this.config.transition,\n caption : node.caption,\n description : node.description,\n panoData : node.panoData,\n sphereCorrection: node.sphereCorrection,\n })\n .then((completed) => {\n if (!completed) {\n throw utils.getAbortError();\n }\n }),\n this.datasource.loadLinkedNodes(nodeId),\n ]);\n })\n .then(() => {\n if (this.prop.loadingNode !== nodeId) {\n throw utils.getAbortError();\n }\n\n const node = this.prop.currentNode;\n\n if (node.markers) {\n if (this.markers) {\n this.markers.setMarkers(node.markers);\n }\n else {\n utils.logWarn(`Node ${node.id} markers ignored because the plugin is not loaded.`);\n }\n }\n\n this.__renderLinks(node);\n this.__preload(node);\n\n /**\n * @event node-changed\n * @memberof PSV.plugins.VirtualTourPlugin\n * @summary Triggered when the current node is changed\n * @param {string} nodeId\n * @param {PSV.plugins.VirtualTourPlugin.NodeChangedData} data\n */\n this.trigger(EVENTS.NODE_CHANGED, nodeId, {\n fromNode,\n fromLink,\n fromLinkPosition,\n });\n\n this.prop.loadingNode = null;\n\n return true;\n })\n .catch((err) => {\n if (utils.isAbortError(err)) {\n return false;\n }\n\n this.psv.showError(this.psv.config.lang.loadError);\n\n this.psv.loader.hide();\n this.psv.navbar.setCaption('');\n\n this.prop.loadingNode = null;\n\n throw err;\n });\n }\n\n /**\n * @summary Adds the links for the node\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @private\n */\n __renderLinks(node) {\n const positions = [];\n\n node.links.forEach((link) => {\n const position = this.__getLinkPosition(node, link);\n positions.push(position);\n\n if (this.is3D()) {\n const mesh = new THREE.Mesh(ARROW_GEOM, new THREE.MeshLambertMaterial());\n mesh.userData = { [LINK_DATA]: link, longitude: position.longitude };\n mesh.rotation.order = 'YXZ';\n mesh.rotateY(-position.longitude);\n this.psv.dataHelper\n .sphericalCoordsToVector3({ longitude: position.longitude, latitude: 0 }, mesh.position)\n .multiplyScalar(1 / CONSTANTS.SPHERE_RADIUS);\n\n const outlineMesh = new THREE.Mesh(ARROW_OUTLINE_GEOM, new THREE.MeshBasicMaterial({ side: THREE.BackSide }));\n outlineMesh.position.copy(mesh.position);\n outlineMesh.rotation.copy(mesh.rotation);\n\n setMeshColor(mesh, link.arrowStyle?.color || this.config.arrowStyle.color);\n setMeshColor(outlineMesh, link.arrowStyle?.outlineColor || this.config.arrowStyle.outlineColor);\n\n this.arrowsGroup.add(mesh);\n this.arrowsGroup.add(outlineMesh);\n }\n else {\n if (this.isGps()) {\n position.latitude += this.config.markerLatOffset;\n }\n\n this.markers.addMarker({\n ...this.config.markerStyle,\n ...link.markerStyle,\n id : `tour-link-${link.nodeId}`,\n tooltip : link.name,\n hideList: true,\n data : { [LINK_DATA]: link },\n ...position,\n }, false);\n }\n });\n\n if (this.is3D()) {\n this.__positionArrows();\n }\n else {\n this.markers.renderMarkers();\n }\n\n if (this.config.linksOnCompass && this.compass) {\n this.compass.setHotspots(positions);\n }\n }\n\n /**\n * @summary Computes the marker position for a link\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @param {PSV.plugins.VirtualTourPlugin.NodeLink} link\n * @return {PSV.Position}\n * @private\n */\n __getLinkPosition(node, link) {\n if (this.isGps()) {\n const p1 = [THREE.MathUtils.degToRad(node.position[0]), THREE.MathUtils.degToRad(node.position[1])];\n const p2 = [THREE.MathUtils.degToRad(link.position[0]), THREE.MathUtils.degToRad(link.position[1])];\n const h1 = node.position[2] !== undefined ? node.position[2] : link.position[2] || 0;\n const h2 = link.position[2] !== undefined ? link.position[2] : node.position[2] || 0;\n\n let latitude = 0;\n if (h1 !== h2) {\n latitude = Math.atan((h2 - h1) / distance(p1, p2));\n }\n\n const longitude = bearing(p1, p2);\n\n return { longitude, latitude };\n }\n else {\n return this.psv.dataHelper.cleanPosition(link);\n }\n }\n\n /**\n * @private\n */\n __onEnterObject(mesh, viewerPoint) {\n const link = mesh.userData[LINK_DATA];\n\n setMeshColor(mesh, link.arrowStyle?.hoverColor || this.config.arrowStyle.hoverColor);\n\n if (link.name) {\n this.prop.currentTooltip = this.psv.tooltip.create({\n left : viewerPoint.x,\n top : viewerPoint.y,\n content: link.name,\n });\n }\n\n this.psv.needsUpdate();\n }\n\n\n /**\n * @private\n */\n __onHoverObject(mesh, viewerPoint) {\n if (this.prop.currentTooltip) {\n this.prop.currentTooltip.move({\n left: viewerPoint.x,\n top : viewerPoint.y,\n });\n }\n }\n\n\n /**\n * @private\n */\n __onLeaveObject(mesh) {\n const link = mesh.userData[LINK_DATA];\n\n setMeshColor(mesh, link.arrowStyle?.color || this.config.arrowStyle.color);\n\n if (this.prop.currentTooltip) {\n this.prop.currentTooltip.hide();\n this.prop.currentTooltip = null;\n }\n\n this.psv.needsUpdate();\n }\n\n /**\n * @summary Updates to position of the group of arrows\n * @private\n */\n __positionArrows() {\n this.arrowsGroup.position.copy(this.psv.prop.direction).multiplyScalar(0.5);\n const s = this.config.arrowStyle.scale;\n const f = s[1] + (s[0] - s[1]) * (this.psv.getZoomLevel() / 100);\n const y = 2.5 - (this.psv.getZoomLevel() / 100) * 1.5;\n this.arrowsGroup.position.y += this.config.arrowPosition === 'bottom' ? -y : y;\n this.arrowsGroup.scale.set(f, f, f);\n }\n\n /**\n * @summary Manage the preload of the linked panoramas\n * @param {PSV.plugins.VirtualTourPlugin.Node} node\n * @private\n */\n __preload(node) {\n if (!this.config.preload) {\n return;\n }\n\n this.preload[node.id] = true;\n\n this.prop.currentNode.links\n .filter(link => !this.preload[link.nodeId])\n .filter((link) => {\n if (typeof this.config.preload === 'function') {\n return this.config.preload(this.prop.currentNode, link);\n }\n else {\n return true;\n }\n })\n .forEach((link) => {\n this.preload[link.nodeId] = this.datasource.loadNode(link.nodeId)\n .then((linkNode) => {\n return this.psv.textureLoader.preloadPanorama(linkNode.panorama);\n })\n .then(() => {\n this.preload[link.nodeId] = true;\n })\n .catch(() => {\n delete this.preload[link.nodeId];\n });\n });\n }\n\n /**\n * @summary Toggles the visibility of the list of nodes\n */\n toggleNodesList() {\n if (this.psv.panel.prop.contentId === ID_PANEL_NODES_LIST) {\n this.hideNodesList();\n }\n else {\n this.showNodesList();\n }\n }\n\n /**\n * @summary Opens side panel with the list of nodes\n */\n showNodesList() {\n utils.logWarn(`Starting from next version, the VirtualTourPlugin will require the GalleryPlugin to display the list of nodes.`);\n\n const nodes = this.change(EVENTS.RENDER_NODES_LIST, Object.values(this.datasource.nodes));\n\n this.psv.panel.show({\n id : ID_PANEL_NODES_LIST,\n content : NODES_LIST_TEMPLATE(\n nodes,\n this.psv.config.lang[NodesListButton.id],\n this.prop.currentNode?.id\n ),\n noMargin : true,\n clickHandler: (e) => {\n const li = e.target ? utils.getClosest(e.target, 'li') : undefined;\n const nodeId = li ? li.dataset.nodeId : undefined;\n\n if (nodeId) {\n this.setCurrentNode(nodeId);\n this.hideNodesList();\n }\n },\n });\n }\n\n /**\n * @summary Closes side panel if it contains the list of nodes\n */\n hideNodesList() {\n this.psv.panel.hide(ID_PANEL_NODES_LIST);\n }\n\n}\n"],"names":["AbstractDatasource","plugin","nodes","destroy","loadNode","nodeId","PSVError","loadLinkedNodes","checkNode","node","isGps","id","panorama","position","length","checkLink","link","utils","isExtendedPosition","setMeshColor","mesh","color","material","set","distance","p1","p2","greatArcDistance","bearing","λ1","φ1","λ2","φ2","y","Math","sin","cos","x","atan2","ClientSideDatasource","Promise","resolve","reject","setNodes","rawNodes","linkedNodes","forEach","links","logWarn","name","MODE_CLIENT","MODE_SERVER","MODE_MANUAL","MODE_GPS","MODE_MARKERS","MODE_3D","EVENTS","NODE_CHANGED","RENDER_NODES_LIST","LINK_DATA","DEFAULT_MARKER","html","arrowIconSvg","width","height","scale","anchor","className","style","DEFAULT_ARROW","hoverColor","outlineColor","loader","THREE","ObjectLoader","geometries","parseGeometries","arrowGeometryJson","arrowOutlineGeometryJson","arrow","uuid","arrowOutline","rot","PI","rotateX","ARROW_GEOM","ARROW_OUTLINE_GEOM","ID_PANEL_NODES_LIST","NODES_LIST_TEMPLATE","title","currentNodeId","nodesList","map","thumbnail","caption","join","NodesListButton","navbar","psv","getPlugin","on","CONSTANTS","OPEN_PANEL","CLOSE_PANEL","off","isSupported","isServerSide","gallery","handleEvent","e","type","toggleActive","args","onClick","toggleNodesList","AbstractButton","icon","ServerSideDatasource","config","getNode","nodeResolver","linksResolver","getLinks","then","DEFAULTS","lang","registerButton","VirtualTourPlugin","options","prop","currentNode","currentTooltip","loadingNode","stopObserver","preload","dataMode","positionMode","renderMode","rotateSpeed","transition","DEFAULT_TRANSITION","markerLatOffset","arrowPosition","linksOnCompass","markerStyle","arrowStyle","listButton","markers","compass","datasource","arrowsGroup","is3D","Group","localLight","PointLight","add","init","once","READY","__positionArrows","renderer","scene","ambientLight","AmbientLight","needsUpdate","POSITION_UPDATED","ZOOM_UPDATED","CLICK","observeObjects","startNodeId","setCurrentNode","remove","data","objects","find","o","userData","OBJECT_EVENTS","ENTER_OBJECT","__onEnterObject","detail","object","viewerPoint","HOVER_OBJECT","__onHoverObject","LEAVE_OBJECT","__onLeaveObject","setItems","panoData","sphereCorrection","description","fromLink","hideError","fromNode","fromLinkPosition","__getLinkPosition","all","getAbortError","speed","animate","show","hide","children","filter","clearMarkers","clearHotspots","setPanorama","completed","setMarkers","__renderLinks","__preload","trigger","catch","err","isAbortError","showError","loadError","setCaption","positions","push","Mesh","MeshLambertMaterial","longitude","rotation","order","rotateY","dataHelper","sphericalCoordsToVector3","latitude","multiplyScalar","SPHERE_RADIUS","outlineMesh","MeshBasicMaterial","side","BackSide","copy","addMarker","tooltip","hideList","renderMarkers","setHotspots","MathUtils","degToRad","h1","undefined","h2","atan","cleanPosition","create","left","top","content","move","direction","s","f","getZoomLevel","linkNode","textureLoader","preloadPanorama","panel","contentId","hideNodesList","showNodesList","change","Object","values","noMargin","clickHandler","li","target","getClosest","dataset","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;;EACA,IAAaA,kBAAb,gBAAA,YAAA;EAEE;EACF;EACA;;EAGE;EACF;EACA;EACE,EAAA,SAAA,kBAAA,CAAYC,MAAZ,EAAoB;MAAA,IALpBC,CAAAA,KAKoB,GALZ,EAKY,CAAA;MAClB,IAAKD,CAAAA,MAAL,GAAcA,MAAd,CAAA;EACD,GAAA;;EAZH,EAAA,IAAA,MAAA,GAAA,kBAAA,CAAA,SAAA,CAAA;;IAAA,MAcEE,CAAAA,OAdF,GAcE,SAAU,OAAA,GAAA;EACR,IAAA,OAAO,KAAKF,MAAZ,CAAA;EACD,GAAA;EAED;EACF;EACA;EACA;EACA;EAtBA,GAAA;;EAAA,EAAA,MAAA,CAuBEG,QAvBF,GAuBE,SAASC,QAAAA,CAAAA,MAAT,EAAiB;EAAE;EACjB,IAAA,MAAM,IAAIC,0BAAJ,CAAa,0BAAb,CAAN,CAAA;EACD,GAAA;EAED;EACF;EACA;EACA;EACA;EA/BA,GAAA;;EAAA,EAAA,MAAA,CAgCEC,eAhCF,GAgCE,SAAgBF,eAAAA,CAAAA,MAAhB,EAAwB;EAAE;EACxB,IAAA,MA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,CAAA,CAAA;;EACA,UAAA,MAAI,CAACiQ,aAAL,EAAA,CAAA;EACD,SAAA;EACF,OAAA;OAhBH,CAAA,CAAA;EAkBD,GAAA;EAED;EACF;EACA;EAnoBA,GAAA;;IAAA,MAooBEA,CAAAA,aApoBF,GAooBE,SAAgB,aAAA,GAAA;EACd,IAAA,IAAA,CAAKpK,GAAL,CAASkK,KAAT,CAAe3D,IAAf,CAAoBlH,mBAApB,CAAA,CAAA;KAroBJ,CAAA;;EAAA,EAAA,OAAA,iBAAA,CAAA;EAAA,CAAA,CAAuC0L,gCAAvC,EAAA;EAAalJ,kBAEJpH,KAAK;EAFDoH,kBAIJvE,SAASA;EAJLuE,kBAKJ7E,cAAcA;EALV6E,kBAMJ5E,cAAcA;EANV4E,kBAOJxE,UAAUA;EAPNwE,kBAQJzE,eAAeA;EARXyE,kBASJ3E,cAAcA;EATV2E,kBAUJ1E,WAAWA;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/visible-range.js b/dist/plugins/visible-range.js index af5bbd872..095b6f566 100644 --- a/dist/plugins/visible-range.js +++ b/dist/plugins/visible-range.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.6.5 +* Photo Sphere Viewer 4.7.0 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/docs/.vuepress/components/CropPlayground.vue b/docs/.vuepress/components/CropPlayground.vue index 7deab4dfd..7a91b2a4d 100644 --- a/docs/.vuepress/components/CropPlayground.vue +++ b/docs/.vuepress/components/CropPlayground.vue @@ -86,8 +86,6 @@ + + diff --git a/docs/.vuepress/plugins/gallery/GalleryItem.vue b/docs/.vuepress/plugins/gallery/GalleryItem.vue new file mode 100644 index 000000000..dce64e285 --- /dev/null +++ b/docs/.vuepress/plugins/gallery/GalleryItem.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/docs/.vuepress/plugins/gallery/enhanceApp.js b/docs/.vuepress/plugins/gallery/enhanceApp.js new file mode 100644 index 000000000..31064fbe3 --- /dev/null +++ b/docs/.vuepress/plugins/gallery/enhanceApp.js @@ -0,0 +1,7 @@ +import Gallery from './Gallery.vue'; +import GalleryItem from './GalleryItem.vue'; + +export default ({ Vue }) => { + Vue.component('Gallery', Gallery); + Vue.component('GalleryItem', GalleryItem); +}; diff --git a/docs/.vuepress/plugins/gallery/index.js b/docs/.vuepress/plugins/gallery/index.js new file mode 100644 index 000000000..d80bc768e --- /dev/null +++ b/docs/.vuepress/plugins/gallery/index.js @@ -0,0 +1,34 @@ +const container = require('markdown-it-container'); +const path = require('path'); + +module.exports = (options, ctx) => ({ + name : 'gallery', + enhanceAppFiles: path.resolve(__dirname, './enhanceApp.js'), + extendMarkdown : (md) => { + md.use(container, 'gallery', { + render: (tokens, idx) => { + const token = tokens[idx]; + if (token.nesting === 1) { + return `\n` + } + else { + return `\n` + } + }, + }); + + md.use(container, 'item', { + render: (tokens, idx) => { + const token = tokens[idx]; + const attributes = token.info.trim().slice('item '.length); + + if (token.nesting === 1) { + return `\n` + } + else { + return `\n` + } + }, + }); + } +}); diff --git a/docs/.vuepress/public/assets/demos/base.webm b/docs/.vuepress/public/assets/demos/base.webm new file mode 100644 index 000000000..c0f24d307 Binary files /dev/null and b/docs/.vuepress/public/assets/demos/base.webm differ diff --git a/docs/.vuepress/public/assets/demos/custom-marker.jpg b/docs/.vuepress/public/assets/demos/custom-marker.jpg new file mode 100644 index 000000000..5112d996e Binary files /dev/null and b/docs/.vuepress/public/assets/demos/custom-marker.jpg differ diff --git a/docs/.vuepress/public/assets/demos/fisheye.webm b/docs/.vuepress/public/assets/demos/fisheye.webm new file mode 100644 index 000000000..180b1de88 Binary files /dev/null and b/docs/.vuepress/public/assets/demos/fisheye.webm differ diff --git a/docs/.vuepress/public/assets/home-bg.jpg b/docs/.vuepress/public/assets/home-bg.jpg new file mode 100644 index 000000000..3fd1633cc Binary files /dev/null and b/docs/.vuepress/public/assets/home-bg.jpg differ diff --git a/docs/.vuepress/public/assets/icons/down.svg b/docs/.vuepress/public/assets/icons/down.svg new file mode 100644 index 000000000..ec62ef72f --- /dev/null +++ b/docs/.vuepress/public/assets/icons/down.svg @@ -0,0 +1,4 @@ + + + + diff --git a/docs/.vuepress/public/logo.png b/docs/.vuepress/public/logo.png new file mode 100644 index 000000000..39fd87346 Binary files /dev/null and b/docs/.vuepress/public/logo.png differ diff --git a/docs/.vuepress/styles/index.styl b/docs/.vuepress/styles/index.styl index 35636e219..1e67a5b66 100644 --- a/docs/.vuepress/styles/index.styl +++ b/docs/.vuepress/styles/index.styl @@ -1,6 +1,3 @@ -@import '~photo-sphere-viewer-stylesheet'; -@import '~photo-sphere-viewer-markers-stylesheet'; - .sidebar a:not(.active):not(:hover), .navbar a:not(.active):not(:hover) { color: inherit !important; } diff --git a/docs/.vuepress/theme/components/Home.vue b/docs/.vuepress/theme/components/Home.vue new file mode 100644 index 000000000..0bc3de555 --- /dev/null +++ b/docs/.vuepress/theme/components/Home.vue @@ -0,0 +1,302 @@ + + + + + diff --git a/docs/.vuepress/theme/index.js b/docs/.vuepress/theme/index.js new file mode 100644 index 000000000..cc636ec82 --- /dev/null +++ b/docs/.vuepress/theme/index.js @@ -0,0 +1,3 @@ +module.exports = { + extend: '@vuepress/theme-default' +}; diff --git a/docs/README.md b/docs/README.md index 7902a0591..06eda93d3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,20 +1,22 @@ --- home: true +heroImage: logo.png heroText: Photo Sphere Viewer +heroAlt: Photo Sphere Viewer tagline: A JavaScript library to display Photo Sphere panoramas actionText: Get Started → actionLink: /guide/ features: - title: Spheres and cubemaps details: Photo Sphere Viewer can display standard equirectangular panoramas and also cubemaps. - - title: Touchscreen, gyroscope and VR - details: Friendly user interactions for all kind of devices. - - title: Markers system - details: Display texts, images and even dynamic areas directly on your photos. - title: Fully configurable details: Many options, methods and events allows deep integration in your website/app. - title: Plugins details: New plugins add new features without bloating the main library. + - title: Touchscreen, gyroscope and VR + details: Friendly user interactions for all kind of devices. + - title: Markers system + details: Display texts, images and even dynamic areas directly on your photos. - title: Videos details: Photo Sphere Viewer also supports video, both equirectangular and cubemaps. footer: Licensed under MIT License, documentation under CC BY 3.0 @@ -22,8 +24,6 @@ footer: Licensed under MIT License, documentation under CC BY 3.0 - - ::: tip Thanks to Jéremy Heleine I forked the original Photo Sphere Viewer [by Jérémy Heleine](http://jeremyheleine.me) to provide a better code architecture and a bunch of new features. ::: diff --git a/docs/demos/README.md b/docs/demos/README.md index f1626bbfc..27ad83e96 100644 --- a/docs/demos/README.md +++ b/docs/demos/README.md @@ -1,9 +1,41 @@ -# User demos +--- +sidebar: auto +--- -This sections contains various examples of Photo Sphere Viewer created my users or myself when providing support. +# Demos -### Want your demo here ? +::: tip Want your demo here ? +Create a JSFiddle by forking [PSV Home Demo](https://jsfiddle.net/mistic100/5r684etx/) and submit a pull request to add it to the documentation. +::: -Create a JSFiddle by forking [PSV Home Demo](https://jsfiddle.net/mistic100/5r684etx/) and submit a Pull Request to add it to the documentation, if it is interesting enough it will be added. +::: tip Plugins +Visit each [plugin page](../plugins/) to see an example. +::: -Alternatively open an issue withe your JSFiddle link and a short description and I will add it. +## Basic + +:::: gallery + +::: item video="/assets/demos/base.webm" link="https://jsfiddle.net/mistic100/5r684etx/show" +### Zero config +Simple panorama with default options. +::: + +::: item video="/assets/demos/fisheye.webm" link="https://jsfiddle.net/mistic100/wsL1x5k0/show" +### Intro animation +Use the `Animation` helper to create a cool intro. +::: + +:::: + + +## Markers + +:::: gallery + +::: item image="/assets/demos/custom-marker.jpg" link="https://jsfiddle.net/mistic100/Lm3wzesb/show" +### Custom tooltip +Advanced styling of a marker's tooltip. +::: + +:::: diff --git a/docs/demos/intro.md b/docs/demos/intro.md deleted file mode 100644 index 12d8f53a4..000000000 --- a/docs/demos/intro.md +++ /dev/null @@ -1,5 +0,0 @@ -# Intro animation - -This a simple intro animation using the `Animation` helper. - - diff --git a/docs/guide/README.md b/docs/guide/README.md index f3d90722a..1bb911590 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -88,6 +88,8 @@ const viewer = new Viewer({ + + The `panorama` must be an [equirectangular projection](https://en.wikipedia.org/wiki/Equirectangular_projection) of your photo. Other modes are supported through [adapters](./adapters/). diff --git a/docs/guide/adapters/equirectangular.md b/docs/guide/adapters/equirectangular.md index 6e3f78830..24a3e1ca8 100644 --- a/docs/guide/adapters/equirectangular.md +++ b/docs/guide/adapters/equirectangular.md @@ -121,4 +121,6 @@ const viewer = new PhotoSphereViewer.Viewer({ Use this demo to find the best values for your image. - + + + diff --git a/docs/playground.md b/docs/playground.md index bf321e90b..67d835c25 100644 --- a/docs/playground.md +++ b/docs/playground.md @@ -2,4 +2,6 @@ This page allows to test (almost) all options of Photo Sphere Viewer with your own panorama (equirectangular only). You can also add markers interractively and export them. - + + + diff --git a/docs/plugins/plugin-compass.md b/docs/plugins/plugin-compass.md index dd873307d..49f7b2925 100644 --- a/docs/plugins/plugin-compass.md +++ b/docs/plugins/plugin-compass.md @@ -6,6 +6,8 @@ This plugin is available in the core `photo-sphere-viewer` package in `dist/plugins/compass.js` and `dist/plugins/compass.css`. +[[toc]] + ## Usage diff --git a/docs/plugins/plugin-gallery.md b/docs/plugins/plugin-gallery.md new file mode 100644 index 000000000..909e970af --- /dev/null +++ b/docs/plugins/plugin-gallery.md @@ -0,0 +1,105 @@ +# GalleryPlugin + + + +> Adds a gallery on the bottom of the viewer to navigate between multiple panoramas. + +This plugin is available in the core `photo-sphere-viewer` package in `dist/plugins/gallery.js` and `dist/plugins/gallery.css`. + +[[toc]] + +::: warning +GalleryPlugin is not compatible with ResolutionPlugin. +::: + + +## Usage + +The plugin has a list of `items`, each configuring the corresponding panorama, a name and a thumbnail. + +```js +const viewer = new PhotoSphereViewer.Viewer({ + plugins: [ + [PhotoSphereViewer.GalleryPlugin, { + items: [ + { + id: 'pano-1', + name: 'Panorama 1', + panorama: 'path/to/pano-1.jpg', + thumbnail: 'path/to/pano-1-thumb.jpg', + }, + { + id: 'pano-2', + name: 'Panorama 2', + panorama: 'path/to/pano-2.jpg', + thumbnail: 'path/to/pano-2-thumb.jpg', + }, + ], + }], + ], +}); +``` + + +## Example + + + + +## Configuration + +#### `items` +- type: `array` +- default: `[]` + +The list of items, see bellow. + +#### `visibleOnLoad` +- type: `boolean` +- default: `false` + +Displays the gallery when loading the first panorama. The user will be able to toggle the gallery with the navbar button. + +### Items + +#### `id` (required) +- type: `number|string` + +Unique identifier of the item. + +#### `thumbnail` (recommended) +- type: `string` +- default: `''` + +URL of the thumbnail. + +#### `name` +- type: `string` +- default: `''` + +Text visible over the thumbnail. + +#### `panorama` (required) + +Refer to the main [config page](../guide/config.md#panorama-required). + +#### `options` +- type: `PanoramaOptions` +- default: `null` + +Any option supported by the [setPanorama()](../guide/methods.md#setpanorama-panorama-options-promise) method. + + +## Methods + +#### `setItems(items)` + +Changes the list of items. + + +## Buttons + +This plugin adds buttons to the default navbar: +- `gallery` allows to toggle the gallery panel + +If you use a [custom navbar](../guide/navbar.md) you will need to manually add the buttons to the list. diff --git a/docs/plugins/plugin-markers.md b/docs/plugins/plugin-markers.md index ab922fe6f..f1c6badab 100644 --- a/docs/plugins/plugin-markers.md +++ b/docs/plugins/plugin-markers.md @@ -148,9 +148,6 @@ scale: { // the marker is twice smaller on the minimum zoom level zoom: [0.5, 1] } - -// same thing -scale: [0.5, 1] ``` Scales depending on position, the array contains `[scale on center, scale on the side]` : @@ -241,20 +238,32 @@ _(This option is ignored for polygons and polylines)._ Initial visibility of the marker. #### `tooltip` -- type: `string | {content: string, position: string}` -- default: `{content: null, position: 'top center'}` +- type: `string | {content: string, position: string, className: string, trigger: string}` +- default: `{content: null, position: 'top center', className: null, trigger: 'hover'}` + +Accepted positions are combinations of `top`, `center`, `bottom` and `left`, `center`, `right` with the exception of `center center`. -Tooltip content and position. Accepted positions are combinations of `top`, `center`, `bottom` and `left`, `center`, `right` with the exception of `center center`. +Possible triggers are `hover` and `click`. ```js -tooltip: 'This is a marker' // tooltip with default position +tooltip: 'This is a marker' // tooltip with default position and style tooltip: { // tooltip with custom position content : 'This is marker', - position: 'bottom left' + position: 'bottom left', +} + +tooltip: { // tooltip with a custom class shown on click + content: 'This is marker', + className: 'custom-tooltip', + trigger: 'click', } ``` +::: warning +If `trigger` is set to `'click'` you won't be able to display a `content` in the side panel. +::: + #### `listContent` - type: `string` @@ -353,9 +362,27 @@ markersPlugin.updateMarker({ }); ``` +#### `showMarkerTooltip(id)` | `hideMarkerTooltip(id)` + +Allows to always display a tooltip. + +#### `showAllTooltips()` | `hideAllTooltips()` | `toggleAllTooltips()` + +Allows to always display all tooltips. + ## Events +#### `marker-visibility(marker, visible)` + +Triggered when the visibility of a marker changes. + +```js +markersPlugin.on('marker-visibility', (e, marker, visible) => { + console.log(`Marker ${marker.id} is ${visible ? 'visible' : 'not visible'}`); +}); +``` + #### `over-marker(marker)` | `leave-marker(marker)` Triggered when the user puts the cursor hover or away a marker. diff --git a/docs/plugins/plugin-resolution.md b/docs/plugins/plugin-resolution.md index 9a9af8e1b..9ce1fe6bb 100644 --- a/docs/plugins/plugin-resolution.md +++ b/docs/plugins/plugin-resolution.md @@ -8,6 +8,10 @@ This plugin is available in the core `photo-sphere-viewer` package in `dist/plug [[toc]] +::: warning +ResolutionPlugin is not compatible with GalleryPlugin. +::: + ## Usage diff --git a/docs/plugins/plugin-virtual-tour.md b/docs/plugins/plugin-virtual-tour.md index 8640e6eb0..1f15f3c63 100644 --- a/docs/plugins/plugin-virtual-tour.md +++ b/docs/plugins/plugin-virtual-tour.md @@ -76,6 +76,10 @@ getNode = async (nodeId) => { +::: tip +If the [Gallery plugin](./plugin-gallery.md) is loaded, it will be configured with the list of nodes (client mode only). +::: + ## Example @@ -110,7 +114,7 @@ Only the [ESPG:4326 projection](https://epsg.io/4326) is supported. #### `name` - type: `string` -Short name of this node, used in links tooltips and the nodes list. +Short name of this node, used in links tooltips and the gallery. #### `caption` @@ -123,7 +127,7 @@ Replace the global description. Refer to the main [config page](../guide/config. #### `thumbnail` - type: `string` -Thumbnail for the nodes list in the side panel. +Thumbnail for the nodes list in the gallery. #### `markers` - type: `array` @@ -174,17 +178,6 @@ Overrides the global style of the marker used to display the link. See global co ## Configuration -#### `lang` -- type: `object` -- default: -```js -lang: { - nodesList: 'Locations', -} -``` - -_Note: this option is not part of the plugin but is merged with the main [`lang`](../guide/config.md#lang) object._ - #### `dataMode` - type: `'client' | 'server'` - default: `'client'` @@ -335,3 +328,7 @@ This plugin adds buttons to the default navbar: - `nodesList` allows to open a list of all nodes on the left panel (client mode only) If you use a [custom navbar](../guide/navbar.md) you will need to manually add the buttons to the list. + +::: warning Deprecated +This button will be removed and replaced by the [Gallery plugin](./plugin-gallery.md). +::: diff --git a/example/index.html b/example/index.html index dccaea002..0ae2b9bfd 100644 --- a/example/index.html +++ b/example/index.html @@ -43,6 +43,7 @@
Plugins
Autorotate Keypoints Compass + Gallery Gyroscope & Stereo Markers Markers (cubemap) diff --git a/example/plugin-gallery.html b/example/plugin-gallery.html new file mode 100644 index 000000000..df4291cb9 --- /dev/null +++ b/example/plugin-gallery.html @@ -0,0 +1,110 @@ + + + + + + PhotoSphereViewer - gallery demo + + + + + + + +
+ + + + + + + + + diff --git a/example/plugin-markers.html b/example/plugin-markers.html index bfcb88d14..a42ee2032 100644 --- a/example/plugin-markers.html +++ b/example/plugin-markers.html @@ -19,6 +19,23 @@ border: 1px solid white; background: rgba(0, 0, 0, 0.4); } + + .custom-tooltip { + max-width: none; + width: 300px; + padding: 0; + box-shadow: 0 0 0 3px white; + } + + .custom-tooltip img { + width: 100%; + border-radius: 4px 4px 0 0; + } + + .custom-tooltip h2, .custom-tooltip p { + margin: 1rem; + text-align: justify; + } @@ -128,13 +145,10 @@

Header Level 3

} } - // marker with content + // marker with content and tooltip a.push({ - id : 'lorem', - tooltip : { - content : 'Lorem ipsum dolor ist amet et consecturo.', - position: 'bottom right', - }, + id : 'content', + tooltip : 'Click me!', content : document.getElementById('pin-content').innerHTML, latitude : 0.32, longitude: 0.11, @@ -144,6 +158,31 @@

Header Level 3

anchor : 'bottom center', }); + // marker with custom tooltip + a.push({ + id : 'custom-tooltip', + tooltip : { + content : ` + +
+

Lorem ipsum

+

+ Vivamus magna. Cras in mi at felis aliquet + congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, + tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est. +

+
`, + className: 'custom-tooltip', + trigger : 'click', + }, + latitude : 0.11, + longitude: -0.35, + image : 'assets/pin-blue.png', + width : 32, + height : 32, + anchor : 'bottom center', + }); + // big polygon to test the handling of points behind the camera a.push({ id : 'polygon-sky', @@ -409,6 +448,10 @@

Header Level 3

const markers = viewer.getPlugin(PhotoSphereViewer.MarkersPlugin); + viewer.once('ready', () => { + markers.showMarkerTooltip('content'); + }); + viewer.on('click', (e, data) => { if (!data.rightclick) { markers.addMarker({ @@ -462,6 +505,10 @@

Header Level 3

markers.on('goto-marker-done', (e, marker) => { console.log('goto-done', marker.id); }); + + markers.on('marker-visibility', (e, marker, visible) => { + console.log('marker-visibility', marker.id, visible); + }); diff --git a/example/plugin-virtual-tour.html b/example/plugin-virtual-tour.html index a5af814ec..a9b78af38 100644 --- a/example/plugin-virtual-tour.html +++ b/example/plugin-virtual-tour.html @@ -8,6 +8,7 @@ + @@ -20,6 +21,7 @@ +