diff --git a/dist/adapters/cubemap-tiles.js b/dist/adapters/cubemap-tiles.js index 25958e74d..e288e8f7a 100644 --- a/dist/adapters/cubemap-tiles.js +++ b/dist/adapters/cubemap-tiles.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 2c5a329da..8f357714f 100644 --- a/dist/adapters/cubemap-video.js +++ b/dist/adapters/cubemap-video.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -235,7 +235,7 @@ var video = document.createElement('video'); video.crossOrigin = this.psv.config.withCredentials ? 'use-credentials' : 'anonymous'; video.loop = true; - video.playsinline = true; + video.playsInline = true; video.style.display = 'none'; video.muted = this.config.muted; video.src = src; diff --git a/dist/adapters/cubemap-video.js.map b/dist/adapters/cubemap-video.js.map index ae6840c8a..2320d8333 100644 --- a/dist/adapters/cubemap-video.js.map +++ b/dist/adapters/cubemap-video.js.map @@ -1 +1 @@ -{"version":3,"file":"cubemap-video.js","sources":["../../src/adapters/shared/AbstractVideoAdapter.js","../../src/adapters/cubemap-video/index.js"],"sourcesContent":["import { VideoTexture } from 'three';\nimport { AbstractAdapter, CONSTANTS, PSVError } from '../..';\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\n */\n\n/**\n * @summary Base video adapters class\n * @memberof PSV.adapters\n * @abstract\n * @private\n */\nexport class AbstractVideoAdapter extends AbstractAdapter {\n\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.adapters.AbstractVideoAdapter.Options}\n * @private\n */\n this.config = {\n autoplay: false,\n muted : options?.autoplay ?? false,\n ...options,\n };\n\n /**\n * @member {HTMLVideoElement}\n * @private\n */\n this.video = null;\n\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n\n this.__removeVideo();\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case CONSTANTS.EVENTS.BEFORE_RENDER:\n if (this.video) {\n this.psv.needsUpdate();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {PSV.adapters.AbstractVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n if (typeof panorama !== 'object' || !panorama.source) {\n return Promise.reject(new PSVError('Invalid panorama configuration, are you using the right adapter?'));\n }\n\n if (!this.psv.getPlugin('video')) {\n return Promise.reject(new PSVError('Video adapters require VideoPlugin to be loaded too.'));\n }\n\n const video = this.__createVideo(panorama.source);\n\n return this.__videoLoadPromise(video)\n .then(() => {\n const texture = new VideoTexture(video);\n return { panorama, texture };\n });\n }\n\n /**\n * @override\n */\n __switchVideo(texture) {\n let currentTime;\n let duration;\n let paused = !this.config.autoplay;\n let muted = this.config.muted;\n let volume = 1;\n if (this.video) {\n ({ currentTime, duration, paused, muted, volume } = this.video);\n }\n\n this.__removeVideo();\n this.video = texture.image;\n\n // keep current time when switching resolution\n if (this.video.duration === duration) {\n this.video.currentTime = currentTime;\n }\n\n // keep volume\n this.video.muted = muted;\n this.video.volume = volume;\n\n // play\n if (!paused) {\n this.video.play();\n }\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n if (textureData.texture) {\n const video = textureData.texture.image;\n video.pause();\n this.psv.container.removeChild(video);\n }\n textureData.texture?.dispose();\n }\n\n /**\n * @summary Removes the current video element\n * @private\n */\n __removeVideo() {\n if (this.video) {\n this.video.pause();\n this.psv.container.removeChild(this.video);\n delete this.video;\n }\n }\n\n /**\n * @summary Creates a new video element\n * @memberOf PSV.adapters\n * @param {string} src\n * @return {HTMLVideoElement}\n * @private\n */\n __createVideo(src) {\n const video = document.createElement('video');\n video.crossOrigin = this.psv.config.withCredentials ? 'use-credentials' : 'anonymous';\n video.loop = true;\n video.playsinline = true;\n video.style.display = 'none';\n video.muted = this.config.muted;\n video.src = src;\n video.preload = 'metadata';\n\n this.psv.container.appendChild(video);\n\n return video;\n }\n\n /**\n * @private\n */\n __videoLoadPromise(video) {\n const self = this;\n\n return new Promise((resolve, reject) => {\n video.addEventListener('loadedmetadata', function onLoaded() {\n if (this.video && video.duration === this.video.duration) {\n resolve(self.__videoBufferPromise(video, this.video.currentTime));\n }\n else {\n resolve();\n }\n video.removeEventListener('loadedmetadata', onLoaded);\n });\n\n video.addEventListener('error', function onError(err) {\n reject(err);\n video.removeEventListener('error', onError);\n });\n });\n }\n\n /**\n * @private\n */\n __videoBufferPromise(video, currentTime) {\n return new Promise((resolve) => {\n function onBuffer() {\n const buffer = video.buffered;\n for (let i = 0, l = buffer.length; i < l; i++) {\n if (buffer.start(i) <= video.currentTime && buffer.end(i) >= video.currentTime) {\n video.pause();\n video.removeEventListener('buffer', onBuffer);\n video.removeEventListener('progress', onBuffer);\n resolve();\n break;\n }\n }\n }\n\n // try to reduce the switching time by preloading in advance\n // FIXME find a better way ?\n video.currentTime = Math.min(currentTime + 2000, video.duration.currentTime);\n video.muted = true;\n\n video.addEventListener('buffer', onBuffer);\n video.addEventListener('progress', onBuffer);\n\n video.play();\n });\n }\n\n}\n","import { BoxGeometry, Mesh, ShaderMaterial, Vector2 } from 'three';\nimport { CONSTANTS } from '../..';\nimport { AbstractVideoAdapter } from '../shared/AbstractVideoAdapter';\n\n/**\n * @typedef {Object} PSV.adapters.CubemapVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.CubemapVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\n * @property {number} [equiangular=true] - if the video is an equiangular cubemap (EAC)\n */\n\n\n/**\n * @summary Adapter for cubemap videos\n * @memberof PSV.adapters\n * @extends PSV.adapters.AbstractAdapter\n */\nexport class CubemapVideoAdapter extends AbstractVideoAdapter {\n\n static id = 'cubemap-video';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.adapters.CubemapVideoAdapter.Options} options\n */\n constructor(psv, options) {\n super(psv, {\n equiangular: true,\n ...options,\n });\n }\n\n /**\n * @override\n * @param {PSV.adapters.CubemapVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n return super.loadTexture(panorama);\n }\n\n /**\n * @override\n */\n createMesh(scale = 1) {\n const cubeSize = CONSTANTS.SPHERE_RADIUS * 2 * scale;\n const geometry = new BoxGeometry(cubeSize, cubeSize, cubeSize)\n .scale(1, 1, -1)\n .toNonIndexed();\n\n geometry.clearGroups();\n\n const uvs = geometry.getAttribute('uv');\n\n /*\n Structure of a frame\n\n 1 +---------+---------+---------+\n | | | |\n | Left | Front | Right |\n | | | |\n 1/2 +---------+---------+---------+\n | | | |\n | Bottom | Back | Top |\n | | | |\n 0 +---------+---------+---------+\n 0 1/3 2/3 1\n\n Bottom, Back and Top are rotated 90° clockwise\n */\n\n // columns\n const a = 0;\n const b = 1 / 3;\n const c = 2 / 3;\n const d = 1;\n\n // lines\n const A = 1;\n const B = 1 / 2;\n const C = 0;\n\n // left\n uvs.setXY(0, a, A);\n uvs.setXY(1, a, B);\n uvs.setXY(2, b, A);\n uvs.setXY(3, a, B);\n uvs.setXY(4, b, B);\n uvs.setXY(5, b, A);\n\n // right\n uvs.setXY(6, c, A);\n uvs.setXY(7, c, B);\n uvs.setXY(8, d, A);\n uvs.setXY(9, c, B);\n uvs.setXY(10, d, B);\n uvs.setXY(11, d, A);\n\n // top\n uvs.setXY(12, d, B);\n uvs.setXY(13, c, B);\n uvs.setXY(14, d, C);\n uvs.setXY(15, c, B);\n uvs.setXY(16, c, C);\n uvs.setXY(17, d, C);\n\n // bottom\n uvs.setXY(18, b, B);\n uvs.setXY(19, a, B);\n uvs.setXY(20, b, C);\n uvs.setXY(21, a, B);\n uvs.setXY(22, a, C);\n uvs.setXY(23, b, C);\n\n // back\n uvs.setXY(24, c, B);\n uvs.setXY(25, b, B);\n uvs.setXY(26, c, C);\n uvs.setXY(27, b, B);\n uvs.setXY(28, b, C);\n uvs.setXY(29, c, C);\n\n // front\n uvs.setXY(30, b, A);\n uvs.setXY(31, b, B);\n uvs.setXY(32, c, A);\n uvs.setXY(33, b, B);\n uvs.setXY(34, c, B);\n uvs.setXY(35, c, A);\n\n // shamelessly copied from https://github.com/videojs/videojs-vr\n const material = new ShaderMaterial({\n uniforms : {\n mapped : { value: null },\n contCorrect: { value: 1 },\n faceWH : { value: new Vector2(1 / 3, 1 / 2) },\n vidWH : { value: new Vector2(1, 1) },\n },\n vertexShader : `\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.);\n}`,\n fragmentShader: `\nvarying vec2 vUv;\nuniform sampler2D mapped;\nuniform vec2 faceWH;\nuniform vec2 vidWH;\nuniform float contCorrect;\n\nconst float PI = 3.1415926535897932384626433832795;\n\nvoid main() {\n vec2 corner = vUv - mod(vUv, faceWH) + vec2(0, contCorrect / vidWH.y);\n vec2 faceWHadj = faceWH - vec2(0, contCorrect * 2. / vidWH.y);\n vec2 p = (vUv - corner) / faceWHadj - .5;\n vec2 q = ${this.config.equiangular ? '2. / PI * atan(2. * p) + .5' : 'p + .5'};\n vec2 eUv = corner + q * faceWHadj;\n gl_FragColor = texture2D(mapped, eUv);\n}`,\n });\n\n return new Mesh(geometry, material);\n }\n\n /**\n * @override\n */\n setTexture(mesh, textureData) {\n const { texture } = textureData;\n\n mesh.material.uniforms.mapped.value?.dispose();\n mesh.material.uniforms.mapped.value = texture;\n mesh.material.uniforms.vidWH.value.set(texture.image.videoWidth, texture.image.videoHeight);\n\n this.__switchVideo(textureData.texture);\n }\n\n}\n"],"names":["AbstractVideoAdapter","psv","options","config","autoplay","muted","video","on","CONSTANTS","EVENTS","BEFORE_RENDER","destroy","off","__removeVideo","handleEvent","e","type","needsUpdate","loadTexture","panorama","source","Promise","reject","PSVError","getPlugin","__createVideo","__videoLoadPromise","then","texture","VideoTexture","__switchVideo","currentTime","duration","paused","volume","image","play","disposeTexture","textureData","pause","container","removeChild","dispose","src","document","createElement","crossOrigin","withCredentials","loop","playsinline","style","display","preload","appendChild","self","resolve","addEventListener","onLoaded","__videoBufferPromise","removeEventListener","onError","err","onBuffer","buffer","buffered","i","l","length","start","end","Math","min","AbstractAdapter","CubemapVideoAdapter","equiangular","createMesh","scale","cubeSize","SPHERE_RADIUS","geometry","BoxGeometry","toNonIndexed","clearGroups","uvs","getAttribute","a","b","c","d","A","B","C","setXY","material","ShaderMaterial","uniforms","mapped","value","contCorrect","faceWH","Vector2","vidWH","vertexShader","fragmentShader","Mesh","setTexture","mesh","set","videoWidth","videoHeight","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;;EACA,IAAaA,oBAAb,gBAAA,UAAA,gBAAA,EAAA;EAAA,EAAA,cAAA,CAAA,oBAAA,EAAA,gBAAA,CAAA,CAAA;;IAEE,SAAYC,oBAAAA,CAAAA,GAAZ,EAAiBC,OAAjB,EAA0B;EAAA,IAAA,IAAA,iBAAA,CAAA;;EAAA,IAAA,IAAA,KAAA,CAAA;;EACxB,IAAA,KAAA,GAAA,gBAAA,CAAA,IAAA,CAAA,IAAA,EAAMD,GAAN,CAAA,I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src/adapters/cubemap-video/index.js"],"sourcesContent":["import { VideoTexture } from 'three';\nimport { AbstractAdapter, CONSTANTS, PSVError } from '../..';\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\n */\n\n/**\n * @summary Base video adapters class\n * @memberof PSV.adapters\n * @abstract\n * @private\n */\nexport class AbstractVideoAdapter extends AbstractAdapter {\n\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.adapters.AbstractVideoAdapter.Options}\n * @private\n */\n this.config = {\n autoplay: false,\n muted : options?.autoplay ?? false,\n ...options,\n };\n\n /**\n * @member {HTMLVideoElement}\n * @private\n */\n this.video = null;\n\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n\n this.__removeVideo();\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case CONSTANTS.EVENTS.BEFORE_RENDER:\n if (this.video) {\n this.psv.needsUpdate();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {PSV.adapters.AbstractVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n if (typeof panorama !== 'object' || !panorama.source) {\n return Promise.reject(new PSVError('Invalid panorama configuration, are you using the right adapter?'));\n }\n\n if (!this.psv.getPlugin('video')) {\n return Promise.reject(new PSVError('Video adapters require VideoPlugin to be loaded too.'));\n }\n\n const video = this.__createVideo(panorama.source);\n\n return this.__videoLoadPromise(video)\n .then(() => {\n const texture = new VideoTexture(video);\n return { panorama, texture };\n });\n }\n\n /**\n * @override\n */\n __switchVideo(texture) {\n let currentTime;\n let duration;\n let paused = !this.config.autoplay;\n let muted = this.config.muted;\n let volume = 1;\n if (this.video) {\n ({ currentTime, duration, paused, muted, volume } = this.video);\n }\n\n this.__removeVideo();\n this.video = texture.image;\n\n // keep current time when switching resolution\n if (this.video.duration === duration) {\n this.video.currentTime = currentTime;\n }\n\n // keep volume\n this.video.muted = muted;\n this.video.volume = volume;\n\n // play\n if (!paused) {\n this.video.play();\n }\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n if (textureData.texture) {\n const video = textureData.texture.image;\n video.pause();\n this.psv.container.removeChild(video);\n }\n textureData.texture?.dispose();\n }\n\n /**\n * @summary Removes the current video element\n * @private\n */\n __removeVideo() {\n if (this.video) {\n this.video.pause();\n this.psv.container.removeChild(this.video);\n delete this.video;\n }\n }\n\n /**\n * @summary Creates a new video element\n * @memberOf PSV.adapters\n * @param {string} src\n * @return {HTMLVideoElement}\n * @private\n */\n __createVideo(src) {\n const video = document.createElement('video');\n video.crossOrigin = this.psv.config.withCredentials ? 'use-credentials' : 'anonymous';\n video.loop = true;\n video.playsInline = true;\n video.style.display = 'none';\n video.muted = this.config.muted;\n video.src = src;\n video.preload = 'metadata';\n\n this.psv.container.appendChild(video);\n\n return video;\n }\n\n /**\n * @private\n */\n __videoLoadPromise(video) {\n const self = this;\n\n return new Promise((resolve, reject) => {\n video.addEventListener('loadedmetadata', function onLoaded() {\n if (this.video && video.duration === this.video.duration) {\n resolve(self.__videoBufferPromise(video, this.video.currentTime));\n }\n else {\n resolve();\n }\n video.removeEventListener('loadedmetadata', onLoaded);\n });\n\n video.addEventListener('error', function onError(err) {\n reject(err);\n video.removeEventListener('error', onError);\n });\n });\n }\n\n /**\n * @private\n */\n __videoBufferPromise(video, currentTime) {\n return new Promise((resolve) => {\n function onBuffer() {\n const buffer = video.buffered;\n for (let i = 0, l = buffer.length; i < l; i++) {\n if (buffer.start(i) <= video.currentTime && buffer.end(i) >= video.currentTime) {\n video.pause();\n video.removeEventListener('buffer', onBuffer);\n video.removeEventListener('progress', onBuffer);\n resolve();\n break;\n }\n }\n }\n\n // try to reduce the switching time by preloading in advance\n // FIXME find a better way ?\n video.currentTime = Math.min(currentTime + 2000, video.duration.currentTime);\n video.muted = true;\n\n video.addEventListener('buffer', onBuffer);\n video.addEventListener('progress', onBuffer);\n\n video.play();\n });\n }\n\n}\n","import { BoxGeometry, Mesh, ShaderMaterial, Vector2 } from 'three';\nimport { CONSTANTS } from '../..';\nimport { AbstractVideoAdapter } from '../shared/AbstractVideoAdapter';\n\n/**\n * @typedef {Object} PSV.adapters.CubemapVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.CubemapVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\n * @property {number} [equiangular=true] - if the video is an equiangular cubemap (EAC)\n */\n\n\n/**\n * @summary Adapter for cubemap videos\n * @memberof PSV.adapters\n * @extends PSV.adapters.AbstractAdapter\n */\nexport class CubemapVideoAdapter extends AbstractVideoAdapter {\n\n static id = 'cubemap-video';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.adapters.CubemapVideoAdapter.Options} options\n */\n constructor(psv, options) {\n super(psv, {\n equiangular: true,\n ...options,\n });\n }\n\n /**\n * @override\n * @param {PSV.adapters.CubemapVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n return super.loadTexture(panorama);\n }\n\n /**\n * @override\n */\n createMesh(scale = 1) {\n const cubeSize = CONSTANTS.SPHERE_RADIUS * 2 * scale;\n const geometry = new BoxGeometry(cubeSize, cubeSize, cubeSize)\n .scale(1, 1, -1)\n .toNonIndexed();\n\n geometry.clearGroups();\n\n const uvs = geometry.getAttribute('uv');\n\n /*\n Structure of a frame\n\n 1 +---------+---------+---------+\n | | | |\n | Left | Front | Right |\n | | | |\n 1/2 +---------+---------+---------+\n | | | |\n | Bottom | Back | Top |\n | | | |\n 0 +---------+---------+---------+\n 0 1/3 2/3 1\n\n Bottom, Back and Top are rotated 90° clockwise\n */\n\n // columns\n const a = 0;\n const b = 1 / 3;\n const c = 2 / 3;\n const d = 1;\n\n // lines\n const A = 1;\n const B = 1 / 2;\n const C = 0;\n\n // left\n uvs.setXY(0, a, A);\n uvs.setXY(1, a, B);\n uvs.setXY(2, b, A);\n uvs.setXY(3, a, B);\n uvs.setXY(4, b, B);\n uvs.setXY(5, b, A);\n\n // right\n uvs.setXY(6, c, A);\n uvs.setXY(7, c, B);\n uvs.setXY(8, d, A);\n uvs.setXY(9, c, B);\n uvs.setXY(10, d, B);\n uvs.setXY(11, d, A);\n\n // top\n uvs.setXY(12, d, B);\n uvs.setXY(13, c, B);\n uvs.setXY(14, d, C);\n uvs.setXY(15, c, B);\n uvs.setXY(16, c, C);\n uvs.setXY(17, d, C);\n\n // bottom\n uvs.setXY(18, b, B);\n uvs.setXY(19, a, B);\n uvs.setXY(20, b, C);\n uvs.setXY(21, a, B);\n uvs.setXY(22, a, C);\n uvs.setXY(23, b, C);\n\n // back\n uvs.setXY(24, c, B);\n uvs.setXY(25, b, B);\n uvs.setXY(26, c, C);\n uvs.setXY(27, b, B);\n uvs.setXY(28, b, C);\n uvs.setXY(29, c, C);\n\n // front\n uvs.setXY(30, b, A);\n uvs.setXY(31, b, B);\n uvs.setXY(32, c, A);\n uvs.setXY(33, b, B);\n uvs.setXY(34, c, B);\n uvs.setXY(35, c, A);\n\n // shamelessly copied from https://github.com/videojs/videojs-vr\n const material = new ShaderMaterial({\n uniforms : {\n mapped : { value: null },\n contCorrect: { value: 1 },\n faceWH : { value: new Vector2(1 / 3, 1 / 2) },\n vidWH : { value: new Vector2(1, 1) },\n },\n vertexShader : `\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.);\n}`,\n fragmentShader: `\nvarying vec2 vUv;\nuniform sampler2D mapped;\nuniform vec2 faceWH;\nuniform vec2 vidWH;\nuniform float contCorrect;\n\nconst float PI = 3.1415926535897932384626433832795;\n\nvoid main() {\n vec2 corner = vUv - mod(vUv, faceWH) + vec2(0, contCorrect / vidWH.y);\n vec2 faceWHadj = faceWH - vec2(0, contCorrect * 2. / vidWH.y);\n vec2 p = (vUv - corner) / faceWHadj - .5;\n vec2 q = ${this.config.equiangular ? '2. / PI * atan(2. * p) + .5' : 'p + .5'};\n vec2 eUv = corner + q * faceWHadj;\n gl_FragColor = texture2D(mapped, eUv);\n}`,\n });\n\n return new Mesh(geometry, material);\n }\n\n /**\n * @override\n */\n setTexture(mesh, textureData) {\n const { texture } = textureData;\n\n mesh.material.uniforms.mapped.value?.dispose();\n mesh.material.uniforms.mapped.value = texture;\n mesh.material.uniforms.vidWH.value.set(texture.image.videoWidth, texture.image.videoHeight);\n\n this.__switchVideo(textureData.texture);\n }\n\n}\n"],"names":["AbstractVideoAdapter","psv","options","config","autoplay","muted","video","on","CONSTANTS","EVENTS","BEFORE_RENDER","destroy","off","__removeVideo","handleEvent","e","type","needsUpdate","loadTexture","panorama","source","Promise","reject","PSVError","getPlugin","__createVideo","__videoLoadPromise","then","texture","VideoTexture","__switchVideo","currentTime","duration","paused","volume","image","play","disposeTexture","textureData","pause","container","removeChild","dispose","src","document","createElement","crossOrigin","withCredentials","loop","playsInline","style","display","preload","appendChild","self","resolve","addEventListener","onLoaded","__videoBufferPromise","removeEventListener","onError","err","onBuffer","buffer","buffered","i","l","length","start","end","Math","min","AbstractAdapter","CubemapVideoAdapter","equiangular","createMesh","scale","cubeSize","SPHERE_RADIUS","geometry","BoxGeometry","toNonIndexed","clearGroups","uvs","getAttribute","a","b","c","d","A","B","C","setXY","material","ShaderMaterial","uniforms","mapped","value","contCorrect","faceWH","Vector2","vidWH","vertexShader","fragmentShader","Mesh","setTexture","mesh","set","videoWidth","videoHeight","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;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AcyE,UAArD,EAAiEhF,OAAO,CAACO,KAAR,CAAc0E,WAA/E,CAAA,CAAA;;EAEA,IAAA,IAAA,CAAK/E,aAAL,CAAmBQ,WAAW,CAACV,OAA/B,CAAA,CAAA;KA/JJ,CAAA;;EAAA,EAAA,OAAA,mBAAA,CAAA;EAAA,CAAA,CAAyC5B,oBAAzC,EAAA;EAAayE,oBAEJqC,KAAK;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/adapters/cubemap.js b/dist/adapters/cubemap.js index 1ea7d1819..0fe384bbe 100644 --- a/dist/adapters/cubemap.js +++ b/dist/adapters/cubemap.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 a3dec11b2..273e5de74 100644 --- a/dist/adapters/equirectangular-tiles.js +++ b/dist/adapters/equirectangular-tiles.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 c3876fd45..af638945c 100644 --- a/dist/adapters/equirectangular-video.js +++ b/dist/adapters/equirectangular-video.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -235,7 +235,7 @@ var video = document.createElement('video'); video.crossOrigin = this.psv.config.withCredentials ? 'use-credentials' : 'anonymous'; video.loop = true; - video.playsinline = true; + video.playsInline = true; video.style.display = 'none'; video.muted = this.config.muted; video.src = src; diff --git a/dist/adapters/equirectangular-video.js.map b/dist/adapters/equirectangular-video.js.map index 09bd6a4ce..bba282860 100644 --- a/dist/adapters/equirectangular-video.js.map +++ b/dist/adapters/equirectangular-video.js.map @@ -1 +1 @@ -{"version":3,"file":"equirectangular-video.js","sources":["../../src/adapters/shared/AbstractVideoAdapter.js","../../src/adapters/equirectangular-video/index.js"],"sourcesContent":["import { VideoTexture } from 'three';\nimport { AbstractAdapter, CONSTANTS, PSVError } from '../..';\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\n */\n\n/**\n * @summary Base video adapters class\n * @memberof PSV.adapters\n * @abstract\n * @private\n */\nexport class AbstractVideoAdapter extends AbstractAdapter {\n\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.adapters.AbstractVideoAdapter.Options}\n * @private\n */\n this.config = {\n autoplay: false,\n muted : options?.autoplay ?? false,\n ...options,\n };\n\n /**\n * @member {HTMLVideoElement}\n * @private\n */\n this.video = null;\n\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n\n this.__removeVideo();\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case CONSTANTS.EVENTS.BEFORE_RENDER:\n if (this.video) {\n this.psv.needsUpdate();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {PSV.adapters.AbstractVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n if (typeof panorama !== 'object' || !panorama.source) {\n return Promise.reject(new PSVError('Invalid panorama configuration, are you using the right adapter?'));\n }\n\n if (!this.psv.getPlugin('video')) {\n return Promise.reject(new PSVError('Video adapters require VideoPlugin to be loaded too.'));\n }\n\n const video = this.__createVideo(panorama.source);\n\n return this.__videoLoadPromise(video)\n .then(() => {\n const texture = new VideoTexture(video);\n return { panorama, texture };\n });\n }\n\n /**\n * @override\n */\n __switchVideo(texture) {\n let currentTime;\n let duration;\n let paused = !this.config.autoplay;\n let muted = this.config.muted;\n let volume = 1;\n if (this.video) {\n ({ currentTime, duration, paused, muted, volume } = this.video);\n }\n\n this.__removeVideo();\n this.video = texture.image;\n\n // keep current time when switching resolution\n if (this.video.duration === duration) {\n this.video.currentTime = currentTime;\n }\n\n // keep volume\n this.video.muted = muted;\n this.video.volume = volume;\n\n // play\n if (!paused) {\n this.video.play();\n }\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n if (textureData.texture) {\n const video = textureData.texture.image;\n video.pause();\n this.psv.container.removeChild(video);\n }\n textureData.texture?.dispose();\n }\n\n /**\n * @summary Removes the current video element\n * @private\n */\n __removeVideo() {\n if (this.video) {\n this.video.pause();\n this.psv.container.removeChild(this.video);\n delete this.video;\n }\n }\n\n /**\n * @summary Creates a new video element\n * @memberOf PSV.adapters\n * @param {string} src\n * @return {HTMLVideoElement}\n * @private\n */\n __createVideo(src) {\n const video = document.createElement('video');\n video.crossOrigin = this.psv.config.withCredentials ? 'use-credentials' : 'anonymous';\n video.loop = true;\n video.playsinline = true;\n video.style.display = 'none';\n video.muted = this.config.muted;\n video.src = src;\n video.preload = 'metadata';\n\n this.psv.container.appendChild(video);\n\n return video;\n }\n\n /**\n * @private\n */\n __videoLoadPromise(video) {\n const self = this;\n\n return new Promise((resolve, reject) => {\n video.addEventListener('loadedmetadata', function onLoaded() {\n if (this.video && video.duration === this.video.duration) {\n resolve(self.__videoBufferPromise(video, this.video.currentTime));\n }\n else {\n resolve();\n }\n video.removeEventListener('loadedmetadata', onLoaded);\n });\n\n video.addEventListener('error', function onError(err) {\n reject(err);\n video.removeEventListener('error', onError);\n });\n });\n }\n\n /**\n * @private\n */\n __videoBufferPromise(video, currentTime) {\n return new Promise((resolve) => {\n function onBuffer() {\n const buffer = video.buffered;\n for (let i = 0, l = buffer.length; i < l; i++) {\n if (buffer.start(i) <= video.currentTime && buffer.end(i) >= video.currentTime) {\n video.pause();\n video.removeEventListener('buffer', onBuffer);\n video.removeEventListener('progress', onBuffer);\n resolve();\n break;\n }\n }\n }\n\n // try to reduce the switching time by preloading in advance\n // FIXME find a better way ?\n video.currentTime = Math.min(currentTime + 2000, video.duration.currentTime);\n video.muted = true;\n\n video.addEventListener('buffer', onBuffer);\n video.addEventListener('progress', onBuffer);\n\n video.play();\n });\n }\n\n}\n","import { MathUtils, Mesh, MeshBasicMaterial, SphereGeometry } from 'three';\nimport { CONSTANTS, PSVError } from '../..';\nimport { AbstractVideoAdapter } from '../shared/AbstractVideoAdapter';\n\n/**\n * @typedef {Object} PSV.adapters.EquirectangularVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.EquirectangularVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\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 videos\n * @memberof PSV.adapters\n * @extends PSV.adapters.AbstractAdapter\n */\nexport class EquirectangularVideoAdapter extends AbstractVideoAdapter {\n\n static id = 'equirectangular-video';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.adapters.EquirectangularVideoAdapter.Options} options\n */\n constructor(psv, options) {\n super(psv, {\n resolution: 64,\n ...options,\n });\n\n if (!MathUtils.isPowerOfTwo(this.config.resolution)) {\n throw new PSVError('EquirectangularVideoAdapter 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 * @param {PSV.adapters.EquirectangularVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n return super.loadTexture(panorama)\n .then(({ texture }) => {\n const video = texture.image;\n const panoData = {\n fullWidth : video.videoWidth,\n fullHeight : video.videoHeight,\n croppedWidth : video.videoWidth,\n croppedHeight: video.videoHeight,\n croppedX : 0,\n croppedY : 0,\n poseHeading : 0,\n posePitch : 0,\n poseRoll : 0,\n };\n\n return { panorama, texture, panoData };\n });\n }\n\n /**\n * @override\n */\n createMesh(scale = 1) {\n const geometry = new SphereGeometry(\n CONSTANTS.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 MeshBasicMaterial();\n\n return new 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 this.__switchVideo(textureData.texture);\n }\n\n}\n"],"names":["AbstractVideoAdapter","psv","options","config","autoplay","muted","video","on","CONSTANTS","EVENTS","BEFORE_RENDER","destroy","off","__removeVideo","handleEvent","e","type","needsUpdate","loadTexture","panorama","source","Promise","reject","PSVError","getPlugin","__createVideo","__videoLoadPromise","then","texture","VideoTexture","__switchVideo","currentTime","duration","paused","volume","image","play","disposeTexture","textureData","pause","container","removeChild","dispose","src","document","createElement","crossOrigin","withCredentials","loop","playsinline","style","display","preload","appendChild","self","resolve","addEventListener","onLoaded","__videoBufferPromise","removeEventListener","onError","err","onBuffer","buffer","buffered","i","l","length","start","end","Math","min","AbstractAdapter","EquirectangularVideoAdapter","resolution","MathUtils","isPowerOfTwo","SPHERE_SEGMENTS","SPHERE_HORIZONTAL_SEGMENTS","panoData","fullWidth","videoWidth","fullHeight","videoHeight","croppedWidth","croppedHeight","croppedX","croppedY","poseHeading","posePitch","poseRoll","createMesh","scale","geometry","SphereGeometry","SPHERE_RADIUS","PI","material","MeshBasicMaterial","Mesh","setTexture","mesh","map","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AMJ,CANI,EAMD,CANC,CAAjB,CAAA;EAQA,IAAA,IAAMK,QAAQ,GAAG,IAAIC,uBAAJ,EAAjB,CAAA;EAEA,IAAA,OAAO,IAAIC,UAAJ,CAASN,QAAT,EAAmBI,QAAnB,CAAP,CAAA;EACD,GAAA;EAED;EACF;EACA;EAlEA,GAAA;;EAAA,EAAA,MAAA,CAmEEG,UAnEF,GAmEE,SAAA,UAAA,CAAWC,IAAX,EAAiB/D,WAAjB,EAA8B;EAAA,IAAA,IAAA,kBAAA,CAAA;;EAC5B,IAAA,CAAA,kBAAA,GAAA+D,IAAI,CAACJ,QAAL,CAAcK,GAAd,wCAAmB5D,OAAnB,EAAA,CAAA;EACA2D,IAAAA,IAAI,CAACJ,QAAL,CAAcK,GAAd,GAAoBhE,WAAW,CAACV,OAAhC,CAAA;;EAEA,IAAA,IAAA,CAAKE,aAAL,CAAmBQ,WAAW,CAACV,OAA/B,CAAA,CAAA;KAvEJ,CAAA;;EAAA,EAAA,OAAA,2BAAA,CAAA;EAAA,CAAA,CAAiD5B,oBAAjD,EAAA;EAAayE,4BAEJ8B,KAAK;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"equirectangular-video.js","sources":["../../src/adapters/shared/AbstractVideoAdapter.js","../../src/adapters/equirectangular-video/index.js"],"sourcesContent":["import { VideoTexture } from 'three';\nimport { AbstractAdapter, CONSTANTS, PSVError } from '../..';\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.AbstractVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\n */\n\n/**\n * @summary Base video adapters class\n * @memberof PSV.adapters\n * @abstract\n * @private\n */\nexport class AbstractVideoAdapter extends AbstractAdapter {\n\n constructor(psv, options) {\n super(psv);\n\n /**\n * @member {PSV.adapters.AbstractVideoAdapter.Options}\n * @private\n */\n this.config = {\n autoplay: false,\n muted : options?.autoplay ?? false,\n ...options,\n };\n\n /**\n * @member {HTMLVideoElement}\n * @private\n */\n this.video = null;\n\n this.psv.on(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n }\n\n /**\n * @override\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.BEFORE_RENDER, this);\n\n this.__removeVideo();\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case CONSTANTS.EVENTS.BEFORE_RENDER:\n if (this.video) {\n this.psv.needsUpdate();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n * @param {PSV.adapters.AbstractVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n if (typeof panorama !== 'object' || !panorama.source) {\n return Promise.reject(new PSVError('Invalid panorama configuration, are you using the right adapter?'));\n }\n\n if (!this.psv.getPlugin('video')) {\n return Promise.reject(new PSVError('Video adapters require VideoPlugin to be loaded too.'));\n }\n\n const video = this.__createVideo(panorama.source);\n\n return this.__videoLoadPromise(video)\n .then(() => {\n const texture = new VideoTexture(video);\n return { panorama, texture };\n });\n }\n\n /**\n * @override\n */\n __switchVideo(texture) {\n let currentTime;\n let duration;\n let paused = !this.config.autoplay;\n let muted = this.config.muted;\n let volume = 1;\n if (this.video) {\n ({ currentTime, duration, paused, muted, volume } = this.video);\n }\n\n this.__removeVideo();\n this.video = texture.image;\n\n // keep current time when switching resolution\n if (this.video.duration === duration) {\n this.video.currentTime = currentTime;\n }\n\n // keep volume\n this.video.muted = muted;\n this.video.volume = volume;\n\n // play\n if (!paused) {\n this.video.play();\n }\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n if (textureData.texture) {\n const video = textureData.texture.image;\n video.pause();\n this.psv.container.removeChild(video);\n }\n textureData.texture?.dispose();\n }\n\n /**\n * @summary Removes the current video element\n * @private\n */\n __removeVideo() {\n if (this.video) {\n this.video.pause();\n this.psv.container.removeChild(this.video);\n delete this.video;\n }\n }\n\n /**\n * @summary Creates a new video element\n * @memberOf PSV.adapters\n * @param {string} src\n * @return {HTMLVideoElement}\n * @private\n */\n __createVideo(src) {\n const video = document.createElement('video');\n video.crossOrigin = this.psv.config.withCredentials ? 'use-credentials' : 'anonymous';\n video.loop = true;\n video.playsInline = true;\n video.style.display = 'none';\n video.muted = this.config.muted;\n video.src = src;\n video.preload = 'metadata';\n\n this.psv.container.appendChild(video);\n\n return video;\n }\n\n /**\n * @private\n */\n __videoLoadPromise(video) {\n const self = this;\n\n return new Promise((resolve, reject) => {\n video.addEventListener('loadedmetadata', function onLoaded() {\n if (this.video && video.duration === this.video.duration) {\n resolve(self.__videoBufferPromise(video, this.video.currentTime));\n }\n else {\n resolve();\n }\n video.removeEventListener('loadedmetadata', onLoaded);\n });\n\n video.addEventListener('error', function onError(err) {\n reject(err);\n video.removeEventListener('error', onError);\n });\n });\n }\n\n /**\n * @private\n */\n __videoBufferPromise(video, currentTime) {\n return new Promise((resolve) => {\n function onBuffer() {\n const buffer = video.buffered;\n for (let i = 0, l = buffer.length; i < l; i++) {\n if (buffer.start(i) <= video.currentTime && buffer.end(i) >= video.currentTime) {\n video.pause();\n video.removeEventListener('buffer', onBuffer);\n video.removeEventListener('progress', onBuffer);\n resolve();\n break;\n }\n }\n }\n\n // try to reduce the switching time by preloading in advance\n // FIXME find a better way ?\n video.currentTime = Math.min(currentTime + 2000, video.duration.currentTime);\n video.muted = true;\n\n video.addEventListener('buffer', onBuffer);\n video.addEventListener('progress', onBuffer);\n\n video.play();\n });\n }\n\n}\n","import { MathUtils, Mesh, MeshBasicMaterial, SphereGeometry } from 'three';\nimport { CONSTANTS, PSVError } from '../..';\nimport { AbstractVideoAdapter } from '../shared/AbstractVideoAdapter';\n\n/**\n * @typedef {Object} PSV.adapters.EquirectangularVideoAdapter.Video\n * @summary Object defining a video\n * @property {string} source\n */\n\n/**\n * @typedef {Object} PSV.adapters.EquirectangularVideoAdapter.Options\n * @property {boolean} [autoplay=false] - automatically start the video\n * @property {boolean} [muted=autoplay] - initially mute the video\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 videos\n * @memberof PSV.adapters\n * @extends PSV.adapters.AbstractAdapter\n */\nexport class EquirectangularVideoAdapter extends AbstractVideoAdapter {\n\n static id = 'equirectangular-video';\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.adapters.EquirectangularVideoAdapter.Options} options\n */\n constructor(psv, options) {\n super(psv, {\n resolution: 64,\n ...options,\n });\n\n if (!MathUtils.isPowerOfTwo(this.config.resolution)) {\n throw new PSVError('EquirectangularVideoAdapter 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 * @param {PSV.adapters.EquirectangularVideoAdapter.Video} panorama\n * @returns {Promise.}\n */\n loadTexture(panorama) {\n return super.loadTexture(panorama)\n .then(({ texture }) => {\n const video = texture.image;\n const panoData = {\n fullWidth : video.videoWidth,\n fullHeight : video.videoHeight,\n croppedWidth : video.videoWidth,\n croppedHeight: video.videoHeight,\n croppedX : 0,\n croppedY : 0,\n poseHeading : 0,\n posePitch : 0,\n poseRoll : 0,\n };\n\n return { panorama, texture, panoData };\n });\n }\n\n /**\n * @override\n */\n createMesh(scale = 1) {\n const geometry = new SphereGeometry(\n CONSTANTS.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 MeshBasicMaterial();\n\n return new 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 this.__switchVideo(textureData.texture);\n }\n\n}\n"],"names":["AbstractVideoAdapter","psv","options","config","autoplay","muted","video","on","CONSTANTS","EVENTS","BEFORE_RENDER","destroy","off","__removeVideo","handleEvent","e","type","needsUpdate","loadTexture","panorama","source","Promise","reject","PSVError","getPlugin","__createVideo","__videoLoadPromise","then","texture","VideoTexture","__switchVideo","currentTime","duration","paused","volume","image","play","disposeTexture","textureData","pause","container","removeChild","dispose","src","document","createElement","crossOrigin","withCredentials","loop","playsInline","style","display","preload","appendChild","self","resolve","addEventListener","onLoaded","__videoBufferPromise","removeEventListener","onError","err","onBuffer","buffer","buffered","i","l","length","start","end","Math","min","AbstractAdapter","EquirectangularVideoAdapter","resolution","MathUtils","isPowerOfTwo","SPHERE_SEGMENTS","SPHERE_HORIZONTAL_SEGMENTS","panoData","fullWidth","videoWidth","fullHeight","videoHeight","croppedWidth","croppedHeight","croppedX","croppedY","poseHeading","posePitch","poseRoll","createMesh","scale","geometry","SphereGeometry","SPHERE_RADIUS","PI","material","MeshBasicMaterial","Mesh","setTexture","mesh","map","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;;EACA,IAAaA,oBAAb,gBAAA,UAAA,gBAAA,EAAA;EAAA,EAAA,cAAA,CAAA,oBAAA,EAAA,gBAAA,CAAA,CAAA;;IAEE,SAAYC,oBAAAA,CAAAA,GAAZ,EAAiBC,OAAjB,EAA0B;EAAA,IAAA,IAAA,iBAAA,CAAA;;EAAA,IAAA,IAAA,KAAA,CAAA;;EACxB,IAAA,KAAA,GAAA,gBAAA,CAAA,IAAA,CAAA,IAAA,EAAMD,GAAN,CAAA,IAAA,IAAA,CAAA;EAEA;EACJ;EACA;EACA;;EACI,IAAA,KAAA,CAAKE,MAAL,GAAA,QAAA,CAAA;EACEC,MAAAA,QAAQ,EAAE,KADZ;EAEEC,MAAAA,KAAK,uBAAKH,OAAL,IAAA,IAAA,GAAA,KAAA,CAAA,GAAKA,OAAO,CAAEE,QAAd,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ayE,4BAEJ8B,KAAK;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/adapters/little-planet.js b/dist/adapters/little-planet.js index c54e0f532..424d0c5a0 100644 --- a/dist/adapters/little-planet.js +++ b/dist/adapters/little-planet.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 5d7460579..32705020e 100644 --- a/dist/photo-sphere-viewer.css +++ b/dist/photo-sphere-viewer.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.8.0 + * Photo Sphere Viewer 4.8.1 * @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.js b/dist/photo-sphere-viewer.js index 11b245819..9d6053d1e 100644 --- a/dist/photo-sphere-viewer.js +++ b/dist/photo-sphere-viewer.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -292,6 +292,14 @@ * @constant */ var DEFAULT_TRANSITION = 1500; + /** + * @summary Minimum duration of the animations created with {@link Viewer#animate} + * @memberOf PSV.constants + * @type {number} + * @constant + */ + + var ANIMATION_MIN_DURATION = 500; /** * @summary Number of pixels bellow which a mouse move will be considered as a click * @memberOf PSV.constants @@ -739,6 +747,7 @@ var constants = /*#__PURE__*/Object.freeze({ __proto__: null, DEFAULT_TRANSITION: DEFAULT_TRANSITION, + ANIMATION_MIN_DURATION: ANIMATION_MIN_DURATION, MOVE_THRESHOLD: MOVE_THRESHOLD, DBLCLICK_DELAY: DBLCLICK_DELAY, LONGTOUCH_DELAY: LONGTOUCH_DELAY, @@ -9687,7 +9696,7 @@ this.prop.animationPromise = new Animation({ properties: animProperties, - duration: duration, + duration: Math.max(ANIMATION_MIN_DURATION, duration), easing: 'inOutSine', onTick: function onTick(properties) { if (positionProvided) { diff --git a/dist/photo-sphere-viewer.js.map b/dist/photo-sphere-viewer.js.map index 951f49629..4e93a626d 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 { ShaderMaterial, Texture } from 'three';\nimport { PSVError } from '../PSVError';\n\n/**\n * @namespace PSV.adapters\n */\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 * @summary Indicated if the adapter can display an additional transparent image above the panorama\n * @type {boolean}\n */\n static supportsOverlay = 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 * @param {boolean} [useXmpPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData, useXmpPanoData) { // 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 * @abstract\n * @summary Applies the overlay to the mesh\n * @param {external:THREE.Mesh} mesh\n * @param {PSV.TextureData} textureData\n * @param {number} opacity\n */\n setOverlay(mesh, textureData, opacity) { // eslint-disable-line no-unused-vars\n throw new PSVError('setOverlay not implemented');\n }\n\n /**\n * @internal\n */\n static OVERLAY_UNIFORMS = {\n panorama : 'panorama',\n overlay : 'overlay',\n globalOpacity : 'globalOpacity',\n overlayOpacity: 'overlayOpacity',\n };\n\n /**\n * @internal\n */\n static createOverlayMaterial({ additionalUniforms, overrideVertexShader } = {}) {\n return new ShaderMaterial({\n uniforms: {\n ...additionalUniforms,\n [AbstractAdapter.OVERLAY_UNIFORMS.panorama] : { value: new Texture() },\n [AbstractAdapter.OVERLAY_UNIFORMS.overlay] : { value: new Texture() },\n [AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity] : { value: 1.0 },\n [AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity]: { value: 1.0 },\n },\n\n vertexShader: overrideVertexShader || `\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`,\n\n fragmentShader: `\nuniform sampler2D ${AbstractAdapter.OVERLAY_UNIFORMS.panorama};\nuniform sampler2D ${AbstractAdapter.OVERLAY_UNIFORMS.overlay};\nuniform float ${AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity};\nuniform float ${AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity};\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 tColor1 = texture2D( ${AbstractAdapter.OVERLAY_UNIFORMS.panorama}, vUv );\n vec4 tColor2 = texture2D( ${AbstractAdapter.OVERLAY_UNIFORMS.overlay}, vUv );\n gl_FragColor = vec4(\n mix( tColor1.rgb, tColor2.rgb, tColor2.a * ${AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity} ),\n ${AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity}\n );\n}`,\n });\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) {\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 element.classList.add(...className.split(' '));\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 element.classList.remove(...className.split(' '));\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","import { MathUtils } from 'three';\n\n/**\n * @deprecated use THREE.MathUtils.clamp\n */\nexport function bound(x, min, max) {\n return MathUtils.clamp(x, min, max);\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 * @deprecated Use THREE.MathUtils.isPowerOfTwo\n */\nexport function isPowerOfTwo(x) {\n return MathUtils.isPowerOfTwo(x);\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 { LinearFilter, MathUtils, Quaternion, Texture } from 'three';\nimport { PSVError } from '../PSVError';\nimport { 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 X_VALUES = ['left', 'center', 'right'];\n/**\n * @readonly\n * @private\n */\nconst Y_VALUES = ['top', 'center', 'bottom'];\n/**\n * @readonly\n * @private\n */\nconst POS_VALUES = [...X_VALUES, ...Y_VALUES];\n/**\n * @readonly\n * @private\n */\nconst CENTER = 'center';\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 {object} [options]\n * @param {boolean} [options.allowCenter=true] allow \"center center\"\n * @param {boolean} [options.cssOrder=true] force CSS order (y axis then x axis)\n * @return {string[]}\n */\nexport function cleanPosition(value, { allowCenter, cssOrder } = { allowCenter: true, cssOrder: true }) {\n if (!value) {\n return null;\n }\n\n if (typeof value === 'string') {\n value = value.split(' ');\n }\n\n if (value.length === 1) {\n if (value[0] === CENTER) {\n value = [CENTER, CENTER];\n }\n else if (X_VALUES.indexOf(value[0]) !== -1) {\n value = [CENTER, value[0]];\n }\n else if (Y_VALUES.indexOf(value[0]) !== -1) {\n value = [value[0], CENTER];\n }\n }\n\n if (value.length !== 2 || POS_VALUES.indexOf(value[0]) === -1 || POS_VALUES.indexOf(value[1]) === -1) {\n logWarn(`Unparsable position ${value}`);\n return null;\n }\n\n if (!allowCenter && value[0] === CENTER && value[1] === CENTER) {\n logWarn(`Invalid position center center`);\n return null;\n }\n\n if (cssOrder && !positionIsOrdered(value)) {\n value = [value[1], value[0]];\n }\n if (value[1] === CENTER && X_VALUES.indexOf(value[0]) !== -1) {\n value = [CENTER, value[0]];\n }\n if (value[0] === CENTER && Y_VALUES.indexOf(value[1]) !== -1) {\n value = [value[1], CENTER];\n }\n\n return value;\n}\n\n/**\n * @summary Checks if an array of two positions is ordered (y axis then x axis)\n * @param {string[]} value\n * @return {boolean}\n */\nexport function positionIsOrdered(value) {\n return Y_VALUES.indexOf(value[0]) !== -1 && X_VALUES.indexOf(value[1]) !== -1;\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 = 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 = 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 ? MathUtils.clamp(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 Texture(img);\n texture.needsUpdate = true;\n texture.minFilter = LinearFilter;\n texture.generateMipmaps = false;\n return texture;\n}\n\nconst quaternion = new 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';\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 if (this.__cancelled) {\n return;\n }\n\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 * @returns {Promise}\n */\n then(onFulfilled) {\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","import { MathUtils } from 'three';\nimport { PSVError } from '../PSVError';\nimport { 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) : MathUtils.clamp(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) : MathUtils.clamp(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) : MathUtils.clamp(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 { MathUtils, Mesh, SphereGeometry, Texture } from 'three';\nimport { SPHERE_RADIUS } from '../../data/constants';\nimport { SYSTEM } from '../../data/system';\nimport { PSVError } from '../../PSVError';\nimport { createTexture, firstNonNull, getXMPValue, 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 static supportsOverlay = 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 (!MathUtils.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 * @param {boolean} [useXmpPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData, useXmpPanoData = this.psv.config.useXmpData) {\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 useXmpPanoData\n ? this.__loadXMP(panorama, p => this.psv.loader.setProgress(p))\n .then(xmpPanoData => this.psv.textureLoader.loadImage(panorama).then(img => ({ img, xmpPanoData })))\n : this.psv.textureLoader.loadImage(panorama, p => this.psv.loader.setProgress(p))\n .then(img => ({ img: img, xmpPanoData: null }))\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 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 = AbstractAdapter.createOverlayMaterial();\n\n return new Mesh(geometry, material);\n }\n\n /**\n * @override\n */\n setTexture(mesh, textureData) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.panorama, textureData.texture);\n this.setOverlay(mesh, null);\n }\n\n /**\n * @override\n */\n setOverlay(mesh, textureData, opacity) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity, opacity);\n if (!textureData) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.overlay, new Texture());\n }\n else {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.overlay, textureData.texture);\n }\n }\n\n /**\n * @override\n */\n setTextureOpacity(mesh, opacity) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity, opacity);\n mesh.material.transparent = opacity < 1;\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n textureData.texture?.dispose();\n }\n\n /**\n * @param {external:THREE.Mesh} mesh\n * @param {string} uniform\n * @param {*} value\n * @private\n */\n __setUniform(mesh, uniform, value) {\n if (mesh.material.uniforms[uniform].value instanceof Texture) {\n mesh.material.uniforms[uniform].value.dispose();\n }\n mesh.material.uniforms[uniform].value = value;\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 * @param {boolean} [visible] - forced state\n */\n toggle(visible) {\n if (visible === false || visible === undefined && this.isVisible()) {\n this.hide();\n }\n else if (visible === true || visible === undefined && !this.isVisible()) {\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 this.toggle(supported);\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.call(this.psv, 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 { MathUtils } from 'three';\nimport { AbstractAdapter } from '../adapters/AbstractAdapter';\nimport { EquirectangularAdapter } from '../adapters/equirectangular';\nimport { AbstractPlugin } from '../plugins/AbstractPlugin';\nimport { PSVError } from '../PSVError';\nimport { 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 overlay : null,\n overlayOpacity : 1,\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 autorotateZoomLvl : null,\n moveInertia : true,\n mousewheel : true,\n mousemove : true,\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 captureCursor: 'captureCursor 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 overlayOpacity : (overlayOpacity) => {\n return MathUtils.clamp(overlayOpacity, 0, 1);\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 defaultZoomLvl : (defaultZoomLvl) => {\n return MathUtils.clamp(defaultZoomLvl, 0, 100);\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 MathUtils.clamp(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 MathUtils.clamp(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 autorotateZoomLvl: (autorotateZoomLvl) => {\n if (isNil(autorotateZoomLvl)) {\n return null;\n }\n else {\n return MathUtils.clamp(autorotateZoomLvl, 0, 100);\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 this.toggle(this.container.offsetWidth >= this.prop.contentWidth);\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 { MathUtils } from 'three';\nimport { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { 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, MathUtils.clamp(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 { Euler, MathUtils, Vector2, Vector3 } 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 Vector2();\nconst vector3 = new Vector3();\nconst eulerZero = new 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 MathUtils.radToDeg(2 * Math.atan(Math.tan(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 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, !this.prop.littlePlanet),\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 : MathUtils.degToRad(panoData?.poseHeading || 0),\n tilt: MathUtils.degToRad(panoData?.posePitch || 0),\n roll: MathUtils.degToRad(panoData?.poseRoll || 0),\n };\n }\n\n}\n","import { MathUtils, SplineCurve, Vector2 } 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 MESH_USER_DATA,\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 {\n clone,\n distance,\n each,\n getClosest,\n getPosition,\n hasParent,\n isEmpty,\n isFullscreenEnabled,\n normalizeWheel,\n throttle\n} from '../utils';\nimport { Animation } from '../utils/Animation';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractService } from './AbstractService';\n\nconst IDLE = 0;\nconst MOVING = 1;\nconst INERTIA = 2;\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 {number} step\n * @property {boolean} mousedown - before moving past the threshold\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 step : IDLE,\n mousedown : 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, { passive: false });\n window.addEventListener('keyup', this);\n this.psv.container.addEventListener('mousedown', this);\n window.addEventListener('mousemove', this, { passive: false });\n window.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchstart', this, { passive: false });\n window.addEventListener('touchmove', this, { passive: false });\n window.addEventListener('touchend', this, { passive: false });\n this.psv.container.addEventListener(SYSTEM.mouseWheelEvent, this, { passive: false });\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('mousedown', this);\n window.removeEventListener('mousemove', this);\n window.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchstart', this);\n window.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 'mousemove': this.__onMouseMove(evt); break;\n case 'mouseup': this.__onMouseUp(evt); break;\n case 'touchmove': this.__onTouchMove(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 'touchstart': this.__onTouchStart(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 e.preventDefault();\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 e.preventDefault();\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 this.state.mousedown = true;\n this.state.startMouseX = evt.clientX;\n this.state.startMouseY = evt.clientY;\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (this.state.mousedown || this.state.step === MOVING) {\n this.__stopMove(evt.clientX, evt.clientY, evt.target, evt.button === 2);\n }\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.config.mousemove && (this.state.mousedown || this.state.step === MOVING)) {\n evt.preventDefault();\n this.__move(evt.clientX, evt.clientY);\n }\n\n if (!isEmpty(this.prop.objectsObservers) && hasParent(evt.target, this.psv.container)) {\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 (evt.touches.length === 1) {\n this.state.mousedown = true;\n this.state.startMouseX = evt.touches[0].clientX;\n this.state.startMouseY = evt.touches[0].clientY;\n\n if (!this.prop.longtouchTimeout) {\n this.prop.longtouchTimeout = setTimeout(() => {\n const touch = evt.touches[0];\n this.__stopMove(touch.clientX, touch.clientY, touch.target, true);\n this.prop.longtouchTimeout = null;\n }, LONGTOUCH_DELAY);\n }\n }\n else if (evt.touches.length === 2) {\n this.state.mousedown = false;\n this.__cancelLongTouch();\n\n if (this.config.mousemove) {\n this.__cancelTwoFingersOverlay();\n this.__startMoveZoom(evt);\n evt.preventDefault();\n }\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchEnd(evt) {\n this.__cancelLongTouch();\n\n if (this.state.mousedown || this.state.step === MOVING) {\n evt.preventDefault();\n this.__cancelTwoFingersOverlay();\n\n if (evt.touches.length === 1) {\n this.__stopMove(this.state.mouseX, this.state.mouseY);\n }\n else if (evt.touches.length === 0) {\n const touch = evt.changedTouches[0];\n this.__stopMove(touch.clientX, touch.clientY, touch.target);\n }\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n this.__cancelLongTouch();\n\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (this.config.touchmoveTwoFingers) {\n if (this.state.mousedown && !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 if (this.state.mousedown || this.state.step === MOVING) {\n evt.preventDefault();\n const touch = evt.touches[0];\n this.__move(touch.clientX, touch.clientY);\n }\n }\n else {\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.config.touchmoveTwoFingers) {\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 /**\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 Resets all state variables\n * @private\n */\n __resetMove() {\n this.state.step = IDLE;\n this.state.mousedown = false;\n this.state.mouseX = 0;\n this.state.mouseY = 0;\n this.state.startMouseX = 0;\n this.state.startMouseY = 0;\n this.state.mouseHistory.length = 0;\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 this.__resetMove();\n\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.step = MOVING;\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.__logMouseMove(this.state.mouseX, this.state.mouseY);\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 {int} clientX\n * @param {int} clientY\n * @param {EventTarget} [target]\n * @param {boolean} [rightclick=false]\n * @private\n */\n __stopMove(clientX, clientY, target = null, rightclick = false) {\n if (this.state.step === MOVING) {\n if (this.config.moveInertia) {\n this.__logMouseMove(clientX, clientY);\n this.__stopMoveInertia(clientX, clientY);\n }\n else {\n this.__resetMove();\n this.psv.resetIdleTimer();\n }\n }\n else if (this.state.mousedown) {\n this.psv.stopAnimation();\n this.__click(clientX, clientY, target, rightclick);\n this.__resetMove();\n this.psv.resetIdleTimer();\n }\n }\n\n /**\n * @summary Performs an animation to simulate inertia when the movement stops\n * @param {int} clientX\n * @param {int} clientY\n * @private\n */\n __stopMoveInertia(clientX, clientY) {\n // get direction at end of movement\n const curve = new SplineCurve(this.state.mouseHistory.map(([, x, y]) => new Vector2(x, y)));\n const direction = curve.getTangent(1);\n\n // average speed\n const speed = this.state.mouseHistory.slice(1).reduce(({ total, prev }, curr) => {\n return {\n total: total + distance({ x: prev[1], y: prev[2] }, { x: curr[1], y: curr[2] }) / (curr[0] - prev[0]),\n prev : curr,\n };\n }, {\n total: 0,\n prev : this.state.mouseHistory[0],\n }).total / this.state.mouseHistory.length;\n\n if (!speed) {\n this.__resetMove();\n this.psv.resetIdleTimer();\n return;\n }\n\n this.state.step = INERTIA;\n\n let currentClientX = clientX;\n let currentClientY = clientY;\n\n this.prop.animationPromise = new Animation({\n properties: {\n speed: { start: speed, end: 0 },\n },\n duration : 1000,\n easing : 'outQuad',\n onTick : (properties) => {\n // 3 is a magic number\n currentClientX += properties.speed * direction.x * 3 * SYSTEM.pixelRatio;\n currentClientY += properties.speed * direction.y * 3 * SYSTEM.pixelRatio;\n this.__applyMove(currentClientX, currentClientY);\n },\n });\n\n this.prop.animationPromise\n .then((done) => {\n this.prop.animationPromise = null;\n if (done) {\n this.__resetMove();\n this.psv.resetIdleTimer();\n }\n });\n }\n\n /**\n * @summary Triggers an event with all coordinates when a simple click is performed\n * @param {int} clientX\n * @param {int} clientY\n * @param {EventTarget} target\n * @param {boolean} [rightclick=false]\n * @fires PSV.click\n * @fires PSV.dblclick\n * @private\n */\n __click(clientX, clientY, target, rightclick = false) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n /**\n * @type {PSV.ClickData}\n */\n const data = {\n rightclick: rightclick,\n target : target,\n clientX : clientX,\n clientY : clientY,\n viewerX : clientX - boundingRect.left,\n viewerY : 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[MESH_USER_DATA]);\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[MESH_USER_DATA]);\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 Starts moving when crossing moveThreshold and performs movement\n * @param {int} clientX\n * @param {int} clientY\n * @private\n */\n __move(clientX, clientY) {\n if (this.state.mousedown\n && (Math.abs(clientX - this.state.startMouseX) >= this.state.moveThreshold\n || Math.abs(clientY - this.state.startMouseY) >= this.state.moveThreshold)) {\n this.psv.__stopAll();\n this.__resetMove();\n this.state.step = MOVING;\n this.state.mouseX = clientX;\n this.state.mouseY = clientY;\n this.__logMouseMove(clientX, clientY);\n }\n else if (this.state.step === MOVING) {\n this.__applyMove(clientX, clientY);\n this.__logMouseMove(clientX, clientY);\n }\n }\n\n /**\n * @summary Raw method for movement, called from mouse event and move inertia\n * @param {int} clientX\n * @param {int} clientY\n * @private\n */\n __applyMove(clientX, clientY) {\n const rotation = {\n longitude: (clientX - this.state.mouseX) / this.prop.size.width * this.config.moveSpeed\n * MathUtils.degToRad(this.prop.littlePlanet ? 90 : this.prop.hFov),\n latitude : (clientY - this.state.mouseY) / this.prop.size.height * this.config.moveSpeed\n * MathUtils.degToRad(this.prop.littlePlanet ? 90 : 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 = clientX;\n this.state.mouseY = clientY;\n }\n\n /**\n * @summary Perfoms combined move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __moveZoom(evt) {\n if (this.state.step === MOVING) {\n evt.preventDefault();\n\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 = (p - this.state.pinchDist) / SYSTEM.pixelRatio * this.config.zoomSpeed;\n\n this.psv.zoom(this.psv.getZoomLevel() + delta);\n\n this.__move((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);\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 {int} clientX\n * @param {int} clientY\n * @private\n */\n __logMouseMove(clientX, clientY) {\n const now = Date.now();\n\n const last = this.state.mouseHistory.length ? this.state.mouseHistory[this.state.mouseHistory.length - 1] : [0, -1, -1];\n\n // avoid duplicates\n if (last[1] === clientX && last[2] === clientY) {\n last[0] = now;\n }\n else if (now === last[0]) {\n last[1] = clientX;\n last[2] = clientY;\n }\n else {\n this.state.mouseHistory.push([now, clientX, clientY]);\n }\n\n let previous = null;\n\n for (let i = 0; i < this.state.mouseHistory.length;) {\n if (this.state.mouseHistory[i][0] < now - INERTIA_WINDOW) {\n this.state.mouseHistory.splice(i, 1);\n }\n else if (previous && this.state.mouseHistory[i][0] - previous > INERTIA_WINDOW / 10) {\n this.state.mouseHistory.splice(0, i);\n i = 0;\n previous = this.state.mouseHistory[i][0];\n }\n else {\n previous = this.state.mouseHistory[i][0];\n i++;\n }\n }\n }\n\n}\n","import { Group, PerspectiveCamera, Raycaster, Scene, Vector3, WebGLRenderer } from 'three';\nimport { EVENTS, MESH_USER_DATA, SPHERE_RADIUS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { Animation, 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 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 Scene();\n\n /**\n * @member {external:THREE.PerspectiveCamera}\n * @readonly\n * @protected\n */\n this.camera = new PerspectiveCamera(50, 16 / 9, 0.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 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 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 Applies the overlay to the mesh\n * @param {PSV.TextureData} textureData\n * @param {number} opacity\n * @package\n */\n setOverlay(textureData, opacity) {\n this.psv.adapter.setOverlay(this.mesh, textureData, opacity);\n this.psv.needsUpdate();\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.utils.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 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 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 Vector3(0, 1, 0).cross(this.camera.getWorldDirection(new 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 Scene)) {\n item.dispose();\n }\n\n if (item !== object) {\n this.__cleanTHREEScene(item);\n }\n });\n }\n\n}\n","import { FileLoader } 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 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 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?.(progress);\n\n this.loader.load(\n url,\n (result) => {\n progress = 100;\n 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?.(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, positionIsOrdered } 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, border: number}} size\n */\n constructor(psv, size) {\n super(psv, 'psv-tooltip');\n\n /**\n * @override\n * @property {number} arrow\n * @property {number} border\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 if (!config.box) {\n config.box = {\n width : 0,\n height: 0,\n };\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, { allowCenter: false, cssOrder: false }) || ['top', 'center'],\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 swapY = null;\n let swapX = null;\n if (style.top < 0) {\n swapY = 'bottom';\n }\n else if (style.top + style.height > this.psv.prop.size.height) {\n swapY = 'top';\n }\n if (style.left < 0) {\n swapX = 'right';\n }\n else if (style.left + style.width > this.psv.prop.size.width) {\n swapX = 'left';\n }\n if (swapX || swapY) {\n const ordered = positionIsOrdered(style.posClass);\n if (swapY) {\n style.posClass[ordered ? 0 : 1] = swapY;\n }\n if (swapX) {\n style.posClass[ordered ? 1 : 0] = swapX;\n }\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 const arrow = this.prop.arrow;\n const top = config.top;\n const height = style.height;\n const left = config.left;\n const width = style.width;\n const offsetSide = arrow + this.prop.border;\n const offsetX = config.box.width / 2 + arrow * 2;\n const offsetY = config.box.height / 2 + arrow * 2;\n\n switch (style.posClass.join('-')) {\n case 'top-left':\n style.top = top - offsetY - height;\n style.left = left + offsetSide - width;\n style.arrowTop = height;\n style.arrowLeft = width - offsetSide - arrow;\n break;\n case 'top-center':\n style.top = top - offsetY - height;\n style.left = left - width / 2;\n style.arrowTop = height;\n style.arrowLeft = width / 2 - arrow;\n break;\n case 'top-right':\n style.top = top - offsetY - height;\n style.left = left - offsetSide;\n style.arrowTop = height;\n style.arrowLeft = arrow;\n break;\n case 'bottom-left':\n style.top = top + offsetY;\n style.left = left + offsetSide - width;\n style.arrowTop = -arrow * 2;\n style.arrowLeft = width - offsetSide - arrow;\n break;\n case 'bottom-center':\n style.top = top + offsetY;\n style.left = left - width / 2;\n style.arrowTop = -arrow * 2;\n style.arrowLeft = width / 2 - arrow;\n break;\n case 'bottom-right':\n style.top = top + offsetY;\n style.left = left - offsetSide;\n style.arrowTop = -arrow * 2;\n style.arrowLeft = arrow;\n break;\n case 'left-top':\n style.top = top + offsetSide - height;\n style.left = left - offsetX - width;\n style.arrowTop = height - offsetSide - arrow;\n style.arrowLeft = width;\n break;\n case 'center-left':\n style.top = top - height / 2;\n style.left = left - offsetX - width;\n style.arrowTop = height / 2 - arrow;\n style.arrowLeft = width;\n break;\n case 'left-bottom':\n style.top = top - offsetSide;\n style.left = left - offsetX - width;\n style.arrowTop = arrow;\n style.arrowLeft = width;\n break;\n case 'right-top':\n style.top = top + offsetSide - height;\n style.left = left + offsetX;\n style.arrowTop = height - offsetSide - arrow;\n style.arrowLeft = -arrow * 2;\n break;\n case 'center-right':\n style.top = top - height / 2;\n style.left = left + offsetX;\n style.arrowTop = height / 2 - arrow;\n style.arrowLeft = -arrow * 2;\n break;\n case 'right-bottom':\n style.top = top - offsetSide;\n style.left = left + offsetX;\n style.arrowTop = arrow;\n style.arrowLeft = -arrow * 2;\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, { arrow: 0, border: 0 });\n\n /**\n * @summary Computed static sizes\n * @member {Object}\n * @package\n * @property {number} arrow\n * @property {number} border\n */\n this.size = {\n arrow : parseInt(getStyle(testTooltip.arrow, 'borderTopWidth'), 10),\n border: parseInt(getStyle(testTooltip.container, 'borderTopLeftRadius'), 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 { Cache, MathUtils, Vector3 } 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\nCache.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.utils.Animation} animationPromise - promise of the current animation\n * @property {Promise} loadingPromise - promise of the setPanorama method\n * @property {boolean} littlePlanet - special tweaks for LittlePlanetAdapter\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 Vector3(0, 0, SPHERE_RADIUS),\n vFov : null,\n hFov : null,\n aspect : null,\n autorotateEnabled: false,\n animationPromise : null,\n loadingPromise : null,\n littlePlanet : false,\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 : this.prop.littlePlanet\n ? new Dynamic(null, this.config.defaultLat, 0, Math.PI * 2, true)\n : 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 ['sphereCorrection', 'panoData', 'overlay', 'overlayOpacity'].forEach((opt) => {\n if (!(opt in options)) {\n options[opt] = this.config[opt];\n }\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 if (!options.panoData && typeof this.config.panoData === 'function') {\n options.panoData = this.config.panoData;\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.setOverlay(options.overlay, options.overlayOpacity);\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 })\n .then((completed) => {\n this.prop.transitionAnimation = null;\n if (!completed) {\n throw getAbortError();\n }\n })\n .then(done, done);\n }\n\n return this.prop.loadingPromise;\n }\n\n /**\n * @summary Loads a new overlay\n * @param {*} path - URL of the new overlay file\n * @param {number} [opacity=1]\n * @returns {Promise}\n */\n setOverlay(path, opacity = 1) {\n if (!path) {\n if (this.adapter.constructor.supportsOverlay) {\n this.renderer.setOverlay(null, 0);\n }\n\n return Promise.resolve();\n }\n else {\n if (!this.adapter.constructor.supportsOverlay) {\n return Promise.reject(new PSVError(`${this.adapter.constructor.id} adapter does not supports overlay`));\n }\n\n return this.adapter.loadTexture(path, (image) => {\n const p = this.prop.panoData;\n const r = image.width / p.croppedWidth;\n return {\n fullWidth : r * p.fullWidth,\n fullHeight : r * p.fullHeight,\n croppedWidth : r * p.croppedWidth,\n croppedHeight: r * p.croppedHeight,\n croppedX : r * p.croppedX,\n croppedY : r * p.croppedY,\n };\n }, false)\n .then((textureData) => {\n this.renderer.setOverlay(textureData, opacity);\n });\n }\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 'overlay':\n case 'overlayOpacity':\n this.setOverlay(this.config.overlay, this.config.overlayOpacity);\n break;\n\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 if (this.config.autorotateZoomLvl !== null) {\n this.dynamics.zoom.goto(this.config.autorotateZoomLvl);\n }\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 this.dynamics.zoom.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.utils.Animation}\n */\n animate(options) {\n this.__stopAll();\n\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = options.zoom !== undefined;\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 this.prop.animationPromise.cancel();\n return this.prop.animationPromise;\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(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","useXmpPanoData","createMesh","scale","setTexture","mesh","textureData","transition","setTextureOpacity","opacity","disposeTexture","setOverlay","createOverlayMaterial","additionalUniforms","overrideVertexShader","ShaderMaterial","uniforms","OVERLAY_UNIFORMS","value","Texture","overlay","globalOpacity","overlayOpacity","vertexShader","fragmentShader","id","supportsDownload","supportsOverlay","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","add","remove","addClasses","split","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","MathUtils","clamp","loop","result","isPowerOfTwo","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","forEach","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","X_VALUES","Y_VALUES","POS_VALUES","CENTER","cleanPosition","allowCenter","cssOrder","indexOf","positionIsOrdered","parseSpeed","speed","speedStr","trim","speedValue","speedUnit","degToRad","parseAngle","angle","zeroCenter","halfCircle","unit","createTexture","img","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","__cancelled","progress","duration","current","properties","start","end","onTick","__resolve","cb","then","onFulfilled","push","cancel","cancelAnimationFrame","Dynamic","fn","defaultValue","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","useXmpData","reject","__loadXMP","loader","setProgress","xmpPanoData","textureLoader","loadImage","panoData","fullWidth","fullHeight","croppedWidth","croppedHeight","croppedX","croppedY","poseHeading","posePitch","poseRoll","__createEquirectangularTexture","onProgress","loadFile","blob","__loadBlobAsString","binary","substring","includes","reader","FileReader","onload","onerror","readAsText","ratio","resizedPanoData","buffer","drawImage","geometry","SphereGeometry","material","Mesh","__setUniform","transparent","dispose","uniform","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","autorotateZoomLvl","moveInertia","mousewheel","mousemove","mousewheelCtrlKey","touchmoveTwoFingers","requestHeaders","canvasBackground","withCredentials","autorotate","fullscreen","twoFingers","ctrlZoom","loadError","keyboard","READONLY_OPTIONS","DEPRECATED_OPTIONS","captureCursor","CONFIG_PARSERS","getConfig","tempConfig","hasOwnProperty","NavbarCaption","contentWidth","setCaption","html","__refreshButton","AVAILABLE_BUTTONS","AVAILABLE_GROUPS","registerButton","defaultPosition","unshift","Navbar","setButtons","item","cleanedButtons","__cleanButtons","buttonCtor","warnNotFound","availableWidth","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","littlePlanet","cleanSphereCorrection","pan","tilt","cleanPanoramaPose","IDLE","MOVING","INERTIA","EventsHandler","state","moveThreshold","keyboardEnabled","startMouseX","startMouseY","mouseHistory","pinchDist","ctrlKeyDown","dblclickData","dblclickTimeout","longtouchTimeout","twofingersTimeout","ctrlZoomTimeout","__onResize","autoSize","passive","__onKeyDown","__onKeyUp","__fullscreenToggled","__onMouseWheel","enableKeyboard","disableKeyboard","e2","isDefaultPrevented","action","__stopMove","__move","objectsObservers","viewerPos","intersections","dataHelper","emit","observer","listener","CustomEvent","originalEvent","intersection","find","touch","__cancelLongTouch","__cancelTwoFingersOverlay","__startMoveZoom","gestureIcon","__moveZoom","mousewheelIcon","delta","force","startKeyboardControl","stopKeyboardControl","__resetMove","__logMouseMove","rightclick","__stopMoveInertia","stopAnimation","__click","curve","SplineCurve","getTangent","curr","total","prev","currentClientX","currentClientY","animationPromise","__applyMove","done","boundingRect","viewerX","viewerY","sphereIntersection","sphericalCoords","objects","o","textureCoords","textureX","textureY","NaN","hFov","currentPosition","rotate","last","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","createElementNS","URL","revokeObjectURL","createObjectURL","preloadPanorama","STATE","NONE","SHOWING","HIDING","Tooltip","__onTransitionEnd","rect","__waitImages","box","posClass","arrowTop","arrowLeft","__computeTooltipPosition","swapY","swapX","ordered","newPos","propertyName","offsetSide","border","offsetX","offsetY","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","opt","showLoader","hideError","showError","r","setOptions","rawConfig","setOption","option","disableIdleTimer","stopAutorotate","errorIcon","change","animate","animProperties","tOffset","dZoom","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;;EAED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AA,IAAA,CAAA;;EACpC,IAAA,IAAA,CAAKnnB,IAAL,CAAU6mB,gBAAV,CAA2BoL,WAA3B,CAA0C,GAAA;EAAE9K,MAAAA,QAAQ,EAARA,QAAAA;OAA5C,CAAA;EAEA,IAAA,OAAO,YAAM;EACX,MAAA,OAAO,MAAI,CAACnnB,IAAL,CAAU6mB,gBAAV,CAA2BoL,WAA3B,CAAP,CAAA;OADF,CAAA;EAGD,GAAA;EAED;EACF;EACA;EACA;EACA;EA79BA,GAAA;;IAAA,MA89BElY,CAAAA,SA99BF,GA89BE,SAAY,SAAA,GAAA;EACV,IAAA,IAAA,CAAKgG,OAAL,CAAaxrB,MAAM,CAACuB,QAApB,CAAA,CAAA;EAEA,IAAA,IAAA,CAAKw7B,gBAAL,EAAA,CAAA;EACA,IAAA,IAAA,CAAKC,cAAL,EAAA,CAAA;MACA,OAAO,IAAA,CAAKhJ,aAAL,EAAP,CAAA;EACD,GAAA;EAED;EACF;EACA;EACA;EAz+BA,GAAA;;IAAA,MA0+BEwH,CAAAA,cA1+BF,GA0+BE,SAAiB,cAAA,GAAA;MACf,IAAKhiB,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,CAAgCxL,eAAS,CAACgI,QAAV,CAAmB,KAAK8G,MAAL,CAAY4L,SAAZ,GAAwB,EAA3C,CAAhC,CAAA,CAAA;KA5+BJ,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 { ShaderMaterial, Texture } from 'three';\nimport { PSVError } from '../PSVError';\n\n/**\n * @namespace PSV.adapters\n */\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 * @summary Indicated if the adapter can display an additional transparent image above the panorama\n * @type {boolean}\n */\n static supportsOverlay = 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 * @param {boolean} [useXmpPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData, useXmpPanoData) { // 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 * @abstract\n * @summary Applies the overlay to the mesh\n * @param {external:THREE.Mesh} mesh\n * @param {PSV.TextureData} textureData\n * @param {number} opacity\n */\n setOverlay(mesh, textureData, opacity) { // eslint-disable-line no-unused-vars\n throw new PSVError('setOverlay not implemented');\n }\n\n /**\n * @internal\n */\n static OVERLAY_UNIFORMS = {\n panorama : 'panorama',\n overlay : 'overlay',\n globalOpacity : 'globalOpacity',\n overlayOpacity: 'overlayOpacity',\n };\n\n /**\n * @internal\n */\n static createOverlayMaterial({ additionalUniforms, overrideVertexShader } = {}) {\n return new ShaderMaterial({\n uniforms: {\n ...additionalUniforms,\n [AbstractAdapter.OVERLAY_UNIFORMS.panorama] : { value: new Texture() },\n [AbstractAdapter.OVERLAY_UNIFORMS.overlay] : { value: new Texture() },\n [AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity] : { value: 1.0 },\n [AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity]: { value: 1.0 },\n },\n\n vertexShader: overrideVertexShader || `\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}`,\n\n fragmentShader: `\nuniform sampler2D ${AbstractAdapter.OVERLAY_UNIFORMS.panorama};\nuniform sampler2D ${AbstractAdapter.OVERLAY_UNIFORMS.overlay};\nuniform float ${AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity};\nuniform float ${AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity};\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 tColor1 = texture2D( ${AbstractAdapter.OVERLAY_UNIFORMS.panorama}, vUv );\n vec4 tColor2 = texture2D( ${AbstractAdapter.OVERLAY_UNIFORMS.overlay}, vUv );\n gl_FragColor = vec4(\n mix( tColor1.rgb, tColor2.rgb, tColor2.a * ${AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity} ),\n ${AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity}\n );\n}`,\n });\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 Minimum duration of the animations created with {@link Viewer#animate}\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const ANIMATION_MIN_DURATION = 500;\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) {\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 element.classList.add(...className.split(' '));\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 element.classList.remove(...className.split(' '));\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","import { MathUtils } from 'three';\n\n/**\n * @deprecated use THREE.MathUtils.clamp\n */\nexport function bound(x, min, max) {\n return MathUtils.clamp(x, min, max);\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 * @deprecated Use THREE.MathUtils.isPowerOfTwo\n */\nexport function isPowerOfTwo(x) {\n return MathUtils.isPowerOfTwo(x);\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 { LinearFilter, MathUtils, Quaternion, Texture } from 'three';\nimport { PSVError } from '../PSVError';\nimport { 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 X_VALUES = ['left', 'center', 'right'];\n/**\n * @readonly\n * @private\n */\nconst Y_VALUES = ['top', 'center', 'bottom'];\n/**\n * @readonly\n * @private\n */\nconst POS_VALUES = [...X_VALUES, ...Y_VALUES];\n/**\n * @readonly\n * @private\n */\nconst CENTER = 'center';\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 {object} [options]\n * @param {boolean} [options.allowCenter=true] allow \"center center\"\n * @param {boolean} [options.cssOrder=true] force CSS order (y axis then x axis)\n * @return {string[]}\n */\nexport function cleanPosition(value, { allowCenter, cssOrder } = { allowCenter: true, cssOrder: true }) {\n if (!value) {\n return null;\n }\n\n if (typeof value === 'string') {\n value = value.split(' ');\n }\n\n if (value.length === 1) {\n if (value[0] === CENTER) {\n value = [CENTER, CENTER];\n }\n else if (X_VALUES.indexOf(value[0]) !== -1) {\n value = [CENTER, value[0]];\n }\n else if (Y_VALUES.indexOf(value[0]) !== -1) {\n value = [value[0], CENTER];\n }\n }\n\n if (value.length !== 2 || POS_VALUES.indexOf(value[0]) === -1 || POS_VALUES.indexOf(value[1]) === -1) {\n logWarn(`Unparsable position ${value}`);\n return null;\n }\n\n if (!allowCenter && value[0] === CENTER && value[1] === CENTER) {\n logWarn(`Invalid position center center`);\n return null;\n }\n\n if (cssOrder && !positionIsOrdered(value)) {\n value = [value[1], value[0]];\n }\n if (value[1] === CENTER && X_VALUES.indexOf(value[0]) !== -1) {\n value = [CENTER, value[0]];\n }\n if (value[0] === CENTER && Y_VALUES.indexOf(value[1]) !== -1) {\n value = [value[1], CENTER];\n }\n\n return value;\n}\n\n/**\n * @summary Checks if an array of two positions is ordered (y axis then x axis)\n * @param {string[]} value\n * @return {boolean}\n */\nexport function positionIsOrdered(value) {\n return Y_VALUES.indexOf(value[0]) !== -1 && X_VALUES.indexOf(value[1]) !== -1;\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 = 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 = 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 ? MathUtils.clamp(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 Texture(img);\n texture.needsUpdate = true;\n texture.minFilter = LinearFilter;\n texture.generateMipmaps = false;\n return texture;\n}\n\nconst quaternion = new 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';\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 if (this.__cancelled) {\n return;\n }\n\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 * @returns {Promise}\n */\n then(onFulfilled) {\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","import { MathUtils } from 'three';\nimport { PSVError } from '../PSVError';\nimport { 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) : MathUtils.clamp(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) : MathUtils.clamp(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) : MathUtils.clamp(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 { MathUtils, Mesh, SphereGeometry, Texture } from 'three';\nimport { SPHERE_RADIUS } from '../../data/constants';\nimport { SYSTEM } from '../../data/system';\nimport { PSVError } from '../../PSVError';\nimport { createTexture, firstNonNull, getXMPValue, 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 static supportsOverlay = 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 (!MathUtils.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 * @param {boolean} [useXmpPanoData]\n * @returns {Promise.}\n */\n loadTexture(panorama, newPanoData, useXmpPanoData = this.psv.config.useXmpData) {\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 useXmpPanoData\n ? this.__loadXMP(panorama, p => this.psv.loader.setProgress(p))\n .then(xmpPanoData => this.psv.textureLoader.loadImage(panorama).then(img => ({ img, xmpPanoData })))\n : this.psv.textureLoader.loadImage(panorama, p => this.psv.loader.setProgress(p))\n .then(img => ({ img: img, xmpPanoData: null }))\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 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 = AbstractAdapter.createOverlayMaterial();\n\n return new Mesh(geometry, material);\n }\n\n /**\n * @override\n */\n setTexture(mesh, textureData) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.panorama, textureData.texture);\n this.setOverlay(mesh, null);\n }\n\n /**\n * @override\n */\n setOverlay(mesh, textureData, opacity) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.overlayOpacity, opacity);\n if (!textureData) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.overlay, new Texture());\n }\n else {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.overlay, textureData.texture);\n }\n }\n\n /**\n * @override\n */\n setTextureOpacity(mesh, opacity) {\n this.__setUniform(mesh, AbstractAdapter.OVERLAY_UNIFORMS.globalOpacity, opacity);\n mesh.material.transparent = opacity < 1;\n }\n\n /**\n * @override\n */\n disposeTexture(textureData) {\n textureData.texture?.dispose();\n }\n\n /**\n * @param {external:THREE.Mesh} mesh\n * @param {string} uniform\n * @param {*} value\n * @private\n */\n __setUniform(mesh, uniform, value) {\n if (mesh.material.uniforms[uniform].value instanceof Texture) {\n mesh.material.uniforms[uniform].value.dispose();\n }\n mesh.material.uniforms[uniform].value = value;\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 * @param {boolean} [visible] - forced state\n */\n toggle(visible) {\n if (visible === false || visible === undefined && this.isVisible()) {\n this.hide();\n }\n else if (visible === true || visible === undefined && !this.isVisible()) {\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 this.toggle(supported);\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.call(this.psv, 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 { MathUtils } from 'three';\nimport { AbstractAdapter } from '../adapters/AbstractAdapter';\nimport { EquirectangularAdapter } from '../adapters/equirectangular';\nimport { AbstractPlugin } from '../plugins/AbstractPlugin';\nimport { PSVError } from '../PSVError';\nimport { 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 overlay : null,\n overlayOpacity : 1,\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 autorotateZoomLvl : null,\n moveInertia : true,\n mousewheel : true,\n mousemove : true,\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 captureCursor: 'captureCursor 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 overlayOpacity : (overlayOpacity) => {\n return MathUtils.clamp(overlayOpacity, 0, 1);\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 defaultZoomLvl : (defaultZoomLvl) => {\n return MathUtils.clamp(defaultZoomLvl, 0, 100);\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 MathUtils.clamp(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 MathUtils.clamp(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 autorotateZoomLvl: (autorotateZoomLvl) => {\n if (isNil(autorotateZoomLvl)) {\n return null;\n }\n else {\n return MathUtils.clamp(autorotateZoomLvl, 0, 100);\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 this.toggle(this.container.offsetWidth >= this.prop.contentWidth);\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 { MathUtils } from 'three';\nimport { EVENTS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { 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, MathUtils.clamp(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 { Euler, MathUtils, Vector2, Vector3 } 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 Vector2();\nconst vector3 = new Vector3();\nconst eulerZero = new 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 MathUtils.radToDeg(2 * Math.atan(Math.tan(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 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, !this.prop.littlePlanet),\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 : MathUtils.degToRad(panoData?.poseHeading || 0),\n tilt: MathUtils.degToRad(panoData?.posePitch || 0),\n roll: MathUtils.degToRad(panoData?.poseRoll || 0),\n };\n }\n\n}\n","import { MathUtils, SplineCurve, Vector2 } 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 MESH_USER_DATA,\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 {\n clone,\n distance,\n each,\n getClosest,\n getPosition,\n hasParent,\n isEmpty,\n isFullscreenEnabled,\n normalizeWheel,\n throttle\n} from '../utils';\nimport { Animation } from '../utils/Animation';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractService } from './AbstractService';\n\nconst IDLE = 0;\nconst MOVING = 1;\nconst INERTIA = 2;\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 {number} step\n * @property {boolean} mousedown - before moving past the threshold\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 step : IDLE,\n mousedown : 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, { passive: false });\n window.addEventListener('keyup', this);\n this.psv.container.addEventListener('mousedown', this);\n window.addEventListener('mousemove', this, { passive: false });\n window.addEventListener('mouseup', this);\n this.psv.container.addEventListener('touchstart', this, { passive: false });\n window.addEventListener('touchmove', this, { passive: false });\n window.addEventListener('touchend', this, { passive: false });\n this.psv.container.addEventListener(SYSTEM.mouseWheelEvent, this, { passive: false });\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('mousedown', this);\n window.removeEventListener('mousemove', this);\n window.removeEventListener('mouseup', this);\n this.psv.container.removeEventListener('touchstart', this);\n window.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 'mousemove': this.__onMouseMove(evt); break;\n case 'mouseup': this.__onMouseUp(evt); break;\n case 'touchmove': this.__onTouchMove(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 'touchstart': this.__onTouchStart(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 e.preventDefault();\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 e.preventDefault();\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 this.state.mousedown = true;\n this.state.startMouseX = evt.clientX;\n this.state.startMouseY = evt.clientY;\n }\n\n /**\n * @summary Handles mouse up events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseUp(evt) {\n if (this.state.mousedown || this.state.step === MOVING) {\n this.__stopMove(evt.clientX, evt.clientY, evt.target, evt.button === 2);\n }\n }\n\n /**\n * @summary Handles mouse move events\n * @param {MouseEvent} evt\n * @private\n */\n __onMouseMove(evt) {\n if (this.config.mousemove && (this.state.mousedown || this.state.step === MOVING)) {\n evt.preventDefault();\n this.__move(evt.clientX, evt.clientY);\n }\n\n if (!isEmpty(this.prop.objectsObservers) && hasParent(evt.target, this.psv.container)) {\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 (evt.touches.length === 1) {\n this.state.mousedown = true;\n this.state.startMouseX = evt.touches[0].clientX;\n this.state.startMouseY = evt.touches[0].clientY;\n\n if (!this.prop.longtouchTimeout) {\n this.prop.longtouchTimeout = setTimeout(() => {\n const touch = evt.touches[0];\n this.__stopMove(touch.clientX, touch.clientY, touch.target, true);\n this.prop.longtouchTimeout = null;\n }, LONGTOUCH_DELAY);\n }\n }\n else if (evt.touches.length === 2) {\n this.state.mousedown = false;\n this.__cancelLongTouch();\n\n if (this.config.mousemove) {\n this.__cancelTwoFingersOverlay();\n this.__startMoveZoom(evt);\n evt.preventDefault();\n }\n }\n }\n\n /**\n * @summary Handles touch events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchEnd(evt) {\n this.__cancelLongTouch();\n\n if (this.state.mousedown || this.state.step === MOVING) {\n evt.preventDefault();\n this.__cancelTwoFingersOverlay();\n\n if (evt.touches.length === 1) {\n this.__stopMove(this.state.mouseX, this.state.mouseY);\n }\n else if (evt.touches.length === 0) {\n const touch = evt.changedTouches[0];\n this.__stopMove(touch.clientX, touch.clientY, touch.target);\n }\n }\n }\n\n /**\n * @summary Handles touch move events\n * @param {TouchEvent} evt\n * @private\n */\n __onTouchMove(evt) {\n this.__cancelLongTouch();\n\n if (!this.config.mousemove) {\n return;\n }\n\n if (evt.touches.length === 1) {\n if (this.config.touchmoveTwoFingers) {\n if (this.state.mousedown && !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 if (this.state.mousedown || this.state.step === MOVING) {\n evt.preventDefault();\n const touch = evt.touches[0];\n this.__move(touch.clientX, touch.clientY);\n }\n }\n else {\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.config.touchmoveTwoFingers) {\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 /**\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 Resets all state variables\n * @private\n */\n __resetMove() {\n this.state.step = IDLE;\n this.state.mousedown = false;\n this.state.mouseX = 0;\n this.state.mouseY = 0;\n this.state.startMouseX = 0;\n this.state.startMouseY = 0;\n this.state.mouseHistory.length = 0;\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 this.__resetMove();\n\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.step = MOVING;\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.__logMouseMove(this.state.mouseX, this.state.mouseY);\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 {int} clientX\n * @param {int} clientY\n * @param {EventTarget} [target]\n * @param {boolean} [rightclick=false]\n * @private\n */\n __stopMove(clientX, clientY, target = null, rightclick = false) {\n if (this.state.step === MOVING) {\n if (this.config.moveInertia) {\n this.__logMouseMove(clientX, clientY);\n this.__stopMoveInertia(clientX, clientY);\n }\n else {\n this.__resetMove();\n this.psv.resetIdleTimer();\n }\n }\n else if (this.state.mousedown) {\n this.psv.stopAnimation();\n this.__click(clientX, clientY, target, rightclick);\n this.__resetMove();\n this.psv.resetIdleTimer();\n }\n }\n\n /**\n * @summary Performs an animation to simulate inertia when the movement stops\n * @param {int} clientX\n * @param {int} clientY\n * @private\n */\n __stopMoveInertia(clientX, clientY) {\n // get direction at end of movement\n const curve = new SplineCurve(this.state.mouseHistory.map(([, x, y]) => new Vector2(x, y)));\n const direction = curve.getTangent(1);\n\n // average speed\n const speed = this.state.mouseHistory.slice(1).reduce(({ total, prev }, curr) => {\n return {\n total: total + distance({ x: prev[1], y: prev[2] }, { x: curr[1], y: curr[2] }) / (curr[0] - prev[0]),\n prev : curr,\n };\n }, {\n total: 0,\n prev : this.state.mouseHistory[0],\n }).total / this.state.mouseHistory.length;\n\n if (!speed) {\n this.__resetMove();\n this.psv.resetIdleTimer();\n return;\n }\n\n this.state.step = INERTIA;\n\n let currentClientX = clientX;\n let currentClientY = clientY;\n\n this.prop.animationPromise = new Animation({\n properties: {\n speed: { start: speed, end: 0 },\n },\n duration : 1000,\n easing : 'outQuad',\n onTick : (properties) => {\n // 3 is a magic number\n currentClientX += properties.speed * direction.x * 3 * SYSTEM.pixelRatio;\n currentClientY += properties.speed * direction.y * 3 * SYSTEM.pixelRatio;\n this.__applyMove(currentClientX, currentClientY);\n },\n });\n\n this.prop.animationPromise\n .then((done) => {\n this.prop.animationPromise = null;\n if (done) {\n this.__resetMove();\n this.psv.resetIdleTimer();\n }\n });\n }\n\n /**\n * @summary Triggers an event with all coordinates when a simple click is performed\n * @param {int} clientX\n * @param {int} clientY\n * @param {EventTarget} target\n * @param {boolean} [rightclick=false]\n * @fires PSV.click\n * @fires PSV.dblclick\n * @private\n */\n __click(clientX, clientY, target, rightclick = false) {\n const boundingRect = this.psv.container.getBoundingClientRect();\n\n /**\n * @type {PSV.ClickData}\n */\n const data = {\n rightclick: rightclick,\n target : target,\n clientX : clientX,\n clientY : clientY,\n viewerX : clientX - boundingRect.left,\n viewerY : 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[MESH_USER_DATA]);\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[MESH_USER_DATA]);\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 Starts moving when crossing moveThreshold and performs movement\n * @param {int} clientX\n * @param {int} clientY\n * @private\n */\n __move(clientX, clientY) {\n if (this.state.mousedown\n && (Math.abs(clientX - this.state.startMouseX) >= this.state.moveThreshold\n || Math.abs(clientY - this.state.startMouseY) >= this.state.moveThreshold)) {\n this.psv.__stopAll();\n this.__resetMove();\n this.state.step = MOVING;\n this.state.mouseX = clientX;\n this.state.mouseY = clientY;\n this.__logMouseMove(clientX, clientY);\n }\n else if (this.state.step === MOVING) {\n this.__applyMove(clientX, clientY);\n this.__logMouseMove(clientX, clientY);\n }\n }\n\n /**\n * @summary Raw method for movement, called from mouse event and move inertia\n * @param {int} clientX\n * @param {int} clientY\n * @private\n */\n __applyMove(clientX, clientY) {\n const rotation = {\n longitude: (clientX - this.state.mouseX) / this.prop.size.width * this.config.moveSpeed\n * MathUtils.degToRad(this.prop.littlePlanet ? 90 : this.prop.hFov),\n latitude : (clientY - this.state.mouseY) / this.prop.size.height * this.config.moveSpeed\n * MathUtils.degToRad(this.prop.littlePlanet ? 90 : 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 = clientX;\n this.state.mouseY = clientY;\n }\n\n /**\n * @summary Perfoms combined move and zoom\n * @param {TouchEvent} evt\n * @private\n */\n __moveZoom(evt) {\n if (this.state.step === MOVING) {\n evt.preventDefault();\n\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 = (p - this.state.pinchDist) / SYSTEM.pixelRatio * this.config.zoomSpeed;\n\n this.psv.zoom(this.psv.getZoomLevel() + delta);\n\n this.__move((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);\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 {int} clientX\n * @param {int} clientY\n * @private\n */\n __logMouseMove(clientX, clientY) {\n const now = Date.now();\n\n const last = this.state.mouseHistory.length ? this.state.mouseHistory[this.state.mouseHistory.length - 1] : [0, -1, -1];\n\n // avoid duplicates\n if (last[1] === clientX && last[2] === clientY) {\n last[0] = now;\n }\n else if (now === last[0]) {\n last[1] = clientX;\n last[2] = clientY;\n }\n else {\n this.state.mouseHistory.push([now, clientX, clientY]);\n }\n\n let previous = null;\n\n for (let i = 0; i < this.state.mouseHistory.length;) {\n if (this.state.mouseHistory[i][0] < now - INERTIA_WINDOW) {\n this.state.mouseHistory.splice(i, 1);\n }\n else if (previous && this.state.mouseHistory[i][0] - previous > INERTIA_WINDOW / 10) {\n this.state.mouseHistory.splice(0, i);\n i = 0;\n previous = this.state.mouseHistory[i][0];\n }\n else {\n previous = this.state.mouseHistory[i][0];\n i++;\n }\n }\n }\n\n}\n","import { Group, PerspectiveCamera, Raycaster, Scene, Vector3, WebGLRenderer } from 'three';\nimport { EVENTS, MESH_USER_DATA, SPHERE_RADIUS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { Animation, 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 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 Scene();\n\n /**\n * @member {external:THREE.PerspectiveCamera}\n * @readonly\n * @protected\n */\n this.camera = new PerspectiveCamera(50, 16 / 9, 0.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 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 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 Applies the overlay to the mesh\n * @param {PSV.TextureData} textureData\n * @param {number} opacity\n * @package\n */\n setOverlay(textureData, opacity) {\n this.psv.adapter.setOverlay(this.mesh, textureData, opacity);\n this.psv.needsUpdate();\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.utils.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 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 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 Vector3(0, 1, 0).cross(this.camera.getWorldDirection(new 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 Scene)) {\n item.dispose();\n }\n\n if (item !== object) {\n this.__cleanTHREEScene(item);\n }\n });\n }\n\n}\n","import { FileLoader } 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 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 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?.(progress);\n\n this.loader.load(\n url,\n (result) => {\n progress = 100;\n 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?.(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, positionIsOrdered } 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, border: number}} size\n */\n constructor(psv, size) {\n super(psv, 'psv-tooltip');\n\n /**\n * @override\n * @property {number} arrow\n * @property {number} border\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 if (!config.box) {\n config.box = {\n width : 0,\n height: 0,\n };\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, { allowCenter: false, cssOrder: false }) || ['top', 'center'],\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 swapY = null;\n let swapX = null;\n if (style.top < 0) {\n swapY = 'bottom';\n }\n else if (style.top + style.height > this.psv.prop.size.height) {\n swapY = 'top';\n }\n if (style.left < 0) {\n swapX = 'right';\n }\n else if (style.left + style.width > this.psv.prop.size.width) {\n swapX = 'left';\n }\n if (swapX || swapY) {\n const ordered = positionIsOrdered(style.posClass);\n if (swapY) {\n style.posClass[ordered ? 0 : 1] = swapY;\n }\n if (swapX) {\n style.posClass[ordered ? 1 : 0] = swapX;\n }\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 const arrow = this.prop.arrow;\n const top = config.top;\n const height = style.height;\n const left = config.left;\n const width = style.width;\n const offsetSide = arrow + this.prop.border;\n const offsetX = config.box.width / 2 + arrow * 2;\n const offsetY = config.box.height / 2 + arrow * 2;\n\n switch (style.posClass.join('-')) {\n case 'top-left':\n style.top = top - offsetY - height;\n style.left = left + offsetSide - width;\n style.arrowTop = height;\n style.arrowLeft = width - offsetSide - arrow;\n break;\n case 'top-center':\n style.top = top - offsetY - height;\n style.left = left - width / 2;\n style.arrowTop = height;\n style.arrowLeft = width / 2 - arrow;\n break;\n case 'top-right':\n style.top = top - offsetY - height;\n style.left = left - offsetSide;\n style.arrowTop = height;\n style.arrowLeft = arrow;\n break;\n case 'bottom-left':\n style.top = top + offsetY;\n style.left = left + offsetSide - width;\n style.arrowTop = -arrow * 2;\n style.arrowLeft = width - offsetSide - arrow;\n break;\n case 'bottom-center':\n style.top = top + offsetY;\n style.left = left - width / 2;\n style.arrowTop = -arrow * 2;\n style.arrowLeft = width / 2 - arrow;\n break;\n case 'bottom-right':\n style.top = top + offsetY;\n style.left = left - offsetSide;\n style.arrowTop = -arrow * 2;\n style.arrowLeft = arrow;\n break;\n case 'left-top':\n style.top = top + offsetSide - height;\n style.left = left - offsetX - width;\n style.arrowTop = height - offsetSide - arrow;\n style.arrowLeft = width;\n break;\n case 'center-left':\n style.top = top - height / 2;\n style.left = left - offsetX - width;\n style.arrowTop = height / 2 - arrow;\n style.arrowLeft = width;\n break;\n case 'left-bottom':\n style.top = top - offsetSide;\n style.left = left - offsetX - width;\n style.arrowTop = arrow;\n style.arrowLeft = width;\n break;\n case 'right-top':\n style.top = top + offsetSide - height;\n style.left = left + offsetX;\n style.arrowTop = height - offsetSide - arrow;\n style.arrowLeft = -arrow * 2;\n break;\n case 'center-right':\n style.top = top - height / 2;\n style.left = left + offsetX;\n style.arrowTop = height / 2 - arrow;\n style.arrowLeft = -arrow * 2;\n break;\n case 'right-bottom':\n style.top = top - offsetSide;\n style.left = left + offsetX;\n style.arrowTop = arrow;\n style.arrowLeft = -arrow * 2;\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, { arrow: 0, border: 0 });\n\n /**\n * @summary Computed static sizes\n * @member {Object}\n * @package\n * @property {number} arrow\n * @property {number} border\n */\n this.size = {\n arrow : parseInt(getStyle(testTooltip.arrow, 'borderTopWidth'), 10),\n border: parseInt(getStyle(testTooltip.container, 'borderTopLeftRadius'), 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 { Cache, MathUtils, Vector3 } 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 {\n ANIMATION_MIN_DURATION,\n CHANGE_EVENTS,\n DEFAULT_TRANSITION,\n EVENTS,\n IDS,\n SPHERE_RADIUS,\n VIEWER_DATA\n} 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\nCache.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.utils.Animation} animationPromise - promise of the current animation\n * @property {Promise} loadingPromise - promise of the setPanorama method\n * @property {boolean} littlePlanet - special tweaks for LittlePlanetAdapter\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 Vector3(0, 0, SPHERE_RADIUS),\n vFov : null,\n hFov : null,\n aspect : null,\n autorotateEnabled: false,\n animationPromise : null,\n loadingPromise : null,\n littlePlanet : false,\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 : this.prop.littlePlanet\n ? new Dynamic(null, this.config.defaultLat, 0, Math.PI * 2, true)\n : 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 ['sphereCorrection', 'panoData', 'overlay', 'overlayOpacity'].forEach((opt) => {\n if (!(opt in options)) {\n options[opt] = this.config[opt];\n }\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 if (!options.panoData && typeof this.config.panoData === 'function') {\n options.panoData = this.config.panoData;\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.setOverlay(options.overlay, options.overlayOpacity);\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 })\n .then((completed) => {\n this.prop.transitionAnimation = null;\n if (!completed) {\n throw getAbortError();\n }\n })\n .then(done, done);\n }\n\n return this.prop.loadingPromise;\n }\n\n /**\n * @summary Loads a new overlay\n * @param {*} path - URL of the new overlay file\n * @param {number} [opacity=1]\n * @returns {Promise}\n */\n setOverlay(path, opacity = 1) {\n if (!path) {\n if (this.adapter.constructor.supportsOverlay) {\n this.renderer.setOverlay(null, 0);\n }\n\n return Promise.resolve();\n }\n else {\n if (!this.adapter.constructor.supportsOverlay) {\n return Promise.reject(new PSVError(`${this.adapter.constructor.id} adapter does not supports overlay`));\n }\n\n return this.adapter.loadTexture(path, (image) => {\n const p = this.prop.panoData;\n const r = image.width / p.croppedWidth;\n return {\n fullWidth : r * p.fullWidth,\n fullHeight : r * p.fullHeight,\n croppedWidth : r * p.croppedWidth,\n croppedHeight: r * p.croppedHeight,\n croppedX : r * p.croppedX,\n croppedY : r * p.croppedY,\n };\n }, false)\n .then((textureData) => {\n this.renderer.setOverlay(textureData, opacity);\n });\n }\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 'overlay':\n case 'overlayOpacity':\n this.setOverlay(this.config.overlay, this.config.overlayOpacity);\n break;\n\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 if (this.config.autorotateZoomLvl !== null) {\n this.dynamics.zoom.goto(this.config.autorotateZoomLvl);\n }\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 this.dynamics.zoom.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.utils.Animation}\n */\n animate(options) {\n this.__stopAll();\n\n const positionProvided = isExtendedPosition(options);\n const zoomProvided = options.zoom !== undefined;\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 : Math.max(ANIMATION_MIN_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 this.prop.animationPromise.cancel();\n return this.prop.animationPromise;\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(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","useXmpPanoData","createMesh","scale","setTexture","mesh","textureData","transition","setTextureOpacity","opacity","disposeTexture","setOverlay","createOverlayMaterial","additionalUniforms","overrideVertexShader","ShaderMaterial","uniforms","OVERLAY_UNIFORMS","value","Texture","overlay","globalOpacity","overlayOpacity","vertexShader","fragmentShader","id","supportsDownload","supportsOverlay","DEFAULT_TRANSITION","ANIMATION_MIN_DURATION","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","add","remove","addClasses","split","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","MathUtils","clamp","loop","result","isPowerOfTwo","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","forEach","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","X_VALUES","Y_VALUES","POS_VALUES","CENTER","cleanPosition","allowCenter","cssOrder","indexOf","positionIsOrdered","parseSpeed","speed","speedStr","trim","speedValue","speedUnit","degToRad","parseAngle","angle","zeroCenter","halfCircle","unit","createTexture","img","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","__cancelled","progress","duration","current","properties","start","end","onTick","__resolve","cb","then","onFulfilled","push","cancel","cancelAnimationFrame","Dynamic","fn","defaultValue","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","useXmpData","reject","__loadXMP","loader","setProgress","xmpPanoData","textureLoader","loadImage","panoData","fullWidth","fullHeight","croppedWidth","croppedHeight","croppedX","croppedY","poseHeading","posePitch","poseRoll","__createEquirectangularTexture","onProgress","loadFile","blob","__loadBlobAsString","binary","substring","includes","reader","FileReader","onload","onerror","readAsText","ratio","resizedPanoData","buffer","drawImage","geometry","SphereGeometry","material","Mesh","__setUniform","transparent","dispose","uniform","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","autorotateZoomLvl","moveInertia","mousewheel","mousemove","mousewheelCtrlKey","touchmoveTwoFingers","requestHeaders","canvasBackground","withCredentials","autorotate","fullscreen","twoFingers","ctrlZoom","loadError","keyboard","READONLY_OPTIONS","DEPRECATED_OPTIONS","captureCursor","CONFIG_PARSERS","getConfig","tempConfig","hasOwnProperty","NavbarCaption","contentWidth","setCaption","html","__refreshButton","AVAILABLE_BUTTONS","AVAILABLE_GROUPS","registerButton","defaultPosition","unshift","Navbar","setButtons","item","cleanedButtons","__cleanButtons","buttonCtor","warnNotFound","availableWidth","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","littlePlanet","cleanSphereCorrection","pan","tilt","cleanPanoramaPose","IDLE","MOVING","INERTIA","EventsHandler","state","moveThreshold","keyboardEnabled","startMouseX","startMouseY","mouseHistory","pinchDist","ctrlKeyDown","dblclickData","dblclickTimeout","longtouchTimeout","twofingersTimeout","ctrlZoomTimeout","__onResize","autoSize","passive","__onKeyDown","__onKeyUp","__fullscreenToggled","__onMouseWheel","enableKeyboard","disableKeyboard","e2","isDefaultPrevented","action","__stopMove","__move","objectsObservers","viewerPos","intersections","dataHelper","emit","observer","listener","CustomEvent","originalEvent","intersection","find","touch","__cancelLongTouch","__cancelTwoFingersOverlay","__startMoveZoom","gestureIcon","__moveZoom","mousewheelIcon","delta","force","startKeyboardControl","stopKeyboardControl","__resetMove","__logMouseMove","rightclick","__stopMoveInertia","stopAnimation","__click","curve","SplineCurve","getTangent","curr","total","prev","currentClientX","currentClientY","animationPromise","__applyMove","done","boundingRect","viewerX","viewerY","sphereIntersection","sphericalCoords","objects","o","textureCoords","textureX","textureY","NaN","hFov","currentPosition","rotate","last","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","createElementNS","URL","revokeObjectURL","createObjectURL","preloadPanorama","STATE","NONE","SHOWING","HIDING","Tooltip","__onTransitionEnd","rect","__waitImages","box","posClass","arrowTop","arrowLeft","__computeTooltipPosition","swapY","swapX","ordered","newPos","propertyName","offsetSide","border","offsetX","offsetY","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","opt","showLoader","hideError","showError","r","setOptions","rawConfig","setOption","option","disableIdleTimer","stopAutorotate","errorIcon","change","animate","animProperties","tOffset","dZoom","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;;ECjBA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;AACA,MA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EACA;EACA;;EACO,IAAMC,MAAM,GAAG;EACpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,UAAU,EAAU,YAPA;;EAQpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,aAAa,EAAO,eAfA;;EAgBpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,aAAa,EAAO,eAtBA;;EAuBpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,KAAK,EAAe,OA7BA;;EA8BpB;EACF;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;;EA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CAA2BoL,WAA3B,CAAP,CAAA;OADF,CAAA;EAGD,GAAA;EAED;EACF;EACA;EACA;EACA;EA79BA,GAAA;;IAAA,MA89BElY,CAAAA,SA99BF,GA89BE,SAAY,SAAA,GAAA;EACV,IAAA,IAAA,CAAKgG,OAAL,CAAaxrB,MAAM,CAACuB,QAApB,CAAA,CAAA;EAEA,IAAA,IAAA,CAAKw7B,gBAAL,EAAA,CAAA;EACA,IAAA,IAAA,CAAKC,cAAL,EAAA,CAAA;MACA,OAAO,IAAA,CAAKhJ,aAAL,EAAP,CAAA;EACD,GAAA;EAED;EACF;EACA;EACA;EAz+BA,GAAA;;IAAA,MA0+BEwH,CAAAA,cA1+BF,GA0+BE,SAAiB,cAAA,GAAA;MACf,IAAKhiB,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,CAAgCxL,eAAS,CAACgI,QAAV,CAAmB,KAAK8G,MAAL,CAAY4L,SAAZ,GAAwB,EAA3C,CAAhC,CAAA,CAAA;KA5+BJ,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 533a37f49..66be8d69d 100644 --- a/dist/plugins/autorotate-keypoints.js +++ b/dist/plugins/autorotate-keypoints.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 c89e3722a..df160b63d 100644 --- a/dist/plugins/compass.css +++ b/dist/plugins/compass.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.8.0 + * Photo Sphere Viewer 4.8.1 * @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 66a74b34f..60095177b 100644 --- a/dist/plugins/compass.js +++ b/dist/plugins/compass.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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/gallery.css b/dist/plugins/gallery.css index a3fa6cc15..c79315dff 100644 --- a/dist/plugins/gallery.css +++ b/dist/plugins/gallery.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.8.0 + * Photo Sphere Viewer 4.8.1 * @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/gallery.js b/dist/plugins/gallery.js index 613c027fb..cb7727fd4 100644 --- a/dist/plugins/gallery.js +++ b/dist/plugins/gallery.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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/gyroscope.js b/dist/plugins/gyroscope.js index b8cc01e7a..08371f3b7 100644 --- a/dist/plugins/gyroscope.js +++ b/dist/plugins/gyroscope.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 b47a9244f..1c3462730 100644 --- a/dist/plugins/markers.css +++ b/dist/plugins/markers.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.8.0 + * Photo Sphere Viewer 4.8.1 * @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 2b2818df7..c941f3f9a 100644 --- a/dist/plugins/markers.d.ts +++ b/dist/plugins/markers.d.ts @@ -61,6 +61,7 @@ type SelectMarkerData = { type MarkersPluginOptions = { clickEventOnMarker?: boolean; + gotoMarkerSpeed?: string | number; markers?: MarkerProperties[]; }; diff --git a/dist/plugins/markers.js b/dist/plugins/markers.js index 005d5a337..a75ae25cd 100644 --- a/dist/plugins/markers.js +++ b/dist/plugins/markers.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) @@ -1266,6 +1266,7 @@ /** * @typedef {Object} PSV.plugins.MarkersPlugin.Options * @property {boolean} [clickEventOnMarker=false] If a `click` event is triggered on the viewer additionally to the `select-marker` event. + * @property {string | number} [gotoMarkerSpeed=8rpm] Default animation speed for `gotoMarker` method * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers] */ @@ -1323,7 +1324,8 @@ */ _this.config = _extends({ - clickEventOnMarker: false + clickEventOnMarker: false, + gotoMarkerSpeed: '8rpm' }, options); /** * @member {HTMLElement} @@ -1781,6 +1783,10 @@ _proto.gotoMarker = function gotoMarker(markerId, speed) { var _this6 = this; + if (speed === void 0) { + speed = this.config.gotoMarkerSpeed; + } + var marker = this.getMarker(markerId); return this.psv.animate(_extends({}, marker.props.position, { zoom: marker.config.zoomLvl, @@ -1911,7 +1917,7 @@ _this7.trigger(EVENTS.SELECT_MARKER_LIST, marker); - _this7.gotoMarker(marker, 1000); + _this7.gotoMarker(marker); _this7.hideMarkersList(); } diff --git a/dist/plugins/markers.js.map b/dist/plugins/markers.js.map index c97cf100e..5fbed2ca9 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/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 { utils } from '../..';\nimport 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\nconst MARKER_DATA_KEY = utils.dasherize(MARKER_DATA);\n\n/**\n * @summary Markers list template\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @param {string} title\n * @returns {string}\n * @constant\n * @private\n */\nexport const MARKERS_LIST_TEMPLATE = (markers, title) => `\n
\n

${icon} ${title}

\n
    \n ${markers.map(marker => `\n
  • \n ${marker.type === 'image' ? `` : ''}\n ${marker.getListContent()}\n
  • \n `).join('')}\n
\n
\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 { Group, MathUtils, Mesh, MeshBasicMaterial, PlaneGeometry, TextureLoader } from 'three';\nimport { CONSTANTS, PSVError, utils } from '../..';\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 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 const svgType = this.type === 'square' ? 'rect' : this.type;\n this.$el = document.createElementNS(SVG_NS, svgType);\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 = MathUtils.degToRad(this.psv.prop.hFov) / 2;\n const arc = Math.abs(utils.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 if (mousePosition) {\n const viewerPos = utils.getPosition(this.psv.container);\n config.top = mousePosition.clientY - viewerPos.top;\n config.left = mousePosition.clientX - viewerPos.left;\n config.box = { // separate the tooltip from the cursor\n width : 20,\n height: 20,\n };\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 + this.props.height / 2;\n config.left = this.props.position2D.x + this.props.width / 2;\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.className = '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 this.$el.classList.add('psv-marker--has-tooltip');\n }\n if (this.config.content) {\n this.$el.classList.add('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 && Array.isArray(this.config.scale)) {\n this.config.scale = { zoom: this.config.scale };\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 MeshBasicMaterial({\n transparent: true,\n opacity : this.config.opacity ?? 1,\n depthTest : false,\n });\n const geometry = new PlaneGeometry(1, 1);\n const mesh = new Mesh(geometry, material);\n mesh.userData = { [MARKER_DATA]: this };\n this.$el = new 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 { Vector3 } 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 /**\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 this.psv.once(CONSTANTS.EVENTS.READY, () => {\n if (this.config.markers) {\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.utils.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 zoom : marker.config.zoomLvl,\n speed: 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(markers, this.psv.config.lang[MarkersButton.id]),\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.height * 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 marker.$el.classList.add('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 marker.$el.classList.remove('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 Vector3().crossVectors(P1, P2).normalize();\n const V = new 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 Vector3().addVectors(X, Y).normalize();\n const a = new 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\n if (nbMarkers === 0) {\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 // eslint-disable-next-line no-lonely-if\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 this.psv.navbar.getButton(MarkersButton.id, false)?.toggle(nbMarkers > 0);\n this.psv.navbar.getButton(MarkersListButton.id, false)?.toggle(nbMarkers > 0);\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","MARKER_DATA_KEY","utils","dasherize","MARKERS_LIST_TEMPLATE","markers","title","icon","map","marker","config","id","type","image","getListContent","join","greatArcIntermediaryPoint","p1","p2","f","λ1","φ1","λ2","φ2","r","greatArcDistance","a","Math","sin","b","x","cos","y","z","atan2","sqrt","getPolygonCenter","polygon","workPoints","k","i","length","d","PI","push","sum","reduce","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","PSVError","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","svgType","update","destroy","isPoly","isPolyPx","isPolyRad","getScale","zoomLevel","scale","Array","isArray","zoom","bounds","EASINGS","inQuad","longitude","halfFov","MathUtils","degToRad","prop","hFov","arc","abs","getShortestArc","outQuad","max","listContent","content","showTooltip","mousePosition","viewerPos","getPosition","container","top","clientY","left","clientX","box","move","create","refreshTooltip","hideTooltip","hide","newType","deepmerge","trigger","className","setAttribute","addClasses","classList","add","style","opacity","parsePosition","__updateNormal","__updatePoly","__updateSvg","__update3d","isExtendedPosition","backgroundImage","innerHTML","transformOrigin","dataHelper","cleanPosition","sphericalCoordsToVector3","cx","cy","rx","ry","each","value","setAttributeNS","svgStyle","fill","actualPoly","splice","coord","sphericalCoords","textureCoordsToSphericalCoords","latitude","centroid","material","MeshBasicMaterial","transparent","depthTest","geometry","PlaneGeometry","mesh","Mesh","userData","Group","Object","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","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","zoomLvl","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","size","getAttributeNS","removeAttributeNS","getBoundingClientRect","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","getButton","toggle","has3d","some","observeObjects","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;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,EAAK,kBAfD;;EAgBpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAS,cAtBD;;EAuBpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,WAAW,EAAU,aA7BD;;EA8BpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,mBAAmB,EAAE,qBArCD;;EAsCpB;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,aAAa,EAAQ,eA9CD;;EA+CpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,kBAAkB,EAAG,oBArDD;;EAsDpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,eAAe,EAAM,iBA5DD;;EA6DpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAS,cAlED;;EAmEpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,WAAW,EAAU,aAzED;;EA0EpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAS,cAAA;EA/ED,EAAf;EAkFP;EACA;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,s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ins/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 { utils } from '../..';\nimport 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\nconst MARKER_DATA_KEY = utils.dasherize(MARKER_DATA);\n\n/**\n * @summary Markers list template\n * @param {PSV.plugins.MarkersPlugin.Marker[]} markers\n * @param {string} title\n * @returns {string}\n * @constant\n * @private\n */\nexport const MARKERS_LIST_TEMPLATE = (markers, title) => `\n
\n

${icon} ${title}

\n
    \n ${markers.map(marker => `\n
  • \n ${marker.type === 'image' ? `` : ''}\n ${marker.getListContent()}\n
  • \n `).join('')}\n
\n
\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 { Group, MathUtils, Mesh, MeshBasicMaterial, PlaneGeometry, TextureLoader } from 'three';\nimport { CONSTANTS, PSVError, utils } from '../..';\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 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 const svgType = this.type === 'square' ? 'rect' : this.type;\n this.$el = document.createElementNS(SVG_NS, svgType);\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 = MathUtils.degToRad(this.psv.prop.hFov) / 2;\n const arc = Math.abs(utils.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 if (mousePosition) {\n const viewerPos = utils.getPosition(this.psv.container);\n config.top = mousePosition.clientY - viewerPos.top;\n config.left = mousePosition.clientX - viewerPos.left;\n config.box = { // separate the tooltip from the cursor\n width : 20,\n height: 20,\n };\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 + this.props.height / 2;\n config.left = this.props.position2D.x + this.props.width / 2;\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.className = '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 this.$el.classList.add('psv-marker--has-tooltip');\n }\n if (this.config.content) {\n this.$el.classList.add('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 && Array.isArray(this.config.scale)) {\n this.config.scale = { zoom: this.config.scale };\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 MeshBasicMaterial({\n transparent: true,\n opacity : this.config.opacity ?? 1,\n depthTest : false,\n });\n const geometry = new PlaneGeometry(1, 1);\n const mesh = new Mesh(geometry, material);\n mesh.userData = { [MARKER_DATA]: this };\n this.$el = new 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 { Vector3 } 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 {string | number} [gotoMarkerSpeed=8rpm] Default animation speed for `gotoMarker` method\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 gotoMarkerSpeed: '8rpm',\n ...options,\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 this.psv.once(CONSTANTS.EVENTS.READY, () => {\n if (this.config.markers) {\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.utils.Animation} A promise that will be resolved when the animation finishes\n */\n gotoMarker(markerId, speed = this.config.gotoMarkerSpeed) {\n const marker = this.getMarker(markerId);\n\n return this.psv.animate({\n ...marker.props.position,\n zoom : marker.config.zoomLvl,\n speed: 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(markers, this.psv.config.lang[MarkersButton.id]),\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);\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.height * 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 marker.$el.classList.add('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 marker.$el.classList.remove('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 Vector3().crossVectors(P1, P2).normalize();\n const V = new 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 Vector3().addVectors(X, Y).normalize();\n const a = new 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\n if (nbMarkers === 0) {\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 // eslint-disable-next-line no-lonely-if\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 this.psv.navbar.getButton(MarkersButton.id, false)?.toggle(nbMarkers > 0);\n this.psv.navbar.getButton(MarkersListButton.id, false)?.toggle(nbMarkers > 0);\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","MARKER_DATA_KEY","utils","dasherize","MARKERS_LIST_TEMPLATE","markers","title","icon","map","marker","config","id","type","image","getListContent","join","greatArcIntermediaryPoint","p1","p2","f","λ1","φ1","λ2","φ2","r","greatArcDistance","a","Math","sin","b","x","cos","y","z","atan2","sqrt","getPolygonCenter","polygon","workPoints","k","i","length","d","PI","push","sum","reduce","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","PSVError","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","svgType","update","destroy","isPoly","isPolyPx","isPolyRad","getScale","zoomLevel","scale","Array","isArray","zoom","bounds","EASINGS","inQuad","longitude","halfFov","MathUtils","degToRad","prop","hFov","arc","abs","getShortestArc","outQuad","max","listContent","content","showTooltip","mousePosition","viewerPos","getPosition","container","top","clientY","left","clientX","box","move","create","refreshTooltip","hideTooltip","hide","newType","deepmerge","trigger","className","setAttribute","addClasses","classList","add","style","opacity","parsePosition","__updateNormal","__updatePoly","__updateSvg","__update3d","isExtendedPosition","backgroundImage","innerHTML","transformOrigin","dataHelper","cleanPosition","sphericalCoordsToVector3","cx","cy","rx","ry","each","value","setAttributeNS","svgStyle","fill","actualPoly","splice","coord","sphericalCoords","textureCoordsToSphericalCoords","latitude","centroid","material","MeshBasicMaterial","transparent","depthTest","geometry","PlaneGeometry","mesh","Mesh","userData","Group","Object","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","gotoMarkerSpeed","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","zoomLvl","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","size","getAttributeNS","removeAttributeNS","getBoundingClientRect","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","getButton","toggle","has3d","some","observeObjects","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;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,EAAK,kBAfD;;EAgBpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAS,cAtBD;;EAuBpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,WAAW,EAAU,aA7BD;;EA8BpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,mBAAmB,EAAE,qBArCD;;EAsCpB;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,aAAa,EAAQ,eA9CD;;EA+CpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,kBAAkB,EAAG,oBArDD;;EAsDpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,eAAe,EAAM,iBA5DD;;EA6DpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAS,cAlED;;EAmEpB;EACF;EACA;EACA;EACA;EACA;EACEC,EAAAA,WAAW,EAAU,aAzED;;EA0EpB;EACF;EACA;EACA;EACA;EACEC,EAAAA,YAAY,EAAS,cAAA;EA/ED,EAAf;EAkFP;EACA;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,sBAAsB,GAAG;EACpCC,EAAAA,KAAK,EAAE,OAD6B;EAEpCC,EAAAA,KAAK,EAAE,OAAA;EAF6B,CAA/B,CAAA;EAKP;EACA;E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/plugins/resolution.js index 6bf96f9bd..c213a233e 100644 --- a/dist/plugins/resolution.js +++ b/dist/plugins/resolution.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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.css b/dist/plugins/settings.css index 84603f2f3..e128f2eb2 100644 --- a/dist/plugins/settings.css +++ b/dist/plugins/settings.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.8.0 + * Photo Sphere Viewer 4.8.1 * @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 e8441c4ee..5973484c9 100644 --- a/dist/plugins/settings.js +++ b/dist/plugins/settings.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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.map b/dist/plugins/settings.js.map index bb0c466f1..7c103a69c 100644 --- a/dist/plugins/settings.js.map +++ b/dist/plugins/settings.js.map @@ -1 +1 @@ -{"version":3,"file":"settings.js","sources":["../../src/plugins/settings/constants.js","../../src/plugins/settings/SettingsButton.js","../../src/data/constants.js","../../src/plugins/settings/SettingsComponent.js","../../src/plugins/settings/index.js"],"sourcesContent":["import { utils } from '../..';\nimport check from './check.svg';\nimport chevron from './chevron.svg';\nimport switchOff from './switch-off.svg';\nimport switchOn from './switch-on.svg';\n\n/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.SettingsPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event setting-changed\n * @memberof PSV.plugins.SettingsPlugin\n * @summary Triggered when a setting is changed\n * @param {string} settingId\n * @param {any} value\n */\n SETTING_CHANGED: 'setting-changed',\n};\n\n/**\n * @type {string}\n * @memberof PSV.plugins.SettingsPlugin\n * @constant\n */\nexport const TYPE_OPTIONS = 'options';\n\n/**\n * @type {string}\n * @memberof PSV.plugins.SettingsPlugin\n * @constant\n */\nexport const TYPE_TOGGLE = 'toggle';\n\n/**\n * @summary Key of settings in LocalStorage\n * @type {string}\n * @constant\n * @private\n */\nexport const LOCAL_STORAGE_KEY = 'psvSettings';\n\n/**\n * @summary Panel identifier for settings content\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL = 'settings';\n\n/**\n * @summary Property name added to settings items\n * @type {string}\n * @constant\n * @private\n */\nexport const SETTING_DATA = 'settingId';\n\n/**\n * @summary Property name added to settings items\n * @type {string}\n * @constant\n * @private\n */\nexport const OPTION_DATA = 'optionId';\n\n/**\n * @summary Identifier of the \"back\" list item\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_BACK = '__back';\n\n/**\n * @summary Identifier of the \"back\" list item\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_ENTER = '__enter';\n\nconst SETTING_DATA_KEY = utils.dasherize(SETTING_DATA);\nconst OPTION_DATA_KEY = utils.dasherize(OPTION_DATA);\n\n/**\n * @summary Setting item template, by type\n * @constant\n * @private\n */\nexport const SETTINGS_TEMPLATE_ = {\n [TYPE_OPTIONS]: (setting, optionsCurrent) => `\n ${setting.label}\n ${optionsCurrent(setting)}\n ${chevron}\n `,\n [TYPE_TOGGLE] : setting => `\n ${setting.label}\n ${setting.active() ? switchOn : switchOff}\n `,\n};\n\n/**\n * @summary Settings list template\n * @param {PSV.plugins.SettingsPlugin.Setting[]} settings\n * @param {function} optionsCurrent\n * @returns {string}\n * @constant\n * @private\n */\nexport const SETTINGS_TEMPLATE = (settings, optionsCurrent) => `\n
    \n ${settings.map(s => `\n
  • \n ${SETTINGS_TEMPLATE_[s.type](s, optionsCurrent)}\n
  • \n `).join('')}\n
\n`;\n\n/**\n * @summary Settings options template\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @param {function} optionActive\n * @returns {string}\n * @constant\n * @private\n */\nexport const SETTING_OPTIONS_TEMPLATE = (setting, optionActive) => `\n
    \n
  • \n ${chevron}\n ${setting.label}\n
  • \n ${setting.options().map(option => `\n
  • \n ${optionActive(option) ? check : ''}\n ${option.label}\n
  • \n `).join('')}\n
\n`;\n","import { AbstractButton } from '../..';\nimport icon from './settings.svg';\n\n/**\n * @summary Navigation bar settings button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class SettingsButton extends AbstractButton {\n\n static id = 'settings';\n static icon = icon;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-settings-button', true);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @private\n * @readonly\n */\n this.plugin = this.psv.getPlugin('settings');\n\n /**\n * @member {HTMLElement}\n * @private\n * @readonly\n */\n this.badge = document.createElement('div');\n this.badge.className = 'psv-settings-badge';\n this.badge.style.display = 'none';\n this.container.appendChild(this.badge);\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @override\n * @description Toggles settings\n */\n onClick() {\n this.plugin.toggleSettings();\n }\n\n /**\n * @summary Changes the badge value\n * @param {string} value\n */\n setBadge(value) {\n this.badge.innerText = value;\n this.badge.style.display = value ? '' : 'none';\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 { AbstractComponent, utils } from '../..';\nimport { EVENTS, KEY_CODES } from '../../data/constants';\nimport {\n ID_BACK,\n ID_ENTER,\n OPTION_DATA,\n SETTING_DATA,\n SETTING_OPTIONS_TEMPLATE,\n SETTINGS_TEMPLATE,\n TYPE_OPTIONS,\n TYPE_TOGGLE\n} from './constants';\n\n/**\n * @private\n */\nexport class SettingsComponent extends AbstractComponent {\n\n constructor(plugin) {\n super(plugin.psv, 'psv-settings psv--capture-event');\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @private\n * @readonly\n */\n this.plugin = plugin;\n\n /**\n * @type {Object}\n * @private\n */\n this.prop = {\n ...this.prop,\n };\n\n this.container.addEventListener('click', this);\n this.container.addEventListener('transitionend', this);\n this.container.addEventListener('keydown', this);\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case 'click':\n this.__click(e.target);\n break;\n\n case 'transitionend':\n if (!this.isVisible()) {\n this.container.innerHTML = ''; // empty content after fade out\n }\n else {\n this.__focusFirstOption();\n }\n break;\n\n case 'keydown':\n if (this.isVisible()) {\n switch (e.key) {\n case KEY_CODES.Escape:\n this.plugin.hideSettings();\n break;\n case KEY_CODES.Enter:\n this.__click(e.target);\n break;\n }\n }\n break;\n\n case EVENTS.KEY_PRESS:\n if (this.isVisible() && e.args[0] === KEY_CODES.Escape) {\n this.plugin.hideSettings();\n e.preventDefault();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n show() {\n this.__showSettings(false);\n\n this.container.classList.add('psv-settings--open');\n this.prop.visible = true;\n }\n\n /**\n * @override\n */\n hide() {\n this.container.classList.remove('psv-settings--open');\n this.prop.visible = false;\n }\n\n /**\n * @summary Handle clicks on items\n * @param {HTMLElement} element\n * @private\n */\n __click(element) {\n const li = utils.getClosest(element, 'li');\n if (!li) {\n return;\n }\n\n const settingId = li.dataset[SETTING_DATA];\n const optionId = li.dataset[OPTION_DATA];\n\n const setting = this.plugin.settings.find(s => s.id === settingId);\n\n switch (optionId) {\n case ID_BACK:\n this.__showSettings(true);\n break;\n\n case ID_ENTER:\n switch (setting.type) {\n case TYPE_TOGGLE:\n this.plugin.toggleSettingValue(setting);\n this.__showSettings(true); // re-render\n break;\n\n case TYPE_OPTIONS:\n this.__showOptions(setting);\n break;\n\n default:\n // noop\n }\n break;\n\n default:\n switch (setting.type) {\n case TYPE_OPTIONS:\n this.hide();\n this.plugin.applySettingOption(setting, optionId);\n break;\n\n default:\n // noop\n }\n break;\n }\n }\n\n /**\n * @summary Shows the list of options\n * @private\n */\n __showSettings(focus) {\n this.container.innerHTML = SETTINGS_TEMPLATE(\n this.plugin.settings,\n (setting) => {\n const current = setting.current();\n const option = setting.options()\n .find(opt => opt.id === current);\n return option?.label;\n }\n );\n\n // must not focus during the initial transition\n if (focus) {\n this.__focusFirstOption();\n }\n }\n\n /**\n * @summary Shows setting options panel\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @private\n */\n __showOptions(setting) {\n const current = setting.current();\n\n this.container.innerHTML = SETTING_OPTIONS_TEMPLATE(\n setting,\n (option) => {\n return option.id === current;\n }\n );\n\n this.__focusFirstOption();\n }\n\n __focusFirstOption() {\n this.container.querySelector('[tabindex]')?.focus();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..';\nimport { EVENTS, LOCAL_STORAGE_KEY, SETTINGS_TEMPLATE_, TYPE_OPTIONS, TYPE_TOGGLE } from './constants';\nimport { SettingsButton } from './SettingsButton';\nimport { SettingsComponent } from './SettingsComponent';\nimport './style.scss';\n\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Setting\n * @summary Description of a setting\n * @property {string} id - identifier of the setting\n * @property {string} label - label of the setting\n * @property {'options' | 'toggle'} type - type of the setting\n * @property {function} [badge] - function which returns the value of the button badge\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.OptionsSetting\n * @summary Description of a 'options' setting\n * @property {'options'} type - type of the setting\n * @property {function} current - function which returns the current option id\n * @property {function} options - function which the possible options as an array of {@link PSV.plugins.SettingsPlugin.Option}\n * @property {function} apply - function called with the id of the selected option\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.ToggleSetting\n * @summary Description of a 'toggle' setting\n * @property {'toggle'} type - type of the setting\n * @property {function} active - function which return whereas the setting is active or not\n * @property {function} toggle - function called when the setting is toggled\n */\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Option\n * @summary Option of an 'option' setting\n * @property {string} id - identifier of the option\n * @property {string} label - label of the option\n */\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Options\n * @property {boolean} [persist=false] - should the settings be saved accross sessions\n * @property {Object} [storage] - custom storage handler, defaults to LocalStorage\n * @property {PSV.plugins.SettingsPlugin.StorageGetter} [storage.get]\n * @property {PSV.plugins.SettingsPlugin.StorageSetter} [storage.set]\n */\n\n/**\n * @callback StorageGetter\n * @memberOf PSV.plugins.SettingsPlugin\n * @param {string} settingId\n * @return {boolean | string | Promise} - return `undefined` or `null` if the option does not exist\n */\n\n/**\n * @callback StorageSetter\n * @memberOf PSV.plugins.SettingsPlugin\n * @param {string} settingId\n * @param {boolean | string} value\n */\n\n\n// add settings button\nDEFAULTS.lang[SettingsButton.id] = 'Settings';\nregisterButton(SettingsButton, 'fullscreen:left');\n\n\nfunction getData() {\n return JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY)) || {};\n}\n\nfunction setData(data) {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(data));\n}\n\n\nexport { EVENTS, TYPE_TOGGLE, TYPE_OPTIONS } from './constants';\n\n\n/**\n * @summary Adds a button to access various settings.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class SettingsPlugin extends AbstractPlugin {\n\n static id = 'settings';\n\n static EVENTS = EVENTS;\n static TYPE_TOGGLE = TYPE_TOGGLE;\n static TYPE_OPTIONS = TYPE_OPTIONS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.SettingsPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin.Options}\n */\n this.config = {\n persist: false,\n storage: {\n get(id) {\n return getData()[id];\n },\n set(id, value) {\n const data = getData();\n data[id] = value;\n setData(data);\n },\n },\n ...options,\n };\n\n /**\n * @type {SettingsComponent}\n * @private\n * @readonly\n */\n this.component = new SettingsComponent(this);\n\n /**\n * @type {PSV.plugins.SettingsPlugin.Setting[]}\n * @private\n */\n this.settings = [];\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n\n // buttons are initialized just after plugins\n setTimeout(() => this.updateButton());\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n\n this.component.destroy();\n\n delete this.component;\n this.settings.length = 0;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case CONSTANTS.EVENTS.CLICK:\n case CONSTANTS.EVENTS.OPEN_PANEL:\n if (this.component.isVisible()) {\n this.hideSettings();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @summary Registers a new setting\n * @param {PSV.plugins.SettingsPlugin.Setting} setting\n */\n addSetting(setting) {\n if (!setting.id) {\n throw new PSVError('Missing setting id');\n }\n if (!setting.type) {\n throw new PSVError('Missing setting type');\n }\n if (!SETTINGS_TEMPLATE_[setting.type]) {\n throw new PSVError('Unsupported setting type');\n }\n\n if (setting.badge && this.settings.some(s => s.badge)) {\n utils.logWarn('More than one setting with a badge are declared, the result is unpredictable.');\n }\n\n this.settings.push(setting);\n\n if (this.component.isVisible()) {\n this.component.show(); // re-render\n }\n\n this.updateButton();\n\n if (this.config.persist) {\n Promise.resolve(this.config.storage.get(setting.id))\n .then((value) => {\n switch (setting.type) {\n case TYPE_TOGGLE:\n if (!utils.isNil(value) && value !== setting.active()) {\n setting.toggle();\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, setting.active());\n }\n break;\n\n case TYPE_OPTIONS:\n if (!utils.isNil(value) && value !== setting.current()) {\n setting.apply(value);\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, setting.current());\n }\n break;\n\n default:\n // noop\n }\n\n this.updateButton();\n });\n }\n }\n\n /**\n * @summary Removes a setting\n * @param {string} id\n */\n removeSetting(id) {\n const idx = this.settings.findIndex(setting => setting.id === id);\n if (idx !== -1) {\n this.settings.splice(idx, 1);\n\n if (this.component.isVisible()) {\n this.component.show(); // re-render\n }\n\n this.updateButton();\n }\n }\n\n /**\n * @summary Toggles the settings menu\n */\n toggleSettings() {\n this.component.toggle();\n this.updateButton();\n }\n\n /**\n * @summary Hides the settings menu\n */\n hideSettings() {\n this.component.hide();\n this.updateButton();\n }\n\n /**\n * @summary Shows the settings menu\n */\n showSettings() {\n this.component.show();\n this.updateButton();\n }\n\n /**\n * @summary Updates the badge in the button\n */\n updateButton() {\n const value = this.settings.find(s => s.badge)?.badge();\n const button = this.psv.navbar.getButton(SettingsButton.id, false);\n button?.toggleActive(this.component.isVisible());\n button?.setBadge(value);\n }\n\n /**\n * @summary Toggles a setting\n * @param {PSV.plugins.SettingsPlugin.ToggleSetting} setting\n * @package\n */\n toggleSettingValue(setting) {\n const newValue = !setting.active(); // in case \"toggle\" is async\n\n setting.toggle();\n\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, newValue);\n\n if (this.config.persist) {\n this.config.storage.set(setting.id, newValue);\n }\n\n this.updateButton();\n }\n\n /**\n * @summary Changes the value of an setting\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @param {string} optionId\n * @package\n */\n applySettingOption(setting, optionId) {\n setting.apply(optionId);\n\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, optionId);\n\n if (this.config.persist) {\n this.config.storage.set(setting.id, optionId);\n }\n\n this.updateButton();\n }\n\n}\n"],"names":["EVENTS","SETTING_CHANGED","TYPE_OPTIONS","TYPE_TOGGLE","LOCAL_STORAGE_KEY","SETTING_DATA","OPTION_DATA","ID_BACK","ID_ENTER","SETTING_DATA_KEY","utils","dasherize","OPTION_DATA_KEY","SETTINGS_TEMPLATE_","setting","optionsCurrent","label","chevron","active","switchOn","switchOff","SETTINGS_TEMPLATE","settings","map","s","id","type","join","SETTING_OPTIONS_TEMPLATE","optionActive","options","option","check","SettingsButton","navbar","plugin","psv","getPlugin","badge","document","createElement","className","style","display","container","appendChild","destroy","isSupported","onClick","toggleSettings","setBadge","value","innerText","AbstractButton","icon","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","KEY_CODES","Enter","Control","Escape","Space","PageUp","PageDown","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Delete","Plus","Minus","SettingsComponent","prop","addEventListener","hide","handleEvent","e","__click","target","isVisible","innerHTML","__focusFirstOption","key","hideSettings","args","preventDefault","show","__showSettings","classList","add","visible","remove","element","li","getClosest","settingId","dataset","optionId","find","toggleSettingValue","__showOptions","applySettingOption","focus","current","opt","querySelector","AbstractComponent","DEFAULTS","lang","registerButton","getData","JSON","parse","localStorage","getItem","setData","data","setItem","stringify","SettingsPlugin","config","persist","storage","get","set","component","init","on","CONSTANTS","setTimeout","updateButton","off","length","addSetting","PSVError","some","logWarn","push","Promise","resolve","then","isNil","toggle","trigger","apply","removeSetting","idx","findIndex","splice","showSettings","button","getButton","toggleActive","newValue","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;;AACO,MAAMA,QAAM,GAAG;EACpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,eAAe,EAAE,iBAAA;EARG,EAAf;EAWP;EACA;EACA;EACA;EACA;;AACO,MAAMC,YAAY,GAAG,UAArB;EAEP;EACA;EACA;EACA;EACA;;AACO,MAAMC,WAAW,GAAG,SAApB;EAEP;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,iBAAiB,GAAG,aAA1B,CAAA;EAUP;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,YAAY,GAAG,WAArB,CAAA;EA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hC,EAAoCsJ,QAApC,CAAA,CAAA;EACD,KAAA;;EAED,IAAA,IAAA,CAAKvB,YAAL,EAAA,CAAA;EACD,GAAA;EAED;EACF;EACA;EACA;EACA;EACA;EA5NA,GAAA;;EAAA,EAAA,MAAA,CA6NE7B,kBA7NF,GA6NE,SAAA,kBAAA,CAAmB7G,OAAnB,EAA4ByG,QAA5B,EAAsC;MACpCzG,OAAO,CAACwJ,KAAR,CAAc/C,QAAd,CAAA,CAAA;MAEA,IAAK8C,CAAAA,OAAL,CAAarK,QAAM,CAACC,eAApB,EAAqCa,OAAO,CAACW,EAA7C,EAAiD8F,QAAjD,CAAA,CAAA;;EAEA,IAAA,IAAI,IAAKuB,CAAAA,MAAL,CAAYC,OAAhB,EAAyB;QACvB,IAAKD,CAAAA,MAAL,CAAYE,OAAZ,CAAoBE,GAApB,CAAwBpI,OAAO,CAACW,EAAhC,EAAoC8F,QAApC,CAAA,CAAA;EACD,KAAA;;EAED,IAAA,IAAA,CAAKiC,YAAL,EAAA,CAAA;KAtOJ,CAAA;;EAAA,EAAA,OAAA,cAAA,CAAA;EAAA,CAAA,CAAoCwB,gCAApC,EAAA;EAAanC,eAEJpH,KAAK;EAFDoH,eAIJ7I,SAASA;EAJL6I,eAKJ1I,cAAcA;EALV0I,eAMJ3I,eAAeA;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"settings.js","sources":["../../src/plugins/settings/constants.js","../../src/plugins/settings/SettingsButton.js","../../src/data/constants.js","../../src/plugins/settings/SettingsComponent.js","../../src/plugins/settings/index.js"],"sourcesContent":["import { utils } from '../..';\nimport check from './check.svg';\nimport chevron from './chevron.svg';\nimport switchOff from './switch-off.svg';\nimport switchOn from './switch-on.svg';\n\n/**\n * @summary Available events\n * @enum {string}\n * @memberof PSV.plugins.SettingsPlugin\n * @constant\n */\nexport const EVENTS = {\n /**\n * @event setting-changed\n * @memberof PSV.plugins.SettingsPlugin\n * @summary Triggered when a setting is changed\n * @param {string} settingId\n * @param {any} value\n */\n SETTING_CHANGED: 'setting-changed',\n};\n\n/**\n * @type {string}\n * @memberof PSV.plugins.SettingsPlugin\n * @constant\n */\nexport const TYPE_OPTIONS = 'options';\n\n/**\n * @type {string}\n * @memberof PSV.plugins.SettingsPlugin\n * @constant\n */\nexport const TYPE_TOGGLE = 'toggle';\n\n/**\n * @summary Key of settings in LocalStorage\n * @type {string}\n * @constant\n * @private\n */\nexport const LOCAL_STORAGE_KEY = 'psvSettings';\n\n/**\n * @summary Panel identifier for settings content\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_PANEL = 'settings';\n\n/**\n * @summary Property name added to settings items\n * @type {string}\n * @constant\n * @private\n */\nexport const SETTING_DATA = 'settingId';\n\n/**\n * @summary Property name added to settings items\n * @type {string}\n * @constant\n * @private\n */\nexport const OPTION_DATA = 'optionId';\n\n/**\n * @summary Identifier of the \"back\" list item\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_BACK = '__back';\n\n/**\n * @summary Identifier of the \"back\" list item\n * @type {string}\n * @constant\n * @private\n */\nexport const ID_ENTER = '__enter';\n\nconst SETTING_DATA_KEY = utils.dasherize(SETTING_DATA);\nconst OPTION_DATA_KEY = utils.dasherize(OPTION_DATA);\n\n/**\n * @summary Setting item template, by type\n * @constant\n * @private\n */\nexport const SETTINGS_TEMPLATE_ = {\n [TYPE_OPTIONS]: (setting, optionsCurrent) => `\n ${setting.label}\n ${optionsCurrent(setting)}\n ${chevron}\n `,\n [TYPE_TOGGLE] : setting => `\n ${setting.label}\n ${setting.active() ? switchOn : switchOff}\n `,\n};\n\n/**\n * @summary Settings list template\n * @param {PSV.plugins.SettingsPlugin.Setting[]} settings\n * @param {function} optionsCurrent\n * @returns {string}\n * @constant\n * @private\n */\nexport const SETTINGS_TEMPLATE = (settings, optionsCurrent) => `\n
    \n ${settings.map(s => `\n
  • \n ${SETTINGS_TEMPLATE_[s.type](s, optionsCurrent)}\n
  • \n `).join('')}\n
\n`;\n\n/**\n * @summary Settings options template\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @param {function} optionActive\n * @returns {string}\n * @constant\n * @private\n */\nexport const SETTING_OPTIONS_TEMPLATE = (setting, optionActive) => `\n
    \n
  • \n ${chevron}\n ${setting.label}\n
  • \n ${setting.options().map(option => `\n
  • \n ${optionActive(option) ? check : ''}\n ${option.label}\n
  • \n `).join('')}\n
\n`;\n","import { AbstractButton } from '../..';\nimport icon from './settings.svg';\n\n/**\n * @summary Navigation bar settings button class\n * @extends PSV.buttons.AbstractButton\n * @memberof PSV.buttons\n */\nexport class SettingsButton extends AbstractButton {\n\n static id = 'settings';\n static icon = icon;\n\n /**\n * @param {PSV.components.Navbar} navbar\n */\n constructor(navbar) {\n super(navbar, 'psv-button--hover-scale psv-settings-button', true);\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @private\n * @readonly\n */\n this.plugin = this.psv.getPlugin('settings');\n\n /**\n * @member {HTMLElement}\n * @private\n * @readonly\n */\n this.badge = document.createElement('div');\n this.badge.className = 'psv-settings-badge';\n this.badge.style.display = 'none';\n this.container.appendChild(this.badge);\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @override\n */\n isSupported() {\n return !!this.plugin;\n }\n\n /**\n * @override\n * @description Toggles settings\n */\n onClick() {\n this.plugin.toggleSettings();\n }\n\n /**\n * @summary Changes the badge value\n * @param {string} value\n */\n setBadge(value) {\n this.badge.innerText = value;\n this.badge.style.display = value ? '' : 'none';\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 Minimum duration of the animations created with {@link Viewer#animate}\n * @memberOf PSV.constants\n * @type {number}\n * @constant\n */\nexport const ANIMATION_MIN_DURATION = 500;\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 { AbstractComponent, utils } from '../..';\nimport { EVENTS, KEY_CODES } from '../../data/constants';\nimport {\n ID_BACK,\n ID_ENTER,\n OPTION_DATA,\n SETTING_DATA,\n SETTING_OPTIONS_TEMPLATE,\n SETTINGS_TEMPLATE,\n TYPE_OPTIONS,\n TYPE_TOGGLE\n} from './constants';\n\n/**\n * @private\n */\nexport class SettingsComponent extends AbstractComponent {\n\n constructor(plugin) {\n super(plugin.psv, 'psv-settings psv--capture-event');\n\n /**\n * @type {PSV.plugins.SettingsPlugin}\n * @private\n * @readonly\n */\n this.plugin = plugin;\n\n /**\n * @type {Object}\n * @private\n */\n this.prop = {\n ...this.prop,\n };\n\n this.container.addEventListener('click', this);\n this.container.addEventListener('transitionend', this);\n this.container.addEventListener('keydown', this);\n\n this.hide();\n }\n\n /**\n * @override\n */\n destroy() {\n delete this.plugin;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case 'click':\n this.__click(e.target);\n break;\n\n case 'transitionend':\n if (!this.isVisible()) {\n this.container.innerHTML = ''; // empty content after fade out\n }\n else {\n this.__focusFirstOption();\n }\n break;\n\n case 'keydown':\n if (this.isVisible()) {\n switch (e.key) {\n case KEY_CODES.Escape:\n this.plugin.hideSettings();\n break;\n case KEY_CODES.Enter:\n this.__click(e.target);\n break;\n }\n }\n break;\n\n case EVENTS.KEY_PRESS:\n if (this.isVisible() && e.args[0] === KEY_CODES.Escape) {\n this.plugin.hideSettings();\n e.preventDefault();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @override\n */\n show() {\n this.__showSettings(false);\n\n this.container.classList.add('psv-settings--open');\n this.prop.visible = true;\n }\n\n /**\n * @override\n */\n hide() {\n this.container.classList.remove('psv-settings--open');\n this.prop.visible = false;\n }\n\n /**\n * @summary Handle clicks on items\n * @param {HTMLElement} element\n * @private\n */\n __click(element) {\n const li = utils.getClosest(element, 'li');\n if (!li) {\n return;\n }\n\n const settingId = li.dataset[SETTING_DATA];\n const optionId = li.dataset[OPTION_DATA];\n\n const setting = this.plugin.settings.find(s => s.id === settingId);\n\n switch (optionId) {\n case ID_BACK:\n this.__showSettings(true);\n break;\n\n case ID_ENTER:\n switch (setting.type) {\n case TYPE_TOGGLE:\n this.plugin.toggleSettingValue(setting);\n this.__showSettings(true); // re-render\n break;\n\n case TYPE_OPTIONS:\n this.__showOptions(setting);\n break;\n\n default:\n // noop\n }\n break;\n\n default:\n switch (setting.type) {\n case TYPE_OPTIONS:\n this.hide();\n this.plugin.applySettingOption(setting, optionId);\n break;\n\n default:\n // noop\n }\n break;\n }\n }\n\n /**\n * @summary Shows the list of options\n * @private\n */\n __showSettings(focus) {\n this.container.innerHTML = SETTINGS_TEMPLATE(\n this.plugin.settings,\n (setting) => {\n const current = setting.current();\n const option = setting.options()\n .find(opt => opt.id === current);\n return option?.label;\n }\n );\n\n // must not focus during the initial transition\n if (focus) {\n this.__focusFirstOption();\n }\n }\n\n /**\n * @summary Shows setting options panel\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @private\n */\n __showOptions(setting) {\n const current = setting.current();\n\n this.container.innerHTML = SETTING_OPTIONS_TEMPLATE(\n setting,\n (option) => {\n return option.id === current;\n }\n );\n\n this.__focusFirstOption();\n }\n\n __focusFirstOption() {\n this.container.querySelector('[tabindex]')?.focus();\n }\n\n}\n","import { AbstractPlugin, CONSTANTS, DEFAULTS, PSVError, registerButton, utils } from '../..';\nimport { EVENTS, LOCAL_STORAGE_KEY, SETTINGS_TEMPLATE_, TYPE_OPTIONS, TYPE_TOGGLE } from './constants';\nimport { SettingsButton } from './SettingsButton';\nimport { SettingsComponent } from './SettingsComponent';\nimport './style.scss';\n\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Setting\n * @summary Description of a setting\n * @property {string} id - identifier of the setting\n * @property {string} label - label of the setting\n * @property {'options' | 'toggle'} type - type of the setting\n * @property {function} [badge] - function which returns the value of the button badge\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.OptionsSetting\n * @summary Description of a 'options' setting\n * @property {'options'} type - type of the setting\n * @property {function} current - function which returns the current option id\n * @property {function} options - function which the possible options as an array of {@link PSV.plugins.SettingsPlugin.Option}\n * @property {function} apply - function called with the id of the selected option\n */\n\n/**\n * @typedef {PSV.plugins.SettingsPlugin.Setting} PSV.plugins.SettingsPlugin.ToggleSetting\n * @summary Description of a 'toggle' setting\n * @property {'toggle'} type - type of the setting\n * @property {function} active - function which return whereas the setting is active or not\n * @property {function} toggle - function called when the setting is toggled\n */\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Option\n * @summary Option of an 'option' setting\n * @property {string} id - identifier of the option\n * @property {string} label - label of the option\n */\n\n/**\n * @typedef {Object} PSV.plugins.SettingsPlugin.Options\n * @property {boolean} [persist=false] - should the settings be saved accross sessions\n * @property {Object} [storage] - custom storage handler, defaults to LocalStorage\n * @property {PSV.plugins.SettingsPlugin.StorageGetter} [storage.get]\n * @property {PSV.plugins.SettingsPlugin.StorageSetter} [storage.set]\n */\n\n/**\n * @callback StorageGetter\n * @memberOf PSV.plugins.SettingsPlugin\n * @param {string} settingId\n * @return {boolean | string | Promise} - return `undefined` or `null` if the option does not exist\n */\n\n/**\n * @callback StorageSetter\n * @memberOf PSV.plugins.SettingsPlugin\n * @param {string} settingId\n * @param {boolean | string} value\n */\n\n\n// add settings button\nDEFAULTS.lang[SettingsButton.id] = 'Settings';\nregisterButton(SettingsButton, 'fullscreen:left');\n\n\nfunction getData() {\n return JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY)) || {};\n}\n\nfunction setData(data) {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(data));\n}\n\n\nexport { EVENTS, TYPE_TOGGLE, TYPE_OPTIONS } from './constants';\n\n\n/**\n * @summary Adds a button to access various settings.\n * @extends PSV.plugins.AbstractPlugin\n * @memberof PSV.plugins\n */\nexport class SettingsPlugin extends AbstractPlugin {\n\n static id = 'settings';\n\n static EVENTS = EVENTS;\n static TYPE_TOGGLE = TYPE_TOGGLE;\n static TYPE_OPTIONS = TYPE_OPTIONS;\n\n /**\n * @param {PSV.Viewer} psv\n * @param {PSV.plugins.SettingsPlugin.Options} options\n */\n constructor(psv, options) {\n super(psv);\n\n /**\n * @type {PSV.plugins.SettingsPlugin.Options}\n */\n this.config = {\n persist: false,\n storage: {\n get(id) {\n return getData()[id];\n },\n set(id, value) {\n const data = getData();\n data[id] = value;\n setData(data);\n },\n },\n ...options,\n };\n\n /**\n * @type {SettingsComponent}\n * @private\n * @readonly\n */\n this.component = new SettingsComponent(this);\n\n /**\n * @type {PSV.plugins.SettingsPlugin.Setting[]}\n * @private\n */\n this.settings = [];\n }\n\n /**\n * @package\n */\n init() {\n super.init();\n\n this.psv.on(CONSTANTS.EVENTS.CLICK, this);\n this.psv.on(CONSTANTS.EVENTS.OPEN_PANEL, this);\n\n // buttons are initialized just after plugins\n setTimeout(() => this.updateButton());\n }\n\n /**\n * @package\n */\n destroy() {\n this.psv.off(CONSTANTS.EVENTS.CLICK, this);\n this.psv.off(CONSTANTS.EVENTS.OPEN_PANEL, this);\n\n this.component.destroy();\n\n delete this.component;\n this.settings.length = 0;\n\n super.destroy();\n }\n\n /**\n * @private\n */\n handleEvent(e) {\n /* eslint-disable */\n switch (e.type) {\n case CONSTANTS.EVENTS.CLICK:\n case CONSTANTS.EVENTS.OPEN_PANEL:\n if (this.component.isVisible()) {\n this.hideSettings();\n }\n break;\n }\n /* eslint-enable */\n }\n\n /**\n * @summary Registers a new setting\n * @param {PSV.plugins.SettingsPlugin.Setting} setting\n */\n addSetting(setting) {\n if (!setting.id) {\n throw new PSVError('Missing setting id');\n }\n if (!setting.type) {\n throw new PSVError('Missing setting type');\n }\n if (!SETTINGS_TEMPLATE_[setting.type]) {\n throw new PSVError('Unsupported setting type');\n }\n\n if (setting.badge && this.settings.some(s => s.badge)) {\n utils.logWarn('More than one setting with a badge are declared, the result is unpredictable.');\n }\n\n this.settings.push(setting);\n\n if (this.component.isVisible()) {\n this.component.show(); // re-render\n }\n\n this.updateButton();\n\n if (this.config.persist) {\n Promise.resolve(this.config.storage.get(setting.id))\n .then((value) => {\n switch (setting.type) {\n case TYPE_TOGGLE:\n if (!utils.isNil(value) && value !== setting.active()) {\n setting.toggle();\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, setting.active());\n }\n break;\n\n case TYPE_OPTIONS:\n if (!utils.isNil(value) && value !== setting.current()) {\n setting.apply(value);\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, setting.current());\n }\n break;\n\n default:\n // noop\n }\n\n this.updateButton();\n });\n }\n }\n\n /**\n * @summary Removes a setting\n * @param {string} id\n */\n removeSetting(id) {\n const idx = this.settings.findIndex(setting => setting.id === id);\n if (idx !== -1) {\n this.settings.splice(idx, 1);\n\n if (this.component.isVisible()) {\n this.component.show(); // re-render\n }\n\n this.updateButton();\n }\n }\n\n /**\n * @summary Toggles the settings menu\n */\n toggleSettings() {\n this.component.toggle();\n this.updateButton();\n }\n\n /**\n * @summary Hides the settings menu\n */\n hideSettings() {\n this.component.hide();\n this.updateButton();\n }\n\n /**\n * @summary Shows the settings menu\n */\n showSettings() {\n this.component.show();\n this.updateButton();\n }\n\n /**\n * @summary Updates the badge in the button\n */\n updateButton() {\n const value = this.settings.find(s => s.badge)?.badge();\n const button = this.psv.navbar.getButton(SettingsButton.id, false);\n button?.toggleActive(this.component.isVisible());\n button?.setBadge(value);\n }\n\n /**\n * @summary Toggles a setting\n * @param {PSV.plugins.SettingsPlugin.ToggleSetting} setting\n * @package\n */\n toggleSettingValue(setting) {\n const newValue = !setting.active(); // in case \"toggle\" is async\n\n setting.toggle();\n\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, newValue);\n\n if (this.config.persist) {\n this.config.storage.set(setting.id, newValue);\n }\n\n this.updateButton();\n }\n\n /**\n * @summary Changes the value of an setting\n * @param {PSV.plugins.SettingsPlugin.OptionsSetting} setting\n * @param {string} optionId\n * @package\n */\n applySettingOption(setting, optionId) {\n setting.apply(optionId);\n\n this.trigger(EVENTS.SETTING_CHANGED, setting.id, optionId);\n\n if (this.config.persist) {\n this.config.storage.set(setting.id, optionId);\n }\n\n this.updateButton();\n }\n\n}\n"],"names":["EVENTS","SETTING_CHANGED","TYPE_OPTIONS","TYPE_TOGGLE","LOCAL_STORAGE_KEY","SETTING_DATA","OPTION_DATA","ID_BACK","ID_ENTER","SETTING_DATA_KEY","utils","dasherize","OPTION_DATA_KEY","SETTINGS_TEMPLATE_","setting","optionsCurrent","label","chevron","active","switchOn","switchOff","SETTINGS_TEMPLATE","settings","map","s","id","type","join","SETTING_OPTIONS_TEMPLATE","optionActive","options","option","check","SettingsButton","navbar","plugin","psv","getPlugin","badge","document","createElement","className","style","display","container","appendChild","destroy","isSupported","onClick","toggleSettings","setBadge","value","innerText","AbstractButton","icon","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","KEY_CODES","Enter","Control","Escape","Space","PageUp","PageDown","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Delete","Plus","Minus","SettingsComponent","prop","addEventListener","hide","handleEvent","e","__click","target","isVisible","innerHTML","__focusFirstOption","key","hideSettings","args","preventDefault","show","__showSettings","classList","add","visible","remove","element","li","getClosest","settingId","dataset","optionId","find","toggleSettingValue","__showOptions","applySettingOption","focus","current","opt","querySelector","AbstractComponent","DEFAULTS","lang","registerButton","getData","JSON","parse","localStorage","getItem","setData","data","setItem","stringify","SettingsPlugin","config","persist","storage","get","set","component","init","on","CONSTANTS","setTimeout","updateButton","off","length","addSetting","PSVError","some","logWarn","push","Promise","resolve","then","isNil","toggle","trigger","apply","removeSetting","idx","findIndex","splice","showSettings","button","getButton","toggleActive","newValue","AbstractPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;;AACO,MAAMA,QAAM,GAAG;EACpB;EACF;EACA;EACA;EACA;EACA;EACA;EACEC,EAAAA,eAAe,EAAE,iBAAA;EARG,EAAf;EAWP;EACA;EACA;EACA;EACA;;AACO,MAAMC,YAAY,GAAG,UAArB;EAEP;EACA;EACA;EACA;EACA;;AACO,MAAMC,WAAW,GAAG,SAApB;EAEP;EACA;EACA;EACA;EACA;EACA;;EACO,IAAMC,iBAAi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hB,EAAyB;QACvB,IAAKD,CAAAA,MAAL,CAAYE,OAAZ,CAAoBE,GAApB,CAAwBpI,OAAO,CAACW,EAAhC,EAAoCsJ,QAApC,CAAA,CAAA;EACD,KAAA;;EAED,IAAA,IAAA,CAAKvB,YAAL,EAAA,CAAA;EACD,GAAA;EAED;EACF;EACA;EACA;EACA;EACA;EA5NA,GAAA;;EAAA,EAAA,MAAA,CA6NE7B,kBA7NF,GA6NE,SAAA,kBAAA,CAAmB7G,OAAnB,EAA4ByG,QAA5B,EAAsC;MACpCzG,OAAO,CAACwJ,KAAR,CAAc/C,QAAd,CAAA,CAAA;MAEA,IAAK8C,CAAAA,OAAL,CAAarK,QAAM,CAACC,eAApB,EAAqCa,OAAO,CAACW,EAA7C,EAAiD8F,QAAjD,CAAA,CAAA;;EAEA,IAAA,IAAI,IAAKuB,CAAAA,MAAL,CAAYC,OAAhB,EAAyB;QACvB,IAAKD,CAAAA,MAAL,CAAYE,OAAZ,CAAoBE,GAApB,CAAwBpI,OAAO,CAACW,EAAhC,EAAoC8F,QAApC,CAAA,CAAA;EACD,KAAA;;EAED,IAAA,IAAA,CAAKiC,YAAL,EAAA,CAAA;KAtOJ,CAAA;;EAAA,EAAA,OAAA,cAAA,CAAA;EAAA,CAAA,CAAoCwB,gCAApC,EAAA;EAAanC,eAEJpH,KAAK;EAFDoH,eAIJ7I,SAASA;EAJL6I,eAKJ1I,cAAcA;EALV0I,eAMJ3I,eAAeA;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/plugins/stereo.js b/dist/plugins/stereo.js index 347a32ac2..38232c52d 100644 --- a/dist/plugins/stereo.js +++ b/dist/plugins/stereo.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 44042fe98..5680cc07b 100644 --- a/dist/plugins/video.css +++ b/dist/plugins/video.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.8.0 + * Photo Sphere Viewer 4.8.1 * @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 172d2c953..1e0d52112 100644 --- a/dist/plugins/video.js +++ b/dist/plugins/video.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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 d1d215158..9126102d8 100644 --- a/dist/plugins/virtual-tour.css +++ b/dist/plugins/virtual-tour.css @@ -1,5 +1,5 @@ /*! - * Photo Sphere Viewer 4.8.0 + * Photo Sphere Viewer 4.8.1 * @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 d303ec41a..4a5de1849 100644 --- a/dist/plugins/virtual-tour.js +++ b/dist/plugins/virtual-tour.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @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/visible-range.js b/dist/plugins/visible-range.js index e8518406f..95c6de327 100644 --- a/dist/plugins/visible-range.js +++ b/dist/plugins/visible-range.js @@ -1,5 +1,5 @@ /*! -* Photo Sphere Viewer 4.8.0 +* Photo Sphere Viewer 4.8.1 * @copyright 2014-2015 Jérémy Heleine * @copyright 2015-2022 Damien "Mistic" Sorel * @licence MIT (https://opensource.org/licenses/MIT) diff --git a/docs/.netlify/functions/announcements.js b/docs/.netlify/functions/announcements.js index 49c583292..08f175c45 100644 --- a/docs/.netlify/functions/announcements.js +++ b/docs/.netlify/functions/announcements.js @@ -1,17 +1,14 @@ -const axios = require('axios'); - exports.handler = async function(event, context) { if (event.httpMethod !== 'GET') { return { statusCode: 405, body: 'Method Not Allowed' }; } - return await axios({ - url : 'https://api.github.com/graphql', + return await fetch('https://api.github.com/graphql', { method : 'POST', headers: { 'Authorization': `bearer ${process.env.GH_TOKEN}`, }, - data : { + body : JSON.stringify({ query: ` query { repository(owner: "mistic100", name: "photo-sphere-viewer") { @@ -27,10 +24,11 @@ exports.handler = async function(event, context) { } } }`, - }, + }), }) + .then(response => response.json()) .then(result => { - const announcements = result.data.data.repository.pinnedDiscussions.nodes.map(n => n.discussion); + const announcements = result.data.repository.pinnedDiscussions.nodes.map(n => n.discussion); return { statusCode: 200, body: JSON.stringify(announcements) diff --git a/docs/.netlify/functions/releases.js b/docs/.netlify/functions/releases.js index 0924bf299..ed01a12d1 100644 --- a/docs/.netlify/functions/releases.js +++ b/docs/.netlify/functions/releases.js @@ -1,17 +1,14 @@ -const axios = require('axios'); - exports.handler = async function(event, context) { if (event.httpMethod !== 'GET') { return { statusCode: 405, body: 'Method Not Allowed' }; } - return await axios({ - url : 'https://api.github.com/graphql', + return await fetch('https://api.github.com/graphql', { method : 'POST', headers: { 'Authorization': `bearer ${process.env.GH_TOKEN}`, }, - data : { + body : JSON.stringify({ query: ` query { repository(owner: "mistic100", name: "photo-sphere-viewer") { @@ -26,10 +23,11 @@ exports.handler = async function(event, context) { } } }`, - }, + }), }) + .then(response => response.json()) .then(result => { - const releases = result.data.data.repository.releases.nodes; + const releases = result.data.repository.releases.nodes; return { statusCode: 200, body: JSON.stringify(releases) diff --git a/docs/plugins/plugin-markers.md b/docs/plugins/plugin-markers.md index 971fa1c5c..965462198 100644 --- a/docs/plugins/plugin-markers.md +++ b/docs/plugins/plugin-markers.md @@ -494,6 +494,12 @@ lang: { _Note: this option is not part of the plugin but is merged with the main [`lang`](../guide/config.md#lang) object._ +#### `gotoMarkerSpeed` +- type: `string|number` +- default `'8rpm'` + +Default animation speed for `gotoMarker` method. + #### `clickEventOnMarker` - type: `boolean` - default: `false` @@ -529,7 +535,7 @@ Returns the last marker clicked by the user. Moves the view to face a specific marker. ```js -markersPlugin.gotoMarker('marker-1', 1500) +markersPlugin.gotoMarker('marker-1', '4rpm') .then(() => /* animation complete */); ``` diff --git a/example/plugin-markers.html b/example/plugin-markers.html index c9d7810af..b5cc58436 100644 --- a/example/plugin-markers.html +++ b/example/plugin-markers.html @@ -426,11 +426,11 @@

Lorem ipsum

}); // add markers all hover the sphere - for (let i = 0; i < Math.PI * 2; i += Math.PI / 4) { - for (let j = -Math.PI / 2 + Math.PI / 4; j < Math.PI / 2; j += Math.PI / 4) { + for (let i = 0, k = 1; i < Math.PI * 2; i += Math.PI / 4) { + for (let j = -Math.PI / 2 + Math.PI / 4; j < Math.PI / 2; j += Math.PI / 4, k++) { a.push({ - id : '#' + a.length, - tooltip : '#' + a.length, + id : '#' + k, + tooltip : '#' + k, latitude : j, longitude: i, image : 'assets/pin-red.png', diff --git a/package.json b/package.json index b64e68129..38fbf3bfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "photo-sphere-viewer", - "version": "4.8.0", + "version": "4.8.1", "description": "A JavaScript library to display Photo Sphere panoramas", "homepage": "https://photo-sphere-viewer.js.org", "main": "dist/photo-sphere-viewer.js", @@ -33,7 +33,7 @@ "url": "git://github.com/mistic100/Photo-Sphere-Viewer.git" }, "dependencies": { - "three": "^0.146.0", + "three": "^0.147.0", "uevent": "^2.1.1" }, "devDependencies": { @@ -52,7 +52,6 @@ "@vuepress/plugin-back-to-top": "^1.8.2", "@vuepress/plugin-google-analytics": "^1.8.2", "autoprefixer": "^10.3.3", - "axios": "^1.0.0", "cpx2": "^4.1.2", "date-fns": "^2.23.0", "eslint": "^8.2.0", diff --git a/src/Viewer.js b/src/Viewer.js index 02481372e..f8a14c397 100644 --- a/src/Viewer.js +++ b/src/Viewer.js @@ -6,7 +6,15 @@ import { Notification } from './components/Notification'; import { Overlay } from './components/Overlay'; import { Panel } from './components/Panel'; import { CONFIG_PARSERS, DEFAULTS, DEPRECATED_OPTIONS, getConfig, READONLY_OPTIONS } from './data/config'; -import { CHANGE_EVENTS, DEFAULT_TRANSITION, EVENTS, IDS, SPHERE_RADIUS, VIEWER_DATA } from './data/constants'; +import { + ANIMATION_MIN_DURATION, + CHANGE_EVENTS, + DEFAULT_TRANSITION, + EVENTS, + IDS, + SPHERE_RADIUS, + VIEWER_DATA +} from './data/constants'; import { SYSTEM } from './data/system'; import errorIcon from './icons/error.svg'; import { AbstractPlugin } from './plugins/AbstractPlugin'; @@ -877,7 +885,7 @@ export class Viewer extends EventEmitter { this.prop.animationPromise = new Animation({ properties: animProperties, - duration : duration, + duration : Math.max(ANIMATION_MIN_DURATION, duration), easing : 'inOutSine', onTick : (properties) => { if (positionProvided) { diff --git a/src/adapters/shared/AbstractVideoAdapter.js b/src/adapters/shared/AbstractVideoAdapter.js index 3cfb1f98e..accf2dbd8 100644 --- a/src/adapters/shared/AbstractVideoAdapter.js +++ b/src/adapters/shared/AbstractVideoAdapter.js @@ -158,7 +158,7 @@ export class AbstractVideoAdapter extends AbstractAdapter { const video = document.createElement('video'); video.crossOrigin = this.psv.config.withCredentials ? 'use-credentials' : 'anonymous'; video.loop = true; - video.playsinline = true; + video.playsInline = true; video.style.display = 'none'; video.muted = this.config.muted; video.src = src; diff --git a/src/data/constants.js b/src/data/constants.js index 87b611a57..105167ecb 100644 --- a/src/data/constants.js +++ b/src/data/constants.js @@ -10,6 +10,14 @@ */ export const DEFAULT_TRANSITION = 1500; +/** + * @summary Minimum duration of the animations created with {@link Viewer#animate} + * @memberOf PSV.constants + * @type {number} + * @constant + */ +export const ANIMATION_MIN_DURATION = 500; + /** * @summary Number of pixels bellow which a mouse move will be considered as a click * @memberOf PSV.constants diff --git a/src/plugins/markers/index.js b/src/plugins/markers/index.js index 60ff20420..ade2350d8 100644 --- a/src/plugins/markers/index.js +++ b/src/plugins/markers/index.js @@ -18,6 +18,7 @@ import './style.scss'; /** * @typedef {Object} PSV.plugins.MarkersPlugin.Options * @property {boolean} [clickEventOnMarker=false] If a `click` event is triggered on the viewer additionally to the `select-marker` event. + * @property {string | number} [gotoMarkerSpeed=8rpm] Default animation speed for `gotoMarker` method * @property {PSV.plugins.MarkersPlugin.Properties[]} [markers] */ @@ -82,6 +83,7 @@ export class MarkersPlugin extends AbstractPlugin { */ this.config = { clickEventOnMarker: false, + gotoMarkerSpeed: '8rpm', ...options, }; @@ -438,7 +440,7 @@ export class MarkersPlugin extends AbstractPlugin { * @fires PSV.plugins.MarkersPlugin.goto-marker-done * @return {PSV.utils.Animation} A promise that will be resolved when the animation finishes */ - gotoMarker(markerId, speed) { + gotoMarker(markerId, speed = this.config.gotoMarkerSpeed) { const marker = this.getMarker(markerId); return this.psv.animate({ @@ -560,7 +562,7 @@ export class MarkersPlugin extends AbstractPlugin { this.trigger(EVENTS.SELECT_MARKER_LIST, marker); - this.gotoMarker(marker, 1000); + this.gotoMarker(marker); this.hideMarkersList(); } }, diff --git a/types/plugins/markers/index.d.ts b/types/plugins/markers/index.d.ts index 7aefa69ed..e0b28005d 100644 --- a/types/plugins/markers/index.d.ts +++ b/types/plugins/markers/index.d.ts @@ -61,6 +61,7 @@ export type SelectMarkerData = { export type MarkersPluginOptions = { clickEventOnMarker?: boolean; + gotoMarkerSpeed?: string | number; markers?: MarkerProperties[]; };