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BkD,EAAelD,gBACjCC,EAAkBiD,EAAejD,gBACjCC,EAAkBgD,EAAehD,gBACjCC,EAAiB+C,EAAe/C,eAChC7K,EAAqB4N,EAAe5N,mBACpC5G,EAAmBwU,EAAexU,iBAClCmS,EAAYqC,EAAerC,UAC3BC,EAAeoC,EAAepC,aAC9BC,GAAamC,EAAenC,WAC5BE,GAAgBiC,EAAejC,cAC/B7e,GAAU8gB,EAAe9gB,QACzBge,GAAe8C,EAAe9C,aAC9B5d,GAAS0gB,EAAe1gB,OACxB2e,GAAyB+B,EAAe/B,uBACxCpS,GAAkBmU,EAAenU,gBACjCC,GAAmBkU,EAAelU,iBAClCoS,GAAsB8B,EAAe9B,oBACrC6E,GAAY/C,EAAe+C,UAC3BC,GAAahD,EAAegD,WAIhCC,EAAQ,GAAUjD,C","sources":["webpack://acura/./node_modules/react-pannellum/dist/index.js"],"sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\nvar PropTypes = require('prop-types');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\nvar PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\n/*eslint-disable*/\nvar libpannellum = (function (window, document, undefined$1) {\n if (!window || !document) return;\n\n function Renderer(container) {\n var canvas = document.createElement(\"canvas\");\n canvas.style.width = canvas.style.height = \"100%\";\n container.appendChild(canvas);\n var program, gl, vs, fs;\n var fallbackImgSize;\n var world;\n var vtmps;\n var pose;\n var image, imageType, dynamic;\n var texCoordBuffer, cubeVertBuf, cubeVertTexCoordBuf, cubeVertIndBuf;\n var globalParams;\n /**\r\n * Initialize renderer.\r\n * @memberof Renderer\r\n * @instance\r\n * @param {Image|Array|Object} image - Input image; format varies based on\r\n * `imageType`. For `equirectangular`, this is an image; for\r\n * `cubemap`, this is an array of images for the cube faces in the\r\n * order [+z, +x, -z, -x, +y, -y]; for `multires`, this is a\r\n * configuration object.\r\n * @param {string} imageType - The type of the image: `equirectangular`,\r\n * `cubemap`, or `multires`.\r\n * @param {boolean} dynamic - Whether or not the image is dynamic (e.g. video).\r\n * @param {number} haov - Initial horizontal angle of view.\r\n * @param {number} vaov - Initial vertical angle of view.\r\n * @param {number} voffset - Initial vertical offset angle.\r\n * @param {function} callback - Load callback function.\r\n * @param {Object} [params] - Other configuration parameters (`horizonPitch`, `horizonRoll`, `backgroundColor`).\r\n */\n\n this.init = function (_image, _imageType, _dynamic, haov, vaov, voffset, callback, params) {\n // Default argument for image type\n if (_imageType === undefined$1) _imageType = \"equirectangular\";\n\n if (_imageType != \"equirectangular\" && _imageType != \"cubemap\" && _imageType != \"multires\") {\n console.log(\"Error: invalid image type specified!\");\n throw {\n type: \"config error\"\n };\n }\n\n imageType = _imageType;\n image = _image;\n dynamic = _dynamic;\n globalParams = params || {}; // Clear old data\n\n if (program) {\n if (vs) {\n gl.detachShader(program, vs);\n gl.deleteShader(vs);\n }\n\n if (fs) {\n gl.detachShader(program, fs);\n gl.deleteShader(fs);\n }\n\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n if (program.texture) gl.deleteTexture(program.texture);\n if (program.nodeCache) for (var i = 0; i < program.nodeCache.length; i++) {\n gl.deleteTexture(program.nodeCache[i].texture);\n }\n gl.deleteProgram(program);\n program = undefined$1;\n }\n\n pose = undefined$1;\n var s;\n var faceMissing = false;\n var cubeImgWidth;\n\n if (imageType == \"cubemap\") {\n for (s = 0; s < 6; s++) {\n if (image[s].width > 0) {\n if (cubeImgWidth === undefined$1) cubeImgWidth = image[s].width;\n if (cubeImgWidth != image[s].width) console.log(\"Cube faces have inconsistent widths: \" + cubeImgWidth + \" vs. \" + image[s].width);\n } else faceMissing = true;\n }\n }\n\n function fillMissingFaces(imgSize) {\n if (faceMissing) {\n // Fill any missing fallback/cubemap faces with background\n var nbytes = imgSize * imgSize * 4; // RGB, plus non-functional alpha\n\n var imageArray = new Uint8ClampedArray(nbytes);\n var rgb = params.backgroundColor ? params.backgroundColor : [0, 0, 0];\n rgb[0] *= 255;\n rgb[1] *= 255;\n rgb[2] *= 255; // Maybe filling could be done faster, see e.g. https://stackoverflow.com/questions/1295584/most-efficient-way-to-create-a-zero-filled-javascript-array\n\n for (var i = 0; i < nbytes; i++) {\n imageArray[i++] = rgb[0];\n imageArray[i++] = rgb[1];\n imageArray[i++] = rgb[2];\n }\n\n var backgroundSquare = new ImageData(imageArray, imgSize, imgSize);\n\n for (s = 0; s < 6; s++) {\n if (image[s].width == 0) image[s] = backgroundSquare;\n }\n }\n } // This awful browser specific test exists because iOS 8/9 and IE 11\n // don't display non-power-of-two cubemap textures but also don't\n // throw an error (tested on an iPhone 5c / iOS 8.1.3 / iOS 9.2 /\n // iOS 10.3.1).\n // Therefore, the WebGL context is never created for these browsers for\n // NPOT cubemaps, and the CSS 3D transform fallback renderer is used\n // instead.\n\n\n if (!(imageType == \"cubemap\" && (cubeImgWidth & cubeImgWidth - 1) !== 0 && (navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/) || navigator.userAgent.match(/Trident.*rv[ :]*11\\./)))) {\n // Enable WebGL on canvas\n if (!gl) gl = canvas.getContext(\"experimental-webgl\", {\n alpha: false,\n depth: false\n });\n if (gl && gl.getError() == 1286) handleWebGLError1286();\n } // If there is no WebGL, fall back to CSS 3D transform renderer.\n // This will discard the image loaded so far and load the fallback image.\n // While browser specific tests are usually frowned upon, the\n // fallback viewer only really works with WebKit/Blink and IE 10/11\n // (it doesn't work properly in Firefox).\n\n\n if (!gl && (imageType == \"multires\" && image.hasOwnProperty(\"fallbackPath\") || imageType == \"cubemap\") && (\"WebkitAppearance\" in document.documentElement.style || navigator.userAgent.match(/Trident.*rv[ :]*11\\./) || navigator.appVersion.indexOf(\"MSIE 10\") !== -1)) {\n // Remove old world if it exists\n if (world) {\n container.removeChild(world);\n } // Initialize renderer\n\n\n world = document.createElement(\"div\");\n world.className = \"pnlm-world\"; // Add images\n\n var path;\n\n if (image.basePath) {\n path = image.basePath + image.fallbackPath;\n } else {\n path = image.fallbackPath;\n }\n\n var sides = [\"f\", \"r\", \"b\", \"l\", \"u\", \"d\"];\n var loaded = 0;\n\n var onLoad = function onLoad() {\n // Draw image on canvas\n var faceCanvas = document.createElement(\"canvas\");\n faceCanvas.className = \"pnlm-face pnlm-\" + sides[this.side] + \"face\";\n world.appendChild(faceCanvas);\n var faceContext = faceCanvas.getContext(\"2d\");\n faceCanvas.style.width = this.width + 4 + \"px\";\n faceCanvas.style.height = this.height + 4 + \"px\";\n faceCanvas.width = this.width + 4;\n faceCanvas.height = this.height + 4;\n faceContext.drawImage(this, 2, 2);\n var imgData = faceContext.getImageData(0, 0, faceCanvas.width, faceCanvas.height);\n var data = imgData.data; // Duplicate edge pixels\n\n var i;\n var j;\n\n for (i = 2; i < faceCanvas.width - 2; i++) {\n for (j = 0; j < 4; j++) {\n data[(i + faceCanvas.width) * 4 + j] = data[(i + faceCanvas.width * 2) * 4 + j];\n data[(i + faceCanvas.width * (faceCanvas.height - 2)) * 4 + j] = data[(i + faceCanvas.width * (faceCanvas.height - 3)) * 4 + j];\n }\n }\n\n for (i = 2; i < faceCanvas.height - 2; i++) {\n for (j = 0; j < 4; j++) {\n data[(i * faceCanvas.width + 1) * 4 + j] = data[(i * faceCanvas.width + 2) * 4 + j];\n data[((i + 1) * faceCanvas.width - 2) * 4 + j] = data[((i + 1) * faceCanvas.width - 3) * 4 + j];\n }\n }\n\n for (j = 0; j < 4; j++) {\n data[(faceCanvas.width + 1) * 4 + j] = data[(faceCanvas.width * 2 + 2) * 4 + j];\n data[(faceCanvas.width * 2 - 2) * 4 + j] = data[(faceCanvas.width * 3 - 3) * 4 + j];\n data[(faceCanvas.width * (faceCanvas.height - 2) + 1) * 4 + j] = data[(faceCanvas.width * (faceCanvas.height - 3) + 2) * 4 + j];\n data[(faceCanvas.width * (faceCanvas.height - 1) - 2) * 4 + j] = data[(faceCanvas.width * (faceCanvas.height - 2) - 3) * 4 + j];\n }\n\n for (i = 1; i < faceCanvas.width - 1; i++) {\n for (j = 0; j < 4; j++) {\n data[i * 4 + j] = data[(i + faceCanvas.width) * 4 + j];\n data[(i + faceCanvas.width * (faceCanvas.height - 1)) * 4 + j] = data[(i + faceCanvas.width * (faceCanvas.height - 2)) * 4 + j];\n }\n }\n\n for (i = 1; i < faceCanvas.height - 1; i++) {\n for (j = 0; j < 4; j++) {\n data[i * faceCanvas.width * 4 + j] = data[(i * faceCanvas.width + 1) * 4 + j];\n data[((i + 1) * faceCanvas.width - 1) * 4 + j] = data[((i + 1) * faceCanvas.width - 2) * 4 + j];\n }\n }\n\n for (j = 0; j < 4; j++) {\n data[j] = data[(faceCanvas.width + 1) * 4 + j];\n data[(faceCanvas.width - 1) * 4 + j] = data[(faceCanvas.width * 2 - 2) * 4 + j];\n data[faceCanvas.width * (faceCanvas.height - 1) * 4 + j] = data[(faceCanvas.width * (faceCanvas.height - 2) + 1) * 4 + j];\n data[(faceCanvas.width * faceCanvas.height - 1) * 4 + j] = data[(faceCanvas.width * (faceCanvas.height - 1) - 2) * 4 + j];\n } // Draw image width duplicated edge pixels on canvas\n\n\n faceContext.putImageData(imgData, 0, 0);\n incLoaded.call(this);\n };\n\n var incLoaded = function incLoaded() {\n if (this.width > 0) {\n if (fallbackImgSize === undefined$1) fallbackImgSize = this.width;\n if (fallbackImgSize != this.width) console.log(\"Fallback faces have inconsistent widths: \" + fallbackImgSize + \" vs. \" + this.width);\n } else faceMissing = true;\n\n loaded++;\n\n if (loaded == 6) {\n fallbackImgSize = this.width;\n container.appendChild(world);\n callback();\n }\n };\n\n faceMissing = false;\n\n for (s = 0; s < 6; s++) {\n var faceImg = new Image();\n faceImg.crossOrigin = globalParams.crossOrigin ? globalParams.crossOrigin : \"anonymous\";\n faceImg.side = s;\n faceImg.onload = onLoad;\n faceImg.onerror = incLoaded; // ignore missing face to support partial fallback image\n\n if (imageType == \"multires\") {\n faceImg.src = path.replace(\"%s\", sides[s]) + \".\" + image.extension;\n } else {\n faceImg.src = image[s].src;\n }\n }\n\n fillMissingFaces(fallbackImgSize);\n return;\n } else if (!gl) {\n console.log(\"Error: no WebGL support detected!\");\n throw {\n type: \"no webgl\"\n };\n }\n\n if (imageType == \"cubemap\") fillMissingFaces(cubeImgWidth);\n\n if (image.basePath) {\n image.fullpath = image.basePath + image.path;\n } else {\n image.fullpath = image.path;\n }\n\n image.invTileResolution = 1 / image.tileResolution;\n var vertices = createCube();\n vtmps = [];\n\n for (s = 0; s < 6; s++) {\n vtmps[s] = vertices.slice(s * 12, s * 12 + 12);\n vertices = createCube();\n } // Make sure image isn't too big\n\n\n var maxWidth = 0;\n\n if (imageType == \"equirectangular\") {\n maxWidth = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n\n if (Math.max(image.width / 2, image.height) > maxWidth) {\n console.log(\"Error: The image is too big; it's \" + image.width + \"px wide, \" + \"but this device's maximum supported size is \" + maxWidth * 2 + \"px.\");\n throw {\n type: \"webgl size error\",\n width: image.width,\n maxWidth: maxWidth * 2\n };\n }\n } else if (imageType == \"cubemap\") {\n if (cubeImgWidth > gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) {\n console.log(\"Error: The image is too big; it's \" + cubeImgWidth + \"px wide, \" + \"but this device's maximum supported size is \" + maxWidth + \"px.\");\n throw {\n type: \"webgl size error\",\n width: cubeImgWidth,\n maxWidth: maxWidth\n };\n }\n } // Store horizon pitch and roll if applicable\n\n\n if (params !== undefined$1 && (params.horizonPitch !== undefined$1 || params.horizonRoll !== undefined$1)) pose = [params.horizonPitch == undefined$1 ? 0 : params.horizonPitch, params.horizonRoll == undefined$1 ? 0 : params.horizonRoll]; // Set 2d texture binding\n\n var glBindType = gl.TEXTURE_2D; // Create viewport for entire canvas\n\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); // Check precision support\n\n if (gl.getShaderPrecisionFormat) {\n var precision = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n\n if (precision && precision.precision < 1) {\n // `highp` precision not supported; https://stackoverflow.com/a/33308927\n fragEquiCubeBase = fragEquiCubeBase.replace(\"highp\", \"mediump\");\n }\n } // Create vertex shader\n\n\n vs = gl.createShader(gl.VERTEX_SHADER);\n var vertexSrc = v;\n\n if (imageType == \"multires\") {\n vertexSrc = vMulti;\n }\n\n gl.shaderSource(vs, vertexSrc);\n gl.compileShader(vs); // Create fragment shader\n\n fs = gl.createShader(gl.FRAGMENT_SHADER);\n var fragmentSrc = fragEquirectangular;\n\n if (imageType == \"cubemap\") {\n glBindType = gl.TEXTURE_CUBE_MAP;\n fragmentSrc = fragCube;\n } else if (imageType == \"multires\") {\n fragmentSrc = fragMulti;\n }\n\n gl.shaderSource(fs, fragmentSrc);\n gl.compileShader(fs); // Link WebGL program\n\n program = gl.createProgram();\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program); // Log errors\n\n if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) console.log(gl.getShaderInfoLog(vs));\n if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) console.log(gl.getShaderInfoLog(fs));\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) console.log(gl.getProgramInfoLog(program)); // Use WebGL program\n\n gl.useProgram(program);\n program.drawInProgress = false; // Set background clear color (does not apply to cubemap/fallback image)\n\n var color = params.backgroundColor ? params.backgroundColor : [0, 0, 0];\n gl.clearColor(color[0], color[1], color[2], 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT); // Look up texture coordinates location\n\n program.texCoordLocation = gl.getAttribLocation(program, \"a_texCoord\");\n gl.enableVertexAttribArray(program.texCoordLocation);\n\n if (imageType != \"multires\") {\n // Provide texture coordinates for rectangle\n if (!texCoordBuffer) texCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW);\n gl.vertexAttribPointer(program.texCoordLocation, 2, gl.FLOAT, false, 0, 0); // Pass aspect ratio\n\n program.aspectRatio = gl.getUniformLocation(program, \"u_aspectRatio\");\n gl.uniform1f(program.aspectRatio, gl.drawingBufferWidth / gl.drawingBufferHeight); // Locate psi, theta, focal length, horizontal extent, vertical extent, and vertical offset\n\n program.psi = gl.getUniformLocation(program, \"u_psi\");\n program.theta = gl.getUniformLocation(program, \"u_theta\");\n program.f = gl.getUniformLocation(program, \"u_f\");\n program.h = gl.getUniformLocation(program, \"u_h\");\n program.v = gl.getUniformLocation(program, \"u_v\");\n program.vo = gl.getUniformLocation(program, \"u_vo\");\n program.rot = gl.getUniformLocation(program, \"u_rot\"); // Pass horizontal extent, vertical extent, and vertical offset\n\n gl.uniform1f(program.h, haov / (Math.PI * 2.0));\n gl.uniform1f(program.v, vaov / Math.PI);\n gl.uniform1f(program.vo, voffset / Math.PI * 2); // Set background color\n\n if (imageType == \"equirectangular\") {\n program.backgroundColor = gl.getUniformLocation(program, \"u_backgroundColor\");\n gl.uniform4fv(program.backgroundColor, color.concat([1]));\n } // Create texture\n\n\n program.texture = gl.createTexture();\n gl.bindTexture(glBindType, program.texture); // Upload images to texture depending on type\n\n if (imageType == \"cubemap\") {\n // Load all six sides of the cube map\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image[1]);\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image[3]);\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image[4]);\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image[5]);\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image[0]);\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image[2]);\n } else {\n if (image.width <= maxWidth) {\n gl.uniform1i(gl.getUniformLocation(program, \"u_splitImage\"), 0); // Upload image to the texture\n\n gl.texImage2D(glBindType, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image);\n } else {\n // Image needs to be split into two parts due to texture size limits\n gl.uniform1i(gl.getUniformLocation(program, \"u_splitImage\"), 1); // Draw image on canvas\n\n var cropCanvas = document.createElement(\"canvas\");\n cropCanvas.width = image.width / 2;\n cropCanvas.height = image.height;\n var cropContext = cropCanvas.getContext(\"2d\");\n cropContext.drawImage(image, 0, 0); // Upload first half of image to the texture\n\n var cropImage = cropContext.getImageData(0, 0, image.width / 2, image.height);\n gl.texImage2D(glBindType, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, cropImage); // Create and bind texture for second half of image\n\n program.texture2 = gl.createTexture();\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(glBindType, program.texture2);\n gl.uniform1i(gl.getUniformLocation(program, \"u_image1\"), 1); // Upload second half of image to the texture\n\n cropContext.drawImage(image, -image.width / 2, 0);\n cropImage = cropContext.getImageData(0, 0, image.width / 2, image.height);\n gl.texImage2D(glBindType, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, cropImage); // Set parameters for rendering any size\n\n gl.texParameteri(glBindType, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(glBindType, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(glBindType, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(glBindType, gl.TEXTURE_MAG_FILTER, gl.LINEAR); // Reactivate first texture unit\n\n gl.activeTexture(gl.TEXTURE0);\n }\n } // Set parameters for rendering any size\n\n\n gl.texParameteri(glBindType, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(glBindType, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(glBindType, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(glBindType, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n } else {\n // Look up vertex coordinates location\n program.vertPosLocation = gl.getAttribLocation(program, \"a_vertCoord\");\n gl.enableVertexAttribArray(program.vertPosLocation); // Create buffers\n\n if (!cubeVertBuf) cubeVertBuf = gl.createBuffer();\n if (!cubeVertTexCoordBuf) cubeVertTexCoordBuf = gl.createBuffer();\n if (!cubeVertIndBuf) cubeVertIndBuf = gl.createBuffer(); // Bind texture coordinate buffer and pass coordinates to WebGL\n\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertTexCoordBuf);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), gl.STATIC_DRAW); // Bind square index buffer and pass indicies to WebGL\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVertIndBuf);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 0, 2, 3]), gl.STATIC_DRAW); // Find uniforms\n\n program.perspUniform = gl.getUniformLocation(program, \"u_perspMatrix\");\n program.cubeUniform = gl.getUniformLocation(program, \"u_cubeMatrix\"); //program.colorUniform = gl.getUniformLocation(program, 'u_color');\n\n program.level = -1;\n program.currentNodes = [];\n program.nodeCache = [];\n program.nodeCacheTimestamp = 0;\n } // Check if there was an error\n\n\n var err = gl.getError();\n\n if (err !== 0) {\n console.log(\"Error: Something went wrong with WebGL!\", err);\n throw {\n type: \"webgl error\"\n };\n }\n\n callback();\n };\n /**\r\n * Destroy renderer.\r\n * @memberof Renderer\r\n * @instance\r\n */\n\n\n this.destroy = function () {\n if (container !== undefined$1) {\n if (canvas !== undefined$1 && container.contains(canvas)) {\n container.removeChild(canvas);\n }\n\n if (world !== undefined$1 && container.contains(world)) {\n container.removeChild(world);\n }\n }\n\n if (gl) {\n // The spec says this is only supposed to simulate losing the WebGL\n // context, but in practice it tends to actually free the memory.\n var extension = gl.getExtension(\"WEBGL_lose_context\");\n if (extension) extension.loseContext();\n }\n };\n /**\r\n * Resize renderer (call after resizing container).\r\n * @memberof Renderer\r\n * @instance\r\n */\n\n\n this.resize = function () {\n var pixelRatio = window.devicePixelRatio || 1;\n canvas.width = canvas.clientWidth * pixelRatio;\n canvas.height = canvas.clientHeight * pixelRatio;\n\n if (gl) {\n if (gl.getError() == 1286) handleWebGLError1286();\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n\n if (imageType != \"multires\") {\n gl.uniform1f(program.aspectRatio, canvas.clientWidth / canvas.clientHeight);\n }\n }\n }; // Initialize canvas size\n\n\n this.resize();\n /**\r\n * Set renderer horizon pitch and roll.\r\n * @memberof Renderer\r\n * @instance\r\n */\n\n this.setPose = function (horizonPitch, horizonRoll) {\n pose = [horizonPitch, horizonRoll];\n };\n /**\r\n * Render new view of panorama.\r\n * @memberof Renderer\r\n * @instance\r\n * @param {number} pitch - Pitch to render at (in radians).\r\n * @param {number} yaw - Yaw to render at (in radians).\r\n * @param {number} hfov - Horizontal field of view to render with (in radians).\r\n * @param {Object} [params] - Extra configuration parameters.\r\n * @param {number} [params.roll] - Camera roll (in radians).\r\n * @param {boolean} [params.returnImage] - Return rendered image?\r\n */\n\n\n this.render = function (pitch, yaw, hfov, params) {\n var focal,\n i,\n s,\n roll = 0;\n if (params === undefined$1) params = {};\n if (params.roll) roll = params.roll; // Apply pitch and roll transformation if applicable\n\n if (pose !== undefined$1) {\n var horizonPitch = pose[0],\n horizonRoll = pose[1]; // Calculate new pitch and yaw\n\n var orig_pitch = pitch,\n orig_yaw = yaw,\n x = Math.cos(horizonRoll) * Math.sin(pitch) * Math.sin(horizonPitch) + Math.cos(pitch) * (Math.cos(horizonPitch) * Math.cos(yaw) + Math.sin(horizonRoll) * Math.sin(horizonPitch) * Math.sin(yaw)),\n y = -Math.sin(pitch) * Math.sin(horizonRoll) + Math.cos(pitch) * Math.cos(horizonRoll) * Math.sin(yaw),\n z = Math.cos(horizonRoll) * Math.cos(horizonPitch) * Math.sin(pitch) + Math.cos(pitch) * (-Math.cos(yaw) * Math.sin(horizonPitch) + Math.cos(horizonPitch) * Math.sin(horizonRoll) * Math.sin(yaw));\n pitch = Math.asin(Math.max(Math.min(z, 1), -1));\n yaw = Math.atan2(y, x); // Calculate roll\n\n var v = [Math.cos(orig_pitch) * (Math.sin(horizonRoll) * Math.sin(horizonPitch) * Math.cos(orig_yaw) - Math.cos(horizonPitch) * Math.sin(orig_yaw)), Math.cos(orig_pitch) * Math.cos(horizonRoll) * Math.cos(orig_yaw), Math.cos(orig_pitch) * (Math.cos(horizonPitch) * Math.sin(horizonRoll) * Math.cos(orig_yaw) + Math.sin(orig_yaw) * Math.sin(horizonPitch))],\n w = [-Math.cos(pitch) * Math.sin(yaw), Math.cos(pitch) * Math.cos(yaw)];\n var roll_adj = Math.acos(Math.max(Math.min((v[0] * w[0] + v[1] * w[1]) / (Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]) * Math.sqrt(w[0] * w[0] + w[1] * w[1])), 1), -1));\n if (v[2] < 0) roll_adj = 2 * Math.PI - roll_adj;\n roll += roll_adj;\n } // If no WebGL\n\n\n if (!gl && (imageType == \"multires\" || imageType == \"cubemap\")) {\n // Determine face transforms\n s = fallbackImgSize / 2;\n var transforms = {\n f: \"translate3d(-\" + (s + 2) + \"px, -\" + (s + 2) + \"px, -\" + s + \"px)\",\n b: \"translate3d(\" + (s + 2) + \"px, -\" + (s + 2) + \"px, \" + s + \"px) rotateX(180deg) rotateZ(180deg)\",\n u: \"translate3d(-\" + (s + 2) + \"px, -\" + s + \"px, \" + (s + 2) + \"px) rotateX(270deg)\",\n d: \"translate3d(-\" + (s + 2) + \"px, \" + s + \"px, -\" + (s + 2) + \"px) rotateX(90deg)\",\n l: \"translate3d(-\" + s + \"px, -\" + (s + 2) + \"px, \" + (s + 2) + \"px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)\",\n r: \"translate3d(\" + s + \"px, -\" + (s + 2) + \"px, -\" + (s + 2) + \"px) rotateY(270deg)\"\n };\n focal = 1 / Math.tan(hfov / 2);\n var zoom = focal * canvas.clientWidth / 2 + \"px\";\n var transform = \"perspective(\" + zoom + \") translateZ(\" + zoom + \") rotateX(\" + pitch + \"rad) rotateY(\" + yaw + \"rad) \"; // Apply face transforms\n\n var faces = Object.keys(transforms);\n\n for (i = 0; i < 6; i++) {\n var face = world.querySelector(\".pnlm-\" + faces[i] + \"face\");\n if (!face) continue; // ignore missing face to support partial cubemap/fallback image\n\n face.style.webkitTransform = transform + transforms[faces[i]];\n face.style.transform = transform + transforms[faces[i]];\n }\n\n return;\n }\n\n if (imageType != \"multires\") {\n // Calculate focal length from vertical field of view\n var vfov = 2 * Math.atan(Math.tan(hfov * 0.5) / (gl.drawingBufferWidth / gl.drawingBufferHeight));\n focal = 1 / Math.tan(vfov * 0.5); // Pass psi, theta, roll, and focal length\n\n gl.uniform1f(program.psi, yaw);\n gl.uniform1f(program.theta, pitch);\n gl.uniform1f(program.rot, roll);\n gl.uniform1f(program.f, focal);\n\n if (dynamic === true) {\n // Update texture if dynamic\n if (imageType == \"equirectangular\") {\n gl.bindTexture(gl.TEXTURE_2D, program.texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image);\n }\n } // Draw using current buffer\n\n\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n } else {\n // Create perspective matrix\n var perspMatrix = makePersp(hfov, gl.drawingBufferWidth / gl.drawingBufferHeight, 0.1, 100.0); // Find correct zoom level\n\n checkZoom(hfov); // Create rotation matrix\n\n var matrix = identityMatrix3();\n matrix = rotateMatrix(matrix, -roll, \"z\");\n matrix = rotateMatrix(matrix, -pitch, \"x\");\n matrix = rotateMatrix(matrix, yaw, \"y\");\n matrix = makeMatrix4(matrix); // Set matrix uniforms\n\n gl.uniformMatrix4fv(program.perspUniform, false, new Float32Array(transposeMatrix4(perspMatrix)));\n gl.uniformMatrix4fv(program.cubeUniform, false, new Float32Array(transposeMatrix4(matrix))); // Find current nodes\n\n var rotPersp = rotatePersp(perspMatrix, matrix);\n program.nodeCache.sort(multiresNodeSort);\n\n if (program.nodeCache.length > 200 && program.nodeCache.length > program.currentNodes.length + 50) {\n // Remove older nodes from cache\n var removed = program.nodeCache.splice(200, program.nodeCache.length - 200);\n\n for (var j = 0; j < removed.length; j++) {\n // Explicitly delete textures\n gl.deleteTexture(removed[j].texture);\n }\n }\n\n program.currentNodes = [];\n var sides = [\"f\", \"b\", \"u\", \"d\", \"l\", \"r\"];\n\n for (s = 0; s < 6; s++) {\n var ntmp = new MultiresNode(vtmps[s], sides[s], 1, 0, 0, image.fullpath);\n testMultiresNode(rotPersp, ntmp, pitch, yaw);\n }\n\n program.currentNodes.sort(multiresNodeRenderSort); // Unqueue any pending requests for nodes that are no longer visible\n\n for (i = pendingTextureRequests.length - 1; i >= 0; i--) {\n if (program.currentNodes.indexOf(pendingTextureRequests[i].node) === -1) {\n pendingTextureRequests[i].node.textureLoad = false;\n pendingTextureRequests.splice(i, 1);\n }\n } // Allow one request to be pending, so that we can create a texture buffer for that in advance of loading actually beginning\n\n\n if (pendingTextureRequests.length === 0) {\n for (i = 0; i < program.currentNodes.length; i++) {\n var node = program.currentNodes[i];\n\n if (!node.texture && !node.textureLoad) {\n node.textureLoad = true;\n setTimeout(processNextTile, 0, node); // Only process one tile per frame to improve responsiveness\n\n break;\n }\n }\n } // Draw tiles\n\n\n multiresDraw();\n }\n\n if (params.returnImage !== undefined$1) {\n return canvas.toDataURL(\"image/png\");\n }\n };\n /**\r\n * Check if images are loading.\r\n * @memberof Renderer\r\n * @instance\r\n * @returns {boolean} Whether or not images are loading.\r\n */\n\n\n this.isLoading = function () {\n if (gl && imageType == \"multires\") {\n for (var i = 0; i < program.currentNodes.length; i++) {\n if (!program.currentNodes[i].textureLoaded) {\n return true;\n }\n }\n }\n\n return false;\n };\n /**\r\n * Retrieve renderer's canvas.\r\n * @memberof Renderer\r\n * @instance\r\n * @returns {HTMLElement} Renderer's canvas.\r\n */\n\n\n this.getCanvas = function () {\n return canvas;\n };\n /**\r\n * Sorting method for multires nodes.\r\n * @private\r\n * @param {MultiresNode} a - First node.\r\n * @param {MultiresNode} b - Second node.\r\n * @returns {number} Base tiles first, then higher timestamp first.\r\n */\n\n\n function multiresNodeSort(a, b) {\n // Base tiles are always first\n if (a.level == 1 && b.level != 1) {\n return -1;\n }\n\n if (b.level == 1 && a.level != 1) {\n return 1;\n } // Higher timestamp first\n\n\n return b.timestamp - a.timestamp;\n }\n /**\r\n * Sorting method for multires node rendering.\r\n * @private\r\n * @param {MultiresNode} a - First node.\r\n * @param {MultiresNode} b - Second node.\r\n * @returns {number} Lower zoom levels first, then closest to center first.\r\n */\n\n\n function multiresNodeRenderSort(a, b) {\n // Lower zoom levels first\n if (a.level != b.level) {\n return a.level - b.level;\n } // Lower distance from center first\n\n\n return a.diff - b.diff;\n }\n /**\r\n * Draws multires nodes.\r\n * @private\r\n */\n\n\n function multiresDraw() {\n if (!program.drawInProgress) {\n program.drawInProgress = true;\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n for (var i = 0; i < program.currentNodes.length; i++) {\n if (program.currentNodes[i].textureLoaded > 1) {\n //var color = program.currentNodes[i].color;\n //gl.uniform4f(program.colorUniform, color[0], color[1], color[2], 1.0);\n // Bind vertex buffer and pass vertices to WebGL\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertBuf);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(program.currentNodes[i].vertices), gl.STATIC_DRAW);\n gl.vertexAttribPointer(program.vertPosLocation, 3, gl.FLOAT, false, 0, 0); // Prep for texture\n\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertTexCoordBuf);\n gl.vertexAttribPointer(program.texCoordLocation, 2, gl.FLOAT, false, 0, 0); // Bind texture and draw tile\n\n gl.bindTexture(gl.TEXTURE_2D, program.currentNodes[i].texture); // Bind program.currentNodes[i].texture to TEXTURE0\n\n gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);\n }\n }\n\n program.drawInProgress = false;\n }\n }\n /**\r\n * Creates new multires node.\r\n * @constructor\r\n * @private\r\n * @param {number[]} vertices - Node's verticies.\r\n * @param {string} side - Node's cube face.\r\n * @param {number} level - Node's zoom level.\r\n * @param {number} x - Node's x position.\r\n * @param {number} y - Node's y position.\r\n * @param {string} path - Node's path.\r\n */\n\n\n function MultiresNode(vertices, side, level, x, y, path) {\n this.vertices = vertices;\n this.side = side;\n this.level = level;\n this.x = x;\n this.y = y;\n this.path = path.replace(\"%s\", side).replace(\"%l\", level).replace(\"%x\", x).replace(\"%y\", y);\n }\n /**\r\n * Test if multires node is visible. If it is, add it to current nodes,\r\n * load its texture, and load appropriate child nodes.\r\n * @private\r\n * @param {number[]} rotPersp - Rotated perspective matrix.\r\n * @param {MultiresNode} node - Multires node to check.\r\n * @param {number} pitch - Pitch to check at.\r\n * @param {number} yaw - Yaw to check at.\r\n * @param {number} hfov - Horizontal field of view to check at.\r\n */\n\n\n function testMultiresNode(rotPersp, node, pitch, yaw, hfov) {\n if (checkSquareInView(rotPersp, node.vertices)) {\n // Calculate central angle between center of view and center of tile\n var v = node.vertices;\n var x = v[0] + v[3] + v[6] + v[9];\n var y = v[1] + v[4] + v[7] + v[10];\n var z = v[2] + v[5] + v[8] + v[11];\n var r = Math.sqrt(x * x + y * y + z * z);\n var theta = Math.asin(z / r);\n var phi = Math.atan2(y, x);\n var ydiff = phi - yaw;\n ydiff += ydiff > Math.PI ? -2 * Math.PI : ydiff < -Math.PI ? 2 * Math.PI : 0;\n ydiff = Math.abs(ydiff);\n node.diff = Math.acos(Math.sin(pitch) * Math.sin(theta) + Math.cos(pitch) * Math.cos(theta) * Math.cos(ydiff)); // Add node to current nodes and load texture if needed\n\n var inCurrent = false;\n\n for (var k = 0; k < program.nodeCache.length; k++) {\n if (program.nodeCache[k].path == node.path) {\n inCurrent = true;\n program.nodeCache[k].timestamp = program.nodeCacheTimestamp++;\n program.nodeCache[k].diff = node.diff;\n program.currentNodes.push(program.nodeCache[k]);\n break;\n }\n }\n\n if (!inCurrent) {\n //node.color = [Math.random(), Math.random(), Math.random()];\n node.timestamp = program.nodeCacheTimestamp++;\n program.currentNodes.push(node);\n program.nodeCache.push(node);\n } // TODO: Test error\n // Create child nodes\n\n\n if (node.level < program.level) {\n var cubeSize = image.cubeResolution * Math.pow(2, node.level - image.maxLevel);\n var numTiles = Math.ceil(cubeSize * image.invTileResolution) - 1;\n var doubleTileSize = cubeSize % image.tileResolution * 2;\n var lastTileSize = cubeSize * 2 % image.tileResolution;\n\n if (lastTileSize === 0) {\n lastTileSize = image.tileResolution;\n }\n\n if (doubleTileSize === 0) {\n doubleTileSize = image.tileResolution * 2;\n }\n\n var f = 0.5;\n\n if (node.x == numTiles || node.y == numTiles) {\n f = 1.0 - image.tileResolution / (image.tileResolution + lastTileSize);\n }\n\n var i = 1.0 - f;\n var children = [];\n var vtmp, ntmp;\n var f1 = f,\n f2 = f,\n f3 = f,\n i1 = i,\n i2 = i,\n i3 = i; // Handle non-symmetric tiles\n\n if (lastTileSize < image.tileResolution) {\n if (node.x == numTiles && node.y != numTiles) {\n f2 = 0.5;\n i2 = 0.5;\n\n if (node.side == \"d\" || node.side == \"u\") {\n f3 = 0.5;\n i3 = 0.5;\n }\n } else if (node.x != numTiles && node.y == numTiles) {\n f1 = 0.5;\n i1 = 0.5;\n\n if (node.side == \"l\" || node.side == \"r\") {\n f3 = 0.5;\n i3 = 0.5;\n }\n }\n } // Handle small tiles that have fewer than four children\n\n\n if (doubleTileSize <= image.tileResolution) {\n if (node.x == numTiles) {\n f1 = 0;\n i1 = 1;\n\n if (node.side == \"l\" || node.side == \"r\") {\n f3 = 0;\n i3 = 1;\n }\n }\n\n if (node.y == numTiles) {\n f2 = 0;\n i2 = 1;\n\n if (node.side == \"d\" || node.side == \"u\") {\n f3 = 0;\n i3 = 1;\n }\n }\n }\n\n vtmp = [v[0], v[1], v[2], v[0] * f1 + v[3] * i1, v[1] * f + v[4] * i, v[2] * f3 + v[5] * i3, v[0] * f1 + v[6] * i1, v[1] * f2 + v[7] * i2, v[2] * f3 + v[8] * i3, v[0] * f + v[9] * i, v[1] * f2 + v[10] * i2, v[2] * f3 + v[11] * i3];\n ntmp = new MultiresNode(vtmp, node.side, node.level + 1, node.x * 2, node.y * 2, image.fullpath);\n children.push(ntmp);\n\n if (!(node.x == numTiles && doubleTileSize <= image.tileResolution)) {\n vtmp = [v[0] * f1 + v[3] * i1, v[1] * f + v[4] * i, v[2] * f3 + v[5] * i3, v[3], v[4], v[5], v[3] * f + v[6] * i, v[4] * f2 + v[7] * i2, v[5] * f3 + v[8] * i3, v[0] * f1 + v[6] * i1, v[1] * f2 + v[7] * i2, v[2] * f3 + v[8] * i3];\n ntmp = new MultiresNode(vtmp, node.side, node.level + 1, node.x * 2 + 1, node.y * 2, image.fullpath);\n children.push(ntmp);\n }\n\n if (!(node.x == numTiles && doubleTileSize <= image.tileResolution) && !(node.y == numTiles && doubleTileSize <= image.tileResolution)) {\n vtmp = [v[0] * f1 + v[6] * i1, v[1] * f2 + v[7] * i2, v[2] * f3 + v[8] * i3, v[3] * f + v[6] * i, v[4] * f2 + v[7] * i2, v[5] * f3 + v[8] * i3, v[6], v[7], v[8], v[9] * f1 + v[6] * i1, v[10] * f + v[7] * i, v[11] * f3 + v[8] * i3];\n ntmp = new MultiresNode(vtmp, node.side, node.level + 1, node.x * 2 + 1, node.y * 2 + 1, image.fullpath);\n children.push(ntmp);\n }\n\n if (!(node.y == numTiles && doubleTileSize <= image.tileResolution)) {\n vtmp = [v[0] * f + v[9] * i, v[1] * f2 + v[10] * i2, v[2] * f3 + v[11] * i3, v[0] * f1 + v[6] * i1, v[1] * f2 + v[7] * i2, v[2] * f3 + v[8] * i3, v[9] * f1 + v[6] * i1, v[10] * f + v[7] * i, v[11] * f3 + v[8] * i3, v[9], v[10], v[11]];\n ntmp = new MultiresNode(vtmp, node.side, node.level + 1, node.x * 2, node.y * 2 + 1, image.fullpath);\n children.push(ntmp);\n }\n\n for (var j = 0; j < children.length; j++) {\n testMultiresNode(rotPersp, children[j], pitch, yaw);\n }\n }\n }\n }\n /**\r\n * Creates cube vertex array.\r\n * @private\r\n * @returns {number[]} Cube vertex array.\r\n */\n\n\n function createCube() {\n return [-1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, // Front face\n 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, // Back face\n -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, // Up face\n -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, // Down face\n -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, // Left face\n 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1 // Right face\n ];\n }\n /**\r\n * Creates 3x3 identity matrix.\r\n * @private\r\n * @returns {number[]} Identity matrix.\r\n */\n\n\n function identityMatrix3() {\n return [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n /**\r\n * Rotates a 3x3 matrix.\r\n * @private\r\n * @param {number[]} m - Matrix to rotate.\r\n * @param {number[]} angle - Angle to rotate by in radians.\r\n * @param {string} axis - Axis to rotate about (`x`, `y`, or `z`).\r\n * @returns {number[]} Rotated matrix.\r\n */\n\n\n function rotateMatrix(m, angle, axis) {\n var s = Math.sin(angle);\n var c = Math.cos(angle);\n\n if (axis == \"x\") {\n return [m[0], c * m[1] + s * m[2], c * m[2] - s * m[1], m[3], c * m[4] + s * m[5], c * m[5] - s * m[4], m[6], c * m[7] + s * m[8], c * m[8] - s * m[7]];\n }\n\n if (axis == \"y\") {\n return [c * m[0] - s * m[2], m[1], c * m[2] + s * m[0], c * m[3] - s * m[5], m[4], c * m[5] + s * m[3], c * m[6] - s * m[8], m[7], c * m[8] + s * m[6]];\n }\n\n if (axis == \"z\") {\n return [c * m[0] + s * m[1], c * m[1] - s * m[0], m[2], c * m[3] + s * m[4], c * m[4] - s * m[3], m[5], c * m[6] + s * m[7], c * m[7] - s * m[6], m[8]];\n }\n }\n /**\r\n * Turns a 3x3 matrix into a 4x4 matrix.\r\n * @private\r\n * @param {number[]} m - Input matrix.\r\n * @returns {number[]} Expanded matrix.\r\n */\n\n\n function makeMatrix4(m) {\n return [m[0], m[1], m[2], 0, m[3], m[4], m[5], 0, m[6], m[7], m[8], 0, 0, 0, 0, 1];\n }\n /**\r\n * Transposes a 4x4 matrix.\r\n * @private\r\n * @param {number[]} m - Input matrix.\r\n * @returns {number[]} Transposed matrix.\r\n */\n\n\n function transposeMatrix4(m) {\n return [m[0], m[4], m[8], m[12], m[1], m[5], m[9], m[13], m[2], m[6], m[10], m[14], m[3], m[7], m[11], m[15]];\n }\n /**\r\n * Creates a perspective matrix.\r\n * @private\r\n * @param {number} hfov - Desired horizontal field of view.\r\n * @param {number} aspect - Desired aspect ratio.\r\n * @param {number} znear - Near distance.\r\n * @param {number} zfar - Far distance.\r\n * @returns {number[]} Generated perspective matrix.\r\n */\n\n\n function makePersp(hfov, aspect, znear, zfar) {\n var fovy = 2 * Math.atan(Math.tan(hfov / 2) * gl.drawingBufferHeight / gl.drawingBufferWidth);\n var f = 1 / Math.tan(fovy / 2);\n return [f / aspect, 0, 0, 0, 0, f, 0, 0, 0, 0, (zfar + znear) / (znear - zfar), 2 * zfar * znear / (znear - zfar), 0, 0, -1, 0];\n }\n /**\r\n * Processes a loaded texture image into a WebGL texture.\r\n * @private\r\n * @param {Image} img - Input image.\r\n * @param {WebGLTexture} tex - Texture to bind image to.\r\n */\n\n\n function processLoadedTexture(img, tex) {\n gl.bindTexture(gl.TEXTURE_2D, tex);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, img);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.bindTexture(gl.TEXTURE_2D, null);\n }\n\n var pendingTextureRequests = []; // Based on http://blog.tojicode.com/2012/03/javascript-memory-optimization-and.html\n\n var loadTexture = function () {\n var cacheTop = 4; // Maximum number of concurrents loads\n\n var textureImageCache = {};\n var crossOrigin;\n\n function TextureImageLoader() {\n var self = this;\n this.texture = this.callback = null;\n this.image = new Image();\n this.image.crossOrigin = crossOrigin ? crossOrigin : \"anonymous\";\n\n var loadFn = function loadFn() {\n if (self.image.width > 0 && self.image.height > 0) {\n // ignore missing tile to supporting partial image\n processLoadedTexture(self.image, self.texture);\n self.callback(self.texture, true);\n } else {\n self.callback(self.texture, false);\n }\n\n releaseTextureImageLoader(self);\n };\n\n this.image.addEventListener(\"load\", loadFn);\n this.image.addEventListener(\"error\", loadFn); // ignore missing tile file to support partial image, otherwise retry loop causes high CPU load\n }\n\n TextureImageLoader.prototype.loadTexture = function (src, texture, callback) {\n this.texture = texture;\n this.callback = callback;\n this.image.src = src;\n };\n\n function PendingTextureRequest(node, src, texture, callback) {\n this.node = node;\n this.src = src;\n this.texture = texture;\n this.callback = callback;\n }\n\n function releaseTextureImageLoader(til) {\n if (pendingTextureRequests.length) {\n var req = pendingTextureRequests.shift();\n til.loadTexture(req.src, req.texture, req.callback);\n } else textureImageCache[cacheTop++] = til;\n }\n\n for (var i = 0; i < cacheTop; i++) {\n textureImageCache[i] = new TextureImageLoader();\n }\n\n return function (node, src, callback, _crossOrigin) {\n crossOrigin = _crossOrigin;\n var texture = gl.createTexture();\n if (cacheTop) textureImageCache[--cacheTop].loadTexture(src, texture, callback);else pendingTextureRequests.push(new PendingTextureRequest(node, src, texture, callback));\n return texture;\n };\n }();\n /**\r\n * Loads image and creates texture for a multires node / tile.\r\n * @private\r\n * @param {MultiresNode} node - Input node.\r\n */\n\n\n function processNextTile(node) {\n loadTexture(node, node.path + \".\" + image.extension, function (texture, loaded) {\n node.texture = texture;\n node.textureLoaded = loaded ? 2 : 1;\n }, globalParams.crossOrigin);\n }\n /**\r\n * Finds and applies optimal multires zoom level.\r\n * @private\r\n * @param {number} hfov - Horizontal field of view to check at.\r\n */\n\n\n function checkZoom(hfov) {\n // Find optimal level\n var newLevel = 1;\n\n while (newLevel < image.maxLevel && gl.drawingBufferWidth > image.tileResolution * Math.pow(2, newLevel - 1) * Math.tan(hfov / 2) * 0.707) {\n newLevel++;\n } // Apply change\n\n\n program.level = newLevel;\n }\n /**\r\n * Rotates perspective matrix.\r\n * @private\r\n * @param {number[]} p - Perspective matrix.\r\n * @param {number[]} r - Rotation matrix.\r\n * @returns {number[]} Rotated matrix.\r\n */\n\n\n function rotatePersp(p, r) {\n return [p[0] * r[0], p[0] * r[1], p[0] * r[2], 0, p[5] * r[4], p[5] * r[5], p[5] * r[6], 0, p[10] * r[8], p[10] * r[9], p[10] * r[10], p[11], -r[8], -r[9], -r[10], 0];\n }\n /**\r\n * Applies rotated perspective matrix to a 3-vector\r\n * (last element is inverted).\r\n * @private\r\n * @param {number[]} m - Rotated perspective matrix.\r\n * @param {number[]} v - Input 3-vector.\r\n * @returns {number[]} Resulting 4-vector.\r\n */\n\n\n function applyRotPerspToVec(m, v) {\n return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[4] * v[0] + m[5] * v[1] + m[6] * v[2], m[11] + m[8] * v[0] + m[9] * v[1] + m[10] * v[2], 1 / (m[12] * v[0] + m[13] * v[1] + m[14] * v[2])];\n }\n /**\r\n * Checks if a vertex is visible.\r\n * @private\r\n * @param {number[]} m - Rotated perspective matrix.\r\n * @param {number[]} v - Input vertex.\r\n * @returns {number} 1 or -1 if the vertex is or is not visible,\r\n * respectively.\r\n */\n\n\n function checkInView(m, v) {\n var vpp = applyRotPerspToVec(m, v);\n var winX = vpp[0] * vpp[3];\n var winY = vpp[1] * vpp[3];\n var winZ = vpp[2] * vpp[3];\n var ret = [0, 0, 0];\n if (winX < -1) ret[0] = -1;\n if (winX > 1) ret[0] = 1;\n if (winY < -1) ret[1] = -1;\n if (winY > 1) ret[1] = 1;\n if (winZ < -1 || winZ > 1) ret[2] = 1;\n return ret;\n }\n /**\r\n * Checks if a square (tile) is visible.\r\n * @private\r\n * @param {number[]} m - Rotated perspective matrix.\r\n * @param {number[]} v - Square's vertex array.\r\n * @returns {boolean} Whether or not the square is visible.\r\n */\n\n\n function checkSquareInView(m, v) {\n var check1 = checkInView(m, v.slice(0, 3));\n var check2 = checkInView(m, v.slice(3, 6));\n var check3 = checkInView(m, v.slice(6, 9));\n var check4 = checkInView(m, v.slice(9, 12));\n var testX = check1[0] + check2[0] + check3[0] + check4[0];\n if (testX == -4 || testX == 4) return false;\n var testY = check1[1] + check2[1] + check3[1] + check4[1];\n if (testY == -4 || testY == 4) return false;\n var testZ = check1[2] + check2[2] + check3[2] + check4[2];\n return testZ != 4;\n }\n /**\r\n * On iOS (iPhone 5c, iOS 10.3), this WebGL error occurs when the canvas is\r\n * too big. Unfortuately, there's no way to test for this beforehand, so we\r\n * reduce the canvas size if this error is thrown.\r\n * @private\r\n */\n\n\n function handleWebGLError1286() {\n console.log(\"Reducing canvas size due to error 1286!\");\n canvas.width = Math.round(canvas.width / 2);\n canvas.height = Math.round(canvas.height / 2);\n }\n } // Vertex shader for equirectangular and cube\n\n\n var v = [\"attribute vec2 a_texCoord;\", \"varying vec2 v_texCoord;\", \"void main() {\", // Set position\n \"gl_Position = vec4(a_texCoord, 0.0, 1.0);\", // Pass the coordinates to the fragment shader\n \"v_texCoord = a_texCoord;\", \"}\"].join(\"\"); // Vertex shader for multires\n\n var vMulti = [\"attribute vec3 a_vertCoord;\", \"attribute vec2 a_texCoord;\", \"uniform mat4 u_cubeMatrix;\", \"uniform mat4 u_perspMatrix;\", \"varying mediump vec2 v_texCoord;\", \"void main(void) {\", // Set position\n \"gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);\", // Pass the coordinates to the fragment shader\n \"v_texCoord = a_texCoord;\", \"}\"].join(\"\"); // Fragment shader\n\n var fragEquiCubeBase = [\"precision highp float;\", // mediump looks bad on some mobile devices\n \"uniform float u_aspectRatio;\", \"uniform float u_psi;\", \"uniform float u_theta;\", \"uniform float u_f;\", \"uniform float u_h;\", \"uniform float u_v;\", \"uniform float u_vo;\", \"uniform float u_rot;\", \"const float PI = 3.14159265358979323846264;\", // Texture\n \"uniform sampler2D u_image0;\", \"uniform sampler2D u_image1;\", \"uniform bool u_splitImage;\", \"uniform samplerCube u_imageCube;\", // Coordinates passed in from vertex shader\n \"varying vec2 v_texCoord;\", // Background color (display for partial panoramas)\n \"uniform vec4 u_backgroundColor;\", \"void main() {\", // Map canvas/camera to sphere\n \"float x = v_texCoord.x * u_aspectRatio;\", \"float y = v_texCoord.y;\", \"float sinrot = sin(u_rot);\", \"float cosrot = cos(u_rot);\", \"float rot_x = x * cosrot - y * sinrot;\", \"float rot_y = x * sinrot + y * cosrot;\", \"float sintheta = sin(u_theta);\", \"float costheta = cos(u_theta);\", \"float a = u_f * costheta - rot_y * sintheta;\", \"float root = sqrt(rot_x * rot_x + a * a);\", \"float lambda = atan(rot_x / root, a / root) + u_psi;\", \"float phi = atan((rot_y * costheta + u_f * sintheta) / root);\"].join(\"\\n\"); // Fragment shader\n\n var fragCube = fragEquiCubeBase + [// Look up color from texture\n \"float cosphi = cos(phi);\", \"gl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));\", \"}\"].join(\"\\n\"); // Fragment shader\n\n var fragEquirectangular = fragEquiCubeBase + [// Wrap image\n \"lambda = mod(lambda + PI, PI * 2.0) - PI;\", // Map texture to sphere\n \"vec2 coord = vec2(lambda / PI, phi / (PI / 2.0));\", // Look up color from texture\n // Map from [-1,1] to [0,1] and flip y-axis\n \"if(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)\", \"gl_FragColor = u_backgroundColor;\", \"else {\", \"if(u_splitImage) {\", // Image was split into two textures to work around texture size limits\n \"if(coord.x < 0.0)\", \"gl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / u_h, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\", \"else\", \"gl_FragColor = texture2D(u_image1, vec2((coord.x + u_h) / u_h - 1.0, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\", \"} else {\", \"gl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));\", \"}\", \"}\", \"}\"].join(\"\\n\"); // Fragment shader\n\n var fragMulti = [\"varying mediump vec2 v_texCoord;\", \"uniform sampler2D u_sampler;\", //'uniform mediump vec4 u_color;',\n \"void main(void) {\", // Look up color from texture\n \"gl_FragColor = texture2D(u_sampler, v_texCoord);\", // 'gl_FragColor = u_color;',\n \"}\"].join(\"\");\n return {\n renderer: function renderer(container, image, imagetype, dynamic) {\n return new Renderer(container, image, imagetype, dynamic);\n }\n };\n})(typeof window === \"undefined\" ? null : window, typeof document === \"undefined\" ? null : document);\n\nvar pannellum = (function (window, document, undefined$1) {\n function Viewer(container, initialConfig) {\n var _this = this; // Declare variables\n\n\n var config,\n renderer,\n preview,\n isUserInteracting = false,\n latestInteraction = Date.now(),\n onPointerDownPointerX = 0,\n onPointerDownPointerY = 0,\n onPointerDownPointerDist = -1,\n onPointerDownYaw = 0,\n onPointerDownPitch = 0,\n keysDown = new Array(10),\n fullscreenActive = false,\n loaded,\n error = false,\n listenersAdded = false,\n panoImage,\n prevTime,\n speed = {\n yaw: 0,\n pitch: 0,\n hfov: 0\n },\n animating = false,\n orientation = false,\n orientationYawOffset = 0,\n autoRotateStart,\n autoRotateSpeed = 0,\n origHfov,\n origPitch,\n animatedMove = {},\n externalEventListeners = {},\n specifiedPhotoSphereExcludes = [],\n update = false,\n // Should we update when still to render dynamic content\n eps = 1e-6,\n hotspotsCreated = false,\n destroyed = false;\n var defaultConfig = {\n hfov: 100,\n minHfov: 50,\n multiResMinHfov: false,\n maxHfov: 120,\n pitch: 0,\n minPitch: -90,\n maxPitch: 90,\n yaw: 0,\n minYaw: -180,\n maxYaw: 180,\n roll: 0,\n haov: 360,\n vaov: 180,\n vOffset: 0,\n autoRotate: false,\n autoRotateInactivityDelay: -1,\n autoRotateStopDelay: 0,\n type: \"equirectangular\",\n northOffset: 0,\n showFullscreenCtrl: true,\n dynamic: false,\n dynamicUpdate: false,\n doubleClickZoom: true,\n keyboardZoom: true,\n mouseZoom: true,\n showZoomCtrl: true,\n autoLoad: false,\n showControls: true,\n orientationOnByDefault: false,\n hotSpotDebug: false,\n backgroundColor: [0, 0, 0],\n avoidShowingBackground: false,\n animationTimingFunction: timingFunction,\n draggable: true,\n disableKeyboardCtrl: false,\n crossOrigin: \"anonymous\",\n touchPanSpeedCoeffFactor: 1,\n capturedKeyNumbers: [16, 17, 27, 37, 38, 39, 40, 61, 65, 68, 83, 87, 107, 109, 173, 187, 189],\n friction: 0.15\n }; // Translatable / configurable strings\n // Some strings contain '%s', which is a placeholder for inserted values\n // When setting strings in external configuration, `\\n` should be used instead of `
` to insert line breaks\n\n defaultConfig.uiText = {\n // Labels\n loadButtonLabel: \"Click to
Load
Panorama\",\n loadingLabel: \"Loading...\",\n bylineLabel: \"by %s\",\n // One substitution: author\n // Errors\n noPanoramaError: \"No panorama image was specified.\",\n fileAccessError: \"The file %s could not be accessed.\",\n // One substitution: file URL\n malformedURLError: \"There is something wrong with the panorama URL.\",\n iOS8WebGLError: \"Due to iOS 8's broken WebGL implementation, only \" + \"progressive encoded JPEGs work for your device (this \" + \"panorama uses standard encoding).\",\n genericWebGLError: \"Your browser does not have the necessary WebGL support to display this panorama.\",\n textureSizeError: \"This panorama is too big for your device! It's \" + \"%spx wide, but your device only supports images up to \" + \"%spx wide. Try another device.\" + \" (If you're the author, try scaling down the image.)\",\n // Two substitutions: image width, max image width\n unknownError: \"Unknown error. Check developer console.\"\n }; // Initialize container\n\n container = typeof container === \"string\" ? document.getElementById(container) : container;\n container.classList.add(\"pnlm-container\");\n container.tabIndex = 0; // Create container for ui\n\n var uiContainer = document.createElement(\"div\");\n uiContainer.className = \"pnlm-ui\";\n container.appendChild(uiContainer); // Create container for renderer\n\n var renderContainer = document.createElement(\"div\");\n renderContainer.className = \"pnlm-render-container\";\n container.appendChild(renderContainer);\n var dragFix = document.createElement(\"div\");\n dragFix.className = \"pnlm-dragfix\";\n uiContainer.appendChild(dragFix); // Display about information on right click\n\n var aboutMsg = document.createElement(\"span\");\n aboutMsg.className = \"pnlm-about-msg\";\n aboutMsg.innerHTML = 'Pannellum';\n uiContainer.appendChild(aboutMsg);\n dragFix.addEventListener(\"contextmenu\", aboutMessage); // Create info display\n\n var infoDisplay = {}; // Hot spot debug indicator\n\n var hotSpotDebugIndicator = document.createElement(\"div\");\n hotSpotDebugIndicator.className = \"pnlm-sprite pnlm-hot-spot-debug-indicator\";\n uiContainer.appendChild(hotSpotDebugIndicator); // Panorama info\n\n infoDisplay.container = document.createElement(\"div\");\n infoDisplay.container.className = \"pnlm-panorama-info\";\n infoDisplay.title = document.createElement(\"div\");\n infoDisplay.title.className = \"pnlm-title-box\";\n infoDisplay.container.appendChild(infoDisplay.title);\n infoDisplay.description = document.createElement(\"div\");\n infoDisplay.description.className = \"pnlm-description-box\";\n infoDisplay.container.appendChild(infoDisplay.description);\n infoDisplay.author = document.createElement(\"div\");\n infoDisplay.author.className = \"pnlm-author-box\";\n infoDisplay.container.appendChild(infoDisplay.author);\n uiContainer.appendChild(infoDisplay.container); // Load box\n\n infoDisplay.load = {};\n infoDisplay.load.box = document.createElement(\"div\");\n infoDisplay.load.box.className = \"pnlm-load-box\";\n infoDisplay.load.boxp = document.createElement(\"p\");\n infoDisplay.load.box.appendChild(infoDisplay.load.boxp);\n infoDisplay.load.lbox = document.createElement(\"div\");\n infoDisplay.load.lbox.className = \"pnlm-lbox\";\n infoDisplay.load.lbox.innerHTML = '
\" + errorMsg + \"
\";\n controls.load.style.display = \"none\";\n infoDisplay.load.box.style.display = \"none\";\n infoDisplay.errorMsg.style.display = \"table\";\n error = true;\n loaded = undefined$1;\n renderContainer.style.display = \"none\";\n fireEvent(\"error\", errorMsg);\n }\n /**\r\n * Hides error message display.\r\n * @private\r\n */\n\n\n function clearError() {\n if (error) {\n infoDisplay.load.box.style.display = \"none\";\n infoDisplay.errorMsg.style.display = \"none\";\n error = false;\n renderContainer.style.display = \"block\";\n fireEvent(\"errorcleared\");\n }\n }\n /**\r\n * Displays about message.\r\n * @private\r\n * @param {MouseEvent} event - Right click location\r\n */\n\n\n function aboutMessage(event) {\n var pos = mousePosition(event);\n aboutMsg.style.left = pos.x + \"px\";\n aboutMsg.style.top = pos.y + \"px\";\n clearTimeout(aboutMessage.t1);\n clearTimeout(aboutMessage.t2);\n aboutMsg.style.display = \"block\";\n aboutMsg.style.opacity = 1;\n aboutMessage.t1 = setTimeout(function () {\n aboutMsg.style.opacity = 0;\n }, 2000);\n aboutMessage.t2 = setTimeout(function () {\n aboutMsg.style.display = \"none\";\n }, 2500);\n event.preventDefault();\n }\n /**\r\n * Calculate mouse position relative to top left of viewer container.\r\n * @private\r\n * @param {MouseEvent} event - Mouse event to use in calculation\r\n * @returns {Object} Calculated X and Y coordinates\r\n */\n\n\n function mousePosition(event) {\n var bounds = container.getBoundingClientRect();\n var pos = {}; // pageX / pageY needed for iOS\n\n pos.x = (event.clientX || event.pageX) - bounds.left;\n pos.y = (event.clientY || event.pageY) - bounds.top;\n return pos;\n }\n /**\r\n * Event handler for mouse clicks. Initializes panning. Prints center and click\r\n * location coordinates when hot spot debugging is enabled.\r\n * @private\r\n * @param {MouseEvent} event - Document mouse down event.\r\n */\n\n\n function onDocumentMouseDown(event) {\n // Override default action\n event.preventDefault(); // But not all of it\n\n container.focus(); // Only do something if the panorama is loaded\n\n if (!loaded || !config.draggable) {\n return;\n } // Calculate mouse position relative to top left of viewer container\n\n\n var pos = mousePosition(event); // Log pitch / yaw of mouse click when debugging / placing hot spots\n\n if (config.hotSpotDebug) {\n var coords = mouseEventToCoords(event);\n console.log(\"Pitch: \" + coords[0] + \", Yaw: \" + coords[1] + \", Center Pitch: \" + config.pitch + \", Center Yaw: \" + config.yaw + \", HFOV: \" + config.hfov);\n } // Turn off auto-rotation if enabled\n\n\n stopAnimation();\n stopOrientation();\n config.roll = 0;\n speed.hfov = 0;\n isUserInteracting = true;\n latestInteraction = Date.now();\n onPointerDownPointerX = pos.x;\n onPointerDownPointerY = pos.y;\n onPointerDownYaw = config.yaw;\n onPointerDownPitch = config.pitch;\n uiContainer.classList.add(\"pnlm-grabbing\");\n uiContainer.classList.remove(\"pnlm-grab\");\n fireEvent(\"mousedown\", event);\n animateInit();\n }\n /**\r\n * Event handler for double clicks. Zooms in at clicked location\r\n * @private\r\n * @param {MouseEvent} event - Document mouse down event.\r\n */\n\n\n function onDocumentDoubleClick(event) {\n if (config.minHfov === config.hfov) {\n _this.setHfov(origHfov, 1000);\n } else {\n var coords = mouseEventToCoords(event);\n\n _this.lookAt(coords[0], coords[1], config.minHfov, 1000);\n }\n }\n /**\r\n * Calculate panorama pitch and yaw from location of mouse event.\r\n * @private\r\n * @param {MouseEvent} event - Document mouse down event.\r\n * @returns {number[]} [pitch, yaw]\r\n */\n\n\n function mouseEventToCoords(event) {\n var pos = mousePosition(event);\n var canvas = renderer.getCanvas();\n var canvasWidth = canvas.clientWidth,\n canvasHeight = canvas.clientHeight;\n var x = pos.x / canvasWidth * 2 - 1;\n var y = (1 - pos.y / canvasHeight * 2) * canvasHeight / canvasWidth;\n var focal = 1 / Math.tan(config.hfov * Math.PI / 360);\n var s = Math.sin(config.pitch * Math.PI / 180);\n var c = Math.cos(config.pitch * Math.PI / 180);\n var a = focal * c - y * s;\n var root = Math.sqrt(x * x + a * a);\n var pitch = Math.atan((y * c + focal * s) / root) * 180 / Math.PI;\n var yaw = Math.atan2(x / root, a / root) * 180 / Math.PI + config.yaw;\n if (yaw < -180) yaw += 360;\n if (yaw > 180) yaw -= 360;\n return [pitch, yaw];\n }\n /**\r\n * Event handler for mouse moves. Pans center of view.\r\n * @private\r\n * @param {MouseEvent} event - Document mouse move event.\r\n */\n\n\n function onDocumentMouseMove(event) {\n if (isUserInteracting && loaded) {\n latestInteraction = Date.now();\n var canvas = renderer.getCanvas();\n var canvasWidth = canvas.clientWidth,\n canvasHeight = canvas.clientHeight;\n var pos = mousePosition(event); //TODO: This still isn't quite right\n\n var yaw = (Math.atan(onPointerDownPointerX / canvasWidth * 2 - 1) - Math.atan(pos.x / canvasWidth * 2 - 1)) * 180 / Math.PI * config.hfov / 90 + onPointerDownYaw;\n speed.yaw = (yaw - config.yaw) % 360 * 0.2;\n config.yaw = yaw;\n var vfov = 2 * Math.atan(Math.tan(config.hfov / 360 * Math.PI) * canvasHeight / canvasWidth) * 180 / Math.PI;\n var pitch = (Math.atan(pos.y / canvasHeight * 2 - 1) - Math.atan(onPointerDownPointerY / canvasHeight * 2 - 1)) * 180 / Math.PI * vfov / 90 + onPointerDownPitch;\n speed.pitch = (pitch - config.pitch) * 0.2;\n config.pitch = pitch;\n }\n }\n /**\r\n * Event handler for mouse up events. Stops panning.\r\n * @private\r\n */\n\n\n function onDocumentMouseUp(event) {\n if (!isUserInteracting) {\n return;\n }\n\n isUserInteracting = false;\n\n if (Date.now() - latestInteraction > 15) {\n // Prevents jump when user rapidly moves mouse, stops, and then\n // releases the mouse button\n speed.pitch = speed.yaw = 0;\n }\n\n uiContainer.classList.add(\"pnlm-grab\");\n uiContainer.classList.remove(\"pnlm-grabbing\");\n latestInteraction = Date.now();\n fireEvent(\"mouseup\", event);\n }\n /**\r\n * Event handler for touches. Initializes panning if one touch or zooming if\r\n * two touches.\r\n * @private\r\n * @param {TouchEvent} event - Document touch start event.\r\n */\n\n\n function onDocumentTouchStart(event) {\n // Only do something if the panorama is loaded\n if (!loaded || !config.draggable) {\n return;\n } // Turn off auto-rotation if enabled\n\n\n stopAnimation();\n stopOrientation();\n config.roll = 0;\n speed.hfov = 0; // Calculate touch position relative to top left of viewer container\n\n var pos0 = mousePosition(event.targetTouches[0]);\n onPointerDownPointerX = pos0.x;\n onPointerDownPointerY = pos0.y;\n\n if (event.targetTouches.length === 2) {\n // Down pointer is the center of the two fingers\n var pos1 = mousePosition(event.targetTouches[1]);\n onPointerDownPointerX += (pos1.x - pos0.x) * 0.5;\n onPointerDownPointerY += (pos1.y - pos0.y) * 0.5;\n onPointerDownPointerDist = Math.sqrt((pos0.x - pos1.x) * (pos0.x - pos1.x) + (pos0.y - pos1.y) * (pos0.y - pos1.y));\n }\n\n isUserInteracting = true;\n latestInteraction = Date.now();\n onPointerDownYaw = config.yaw;\n onPointerDownPitch = config.pitch;\n fireEvent(\"touchstart\", event);\n animateInit();\n }\n /**\r\n * Event handler for touch movements. Pans center of view if one touch or\r\n * adjusts zoom if two touches.\r\n * @private\r\n * @param {TouchEvent} event - Document touch move event.\r\n */\n\n\n function onDocumentTouchMove(event) {\n if (!config.draggable) {\n return;\n } // Override default action\n\n\n event.preventDefault();\n\n if (loaded) {\n latestInteraction = Date.now();\n }\n\n if (isUserInteracting && loaded) {\n var pos0 = mousePosition(event.targetTouches[0]);\n var clientX = pos0.x;\n var clientY = pos0.y;\n\n if (event.targetTouches.length === 2 && onPointerDownPointerDist != -1) {\n var pos1 = mousePosition(event.targetTouches[1]);\n clientX += (pos1.x - pos0.x) * 0.5;\n clientY += (pos1.y - pos0.y) * 0.5;\n var clientDist = Math.sqrt((pos0.x - pos1.x) * (pos0.x - pos1.x) + (pos0.y - pos1.y) * (pos0.y - pos1.y));\n setHfov(config.hfov + (onPointerDownPointerDist - clientDist) * 0.1);\n onPointerDownPointerDist = clientDist;\n } // The smaller the config.hfov value (the more zoomed-in the user is), the faster\n // yaw/pitch are perceived to change on one-finger touchmove (panning) events and vice versa.\n // To improve usability at both small and large zoom levels (config.hfov values)\n // we introduce a dynamic pan speed coefficient.\n //\n // Currently this seems to *roughly* keep initial drag/pan start position close to\n // the user's finger while panning regardless of zoom level / config.hfov value.\n\n\n var touchmovePanSpeedCoeff = config.hfov / 360 * config.touchPanSpeedCoeffFactor;\n var yaw = (onPointerDownPointerX - clientX) * touchmovePanSpeedCoeff + onPointerDownYaw;\n speed.yaw = (yaw - config.yaw) % 360 * 0.2;\n config.yaw = yaw;\n var pitch = (clientY - onPointerDownPointerY) * touchmovePanSpeedCoeff + onPointerDownPitch;\n speed.pitch = (pitch - config.pitch) * 0.2;\n config.pitch = pitch;\n }\n }\n /**\r\n * Event handler for end of touches. Stops panning and/or zooming.\r\n * @private\r\n */\n\n\n function onDocumentTouchEnd() {\n isUserInteracting = false;\n\n if (Date.now() - latestInteraction > 150) {\n speed.pitch = speed.yaw = 0;\n }\n\n onPointerDownPointerDist = -1;\n latestInteraction = Date.now();\n fireEvent(\"touchend\", event);\n }\n\n var pointerIDs = [],\n pointerCoordinates = [];\n /**\r\n * Event handler for touch starts in IE / Edge.\r\n * @private\r\n * @param {PointerEvent} event - Document pointer down event.\r\n */\n\n function onDocumentPointerDown(event) {\n if (event.pointerType === \"touch\") {\n // Only do something if the panorama is loaded\n if (!loaded || !config.draggable) return;\n pointerIDs.push(event.pointerId);\n pointerCoordinates.push({\n clientX: event.clientX,\n clientY: event.clientY\n });\n event.targetTouches = pointerCoordinates;\n onDocumentTouchStart(event);\n event.preventDefault();\n }\n }\n /**\r\n * Event handler for touch moves in IE / Edge.\r\n * @private\r\n * @param {PointerEvent} event - Document pointer move event.\r\n */\n\n\n function onDocumentPointerMove(event) {\n if (event.pointerType === \"touch\") {\n if (!config.draggable) return;\n\n for (var i = 0; i < pointerIDs.length; i++) {\n if (event.pointerId === pointerIDs[i]) {\n pointerCoordinates[i].clientX = event.clientX;\n pointerCoordinates[i].clientY = event.clientY;\n event.targetTouches = pointerCoordinates;\n onDocumentTouchMove(event);\n event.preventDefault();\n return;\n }\n }\n }\n }\n /**\r\n * Event handler for touch ends in IE / Edge.\r\n * @private\r\n * @param {PointerEvent} event - Document pointer up event.\r\n */\n\n\n function onDocumentPointerUp(event) {\n if (event.pointerType === \"touch\") {\n var defined = false;\n\n for (var i = 0; i < pointerIDs.length; i++) {\n if (event.pointerId === pointerIDs[i]) pointerIDs[i] = undefined$1;\n if (pointerIDs[i]) defined = true;\n }\n\n if (!defined) {\n pointerIDs = [];\n pointerCoordinates = [];\n onDocumentTouchEnd();\n }\n\n event.preventDefault();\n }\n }\n /**\r\n * Event handler for mouse wheel. Changes zoom.\r\n * @private\r\n * @param {WheelEvent} event - Document mouse wheel event.\r\n */\n\n\n function onDocumentMouseWheel(event) {\n // Only do something if the panorama is loaded and mouse wheel zoom is enabled\n if (!loaded || config.mouseZoom === \"fullscreenonly\" && !fullscreenActive) {\n return;\n }\n\n event.preventDefault(); // Turn off auto-rotation if enabled\n\n stopAnimation();\n latestInteraction = Date.now();\n\n if (event.wheelDeltaY) {\n // WebKit\n setHfov(config.hfov - event.wheelDeltaY * 0.05);\n speed.hfov = event.wheelDelta < 0 ? 1 : -1;\n } else if (event.wheelDelta) {\n // Opera / Explorer 9\n setHfov(config.hfov - event.wheelDelta * 0.05);\n speed.hfov = event.wheelDelta < 0 ? 1 : -1;\n } else if (event.detail) {\n // Firefox\n setHfov(config.hfov + event.detail * 1.5);\n speed.hfov = event.detail > 0 ? 1 : -1;\n }\n\n animateInit();\n }\n /**\r\n * Event handler for key presses. Updates list of currently pressed keys.\r\n * @private\r\n * @param {KeyboardEvent} event - Document key press event.\r\n */\n\n\n function onDocumentKeyPress(event) {\n // Turn off auto-rotation if enabled\n stopAnimation();\n latestInteraction = Date.now();\n stopOrientation();\n config.roll = 0; // Record key pressed\n\n var keynumber = event.which || event.keycode; // Override default action for keys that are used\n\n if (config.capturedKeyNumbers.indexOf(keynumber) < 0) return;\n event.preventDefault(); // If escape key is pressed\n\n if (keynumber === 27) {\n // If in fullscreen mode\n if (fullscreenActive) {\n toggleFullscreen();\n }\n } else {\n // Change key\n changeKey(keynumber, true);\n }\n }\n /**\r\n * Clears list of currently pressed keys.\r\n * @private\r\n */\n\n\n function clearKeys() {\n for (var i = 0; i < 10; i++) {\n keysDown[i] = false;\n }\n }\n /**\r\n * Event handler for key releases. Updates list of currently pressed keys.\r\n * @private\r\n * @param {KeyboardEvent} event - Document key up event.\r\n */\n\n\n function onDocumentKeyUp(event) {\n // Record key pressed\n var keynumber = event.which || event.keycode; // Override default action for keys that are used\n\n if (config.capturedKeyNumbers.indexOf(keynumber) < 0) return;\n event.preventDefault(); // Change key\n\n changeKey(keynumber, false);\n }\n /**\r\n * Updates list of currently pressed keys.\r\n * @private\r\n * @param {number} keynumber - Key number.\r\n * @param {boolean} value - Whether or not key is pressed.\r\n */\n\n\n function changeKey(keynumber, value) {\n var keyChanged = false;\n\n switch (keynumber) {\n // If minus key is released\n case 109:\n case 189:\n case 17:\n case 173:\n if (keysDown[0] != value) {\n keyChanged = true;\n }\n\n keysDown[0] = value;\n break;\n // If plus key is released\n\n case 107:\n case 187:\n case 16:\n case 61:\n if (keysDown[1] != value) {\n keyChanged = true;\n }\n\n keysDown[1] = value;\n break;\n // If up arrow is released\n\n case 38:\n if (keysDown[2] != value) {\n keyChanged = true;\n }\n\n keysDown[2] = value;\n break;\n // If \"w\" is released\n\n case 87:\n if (keysDown[6] != value) {\n keyChanged = true;\n }\n\n keysDown[6] = value;\n break;\n // If down arrow is released\n\n case 40:\n if (keysDown[3] != value) {\n keyChanged = true;\n }\n\n keysDown[3] = value;\n break;\n // If \"s\" is released\n\n case 83:\n if (keysDown[7] != value) {\n keyChanged = true;\n }\n\n keysDown[7] = value;\n break;\n // If left arrow is released\n\n case 37:\n if (keysDown[4] != value) {\n keyChanged = true;\n }\n\n keysDown[4] = value;\n break;\n // If \"a\" is released\n\n case 65:\n if (keysDown[8] != value) {\n keyChanged = true;\n }\n\n keysDown[8] = value;\n break;\n // If right arrow is released\n\n case 39:\n if (keysDown[5] != value) {\n keyChanged = true;\n }\n\n keysDown[5] = value;\n break;\n // If \"d\" is released\n\n case 68:\n if (keysDown[9] != value) {\n keyChanged = true;\n }\n\n keysDown[9] = value;\n }\n\n if (keyChanged && value) {\n if (typeof performance !== \"undefined\" && performance.now()) {\n prevTime = performance.now();\n } else {\n prevTime = Date.now();\n }\n\n animateInit();\n }\n }\n /**\r\n * Pans and/or zooms panorama based on currently pressed keys. Also handles\r\n * panorama \"inertia\" and auto rotation.\r\n * @private\r\n */\n\n\n function keyRepeat() {\n // Only do something if the panorama is loaded\n if (!loaded) {\n return;\n }\n\n var isKeyDown = false;\n var prevPitch = config.pitch;\n var prevYaw = config.yaw;\n var prevZoom = config.hfov;\n var newTime;\n\n if (typeof performance !== \"undefined\" && performance.now()) {\n newTime = performance.now();\n } else {\n newTime = Date.now();\n }\n\n if (prevTime === undefined$1) {\n prevTime = newTime;\n }\n\n var diff = (newTime - prevTime) * config.hfov / 1700;\n diff = Math.min(diff, 1.0); // If minus key is down\n\n if (keysDown[0] && config.keyboardZoom === true) {\n setHfov(config.hfov + (speed.hfov * 0.8 + 0.5) * diff);\n isKeyDown = true;\n } // If plus key is down\n\n\n if (keysDown[1] && config.keyboardZoom === true) {\n setHfov(config.hfov + (speed.hfov * 0.8 - 0.2) * diff);\n isKeyDown = true;\n } // If up arrow or \"w\" is down\n\n\n if (keysDown[2] || keysDown[6]) {\n // Pan up\n config.pitch += (speed.pitch * 0.8 + 0.2) * diff;\n isKeyDown = true;\n } // If down arrow or \"s\" is down\n\n\n if (keysDown[3] || keysDown[7]) {\n // Pan down\n config.pitch += (speed.pitch * 0.8 - 0.2) * diff;\n isKeyDown = true;\n } // If left arrow or \"a\" is down\n\n\n if (keysDown[4] || keysDown[8]) {\n // Pan left\n config.yaw += (speed.yaw * 0.8 - 0.2) * diff;\n isKeyDown = true;\n } // If right arrow or \"d\" is down\n\n\n if (keysDown[5] || keysDown[9]) {\n // Pan right\n config.yaw += (speed.yaw * 0.8 + 0.2) * diff;\n isKeyDown = true;\n }\n\n if (isKeyDown) latestInteraction = Date.now(); // If auto-rotate\n\n if (config.autoRotate) {\n // Pan\n if (newTime - prevTime > 0.001) {\n var timeDiff = (newTime - prevTime) / 1000;\n var yawDiff = (speed.yaw / timeDiff * diff - config.autoRotate * 0.2) * timeDiff;\n yawDiff = (-config.autoRotate > 0 ? 1 : -1) * Math.min(Math.abs(config.autoRotate * timeDiff), Math.abs(yawDiff));\n config.yaw += yawDiff;\n } // Deal with stopping auto rotation after a set delay\n\n\n if (config.autoRotateStopDelay) {\n config.autoRotateStopDelay -= newTime - prevTime;\n\n if (config.autoRotateStopDelay <= 0) {\n config.autoRotateStopDelay = false;\n autoRotateSpeed = config.autoRotate;\n config.autoRotate = 0;\n }\n }\n } // Animated moves\n\n\n if (animatedMove.pitch) {\n animateMove(\"pitch\");\n prevPitch = config.pitch;\n }\n\n if (animatedMove.yaw) {\n animateMove(\"yaw\");\n prevYaw = config.yaw;\n }\n\n if (animatedMove.hfov) {\n animateMove(\"hfov\");\n prevZoom = config.hfov;\n } // \"Inertia\"\n\n\n if (diff > 0 && !config.autoRotate) {\n // \"Friction\"\n var slowDownFactor = 1 - config.friction; // Yaw\n\n if (!keysDown[4] && !keysDown[5] && !keysDown[8] && !keysDown[9] && !animatedMove.yaw) {\n config.yaw += speed.yaw * diff * slowDownFactor;\n } // Pitch\n\n\n if (!keysDown[2] && !keysDown[3] && !keysDown[6] && !keysDown[7] && !animatedMove.pitch) {\n config.pitch += speed.pitch * diff * slowDownFactor;\n } // Zoom\n\n\n if (!keysDown[0] && !keysDown[1] && !animatedMove.hfov) {\n setHfov(config.hfov + speed.hfov * diff * slowDownFactor);\n }\n }\n\n prevTime = newTime;\n\n if (diff > 0) {\n speed.yaw = speed.yaw * 0.8 + (config.yaw - prevYaw) / diff * 0.2;\n speed.pitch = speed.pitch * 0.8 + (config.pitch - prevPitch) / diff * 0.2;\n speed.hfov = speed.hfov * 0.8 + (config.hfov - prevZoom) / diff * 0.2; // Limit speed\n\n var maxSpeed = config.autoRotate ? Math.abs(config.autoRotate) : 5;\n speed.yaw = Math.min(maxSpeed, Math.max(speed.yaw, -maxSpeed));\n speed.pitch = Math.min(maxSpeed, Math.max(speed.pitch, -maxSpeed));\n speed.hfov = Math.min(maxSpeed, Math.max(speed.hfov, -maxSpeed));\n } // Stop movement if opposite controls are pressed\n\n\n if (keysDown[0] && keysDown[1]) {\n speed.hfov = 0;\n }\n\n if ((keysDown[2] || keysDown[6]) && (keysDown[3] || keysDown[7])) {\n speed.pitch = 0;\n }\n\n if ((keysDown[4] || keysDown[8]) && (keysDown[5] || keysDown[9])) {\n speed.yaw = 0;\n }\n }\n /**\r\n * Animates moves.\r\n * @param {string} axis - Axis to animate\r\n * @private\r\n */\n\n\n function animateMove(axis) {\n var t = animatedMove[axis];\n var normTime = Math.min(1, Math.max((Date.now() - t.startTime) / 1000 / (t.duration / 1000), 0));\n var result = t.startPosition + config.animationTimingFunction(normTime) * (t.endPosition - t.startPosition);\n\n if (t.endPosition > t.startPosition && result >= t.endPosition || t.endPosition < t.startPosition && result <= t.endPosition || t.endPosition === t.startPosition) {\n result = t.endPosition;\n speed[axis] = 0;\n delete animatedMove[axis];\n }\n\n config[axis] = result;\n }\n /**\r\n * @param {number} t - Normalized time in animation\r\n * @return {number} Position in animation\r\n * @private\r\n */\n\n\n function timingFunction(t) {\n // easeInOutQuad from https://gist.github.com/gre/1650294\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n }\n /**\r\n * Event handler for document resizes. Updates viewer size and rerenders view.\r\n * @private\r\n */\n\n\n function onDocumentResize() {\n // Resize panorama renderer (moved to onFullScreenChange)\n //renderer.resize();\n //animateInit();\n // Kludge to deal with WebKit regression: https://bugs.webkit.org/show_bug.cgi?id=93525\n onFullScreenChange(\"resize\");\n }\n /**\r\n * Initializes animation.\r\n * @private\r\n */\n\n\n function animateInit() {\n if (animating) {\n return;\n }\n\n animating = true;\n animate();\n }\n /**\r\n * Animates view, using requestAnimationFrame to trigger rendering.\r\n * @private\r\n */\n\n\n function animate() {\n if (destroyed) {\n return;\n }\n\n render();\n if (autoRotateStart) clearTimeout(autoRotateStart);\n\n if (isUserInteracting || orientation === true) {\n requestAnimationFrame(animate);\n } else if (keysDown[0] || keysDown[1] || keysDown[2] || keysDown[3] || keysDown[4] || keysDown[5] || keysDown[6] || keysDown[7] || keysDown[8] || keysDown[9] || config.autoRotate || animatedMove.pitch || animatedMove.yaw || animatedMove.hfov || Math.abs(speed.yaw) > 0.01 || Math.abs(speed.pitch) > 0.01 || Math.abs(speed.hfov) > 0.01) {\n keyRepeat();\n\n if (config.autoRotateInactivityDelay >= 0 && autoRotateSpeed && Date.now() - latestInteraction > config.autoRotateInactivityDelay && !config.autoRotate) {\n config.autoRotate = autoRotateSpeed;\n\n _this.lookAt(origPitch, undefined$1, origHfov, 3000);\n }\n\n requestAnimationFrame(animate);\n } else if (renderer && (renderer.isLoading() || config.dynamic === true && update)) {\n requestAnimationFrame(animate);\n } else {\n fireEvent(\"animatefinished\", {\n pitch: _this.getPitch(),\n yaw: _this.getYaw(),\n hfov: _this.getHfov()\n });\n animating = false;\n prevTime = undefined$1;\n var autoRotateStartTime = config.autoRotateInactivityDelay - (Date.now() - latestInteraction);\n\n if (autoRotateStartTime > 0) {\n autoRotateStart = setTimeout(function () {\n config.autoRotate = autoRotateSpeed;\n\n _this.lookAt(origPitch, undefined$1, origHfov, 3000);\n\n animateInit();\n }, autoRotateStartTime);\n } else if (config.autoRotateInactivityDelay >= 0 && autoRotateSpeed) {\n config.autoRotate = autoRotateSpeed;\n\n _this.lookAt(origPitch, undefined$1, origHfov, 3000);\n\n animateInit();\n }\n }\n }\n /**\r\n * Renders panorama view.\r\n * @private\r\n */\n\n\n function render() {\n var tmpyaw;\n\n if (loaded) {\n var canvas = renderer.getCanvas();\n\n if (config.autoRotate !== false) {\n // When auto-rotating this check needs to happen first (see issue #764)\n if (config.yaw > 180) {\n config.yaw -= 360;\n } else if (config.yaw < -180) {\n config.yaw += 360;\n }\n } // Keep a tmp value of yaw for autoRotate comparison later\n\n\n tmpyaw = config.yaw; // Optionally avoid showing background (empty space) on left or right by adapting min/max yaw\n\n var hoffcut = 0;\n\n if (config.avoidShowingBackground) {\n var hfov2 = config.hfov / 2,\n vfov2 = Math.atan2(Math.tan(hfov2 / 180 * Math.PI), canvas.width / canvas.height) * 180 / Math.PI,\n transposed = config.vaov > config.haov;\n\n if (!transposed) {\n hoffcut = hfov2 * (1 - Math.min(Math.cos((config.pitch - vfov2) / 180 * Math.PI), Math.cos((config.pitch + vfov2) / 180 * Math.PI)));\n }\n } // Ensure the yaw is within min and max allowed\n\n\n var yawRange = config.maxYaw - config.minYaw,\n minYaw = -180,\n maxYaw = 180;\n\n if (yawRange < 360) {\n minYaw = config.minYaw + config.hfov / 2 + hoffcut;\n maxYaw = config.maxYaw - config.hfov / 2 - hoffcut;\n\n if (yawRange < config.hfov) {\n // Lock yaw to average of min and max yaw when both can be seen at once\n minYaw = maxYaw = (minYaw + maxYaw) / 2;\n }\n\n config.yaw = Math.max(minYaw, Math.min(maxYaw, config.yaw));\n }\n\n if (!(config.autoRotate !== false)) {\n // When not auto-rotating, this check needs to happen after the\n // previous check (see issue #698)\n if (config.yaw > 180) {\n config.yaw -= 360;\n } else if (config.yaw < -180) {\n config.yaw += 360;\n }\n } // Check if we autoRotate in a limited by min and max yaw\n // If so reverse direction\n\n\n if (config.autoRotate !== false && tmpyaw != config.yaw && prevTime !== undefined$1) {\n // this condition prevents changing the direction initially\n config.autoRotate *= -1;\n } // Ensure the calculated pitch is within min and max allowed\n\n\n var vfov = 2 * Math.atan(Math.tan(config.hfov / 180 * Math.PI * 0.5) / (canvas.width / canvas.height)) / Math.PI * 180;\n var minPitch = config.minPitch + vfov / 2,\n maxPitch = config.maxPitch - vfov / 2;\n var pitchRange = config.maxPitch - config.minPitch;\n\n if (pitchRange < vfov) {\n // Lock pitch to average of min and max pitch when both can be seen at once\n minPitch = maxPitch = (minPitch + maxPitch) / 2;\n }\n\n if (isNaN(minPitch)) minPitch = -90;\n if (isNaN(maxPitch)) maxPitch = 90;\n config.pitch = Math.max(minPitch, Math.min(maxPitch, config.pitch));\n renderer.render(config.pitch * Math.PI / 180, config.yaw * Math.PI / 180, config.hfov * Math.PI / 180, {\n roll: config.roll * Math.PI / 180\n });\n renderHotSpots(); // Update compass\n\n if (config.compass) {\n compass.style.transform = \"rotate(\" + (-config.yaw - config.northOffset) + \"deg)\";\n compass.style.webkitTransform = \"rotate(\" + (-config.yaw - config.northOffset) + \"deg)\";\n }\n }\n }\n /**\r\n * Creates a new quaternion.\r\n * @private\r\n * @constructor\r\n * @param {Number} w - W value\r\n * @param {Number} x - X value\r\n * @param {Number} y - Y value\r\n * @param {Number} z - Z value\r\n */\n\n\n function Quaternion(w, x, y, z) {\n this.w = w;\n this.x = x;\n this.y = y;\n this.z = z;\n }\n /**\r\n * Multiplies quaternions.\r\n * @private\r\n * @param {Quaternion} q - Quaternion to multiply\r\n * @returns {Quaternion} Result of multiplication\r\n */\n\n\n Quaternion.prototype.multiply = function (q) {\n return new Quaternion(this.w * q.w - this.x * q.x - this.y * q.y - this.z * q.z, this.x * q.w + this.w * q.x + this.y * q.z - this.z * q.y, this.y * q.w + this.w * q.y + this.z * q.x - this.x * q.z, this.z * q.w + this.w * q.z + this.x * q.y - this.y * q.x);\n };\n /**\r\n * Converts quaternion to Euler angles.\r\n * @private\r\n * @returns {Number[]} [phi angle, theta angle, psi angle]\r\n */\n\n\n Quaternion.prototype.toEulerAngles = function () {\n var phi = Math.atan2(2 * (this.w * this.x + this.y * this.z), 1 - 2 * (this.x * this.x + this.y * this.y)),\n theta = Math.asin(2 * (this.w * this.y - this.z * this.x)),\n psi = Math.atan2(2 * (this.w * this.z + this.x * this.y), 1 - 2 * (this.y * this.y + this.z * this.z));\n return [phi, theta, psi];\n };\n /**\r\n * Converts device orientation API Tait-Bryan angles to a quaternion.\r\n * @private\r\n * @param {Number} alpha - Alpha angle (in degrees)\r\n * @param {Number} beta - Beta angle (in degrees)\r\n * @param {Number} gamma - Gamma angle (in degrees)\r\n * @returns {Quaternion} Orientation quaternion\r\n */\n\n\n function taitBryanToQuaternion(alpha, beta, gamma) {\n var r = [beta ? beta * Math.PI / 180 / 2 : 0, gamma ? gamma * Math.PI / 180 / 2 : 0, alpha ? alpha * Math.PI / 180 / 2 : 0];\n var c = [Math.cos(r[0]), Math.cos(r[1]), Math.cos(r[2])],\n s = [Math.sin(r[0]), Math.sin(r[1]), Math.sin(r[2])];\n return new Quaternion(c[0] * c[1] * c[2] - s[0] * s[1] * s[2], s[0] * c[1] * c[2] - c[0] * s[1] * s[2], c[0] * s[1] * c[2] + s[0] * c[1] * s[2], c[0] * c[1] * s[2] + s[0] * s[1] * c[2]);\n }\n /**\r\n * Computes current device orientation quaternion from device orientation API\r\n * Tait-Bryan angles.\r\n * @private\r\n * @param {Number} alpha - Alpha angle (in degrees)\r\n * @param {Number} beta - Beta angle (in degrees)\r\n * @param {Number} gamma - Gamma angle (in degrees)\r\n * @returns {Quaternion} Orientation quaternion\r\n */\n\n\n function computeQuaternion(alpha, beta, gamma) {\n // Convert Tait-Bryan angles to quaternion\n var quaternion = taitBryanToQuaternion(alpha, beta, gamma); // Apply world transform\n\n quaternion = quaternion.multiply(new Quaternion(Math.sqrt(0.5), -Math.sqrt(0.5), 0, 0)); // Apply screen transform\n\n var angle = window.orientation ? -window.orientation * Math.PI / 180 / 2 : 0;\n return quaternion.multiply(new Quaternion(Math.cos(angle), 0, -Math.sin(angle), 0));\n }\n /**\r\n * Event handler for device orientation API. Controls pointing.\r\n * @private\r\n * @param {DeviceOrientationEvent} event - Device orientation event.\r\n */\n\n\n function orientationListener(e) {\n if (e.hasOwnProperty(\"requestPermission\")) e.requestPermission();\n var q = computeQuaternion(e.alpha, e.beta, e.gamma).toEulerAngles();\n\n if (typeof orientation === \"number\" && orientation < 10) {\n // This kludge is necessary because iOS sometimes provides a few stale\n // device orientation events when the listener is removed and then\n // readded. Thus, we skip the first 10 events to prevent this from\n // causing problems.\n orientation += 1;\n } else if (orientation === 10) {\n // Record starting yaw to prevent jumping\n orientationYawOffset = q[2] / Math.PI * 180 + config.yaw;\n orientation = true;\n requestAnimationFrame(animate);\n } else {\n config.pitch = q[0] / Math.PI * 180;\n config.roll = -q[1] / Math.PI * 180;\n config.yaw = -q[2] / Math.PI * 180 + orientationYawOffset;\n }\n }\n /**\r\n * Initializes renderer.\r\n * @private\r\n */\n\n\n function renderInit() {\n try {\n var params = {};\n if (config.horizonPitch !== undefined$1) params.horizonPitch = config.horizonPitch * Math.PI / 180;\n if (config.horizonRoll !== undefined$1) params.horizonRoll = config.horizonRoll * Math.PI / 180;\n if (config.backgroundColor !== undefined$1) params.backgroundColor = config.backgroundColor;\n renderer.init(panoImage, config.type, config.dynamic, config.haov * Math.PI / 180, config.vaov * Math.PI / 180, config.vOffset * Math.PI / 180, renderInitCallback, params);\n\n if (config.dynamic !== true) {\n // Allow image to be garbage collected\n panoImage = undefined$1;\n }\n } catch (event) {\n // Panorama not loaded\n // Display error if there is a bad texture\n if (event.type === \"webgl error\" || event.type === \"no webgl\") {\n anError();\n } else if (event.type === \"webgl size error\") {\n anError(config.uiText.textureSizeError.replace(\"%s\", event.width).replace(\"%s\", event.maxWidth));\n } else {\n anError(config.uiText.unknownError);\n throw event;\n }\n }\n }\n /**\r\n * Triggered when render initialization finishes. Handles fading between\r\n * scenes as well as showing the compass and hotspots and hiding the loading\r\n * display.\r\n * @private\r\n */\n\n\n function renderInitCallback() {\n // Fade if specified\n if (config.sceneFadeDuration && renderer.fadeImg !== undefined$1) {\n renderer.fadeImg.style.opacity = 0; // Remove image\n\n var fadeImg = renderer.fadeImg;\n delete renderer.fadeImg;\n setTimeout(function () {\n renderContainer.removeChild(fadeImg);\n fireEvent(\"scenechangefadedone\");\n }, config.sceneFadeDuration);\n } // Show compass if applicable\n\n\n if (config.compass) {\n compass.style.display = \"inline\";\n } else {\n compass.style.display = \"none\";\n } // Show hotspots\n\n\n createHotSpots(); // Hide loading display\n\n infoDisplay.load.box.style.display = \"none\";\n\n if (preview !== undefined$1) {\n renderContainer.removeChild(preview);\n preview = undefined$1;\n }\n\n loaded = true;\n animateInit();\n fireEvent(\"load\");\n }\n /**\r\n * Creates hot spot element for the current scene.\r\n * @private\r\n * @param {Object} hs - The configuration for the hotspot\r\n */\n\n\n function createHotSpot(hs) {\n // Make sure hot spot pitch and yaw are numbers\n hs.pitch = Number(hs.pitch) || 0;\n hs.yaw = Number(hs.yaw) || 0;\n var div = document.createElement(\"div\");\n div.className = \"pnlm-hotspot-base\";\n if (hs.cssClass) div.className += \" \" + hs.cssClass;else div.className += \" pnlm-hotspot pnlm-sprite pnlm-\" + escapeHTML(hs.type);\n var span = document.createElement(\"span\");\n if (hs.text) span.innerHTML = escapeHTML(hs.text);\n var a;\n\n if (hs.video) {\n var video = document.createElement(\"video\"),\n vidp = hs.video;\n if (config.basePath && !absoluteURL(vidp)) vidp = config.basePath + vidp;\n video.src = sanitizeURL(vidp);\n video.controls = true;\n video.style.width = hs.width + \"px\";\n renderContainer.appendChild(div);\n span.appendChild(video);\n } else if (hs.image) {\n var imgp = hs.image;\n if (config.basePath && !absoluteURL(imgp)) imgp = config.basePath + imgp;\n a = document.createElement(\"a\");\n a.href = sanitizeURL(hs.URL ? hs.URL : imgp);\n a.target = \"_blank\";\n span.appendChild(a);\n var image = document.createElement(\"img\");\n image.src = sanitizeURL(imgp);\n image.style.width = hs.width + \"px\";\n image.style.paddingTop = \"5px\";\n renderContainer.appendChild(div);\n a.appendChild(image);\n span.style.maxWidth = \"initial\";\n } else if (hs.URL) {\n a = document.createElement(\"a\");\n a.href = sanitizeURL(hs.URL);\n\n if (hs.attributes) {\n for (var key in hs.attributes) {\n a.setAttribute(key, hs.attributes[key]);\n }\n } else {\n a.target = \"_blank\";\n }\n\n renderContainer.appendChild(a);\n div.className += \" pnlm-pointer\";\n span.className += \" pnlm-pointer\";\n a.appendChild(div);\n } else {\n if (hs.sceneId) {\n div.onclick = div.ontouchend = function () {\n if (!div.clicked) {\n div.clicked = true;\n loadScene(hs.sceneId, hs.targetPitch, hs.targetYaw, hs.targetHfov);\n }\n\n return false;\n };\n\n div.className += \" pnlm-pointer\";\n span.className += \" pnlm-pointer\";\n }\n\n renderContainer.appendChild(div);\n }\n\n if (hs.createTooltipFunc) {\n hs.createTooltipFunc(div, hs.createTooltipArgs);\n } else if (hs.text || hs.video || hs.image) {\n div.classList.add(\"pnlm-tooltip\");\n div.appendChild(span);\n span.style.width = span.scrollWidth - 20 + \"px\";\n span.style.marginLeft = -(span.scrollWidth - div.offsetWidth) / 2 + \"px\";\n span.style.marginTop = -span.scrollHeight - 12 + \"px\";\n }\n\n if (hs.clickHandlerFunc) {\n div.addEventListener(\"click\", function (e) {\n hs.clickHandlerFunc(e, hs.clickHandlerArgs);\n }, \"false\");\n div.className += \" pnlm-pointer\";\n span.className += \" pnlm-pointer\";\n }\n\n hs.div = div;\n }\n /**\r\n * Creates hot spot elements for the current scene.\r\n * @private\r\n */\n\n\n function createHotSpots() {\n if (hotspotsCreated) return;\n\n if (!config.hotSpots) {\n config.hotSpots = [];\n } else {\n // Sort by pitch so tooltip is never obscured by another hot spot\n config.hotSpots = config.hotSpots.sort(function (a, b) {\n return a.pitch < b.pitch;\n });\n config.hotSpots.forEach(createHotSpot);\n }\n\n hotspotsCreated = true;\n renderHotSpots();\n }\n /**\r\n * Destroys currently created hot spot elements.\r\n * @private\r\n */\n\n\n function destroyHotSpots() {\n var hs = config.hotSpots;\n hotspotsCreated = false;\n delete config.hotSpots;\n\n if (hs) {\n for (var i = 0; i < hs.length; i++) {\n var current = hs[i].div;\n\n if (current) {\n while (current.parentNode && current.parentNode != renderContainer) {\n current = current.parentNode;\n }\n\n renderContainer.removeChild(current);\n }\n\n delete hs[i].div;\n }\n }\n }\n /**\r\n * Renders hot spot, updating its position and visibility.\r\n * @private\r\n */\n\n\n function renderHotSpot(hs) {\n var hsPitchSin = Math.sin(hs.pitch * Math.PI / 180),\n hsPitchCos = Math.cos(hs.pitch * Math.PI / 180),\n configPitchSin = Math.sin(config.pitch * Math.PI / 180),\n configPitchCos = Math.cos(config.pitch * Math.PI / 180),\n yawCos = Math.cos((-hs.yaw + config.yaw) * Math.PI / 180);\n var z = hsPitchSin * configPitchSin + hsPitchCos * yawCos * configPitchCos;\n\n if (hs.yaw <= 90 && hs.yaw > -90 && z <= 0 || (hs.yaw > 90 || hs.yaw <= -90) && z <= 0) {\n hs.div.style.visibility = \"hidden\";\n } else {\n var yawSin = Math.sin((-hs.yaw + config.yaw) * Math.PI / 180),\n hfovTan = Math.tan(config.hfov * Math.PI / 360);\n hs.div.style.visibility = \"visible\"; // Subpixel rendering doesn't work in Firefox\n // https://bugzilla.mozilla.org/show_bug.cgi?id=739176\n\n var canvas = renderer.getCanvas(),\n canvasWidth = canvas.clientWidth,\n canvasHeight = canvas.clientHeight;\n var coord = [-canvasWidth / hfovTan * yawSin * hsPitchCos / z / 2, -canvasWidth / hfovTan * (hsPitchSin * configPitchCos - hsPitchCos * yawCos * configPitchSin) / z / 2]; // Apply roll\n\n var rollSin = Math.sin(config.roll * Math.PI / 180),\n rollCos = Math.cos(config.roll * Math.PI / 180);\n coord = [coord[0] * rollCos - coord[1] * rollSin, coord[0] * rollSin + coord[1] * rollCos]; // Apply transform\n\n coord[0] += (canvasWidth - hs.div.offsetWidth) / 2;\n coord[1] += (canvasHeight - hs.div.offsetHeight) / 2;\n var transform = \"translate(\" + coord[0] + \"px, \" + coord[1] + \"px) translateZ(9999px) rotate(\" + config.roll + \"deg)\";\n\n if (hs.scale) {\n transform += \" scale(\" + origHfov / config.hfov / z + \")\";\n }\n\n hs.div.style.webkitTransform = transform;\n hs.div.style.MozTransform = transform;\n hs.div.style.transform = transform;\n }\n }\n /**\r\n * Renders hot spots, updating their positions and visibility.\r\n * @private\r\n */\n\n\n function renderHotSpots() {\n config.hotSpots.forEach(renderHotSpot);\n }\n /**\r\n * Merges a scene configuration into the current configuration.\r\n * @private\r\n * @param {string} sceneId - Identifier of scene configuration to merge in.\r\n */\n\n\n function mergeConfig(sceneId) {\n config = {};\n var k, s;\n var photoSphereExcludes = [\"haov\", \"vaov\", \"vOffset\", \"northOffset\", \"horizonPitch\", \"horizonRoll\"];\n specifiedPhotoSphereExcludes = []; // Merge default config\n\n for (k in defaultConfig) {\n if (defaultConfig.hasOwnProperty(k)) {\n config[k] = defaultConfig[k];\n }\n } // Merge default scene config\n\n\n for (k in initialConfig[\"default\"]) {\n if (initialConfig[\"default\"].hasOwnProperty(k)) {\n if (k === \"uiText\") {\n for (s in initialConfig[\"default\"].uiText) {\n if (initialConfig[\"default\"].uiText.hasOwnProperty(s)) {\n config.uiText[s] = escapeHTML(initialConfig[\"default\"].uiText[s]);\n }\n }\n } else {\n config[k] = initialConfig[\"default\"][k];\n\n if (photoSphereExcludes.indexOf(k) >= 0) {\n specifiedPhotoSphereExcludes.push(k);\n }\n }\n }\n } // Merge current scene config\n\n\n if (sceneId !== null && sceneId !== \"\" && initialConfig.scenes && initialConfig.scenes[sceneId]) {\n var scene = initialConfig.scenes[sceneId];\n\n for (k in scene) {\n if (scene.hasOwnProperty(k)) {\n if (k === \"uiText\") {\n for (s in scene.uiText) {\n if (scene.uiText.hasOwnProperty(s)) {\n config.uiText[s] = escapeHTML(scene.uiText[s]);\n }\n }\n } else {\n config[k] = scene[k];\n\n if (photoSphereExcludes.indexOf(k) >= 0) {\n specifiedPhotoSphereExcludes.push(k);\n }\n }\n }\n }\n\n config.scene = sceneId;\n } // Merge initial config\n\n\n for (k in initialConfig) {\n if (initialConfig.hasOwnProperty(k)) {\n if (k === \"uiText\") {\n for (s in initialConfig.uiText) {\n if (initialConfig.uiText.hasOwnProperty(s)) {\n config.uiText[s] = escapeHTML(initialConfig.uiText[s]);\n }\n }\n } else {\n config[k] = initialConfig[k];\n\n if (photoSphereExcludes.indexOf(k) >= 0) {\n specifiedPhotoSphereExcludes.push(k);\n }\n }\n }\n }\n }\n /**\r\n * Processes configuration options.\r\n * @param {boolean} [isPreview] - Whether or not the preview is being displayed\r\n * @private\r\n */\n\n\n function processOptions(isPreview) {\n isPreview = isPreview ? isPreview : false; // Process preview first so it always loads before the browser hits its\n // maximum number of connections to a server as can happen with cubic\n // panoramas\n\n if (isPreview && \"preview\" in config) {\n var p = config.preview;\n if (config.basePath && !absoluteURL(p)) p = config.basePath + p;\n preview = document.createElement(\"div\");\n preview.className = \"pnlm-preview-img\";\n preview.style.backgroundImage = \"url('\" + sanitizeURLForCss(p) + \"')\";\n renderContainer.appendChild(preview);\n } // Handle different preview values\n\n\n var title = config.title,\n author = config.author,\n description = config.description;\n\n if (isPreview) {\n if (\"previewTitle\" in config) config.title = config.previewTitle;\n if (\"previewDescription\" in config) config.description = config.previewDescription;\n if (\"previewAuthor\" in config) config.author = config.previewAuthor;\n } // Reset title / author display\n\n\n if (!config.hasOwnProperty(\"title\")) infoDisplay.title.innerHTML = \"\";\n if (!config.hasOwnProperty(\"description\")) infoDisplay.description.innerHTML = \"\";\n if (!config.hasOwnProperty(\"author\")) infoDisplay.author.innerHTML = \"\";\n if (!config.hasOwnProperty(\"title\") && !config.hasOwnProperty(\"description\") && !config.hasOwnProperty(\"author\")) infoDisplay.container.style.display = \"none\"; // Fill in load button label and loading box text\n\n controls.load.innerHTML = \"\" + config.uiText.loadButtonLabel + \"
\";\n infoDisplay.load.boxp.innerHTML = config.uiText.loadingLabel; // Process other options\n\n for (var key in config) {\n if (config.hasOwnProperty(key)) {\n switch (key) {\n case \"title\":\n infoDisplay.title.innerHTML = escapeHTML(config[key]);\n infoDisplay.container.style.display = \"inline\";\n break;\n\n case \"description\":\n infoDisplay.description.innerHTML = escapeHTML(config[key]);\n infoDisplay.container.style.display = \"inline\";\n break;\n\n case \"author\":\n var authorText = escapeHTML(config[key]);\n\n if (config.authorURL) {\n var authorLink = document.createElement(\"a\");\n authorLink.href = sanitizeURL(config[\"authorURL\"]);\n authorLink.target = \"_blank\";\n authorLink.innerHTML = escapeHTML(config[key]);\n authorText = authorLink.outerHTML;\n }\n\n infoDisplay.author.innerHTML = config.uiText.bylineLabel.replace(\"%s\", authorText);\n infoDisplay.container.style.display = \"inline\";\n break;\n\n case \"fallback\":\n var link = document.createElement(\"a\");\n link.href = sanitizeURL(config[key]);\n link.target = \"_blank\";\n link.textContent = \"Click here to view this panorama in an alternative viewer.\";\n var message = document.createElement(\"p\");\n message.textContent = \"Your browser does not support WebGL.\";\n message.appendChild(document.createElement(\"br\"));\n message.appendChild(link);\n infoDisplay.errorMsg.innerHTML = \"\"; // Removes all children nodes\n\n infoDisplay.errorMsg.appendChild(message);\n break;\n\n case \"hfov\":\n setHfov(Number(config[key]));\n break;\n\n case \"autoLoad\":\n if (config[key] === true && renderer === undefined$1) {\n // Show loading box\n infoDisplay.load.box.style.display = \"inline\"; // Hide load button\n\n controls.load.style.display = \"none\"; // Initialize\n\n init();\n }\n\n break;\n\n case \"showZoomCtrl\":\n if (config[key] && config.showControls != false) {\n // Show zoom controls\n controls.zoom.style.display = \"block\";\n } else {\n // Hide zoom controls\n controls.zoom.style.display = \"none\";\n }\n\n break;\n\n case \"showFullscreenCtrl\":\n if (config[key] && config.showControls != false && (\"fullscreen\" in document || \"mozFullScreen\" in document || \"webkitIsFullScreen\" in document || \"msFullscreenElement\" in document)) {\n // Show fullscreen control\n controls.fullscreen.style.display = \"block\";\n } else {\n // Hide fullscreen control\n controls.fullscreen.style.display = \"none\";\n }\n\n break;\n\n case \"hotSpotDebug\":\n if (config[key]) hotSpotDebugIndicator.style.display = \"block\";else hotSpotDebugIndicator.style.display = \"none\";\n break;\n\n case \"showControls\":\n if (!config[key]) {\n controls.orientation.style.display = \"none\";\n controls.zoom.style.display = \"none\";\n controls.fullscreen.style.display = \"none\";\n }\n\n break;\n\n case \"orientationOnByDefault\":\n if (config[key]) {\n startOrientation();\n break;\n }\n\n }\n }\n }\n\n if (isPreview) {\n // Restore original values if changed for preview\n if (title) config.title = title;else delete config.title;\n if (description) config.description = description;else delete config.description;\n if (author) config.author = author;else delete config.author;\n }\n }\n /**\r\n * Toggles fullscreen mode.\r\n * @private\r\n */\n\n\n function toggleFullscreen() {\n if (loaded && !error) {\n if (!fullscreenActive) {\n try {\n if (container.requestFullscreen) {\n container.requestFullscreen();\n } else if (container.mozRequestFullScreen) {\n container.mozRequestFullScreen();\n } else if (container.msRequestFullscreen) {\n container.msRequestFullscreen();\n } else {\n container.webkitRequestFullScreen();\n }\n } catch (event) {// Fullscreen doesn't work\n }\n } else {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n }\n }\n }\n /**\r\n * Event handler for fullscreen changes.\r\n * @private\r\n */\n\n\n function onFullScreenChange(resize) {\n if (document.fullscreenElement || document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement) {\n controls.fullscreen.classList.add(\"pnlm-fullscreen-toggle-button-active\");\n fullscreenActive = true;\n } else {\n controls.fullscreen.classList.remove(\"pnlm-fullscreen-toggle-button-active\");\n fullscreenActive = false;\n }\n\n if (resize !== \"resize\") fireEvent(\"fullscreenchange\", fullscreenActive); // Resize renderer (deal with browser quirks and fixes #155)\n\n renderer.resize();\n setHfov(config.hfov);\n animateInit();\n }\n /**\r\n * Increases panorama zoom. For use with zoom button.\r\n * @private\r\n */\n\n\n function zoomIn() {\n if (loaded) {\n setHfov(config.hfov - 5);\n animateInit();\n }\n }\n /**\r\n * Decreases panorama zoom. For use with zoom button.\r\n * @private\r\n */\n\n\n function zoomOut() {\n if (loaded) {\n setHfov(config.hfov + 5);\n animateInit();\n }\n }\n /**\r\n * Clamps horzontal field of view to viewer's limits.\r\n * @private\r\n * @param {number} hfov - Input horizontal field of view (in degrees)\r\n * @return {number} - Clamped horizontal field of view (in degrees)\r\n */\n\n\n function constrainHfov(hfov) {\n // Keep field of view within bounds\n var minHfov = config.minHfov;\n\n if (config.type === \"multires\" && renderer && !config.multiResMinHfov) {\n minHfov = Math.min(minHfov, renderer.getCanvas().width / (config.multiRes.cubeResolution / 90 * 0.9));\n }\n\n if (minHfov > config.maxHfov) {\n // Don't change view if bounds don't make sense\n console.log(\"HFOV bounds do not make sense (minHfov > maxHfov).\");\n return config.hfov;\n }\n\n var newHfov = config.hfov;\n\n if (hfov < minHfov) {\n newHfov = minHfov;\n } else if (hfov > config.maxHfov) {\n newHfov = config.maxHfov;\n } else {\n newHfov = hfov;\n } // Optionally avoid showing background (empty space) on top or bottom by adapting newHfov\n\n\n if (config.avoidShowingBackground && renderer) {\n var canvas = renderer.getCanvas();\n newHfov = Math.min(newHfov, Math.atan(Math.tan((config.maxPitch - config.minPitch) / 360 * Math.PI) / canvas.height * canvas.width) * 360 / Math.PI);\n }\n\n return newHfov;\n }\n /**\r\n * Sets viewer's horizontal field of view.\r\n * @private\r\n * @param {number} hfov - Desired horizontal field of view in degrees.\r\n */\n\n\n function setHfov(hfov) {\n config.hfov = constrainHfov(hfov);\n fireEvent(\"zoomchange\", config.hfov);\n }\n /**\r\n * Stops auto rotation and animated moves.\r\n * @private\r\n */\n\n\n function stopAnimation() {\n animatedMove = {};\n autoRotateSpeed = config.autoRotate ? config.autoRotate : autoRotateSpeed;\n config.autoRotate = false;\n }\n /**\r\n * Loads panorama.\r\n * @private\r\n */\n\n\n function load() {\n // Since WebGL error handling is very general, first we clear any error box\n // since it is a new scene and the error from previous maybe because of lacking\n // memory etc and not because of a lack of WebGL support etc\n clearError();\n loaded = false;\n controls.load.style.display = \"none\";\n infoDisplay.load.box.style.display = \"inline\";\n init();\n }\n /**\r\n * Loads scene.\r\n * @private\r\n * @param {string} sceneId - Identifier of scene configuration to merge in.\r\n * @param {number} targetPitch - Pitch viewer should be centered on once scene loads.\r\n * @param {number} targetYaw - Yaw viewer should be centered on once scene loads.\r\n * @param {number} targetHfov - HFOV viewer should use once scene loads.\r\n * @param {boolean} [fadeDone] - If `true`, fade setup is skipped.\r\n */\n\n\n function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) {\n if (!loaded) fadeDone = true; // Don't try to fade when there isn't a scene loaded\n\n loaded = false;\n animatedMove = {}; // Set up fade if specified\n\n var fadeImg, workingPitch, workingYaw, workingHfov;\n\n if (config.sceneFadeDuration && !fadeDone) {\n var data = renderer.render(config.pitch * Math.PI / 180, config.yaw * Math.PI / 180, config.hfov * Math.PI / 180, {\n returnImage: true\n });\n\n if (data !== undefined$1) {\n fadeImg = new Image();\n fadeImg.className = \"pnlm-fade-img\";\n fadeImg.style.transition = \"opacity \" + config.sceneFadeDuration / 1000 + \"s\";\n fadeImg.style.width = \"100%\";\n fadeImg.style.height = \"100%\";\n\n fadeImg.onload = function () {\n loadScene(sceneId, targetPitch, targetYaw, targetHfov, true);\n };\n\n fadeImg.src = data;\n renderContainer.appendChild(fadeImg);\n renderer.fadeImg = fadeImg;\n return;\n }\n } // Set new pointing\n\n\n if (targetPitch === \"same\") {\n workingPitch = config.pitch;\n } else {\n workingPitch = targetPitch;\n }\n\n if (targetYaw === \"same\") {\n workingYaw = config.yaw;\n } else if (targetYaw === \"sameAzimuth\") {\n workingYaw = config.yaw + (config.northOffset || 0) - (initialConfig.scenes[sceneId].northOffset || 0);\n } else {\n workingYaw = targetYaw;\n }\n\n if (targetHfov === \"same\") {\n workingHfov = config.hfov;\n } else {\n workingHfov = targetHfov;\n } // Destroy hot spots from previous scene\n\n\n destroyHotSpots(); // Create the new config for the scene\n\n mergeConfig(sceneId); // Stop motion\n\n speed.yaw = speed.pitch = speed.hfov = 0; // Reload scene\n\n processOptions();\n\n if (workingPitch !== undefined$1) {\n config.pitch = workingPitch;\n }\n\n if (workingYaw !== undefined$1) {\n config.yaw = workingYaw;\n }\n\n if (workingHfov !== undefined$1) {\n config.hfov = workingHfov;\n }\n\n fireEvent(\"scenechange\", sceneId);\n load();\n }\n /**\r\n * Stop using device orientation.\r\n * @private\r\n */\n\n\n function stopOrientation() {\n window.removeEventListener(\"deviceorientation\", orientationListener);\n controls.orientation.classList.remove(\"pnlm-orientation-button-active\");\n orientation = false;\n }\n /**\r\n * Start using device orientation.\r\n * @private\r\n */\n\n\n function startOrientation() {\n orientation = 1; // Fix for IOS 13 where the user needs to perform an action i.e click. Then we need to ask permission\n\n if (DeviceOrientationEvent && typeof DeviceOrientationEvent.requestPermission === \"function\") {\n DeviceOrientationEvent.requestPermission().then(function (response) {\n if (response === \"granted\") {\n window.addEventListener(\"deviceorientation\", orientationListener);\n }\n })[\"catch\"](console.error);\n } else {\n window.addEventListener(\"deviceorientation\", orientationListener);\n } // window.addEventListener('deviceorientation', orientationListener);\n\n\n controls.orientation.classList.add(\"pnlm-orientation-button-active\");\n }\n /**\r\n * Escapes HTML string (to mitigate possible DOM XSS attacks).\r\n * @private\r\n * @param {string} s - String to escape\r\n * @returns {string} Escaped string\r\n */\n\n\n function escapeHTML(s) {\n if (!initialConfig.escapeHTML) return String(s).split(\"\\n\").join(\"