You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
177 lines
702 KiB
JavaScript
177 lines
702 KiB
JavaScript
/*! @name videojs-vr @version 1.7.1 @license Apache-2.0 */
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document"),require("video.js")):"function"==typeof define&&define.amd?define(["global/window","global/document","video.js"],t):(e=e||self).videojsVr=t(e.window,e.document,e.videojs)}(this,function(e,t,i){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t,i=i&&i.hasOwnProperty("default")?i.default:i;var n=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var r=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t},a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var o,s=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e,t){
|
|
/**
|
|
* @license
|
|
* webvr-polyfill
|
|
* Copyright (c) 2015-2017 Google
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
/**
|
|
* @license
|
|
* cardboard-vr-display
|
|
* Copyright (c) 2015-2017 Google
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
/**
|
|
* @license
|
|
* webvr-polyfill-dpdb
|
|
* Copyright (c) 2017 Google
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
/**
|
|
* @license
|
|
* wglu-preserve-state
|
|
* Copyright (c) 2016, Brandon Jones.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
* in the Software without restriction, including without limitation the rights
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
* THE SOFTWARE.
|
|
*/
|
|
/**
|
|
* @license
|
|
* nosleep.js
|
|
* Copyright (c) 2017, Rich Tibbett
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
* in the Software without restriction, including without limitation the rights
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
* THE SOFTWARE.
|
|
*/
|
|
e.exports=function(){var e,t="undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{},i=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},n=function(e,t){for(var i=0,n=e.length;i<n;i++)t[i]=e[i]},r=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},o=(e=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e,i){
|
|
/**
|
|
* @license
|
|
* cardboard-vr-display
|
|
* Copyright (c) 2015-2017 Google
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
/**
|
|
* @license
|
|
* gl-preserve-state
|
|
* Copyright (c) 2016, Brandon Jones.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
* in the Software without restriction, including without limitation the rights
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
* THE SOFTWARE.
|
|
*/
|
|
/**
|
|
* @license
|
|
* webvr-polyfill-dpdb
|
|
* Copyright (c) 2015-2017 Google
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
/**
|
|
* @license
|
|
* nosleep.js
|
|
* Copyright (c) 2017, Rich Tibbett
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
* in the Software without restriction, including without limitation the rights
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
* THE SOFTWARE.
|
|
*/
|
|
e.exports=function(){var e,i,n,r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw a}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},s=function(e,t,i){return e+(t-e)*i},c=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),u=function(){var e=-1!==navigator.userAgent.indexOf("Version")&&-1!==navigator.userAgent.indexOf("Android")&&-1!==navigator.userAgent.indexOf("Chrome");return function(){return e}}(),h=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent),function(){var e=-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}()),l=(i=navigator.userAgent.match(/.*Chrome\/([0-9]+)/),n=i?parseInt(i[1],10):null,function(){return n}),d=function(){var e=!1;if(65===l()){var t=navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/);if(t){var i=t[1].split("."),n=o(i,4),r=(n[0],n[1],n[2]),a=n[3];e=3325===parseInt(r,10)&&parseInt(a,10)<148}}return function(){return e}}(),p=function(){var e=-1!==navigator.userAgent.indexOf("R7 Build");return function(){return e}}(),f=function(){var e=90==window.orientation||-90==window.orientation;return p()?!e:e},g=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},m=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},M=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},y=function(e,t,i,n){var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t),e.compileShader(r);var a=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(a,i),e.compileShader(a);var o=e.createProgram();for(var s in e.attachShader(o,r),e.attachShader(o,a),n)e.bindAttribLocation(o,n[s],s);return e.linkProgram(o),e.deleteShader(r),e.deleteShader(a),o},v=function(e,t){for(var i={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r="",a=0;a<n;a++)i[r=e.getActiveUniform(t,a).name.replace("[0]","")]=e.getUniformLocation(t,r);return i},A=function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t},w=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},x=function(e){if(c()){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t)+1+"px",e.style.height=parseInt(i)+"px",setTimeout(function(){e.style.width=t,e.style.height=i},100)}window.canvas=e},E=function(){var e=Math.PI/180,t=.25*Math.PI,i=new Float32Array([0,0,0,1]),n=new Float32Array([0,0,0]);function r(r,a,o,s,c,u){!function(i,n,r,a){var o=Math.tan(n?n.upDegrees*e:t),s=Math.tan(n?n.downDegrees*e:t),c=Math.tan(n?n.leftDegrees*e:t),u=Math.tan(n?n.rightDegrees*e:t),h=2/(c+u),l=2/(o+s);i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=-(c-u)*h*.5,i[9]=(o-s)*l*.5,i[10]=a/(r-a),i[11]=-1,i[12]=0,i[13]=0,i[14]=a*r/(r-a),i[15]=0}(r,s||null,u.depthNear,u.depthFar);var h,l,d,p,f,g,m,M,y,v,A,w,x,E,T,N,D,L,b,I=o.orientation||i,_=o.position||n;h=a,d=_,p=(l=I)[0],f=l[1],g=l[2],m=l[3],A=p*(M=p+p),w=p*(y=f+f),x=p*(v=g+g),E=f*y,T=f*v,N=g*v,D=m*M,L=m*y,b=m*v,h[0]=1-(E+N),h[1]=w+b,h[2]=x-L,h[3]=0,h[4]=w-b,h[5]=1-(A+N),h[6]=T+D,h[7]=0,h[8]=x+L,h[9]=T-D,h[10]=1-(A+E),h[11]=0,h[12]=d[0],h[13]=d[1],h[14]=d[2],h[15]=1,c&&function(e,t,i){var n,r,a,o,s,c,u,h,l,d,p,f,g=i[0],m=i[1],M=i[2];t===e?(e[12]=t[0]*g+t[4]*m+t[8]*M+t[12],e[13]=t[1]*g+t[5]*m+t[9]*M+t[13],e[14]=t[2]*g+t[6]*m+t[10]*M+t[14],e[15]=t[3]*g+t[7]*m+t[11]*M+t[15]):(n=t[0],r=t[1],a=t[2],o=t[3],s=t[4],c=t[5],u=t[6],h=t[7],l=t[8],d=t[9],p=t[10],f=t[11],e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=u,e[7]=h,e[8]=l,e[9]=d,e[10]=p,e[11]=f,e[12]=n*g+s*m+l*M+t[12],e[13]=r*g+c*m+d*M+t[13],e[14]=a*g+u*m+p*M+t[14],e[15]=o*g+h*m+f*M+t[15])}(a,a,c),function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6],u=t[7],h=t[8],l=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],M=t[15],y=i*s-n*o,v=i*c-r*o,A=i*u-a*o,w=n*c-r*s,x=n*u-a*s,E=r*u-a*c,T=h*g-l*f,N=h*m-d*f,D=h*M-p*f,L=l*m-d*g,b=l*M-p*g,I=d*M-p*m,_=y*I-v*b+A*L+w*D-x*N+E*T;_&&(_=1/_,e[0]=(s*I-c*b+u*L)*_,e[1]=(r*b-n*I-a*L)*_,e[2]=(g*E-m*x+M*w)*_,e[3]=(d*x-l*E-p*w)*_,e[4]=(c*D-o*I-u*N)*_,e[5]=(i*I-r*D+a*N)*_,e[6]=(m*A-f*E-M*v)*_,e[7]=(h*E-d*A+p*v)*_,e[8]=(o*b-s*D+u*T)*_,e[9]=(n*D-i*b-a*T)*_,e[10]=(f*x-g*A+M*y)*_,e[11]=(l*A-h*x-p*y)*_,e[12]=(s*N-o*L-c*T)*_,e[13]=(i*L-n*N+r*T)*_,e[14]=(g*v-f*w-m*y)*_,e[15]=(h*w-l*v+d*y)*_)}(a,a)}return function(e,t,i){return!(!e||!t||(e.pose=t,e.timestamp=t.timestamp,r(e.leftProjectionMatrix,e.leftViewMatrix,t,i._getFieldOfView("left"),i._getEyeOffset("left"),i),r(e.rightProjectionMatrix,e.rightViewMatrix,t,i._getFieldOfView("right"),i._getEyeOffset("right"),i),0))}}(),T=function(e){var t,i=e.indexOf("://");t=-1!==i?i+3:0;var n=e.indexOf("/",t);return-1===n&&(n=e.length),e.substring(0,n)},N=(e={},function(t,i){void 0===e[t]&&(console.warn("webvr-polyfill: "+i),e[t]=!0)}),D=function(e,t){N(e,e+" has been deprecated. This may not work on native WebVR displays. "+(t?"Please use "+t+" instead.":""))},L=function(e,t,i){if(t){for(var n=[],r=null,a=0;a<t.length;++a)switch(o=t[a]){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:if((c=t[++a])<e.TEXTURE0||c>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),n.push(null,null);break}r||(r=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(c),n.push(e.getParameter(o),null);break;case e.ACTIVE_TEXTURE:r=e.getParameter(e.ACTIVE_TEXTURE),n.push(null);break;default:n.push(e.getParameter(o))}for(i(e),a=0;a<t.length;++a){var o=t[a],s=n[a];switch(o){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,s);break;case e.COLOR_CLEAR_VALUE:e.clearColor(s[0],s[1],s[2],s[3]);break;case e.COLOR_WRITEMASK:e.colorMask(s[0],s[1],s[2],s[3]);break;case e.CURRENT_PROGRAM:e.useProgram(s);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,s);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,s);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,s);break;case e.TEXTURE_BINDING_2D:if((c=t[++a])<e.TEXTURE0||c>e.TEXTURE31)break;e.activeTexture(c),e.bindTexture(e.TEXTURE_2D,s);break;case e.TEXTURE_BINDING_CUBE_MAP:var c;if((c=t[++a])<e.TEXTURE0||c>e.TEXTURE31)break;e.activeTexture(c),e.bindTexture(e.TEXTURE_CUBE_MAP,s);break;case e.VIEWPORT:e.viewport(s[0],s[1],s[2],s[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:s?e.enable(o):e.disable(o);break;default:console.log("No GL restore behavior for 0x"+o.toString(16))}r&&e.activeTexture(r)}}else i(e)},b=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),I=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");function _(e,t,i,n){this.gl=e,this.cardboardUI=t,this.bufferScale=i,this.dirtySubmitFrameBindings=n,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,c()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=y(e,b,I,this.attribs),this.uniforms=v(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize()}_.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},_.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];L(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},_.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;c()||(t.width=g()*this.bufferScale,t.height=m()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(i){e.bufferWidth=i,e.realCanvasWidth.set.call(t,i),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(i){e.bufferHeight=i,e.realCanvasHeight.set.call(t,i),e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,n){e.lastBoundFramebuffer=n||e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,n,r,a){e.colorMask[0]=t,e.colorMask[1]=n,e.colorMask[2]=r,e.colorMask[3]=a,e.realColorMask.call(i,t,n,r,a)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,n,r,a){e.clearColor[0]=t,e.clearColor[1]=n,e.clearColor[2]=r,e.clearColor[3]=a,e.realClearColor.call(i,t,n,r,a)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,n,r,a){e.viewport[0]=t,e.viewport[1]=n,e.viewport[2]=r,e.viewport[3]=a,e.realViewport.call(i,t,n,r,a)},this.isPatched=!0,x(t)}},_.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;c()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout(function(){x(t)},1)}},_.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},_.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(this.dirtySubmitFrameBindings||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),L(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||c())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.dirtySubmitFrameBindings||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor)}),c()){var n=e.canvas;n.width==t.bufferWidth&&n.height==t.bufferHeight||(t.bufferWidth=n.width,t.bufferHeight=n.height,t.onResize())}},_.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,n=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];L(t,n,function(t){var n=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW),!i.indexCount){var r=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,r,t.STATIC_DRAW),i.indexCount=r.length}})},_.prototype.computeMeshVertices_=function(e,t,i){for(var n=new Float32Array(2*e*t*5),r=i.getLeftEyeVisibleTanAngles(),a=i.getLeftEyeNoLensTanAngles(),o=i.getLeftEyeVisibleScreenRect(a),c=0,u=0;u<2;u++){for(var h=0;h<t;h++)for(var l=0;l<e;l++,c++){var d=l/(e-1),p=h/(t-1),f=d,g=p,m=s(r[0],r[2],d),M=s(r[3],r[1],p),y=Math.sqrt(m*m+M*M),v=i.distortion.distortInverse(y),A=M*v/y;d=(m*v/y-a[0])/(a[2]-a[0]),p=(A-a[3])/(a[1]-a[3]),d=2*(o.x+d*o.width-.5),p=2*(o.y+p*o.height-.5),n[5*c+0]=d,n[5*c+1]=p,n[5*c+2]=f,n[5*c+3]=g,n[5*c+4]=u}var w=r[2]-r[0];r[0]=-(w+r[0]),r[2]=w-r[2],w=a[2]-a[0],a[0]=-(w+a[0]),a[2]=w-a[2],o.x=1-(o.x+o.width)}return n},_.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),n=e/2,r=t/2,a=0,o=0,s=0;s<2;s++)for(var c=0;c<t;c++)for(var u=0;u<e;u++,a++)0!=u&&0!=c&&(u<=n==c<=r?(i[o++]=a,i[o++]=a-e-1,i[o++]=a-e,i[o++]=a-e-1,i[o++]=a,i[o++]=a-1):(i[o++]=a-1,i[o++]=a-e,i[o++]=a,i[o++]=a-e,i[o++]=a-1,i[o++]=a-e-1));return i},_.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return void 0!==i.get&&void 0!==i.set||(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i};var S=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),j=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),C=Math.PI/180,O=.3125;function z(e){this.gl=e,this.attribs={position:0},this.program=y(e,S,j,this.attribs),this.uniforms=v(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}function R(e){this.coefficients=e}z.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},z.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(n){var r=i.clientWidth/2;n.clientX>r-42&&n.clientX<r+42&&n.clientY>i.clientHeight-42?e(n):n.clientX<42&&n.clientY<42&&t(n)},i.addEventListener("click",this.listener,!1)},z.prototype.onResize=function(){var e=this.gl,t=this,i=[e.ARRAY_BUFFER_BINDING];L(e,i,function(e){var i=[],n=e.drawingBufferWidth/2,r=Math.max(screen.width,screen.height)*window.devicePixelRatio,a=e.drawingBufferWidth/r*window.devicePixelRatio,o=4*a/2,s=42*a,c=28*a/2,u=14*a;function h(e,t){var r=(90-e)*C,a=Math.cos(r),o=Math.sin(r);i.push(O*a*c+n,O*o*c+c),i.push(t*a*c+n,t*o*c+c)}i.push(n-o,s),i.push(n-o,e.drawingBufferHeight),i.push(n+o,s),i.push(n+o,e.drawingBufferHeight),t.gearOffset=i.length/2;for(var l=0;l<=6;l++){var d=60*l;h(d,1),h(d+12,1),h(d+20,.75),h(d+40,.75),h(d+48,1)}function p(t,n){i.push(u+t,e.drawingBufferHeight-u-n)}t.gearVertexCount=i.length/2-t.gearOffset,t.arrowOffset=i.length/2;var f=o/Math.sin(45*C);p(0,c),p(c,0),p(c+f,f),p(f,c+f),p(f,c-f),p(0,c),p(c,2*c),p(c+f,2*c-f),p(f,c-f),p(0,c),p(f,c-o),p(28*a,c-o),p(f,c+o),p(28*a,c+o),t.arrowVertexCount=i.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(i),e.STATIC_DRAW)})},z.prototype.render=function(){var e=this.gl,t=this,i=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];L(e,i,function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()})},z.prototype.renderNoState=function(){var e,t,i,n,r,a,o,s,c,u,h=this.gl;h.useProgram(this.program),h.bindBuffer(h.ARRAY_BUFFER,this.vertexBuffer),h.enableVertexAttribArray(this.attribs.position),h.vertexAttribPointer(this.attribs.position,2,h.FLOAT,!1,8,0),h.uniform4f(this.uniforms.color,1,1,1,1),e=this.projMat,t=0,i=h.drawingBufferWidth,n=0,r=h.drawingBufferHeight,s=1/(t-i),c=1/(n-r),u=1/((a=.1)-(o=1024)),e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(r+n)*c,e[14]=(o+a)*u,e[15]=1,h.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),h.drawArrays(h.TRIANGLE_STRIP,0,4),h.drawArrays(h.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),h.drawArrays(h.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},R.prototype.distortInverse=function(e){for(var t=0,i=1,n=e-this.distort(t);Math.abs(i-t)>1e-4;){var r=e-this.distort(i),a=i-r*((i-t)/(r-n));t=i,i=a,n=r}return i},R.prototype.distort=function(e){for(var t=e*e,i=0,n=0;n<this.coefficients.length;n++)i=t*(i+this.coefficients[n]);return(i+1)*e};var U=Math.PI/180,P=180/Math.PI,B=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0};B.prototype={constructor:B,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*n-o*i,u=s*i+o*t-r*n,h=s*n+r*i-a*t,l=-r*t-a*i-o*n;return this.x=c*s+l*-r+u*-o-h*-a,this.y=u*s+l*-a+h*-r-c*-o,this.z=h*s+l*-o+c*-a-u*-r,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=n*s-r*o,this.y=r*a-i*s,this.z=i*o-n*a,this}};var k,F,G=function(e,t,i,n){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==n?n:1};function Q(e){this.width=e.width||g(),this.height=e.height||m(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}G.prototype={constructor:G,set:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var n=Math.cos(e/2),r=Math.cos(t/2),a=Math.cos(i/2),o=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=o*r*a+n*s*c,this.y=n*s*a-o*r*c,this.z=n*r*c+o*s*a,this.w=n*r*a-o*s*c,this},setFromEulerYXZ:function(e,t,i){var n=Math.cos(e/2),r=Math.cos(t/2),a=Math.cos(i/2),o=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=o*r*a+n*s*c,this.y=n*s*a-o*r*c,this.z=n*r*c-o*s*a,this.w=n*r*a+o*s*c,this},setFromAxisAngle:function(e,t){var i=t/2,n=Math.sin(i);return this.x=e.x*n,this.y=e.y*n,this.z=e.z*n,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,n=e.y,r=e.z,a=e.w,o=t.x,s=t.y,c=t.z,u=t.w;return this.x=i*u+a*o+n*c-r*s,this.y=n*u+a*s+r*o-i*c,this.z=r*u+a*c+i*s-n*o,this.w=a*u-i*o-n*s-r*c,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,n=this.y,r=this.z,a=this.w,o=a*e.w+i*e.x+n*e.y+r*e.z;if(o<0?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,o=-o):this.copy(e),o>=1)return this.w=a,this.x=i,this.y=n,this.z=r,this;var s=Math.acos(o),c=Math.sqrt(1-o*o);if(Math.abs(c)<.001)return this.w=.5*(a+this.w),this.x=.5*(i+this.x),this.y=.5*(n+this.y),this.z=.5*(r+this.z),this;var u=Math.sin((1-t)*s)/c,h=Math.sin(t*s)/c;return this.w=a*u+this.w*h,this.x=i*u+this.x*h,this.y=n*u+this.y*h,this.z=r*u+this.z*h,this},setFromUnitVectors:function(e,t){return void 0===k&&(k=new B),(F=e.dot(t)+1)<1e-6?(F=0,Math.abs(e.x)>Math.abs(e.z)?k.set(-e.y,e.x,0):k.set(0,-e.z,e.y)):k.crossVectors(e,t),this.x=k.x,this.y=k.y,this.z=k.z,this.w=F,this.normalize(),this}};var Y=new Q({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),V=new Q({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),H={CardboardV1:new X({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new X({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};function W(e,t){this.viewer=H.CardboardV2,this.updateDeviceParams(e),this.distortion=new R(this.viewer.distortionCoefficients);for(var i=0;i<t.length;i++){var n=t[i];H[n.id]=new X(n)}}function X(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}W.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},W.prototype.getDevice=function(){return this.device},W.prototype.setViewer=function(e){this.viewer=e,this.distortion=new R(this.viewer.distortionCoefficients)},W.prototype.determineDevice_=function(e){if(!e)return c()?(console.warn("Using fallback iOS device measurements."),V):(console.warn("Using fallback Android device measurements."),Y);var t=.0254/e.xdpi,i=.0254/e.ydpi;return new Q({widthMeters:t*g(),heightMeters:i*m(),bevelMeters:.001*e.bevelMm})},W.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,n=e.screenLensDistance,r=(t.widthMeters-e.interLensDistance)/2,a=e.interLensDistance/2,o=e.baselineLensDistance-t.bevelMeters,s=t.heightMeters-o,c=P*Math.atan(i.distort(r/n)),u=P*Math.atan(i.distort(a/n)),h=P*Math.atan(i.distort(o/n)),l=P*Math.atan(i.distort(s/n));return{leftDegrees:Math.min(c,e.fov),rightDegrees:Math.min(u,e.fov),downDegrees:Math.min(h,e.fov),upDegrees:Math.min(l,e.fov)}},W.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=Math.tan(-U*e.fov),r=Math.tan(U*e.fov),a=Math.tan(U*e.fov),o=Math.tan(-U*e.fov),s=t.widthMeters/4,c=t.heightMeters/2,u=e.baselineLensDistance-t.bevelMeters-c,h=e.interLensDistance/2-s,l=-u,d=e.screenLensDistance,p=i.distort((h-s)/d),f=i.distort((l+c)/d),g=i.distort((h+s)/d),m=i.distort((l-c)/d),M=new Float32Array(4);return M[0]=Math.max(n,p),M[1]=Math.min(r,f),M[2]=Math.min(a,g),M[3]=Math.max(o,m),M},W.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,n=new Float32Array(4),r=i.distortInverse(Math.tan(-U*e.fov)),a=i.distortInverse(Math.tan(U*e.fov)),o=i.distortInverse(Math.tan(U*e.fov)),s=i.distortInverse(Math.tan(-U*e.fov)),c=t.widthMeters/4,u=t.heightMeters/2,h=e.baselineLensDistance-t.bevelMeters-u,l=e.interLensDistance/2-c,d=-h,p=e.screenLensDistance,f=(l-c)/p,g=(d+u)/p,m=(l+c)/p,M=(d-u)/p;return n[0]=Math.max(r,f),n[1]=Math.min(a,g),n[2]=Math.min(o,m),n[3]=Math.max(s,M),n},W.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,n=t.screenLensDistance,r=(i.widthMeters-t.interLensDistance)/2,a=t.baselineLensDistance-i.bevelMeters,o=(e[0]*n+r)/i.widthMeters,s=(e[1]*n+a)/i.heightMeters,c=(e[2]*n+r)/i.widthMeters,u=(e[3]*n+a)/i.heightMeters;return{x:o,y:u,width:c-o,height:s-u}},W.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},W.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},W.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:P*Math.atan(e.outerDist),rightDegrees:P*Math.atan(e.innerDist),downDegrees:P*Math.atan(e.bottomDist),upDegrees:P*Math.atan(e.topDist)}},W.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,n=t.screenLensDistance,r=i.widthMeters/n,a=i.heightMeters/n,o=i.width/r,s=i.height/a,c=Math.round((e.eyePosX-e.outerDist)*o),u=Math.round((e.eyePosY-e.bottomDist)*s);return{x:c,y:u,width:Math.round((e.eyePosX+e.innerDist)*o)-c,height:Math.round((e.eyePosY+e.topDist)*s)-u}},W.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,n=e.screenLensDistance,r=e.interLensDistance/2/n,a=t.widthMeters/n,o=t.heightMeters/n,s=a/2-r,c=(e.baselineLensDistance-t.bevelMeters)/n,u=e.fov,h=i.distortInverse(Math.tan(U*u)),l=Math.min(s,h),d=Math.min(r,h),p=Math.min(c,h);return{outerDist:l,innerDist:d,topDist:Math.min(o-c,h),bottomDist:p,eyePosX:s,eyePosY:c}},W.Viewers=H;var Z={format:1,last_updated:"2018-02-20T22:55:10Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel XL/*"},{ua:"Pixel XL"}],dpi:[537.9,533],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google/*/Pixel/*"},{ua:"Pixel"}],dpi:[432.6,436.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LENOVO/*/Lenovo PB2-690Y/*"},{ua:"Lenovo PB2-690Y"}],dpi:[457.2,454.713],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 B"}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/G5/*"},{ua:"Moto G (5) Plus"}],dpi:[403.4,403],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 B"}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/G4/*"},{ua:"Moto G (4)"}],dpi:401,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONEPLUS A5000/*"},{ua:"ONEPLUS A5000 "}],dpi:[403.411,399.737],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A5010/*"},{ua:"ONEPLUS A5010"}],dpi:[403,400],bw:2,ac:1e3},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SGH-M919/*"},{ua:"SGH-M919"}],dpi:[440.8,437.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920P/*"},{ua:"SM-N920P"}],dpi:[386.3655,390.144],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920W8/*"},{ua:"SM-N920W8"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G930F/*"},{ua:"SM-G930F"}],dpi:576.6,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G935F/*"},{ua:"SM-G935F"}],dpi:533,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G950F/*"},{ua:"SM-G950F"}],dpi:[562.707,565.293],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G955U/*"},{ua:"SM-G955U"}],dpi:[522.514,525.762],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Fly/*/IQ4412/*"},{ua:"IQ4412"}],dpi:307.9,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"BENEVE/*/VR518/*"},{ua:"VR518"}],dpi:480,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2001]}],dpi:[410.9,415.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2436]}],dpi:458,bw:4,ac:1e3}]};function q(e,t){if(this.dpdb=Z,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t;var i=new XMLHttpRequest,n=this;i.open("GET",e,!0),i.addEventListener("load",function(){n.loading=!1,i.status>=200&&i.status<=299?(n.dpdb=JSON.parse(i.response),n.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function J(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function K(e,t){this.set(e,t)}function $(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new K,this.currentGyroMeasurement=new K,this.previousGyroMeasurement=new K,c()?this.filterQ=new G(-1,0,0,1):this.filterQ=new G(1,0,0,1),this.previousFilterQ=new G,this.previousFilterQ.copy(this.filterQ),this.accelQ=new G,this.isOrientationInitialized=!1,this.estimatedGravity=new B,this.measuredGravity=new B,this.gyroIntegralQ=new G}function ee(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new G,this.previousTimestampS=null,this.deltaQ=new G,this.outQ=new G}function te(e,t,i,n){this.yawOnly=i,this.accelerometer=new B,this.gyroscope=new B,this.filter=new $(e,n),this.posePredictor=new ee(t,n),this.isFirefoxAndroid=h(),this.isIOS=c();var r=l();this.isDeviceMotionInRadians=!this.isIOS&&r&&r<66,this.isWithoutDeviceMotion=d(),this.filterToWorldQ=new G,c()?this.filterToWorldQ.setFromAxisAngle(new B(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new B(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new G,this.worldToScreenQ=new G,this.originalPoseAdjustQ=new G,this.originalPoseAdjustQ.setFromAxisAngle(new B(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),f()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new G,this.orientationOut_=new Float32Array(4),this.start()}q.prototype.getDeviceParams=function(){return this.deviceParams},q.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},q.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,i=g(),n=m();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var r=0;r<e.devices.length;r++){var a=e.devices[r];if(a.rules)if("ios"==a.type||"android"==a.type){if(c()==("ios"==a.type)){for(var o=!1,s=0;s<a.rules.length;s++){var u=a.rules[s];if(this.matchRule_(u,t,i,n)){o=!0;break}}if(o)return new J({xdpi:a.dpi[0]||a.dpi,ydpi:a.dpi[1]||a.dpi,bevelMm:a.bw})}}else console.warn("Device["+r+"] has invalid type.");else console.warn("Device["+r+"] has no rules section.")}return console.warn("No DPDB device match."),null},q.prototype.matchRule_=function(e,t,i,n){if(!e.ua&&!e.res)return!1;if(e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var r=e.res[0],a=e.res[1];if(Math.min(i,n)!=Math.min(r,a)||Math.max(i,n)!=Math.max(r,a))return!1}return!0},K.prototype.set=function(e,t){this.sample=e,this.timestampS=t},K.prototype.copy=function(e){this.set(e.sample,e.timestampS)},$.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},$.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i,n=t-this.previousGyroMeasurement.timestampS;i=n,isNaN(i)||i<=.001||i>1||this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},$.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new G;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var n,r=new G;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",P*((n=r).w>1?(console.warn("getQuaternionAngle: w > 1"),0):2*Math.acos(n.w)),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var a=new G;a.copy(this.filterQ),a.multiply(r),this.filterQ.slerp(a,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},$.prototype.getOrientation=function(){return this.filterQ},$.prototype.accelToQuaternion_=function(e){var t=new B;t.copy(e),t.normalize();var i=new G;return i.setFromUnitVectors(new B(0,0,-1),t),i.inverse(),i},$.prototype.gyroToQuaternionDelta_=function(e,t){var i=new G,n=new B;return n.copy(e),n.normalize(),i.setFromAxisAngle(n,e.length()*t),i},ee.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var n=new B;n.copy(t),n.normalize();var r=t.length();if(r<20*U)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(P*r).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var a=r*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(n,a),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=i,this.outQ},te.prototype.getPosition=function(){return null},te.prototype.getOrientation=function(){var e=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ)return this.deviceOrientationFixQ=this.deviceOrientationFixQ||(i=(new G).setFromAxisAngle(new B(0,0,-1),0),n=new G,-90===window.orientation?n.setFromAxisAngle(new B(0,1,0),Math.PI/-2):n.setFromAxisAngle(new B(0,1,0),Math.PI/2),i.multiply(n)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((t=new G).setFromAxisAngle(new B(1,0,0),-Math.PI/2),t),e=this._deviceOrientationQ,(r=new G).copy(e),r.multiply(this.deviceOrientationFilterToWorldQ),r.multiply(this.resetQ),r.multiply(this.worldToScreenQ),r.multiplyQuaternions(this.deviceOrientationFixQ,r),this.yawOnly&&(r.x=0,r.z=0,r.normalize()),this.orientationOut_[0]=r.x,this.orientationOut_[1]=r.y,this.orientationOut_[2]=r.z,this.orientationOut_[3]=r.w,this.orientationOut_;var t,i,n,r,a=this.filter.getOrientation();return e=this.posePredictor.getPrediction(a,this.gyroscope,this.previousTimestampS),(r=new G).copy(this.filterToWorldQ),r.multiply(this.resetQ),r.multiply(e),r.multiply(this.worldToScreenQ),this.yawOnly&&(r.x=0,r.z=0,r.normalize()),this.orientationOut_[0]=r.x,this.orientationOut_[1]=r.y,this.orientationOut_[2]=r.z,this.orientationOut_[3]=r.w,this.orientationOut_},te.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),f()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},te.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new G;var t=e.alpha,i=e.beta,n=e.gamma;t=(t||0)*Math.PI/180,i=(i||0)*Math.PI/180,n=(n||0)*Math.PI/180,this._deviceOrientationQ.setFromEulerYXZ(i,t,-n)},te.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},te.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,n=e.timeStamp/1e3,r=n-this.previousTimestampS;return r<0?(N("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=n)):r<=.001||r>1?(N("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=n)):(this.accelerometer.set(-t.x,-t.y,-t.z),p()?this.gyroscope.set(-i.beta,i.alpha,i.gamma):this.gyroscope.set(i.alpha,i.beta,i.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,n),this.filter.addGyroMeasurement(this.gyroscope,n),void(this.previousTimestampS=n))},te.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},te.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)},te.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new B(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new B(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},te.prototype.start=function(){var e,t,i;this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),this.onDeviceOrientationCallback_=this.onDeviceOrientation_.bind(this),c()&&(e=window.self!==window.top,t=T(document.referrer),i=T(window.location.href),e&&t!==i)&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},te.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)};var ie=new B(1,0,0),ne=new B(0,0,1),re={};screen.orientation?re=screen.orientation:screen.msOrientation?re=screen.msOrientation:Object.defineProperty(re,"angle",{get:function(){return window.orientation||0}});var ae=new G;ae.setFromAxisAngle(ie,-Math.PI/2),ae.multiply((new G).setFromAxisAngle(ne,Math.PI/2));var oe=function(){function e(t){r(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new G,this._worldToScreenQ=new G,this._outQ=new G,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onOrientationChange(),this.init()}return a(e,[{key:"init",value:function(){var e=null;try{(e=new RelativeOrientationSensor({frequency:60})).addEventListener("error",this._onSensorError)}catch(e){this.errors.push(e),"SecurityError"===e.name?(console.error("Cannot construct sensors due to the Feature Policy"),console.warn('Attempting to fall back using "devicemotion"; however this will fail in the future without correct permissions.'),this.useDeviceMotion()):"ReferenceError"===e.name?this.useDeviceMotion():console.error(e)}e&&(this.api="sensor",this.sensor=e,this.sensor.addEventListener("reading",this._onSensorRead),this.sensor.start()),window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"useDeviceMotion",value:function(){this.api="devicemotion",this.fusionSensor=new te(this.config.K_FILTER,this.config.PREDICTION_TIME_S,this.config.YAW_ONLY,this.config.DEBUG),this.sensor&&(this.sensor.removeEventListener("reading",this._onSensorRead),this.sensor.removeEventListener("error",this._onSensorError),this.sensor=null)}},{key:"getOrientation",value:function(){if(this.fusionSensor)return this.fusionSensor.getOrientation();if(!this.sensor||!this.sensor.quaternion)return this._out[0]=this._out[1]=this._out[2]=0,this._out[3]=1,this._out;var e=this.sensor.quaternion;this._sensorQ.set(e[0],e[1],e[2],e[3]);var t=this._outQ;return t.copy(ae),t.multiply(this._sensorQ),t.multiply(this._worldToScreenQ),this.config.YAW_ONLY&&(t.x=t.z=0,t.normalize()),this._out[0]=t.x,this._out[1]=t.y,this._out[2]=t.z,this._out[3]=t.w,this._out}},{key:"_onSensorError",value:function(e){this.errors.push(e.error),"NotAllowedError"===e.error.name?console.error("Permission to access sensor was denied"):"NotReadableError"===e.error.name?console.error("Sensor could not be read"):console.error(e.error),this.useDeviceMotion()}},{key:"_onSensorRead",value:function(){}},{key:"_onOrientationChange",value:function(){var e=-re.angle*Math.PI/180;this._worldToScreenQ.setFromAxisAngle(ne,e)}}]),e}();function se(){this.loadIcon_();var e=document.createElement("div");(a=e.style).position="fixed",a.top=0,a.right=0,a.bottom=0,a.left=0,a.backgroundColor="gray",a.fontFamily="sans-serif",a.zIndex=1e6;var t=document.createElement("img");t.src=this.icon,(a=t.style).marginLeft="25%",a.marginTop="25%",a.width="50%",e.appendChild(t);var i=document.createElement("div");(a=i.style).textAlign="center",a.fontSize="16px",a.lineHeight="24px",a.margin="24px 25%",a.width="50%",i.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(i);var n=document.createElement("div");(a=n.style).backgroundColor="#CFD8DC",a.position="fixed",a.bottom=0,a.width="100%",a.height="48px",a.padding="14px 24px",a.boxSizing="border-box",a.color="#656A6B",e.appendChild(n);var r=document.createElement("div");r.style.float="left",r.innerHTML="No Cardboard viewer?";var a,o=document.createElement("a");o.href="https://www.google.com/get/cardboard/get-cardboard/",o.innerHTML="get one",o.target="_blank",(a=o.style).float="right",a.fontWeight=600,a.textTransform="uppercase",a.borderLeft="1px solid gray",a.paddingLeft="24px",a.textDecoration="none",a.color="#656A6B",n.appendChild(r),n.appendChild(o),this.overlay=e,this.text=i,this.hide()}se.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img").style;f()?(t.width="20%",t.marginLeft="40%",t.marginTop="3%"):(t.width="50%",t.marginLeft="25%",t.marginTop="25%")},se.prototype.hide=function(){this.overlay.style.display="none"},se.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},se.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},se.prototype.update=function(){this.disableShowTemporarily(),!f()&&A()?this.show():this.hide()},se.prototype.loadIcon_=function(){this.icon="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjE5OHB4IiBoZWlnaHQ9IjI0MHB4IiB2aWV3Qm94PSIwIDAgMTk4IDI0MCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpza2V0Y2g9Imh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaC9ucyI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDMuMy4zICgxMjA4MSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5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IjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEwLjA4Myw5MC4zNzUgTDEwLjA4Myw0Ni40MjEgTDEwLjE0Niw0Ni4zODUgTDc3LjQwMyw3LjU1NCBMNzcuNDAzLDUxLjUwOCBMNzcuMzQxLDUxLjU0NCBMMTAuMDgzLDkwLjM3NSBMMTAuMDgzLDkwLjM3NSBaIE0xMC4zMzMsNDYuNTY0IEwxMC4zMzMsODkuOTQ0IEw3Ny4xNTQsNTEuMzY1IEw3Ny4xNTQsNy45ODUgTDEwLjMzMyw0Ni41NjQgTDEwLjMzMyw0Ni41NjQgWiIgaWQ9IkZpbGwtMjAiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMjUuNzM3LDg4LjY0NyBMMTE4LjA5OCw5MS45ODEgTDExOC4wOTgsODQgTDEwNi42MzksODguNzEzIEwxMDYuNjM5LDk2Ljk4MiBMOTksMTAwLjMxNSBMMTEyLjM2OSwxMDMuOTYxIEwxMjUuNzM3LDg4LjY0NyIgaWQ9IkltcG9ydGVkLUxheWVycy1Db3B5LTIiIGZpbGw9IiM0NTVBNjQiIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"};var ce="CardboardV1",ue="WEBVR_CARDBOARD_VIEWER";function he(e){try{this.selectedKey=localStorage.getItem(ue)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||ce),this.dialog=this.createDialog_(W.Viewers),this.root=null,this.onChangeCallbacks_=[]}he.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},he.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},he.prototype.getCurrentViewer=function(){return W.Viewers[this.selectedKey]},he.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},he.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},he.prototype.fireOnChange_=function(e){for(var t=0;t<this.onChangeCallbacks_.length;t++)this.onChangeCallbacks_[t](e)},he.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),this.selectedKey&&W.Viewers[this.selectedKey]){this.fireOnChange_(W.Viewers[this.selectedKey]);try{localStorage.setItem(ue,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()}else console.error("ViewerSelector.onSave_: this should never happen!")},he.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add("webvr-polyfill-viewer-selector"),t.style.display="none";var i=document.createElement("div");(r=i.style).position="fixed",r.left=0,r.top=0,r.width="100%",r.height="100%",r.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var n=document.createElement("div"),r=n.style;for(var a in r.boxSizing="border-box",r.position="fixed",r.top="24px",r.left="50%",r.marginLeft="-140px",r.width="280px",r.padding="24px",r.overflow="hidden",r.background="#fafafa",r.fontFamily="'Roboto', sans-serif",r.boxShadow="0px 5px 20px #666",n.appendChild(this.createH1_("Select your viewer")),e)n.appendChild(this.createChoice_(a,e[a].label));return n.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(n),t},he.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},he.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var n=document.createElement("input");n.style.fontSize="30px",n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("value",e),n.setAttribute("name","field");var r=document.createElement("label");return r.style.marginLeft="4px",r.setAttribute("for",e),r.innerHTML=t,i.appendChild(n),i.appendChild(r),i},he.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var n=i.style;return n.float="right",n.textTransform="uppercase",n.color="#1094f7",n.fontSize="14px",n.letterSpacing=0,n.border=0,n.background="none",n.marginTop="16px",i.addEventListener("click",t),i},"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var le,de=(le=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e,t){var i;i=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i(1),a="undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("playsinline",""),this.noSleepVideo.setAttribute("src",r),this.noSleepVideo.addEventListener("timeupdate",function(e){this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return n(e,[{key:"enable",value:function(){a?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location.href="/",window.setTimeout(window.stop,0)},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){a?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=o},function(e,t,i){e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxc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AAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])},e.exports=i()}))&&le.__esModule?le.default:le,pe=1e3,fe=[0,0,.5,1],ge=[.5,0,.5,1],me=window.requestAnimationFrame,Me=window.cancelAnimationFrame;function ye(e){Object.defineProperties(this,{hasPosition:{writable:!1,enumerable:!0,value:e.hasPosition},hasExternalDisplay:{writable:!1,enumerable:!0,value:e.hasExternalDisplay},canPresent:{writable:!1,enumerable:!0,value:e.canPresent},maxLayers:{writable:!1,enumerable:!0,value:e.maxLayers},hasOrientation:{enumerable:!0,get:function(){return D("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function ve(e){var t=!("wakelock"in(e=e||{}))||e.wakelock;this.isPolyfilled=!0,this.displayId=pe++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return D("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new ye({hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1}),this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.originalParent_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,t&&A()&&(this.wakelock_=new de)}ve.prototype.getFrameData=function(e){return E(e,this._getPose(),this)},ve.prototype.getPose=function(){return D("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},ve.prototype.resetPose=function(){return D("VRDisplay.prototype.resetPose"),this._resetPose()},ve.prototype.getImmediatePose=function(){return D("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},ve.prototype.requestAnimationFrame=function(e){return me(e)},ve.prototype.cancelAnimationFrame=function(e){return Me(e)},ve.prototype.wrapForFullscreen=function(e){if(c())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;if(this.fullscreenElement_&&(this.originalParent_?this.originalParent_.appendChild(this.fullscreenElement_):this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_)),this.fullscreenElement_=e,this.originalParent_=e.parentElement,this.originalParent_||document.body.appendChild(e),!this.fullscreenWrapper_.parentElement){var i=this.fullscreenElement_.parentElement;i.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),i.removeChild(this.fullscreenElement_)}this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;return function(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}(),this.fullscreenWrapper_},ve.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),this.originalParent_===t?t.insertBefore(e,this.fullscreenWrapper_):this.originalParent_&&this.originalParent_.appendChild(e),t.removeChild(this.fullscreenWrapper_),e}},ve.prototype.requestPresent=function(e){var t=this.isPresenting,i=this;return e instanceof Array||(D("VRDisplay.prototype.requestPresent with non-array argument","an array of VRLayers as the first argument"),e=[e]),new Promise(function(n,r){if(i.capabilities.canPresent)if(0==e.length||e.length>i.capabilities.maxLayers)r(new Error("Invalid number of layers."));else{var a=e[0];if(a.source){var o=a.leftBounds||fe,s=a.rightBounds||ge;if(t){var h=i.layer_;h.source!==a.source&&(h.source=a.source);for(var l=0;l<4;l++)h.leftBounds[l]=o[l],h.rightBounds[l]=s[l];return i.wrapForFullscreen(i.layer_.source),i.updatePresent_(),void n()}if(i.layer_={predistorted:a.predistorted,source:a.source,leftBounds:o.slice(0),rightBounds:s.slice(0)},i.waitingForPresent_=!1,i.layer_&&i.layer_.source){var d=i.wrapForFullscreen(i.layer_.source);i.addFullscreenListeners_(d,function(){var e=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;i.isPresenting=d===e,i.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch(function(e){console.error("screen.orientation.lock() failed due to",e.message)}),i.waitingForPresent_=!1,i.beginPresent_(),n()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),i.removeFullscreenWrapper(),i.disableWakeLock(),i.endPresent_(),i.removeFullscreenListeners_()),i.fireVRDisplayPresentChange_()},function(){i.waitingForPresent_&&(i.removeFullscreenWrapper(),i.removeFullscreenListeners_(),i.disableWakeLock(),i.waitingForPresent_=!1,i.isPresenting=!1,r(new Error("Unable to present.")))}),function(e){if(u())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0}(d)?(i.enableWakeLock(),i.waitingForPresent_=!0):(c()||u())&&(i.enableWakeLock(),i.isPresenting=!0,i.beginPresent_(),i.fireVRDisplayPresentChange_(),n())}i.waitingForPresent_||c()||(M(),r(new Error("Unable to present.")))}else n()}else r(new Error("VRDisplay is not capable of presenting."))})},ve.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise(function(i,n){e?(!M()&&c()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),u()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):n(new Error("Was not presenting to VRDisplay."))})},ve.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},ve.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},ve.prototype.fireVRDisplayConnect_=function(){var e=new CustomEvent("vrdisplayconnect",{detail:{display:this}});window.dispatchEvent(e)},ve.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),i&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",i,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",i,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",i,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",i,!1))},ve.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},ve.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},ve.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},ve.prototype.beginPresent_=function(){},ve.prototype.endPresent_=function(){},ve.prototype.submitFrame=function(e){},ve.prototype.getEyeParameters=function(e){return null};var Ae={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},we="left",xe="right";function Ee(e){var t=w({},Ae);e=w(t,e||{}),ve.call(this,{wakelock:e.MOBILE_WAKE_LOCK}),this.config=e,this.displayName="Cardboard VRDisplay",this.capabilities=new ye({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new oe(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new q(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new W(this.dpdb_.getDeviceParams(),e.ADDITIONAL_VIEWERS),this.viewerSelector_=new he(e.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new se),c()&&window.addEventListener("resize",this.onResize_.bind(this))}return Ee.prototype=Object.create(ve.prototype),Ee.prototype._getPose=function(){return{position:null,orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},Ee.prototype._resetPose=function(){this.poseSensor_.resetPose&&this.poseSensor_.resetPose()},Ee.prototype._getFieldOfView=function(e){var t;if(e==we)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=xe)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return t},Ee.prototype._getEyeOffset=function(e){var t;if(e==we)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=xe)return console.error("Invalid eye provided: %s",e),null;t=[.5*this.deviceInfo_.viewer.interLensDistance,0,0]}return t},Ee.prototype.getEyeParameters=function(e){var t=this._getEyeOffset(e),i=this._getFieldOfView(e),n={offset:t,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_};return Object.defineProperty(n,"fieldOfView",{enumerable:!0,get:function(){return D("VRFieldOfView","VRFrameData's projection matrices"),i}}),n},Ee.prototype.onDeviceParamsUpdated_=function(e){this.config.DEBUG&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},Ee.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},Ee.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?this.config.CARDBOARD_UI_DISABLED||(e.canvas.width=g()*this.bufferScale_,e.canvas.height=m()*this.bufferScale_,this.cardboardUI_=new z(e)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new z(e)),this.distorter_=new _(e,this.cardboardUI_,this.config.BUFFER_SCALE,this.config.DIRTY_SUBMIT_FRAME_BINDINGS),this.distorter_.updateDeviceInfo(this.deviceInfo_)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(f()&&A()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),window.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},Ee.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler),window.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},Ee.prototype.updatePresent_=function(){this.endPresent_(),this.beginPresent_()},Ee.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl").canvas;t.width==this.lastWidth&&t.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=t.width,this.lastHeight=t.height,this.cardboardUI_.render()}},Ee.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},Ee.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl");t.canvas.setAttribute("style",["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"].join("; ")+";"),x(t.canvas)}},Ee.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},Ee.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},Ee.VRFrameData=function(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null},Ee.VRDisplay=ve,Ee}()}))&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,s={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",PROVIDE_MOBILE_VRDISPLAY:!0,GET_VR_DISPLAYS_TIMEOUT:1e3,MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,TOUCH_PANNER_DISABLED:!0,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1};function c(e){this.config=r(r({},s),e),this.polyfillDisplays=[],this.enabled=!1,this.hasNative="getVRDisplays"in navigator,this.native={},this.native.getVRDisplays=navigator.getVRDisplays,this.native.VRFrameData=window.VRFrameData,this.native.VRDisplay=window.VRDisplay,(!this.hasNative||this.config.PROVIDE_MOBILE_VRDISPLAY&&i())&&(this.enable(),this.getVRDisplays().then(function(e){e&&e[0]&&e[0].fireVRDisplayConnect_&&e[0].fireVRDisplayConnect_()}))}c.prototype.getPolyfillDisplays=function(){if(this._polyfillDisplaysPopulated)return this.polyfillDisplays;if(i()){var e=new o({ADDITIONAL_VIEWERS:this.config.ADDITIONAL_VIEWERS,DEFAULT_VIEWER:this.config.DEFAULT_VIEWER,MOBILE_WAKE_LOCK:this.config.MOBILE_WAKE_LOCK,DEBUG:this.config.DEBUG,DPDB_URL:this.config.DPDB_URL,CARDBOARD_UI_DISABLED:this.config.CARDBOARD_UI_DISABLED,K_FILTER:this.config.K_FILTER,PREDICTION_TIME_S:this.config.PREDICTION_TIME_S,TOUCH_PANNER_DISABLED:this.config.TOUCH_PANNER_DISABLED,ROTATE_INSTRUCTIONS_DISABLED:this.config.ROTATE_INSTRUCTIONS_DISABLED,YAW_ONLY:this.config.YAW_ONLY,BUFFER_SCALE:this.config.BUFFER_SCALE,DIRTY_SUBMIT_FRAME_BINDINGS:this.config.DIRTY_SUBMIT_FRAME_BINDINGS});this.polyfillDisplays.push(e)}return this._polyfillDisplaysPopulated=!0,this.polyfillDisplays},c.prototype.enable=function(){if(this.enabled=!0,this.hasNative&&this.native.VRFrameData){var e=this.native.VRFrameData,t=new this.native.VRFrameData,i=this.native.VRDisplay.prototype.getFrameData;window.VRDisplay.prototype.getFrameData=function(r){r instanceof e?i.call(this,r):(i.call(this,t),r.pose=t.pose,n(t.leftProjectionMatrix,r.leftProjectionMatrix),n(t.rightProjectionMatrix,r.rightProjectionMatrix),n(t.leftViewMatrix,r.leftViewMatrix),n(t.rightViewMatrix,r.rightViewMatrix))}}navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=o.VRDisplay,window.VRFrameData=o.VRFrameData},c.prototype.getVRDisplays=function(){var e,t=this,i=this.config;if(!this.hasNative)return Promise.resolve(this.getPolyfillDisplays());var n,r=this.native.getVRDisplays.call(navigator),a=new Promise(function(t){e=setTimeout(function(){console.warn("Native WebVR implementation detected, but `getVRDisplays()` failed to resolve. Falling back to polyfill."),t([])},i.GET_VR_DISPLAYS_TIMEOUT)});return(n=[r,a],Promise.race?Promise.race(n):new Promise(function(e,t){for(var i=0;i<n.length;i++)n[i].then(e,t)})).then(function(i){return clearTimeout(e),i.length>0?i:t.getPolyfillDisplays()})},c.version="0.10.6",c.VRFrameData=o.VRFrameData,c.VRDisplay=o.VRDisplay;var u=Object.freeze({default:c}),h=u&&c||u;return void 0!==t&&t.window&&(t.document||(t.document=t.window.document),t.navigator||(t.navigator=t.window.navigator)),h}()}),c=(o=s)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;function u(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),Object.assign(u.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var i=t.slice(0),n=0,r=i.length;n<r;n++)i[n].call(this,e)}}}});var h,l,d,p,f,g,m,M,y="93",v=0,A=1,w=2,x=0,E=1,T=2,N=1,D=2,L=0,b=1,I=2,_=0,S=1,j=2,C=0,O=1,z=2,R=3,U=4,P=5,B=100,k=101,F=102,G=103,Q=104,Y=200,V=201,H=202,W=203,X=204,Z=205,q=206,J=207,K=208,$=209,ee=210,te=0,ie=1,ne=2,re=3,ae=4,oe=5,se=6,ce=7,ue=0,he=1,le=2,de=0,pe=1,fe=2,ge=3,me=4,Me=301,ye=302,ve=303,Ae=304,we=305,xe=306,Ee=307,Te=1e3,Ne=1001,De=1002,Le=1003,be=1004,Ie=1005,_e=1006,Se=1007,je=1008,Ce=1009,Oe=1010,ze=1011,Re=1012,Ue=1013,Pe=1014,Be=1015,ke=1016,Fe=1017,Ge=1018,Qe=1019,Ye=1020,Ve=1021,He=1022,We=1023,Xe=1024,Ze=1025,qe=1026,Je=1027,Ke=33776,$e=33777,et=33778,tt=33779,it=35840,nt=35841,rt=35842,at=35843,ot=36196,st=37808,ct=37809,ut=37810,ht=37811,lt=37812,dt=37813,pt=37814,ft=37815,gt=37816,mt=37817,Mt=37818,yt=37819,vt=37820,At=37821,wt=2201,xt=2400,Et=0,Tt=1,Nt=2,Dt=3e3,Lt=3001,bt=3007,It=3002,_t=3004,St=3005,jt=3006,Ct=3200,Ot=3201,zt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&i]+e[i>>8&255]+"-"+e[i>>16&15|64]+e[i>>24&255]+"-"+e[63&n|128]+e[n>>8&255]+"-"+e[n>>16&255]+e[n>>24&255]+e[255&r]+e[r>>8&255]+e[r>>16&255]+e[r>>24&255]).toUpperCase()}}(),clamp:function(e,t,i){return Math.max(t,Math.min(i,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},lerp:function(e,t,i){return(1-i)*e+i*t},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*zt.DEG2RAD},radToDeg:function(e){return e*zt.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function Rt(e,t){this.x=e||0,this.y=t||0}function Ut(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Pt(e,t,i,n){this._x=e||0,this._y=t||0,this._z=i||0,this._w=void 0!==n?n:1}function Bt(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0}function kt(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(Rt.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(Rt.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:(h=new Rt,l=new Rt,function(e,t){return h.set(e,e),l.set(t,t),this.clamp(h,l)}),clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}}),Object.assign(Ut.prototype,{isMatrix4:!0,set:function(e,t,i,n,r,a,o,s,c,u,h,l,d,p,f,g){var m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=n,m[1]=r,m[5]=a,m[9]=o,m[13]=s,m[2]=c,m[6]=u,m[10]=h,m[14]=l,m[3]=d,m[7]=p,m[11]=f,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Ut).fromArray(this.elements)},copy:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},copyPosition:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this},extractRotation:(m=new Bt,function(e){var t=this.elements,i=e.elements,n=1/m.setFromMatrixColumn(e,0).length(),r=1/m.setFromMatrixColumn(e,1).length(),a=1/m.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),o=Math.sin(i),s=Math.cos(n),c=Math.sin(n),u=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var l=a*u,d=a*h,p=o*u,f=o*h;t[0]=s*u,t[4]=-s*h,t[8]=c,t[1]=d+p*c,t[5]=l-f*c,t[9]=-o*s,t[2]=f-l*c,t[6]=p+d*c,t[10]=a*s}else if("YXZ"===e.order){var g=s*u,m=s*h,M=c*u,y=c*h;t[0]=g+y*o,t[4]=M*o-m,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=m*o-M,t[6]=y+g*o,t[10]=a*s}else if("ZXY"===e.order){g=s*u,m=s*h,M=c*u,y=c*h;t[0]=g-y*o,t[4]=-a*h,t[8]=M+m*o,t[1]=m+M*o,t[5]=a*u,t[9]=y-g*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){l=a*u,d=a*h,p=o*u,f=o*h;t[0]=s*u,t[4]=p*c-d,t[8]=l*c+f,t[1]=s*h,t[5]=f*c+l,t[9]=d*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var v=a*s,A=a*c,w=o*s,x=o*c;t[0]=s*u,t[4]=x-v*h,t[8]=w*h+A,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=A*h+w,t[10]=v-x*h}else if("XZY"===e.order){v=a*s,A=a*c,w=o*s,x=o*c;t[0]=s*u,t[4]=-h,t[8]=c*u,t[1]=v*h+x,t[5]=a*u,t[9]=A*h-w,t[2]=w*h-A,t[6]=o*u,t[10]=x*h+v}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:(f=new Bt(0,0,0),g=new Bt(1,1,1),function(e){return this.compose(f,e,g)}),lookAt:function(){var e=new Bt,t=new Bt,i=new Bt;return function(n,r,a){var o=this.elements;return i.subVectors(n,r),0===i.lengthSq()&&(i.z=1),i.normalize(),e.crossVectors(a,i),0===e.lengthSq()&&(1===Math.abs(a.z)?i.x+=1e-4:i.z+=1e-4,i.normalize(),e.crossVectors(a,i)),e.normalize(),t.crossVectors(i,e),o[0]=e.x,o[4]=t.x,o[8]=i.x,o[1]=e.y,o[5]=t.y,o[9]=i.y,o[2]=e.z,o[6]=t.z,o[10]=i.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[4],s=i[8],c=i[12],u=i[1],h=i[5],l=i[9],d=i[13],p=i[2],f=i[6],g=i[10],m=i[14],M=i[3],y=i[7],v=i[11],A=i[15],w=n[0],x=n[4],E=n[8],T=n[12],N=n[1],D=n[5],L=n[9],b=n[13],I=n[2],_=n[6],S=n[10],j=n[14],C=n[3],O=n[7],z=n[11],R=n[15];return r[0]=a*w+o*N+s*I+c*C,r[4]=a*x+o*D+s*_+c*O,r[8]=a*E+o*L+s*S+c*z,r[12]=a*T+o*b+s*j+c*R,r[1]=u*w+h*N+l*I+d*C,r[5]=u*x+h*D+l*_+d*O,r[9]=u*E+h*L+l*S+d*z,r[13]=u*T+h*b+l*j+d*R,r[2]=p*w+f*N+g*I+m*C,r[6]=p*x+f*D+g*_+m*O,r[10]=p*E+f*L+g*S+m*z,r[14]=p*T+f*b+g*j+m*R,r[3]=M*w+y*N+v*I+A*C,r[7]=M*x+y*D+v*_+A*O,r[11]=M*E+y*L+v*S+A*z,r[15]=M*T+y*b+v*j+A*R,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new Bt;return function(t){for(var i=0,n=t.count;i<n;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.applyMatrix4(this),t.setXYZ(i,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],o=e[5],s=e[9],c=e[13],u=e[2],h=e[6],l=e[10],d=e[14];return e[3]*(+r*s*h-n*c*h-r*o*l+i*c*l+n*o*d-i*s*d)+e[7]*(+t*s*d-t*c*l+r*a*l-n*a*d+n*c*u-r*s*u)+e[11]*(+t*c*h-t*o*d-r*a*h+i*a*d+r*o*u-i*c*u)+e[15]*(-n*o*u-t*s*h+t*o*l+n*a*h-i*a*l+i*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var i=this.elements,n=e.elements,r=n[0],a=n[1],o=n[2],s=n[3],c=n[4],u=n[5],h=n[6],l=n[7],d=n[8],p=n[9],f=n[10],g=n[11],m=n[12],M=n[13],y=n[14],v=n[15],A=p*y*l-M*f*l+M*h*g-u*y*g-p*h*v+u*f*v,w=m*f*l-d*y*l-m*h*g+c*y*g+d*h*v-c*f*v,x=d*M*l-m*p*l+m*u*g-c*M*g-d*u*v+c*p*v,E=m*p*h-d*M*h-m*u*f+c*M*f+d*u*y-c*p*y,T=r*A+a*w+o*x+s*E;if(0===T){var N="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(N);return console.warn(N),this.identity()}var D=1/T;return i[0]=A*D,i[1]=(M*f*s-p*y*s-M*o*g+a*y*g+p*o*v-a*f*v)*D,i[2]=(u*y*s-M*h*s+M*o*l-a*y*l-u*o*v+a*h*v)*D,i[3]=(p*h*s-u*f*s-p*o*l+a*f*l+u*o*g-a*h*g)*D,i[4]=w*D,i[5]=(d*y*s-m*f*s+m*o*g-r*y*g-d*o*v+r*f*v)*D,i[6]=(m*h*s-c*y*s-m*o*l+r*y*l+c*o*v-r*h*v)*D,i[7]=(c*f*s-d*h*s+d*o*l-r*f*l-c*o*g+r*h*g)*D,i[8]=x*D,i[9]=(m*p*s-d*M*s-m*a*g+r*M*g+d*a*v-r*p*v)*D,i[10]=(c*M*s-m*u*s+m*a*l-r*M*l-c*a*v+r*u*v)*D,i[11]=(d*u*s-c*p*s-d*a*l+r*p*l+c*a*g-r*u*g)*D,i[12]=E*D,i[13]=(d*M*o-m*p*o+m*a*f-r*M*f-d*a*y+r*p*y)*D,i[14]=(m*u*o-c*M*o-m*a*h+r*M*h+c*a*y-r*u*y)*D,i[15]=(c*p*o-d*u*o+d*a*h-r*p*h-c*a*f+r*u*f)*D,this},scale:function(e){var t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,o=e.y,s=e.z,c=r*a,u=r*o;return this.set(c*a+i,c*o-n*s,c*s+n*o,0,c*o+n*s,u*o+i,u*s-n*a,0,c*s-n*o,u*s+n*a,r*s*s+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(e,t,i){return this.set(1,t,i,0,e,1,i,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,i){var n=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,c=r+r,u=a+a,h=o+o,l=r*c,d=r*u,p=r*h,f=a*u,g=a*h,m=o*h,M=s*c,y=s*u,v=s*h,A=i.x,w=i.y,x=i.z;return n[0]=(1-(f+m))*A,n[1]=(d+v)*A,n[2]=(p-y)*A,n[3]=0,n[4]=(d-v)*w,n[5]=(1-(l+m))*w,n[6]=(g+M)*w,n[7]=0,n[8]=(p+y)*x,n[9]=(g-M)*x,n[10]=(1-(l+f))*x,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this},decompose:(d=new Bt,p=new Ut,function(e,t,i){var n=this.elements,r=d.set(n[0],n[1],n[2]).length(),a=d.set(n[4],n[5],n[6]).length(),o=d.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],p.copy(this);var s=1/r,c=1/a,u=1/o;return p.elements[0]*=s,p.elements[1]*=s,p.elements[2]*=s,p.elements[4]*=c,p.elements[5]*=c,p.elements[6]*=c,p.elements[8]*=u,p.elements[9]*=u,p.elements[10]*=u,t.setFromRotationMatrix(p),i.x=r,i.y=a,i.z=o,this}),makePerspective:function(e,t,i,n,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*r/(t-e),c=2*r/(i-n),u=(t+e)/(t-e),h=(i+n)/(i-n),l=-(a+r)/(a-r),d=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=c,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=l,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,i,n,r,a){var o=this.elements,s=1/(t-e),c=1/(i-n),u=1/(a-r),h=(t+e)*s,l=(i+n)*c,d=(a+r)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-l,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,i=e.elements,n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;i<16;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}),Object.assign(Pt,{slerp:function(e,t,i,n){return i.copy(e).slerp(t,n)},slerpFlat:function(e,t,i,n,r,a,o){var s=i[n+0],c=i[n+1],u=i[n+2],h=i[n+3],l=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(h!==f||s!==l||c!==d||u!==p){var g=1-o,m=s*l+c*d+u*p+h*f,M=m>=0?1:-1,y=1-m*m;if(y>Number.EPSILON){var v=Math.sqrt(y),A=Math.atan2(v,m*M);g=Math.sin(g*A)/v,o=Math.sin(o*A)/v}var w=o*M;if(s=s*g+l*w,c=c*g+d*w,u=u*g+p*w,h=h*g+f*w,g===1-o){var x=1/Math.sqrt(s*s+c*c+u*u+h*h);s*=x,c*=x,u*=x,h*=x}}e[t]=s,e[t+1]=c,e[t+2]=u,e[t+3]=h}}),Object.defineProperties(Pt.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(Pt.prototype,{set:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=e._x,n=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(i/2),u=o(n/2),h=o(r/2),l=s(i/2),d=s(n/2),p=s(r/2);return"XYZ"===a?(this._x=l*u*h+c*d*p,this._y=c*d*h-l*u*p,this._z=c*u*p+l*d*h,this._w=c*u*h-l*d*p):"YXZ"===a?(this._x=l*u*h+c*d*p,this._y=c*d*h-l*u*p,this._z=c*u*p-l*d*h,this._w=c*u*h+l*d*p):"ZXY"===a?(this._x=l*u*h-c*d*p,this._y=c*d*h+l*u*p,this._z=c*u*p+l*d*h,this._w=c*u*h-l*d*p):"ZYX"===a?(this._x=l*u*h-c*d*p,this._y=c*d*h+l*u*p,this._z=c*u*p-l*d*h,this._w=c*u*h+l*d*p):"YZX"===a?(this._x=l*u*h+c*d*p,this._y=c*d*h+l*u*p,this._z=c*u*p-l*d*h,this._w=c*u*h-l*d*p):"XZY"===a&&(this._x=l*u*h-c*d*p,this._y=c*d*h-l*u*p,this._z=c*u*p+l*d*h,this._w=c*u*h+l*d*p),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,i=e.elements,n=i[0],r=i[4],a=i[8],o=i[1],s=i[5],c=i[9],u=i[2],h=i[6],l=i[10],d=n+s+l;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(h-c)*t,this._y=(a-u)*t,this._z=(o-r)*t):n>s&&n>l?(t=2*Math.sqrt(1+n-s-l),this._w=(h-c)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+u)/t):s>l?(t=2*Math.sqrt(1+s-n-l),this._w=(a-u)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+l-n-s),this._w=(o-r)/t,this._x=(a+u)/t,this._y=(c+h)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new Bt;return function(i,n){return void 0===t&&(t=new Bt),(e=i.dot(n)+1)<1e-6?(e=0,Math.abs(i.x)>Math.abs(i.z)?t.set(-i.y,i.x,0):t.set(0,-i.z,i.y)):t.crossVectors(i,n),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var i=e._x,n=e._y,r=e._z,a=e._w,o=t._x,s=t._y,c=t._z,u=t._w;return this._x=i*u+a*o+n*c-r*s,this._y=n*u+a*s+r*o-i*c,this._z=r*u+a*c+i*s-n*o,this._w=a*u-i*o-n*s-r*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,n=this._y,r=this._z,a=this._w,o=a*e._w+i*e._x+n*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(i+this._x),this._y=.5*(n+this._y),this._z=.5*(r+this._z),this;var c=Math.atan2(s,o),u=Math.sin((1-t)*c)/s,h=Math.sin(t*c)/s;return this._w=a*u+this._w*h,this._x=i*u+this._x*h,this._y=n*u+this._y*h,this._z=r*u+this._z*h,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Bt.prototype,{isVector3:!0,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(M=new Pt,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(M.setFromEuler(e))}),applyAxisAngle:function(){var e=new Pt;return function(t,i){return this.applyQuaternion(e.setFromAxisAngle(t,i))}}(),applyMatrix3:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this},applyQuaternion:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*n-o*i,u=s*i+o*t-r*n,h=s*n+r*i-a*t,l=-r*t-a*i-o*n;return this.x=c*s+l*-r+u*-o-h*-a,this.y=u*s+l*-a+h*-r-c*-o,this.z=h*s+l*-o+c*-a-u*-r,this},project:function(){var e=new Ut;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new Ut;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new Bt,t=new Bt;return function(i,n){return e.set(i,i,i),t.set(n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=n*s-r*o,this.y=r*a-i*s,this.z=i*o-n*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new Bt;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new Bt;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(zt.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(kt.prototype,{isMatrix3:!0,set:function(e,t,i,n,r,a,o,s,c){var u=this.elements;return u[0]=e,u[1]=n,u[2]=o,u[3]=t,u[4]=r,u[5]=s,u[6]=i,u[7]=a,u[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var e=new Bt;return function(t){for(var i=0,n=t.count;i<n;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.applyMatrix3(this),t.setXYZ(i,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.elements,n=t.elements,r=this.elements,a=i[0],o=i[3],s=i[6],c=i[1],u=i[4],h=i[7],l=i[2],d=i[5],p=i[8],f=n[0],g=n[3],m=n[6],M=n[1],y=n[4],v=n[7],A=n[2],w=n[5],x=n[8];return r[0]=a*f+o*M+s*A,r[3]=a*g+o*y+s*w,r[6]=a*m+o*v+s*x,r[1]=c*f+u*M+h*A,r[4]=c*g+u*y+h*w,r[7]=c*m+u*v+h*x,r[2]=l*f+d*M+p*A,r[5]=l*g+d*y+p*w,r[8]=l*m+d*v+p*x,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],o=e[5],s=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-i*r*u+i*o*s+n*r*c-n*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var i=e.elements,n=this.elements,r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],u=i[5],h=i[6],l=i[7],d=i[8],p=d*c-u*l,f=u*h-d*s,g=l*s-c*h,m=r*p+a*f+o*g;if(0===m){var M="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(M);return console.warn(M),this.identity()}var y=1/m;return n[0]=p*y,n[1]=(o*l-d*a)*y,n[2]=(u*a-o*c)*y,n[3]=f*y,n[4]=(d*r-o*h)*y,n[5]=(o*s-u*r)*y,n[6]=g*y,n[7]=(a*h-l*r)*y,n[8]=(c*r-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,i,n,r,a,o){var s=Math.cos(r),c=Math.sin(r);this.set(i*s,i*c,-i*(s*a+c*o)+a+e,-n*c,n*s,-n*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this},rotate:function(e){var t=Math.cos(e),i=Math.sin(e),n=this.elements,r=n[0],a=n[3],o=n[6],s=n[1],c=n[4],u=n[7];return n[0]=t*r+i*s,n[3]=t*a+i*c,n[6]=t*o+i*u,n[1]=-i*r+t*s,n[4]=-i*a+t*c,n[7]=-i*o+t*u,this},translate:function(e,t){var i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this},equals:function(e){for(var t=this.elements,i=e.elements,n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;i<9;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}});var Ft,Gt,Qt,Yt,Vt,Ht=0;function Wt(e,t,i,n,r,a,o,s,c,u){Object.defineProperty(this,"id",{value:Ht++}),this.uuid=zt.generateUUID(),this.name="",this.image=void 0!==e?e:Wt.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Wt.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:Ne,this.wrapT=void 0!==n?n:Ne,this.magFilter=void 0!==r?r:_e,this.minFilter=void 0!==a?a:je,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:We,this.type=void 0!==s?s:Ce,this.offset=new Rt(0,0),this.repeat=new Rt(1,1),this.center=new Rt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new kt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:Dt,this.version=0,this.onUpdate=null}function Xt(e,t,i,n){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==n?n:1}function Zt(e,t,i){this.width=e,this.height=t,this.scissor=new Xt(0,0,e,t),this.scissorTest=!1,this.viewport=new Xt(0,0,e,t),void 0===(i=i||{}).minFilter&&(i.minFilter=_e),this.texture=new Wt(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.generateMipmaps=void 0===i.generateMipmaps||i.generateMipmaps,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function qt(e,t,i){Zt.call(this,e,t,i),this.activeCubeFace=0,this.activeMipMapLevel=0}function Jt(e,t,i,n,r,a,o,s,c,u,h,l){Wt.call(this,null,a,o,s,c,u,n,r,h,l),this.image={data:e,width:t,height:i},this.magFilter=void 0!==c?c:Le,this.minFilter=void 0!==u?u:Le,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Kt(e,t){this.min=void 0!==e?e:new Bt(1/0,1/0,1/0),this.max=void 0!==t?t:new Bt(-1/0,-1/0,-1/0)}function $t(e,t){this.center=void 0!==e?e:new Bt,this.radius=void 0!==t?t:0}function ei(e,t){this.normal=void 0!==e?e:new Bt(1,0,0),this.constant=void 0!==t?t:0}function ti(e,t,i,n,r,a){this.planes=[void 0!==e?e:new ei,void 0!==t?t:new ei,void 0!==i?i:new ei,void 0!==n?n:new ei,void 0!==r?r:new ei,void 0!==a?a:new ei]}Wt.DEFAULT_IMAGE=void 0,Wt.DEFAULT_MAPPING=300,Wt.prototype=Object.assign(Object.create(u.prototype),{constructor:Wt,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var n=this.image;void 0===n.uuid&&(n.uuid=zt.generateUUID()),t||void 0!==e.images[n.uuid]||(e.images[n.uuid]={uuid:n.uuid,url:function(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=e.width,t.height=e.height;var i=t.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height)}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}(n)}),i.image=n.uuid}return t||(e.textures[this.uuid]=i),i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300===this.mapping){if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Te:e.x=e.x-Math.floor(e.x);break;case Ne:e.x=e.x<0?0:1;break;case De:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Te:e.y=e.y-Math.floor(e.y);break;case Ne:e.y=e.y<0?0:1;break;case De:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.defineProperty(Wt.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Xt.prototype,{isVector4:!0,set:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,i,n,r,a=e.elements,o=a[0],s=a[4],c=a[8],u=a[1],h=a[5],l=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-u)<.01&&Math.abs(c-d)<.01&&Math.abs(l-p)<.01){if(Math.abs(s+u)<.1&&Math.abs(c+d)<.1&&Math.abs(l+p)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var g=(o+1)/2,m=(h+1)/2,M=(f+1)/2,y=(s+u)/4,v=(c+d)/4,A=(l+p)/4;return g>m&&g>M?g<.01?(i=0,n=.707106781,r=.707106781):(n=y/(i=Math.sqrt(g)),r=v/i):m>M?m<.01?(i=.707106781,n=0,r=.707106781):(i=y/(n=Math.sqrt(m)),r=A/n):M<.01?(i=.707106781,n=.707106781,r=0):(i=v/(r=Math.sqrt(M)),n=A/r),this.set(i,n,r,t),this}var w=Math.sqrt((p-l)*(p-l)+(c-d)*(c-d)+(u-s)*(u-s));return Math.abs(w)<.001&&(w=1),this.x=(p-l)/w,this.y=(c-d)/w,this.z=(u-s)/w,this.w=Math.acos((o+h+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(i,n){return void 0===e&&(e=new Xt,t=new Xt),e.set(i,i,i,i),t.set(n,n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Zt.prototype=Object.assign(Object.create(u.prototype),{constructor:Zt,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),qt.prototype=Object.create(Zt.prototype),qt.prototype.constructor=qt,qt.prototype.isWebGLRenderTargetCube=!0,Jt.prototype=Object.create(Wt.prototype),Jt.prototype.constructor=Jt,Jt.prototype.isDataTexture=!0,Object.assign(Kt.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var u=e[s],h=e[s+1],l=e[s+2];u<t&&(t=u),h<i&&(i=h),l<n&&(n=l),u>r&&(r=u),h>a&&(a=h),l>o&&(o=l)}return this.min.set(t,i,n),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var u=e.getX(s),h=e.getY(s),l=e.getZ(s);u<t&&(t=u),h<i&&(i=h),l<n&&(n=l),u>r&&(r=u),h>a&&(a=h),l>o&&(o=l)}return this.min.set(t,i,n),this.max.set(r,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new Bt;return function(t,i){var n=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Bt),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Bt),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e,t,i,n=new Bt;function r(r){var a=r.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(t=0,i=o.length;t<i;t++)n.copy(o[t]),n.applyMatrix4(r.matrixWorld),e.expandByPoint(n)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(t=0,i=s.count;t<i;t++)n.fromBufferAttribute(s,t).applyMatrix4(r.matrixWorld),e.expandByPoint(n)}}return function(t){return e=this,t.updateMatrixWorld(!0),t.traverse(r),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Bt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:(Ft=new Bt,function(e){return this.clampPoint(e.center,Ft),Ft.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=e.constant&&i>=e.constant},intersectsTriangle:function(){var e=new Bt,t=new Bt,i=new Bt,n=new Bt,r=new Bt,a=new Bt,o=new Bt,s=new Bt,c=new Bt,u=new Bt;function h(n){var r,a;for(r=0,a=n.length-3;r<=a;r+=3){o.fromArray(n,r);var s=c.x*Math.abs(o.x)+c.y*Math.abs(o.y)+c.z*Math.abs(o.z),u=e.dot(o),h=t.dot(o),l=i.dot(o);if(Math.max(-Math.max(u,h,l),Math.min(u,h,l))>s)return!1}return!0}return function(o){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(o.a,s),t.subVectors(o.b,s),i.subVectors(o.c,s),n.subVectors(t,e),r.subVectors(i,t),a.subVectors(e,i);var l=[0,-n.z,n.y,0,-r.z,r.y,0,-a.z,a.y,n.z,0,-n.x,r.z,0,-r.x,a.z,0,-a.x,-n.y,n.x,0,-r.y,r.x,0,-a.y,a.x,0];return!!h(l)&&(!!h(l=[1,0,0,0,1,0,0,0,1])&&(u.crossVectors(n,r),h(l=[u.x,u.y,u.z])))}}(),clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Bt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Bt;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new Bt;return function(t){return void 0===t&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),t=new $t),this.getCenter(t.center),t.radius=.5*this.getSize(e).length(),t}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){if(this.isEmpty())return this;var t=e.elements,i=t[0]*this.min.x,n=t[1]*this.min.x,r=t[2]*this.min.x,a=t[0]*this.max.x,o=t[1]*this.max.x,s=t[2]*this.max.x,c=t[4]*this.min.y,u=t[5]*this.min.y,h=t[6]*this.min.y,l=t[4]*this.max.y,d=t[5]*this.max.y,p=t[6]*this.max.y,f=t[8]*this.min.z,g=t[9]*this.min.z,m=t[10]*this.min.z,M=t[8]*this.max.z,y=t[9]*this.max.z,v=t[10]*this.max.z;return this.min.x=Math.min(i,a)+Math.min(c,l)+Math.min(f,M)+t[12],this.min.y=Math.min(n,o)+Math.min(u,d)+Math.min(g,y)+t[13],this.min.z=Math.min(r,s)+Math.min(h,p)+Math.min(m,v)+t[14],this.max.x=Math.max(i,a)+Math.max(c,l)+Math.max(f,M)+t[12],this.max.y=Math.max(n,o)+Math.max(u,d)+Math.max(g,y)+t[13],this.max.z=Math.max(r,s)+Math.max(h,p)+Math.max(m,v)+t[14],this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign($t.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(Gt=new Kt,function(e,t){var i=this.center;void 0!==t?i.copy(t):Gt.setFromPoints(e).getCenter(i);for(var n=0,r=0,a=e.length;r<a;r++)n=Math.max(n,i.distanceToSquared(e[r]));return this.radius=Math.sqrt(n),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var i=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Bt),t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Kt),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(ei.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new Bt,t=new Bt;return function(i,n,r){var a=e.subVectors(r,n).cross(t.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(a,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Bt),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new Bt;return function(t,i){void 0===i&&(console.warn("THREE.Plane: .intersectLine() target is now required"),i=new Bt);var n=t.delta(e),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?i.copy(t.start):void 0;var a=-(t.start.dot(this.normal)+this.constant)/r;return a<0||a>1?void 0:i.copy(n).multiplyScalar(a).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Bt),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new Bt,t=new kt;return function(i,n){var r=n||t.getNormalMatrix(i),a=this.coplanarPoint(e).applyMatrix4(i),o=this.normal.applyMatrix3(r).normalize();return this.constant=-a.dot(o),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(ti.prototype,{set:function(e,t,i,n,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,i=0;i<6;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements,n=i[0],r=i[1],a=i[2],o=i[3],s=i[4],c=i[5],u=i[6],h=i[7],l=i[8],d=i[9],p=i[10],f=i[11],g=i[12],m=i[13],M=i[14],y=i[15];return t[0].setComponents(o-n,h-s,f-l,y-g).normalize(),t[1].setComponents(o+n,h+s,f+l,y+g).normalize(),t[2].setComponents(o+r,h+c,f+d,y+m).normalize(),t[3].setComponents(o-r,h-c,f-d,y-m).normalize(),t[4].setComponents(o-a,h-u,f-p,y-M).normalize(),t[5].setComponents(o+a,h+u,f+p,y+M).normalize(),this},intersectsObject:(Vt=new $t,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Vt.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Vt)}),intersectsSprite:function(){var e=new $t;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,i=e.center,n=-e.radius,r=0;r<6;r++){if(t[r].distanceToPoint(i)<n)return!1}return!0},intersectsBox:(Qt=new Bt,Yt=new Bt,function(e){for(var t=this.planes,i=0;i<6;i++){var n=t[i];Qt.x=n.normal.x>0?e.min.x:e.max.x,Yt.x=n.normal.x>0?e.max.x:e.min.x,Qt.y=n.normal.y>0?e.min.y:e.max.y,Yt.y=n.normal.y>0?e.max.y:e.min.y,Qt.z=n.normal.z>0?e.min.z:e.max.z,Yt.z=n.normal.z>0?e.max.z:e.min.z;var r=n.distanceToPoint(Qt),a=n.distanceToPoint(Yt);if(r<0&&a<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}});var ii,ni={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n",lights_pars_maps:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif\n",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif\n",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy *= normalScale;\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}\n",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n"},ri={merge:function(e){for(var t={},i=0;i<e.length;i++){var n=this.clone(e[i]);for(var r in n)t[r]=n[r]}return t},clone:function(e){var t={};for(var i in e)for(var n in t[i]={},e[i]){var r=e[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?t[i][n]=r.clone():Array.isArray(r)?t[i][n]=r.slice():t[i][n]=r}return t}},ai={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function oi(e,t,i){return void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}Object.assign(oi.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(){function e(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}return function(t,i,n){if(t=zt.euclideanModulo(t,1),i=zt.clamp(i,0,1),n=zt.clamp(n,0,1),0===i)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+i):n+i-n*i,a=2*n-r;this.r=e(a,r,t+1/3),this.g=e(a,r,t),this.b=e(a,r,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n,r=i[1],a=i[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,c=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(o,s,c)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(e)){var u,h=(u=i[1]).length;if(3===h)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(u=ai[e])?this.setHex(u):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,i,n=this.r,r=this.g,a=this.b,o=Math.max(n,r,a),s=Math.min(n,r,a),c=(s+o)/2;if(s===o)t=0,i=0;else{var u=o-s;switch(i=c<=.5?u/(o+s):u/(2-o-s),o){case n:t=(r-a)/u+(r<a?6:0);break;case r:t=(a-n)/u+2;break;case a:t=(n-r)/u+4}t/=6}return e.h=t,e.s=i,e.l=c,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(ii={},function(e,t,i){return this.getHSL(ii),ii.h+=e,ii.s+=t,ii.l+=i,this.setHSL(ii.h,ii.s,ii.l),this}),add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var si,ci={common:{diffuse:{value:new oi(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new kt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new oi(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new oi(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new kt}}},ui={basic:{uniforms:ri.merge([ci.common,ci.specularmap,ci.envmap,ci.aomap,ci.lightmap,ci.fog]),vertexShader:ni.meshbasic_vert,fragmentShader:ni.meshbasic_frag},lambert:{uniforms:ri.merge([ci.common,ci.specularmap,ci.envmap,ci.aomap,ci.lightmap,ci.emissivemap,ci.fog,ci.lights,{emissive:{value:new oi(0)}}]),vertexShader:ni.meshlambert_vert,fragmentShader:ni.meshlambert_frag},phong:{uniforms:ri.merge([ci.common,ci.specularmap,ci.envmap,ci.aomap,ci.lightmap,ci.emissivemap,ci.bumpmap,ci.normalmap,ci.displacementmap,ci.gradientmap,ci.fog,ci.lights,{emissive:{value:new oi(0)},specular:{value:new oi(1118481)},shininess:{value:30}}]),vertexShader:ni.meshphong_vert,fragmentShader:ni.meshphong_frag},standard:{uniforms:ri.merge([ci.common,ci.envmap,ci.aomap,ci.lightmap,ci.emissivemap,ci.bumpmap,ci.normalmap,ci.displacementmap,ci.roughnessmap,ci.metalnessmap,ci.fog,ci.lights,{emissive:{value:new oi(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ni.meshphysical_vert,fragmentShader:ni.meshphysical_frag},points:{uniforms:ri.merge([ci.points,ci.fog]),vertexShader:ni.points_vert,fragmentShader:ni.points_frag},dashed:{uniforms:ri.merge([ci.common,ci.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ni.linedashed_vert,fragmentShader:ni.linedashed_frag},depth:{uniforms:ri.merge([ci.common,ci.displacementmap]),vertexShader:ni.depth_vert,fragmentShader:ni.depth_frag},normal:{uniforms:ri.merge([ci.common,ci.bumpmap,ci.normalmap,ci.displacementmap,{opacity:{value:1}}]),vertexShader:ni.normal_vert,fragmentShader:ni.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ni.cube_vert,fragmentShader:ni.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ni.equirect_vert,fragmentShader:ni.equirect_frag},distanceRGBA:{uniforms:ri.merge([ci.common,ci.displacementmap,{referencePosition:{value:new Bt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ni.distanceRGBA_vert,fragmentShader:ni.distanceRGBA_frag},shadow:{uniforms:ri.merge([ci.lights,ci.fog,{color:{value:new oi(0)},opacity:{value:1}}]),vertexShader:ni.shadow_vert,fragmentShader:ni.shadow_frag}};function hi(){var e=null,t=!1,i=null;function n(r,a){!1!==t&&(i(r,a),e.requestAnimationFrame(n))}return{start:function(){!0!==t&&null!==i&&(e.requestAnimationFrame(n),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function li(e){var t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(i){i.isInterleavedBufferAttribute&&(i=i.data);var n=t.get(i);n&&(e.deleteBuffer(n.buffer),t.delete(i))},update:function(i,n){i.isInterleavedBufferAttribute&&(i=i.data);var r=t.get(i);void 0===r?t.set(i,function(t,i){var n=t.array,r=t.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,a=e.createBuffer();e.bindBuffer(i,a),e.bufferData(i,n,r),t.onUploadCallback();var o=e.FLOAT;return n instanceof Float32Array?o=e.FLOAT:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?o=e.UNSIGNED_SHORT:n instanceof Int16Array?o=e.SHORT:n instanceof Uint32Array?o=e.UNSIGNED_INT:n instanceof Int32Array?o=e.INT:n instanceof Int8Array?o=e.BYTE:n instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:n.BYTES_PER_ELEMENT,version:t.version}}(i,n)):r.version<i.version&&(!function(t,i,n){var r=i.array,a=i.updateRange;e.bindBuffer(n,t),!1===i.dynamic?e.bufferData(n,r,e.STATIC_DRAW):-1===a.count?e.bufferSubData(n,0,r):0===a.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(n,a.offset*r.BYTES_PER_ELEMENT,r.subarray(a.offset,a.offset+a.count)),a.count=-1)}(r.buffer,i,n),r.version=i.version)}}}function di(e,t,i,n){this._x=e||0,this._y=t||0,this._z=i||0,this._order=n||di.DefaultOrder}function pi(){this.mask=1}ui.physical={uniforms:ri.merge([ui.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ni.meshphysical_vert,fragmentShader:ni.meshphysical_frag},di.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],di.DefaultOrder="XYZ",Object.defineProperties(di.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(di.prototype,{isEuler:!0,set:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,i){var n=zt.clamp,r=e.elements,a=r[0],o=r[4],s=r[8],c=r[1],u=r[5],h=r[9],l=r[2],d=r[6],p=r[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,u),this._z=0)):"YXZ"===t?(this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-l,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-l,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,u))):"YZX"===t?(this._z=Math.asin(n(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-l,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new Ut;return function(t,i,n){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,i,n)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(si=new Pt,function(e){return si.setFromEuler(this),this.setFromQuaternion(si,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Bt(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(pi.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var fi,gi,mi,Mi,yi=0;function vi(){Object.defineProperty(this,"id",{value:yi++}),this.uuid=zt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=vi.DefaultUp.clone();var e=new Bt,t=new di,i=new Pt,n=new Bt(1,1,1);t.onChange(function(){i.setFromEuler(t,!1)}),i.onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:n},modelViewMatrix:{value:new Ut},normalMatrix:{value:new kt}}),this.matrix=new Ut,this.matrixWorld=new Ut,this.matrixAutoUpdate=vi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new pi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Ai(){vi.call(this),this.type="Camera",this.matrixWorldInverse=new Ut,this.projectionMatrix=new Ut}function wi(e,t,i,n,r,a){Ai.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function xi(e,t,i,n,r,a){this.a=e,this.b=t,this.c=i,this.normal=n&&n.isVector3?n:new Bt,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new oi,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}vi.DefaultUp=new Bt(0,1,0),vi.DefaultMatrixAutoUpdate=!0,vi.prototype=Object.assign(Object.create(u.prototype),{constructor:vi,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(Mi=new Pt,function(e,t){return Mi.setFromAxisAngle(e,t),this.quaternion.multiply(Mi),this}),rotateOnWorldAxis:function(){var e=new Pt;return function(t,i){return e.setFromAxisAngle(t,i),this.quaternion.premultiply(e),this}}(),rotateX:function(){var e=new Bt(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new Bt(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new Bt(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new Bt;return function(t,i){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(i)),this}}(),translateX:function(){var e=new Bt(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new Bt(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new Bt(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(mi=new Ut,function(e){return e.applyMatrix4(mi.getInverse(this.matrixWorld))}),lookAt:function(){var e=new Ut,t=new Bt;return function(i,n,r){i.isVector3?t.copy(i):t.set(i,n,r),this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var i=this.children.indexOf(e);return-1!==i&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(i,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var i=0,n=this.children.length;i<n;i++){var r=this.children[i].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Bt),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(fi=new Bt,gi=new Bt,function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new Pt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(fi,e,gi),e}),getWorldScale:function(){var e=new Bt,t=new Pt;return function(i){return void 0===i&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),i=new Bt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,i),i}}(),getWorldDirection:function(){var e=new Pt;return function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Bt),this.getWorldQuaternion(e),t.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)},toJSON:function(e){var t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var n={};function r(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),void 0!==this.geometry){n.geometry=r(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,c=o.length;s<c;s++){var u=o[s];r(e.shapes,u)}else r(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(s=0,c=this.material.length;s<c;s++)h.push(r(e.materials,this.material[s]));n.material=h}else n.material=r(e.materials,this.material);if(this.children.length>0){n.children=[];for(s=0;s<this.children.length;s++)n.children.push(this.children[s].toJSON(e).object)}if(t){var l=g(e.geometries),d=g(e.materials),p=g(e.textures),f=g(e.images);o=g(e.shapes);l.length>0&&(i.geometries=l),d.length>0&&(i.materials=d),p.length>0&&(i.textures=p),f.length>0&&(i.images=f),o.length>0&&(i.shapes=o)}return i.object=n,i;function g(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var i=0;i<e.children.length;i++){var n=e.children[i];this.add(n.clone())}return this}}),Ai.prototype=Object.assign(Object.create(vi.prototype),{constructor:Ai,isCamera:!0,copy:function(e,t){return vi.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new Pt;return function(t){return void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Bt),this.getWorldQuaternion(e),t.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){vi.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),wi.prototype=Object.assign(Object.create(Ai.prototype),{constructor:wi,isOrthographicCamera:!0,copy:function(e,t){return Ai.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,i,n,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-e,a=i+e,o=n+t,s=n-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,l=(this.top-this.bottom)/this.view.height;a=(r+=h*(this.view.offsetX/c))+h*(this.view.width/c),s=(o-=l*(this.view.offsetY/u))-l*(this.view.height/u)}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far)},toJSON:function(e){var t=vi.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Object.assign(xi.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,i=e.vertexNormals.length;t<i;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,i=e.vertexColors.length;t<i;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Ei,Ti,Ni=0;function Di(){Object.defineProperty(this,"id",{value:Ni+=2}),this.uuid=zt.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Li(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===i,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function bi(e,t,i){Li.call(this,new Int8Array(e),t,i)}function Ii(e,t,i){Li.call(this,new Uint8Array(e),t,i)}function _i(e,t,i){Li.call(this,new Uint8ClampedArray(e),t,i)}function Si(e,t,i){Li.call(this,new Int16Array(e),t,i)}function ji(e,t,i){Li.call(this,new Uint16Array(e),t,i)}function Ci(e,t,i){Li.call(this,new Int32Array(e),t,i)}function Oi(e,t,i){Li.call(this,new Uint32Array(e),t,i)}function zi(e,t,i){Li.call(this,new Float32Array(e),t,i)}function Ri(e,t,i){Li.call(this,new Float64Array(e),t,i)}function Ui(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Pi(e){if(0===e.length)return-1/0;for(var t=e[0],i=1,n=e.length;i<n;++i)e[i]>t&&(t=e[i]);return t}Di.prototype=Object.assign(Object.create(u.prototype),{constructor:Di,isGeometry:!0,applyMatrix:function(e){for(var t=(new kt).getNormalMatrix(e),i=0,n=this.vertices.length;i<n;i++){this.vertices[i].applyMatrix4(e)}for(i=0,n=this.faces.length;i<n;i++){var r=this.faces[i];r.normal.applyMatrix3(t).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new Ut;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new Ut;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new Ut;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new Ut;return function(t,i,n){return e.makeTranslation(t,i,n),this.applyMatrix(e),this}}(),scale:function(){var e=new Ut;return function(t,i,n){return e.makeScale(t,i,n),this.applyMatrix(e),this}}(),lookAt:(Ti=new vi,function(e){Ti.lookAt(e),Ti.updateMatrix(),this.applyMatrix(Ti.matrix)}),fromBufferGeometry:function(e){var t=this,i=null!==e.index?e.index.array:void 0,n=e.attributes,r=n.position.array,a=void 0!==n.normal?n.normal.array:void 0,o=void 0!==n.color?n.color.array:void 0,s=void 0!==n.uv?n.uv.array:void 0,c=void 0!==n.uv2?n.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var u=[],h=[],l=[],d=0,p=0;d<r.length;d+=3,p+=2)t.vertices.push(new Bt(r[d],r[d+1],r[d+2])),void 0!==a&&u.push(new Bt(a[d],a[d+1],a[d+2])),void 0!==o&&t.colors.push(new oi(o[d],o[d+1],o[d+2])),void 0!==s&&h.push(new Rt(s[p],s[p+1])),void 0!==c&&l.push(new Rt(c[p],c[p+1]));function f(e,i,n,r){var d=new xi(e,i,n,void 0!==a?[u[e].clone(),u[i].clone(),u[n].clone()]:[],void 0!==o?[t.colors[e].clone(),t.colors[i].clone(),t.colors[n].clone()]:[],r);t.faces.push(d),void 0!==s&&t.faceVertexUvs[0].push([h[e].clone(),h[i].clone(),h[n].clone()]),void 0!==c&&t.faceVertexUvs[1].push([l[e].clone(),l[i].clone(),l[n].clone()])}var g=e.groups;if(g.length>0)for(d=0;d<g.length;d++)for(var m=g[d],M=m.start,y=(p=M,M+m.count);p<y;p+=3)void 0!==i?f(i[p],i[p+1],i[p+2],m.materialIndex):f(p,p+1,p+2,m.materialIndex);else if(void 0!==i)for(d=0;d<i.length;d+=3)f(i[d],i[d+1],i[d+2]);else for(d=0;d<r.length/3;d+=3)f(d,d+1,d+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:(Ei=new Bt,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ei).negate(),this.translate(Ei.x,Ei.y,Ei.z),this}),normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,i=0===t?1:1/t,n=new Ut;return n.set(i,0,0,-i*e.x,0,i,0,-i*e.y,0,0,i,-i*e.z,0,0,0,1),this.applyMatrix(n),this},computeFaceNormals:function(){for(var e=new Bt,t=new Bt,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,i,n,r,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,i=this.vertices.length;t<i;t++)o[t]=new Bt;if(e){var s,c,u,h=new Bt,l=new Bt;for(n=0,r=this.faces.length;n<r;n++)a=this.faces[n],s=this.vertices[a.a],c=this.vertices[a.b],u=this.vertices[a.c],h.subVectors(u,c),l.subVectors(s,c),h.cross(l),o[a.a].add(h),o[a.b].add(h),o[a.c].add(h)}else for(this.computeFaceNormals(),n=0,r=this.faces.length;n<r;n++)o[(a=this.faces[n]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,i=this.vertices.length;t<i;t++)o[t].normalize();for(n=0,r=this.faces.length;n<r;n++){var d=(a=this.faces[n]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,i;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var n=(i=this.faces[e]).vertexNormals;3===n.length?(n[0].copy(i.normal),n[1].copy(i.normal),n[2].copy(i.normal)):(n[0]=i.normal.clone(),n[1]=i.normal.clone(),n[2]=i.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,i,n,r;for(i=0,n=this.faces.length;i<n;i++)for((r=this.faces[i]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var a=new Di;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(i=0,n=this.faces.length;i<n;i++)c=new Bt,u={a:new Bt,b:new Bt,c:new Bt},o.push(c),s.push(u)}var c,u,h=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),i=0,n=this.faces.length;i<n;i++)r=this.faces[i],c=h.faceNormals[i],u=h.vertexNormals[i],c.copy(r.normal),u.a.copy(r.vertexNormals[0]),u.b.copy(r.vertexNormals[1]),u.c.copy(r.vertexNormals[2])}for(i=0,n=this.faces.length;i<n;i++)(r=this.faces[i]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new $t),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,i){if(e&&e.isGeometry){var n,r=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,u=this.faceVertexUvs[0],h=e.faceVertexUvs[0],l=this.colors,d=e.colors;void 0===i&&(i=0),void 0!==t&&(n=(new kt).getNormalMatrix(t));for(var p=0,f=o.length;p<f;p++){var g=o[p].clone();void 0!==t&&g.applyMatrix4(t),a.push(g)}for(p=0,f=d.length;p<f;p++)l.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var m,M,y,v=c[p],A=v.vertexNormals,w=v.vertexColors;(m=new xi(v.a+r,v.b+r,v.c+r)).normal.copy(v.normal),void 0!==n&&m.normal.applyMatrix3(n).normalize();for(var x=0,E=A.length;x<E;x++)M=A[x].clone(),void 0!==n&&M.applyMatrix3(n).normalize(),m.vertexNormals.push(M);m.color.copy(v.color);for(x=0,E=w.length;x<E;x++)y=w[x],m.vertexColors.push(y.clone());m.materialIndex=v.materialIndex+i,s.push(m)}for(p=0,f=h.length;p<f;p++){var T=h[p],N=[];if(void 0!==T){for(x=0,E=T.length;x<E;x++)N.push(T[x].clone());u.push(N)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,i,n,r,a,o,s,c={},u=[],h=[],l=Math.pow(10,4);for(i=0,n=this.vertices.length;i<n;i++)e=this.vertices[i],void 0===c[t=Math.round(e.x*l)+"_"+Math.round(e.y*l)+"_"+Math.round(e.z*l)]?(c[t]=i,u.push(this.vertices[i]),h[i]=u.length-1):h[i]=h[c[t]];var d=[];for(i=0,n=this.faces.length;i<n;i++){(r=this.faces[i]).a=h[r.a],r.b=h[r.b],r.c=h[r.c],a=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(i);break}}for(i=d.length-1;i>=0;i--){var f=d[i];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var g=this.vertices.length-u.length;return this.vertices=u,g},setFromPoints:function(e){this.vertices=[];for(var t=0,i=e.length;t<i;t++){var n=e[t];this.vertices.push(new Bt(n.x,n.y,n.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,i=0;i<t;i++)e[i]._id=i;e.sort(function(e,t){return e.materialIndex-t.materialIndex});var n,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(n=[]),o&&o.length===t&&(r=[]);for(i=0;i<t;i++){var s=e[i]._id;n&&n.push(a[s]),r&&r.push(o[s])}n&&(this.faceVertexUvs[0]=n),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}for(var n=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];n.push(a.x,a.y,a.z)}var o=[],s=[],c={},u=[],h={},l=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],g=p.normal.length()>0,m=p.vertexNormals.length>0,M=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,v=0;if(v=E(v,0,0),v=E(v,1,!0),v=E(v,2,!1),v=E(v,3,f),v=E(v,4,g),v=E(v,5,m),v=E(v,6,M),v=E(v,7,y),o.push(v),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var A=this.faceVertexUvs[0][r];o.push(D(A[0]),D(A[1]),D(A[2]))}if(g&&o.push(T(p.normal)),m){var w=p.vertexNormals;o.push(T(w[0]),T(w[1]),T(w[2]))}if(M&&o.push(N(p.color)),y){var x=p.vertexColors;o.push(N(x[0]),N(x[1]),N(x[2]))}}function E(e,t,i){return i?e|1<<t:e&~(1<<t)}function T(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]?c[t]:(c[t]=s.length/3,s.push(e.x,e.y,e.z),c[t])}function N(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]?h[t]:(h[t]=u.length,u.push(e.getHex()),h[t])}function D(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]?d[t]:(d[t]=l.length/2,l.push(e.x,e.y),d[t])}return e.data={},e.data.vertices=n,e.data.normals=s,u.length>0&&(e.data.colors=u),l.length>0&&(e.data.uvs=[l]),e.data.faces=o,e},clone:function(){return(new Di).copy(this)},copy:function(e){var t,i,n,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,i=s.length;t<i;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,i=c.length;t<i;t++)this.colors.push(c[t].clone());var u=e.faces;for(t=0,i=u.length;t<i;t++)this.faces.push(u[t].clone());for(t=0,i=e.faceVertexUvs.length;t<i;t++){var h=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),n=0,r=h.length;n<r;n++){var l=h[n],d=[];for(a=0,o=l.length;a<o;a++){var p=l[a];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,i=f.length;t<i;t++){var g={};if(g.name=f[t].name,void 0!==f[t].vertices)for(g.vertices=[],n=0,r=f[t].vertices.length;n<r;n++)g.vertices.push(f[t].vertices[n].clone());if(void 0!==f[t].normals)for(g.normals=[],n=0,r=f[t].normals.length;n<r;n++)g.normals.push(f[t].normals[n].clone());this.morphTargets.push(g)}var m=e.morphNormals;for(t=0,i=m.length;t<i;t++){var M={};if(void 0!==m[t].vertexNormals)for(M.vertexNormals=[],n=0,r=m[t].vertexNormals.length;n<r;n++){var y=m[t].vertexNormals[n],v={};v.a=y.a.clone(),v.b=y.b.clone(),v.c=y.c.clone(),M.vertexNormals.push(v)}if(void 0!==m[t].faceNormals)for(M.faceNormals=[],n=0,r=m[t].faceNormals.length;n<r;n++)M.faceNormals.push(m[t].faceNormals[n].clone());this.morphNormals.push(M)}var A=e.skinWeights;for(t=0,i=A.length;t<i;t++)this.skinWeights.push(A[t].clone());var w=e.skinIndices;for(t=0,i=w.length;t<i;t++)this.skinIndices.push(w[t].clone());var x=e.lineDistances;for(t=0,i=x.length;t<i;t++)this.lineDistances.push(x[t]);var E=e.boundingBox;null!==E&&(this.boundingBox=E.clone());var T=e.boundingSphere;return null!==T&&(this.boundingSphere=T.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Li.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Li.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.itemSize:0,this.array=e,this},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,i=0,n=0,r=e.length;n<r;n++){var a=e[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),a=new oi),t[i++]=a.r,t[i++]=a.g,t[i++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,i=0,n=0,r=e.length;n<r;n++){var a=e[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),a=new Rt),t[i++]=a.x,t[i++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,i=0,n=0,r=e.length;n<r;n++){var a=e[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),a=new Bt),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,i=0,n=0,r=e.length;n<r;n++){var a=e[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),a=new Xt),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z,t[i++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this},setXYZ:function(e,t,i,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this},setXYZW:function(e,t,i,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),bi.prototype=Object.create(Li.prototype),bi.prototype.constructor=bi,Ii.prototype=Object.create(Li.prototype),Ii.prototype.constructor=Ii,_i.prototype=Object.create(Li.prototype),_i.prototype.constructor=_i,Si.prototype=Object.create(Li.prototype),Si.prototype.constructor=Si,ji.prototype=Object.create(Li.prototype),ji.prototype.constructor=ji,Ci.prototype=Object.create(Li.prototype),Ci.prototype.constructor=Ci,Oi.prototype=Object.create(Li.prototype),Oi.prototype.constructor=Oi,zi.prototype=Object.create(Li.prototype),zi.prototype.constructor=zi,Ri.prototype=Object.create(Li.prototype),Ri.prototype.constructor=Ri,Object.assign(Ui.prototype,{computeGroups:function(e){for(var t,i=[],n=void 0,r=e.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==n&&(n=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,i.push(t)),t={start:3*a,materialIndex:n})}void 0!==t&&(t.count=3*a-t.start,i.push(t)),this.groups=i},fromGeometry:function(e){var t,i=e.faces,n=e.vertices,r=e.faceVertexUvs,a=r[0]&&r[0].length>0,o=r[1]&&r[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var u=0;u<c;u++)t[u]=[];this.morphTargets.position=t}var h,l=e.morphNormals,d=l.length;if(d>0){h=[];for(u=0;u<d;u++)h[u]=[];this.morphTargets.normal=h}var p=e.skinIndices,f=e.skinWeights,g=p.length===n.length,m=f.length===n.length;0===i.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u<i.length;u++){var M=i[u];this.vertices.push(n[M.a],n[M.b],n[M.c]);var y=M.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var v=M.normal;this.normals.push(v,v,v)}var A,w=M.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var x=M.color;this.colors.push(x,x,x)}if(!0===a)void 0!==(A=r[0][u])?this.uvs.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new Rt,new Rt,new Rt));if(!0===o)void 0!==(A=r[1][u])?this.uvs2.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new Rt,new Rt,new Rt));for(var E=0;E<c;E++){var T=s[E].vertices;t[E].push(T[M.a],T[M.b],T[M.c])}for(E=0;E<d;E++){var N=l[E].vertexNormals[u];h[E].push(N.a,N.b,N.c)}g&&this.skinIndices.push(p[M.a],p[M.b],p[M.c]),m&&this.skinWeights.push(f[M.a],f[M.b],f[M.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}});var Bi=1;function ki(){Object.defineProperty(this,"id",{value:Bi+=2}),this.uuid=zt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Fi(e,t,i,n,r,a){Di.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new Gi(e,t,i,n,r,a)),this.mergeVertices()}function Gi(e,t,i,n,r,a){ki.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};var o=this;e=e||1,t=t||1,i=i||1,n=Math.floor(n)||1,r=Math.floor(r)||1,a=Math.floor(a)||1;var s=[],c=[],u=[],h=[],l=0,d=0;function p(e,t,i,n,r,a,p,f,g,m,M){var y,v,A=a/g,w=p/m,x=a/2,E=p/2,T=f/2,N=g+1,D=m+1,L=0,b=0,I=new Bt;for(v=0;v<D;v++){var _=v*w-E;for(y=0;y<N;y++){var S=y*A-x;I[e]=S*n,I[t]=_*r,I[i]=T,c.push(I.x,I.y,I.z),I[e]=0,I[t]=0,I[i]=f>0?1:-1,u.push(I.x,I.y,I.z),h.push(y/g),h.push(1-v/m),L+=1}}for(v=0;v<m;v++)for(y=0;y<g;y++){var j=l+y+N*v,C=l+y+N*(v+1),O=l+(y+1)+N*(v+1),z=l+(y+1)+N*v;s.push(j,C,z),s.push(C,O,z),b+=6}o.addGroup(d,b,M),d+=b,l+=L}p("z","y","x",-1,-1,i,t,e,a,r,0),p("z","y","x",1,-1,i,t,-e,a,r,1),p("x","z","y",1,1,e,i,t,n,a,2),p("x","z","y",1,-1,e,i,-t,n,a,3),p("x","y","z",1,-1,e,t,i,n,r,4),p("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(s),this.addAttribute("position",new zi(c,3)),this.addAttribute("normal",new zi(u,3)),this.addAttribute("uv",new zi(h,2))}function Qi(e,t,i,n){Di.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new Yi(e,t,i,n)),this.mergeVertices()}function Yi(e,t,i,n){ki.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};var r,a,o=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(i)||1,u=Math.floor(n)||1,h=c+1,l=u+1,d=e/c,p=t/u,f=[],g=[],m=[],M=[];for(a=0;a<l;a++){var y=a*p-s;for(r=0;r<h;r++){var v=r*d-o;g.push(v,-y,0),m.push(0,0,1),M.push(r/c),M.push(1-a/u)}}for(a=0;a<u;a++)for(r=0;r<c;r++){var A=r+h*a,w=r+h*(a+1),x=r+1+h*(a+1),E=r+1+h*a;f.push(A,w,E),f.push(w,x,E)}this.setIndex(f),this.addAttribute("position",new zi(g,3)),this.addAttribute("normal",new zi(m,3)),this.addAttribute("uv",new zi(M,2))}ki.prototype=Object.assign(Object.create(u.prototype),{constructor:ki,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(Pi(e)>65535?Oi:ji)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(e,new Li(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,i){this.groups.push({start:e,count:t,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var i=this.attributes.normal;void 0!==i&&((new kt).getNormalMatrix(e).applyToBufferAttribute(i),i.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new Ut;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new Ut;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new Ut;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new Ut;return function(t,i,n){return e.makeTranslation(t,i,n),this.applyMatrix(e),this}}(),scale:function(){var e=new Ut;return function(t,i,n){return e.makeScale(t,i,n),this.applyMatrix(e),this}}(),lookAt:function(){var e=new vi;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){var e=new Bt;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(e).negate(),this.translate(e.x,e.y,e.z),this}}(),setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var i=new zi(3*t.vertices.length,3),n=new zi(3*t.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(t.vertices)),this.addAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new zi(t.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],i=0,n=e.length;i<n;i++){var r=e[i];t.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new zi(t,3)),this},updateFromObject:function(e){var t,i=e.geometry;if(e.isMesh){var n=i.__directGeometry;if(!0===i.elementsNeedUpdate&&(n=void 0,i.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(i);n.verticesNeedUpdate=i.verticesNeedUpdate,n.normalsNeedUpdate=i.normalsNeedUpdate,n.colorsNeedUpdate=i.colorsNeedUpdate,n.uvsNeedUpdate=i.uvsNeedUpdate,n.groupsNeedUpdate=i.groupsNeedUpdate,i.verticesNeedUpdate=!1,i.normalsNeedUpdate=!1,i.colorsNeedUpdate=!1,i.uvsNeedUpdate=!1,i.groupsNeedUpdate=!1,i=n}return!0===i.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(i.vertices),t.needsUpdate=!0),i.verticesNeedUpdate=!1),!0===i.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(i.normals),t.needsUpdate=!0),i.normalsNeedUpdate=!1),!0===i.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(i.colors),t.needsUpdate=!0),i.colorsNeedUpdate=!1),i.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(i.uvs),t.needsUpdate=!0),i.uvsNeedUpdate=!1),i.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(i.lineDistances),t.needsUpdate=!0),i.lineDistancesNeedUpdate=!1),i.groupsNeedUpdate&&(i.computeGroups(e.geometry),this.groups=i.groups,i.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Ui).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Li(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var i=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Li(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var n=new Float32Array(3*e.colors.length);this.addAttribute("color",new Li(n,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Li(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Li(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[o],u=0,h=c.length;u<h;u++){var l=c[u],d=new zi(3*l.length,3);s.push(d.copyVector3sArray(l))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var p=new zi(4*e.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new zi(4*e.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kt);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new Kt,t=new Bt;return function(){null===this.boundingSphere&&(this.boundingSphere=new $t);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;e.setFromBufferAttribute(i),e.getCenter(n);for(var r=0,a=0,o=i.count;a<o;a++)t.x=i.getX(a),t.y=i.getY(a),t.z=i.getZ(a),r=Math.max(r,n.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,i=this.groups;if(t.position){var n=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Li(new Float32Array(n.length),3));else for(var r=t.normal.array,a=0,o=r.length;a<o;a++)r[a]=0;var s,c,u,h=t.normal.array,l=new Bt,d=new Bt,p=new Bt,f=new Bt,g=new Bt;if(e){var m=e.array;0===i.length&&this.addGroup(0,m.length);for(var M=0,y=i.length;M<y;++M){var v=i[M],A=v.start;for(a=A,o=A+v.count;a<o;a+=3)s=3*m[a+0],c=3*m[a+1],u=3*m[a+2],l.fromArray(n,s),d.fromArray(n,c),p.fromArray(n,u),f.subVectors(p,d),g.subVectors(l,d),f.cross(g),h[s]+=f.x,h[s+1]+=f.y,h[s+2]+=f.z,h[c]+=f.x,h[c+1]+=f.y,h[c+2]+=f.z,h[u]+=f.x,h[u+1]+=f.y,h[u+2]+=f.z}}else for(a=0,o=n.length;a<o;a+=9)l.fromArray(n,a),d.fromArray(n,a+3),p.fromArray(n,a+6),f.subVectors(p,d),g.subVectors(l,d),f.cross(g),h[a]=f.x,h[a+1]=f.y,h[a+2]=f.z,h[a+3]=f.x,h[a+4]=f.y,h[a+5]=f.z,h[a+6]=f.x,h[a+7]=f.y,h[a+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var i=this.attributes;for(var n in i)if(void 0!==e.attributes[n])for(var r=i[n].array,a=e.attributes[n],o=a.array,s=0,c=a.itemSize*t;s<o.length;s++,c++)r[c]=o[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){var e=new Bt;return function(){for(var t=this.attributes.normal,i=0,n=t.count;i<n;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.normalize(),t.setXYZ(i,e.x,e.y,e.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new ki,t=this.index.array,i=this.attributes;for(var n in i){for(var r=i[n],a=r.array,o=r.itemSize,s=new a.constructor(t.length*o),c=0,u=0,h=0,l=t.length;h<l;h++){c=t[h]*o;for(var d=0;d<o;d++)s[u++]=a[c++]}e.addAttribute(n,new Li(s,o))}var p=this.groups;for(h=0,l=p.length;h<l;h++){var f=p[h];e.addGroup(f.start,f.count,f.materialIndex)}return e},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var n=this.index;if(null!==n){var r=Array.prototype.slice.call(n.array);e.data.index={type:n.array.constructor.name,array:r}}var a=this.attributes;for(var i in a){var o=a[i];r=Array.prototype.slice.call(o.array);e.data.attributes[i]={itemSize:o.itemSize,type:o.array.constructor.name,array:r,normalized:o.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new ki).copy(this)},copy:function(e){var t,i,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],u=s[t];for(i=0,n=u.length;i<n;i++)c.push(u[i].clone());this.morphAttributes[t]=c}var h=e.groups;for(i=0,n=h.length;i<n;i++){var l=h[i];this.addGroup(l.start,l.count,l.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Fi.prototype=Object.create(Di.prototype),Fi.prototype.constructor=Fi,Gi.prototype=Object.create(ki.prototype),Gi.prototype.constructor=Gi,Qi.prototype=Object.create(Di.prototype),Qi.prototype.constructor=Qi,Yi.prototype=Object.create(ki.prototype),Yi.prototype.constructor=Yi;var Vi,Hi,Wi,Xi,Zi,qi,Ji,Ki=0;function $i(){Object.defineProperty(this,"id",{value:Ki++}),this.uuid=zt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=O,this.side=L,this.flatShading=!1,this.vertexColors=_,this.opacity=1,this.transparent=!1,this.blendSrc=X,this.blendDst=Z,this.blendEquation=B,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=re,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function en(e){$i.call(this),this.type="MeshBasicMaterial",this.color=new oi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ue,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function tn(e){$i.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function nn(e,t){this.origin=void 0!==e?e:new Bt,this.direction=void 0!==t?t:new Bt}function rn(e,t){this.start=void 0!==e?e:new Bt,this.end=void 0!==t?t:new Bt}function an(e,t,i){this.a=void 0!==e?e:new Bt,this.b=void 0!==t?t:new Bt,this.c=void 0!==i?i:new Bt}function on(e,t){vi.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new ki,this.material=void 0!==t?t:new en({color:16777215*Math.random()}),this.drawMode=Et,this.updateMorphTargets()}function sn(e,t,i,n){var r,a,o,s=new oi(0),c=0;function u(e,i){t.buffers.color.setClear(e.r,e.g,e.b,i,n)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),u(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){u(s,c=e)},render:function(t,n,h,l){var d=n.background;null===d?u(s,c):d&&d.isColor&&(u(d,1),l=!0),(e.autoClear||l)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&d.isCubeTexture?(void 0===o&&((o=new on(new Gi(1,1,1),new tn({uniforms:ui.cube.uniforms,vertexShader:ui.cube.vertexShader,fragmentShader:ui.cube.fragmentShader,side:b,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},i.update(o)),o.material.uniforms.tCube.value=d,t.push(o,o.geometry,o.material,0,null)):d&&d.isTexture&&(void 0===r&&(r=new wi(-1,1,1,-1,0,1),a=new on(new Yi(2,2),new en({depthTest:!1,depthWrite:!1,fog:!1})),i.update(a)),a.material.map=d,e.renderBufferDirect(r,null,a.geometry,a.material,a,null))}}}function cn(e,t,i){var n;this.setMode=function(e){n=e},this.render=function(t,r){e.drawArrays(n,t,r),i.update(r,n)},this.renderInstances=function(e,r,a){var o=t.get("ANGLE_instanced_arrays");null!==o?(o.drawArraysInstancedANGLE(n,r,a,e.maxInstancedCount),i.update(a,n,e.maxInstancedCount)):console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function un(e,t,i){var n;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a=void 0!==i.precision?i.precision:"highp",o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);var s=!0===i.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),l=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),p=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),g=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),m=u>0,M=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==n)return n;var i=t.get("EXT_texture_filter_anisotropic");return n=null!==i?e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:l,maxAttributes:d,maxVertexUniforms:p,maxVaryings:f,maxFragmentUniforms:g,vertexTextures:m,floatFragmentTextures:M,floatVertexTextures:m&&M}}function hn(){var e=this,t=null,i=0,n=!1,r=!1,a=new ei,o=new kt,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(t,i,n,r){var c=null!==t?t.length:0,u=null;if(0!==c){if(u=s.value,!0!==r||null===u){var h=n+4*c,l=i.matrixWorldInverse;o.getNormalMatrix(l),(null===u||u.length<h)&&(u=new Float32Array(h));for(var d=0,p=n;d!==c;++d,p+=4)a.copy(t[d]).applyMatrix4(l,o),a.normal.toArray(u,p),u[p+3]=a.constant}s.value=u,s.needsUpdate=!0}return e.numPlanes=c,u}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,r,a){var o=0!==e.length||r||0!==i||n;return n=r,t=u(e,a,0),i=e.length,o},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1,c()},this.setState=function(e,a,o,h,l,d){if(!n||null===e||0===e.length||r&&!o)r?u(null):c();else{var p=r?0:i,f=4*p,g=l.clippingState||null;s.value=g,g=u(e,h,f,d);for(var m=0;m!==f;++m)g[m]=t[m];l.clippingState=g,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}}}function ln(e){var t={};return{get:function(i){if(void 0!==t[i])return t[i];var n;switch(i){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(i)}return null===n&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=n,n}}}function dn(e,t,i){var n={},r={};function a(e){var o=e.target,s=n[o.id];for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener("dispose",a),delete n[o.id];var u=r[o.id];u&&(t.remove(u),delete r[o.id]),(u=r[s.id])&&(t.remove(u),delete r[s.id]),i.memory.geometries--}return{get:function(e,t){var r=n[t.id];return r||(t.addEventListener("dispose",a),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new ki).setFromObject(e)),r=t._bufferGeometry),n[t.id]=r,i.memory.geometries++,r)},update:function(i){var n=i.index,r=i.attributes;for(var a in null!==n&&t.update(n,e.ELEMENT_ARRAY_BUFFER),r)t.update(r[a],e.ARRAY_BUFFER);var o=i.morphAttributes;for(var a in o)for(var s=o[a],c=0,u=s.length;c<u;c++)t.update(s[c],e.ARRAY_BUFFER)},getWireframeAttribute:function(i){var n=r[i.id];if(n)return n;var a,o=[],s=i.index,c=i.attributes;if(null!==s)for(var u=0,h=(a=s.array).length;u<h;u+=3){var l=a[u+0],d=a[u+1],p=a[u+2];o.push(l,d,d,p,p,l)}else for(u=0,h=(a=c.position.array).length/3-1;u<h;u+=3){l=u+0,d=u+1,p=u+2;o.push(l,d,d,p,p,l)}return n=new(Pi(o)>65535?Oi:ji)(o,1),t.update(n,e.ELEMENT_ARRAY_BUFFER),r[i.id]=n,n}}}function pn(e,t,i){var n,r,a;this.setMode=function(e){n=e},this.setIndex=function(e){r=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(n,o,r,t*a),i.update(o,n)},this.renderInstances=function(e,o,s){var c=t.get("ANGLE_instanced_arrays");null!==c?(c.drawElementsInstancedANGLE(n,s,r,o*a,e.maxInstancedCount),i.update(s,n,e.maxInstancedCount)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function fn(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(i,n,r){switch(r=r||1,t.calls++,n){case e.TRIANGLES:t.triangles+=r*(i/3);break;case e.TRIANGLE_STRIP:case e.TRIANGLE_FAN:t.triangles+=r*(i-2);break;case e.LINES:t.lines+=r*(i/2);break;case e.LINE_STRIP:t.lines+=r*(i-1);break;case e.LINE_LOOP:t.lines+=r*i;break;case e.POINTS:t.points+=r*i;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function gn(e,t){return Math.abs(t[1])-Math.abs(e[1])}function mn(e){var t={},i=new Float32Array(8);return{update:function(n,r,a,o){var s=n.morphTargetInfluences,c=s.length,u=t[r.id];if(void 0===u){u=[];for(var h=0;h<c;h++)u[h]=[h,0];t[r.id]=u}var l=a.morphTargets&&r.morphAttributes.position,d=a.morphNormals&&r.morphAttributes.normal;for(h=0;h<c;h++){0!==(p=u[h])[1]&&(l&&r.removeAttribute("morphTarget"+h),d&&r.removeAttribute("morphNormal"+h))}for(h=0;h<c;h++){(p=u[h])[0]=h,p[1]=s[h]}for(u.sort(gn),h=0;h<8;h++){var p;if(p=u[h]){var f=p[0],g=p[1];if(g){l&&r.addAttribute("morphTarget"+h,l[f]),d&&r.addAttribute("morphNormal"+h,d[f]),i[h]=g;continue}}i[h]=0}o.getUniforms().setValue(e,"morphTargetInfluences",i)}}}function Mn(e,t){var i={};return{update:function(n){var r=t.render.frame,a=n.geometry,o=e.get(n,a);return i[o.id]!==r&&(a.isGeometry&&o.updateFromObject(n),e.update(o),i[o.id]=r),o},dispose:function(){i={}}}}function yn(e,t,i,n,r,a,o,s,c,u){e=void 0!==e?e:[],t=void 0!==t?t:Me,Wt.call(this,e,t,i,n,r,a,o,s,c,u),this.flipY=!1}$i.prototype=Object.assign(Object.create(u.prototype),{constructor:$i,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i)if("shading"!==t){var n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]="overdraw"===t?Number(i):i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearCoat&&(i.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(i.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,i.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==O&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),this.side!==L&&(i.side=this.side),this.vertexColors!==_&&(i.vertexColors=this.vertexColors),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,0!==this.rotation&&(i.rotation=this.rotation),1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t){var r=n(e.textures),a=n(e.images);r.length>0&&(i.textures=r),a.length>0&&(i.images=a)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,i=null;if(null!==t){var n=t.length;i=new Array(n);for(var r=0;r!==n;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),en.prototype=Object.create($i.prototype),en.prototype.constructor=en,en.prototype.isMeshBasicMaterial=!0,en.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},tn.prototype=Object.create($i.prototype),tn.prototype.constructor=tn,tn.prototype.isShaderMaterial=!0,tn.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ri.clone(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},tn.prototype.toJSON=function(e){var t=$i.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},Object.assign(nn.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Bt),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new Bt;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Bt),t.subVectors(e,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new Bt;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:(Hi=new Bt,Wi=new Bt,Xi=new Bt,function(e,t,i,n){Hi.copy(e).add(t).multiplyScalar(.5),Wi.copy(t).sub(e).normalize(),Xi.copy(this.origin).sub(Hi);var r,a,o,s,c=.5*e.distanceTo(t),u=-this.direction.dot(Wi),h=Xi.dot(this.direction),l=-Xi.dot(Wi),d=Xi.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(a=u*h-l,s=c*p,(r=u*l-h)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(r*=f)*(r+u*(a*=f)+2*h)+a*(u*r+a+2*l)+d}else a=c,o=-(r=Math.max(0,-(u*a+h)))*r+a*(a+2*l)+d;else a=-c,o=-(r=Math.max(0,-(u*a+h)))*r+a*(a+2*l)+d;else a<=-s?o=-(r=Math.max(0,-(-u*c+h)))*r+(a=r>0?-c:Math.min(Math.max(-c,-l),c))*(a+2*l)+d:a<=s?(r=0,o=(a=Math.min(Math.max(-c,-l),c))*(a+2*l)+d):o=-(r=Math.max(0,-(u*c+h)))*r+(a=r>0?c:Math.min(Math.max(-c,-l),c))*(a+2*l)+d;else a=u>0?-c:c,o=-(r=Math.max(0,-(u*a+h)))*r+a*(a+2*l)+d;return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(Wi).multiplyScalar(a).add(Hi),o}),intersectSphere:function(){var e=new Bt;return function(t,i){e.subVectors(t.center,this.origin);var n=e.dot(this.direction),r=e.dot(e)-n*n,a=t.radius*t.radius;if(r>a)return null;var o=Math.sqrt(a-r),s=n-o,c=n+o;return s<0&&c<0?null:s<0?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null},intersectPlane:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var i,n,r,a,o,s,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,l=this.origin;return c>=0?(i=(e.min.x-l.x)*c,n=(e.max.x-l.x)*c):(i=(e.max.x-l.x)*c,n=(e.min.x-l.x)*c),u>=0?(r=(e.min.y-l.y)*u,a=(e.max.y-l.y)*u):(r=(e.max.y-l.y)*u,a=(e.min.y-l.y)*u),i>a||r>n?null:((r>i||i!=i)&&(i=r),(a<n||n!=n)&&(n=a),h>=0?(o=(e.min.z-l.z)*h,s=(e.max.z-l.z)*h):(o=(e.max.z-l.z)*h,s=(e.min.z-l.z)*h),i>s||o>n?null:((o>i||i!=i)&&(i=o),(s<n||n!=n)&&(n=s),n<0?null:this.at(i>=0?i:n,t)))},intersectsBox:(Vi=new Bt,function(e){return null!==this.intersectBox(e,Vi)}),intersectTriangle:function(){var e=new Bt,t=new Bt,i=new Bt,n=new Bt;return function(r,a,o,s,c){t.subVectors(a,r),i.subVectors(o,r),n.crossVectors(t,i);var u,h=this.direction.dot(n);if(h>0){if(s)return null;u=1}else{if(!(h<0))return null;u=-1,h=-h}e.subVectors(this.origin,r);var l=u*this.direction.dot(i.crossVectors(e,i));if(l<0)return null;var d=u*this.direction.dot(t.cross(e));if(d<0)return null;if(l+d>h)return null;var p=-u*e.dot(n);return p<0?null:this.at(p/h,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(rn.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Bt),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Bt),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Bt),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(Zi=new Bt,qi=new Bt,function(e,t){Zi.subVectors(e,this.start),qi.subVectors(this.end,this.start);var i=qi.dot(qi),n=qi.dot(Zi)/i;return t&&(n=zt.clamp(n,0,1)),n}),closestPointToPoint:function(e,t,i){var n=this.closestPointToPointParameter(e,t);return void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new Bt),this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(an,{getNormal:(Ji=new Bt,function(e,t,i,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new Bt),n.subVectors(i,t),Ji.subVectors(e,t),n.cross(Ji);var r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}),getBarycoord:function(){var e=new Bt,t=new Bt,i=new Bt;return function(n,r,a,o,s){e.subVectors(o,r),t.subVectors(a,r),i.subVectors(n,r);var c=e.dot(e),u=e.dot(t),h=e.dot(i),l=t.dot(t),d=t.dot(i),p=c*l-u*u;if(void 0===s&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),s=new Bt),0===p)return s.set(-2,-1,-1);var f=1/p,g=(l*h-u*d)*f,m=(c*d-u*h)*f;return s.set(1-g-m,m,g)}}(),containsPoint:function(){var e=new Bt;return function(t,i,n,r){return an.getBarycoord(t,i,n,r,e),e.x>=0&&e.y>=0&&e.x+e.y<=1}}()}),Object.assign(an.prototype,{set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){var e=new Bt,t=new Bt;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Bt),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return an.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Bt),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return an.getBarycoord(e,this.a,this.b,this.c,t)},containsPoint:function(e){return an.containsPoint(e,this.a,this.b,this.c)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new ei,t=[new rn,new rn,new rn],i=new Bt,n=new Bt;return function(r,a){void 0===a&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),a=new Bt);var o=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(r,i),!0===this.containsPoint(i))a.copy(i);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var s=0;s<t.length;s++){t[s].closestPointToPoint(i,!0,n);var c=i.distanceToSquared(n);c<o&&(o=c,a.copy(n))}}return a}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),on.prototype=Object.assign(Object.create(vi.prototype),{constructor:on,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return vi.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,i,n=this.geometry;if(n.isBufferGeometry){var r=n.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)i=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}else{var s=n.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;e<t;e++)i=s[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}},raycast:function(){var e=new Ut,t=new nn,i=new $t,n=new Bt,r=new Bt,a=new Bt,o=new Bt,s=new Bt,c=new Bt,u=new Rt,h=new Rt,l=new Rt,d=new Bt,p=new Bt,f=new Bt;function g(e,t,i,n,r,a,o){return an.getBarycoord(e,t,i,n,d),r.multiplyScalar(d.x),a.multiplyScalar(d.y),o.multiplyScalar(d.z),r.add(a).add(o),r.clone()}function m(e,t,i,n,r,a,o,s){if(null===(t.side===b?n.intersectTriangle(o,a,r,!0,s):n.intersectTriangle(r,a,o,t.side!==I,s)))return null;f.copy(s),f.applyMatrix4(e.matrixWorld);var c=i.ray.origin.distanceTo(f);return c<i.near||c>i.far?null:{distance:c,point:f.clone(),object:e}}function M(e,t,i,o,s,c,d,f){n.fromBufferAttribute(o,c),r.fromBufferAttribute(o,d),a.fromBufferAttribute(o,f);var M=m(e,e.material,t,i,n,r,a,p);if(M){s&&(u.fromBufferAttribute(s,c),h.fromBufferAttribute(s,d),l.fromBufferAttribute(s,f),M.uv=g(p,n,r,a,u,h,l));var y=new xi(c,d,f);an.getNormal(n,r,a,y.normal),M.face=y}return M}return function(d,f){var y,v=this.geometry,A=this.material,w=this.matrixWorld;if(void 0!==A&&(null===v.boundingSphere&&v.computeBoundingSphere(),i.copy(v.boundingSphere),i.applyMatrix4(w),!1!==d.ray.intersectsSphere(i)&&(e.getInverse(w),t.copy(d.ray).applyMatrix4(e),null===v.boundingBox||!1!==t.intersectsBox(v.boundingBox))))if(v.isBufferGeometry){var x,E,T,N,D,L=v.index,b=v.attributes.position,I=v.attributes.uv;if(null!==L)for(N=0,D=L.count;N<D;N+=3)x=L.getX(N),E=L.getX(N+1),T=L.getX(N+2),(y=M(this,d,t,b,I,x,E,T))&&(y.faceIndex=Math.floor(N/3),f.push(y));else if(void 0!==b)for(N=0,D=b.count;N<D;N+=3)(y=M(this,d,t,b,I,x=N,E=N+1,T=N+2))&&(y.faceIndex=Math.floor(N/3),f.push(y))}else if(v.isGeometry){var _,S,j,C,O=Array.isArray(A),z=v.vertices,R=v.faces,U=v.faceVertexUvs[0];U.length>0&&(C=U);for(var P=0,B=R.length;P<B;P++){var k=R[P],F=O?A[k.materialIndex]:A;if(void 0!==F){if(_=z[k.a],S=z[k.b],j=z[k.c],!0===F.morphTargets){var G=v.morphTargets,Q=this.morphTargetInfluences;n.set(0,0,0),r.set(0,0,0),a.set(0,0,0);for(var Y=0,V=G.length;Y<V;Y++){var H=Q[Y];if(0!==H){var W=G[Y].vertices;n.addScaledVector(o.subVectors(W[k.a],_),H),r.addScaledVector(s.subVectors(W[k.b],S),H),a.addScaledVector(c.subVectors(W[k.c],j),H)}}n.add(_),r.add(S),a.add(j),_=n,S=r,j=a}if(y=m(this,F,d,t,_,S,j,p)){if(C&&C[P]){var X=C[P];u.copy(X[0]),h.copy(X[1]),l.copy(X[2]),y.uv=g(p,_,S,j,u,h,l)}y.face=k,y.faceIndex=P,f.push(y)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),yn.prototype=Object.create(Wt.prototype),yn.prototype.constructor=yn,yn.prototype.isCubeTexture=!0,Object.defineProperty(yn.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var vn=new Wt,An=new yn;function wn(){this.seq=[],this.map={}}var xn=[],En=[],Tn=new Float32Array(16),Nn=new Float32Array(9),Dn=new Float32Array(4);function Ln(e,t,i){var n=e[0];if(n<=0||n>0)return e;var r=t*i,a=xn[r];if(void 0===a&&(a=new Float32Array(r),xn[r]=a),0!==t){n.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=i,e[o].toArray(a,s)}return a}function bn(e,t){if(e.length!==t.length)return!1;for(var i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0}function In(e,t){for(var i=0,n=t.length;i<n;i++)e[i]=t[i]}function _n(e,t){var i=En[t];void 0===i&&(i=new Int32Array(t),En[t]=i);for(var n=0;n!==t;++n)i[n]=e.allocTextureUnit();return i}function Sn(e,t){var i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function jn(e,t){var i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function Cn(e,t){var i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(bn(i,t))return;e.uniform2fv(this.addr,t),In(i,t)}}function On(e,t){var i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y&&i[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(void 0!==t.r)i[0]===t.r&&i[1]===t.g&&i[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(bn(i,t))return;e.uniform3fv(this.addr,t),In(i,t)}}function zn(e,t){var i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y&&i[2]===t.z&&i[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(bn(i,t))return;e.uniform4fv(this.addr,t),In(i,t)}}function Rn(e,t){var i=this.cache,n=t.elements;if(void 0===n){if(bn(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),In(i,t)}else{if(bn(i,n))return;Dn.set(n),e.uniformMatrix2fv(this.addr,!1,Dn),In(i,n)}}function Un(e,t){var i=this.cache,n=t.elements;if(void 0===n){if(bn(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),In(i,t)}else{if(bn(i,n))return;Nn.set(n),e.uniformMatrix3fv(this.addr,!1,Nn),In(i,n)}}function Pn(e,t){var i=this.cache,n=t.elements;if(void 0===n){if(bn(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),In(i,t)}else{if(bn(i,n))return;Tn.set(n),e.uniformMatrix4fv(this.addr,!1,Tn),In(i,n)}}function Bn(e,t,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2D(t||vn,r)}function kn(e,t,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(t||An,r)}function Fn(e,t){var i=this.cache;bn(i,t)||(e.uniform2iv(this.addr,t),In(i,t))}function Gn(e,t){var i=this.cache;bn(i,t)||(e.uniform3iv(this.addr,t),In(i,t))}function Qn(e,t){var i=this.cache;bn(i,t)||(e.uniform4iv(this.addr,t),In(i,t))}function Yn(e,t){var i=this.cache;bn(i,t)||(e.uniform1fv(this.addr,t),In(i,t))}function Vn(e,t){var i=this.cache;bn(i,t)||(e.uniform1iv(this.addr,t),In(i,t))}function Hn(e,t){var i=this.cache,n=Ln(t,this.size,2);bn(i,n)||(e.uniform2fv(this.addr,n),this.updateCache(n))}function Wn(e,t){var i=this.cache,n=Ln(t,this.size,3);bn(i,n)||(e.uniform3fv(this.addr,n),this.updateCache(n))}function Xn(e,t){var i=this.cache,n=Ln(t,this.size,4);bn(i,n)||(e.uniform4fv(this.addr,n),this.updateCache(n))}function Zn(e,t){var i=this.cache,n=Ln(t,this.size,4);bn(i,n)||(e.uniformMatrix2fv(this.addr,!1,n),this.updateCache(n))}function qn(e,t){var i=this.cache,n=Ln(t,this.size,9);bn(i,n)||(e.uniformMatrix3fv(this.addr,!1,n),this.updateCache(n))}function Jn(e,t){var i=this.cache,n=Ln(t,this.size,16);bn(i,n)||(e.uniformMatrix4fv(this.addr,!1,n),this.updateCache(n))}function Kn(e,t,i){var n=this.cache,r=t.length,a=_n(i,r);!1===bn(n,a)&&(e.uniform1iv(this.addr,a),In(n,a));for(var o=0;o!==r;++o)i.setTexture2D(t[o]||vn,a[o])}function $n(e,t,i){var n=this.cache,r=t.length,a=_n(i,r);!1===bn(n,a)&&(e.uniform1iv(this.addr,a),In(n,a));for(var o=0;o!==r;++o)i.setTextureCube(t[o]||An,a[o])}function er(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Sn;case 35664:return Cn;case 35665:return On;case 35666:return zn;case 35674:return Rn;case 35675:return Un;case 35676:return Pn;case 35678:case 36198:return Bn;case 35680:return kn;case 5124:case 35670:return jn;case 35667:case 35671:return Fn;case 35668:case 35672:return Gn;case 35669:case 35673:return Qn}}(t.type)}function tr(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Yn;case 35664:return Hn;case 35665:return Wn;case 35666:return Xn;case 35674:return Zn;case 35675:return qn;case 35676:return Jn;case 35678:return Kn;case 35680:return $n;case 5124:case 35670:return Vn;case 35667:case 35671:return Fn;case 35668:case 35672:return Gn;case 35669:case 35673:return Qn}}(t.type)}function ir(e){this.id=e,wn.call(this)}tr.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),In(t,e)},ir.prototype.setValue=function(e,t){for(var i=this.seq,n=0,r=i.length;n!==r;++n){var a=i[n];a.setValue(e,t[a.id])}};var nr=/([\w\d_]+)(\])?(\[|\.)?/g;function rr(e,t){e.seq.push(t),e.map[t.id]=t}function ar(e,t,i){var n=e.name,r=n.length;for(nr.lastIndex=0;;){var a=nr.exec(n),o=nr.lastIndex,s=a[1],c="]"===a[2],u=a[3];if(c&&(s|=0),void 0===u||"["===u&&o+2===r){rr(i,void 0===u?new er(s,e,t):new tr(s,e,t));break}var h=i.map[s];void 0===h&&rr(i,h=new ir(s)),i=h}}function or(e,t,i){wn.call(this),this.renderer=i;for(var n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r=0;r<n;++r){var a=e.getActiveUniform(t,r);ar(a,e.getUniformLocation(t,a.name),this)}}function sr(e,t,i){var n=e.createShader(t);return e.shaderSource(n,i),e.compileShader(n),!1===e.getShaderParameter(n,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(n),function(e){for(var t=e.split("\n"),i=0;i<t.length;i++)t[i]=i+1+": "+t[i];return t.join("\n")}(i)),n}or.prototype.setValue=function(e,t,i){var n=this.map[t];void 0!==n&&n.setValue(e,i,this.renderer)},or.prototype.setOptional=function(e,t,i){var n=t[i];void 0!==n&&this.setValue(e,i,n)},or.upload=function(e,t,i,n){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=i[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,n)}},or.seqWithValue=function(e,t){for(var i=[],n=0,r=e.length;n!==r;++n){var a=e[n];a.id in t&&i.push(a)}return i};var cr=0;function ur(e){switch(e){case Dt:return["Linear","( value )"];case Lt:return["sRGB","( value )"];case It:return["RGBE","( value )"];case _t:return["RGBM","( value, 7.0 )"];case St:return["RGBM","( value, 16.0 )"];case jt:return["RGBD","( value, 256.0 )"];case bt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function hr(e,t){var i=ur(t);return"vec4 "+e+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function lr(e,t){var i;switch(t){case pe:i="Linear";break;case fe:i="Reinhard";break;case ge:i="Uncharted2";break;case me:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function dr(e){return""!==e}function pr(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function fr(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function gr(e){return e.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,function(e,t){var i=ni[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return gr(i)})}function mr(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(e,t,i,n){for(var r="",a=parseInt(t);a<parseInt(i);a++)r+=n.replace(/\[ i \]/g,"[ "+a+" ]");return r})}function Mr(e,t,i,n,r,a){var o=e.context,s=n.defines,c=r.vertexShader,u=r.fragmentShader,h="SHADOWMAP_TYPE_BASIC";a.shadowMapType===N?h="SHADOWMAP_TYPE_PCF":a.shadowMapType===D&&(h="SHADOWMAP_TYPE_PCF_SOFT");var l="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(n.envMap.mapping){case Me:case ye:l="ENVMAP_TYPE_CUBE";break;case xe:case Ee:l="ENVMAP_TYPE_CUBE_UV";break;case ve:case Ae:l="ENVMAP_TYPE_EQUIREC";break;case we:l="ENVMAP_TYPE_SPHERE"}switch(n.envMap.mapping){case ye:case Ae:d="ENVMAP_MODE_REFRACTION"}switch(n.combine){case ue:p="ENVMAP_BLENDING_MULTIPLY";break;case he:p="ENVMAP_BLENDING_MIX";break;case le:p="ENVMAP_BLENDING_ADD"}}var f,g,m,M,y,v=e.gammaFactor>0?e.gammaFactor:1,A=function(e,t,i){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(dr).join("\n")}(n.extensions,a,t),w=function(e){var t=[];for(var i in e){var n=e[i];!1!==n&&t.push("#define "+i+" "+n)}return t.join("\n")}(s),x=o.createProgram();n.isRawShaderMaterial?((f=[w].filter(dr).join("\n")).length>0&&(f+="\n"),(g=[A,w].filter(dr).join("\n")).length>0&&(g+="\n")):(f=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+r.name,w,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+h:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(dr).join("\n"),g=[A,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+r.name,w,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+v,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+l:"",a.envMap?"#define "+d:"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+h:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==de?"#define TONE_MAPPING":"",a.toneMapping!==de?ni.tonemapping_pars_fragment:"",a.toneMapping!==de?lr("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.envMapEncoding||a.emissiveMapEncoding?ni.encodings_pars_fragment:"",a.mapEncoding?hr("mapTexelToLinear",a.mapEncoding):"",a.envMapEncoding?hr("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?hr("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(m="linearToOutputTexel",M=a.outputEncoding,y=ur(M),"vec4 "+m+"( vec4 value ) { return LinearTo"+y[0]+y[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(dr).join("\n")),c=fr(c=pr(c=gr(c),a),a),u=fr(u=pr(u=gr(u),a),a);var E=f+(c=mr(c)),T=g+(u=mr(u)),L=sr(o,o.VERTEX_SHADER,E),b=sr(o,o.FRAGMENT_SHADER,T);o.attachShader(x,L),o.attachShader(x,b),void 0!==n.index0AttributeName?o.bindAttribLocation(x,0,n.index0AttributeName):!0===a.morphTargets&&o.bindAttribLocation(x,0,"position"),o.linkProgram(x);var I,_,S=o.getProgramInfoLog(x).trim(),j=o.getShaderInfoLog(L).trim(),C=o.getShaderInfoLog(b).trim(),O=!0,z=!0;return!1===o.getProgramParameter(x,o.LINK_STATUS)?(O=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(x,o.VALIDATE_STATUS),"gl.getProgramInfoLog",S,j,C)):""!==S?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",S):""!==j&&""!==C||(z=!1),z&&(this.diagnostics={runnable:O,material:n,programLog:S,vertexShader:{log:j,prefix:f},fragmentShader:{log:C,prefix:g}}),o.deleteShader(L),o.deleteShader(b),this.getUniforms=function(){return void 0===I&&(I=new or(o,x,e)),I},this.getAttributes=function(){return void 0===_&&(_=function(e,t){for(var i={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),r=0;r<n;r++){var a=e.getActiveAttrib(t,r).name;i[a]=e.getAttribLocation(t,a)}return i}(o,x)),_},this.destroy=function(){o.deleteProgram(x),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=r.name,this.id=cr++,this.code=i,this.usedTimes=1,this.program=x,this.vertexShader=L,this.fragmentShader=b,this}function yr(e,t,i){var n=[],r={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},a=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function o(e,t){var i;return e?e.isTexture?i=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=e.texture.encoding):i=Dt,i===Dt&&t&&(i=bt),i}this.getParameters=function(t,n,a,s,c,u,h){var l=r[t.type],d=h.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(i.floatVertexTextures)return 1024;var n=i.maxVertexUniforms,r=Math.floor((n-20)/4),a=Math.min(r,t.length);return a<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+a+"."),0):a}(h):0,p=i.precision;null!==t.precision&&(p=i.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",p,"instead.");var f=e.getRenderTarget();return{shaderID:l,precision:p,supportsVertexTextures:i.vertexTextures,outputEncoding:o(f?f.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:o(t.map,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:o(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===xe||t.envMap.mapping===Ee),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:o(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!s,useFog:t.fog,fogExp:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:i.logarithmicDepthBuffer,skinning:t.skinning&&d>0,maxBones:d,useVertexTexture:i.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numClippingPlanes:c,numClipIntersection:u,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&h.receiveShadow&&a.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===I,flipSided:t.side===b,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,i){var n=[];if(i.shaderID?n.push(i.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);for(var o=0;o<a.length;o++)n.push(i[a[o]]);return n.push(t.onBeforeCompile.toString()),n.push(e.gammaOutput),n.join()},this.acquireProgram=function(i,r,a,o){for(var s,c=0,u=n.length;c<u;c++){var h=n[c];if(h.code===o){++(s=h).usedTimes;break}}return void 0===s&&(s=new Mr(e,t,o,i,r,a),n.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=n.indexOf(e);n[t]=n[n.length-1],n.pop(),e.destroy()}},this.programs=n}function vr(){var e=new WeakMap;return{get:function(t){var i=e.get(t);return void 0===i&&(i={},e.set(t,i)),i},remove:function(t){e.delete(t)},update:function(t,i,n){e.get(t)[i]=n},dispose:function(){e=new WeakMap}}}function Ar(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function wr(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function xr(){var e=[],t=0,i=[],n=[];return{opaque:i,transparent:n,init:function(){t=0,i.length=0,n.length=0},push:function(r,a,o,s,c){var u=e[t];void 0===u?(u={id:r.id,object:r,geometry:a,material:o,program:o.program,renderOrder:r.renderOrder,z:s,group:c},e[t]=u):(u.id=r.id,u.object=r,u.geometry=a,u.material=o,u.program=o.program,u.renderOrder=r.renderOrder,u.z=s,u.group=c),(!0===o.transparent?n:i).push(u),t++},sort:function(){i.length>1&&i.sort(Ar),n.length>1&&n.sort(wr)}}}function Er(){var e={};return{get:function(t,i){var n=t.id+","+i.id,r=e[n];return void 0===r&&(r=new xr,e[n]=r),r},dispose:function(){e={}}}}function Tr(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var i;switch(t.type){case"DirectionalLight":i={direction:new Bt,color:new oi,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":i={position:new Bt,direction:new Bt,color:new oi,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":i={position:new Bt,color:new oi,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":i={direction:new Bt,skyColor:new oi,groundColor:new oi};break;case"RectAreaLight":i={color:new oi,position:new Bt,halfWidth:new Bt,halfHeight:new Bt}}return e[t.id]=i,i}}}var Nr,Dr,Lr,br,Ir,_r,Sr,jr,Cr=0;function Or(){var e=new Tr,t={id:Cr++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=new Bt,n=new Ut,r=new Ut;return{setup:function(a,o,s){for(var c=0,u=0,h=0,l=0,d=0,p=0,f=0,g=0,m=s.matrixWorldInverse,M=0,y=a.length;M<y;M++){var v=a[M],A=v.color,w=v.intensity,x=v.distance,E=v.shadow&&v.shadow.map?v.shadow.map.texture:null;if(v.isAmbientLight)c+=A.r*w,u+=A.g*w,h+=A.b*w;else if(v.isDirectionalLight){if((N=e.get(v)).color.copy(v.color).multiplyScalar(v.intensity),N.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),N.direction.sub(i),N.direction.transformDirection(m),N.shadow=v.castShadow,v.castShadow){var T=v.shadow;N.shadowBias=T.bias,N.shadowRadius=T.radius,N.shadowMapSize=T.mapSize}t.directionalShadowMap[l]=E,t.directionalShadowMatrix[l]=v.shadow.matrix,t.directional[l]=N,l++}else if(v.isSpotLight){if((N=e.get(v)).position.setFromMatrixPosition(v.matrixWorld),N.position.applyMatrix4(m),N.color.copy(A).multiplyScalar(w),N.distance=x,N.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),N.direction.sub(i),N.direction.transformDirection(m),N.coneCos=Math.cos(v.angle),N.penumbraCos=Math.cos(v.angle*(1-v.penumbra)),N.decay=0===v.distance?0:v.decay,N.shadow=v.castShadow,v.castShadow){T=v.shadow;N.shadowBias=T.bias,N.shadowRadius=T.radius,N.shadowMapSize=T.mapSize}t.spotShadowMap[p]=E,t.spotShadowMatrix[p]=v.shadow.matrix,t.spot[p]=N,p++}else if(v.isRectAreaLight){(N=e.get(v)).color.copy(A).multiplyScalar(w),N.position.setFromMatrixPosition(v.matrixWorld),N.position.applyMatrix4(m),r.identity(),n.copy(v.matrixWorld),n.premultiply(m),r.extractRotation(n),N.halfWidth.set(.5*v.width,0,0),N.halfHeight.set(0,.5*v.height,0),N.halfWidth.applyMatrix4(r),N.halfHeight.applyMatrix4(r),t.rectArea[f]=N,f++}else if(v.isPointLight){if((N=e.get(v)).position.setFromMatrixPosition(v.matrixWorld),N.position.applyMatrix4(m),N.color.copy(v.color).multiplyScalar(v.intensity),N.distance=v.distance,N.decay=0===v.distance?0:v.decay,N.shadow=v.castShadow,v.castShadow){T=v.shadow;N.shadowBias=T.bias,N.shadowRadius=T.radius,N.shadowMapSize=T.mapSize,N.shadowCameraNear=T.camera.near,N.shadowCameraFar=T.camera.far}t.pointShadowMap[d]=E,t.pointShadowMatrix[d]=v.shadow.matrix,t.point[d]=N,d++}else if(v.isHemisphereLight){var N;(N=e.get(v)).direction.setFromMatrixPosition(v.matrixWorld),N.direction.transformDirection(m),N.direction.normalize(),N.skyColor.copy(v.color).multiplyScalar(w),N.groundColor.copy(v.groundColor).multiplyScalar(w),t.hemi[g]=N,g++}}t.ambient[0]=c,t.ambient[1]=u,t.ambient[2]=h,t.directional.length=l,t.spot.length=p,t.rectArea.length=f,t.point.length=d,t.hemi.length=g,t.hash=t.id+","+l+","+d+","+p+","+f+","+g+","+o.length},state:t}}function zr(){var e=new Or,t=[],i=[],n=[];return{init:function(){t.length=0,i.length=0,n.length=0},state:{lightsArray:t,shadowsArray:i,spritesArray:n,lights:e},setupLights:function(n){e.setup(t,i,n)},pushLight:function(e){t.push(e)},pushShadow:function(e){i.push(e)},pushSprite:function(e){n.push(e)}}}function Rr(){var e={};return{get:function(t,i){var n=t.id+","+i.id,r=e[n];return void 0===r&&(r=new zr,e[n]=r),r},dispose:function(){e={}}}}function Ur(e){$i.call(this),this.type="MeshDepthMaterial",this.depthPacking=Ct,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(e)}function Pr(e){$i.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Bt,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Br(e,t,i){for(var n=new ti,r=new Ut,a=new Rt,o=new Rt(i,i),s=new Bt,c=new Bt,u=1,h=2,l=1+(u|h),d=new Array(l),p=new Array(l),f={},g={0:b,1:L,2:I},m=[new Bt(1,0,0),new Bt(-1,0,0),new Bt(0,0,1),new Bt(0,0,-1),new Bt(0,1,0),new Bt(0,-1,0)],M=[new Bt(0,1,0),new Bt(0,1,0),new Bt(0,1,0),new Bt(0,1,0),new Bt(0,0,1),new Bt(0,0,-1)],y=[new Xt,new Xt,new Xt,new Xt,new Xt,new Xt],v=0;v!==l;++v){var A=0!=(v&u),w=0!=(v&h),x=new Ur({depthPacking:Ot,morphTargets:A,skinning:w});d[v]=x;var E=new Pr({morphTargets:A,skinning:w});p[v]=E}var T=this;function D(t,i,n,r,a,o){var s=t.geometry,c=null,l=d,m=t.customDepthMaterial;if(n&&(l=p,m=t.customDistanceMaterial),m)c=m;else{var M=!1;i.morphTargets&&(s&&s.isBufferGeometry?M=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(M=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===i.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var y=t.isSkinnedMesh&&i.skinning,v=0;M&&(v|=u),y&&(v|=h),c=l[v]}if(e.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){var A=c.uuid,w=i.uuid,x=f[A];void 0===x&&(x={},f[A]=x);var E=x[w];void 0===E&&(E=c.clone(),x[w]=E),c=E}return c.visible=i.visible,c.wireframe=i.wireframe,c.side=null!=i.shadowSide?i.shadowSide:g[i.side],c.clipShadows=i.clipShadows,c.clippingPlanes=i.clippingPlanes,c.clipIntersection=i.clipIntersection,c.wireframeLinewidth=i.wireframeLinewidth,c.linewidth=i.linewidth,n&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(r),c.nearDistance=a,c.farDistance=o),c}function _(i,r,a,o){if(!1!==i.visible){if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&i.castShadow&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,i.matrixWorld);var s=t.update(i),u=i.material;if(Array.isArray(u))for(var h=s.groups,l=0,d=h.length;l<d;l++){var p=h[l],f=u[p.materialIndex];if(f&&f.visible){var g=D(i,f,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,g,i,p)}}else if(u.visible){g=D(i,u,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,g,i,null)}}for(var m=i.children,M=0,y=m.length;M<y;M++)_(m[M],r,a,o)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=N,this.render=function(t,i,u){if(!1!==T.enabled&&(!1!==T.autoUpdate||!1!==T.needsUpdate)&&0!==t.length){var h,l=e.context,d=e.state;d.disable(l.BLEND),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var p=0,f=t.length;p<f;p++){var g=t[p],v=g.shadow,A=g&&g.isPointLight;if(void 0!==v){var w=v.camera;if(a.copy(v.mapSize),a.min(o),A){var x=a.x,E=a.y;y[0].set(2*x,E,x,E),y[1].set(0,E,x,E),y[2].set(3*x,E,x,E),y[3].set(x,E,x,E),y[4].set(3*x,0,x,E),y[5].set(x,0,x,E),a.x*=4,a.y*=2}if(null===v.map){var N={minFilter:Le,magFilter:Le,format:We};v.map=new Zt(a.x,a.y,N),v.map.texture.name=g.name+".shadowMap",w.updateProjectionMatrix()}v.isSpotLightShadow&&v.update(g);var D=v.map,L=v.matrix;c.setFromMatrixPosition(g.matrixWorld),w.position.copy(c),A?(h=6,L.makeTranslation(-c.x,-c.y,-c.z)):(h=1,s.setFromMatrixPosition(g.target.matrixWorld),w.lookAt(s),w.updateMatrixWorld(),L.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),L.multiply(w.projectionMatrix),L.multiply(w.matrixWorldInverse)),e.setRenderTarget(D),e.clear();for(var b=0;b<h;b++){if(A){s.copy(w.position),s.add(m[b]),w.up.copy(M[b]),w.lookAt(s),w.updateMatrixWorld();var I=y[b];d.viewport(I)}r.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse),n.setFromMatrix(r),_(i,u,w,A)}}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}T.needsUpdate=!1}}}function kr(e,t,i,n,r,a,o,s,c){Wt.call(this,e,t,i,n,r,a,o,s,c),this.needsUpdate=!0}function Fr(e,t,i,n,r){var a,o,s,c,u,h,l=new Bt,d=new Pt,p=new Bt;function f(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),i=new Uint16Array([0,1,2,0,2,3]);a=t.createBuffer(),o=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.bufferData(t.ELEMENT_ARRAY_BUFFER,i,t.STATIC_DRAW),s=function(){var e=t.createProgram(),i=t.createShader(t.VERTEX_SHADER),n=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(i,["precision "+r.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 center;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = ( position - center ) * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),t.shaderSource(n,["precision "+r.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),t.compileShader(i),t.compileShader(n),t.attachShader(e,i),t.attachShader(e,n),t.linkProgram(e),e}(),c={position:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},u={uvOffset:t.getUniformLocation(s,"uvOffset"),uvScale:t.getUniformLocation(s,"uvScale"),rotation:t.getUniformLocation(s,"rotation"),center:t.getUniformLocation(s,"center"),scale:t.getUniformLocation(s,"scale"),color:t.getUniformLocation(s,"color"),map:t.getUniformLocation(s,"map"),opacity:t.getUniformLocation(s,"opacity"),modelViewMatrix:t.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(s,"projectionMatrix"),fogType:t.getUniformLocation(s,"fogType"),fogDensity:t.getUniformLocation(s,"fogDensity"),fogNear:t.getUniformLocation(s,"fogNear"),fogFar:t.getUniformLocation(s,"fogFar"),fogColor:t.getUniformLocation(s,"fogColor"),fogDepth:t.getUniformLocation(s,"fogDepth"),alphaTest:t.getUniformLocation(s,"alphaTest")};var n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");n.width=8,n.height=8;var l=n.getContext("2d");l.fillStyle="white",l.fillRect(0,0,8,8),h=new kr(n)}function g(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}this.render=function(r,m,M){if(0!==r.length){void 0===s&&f(),i.useProgram(s),i.initAttributes(),i.enableAttribute(c.position),i.enableAttribute(c.uv),i.disableUnusedAttributes(),i.disable(t.CULL_FACE),i.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(c.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(c.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.uniformMatrix4fv(u.projectionMatrix,!1,M.projectionMatrix.elements),i.activeTexture(t.TEXTURE0),t.uniform1i(u.map,0);var y=0,v=0,A=m.fog;A?(t.uniform3f(u.fogColor,A.color.r,A.color.g,A.color.b),A.isFog?(t.uniform1f(u.fogNear,A.near),t.uniform1f(u.fogFar,A.far),t.uniform1i(u.fogType,1),y=1,v=1):A.isFogExp2&&(t.uniform1f(u.fogDensity,A.density),t.uniform1i(u.fogType,2),y=2,v=2)):(t.uniform1i(u.fogType,0),y=0,v=0);for(var w=0,x=r.length;w<x;w++){(N=r[w]).modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,N.matrixWorld),N.z=-N.modelViewMatrix.elements[14]}r.sort(g);var E=[],T=[];for(w=0,x=r.length;w<x;w++){var N,D=(N=r[w]).material;if(!1!==D.visible){N.onBeforeRender(e,m,M,void 0,D,void 0),t.uniform1f(u.alphaTest,D.alphaTest),t.uniformMatrix4fv(u.modelViewMatrix,!1,N.modelViewMatrix.elements),N.matrixWorld.decompose(l,d,p),E[0]=p.x,E[1]=p.y,T[0]=N.center.x-.5,T[1]=N.center.y-.5;var L=0;m.fog&&D.fog&&(L=v),y!==L&&(t.uniform1i(u.fogType,L),y=L),null!==D.map?(t.uniform2f(u.uvOffset,D.map.offset.x,D.map.offset.y),t.uniform2f(u.uvScale,D.map.repeat.x,D.map.repeat.y)):(t.uniform2f(u.uvOffset,0,0),t.uniform2f(u.uvScale,1,1)),t.uniform1f(u.opacity,D.opacity),t.uniform3f(u.color,D.color.r,D.color.g,D.color.b),t.uniform1f(u.rotation,D.rotation),t.uniform2fv(u.center,T),t.uniform2fv(u.scale,E),i.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst,D.blendEquationAlpha,D.blendSrcAlpha,D.blendDstAlpha,D.premultipliedAlpha),i.buffers.depth.setTest(D.depthTest),i.buffers.depth.setMask(D.depthWrite),i.buffers.color.setMask(D.colorWrite),n.setTexture2D(D.map||h,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),N.onAfterRender(e,m,M,void 0,D,void 0)}}i.enable(t.CULL_FACE),i.reset()}}}function Gr(e,t,i){var n=new function(){var t=!1,i=new Xt,n=null,r=new Xt(0,0,0,0);return{setMask:function(i){n===i||t||(e.colorMask(i,i,i,i),n=i)},setLocked:function(e){t=e},setClear:function(t,n,a,o,s){!0===s&&(t*=o,n*=o,a*=o),i.set(t,n,a,o),!1===r.equals(i)&&(e.clearColor(t,n,a,o),r.copy(i))},reset:function(){t=!1,n=null,r.set(-1,0,0,0)}}},r=new function(){var t=!1,i=null,n=null,r=null;return{setTest:function(t){t?X(e.DEPTH_TEST):Z(e.DEPTH_TEST)},setMask:function(n){i===n||t||(e.depthMask(n),i=n)},setFunc:function(t){if(n!==t){if(t)switch(t){case te:e.depthFunc(e.NEVER);break;case ie:e.depthFunc(e.ALWAYS);break;case ne:e.depthFunc(e.LESS);break;case re:e.depthFunc(e.LEQUAL);break;case ae:e.depthFunc(e.EQUAL);break;case oe:e.depthFunc(e.GEQUAL);break;case se:e.depthFunc(e.GREATER);break;case ce:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);n=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,i=null,n=null,r=null}}},a=new function(){var t=!1,i=null,n=null,r=null,a=null,o=null,s=null,c=null,u=null;return{setTest:function(t){t?X(e.STENCIL_TEST):Z(e.STENCIL_TEST)},setMask:function(n){i===n||t||(e.stencilMask(n),i=n)},setFunc:function(t,i,o){n===t&&r===i&&a===o||(e.stencilFunc(t,i,o),n=t,r=i,a=o)},setOp:function(t,i,n){o===t&&s===i&&c===n||(e.stencilOp(t,i,n),o=t,s=i,c=n)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,i=null,n=null,r=null,a=null,o=null,s=null,c=null,u=null}}},o=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(o),c=new Uint8Array(o),u=new Uint8Array(o),h={},l=null,d=null,p=null,f=null,g=null,m=null,M=null,y=null,v=null,A=!1,w=null,N=null,D=null,L=null,_=null,S=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),j=!1,B=0,k=e.getParameter(e.VERSION);-1!==k.indexOf("WebGL")?(B=parseFloat(/^WebGL\ ([0-9])/.exec(k)[1]),j=B>=1):-1!==k.indexOf("OpenGL ES")&&(B=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(k)[1]),j=B>=2);var F=null,G={},Q=new Xt,Y=new Xt;function V(t,i,n){var r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var o=0;o<n;o++)e.texImage2D(i+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,r);return a}var H={};function W(i,n){(s[i]=1,0===c[i]&&(e.enableVertexAttribArray(i),c[i]=1),u[i]!==n)&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(i,n),u[i]=n)}function X(t){!0!==h[t]&&(e.enable(t),h[t]=!0)}function Z(t){!1!==h[t]&&(e.disable(t),h[t]=!1)}function q(t,n,r,a,o,s,c,u){if(t!==C?X(e.BLEND):Z(e.BLEND),t!==P){if(t!==p||u!==A)switch(t){case z:u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE));break;case R:u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR));break;case U:u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR));break;default:u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA))}f=null,g=null,m=null,M=null,y=null,v=null}else o=o||n,s=s||r,c=c||a,n===f&&o===M||(e.blendEquationSeparate(i.convert(n),i.convert(o)),f=n,M=o),r===g&&a===m&&s===y&&c===v||(e.blendFuncSeparate(i.convert(r),i.convert(a),i.convert(s),i.convert(c)),g=r,m=a,y=s,v=c);p=t,A=u}function J(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function K(t){t!==x?(X(e.CULL_FACE),t!==N&&(t===E?e.cullFace(e.BACK):t===T?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):Z(e.CULL_FACE),N=t}function $(t,i,n){t?(X(e.POLYGON_OFFSET_FILL),L===i&&_===n||(e.polygonOffset(i,n),L=i,_=n)):Z(e.POLYGON_OFFSET_FILL)}function ee(t){void 0===t&&(t=e.TEXTURE0+S-1),F!==t&&(e.activeTexture(t),F=t)}return H[e.TEXTURE_2D]=V(e.TEXTURE_2D,e.TEXTURE_2D,1),H[e.TEXTURE_CUBE_MAP]=V(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),n.setClear(0,0,0,1),r.setClear(1),a.setClear(0),X(e.DEPTH_TEST),r.setFunc(re),J(!1),K(E),X(e.CULL_FACE),X(e.BLEND),q(O),{buffers:{color:n,depth:r,stencil:a},initAttributes:function(){for(var e=0,t=s.length;e<t;e++)s[e]=0},enableAttribute:function(e){W(e,0)},enableAttributeAndDivisor:W,disableUnusedAttributes:function(){for(var t=0,i=c.length;t!==i;++t)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},enable:X,disable:Z,getCompressedTextureFormats:function(){if(null===l&&(l=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")||t.get("WEBGL_compressed_texture_astc")))for(var i=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),n=0;n<i.length;n++)l.push(i[n]);return l},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:q,setMaterial:function(t,i){t.side===I?Z(e.CULL_FACE):X(e.CULL_FACE);var a=t.side===b;i&&(a=!a),J(a),!0===t.transparent?q(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):q(C),r.setFunc(t.depthFunc),r.setTest(t.depthTest),r.setMask(t.depthWrite),n.setMask(t.colorWrite),$(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:J,setCullFace:K,setLineWidth:function(t){t!==D&&(j&&e.lineWidth(t),D=t)},setPolygonOffset:$,setScissorTest:function(t){t?X(e.SCISSOR_TEST):Z(e.SCISSOR_TEST)},activeTexture:ee,bindTexture:function(t,i){null===F&&ee();var n=G[F];void 0===n&&(n={type:void 0,texture:void 0},G[F]=n),n.type===t&&n.texture===i||(e.bindTexture(t,i||H[t]),n.type=t,n.texture=i)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===Q.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),Q.copy(t))},viewport:function(t){!1===Y.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),Y.copy(t))},reset:function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);h={},l=null,F=null,G={},d=null,p=null,w=null,N=null,n.reset(),r.reset(),a.reset()}}}function Qr(e,t,i,n,r,a,o){var s,c="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,u={};function h(e,t){if(e.width>t||e.height>t){if("data"in e)return void console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+e.width+"x"+e.height+").");var i=t/Math.max(e.width,e.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.width=Math.floor(e.width*i),n.height=Math.floor(e.height*i),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+n.width+"x"+n.height,e),n}return e}function l(e){return zt.isPowerOfTwo(e.width)&&zt.isPowerOfTwo(e.height)}function d(e,t){return e.generateMipmaps&&t&&e.minFilter!==Le&&e.minFilter!==_e}function p(t,i,r,a){e.generateMipmap(t),n.get(i).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function f(t){return t===Le||t===be||t===Ie?e.NEAREST:e.LINEAR}function g(t){var i=t.target;i.removeEventListener("dispose",g),function(t){var i=n.get(t);if(t.image&&i.__image__webglTextureCube)e.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;e.deleteTexture(i.__webglTexture)}n.remove(t)}(i),i.isVideoTexture&&delete u[i.id],o.memory.textures--}function m(t){var i=t.target;i.removeEventListener("dispose",m),function(t){var i=n.get(t),r=n.get(t.texture);if(!t)return;void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(i.__webglFramebuffer[a]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[a]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer);n.remove(t.texture),n.remove(t)}(i),o.memory.textures--}function M(t,f){var m=n.get(t);if(t.isVideoTexture&&function(e){var t=e.id,i=o.render.frame;u[t]!==i&&(u[t]=i,e.update())}(t),t.version>0&&m.__version!==t.version){var M=t.image;if(void 0===M)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==M.complete)return void function(t,n,u){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",g),t.__webglTexture=e.createTexture(),o.memory.textures++);i.activeTexture(e.TEXTURE0+u),i.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,n.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,n.unpackAlignment);var f=h(n.image,r.maxTextureSize);(function(e){return e.wrapS!==Ne||e.wrapT!==Ne||e.minFilter!==Le&&e.minFilter!==_e})(n)&&!1===l(f)&&(f=function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageBitmap?(void 0===s&&(s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),s.width=zt.floorPowerOfTwo(e.width),s.height=zt.floorPowerOfTwo(e.height),s.getContext("2d").drawImage(e,0,0,s.width,s.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+s.width+"x"+s.height,e),s):e}(f));var m=l(f),M=a.convert(n.format),v=a.convert(n.type);y(e.TEXTURE_2D,n,m);var A,w=n.mipmaps;if(n.isDepthTexture){var x=e.DEPTH_COMPONENT;if(n.type===Be){if(!c)throw new Error("Float Depth Texture only supported in WebGL2.0");x=e.DEPTH_COMPONENT32F}else c&&(x=e.DEPTH_COMPONENT16);n.format===qe&&x===e.DEPTH_COMPONENT&&n.type!==Re&&n.type!==Pe&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Re,v=a.convert(n.type)),n.format===Je&&(x=e.DEPTH_STENCIL,n.type!==Ye&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Ye,v=a.convert(n.type))),i.texImage2D(e.TEXTURE_2D,0,x,f.width,f.height,0,M,v,null)}else if(n.isDataTexture)if(w.length>0&&m){for(var E=0,T=w.length;E<T;E++)A=w[E],i.texImage2D(e.TEXTURE_2D,E,M,A.width,A.height,0,M,v,A.data);n.generateMipmaps=!1,t.__maxMipLevel=w.length-1}else i.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,M,v,f.data),t.__maxMipLevel=0;else if(n.isCompressedTexture){for(E=0,T=w.length;E<T;E++)A=w[E],n.format!==We&&n.format!==He?i.getCompressedTextureFormats().indexOf(M)>-1?i.compressedTexImage2D(e.TEXTURE_2D,E,M,A.width,A.height,0,A.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(e.TEXTURE_2D,E,M,A.width,A.height,0,M,v,A.data);t.__maxMipLevel=w.length-1}else if(w.length>0&&m){for(E=0,T=w.length;E<T;E++)A=w[E],i.texImage2D(e.TEXTURE_2D,E,M,M,v,A);n.generateMipmaps=!1,t.__maxMipLevel=w.length-1}else i.texImage2D(e.TEXTURE_2D,0,M,M,v,f),t.__maxMipLevel=0;d(n,m)&&p(e.TEXTURE_2D,n,f.width,f.height);t.__version=n.version,n.onUpdate&&n.onUpdate(n)}(m,t,f);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}i.activeTexture(e.TEXTURE0+f),i.bindTexture(e.TEXTURE_2D,m.__webglTexture)}function y(i,o,s){var c;if(s?(e.texParameteri(i,e.TEXTURE_WRAP_S,a.convert(o.wrapS)),e.texParameteri(i,e.TEXTURE_WRAP_T,a.convert(o.wrapT)),e.texParameteri(i,e.TEXTURE_MAG_FILTER,a.convert(o.magFilter)),e.texParameteri(i,e.TEXTURE_MIN_FILTER,a.convert(o.minFilter))):(e.texParameteri(i,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(i,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),o.wrapS===Ne&&o.wrapT===Ne||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),e.texParameteri(i,e.TEXTURE_MAG_FILTER,f(o.magFilter)),e.texParameteri(i,e.TEXTURE_MIN_FILTER,f(o.minFilter)),o.minFilter!==Le&&o.minFilter!==_e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),c=t.get("EXT_texture_filter_anisotropic")){if(o.type===Be&&null===t.get("OES_texture_float_linear"))return;if(o.type===ke&&null===t.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(e.texParameterf(i,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function v(t,r,o,s){var c=a.convert(r.texture.format),u=a.convert(r.texture.type);i.texImage2D(s,0,c,r.width,r.height,0,c,u,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,o,s,n.get(r.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function A(t,i){e.bindRenderbuffer(e.RENDERBUFFER,t),i.depthBuffer&&!i.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):i.depthBuffer&&i.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,i.width,i.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function w(t){var i=n.get(t),r=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),M(i.depthTexture,0);var r=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===qe)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,r,0);else{if(i.depthTexture.format!==Je)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,r,0)}}(i.__webglFramebuffer,t)}else if(r){i.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[a]),i.__webglDepthbuffer[a]=e.createRenderbuffer(),A(i.__webglDepthbuffer[a],t)}else e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),A(i.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}this.setTexture2D=M,this.setTextureCube=function(t,s){var c=n.get(t);if(6===t.image.length)if(t.version>0&&c.__version!==t.version){c.__image__webglTextureCube||(t.addEventListener("dispose",g),c.__image__webglTextureCube=e.createTexture(),o.memory.textures++),i.activeTexture(e.TEXTURE0+s),i.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var u=t&&t.isCompressedTexture,f=t.image[0]&&t.image[0].isDataTexture,m=[],M=0;M<6;M++)m[M]=u||f?f?t.image[M].image:t.image[M]:h(t.image[M],r.maxCubemapSize);var v=m[0],A=l(v),w=a.convert(t.format),x=a.convert(t.type);y(e.TEXTURE_CUBE_MAP,t,A);for(M=0;M<6;M++)if(u)for(var E,T=m[M].mipmaps,N=0,D=T.length;N<D;N++)E=T[N],t.format!==We&&t.format!==He?i.getCompressedTextureFormats().indexOf(w)>-1?i.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+M,N,w,E.width,E.height,0,E.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+M,N,w,E.width,E.height,0,w,x,E.data);else f?i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+M,0,w,m[M].width,m[M].height,0,w,x,m[M].data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+M,0,w,w,x,m[M]);c.__maxMipLevel=u?T.length-1:0,d(t,A)&&p(e.TEXTURE_CUBE_MAP,t,v.width,v.height),c.__version=t.version,t.onUpdate&&t.onUpdate(t)}else i.activeTexture(e.TEXTURE0+s),i.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,r){i.activeTexture(e.TEXTURE0+r),i.bindTexture(e.TEXTURE_CUBE_MAP,n.get(t).__webglTexture)},this.setupRenderTarget=function(t){var r=n.get(t),a=n.get(t.texture);t.addEventListener("dispose",m),a.__webglTexture=e.createTexture(),o.memory.textures++;var s=!0===t.isWebGLRenderTargetCube,c=l(t);if(s){r.__webglFramebuffer=[];for(var u=0;u<6;u++)r.__webglFramebuffer[u]=e.createFramebuffer()}else r.__webglFramebuffer=e.createFramebuffer();if(s){i.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture),y(e.TEXTURE_CUBE_MAP,t.texture,c);for(u=0;u<6;u++)v(r.__webglFramebuffer[u],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+u);d(t.texture,c)&&p(e.TEXTURE_CUBE_MAP,t.texture,t.width,t.height),i.bindTexture(e.TEXTURE_CUBE_MAP,null)}else i.bindTexture(e.TEXTURE_2D,a.__webglTexture),y(e.TEXTURE_2D,t.texture,c),v(r.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),d(t.texture,c)&&p(e.TEXTURE_2D,t.texture,t.width,t.height),i.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&w(t)},this.updateRenderTargetMipmap=function(t){var r=t.texture;if(d(r,l(t))){var a=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=n.get(r).__webglTexture;i.bindTexture(a,o),p(a,r,t.width,t.height),i.bindTexture(a,null)}}}function Yr(e,t){return{convert:function(i){var n;if(i===Te)return e.REPEAT;if(i===Ne)return e.CLAMP_TO_EDGE;if(i===De)return e.MIRRORED_REPEAT;if(i===Le)return e.NEAREST;if(i===be)return e.NEAREST_MIPMAP_NEAREST;if(i===Ie)return e.NEAREST_MIPMAP_LINEAR;if(i===_e)return e.LINEAR;if(i===Se)return e.LINEAR_MIPMAP_NEAREST;if(i===je)return e.LINEAR_MIPMAP_LINEAR;if(i===Ce)return e.UNSIGNED_BYTE;if(i===Fe)return e.UNSIGNED_SHORT_4_4_4_4;if(i===Ge)return e.UNSIGNED_SHORT_5_5_5_1;if(i===Qe)return e.UNSIGNED_SHORT_5_6_5;if(i===Oe)return e.BYTE;if(i===ze)return e.SHORT;if(i===Re)return e.UNSIGNED_SHORT;if(i===Ue)return e.INT;if(i===Pe)return e.UNSIGNED_INT;if(i===Be)return e.FLOAT;if(i===ke&&null!==(n=t.get("OES_texture_half_float")))return n.HALF_FLOAT_OES;if(i===Ve)return e.ALPHA;if(i===He)return e.RGB;if(i===We)return e.RGBA;if(i===Xe)return e.LUMINANCE;if(i===Ze)return e.LUMINANCE_ALPHA;if(i===qe)return e.DEPTH_COMPONENT;if(i===Je)return e.DEPTH_STENCIL;if(i===B)return e.FUNC_ADD;if(i===k)return e.FUNC_SUBTRACT;if(i===F)return e.FUNC_REVERSE_SUBTRACT;if(i===Y)return e.ZERO;if(i===V)return e.ONE;if(i===H)return e.SRC_COLOR;if(i===W)return e.ONE_MINUS_SRC_COLOR;if(i===X)return e.SRC_ALPHA;if(i===Z)return e.ONE_MINUS_SRC_ALPHA;if(i===q)return e.DST_ALPHA;if(i===J)return e.ONE_MINUS_DST_ALPHA;if(i===K)return e.DST_COLOR;if(i===$)return e.ONE_MINUS_DST_COLOR;if(i===ee)return e.SRC_ALPHA_SATURATE;if((i===Ke||i===$e||i===et||i===tt)&&null!==(n=t.get("WEBGL_compressed_texture_s3tc"))){if(i===Ke)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===$e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===et)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===tt)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((i===it||i===nt||i===rt||i===at)&&null!==(n=t.get("WEBGL_compressed_texture_pvrtc"))){if(i===it)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===nt)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===rt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===at)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===ot&&null!==(n=t.get("WEBGL_compressed_texture_etc1")))return n.COMPRESSED_RGB_ETC1_WEBGL;if((i===st||i===ct||i===ut||i===ht||i===lt||i===dt||i===pt||i===ft||i===gt||i===mt||i===Mt||i===yt||i===vt||i===At)&&null!==(n=t.get("WEBGL_compressed_texture_astc")))return i;if((i===G||i===Q)&&null!==(n=t.get("EXT_blend_minmax"))){if(i===G)return n.MIN_EXT;if(i===Q)return n.MAX_EXT}return i===Ye&&null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:0}}}function Vr(e,t,i,n){Ai.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Hr(e){Vr.call(this),this.cameras=e||[]}function Wr(e){var t=this,i=null,n=null,r=null,a=new Ut,o=new Ut;"undefined"!=typeof window&&"VRFrameData"in window&&(n=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",m,!1));var s=new Ut,c=new Pt,u=new Bt,h=new Vr;h.bounds=new Xt(0,0,.5,1),h.layers.enable(1);var l=new Vr;l.bounds=new Xt(.5,0,.5,1),l.layers.enable(2);var d,p,f=new Hr([h,l]);function g(){return null!==i&&!0===i.isPresenting}function m(){if(g()){var n=i.getEyeParameters("left"),r=n.renderWidth,a=n.renderHeight;p=e.getPixelRatio(),d=e.getSize(),e.setDrawingBufferSize(2*r,a,1),M.start()}else t.enabled&&(e.setDrawingBufferSize(d.width,d.height,p),M.stop())}f.layers.enable(1),f.layers.enable(2),this.enabled=!1,this.userHeight=1.6,this.getDevice=function(){return i},this.setDevice=function(e){void 0!==e&&(i=e),M.setContext(e)},this.setPoseTarget=function(e){void 0!==e&&(r=e)},this.getCamera=function(e){if(null===i)return e;i.depthNear=e.near,i.depthFar=e.far,i.getFrameData(n);var d=i.stageParameters;d?a.fromArray(d.sittingToStandingTransform):a.makeTranslation(0,t.userHeight,0);var p=n.pose,g=null!==r?r:e;if(g.matrix.copy(a),g.matrix.decompose(g.position,g.quaternion,g.scale),null!==p.orientation&&(c.fromArray(p.orientation),g.quaternion.multiply(c)),null!==p.position&&(c.setFromRotationMatrix(a),u.fromArray(p.position),u.applyQuaternion(c),g.position.add(u)),g.updateMatrixWorld(),!1===i.isPresenting)return e;h.near=e.near,l.near=e.near,h.far=e.far,l.far=e.far,f.matrixWorld.copy(e.matrixWorld),f.matrixWorldInverse.copy(e.matrixWorldInverse),h.matrixWorldInverse.fromArray(n.leftViewMatrix),l.matrixWorldInverse.fromArray(n.rightViewMatrix),o.getInverse(a),h.matrixWorldInverse.multiply(o),l.matrixWorldInverse.multiply(o);var m=g.parent;null!==m&&(s.getInverse(m.matrixWorld),h.matrixWorldInverse.multiply(s),l.matrixWorldInverse.multiply(s)),h.matrixWorld.getInverse(h.matrixWorldInverse),l.matrixWorld.getInverse(l.matrixWorldInverse),h.projectionMatrix.fromArray(n.leftProjectionMatrix),l.projectionMatrix.fromArray(n.rightProjectionMatrix),f.projectionMatrix.copy(h.projectionMatrix);var M=i.getLayers();if(M.length){var y=M[0];null!==y.leftBounds&&4===y.leftBounds.length&&h.bounds.fromArray(y.leftBounds),null!==y.rightBounds&&4===y.rightBounds.length&&l.bounds.fromArray(y.rightBounds)}return f},this.getStandingMatrix=function(){return a},this.isPresenting=g;var M=new hi;this.setAnimationLoop=function(e){M.setAnimationLoop(e)},this.submitFrame=function(){g()&&i.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",m)}}function Xr(e){var t=e.context,i=null,n=null,r=null,a=null;function o(){return null!==n&&null!==r}var s=new Vr;s.layers.enable(1),s.viewport=new Xt;var c=new Vr;c.layers.enable(2),c.viewport=new Xt;var u=new Hr([s,c]);function h(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}u.layers.enable(1),u.layers.enable(2),this.enabled=!1,this.getDevice=function(){return i},this.setDevice=function(e){void 0!==e&&(i=e),t.setCompatibleXRDevice(e)},this.setSession=function(i,a){null!==(n=i)&&(n.addEventListener("end",function(){e.setFramebuffer(null),d.stop()}),n.baseLayer=new XRWebGLLayer(n,t),n.requestFrameOfReference(a.frameOfReferenceType).then(function(t){r=t,e.setFramebuffer(n.baseLayer.framebuffer),d.setContext(n),d.start()}))},this.getCamera=function(e){if(o()){var t=e.parent,i=u.cameras;h(u,t);for(var n=0;n<i.length;n++)h(i[n],t);e.matrixWorld.copy(u.matrixWorld);for(var r=e.children,a=(n=0,r.length);n<a;n++)r[n].updateMatrixWorld(!0);return u}return e},this.isPresenting=o;var l=null;var d=new hi;d.setAnimationLoop(function(e,t){a=t.getDevicePose(r);for(var i=n.baseLayer,o=t.views,s=0;s<o.length;s++){var c=o[s],h=i.getViewport(c),d=a.getViewMatrix(c),p=u.cameras[s];p.matrix.fromArray(d).getInverse(p.matrix),p.projectionMatrix.fromArray(c.projectionMatrix),p.viewport.set(h.x,h.y,h.width,h.height),0===s&&(u.matrix.copy(p.matrix),u.projectionMatrix.copy(p.projectionMatrix))}l&&l()}),this.setAnimationLoop=function(e){l=e},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new THREE.Matrix4},this.submitFrame=function(){}}function Zr(e){console.log("THREE.WebGLRenderer",y);var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),i=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,u=void 0!==e.powerPreference?e.powerPreference:"default",h=null,l=null;this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=pe,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,f,g,m,M,v,A,w,x,E,T,N,D,L,I,S,j,C,O=this,z=!1,R=null,U=null,P=null,B=-1,k="",F=null,G=null,Q=new Xt,Y=new Xt,V=null,H=0,W=t.width,X=t.height,Z=1,q=new Xt(0,0,W,X),J=new Xt(0,0,W,X),K=!1,$=new ti,ee=new hn,te=!1,ie=!1,ne=new Ut,re=new Bt;function ae(){return null===U?Z:1}try{var oe={alpha:n,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u};if(t.addEventListener("webglcontextlost",he,!1),t.addEventListener("webglcontextrestored",le,!1),null===(d=i||t.getContext("webgl",oe)||t.getContext("experimental-webgl",oe)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){console.error("THREE.WebGLRenderer: "+e.message)}function se(){(p=new ln(d)).get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_float_linear"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays"),C=new Yr(d,p),f=new un(d,p,e),(g=new Gr(d,p,C)).scissor(Y.copy(J).multiplyScalar(Z)),g.viewport(Q.copy(q).multiplyScalar(Z)),m=new fn(d),M=new vr,v=new Qr(d,p,g,M,f,C,m),A=new li(d),w=new dn(d,A,m),x=new Mn(w,m),L=new mn(d),E=new yr(O,p,f),T=new Er,N=new Rr,D=new sn(O,g,x,s),I=new cn(d,p,m),S=new pn(d,p,m),j=new Fr(O,d,g,v,f),m.programs=E.programs,O.context=d,O.capabilities=f,O.extensions=p,O.properties=M,O.renderLists=T,O.state=g,O.info=m}se();var ce="xr"in navigator?new Xr(O):new Wr(O);this.vr=ce;var ue=new Br(O,x,f.maxTextureSize);function he(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),z=!0}function le(){console.log("THREE.WebGLRenderer: Context Restored."),z=!1,se()}function de(e){var t=e.target;t.removeEventListener("dispose",de),function(e){fe(e),M.remove(e)}(t)}function fe(e){var t=M.get(e).program;e.program=void 0,void 0!==t&&E.releaseProgram(t)}this.shadowMap=ue,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=p.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=p.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(e){void 0!==e&&(Z=e,this.setSize(W,X,!1))},this.getSize=function(){return{width:W,height:X}},this.setSize=function(e,i,n){ce.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=e,X=i,t.width=e*Z,t.height=i*Z,!1!==n&&(t.style.width=e+"px",t.style.height=i+"px"),this.setViewport(0,0,e,i))},this.getDrawingBufferSize=function(){return{width:W*Z,height:X*Z}},this.setDrawingBufferSize=function(e,i,n){W=e,X=i,Z=n,t.width=e*n,t.height=i*n,this.setViewport(0,0,e,i)},this.getCurrentViewport=function(){return Q},this.setViewport=function(e,t,i,n){q.set(e,X-t-n,i,n),g.viewport(Q.copy(q).multiplyScalar(Z))},this.setScissor=function(e,t,i,n){J.set(e,X-t-n,i,n),g.scissor(Y.copy(J).multiplyScalar(Z))},this.setScissorTest=function(e){g.setScissorTest(K=e)},this.getClearColor=function(){return D.getClearColor()},this.setClearColor=function(){D.setClearColor.apply(D,arguments)},this.getClearAlpha=function(){return D.getClearAlpha()},this.setClearAlpha=function(){D.setClearAlpha.apply(D,arguments)},this.clear=function(e,t,i){var n=0;(void 0===e||e)&&(n|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=d.DEPTH_BUFFER_BIT),(void 0===i||i)&&(n|=d.STENCIL_BUFFER_BIT),d.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,i,n){this.setRenderTarget(e),this.clear(t,i,n)},this.dispose=function(){t.removeEventListener("webglcontextlost",he,!1),t.removeEventListener("webglcontextrestored",le,!1),T.dispose(),N.dispose(),M.dispose(),x.dispose(),ce.dispose(),Me.stop()},this.renderBufferImmediate=function(e,t,i){g.initAttributes();var n=M.get(e);e.hasPositions&&!n.position&&(n.position=d.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=d.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=d.createBuffer()),e.hasColors&&!n.color&&(n.color=d.createBuffer());var r=t.getAttributes();if(e.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,n.position),d.bufferData(d.ARRAY_BUFFER,e.positionArray,d.DYNAMIC_DRAW),g.enableAttribute(r.position),d.vertexAttribPointer(r.position,3,d.FLOAT,!1,0,0)),e.hasNormals){if(d.bindBuffer(d.ARRAY_BUFFER,n.normal),!i.isMeshPhongMaterial&&!i.isMeshStandardMaterial&&!i.isMeshNormalMaterial&&!0===i.flatShading)for(var a=0,o=3*e.count;a<o;a+=9){var s=e.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,u=(s[a+1]+s[a+4]+s[a+7])/3,h=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=u,s[a+2]=h,s[a+3]=c,s[a+4]=u,s[a+5]=h,s[a+6]=c,s[a+7]=u,s[a+8]=h}d.bufferData(d.ARRAY_BUFFER,e.normalArray,d.DYNAMIC_DRAW),g.enableAttribute(r.normal),d.vertexAttribPointer(r.normal,3,d.FLOAT,!1,0,0)}e.hasUvs&&i.map&&(d.bindBuffer(d.ARRAY_BUFFER,n.uv),d.bufferData(d.ARRAY_BUFFER,e.uvArray,d.DYNAMIC_DRAW),g.enableAttribute(r.uv),d.vertexAttribPointer(r.uv,2,d.FLOAT,!1,0,0)),e.hasColors&&i.vertexColors!==_&&(d.bindBuffer(d.ARRAY_BUFFER,n.color),d.bufferData(d.ARRAY_BUFFER,e.colorArray,d.DYNAMIC_DRAW),g.enableAttribute(r.color),d.vertexAttribPointer(r.color,3,d.FLOAT,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,i,n,r,a){var o=r.isMesh&&r.matrixWorld.determinant()<0;g.setMaterial(n,o);var s=we(e,t,n,r),c=i.id+"_"+s.id+"_"+(!0===n.wireframe),u=!1;c!==k&&(k=c,u=!0),r.morphTargetInfluences&&(L.update(r,i,n,s),u=!0);var h,l=i.index,f=i.attributes.position,m=1;!0===n.wireframe&&(l=w.getWireframeAttribute(i),m=2);var M=I;null!==l&&(h=A.get(l),(M=S).setIndex(h)),u&&(!function(e,t,i){if(i&&i.isInstancedBufferGeometry&&null===p.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");g.initAttributes();var n=i.attributes,r=t.getAttributes(),a=e.defaultAttributeValues;for(var o in r){var s=r[o];if(s>=0){var c=n[o];if(void 0!==c){var u=c.normalized,h=c.itemSize,l=A.get(c);if(void 0===l)continue;var f=l.buffer,m=l.type,M=l.bytesPerElement;if(c.isInterleavedBufferAttribute){var y=c.data,v=y.stride,w=c.offset;y&&y.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(s,y.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=y.meshPerAttribute*y.count)):g.enableAttribute(s),d.bindBuffer(d.ARRAY_BUFFER,f),d.vertexAttribPointer(s,h,m,u,v*M,w*M)}else c.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=c.meshPerAttribute*c.count)):g.enableAttribute(s),d.bindBuffer(d.ARRAY_BUFFER,f),d.vertexAttribPointer(s,h,m,u,0,0)}else if(void 0!==a){var x=a[o];if(void 0!==x)switch(x.length){case 2:d.vertexAttrib2fv(s,x);break;case 3:d.vertexAttrib3fv(s,x);break;case 4:d.vertexAttrib4fv(s,x);break;default:d.vertexAttrib1fv(s,x)}}}}g.disableUnusedAttributes()}(n,s,i),null!==l&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,h.buffer));var y=1/0;null!==l?y=l.count:void 0!==f&&(y=f.count);var v=i.drawRange.start*m,x=i.drawRange.count*m,E=null!==a?a.start*m:0,T=null!==a?a.count*m:1/0,N=Math.max(v,E),D=Math.min(y,v+x,E+T)-1,b=Math.max(0,D-N+1);if(0!==b){if(r.isMesh)if(!0===n.wireframe)g.setLineWidth(n.wireframeLinewidth*ae()),M.setMode(d.LINES);else switch(r.drawMode){case Et:M.setMode(d.TRIANGLES);break;case Tt:M.setMode(d.TRIANGLE_STRIP);break;case Nt:M.setMode(d.TRIANGLE_FAN)}else if(r.isLine){var _=n.linewidth;void 0===_&&(_=1),g.setLineWidth(_*ae()),r.isLineSegments?M.setMode(d.LINES):r.isLineLoop?M.setMode(d.LINE_LOOP):M.setMode(d.LINE_STRIP)}else r.isPoints&&M.setMode(d.POINTS);i&&i.isInstancedBufferGeometry?i.maxInstancedCount>0&&M.renderInstances(i,N,b):M.render(N,b)}},this.compile=function(e,t){(l=N.get(e,t)).init(),e.traverse(function(e){e.isLight&&(l.pushLight(e),e.castShadow&&l.pushShadow(e))}),l.setupLights(t),e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var i=0;i<t.material.length;i++)Ae(t.material[i],e.fog,t);else Ae(t.material,e.fog,t)})};var ge=null;var me,Me=new hi;function ye(e,t,i,n){for(var r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,c=o.geometry,u=void 0===n?o.material:n,h=o.group;if(i.isArrayCamera){G=i;for(var l=i.cameras,d=0,p=l.length;d<p;d++){var f=l[d];if(s.layers.test(f.layers)){if("viewport"in f)g.viewport(Q.copy(f.viewport));else{var m=f.bounds,M=m.x*W,y=m.y*X,v=m.z*W,A=m.w*X;g.viewport(Q.set(M,y,v,A).multiplyScalar(Z))}ve(s,t,f,c,u,h)}}}else G=null,ve(s,t,i,c,u,h)}}function ve(e,t,i,n,r,a){if(e.onBeforeRender(O,t,i,n,r,a),l=N.get(t,G||i),e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=e.isMesh&&e.matrixWorld.determinant()<0;g.setMaterial(r,o);var s=we(i,t.fog,r,e);k="",function(e,t,i){e.render(function(e){O.renderBufferImmediate(e,t,i)})}(e,s,r)}else O.renderBufferDirect(i,t.fog,n,r,e,a);e.onAfterRender(O,t,i,n,r,a),l=N.get(t,G||i)}function Ae(e,t,i){var n=M.get(e),r=l.state.lights,a=l.state.shadowsArray,o=E.getParameters(e,r.state,a,t,ee.numPlanes,ee.numIntersection,i),s=E.getProgramCode(e,o),c=n.program,u=!0;if(void 0===c)e.addEventListener("dispose",de);else if(c.code!==s)fe(e);else if(n.lightsHash!==r.state.hash)M.update(e,"lightsHash",r.state.hash),u=!1;else{if(void 0!==o.shaderID)return;u=!1}if(u){if(o.shaderID){var h=ui[o.shaderID];n.shader={name:e.type,uniforms:ri.clone(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}else n.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(n.shader,O),c=E.acquireProgram(e,n.shader,o,s),n.program=c,e.program=c}var d=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var p=0;p<O.maxMorphTargets;p++)d["morphTarget"+p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(p=0;p<O.maxMorphNormals;p++)d["morphNormal"+p]>=0&&e.numSupportedMorphNormals++}var f=n.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(n.numClippingPlanes=ee.numPlanes,n.numIntersection=ee.numIntersection,f.clippingPlanes=ee.uniform),n.fog=t,n.lightsHash=r.state.hash,e.lights&&(f.ambientLightColor.value=r.state.ambient,f.directionalLights.value=r.state.directional,f.spotLights.value=r.state.spot,f.rectAreaLights.value=r.state.rectArea,f.pointLights.value=r.state.point,f.hemisphereLights.value=r.state.hemi,f.directionalShadowMap.value=r.state.directionalShadowMap,f.directionalShadowMatrix.value=r.state.directionalShadowMatrix,f.spotShadowMap.value=r.state.spotShadowMap,f.spotShadowMatrix.value=r.state.spotShadowMatrix,f.pointShadowMap.value=r.state.pointShadowMap,f.pointShadowMatrix.value=r.state.pointShadowMatrix);var g=n.program.getUniforms(),m=or.seqWithValue(g.seq,f);n.uniformsList=m}function we(e,t,i,n){H=0;var r=M.get(i),a=l.state.lights;if(te&&(ie||e!==F)){var o=e===F&&i.id===B;ee.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,e,r,o)}!1===i.needsUpdate&&(void 0===r.program?i.needsUpdate=!0:i.fog&&r.fog!==t?i.needsUpdate=!0:i.lights&&r.lightsHash!==a.state.hash?i.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===ee.numPlanes&&r.numIntersection===ee.numIntersection||(i.needsUpdate=!0)),i.needsUpdate&&(Ae(i,t,n),i.needsUpdate=!1);var s,c,u=!1,h=!1,p=!1,m=r.program,y=m.getUniforms(),v=r.shader.uniforms;if(g.useProgram(m.program)&&(u=!0,h=!0,p=!0),i.id!==B&&(B=i.id,h=!0),u||e!==F){if(y.setValue(d,"projectionMatrix",e.projectionMatrix),f.logarithmicDepthBuffer&&y.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),F!==(G||e)&&(F=G||e,h=!0,p=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var A=y.map.cameraPosition;void 0!==A&&A.setValue(d,re.setFromMatrixPosition(e.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&y.setValue(d,"viewMatrix",e.matrixWorldInverse)}if(i.skinning){y.setOptional(d,n,"bindMatrix"),y.setOptional(d,n,"bindMatrixInverse");var w=n.skeleton;if(w){var x=w.bones;if(f.floatVertexTextures){if(void 0===w.boneTexture){var E=Math.sqrt(4*x.length);E=zt.ceilPowerOfTwo(E),E=Math.max(E,4);var T=new Float32Array(E*E*4);T.set(w.boneMatrices);var N=new Jt(T,E,E,We,Be);N.needsUpdate=!0,w.boneMatrices=T,w.boneTexture=N,w.boneTextureSize=E}y.setValue(d,"boneTexture",w.boneTexture),y.setValue(d,"boneTextureSize",w.boneTextureSize)}else y.setOptional(d,w,"boneMatrices")}}return h&&(y.setValue(d,"toneMappingExposure",O.toneMappingExposure),y.setValue(d,"toneMappingWhitePoint",O.toneMappingWhitePoint),i.lights&&(c=p,(s=v).ambientLightColor.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),t&&i.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(v,t),i.isMeshBasicMaterial?xe(v,i):i.isMeshLambertMaterial?(xe(v,i),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(v,i)):i.isMeshPhongMaterial?(xe(v,i),i.isMeshToonMaterial?function(e,t){Ee(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(v,i):Ee(v,i)):i.isMeshStandardMaterial?(xe(v,i),i.isMeshPhysicalMaterial?function(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,Te(e,t)}(v,i):Te(v,i)):i.isMeshDepthMaterial?(xe(v,i),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(v,i)):i.isMeshDistanceMaterial?(xe(v,i),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(v,i)):i.isMeshNormalMaterial?(xe(v,i),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===b&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===b&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(v,i)):i.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(v,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(v,i)):i.isPointsMaterial?function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*Z,e.scale.value=.5*X,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}(v,i):i.isShadowMaterial&&(v.color.value=i.color,v.opacity.value=i.opacity),void 0!==v.ltc_1&&(v.ltc_1.value=ci.LTC_1),void 0!==v.ltc_2&&(v.ltc_2.value=ci.LTC_2),or.upload(d,r.uniformsList,v,O)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(or.upload(d,r.uniformsList,v,O),i.uniformsNeedUpdate=!1),y.setValue(d,"modelViewMatrix",n.modelViewMatrix),y.setValue(d,"normalMatrix",n.normalMatrix),y.setValue(d,"modelMatrix",n.matrixWorld),m}function xe(e,t){var i;e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=M.get(t.envMap).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?i=t.map:t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}function Ee(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===b&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===b&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Te(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===b&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===b&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}Me.setAnimationLoop(function(){ce.isPresenting()||ge&&ge()}),Me.setContext(window),this.setAnimationLoop=function(e){ge=e,ce.setAnimationLoop(e),Me.start()},this.render=function(e,t,i,n){if(t&&t.isCamera){if(!z){k="",B=-1,F=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ce.enabled&&(t=ce.getCamera(t)),(l=N.get(e,t)).init(),e.onBeforeRender(O,e,t,i),ne.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromMatrix(ne),ie=this.localClippingEnabled,te=ee.init(this.clippingPlanes,ie,t),(h=T.get(e,t)).init(),function e(t,i,n){if(!1===t.visible)return;var r=t.layers.test(i.layers);if(r)if(t.isLight)l.pushLight(t),t.castShadow&&l.pushShadow(t);else if(t.isSprite)t.frustumCulled&&!$.intersectsSprite(t)||l.pushSprite(t);else if(t.isImmediateRenderObject)n&&re.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ne),h.push(t,null,t.material,re.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||$.intersectsObject(t))){n&&re.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ne);var a=x.update(t),o=t.material;if(Array.isArray(o))for(var s=a.groups,c=0,u=s.length;c<u;c++){var d=s[c],p=o[d.materialIndex];p&&p.visible&&h.push(t,a,p,re.z,d)}else o.visible&&h.push(t,a,o,re.z,null)}var f=t.children;for(c=0,u=f.length;c<u;c++)e(f[c],i,n)}(e,t,O.sortObjects),!0===O.sortObjects&&h.sort(),te&&ee.beginShadows();var r=l.state.shadowsArray;ue.render(r,e,t),l.setupLights(t),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),void 0===i&&(i=null),this.setRenderTarget(i),D.render(h,e,t,n);var a=h.opaque,o=h.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&ye(a,e,t,s),o.length&&ye(o,e,t,s)}else a.length&&ye(a,e,t),o.length&&ye(o,e,t);var c=l.state.spritesArray;j.render(c,e,t),i&&v.updateRenderTargetMipmap(i),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),e.onAfterRender(O,e,t),ce.enabled&&ce.submitFrame(),h=null,l=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var e=H;return e>=f.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+f.maxTextures),H+=1,e},this.setTexture2D=(me=!1,function(e,t){e&&e.isWebGLRenderTarget&&(me||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),me=!0),e=e.texture),v.setTexture2D(e,t)}),this.setTexture=function(){var e=!1;return function(t,i){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),v.setTexture2D(t,i)}}(),this.setTextureCube=function(){var e=!1;return function(t,i){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?v.setTextureCube(t,i):v.setTextureCubeDynamic(t,i)}}(),this.setFramebuffer=function(e){R=e},this.getRenderTarget=function(){return U},this.setRenderTarget=function(e){U=e,e&&void 0===M.get(e).__webglFramebuffer&&v.setupRenderTarget(e);var t=R,i=!1;if(e){var n=M.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=n[e.activeCubeFace],i=!0):t=n,Q.copy(e.viewport),Y.copy(e.scissor),V=e.scissorTest}else Q.copy(q).multiplyScalar(Z),Y.copy(J).multiplyScalar(Z),V=K;if(P!==t&&(d.bindFramebuffer(d.FRAMEBUFFER,t),P=t),g.viewport(Q),g.scissor(Y),g.setScissorTest(V),i){var r=M.get(e.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,r.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,i,n,r,a){if(e&&e.isWebGLRenderTarget){var o=M.get(e).__webglFramebuffer;if(o){var s=!1;o!==P&&(d.bindFramebuffer(d.FRAMEBUFFER,o),s=!0);try{var c=e.texture,u=c.format,h=c.type;if(u!==We&&C.convert(u)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===Ce||C.convert(h)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||h===Be&&(p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||h===ke&&p.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-n&&i>=0&&i<=e.height-r&&d.readPixels(t,i,n,r,C.convert(u),C.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&d.bindFramebuffer(d.FRAMEBUFFER,P)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,i){var n=t.image.width,r=t.image.height,a=C.convert(t.format);this.setTexture2D(t,0),d.copyTexImage2D(d.TEXTURE_2D,i||0,a,e.x,e.y,n,r,0)},this.copyTextureToTexture=function(e,t,i,n){var r=t.image.width,a=t.image.height,o=C.convert(i.format),s=C.convert(i.type);this.setTexture2D(i,0),t.isDataTexture?d.texSubImage2D(d.TEXTURE_2D,n||0,e.x,e.y,r,a,o,s,t.image.data):d.texSubImage2D(d.TEXTURE_2D,n||0,e.x,e.y,o,s,t.image)}}function qr(e,t){this.name="",this.color=new oi(e),this.density=void 0!==t?t:25e-5}function Jr(e,t,i){this.name="",this.color=new oi(e),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3}function Kr(){vi.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function $r(e){$i.call(this),this.type="SpriteMaterial",this.color=new oi(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function ea(e){vi.call(this),this.type="Sprite",this.material=void 0!==e?e:new $r,this.center=new Rt(.5,.5)}function ta(){vi.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function ia(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var i=0,n=this.bones.length;i<n;i++)this.boneInverses.push(new Ut)}}function na(){vi.call(this),this.type="Bone"}function ra(e,t){on.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ut,this.bindMatrixInverse=new Ut;var i=new ia(this.initBones());this.bind(i,this.matrixWorld),this.normalizeSkinWeights()}function aa(e){$i.call(this),this.type="LineBasicMaterial",this.color=new oi(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function oa(e,t,i){if(1===i)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new sa(e,t);vi.call(this),this.type="Line",this.geometry=void 0!==e?e:new ki,this.material=void 0!==t?t:new aa({color:16777215*Math.random()})}function sa(e,t){oa.call(this,e,t),this.type="LineSegments"}function ca(e,t){oa.call(this,e,t),this.type="LineLoop"}function ua(e){$i.call(this),this.type="PointsMaterial",this.color=new oi(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function ha(e,t){vi.call(this),this.type="Points",this.geometry=void 0!==e?e:new ki,this.material=void 0!==t?t:new ua({color:16777215*Math.random()})}function la(){vi.call(this),this.type="Group"}function da(e,t,i,n,r,a,o,s,c){Wt.call(this,e,t,i,n,r,a,o,s,c),this.generateMipmaps=!1}function pa(e,t,i,n,r,a,o,s,c,u,h,l){Wt.call(this,null,a,o,s,c,u,n,r,h,l),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function fa(e,t,i,n,r,a,o,s,c,u){if((u=void 0!==u?u:qe)!==qe&&u!==Je)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&u===qe&&(i=Re),void 0===i&&u===Je&&(i=Ye),Wt.call(this,null,n,r,a,o,s,u,i,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:Le,this.minFilter=void 0!==s?s:Le,this.flipY=!1,this.generateMipmaps=!1}function ga(e){ki.call(this),this.type="WireframeGeometry";var t,i,n,r,a,o,s,c,u,h,l=[],d=[0,0],p={},f=["a","b","c"];if(e&&e.isGeometry){var g=e.faces;for(t=0,n=g.length;t<n;t++){var m=g[t];for(i=0;i<3;i++)s=m[f[i]],c=m[f[(i+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]})}for(u in p)o=p[u],h=e.vertices[o.index1],l.push(h.x,h.y,h.z),h=e.vertices[o.index2],l.push(h.x,h.y,h.z)}else if(e&&e.isBufferGeometry){var M,y,v,A,w,x,E;if(h=new Bt,null!==e.index){for(M=e.attributes.position,y=e.index,0===(v=e.groups).length&&(v=[{start:0,count:y.count,materialIndex:0}]),r=0,a=v.length;r<a;++r)for(t=w=(A=v[r]).start,n=w+A.count;t<n;t+=3)for(i=0;i<3;i++)s=y.getX(t+i),c=y.getX(t+(i+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]});for(u in p)o=p[u],h.fromBufferAttribute(M,o.index1),l.push(h.x,h.y,h.z),h.fromBufferAttribute(M,o.index2),l.push(h.x,h.y,h.z)}else for(t=0,n=(M=e.attributes.position).count/3;t<n;t++)for(i=0;i<3;i++)x=3*t+i,h.fromBufferAttribute(M,x),l.push(h.x,h.y,h.z),E=3*t+(i+1)%3,h.fromBufferAttribute(M,E),l.push(h.x,h.y,h.z)}this.addAttribute("position",new zi(l,3))}function ma(e,t,i){Di.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i},this.fromBufferGeometry(new Ma(e,t,i)),this.mergeVertices()}function Ma(e,t,i){ki.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:i};var n,r,a=[],o=[],s=[],c=[],u=new Bt,h=new Bt,l=new Bt,d=new Bt,p=new Bt;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=t+1;for(n=0;n<=i;n++){var g=n/i;for(r=0;r<=t;r++){var m=r/t;e(m,g,h),o.push(h.x,h.y,h.z),m-1e-5>=0?(e(m-1e-5,g,l),d.subVectors(h,l)):(e(m+1e-5,g,l),d.subVectors(l,h)),g-1e-5>=0?(e(m,g-1e-5,l),p.subVectors(h,l)):(e(m,g+1e-5,l),p.subVectors(l,h)),u.crossVectors(d,p).normalize(),s.push(u.x,u.y,u.z),c.push(m,g)}}for(n=0;n<i;n++)for(r=0;r<t;r++){var M=n*f+r,y=n*f+r+1,v=(n+1)*f+r+1,A=(n+1)*f+r;a.push(M,y,A),a.push(y,v,A)}this.setIndex(a),this.addAttribute("position",new zi(o,3)),this.addAttribute("normal",new zi(s,3)),this.addAttribute("uv",new zi(c,2))}function ya(e,t,i,n){Di.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n},this.fromBufferGeometry(new va(e,t,i,n)),this.mergeVertices()}function va(e,t,i,n){ki.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n},i=i||1;var r=[],a=[];function o(e,t,i,n){var r,a,o=Math.pow(2,n),c=[];for(r=0;r<=o;r++){c[r]=[];var u=e.clone().lerp(i,r/o),h=t.clone().lerp(i,r/o),l=o-r;for(a=0;a<=l;a++)c[r][a]=0===a&&r===o?u:u.clone().lerp(h,a/l)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var d=Math.floor(a/2);a%2==0?(s(c[r][d+1]),s(c[r+1][d]),s(c[r][d])):(s(c[r][d+1]),s(c[r+1][d+1]),s(c[r+1][d]))}}function s(e){r.push(e.x,e.y,e.z)}function c(t,i){var n=3*t;i.x=e[n+0],i.y=e[n+1],i.z=e[n+2]}function u(e,t,i,n){n<0&&1===e.x&&(a[t]=e.x-1),0===i.x&&0===i.z&&(a[t]=n/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function l(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){for(var i=new Bt,n=new Bt,r=new Bt,a=0;a<t.length;a+=3)c(t[a+0],i),c(t[a+1],n),c(t[a+2],r),o(i,n,r,e)}(n=n||0),function(e){for(var t=new Bt,i=0;i<r.length;i+=3)t.x=r[i+0],t.y=r[i+1],t.z=r[i+2],t.normalize().multiplyScalar(e),r[i+0]=t.x,r[i+1]=t.y,r[i+2]=t.z}(i),function(){for(var e=new Bt,t=0;t<r.length;t+=3){e.x=r[t+0],e.y=r[t+1],e.z=r[t+2];var i=h(e)/2/Math.PI+.5,n=l(e)/Math.PI+.5;a.push(i,1-n)}(function(){for(var e=new Bt,t=new Bt,i=new Bt,n=new Bt,o=new Rt,s=new Rt,c=new Rt,l=0,d=0;l<r.length;l+=9,d+=6){e.set(r[l+0],r[l+1],r[l+2]),t.set(r[l+3],r[l+4],r[l+5]),i.set(r[l+6],r[l+7],r[l+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),c.set(a[d+4],a[d+5]),n.copy(e).add(t).add(i).divideScalar(3);var p=h(n);u(o,d+0,e,p),u(s,d+2,t,p),u(c,d+4,i,p)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],i=a[e+2],n=a[e+4],r=Math.max(t,i,n),o=Math.min(t,i,n);r>.9&&o<.1&&(t<.2&&(a[e+0]+=1),i<.2&&(a[e+2]+=1),n<.2&&(a[e+4]+=1))}}()}(),this.addAttribute("position",new zi(r,3)),this.addAttribute("normal",new zi(r.slice(),3)),this.addAttribute("uv",new zi(a,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function Aa(e,t){Di.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new wa(e,t)),this.mergeVertices()}function wa(e,t){va.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function xa(e,t){Di.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ea(e,t)),this.mergeVertices()}function Ea(e,t){va.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ta(e,t){Di.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Na(e,t)),this.mergeVertices()}function Na(e,t){var i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1];va.call(this,n,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Da(e,t){Di.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new La(e,t)),this.mergeVertices()}function La(e,t){var i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n];va.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ba(e,t,i,n,r,a){Di.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:n,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Ia(e,t,i,n,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Ia(e,t,i,n,r){ki.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:n,closed:r},t=t||64,i=i||1,n=n||8,r=r||!1;var a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,c=new Bt,u=new Bt,h=new Rt,l=new Bt,d=[],p=[],f=[],g=[];function m(r){l=e.getPointAt(r/t,l);var o=a.normals[r],h=a.binormals[r];for(s=0;s<=n;s++){var f=s/n*Math.PI*2,g=Math.sin(f),m=-Math.cos(f);u.x=m*o.x+g*h.x,u.y=m*o.y+g*h.y,u.z=m*o.z+g*h.z,u.normalize(),p.push(u.x,u.y,u.z),c.x=l.x+i*u.x,c.y=l.y+i*u.y,c.z=l.z+i*u.z,d.push(c.x,c.y,c.z)}}!function(){for(o=0;o<t;o++)m(o);m(!1===r?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=n;s++)h.x=o/t,h.y=s/n,f.push(h.x,h.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=n;o++){var e=(n+1)*(s-1)+(o-1),i=(n+1)*s+(o-1),r=(n+1)*s+o,a=(n+1)*(s-1)+o;g.push(e,i,a),g.push(i,r,a)}}()}(),this.setIndex(g),this.addAttribute("position",new zi(d,3)),this.addAttribute("normal",new zi(p,3)),this.addAttribute("uv",new zi(f,2))}function _a(e,t,i,n,r,a,o){Di.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:n,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Sa(e,t,i,n,r,a)),this.mergeVertices()}function Sa(e,t,i,n,r,a){ki.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:n,p:r,q:a},e=e||1,t=t||.4,i=Math.floor(i)||64,n=Math.floor(n)||8,r=r||2,a=a||3;var o,s,c=[],u=[],h=[],l=[],d=new Bt,p=new Bt,f=new Bt,g=new Bt,m=new Bt,M=new Bt,y=new Bt;for(o=0;o<=i;++o){var v=o/i*r*Math.PI*2;for(L(v,r,a,e,f),L(v+.01,r,a,e,g),M.subVectors(g,f),y.addVectors(g,f),m.crossVectors(M,y),y.crossVectors(m,M),m.normalize(),y.normalize(),s=0;s<=n;++s){var A=s/n*Math.PI*2,w=-t*Math.cos(A),x=t*Math.sin(A);d.x=f.x+(w*y.x+x*m.x),d.y=f.y+(w*y.y+x*m.y),d.z=f.z+(w*y.z+x*m.z),u.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),h.push(p.x,p.y,p.z),l.push(o/i),l.push(s/n)}}for(s=1;s<=i;s++)for(o=1;o<=n;o++){var E=(n+1)*(s-1)+(o-1),T=(n+1)*s+(o-1),N=(n+1)*s+o,D=(n+1)*(s-1)+o;c.push(E,T,D),c.push(T,N,D)}function L(e,t,i,n,r){var a=Math.cos(e),o=Math.sin(e),s=i/t*e,c=Math.cos(s);r.x=n*(2+c)*.5*a,r.y=n*(2+c)*o*.5,r.z=n*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new zi(u,3)),this.addAttribute("normal",new zi(h,3)),this.addAttribute("uv",new zi(l,2))}function ja(e,t,i,n,r){Di.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new Ca(e,t,i,n,r)),this.mergeVertices()}function Ca(e,t,i,n,r){ki.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r},e=e||1,t=t||.4,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;var a,o,s=[],c=[],u=[],h=[],l=new Bt,d=new Bt,p=new Bt;for(a=0;a<=i;a++)for(o=0;o<=n;o++){var f=o/n*r,g=a/i*Math.PI*2;d.x=(e+t*Math.cos(g))*Math.cos(f),d.y=(e+t*Math.cos(g))*Math.sin(f),d.z=t*Math.sin(g),c.push(d.x,d.y,d.z),l.x=e*Math.cos(f),l.y=e*Math.sin(f),p.subVectors(d,l).normalize(),u.push(p.x,p.y,p.z),h.push(o/n),h.push(a/i)}for(a=1;a<=i;a++)for(o=1;o<=n;o++){var m=(n+1)*a+o-1,M=(n+1)*(a-1)+o-1,y=(n+1)*(a-1)+o,v=(n+1)*a+o;s.push(m,M,v),s.push(M,y,v)}this.setIndex(s),this.addAttribute("position",new zi(c,3)),this.addAttribute("normal",new zi(u,3)),this.addAttribute("uv",new zi(h,2))}Ur.prototype=Object.create($i.prototype),Ur.prototype.constructor=Ur,Ur.prototype.isMeshDepthMaterial=!0,Ur.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Pr.prototype=Object.create($i.prototype),Pr.prototype.constructor=Pr,Pr.prototype.isMeshDistanceMaterial=!0,Pr.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},kr.prototype=Object.create(Wt.prototype),kr.prototype.constructor=kr,kr.prototype.isCanvasTexture=!0,Vr.prototype=Object.assign(Object.create(Ai.prototype),{constructor:Vr,isPerspectiveCamera:!0,copy:function(e,t){return Ai.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*zt.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*zt.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*zt.RAD2DEG*Math.atan(Math.tan(.5*zt.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,i,n,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*zt.DEG2RAD*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*n/o,t-=a.offsetY*i/s,n*=a.width/o,i*=a.height/s}var c=this.filmOffset;0!==c&&(r+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far)},toJSON:function(e){var t=vi.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),Hr.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Hr,isArrayCamera:!0}),qr.prototype.isFogExp2=!0,qr.prototype.clone=function(){return new qr(this.color,this.density)},qr.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Jr.prototype.isFog=!0,Jr.prototype.clone=function(){return new Jr(this.color,this.near,this.far)},Jr.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Kr.prototype=Object.assign(Object.create(vi.prototype),{constructor:Kr,copy:function(e,t){return vi.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=vi.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),$r.prototype=Object.create($i.prototype),$r.prototype.constructor=$r,$r.prototype.isSpriteMaterial=!0,$r.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},ea.prototype=Object.assign(Object.create(vi.prototype),{constructor:ea,isSprite:!0,raycast:(Nr=new Bt,Dr=new Bt,Lr=new Bt,function(e,t){Dr.setFromMatrixPosition(this.matrixWorld),e.ray.closestPointToPoint(Dr,Nr),Lr.setFromMatrixScale(this.matrixWorld);var i=Lr.x*Lr.y/4;if(!(Dr.distanceToSquared(Nr)>i)){var n=e.ray.origin.distanceTo(Nr);n<e.near||n>e.far||t.push({distance:n,point:Nr.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return vi.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),ta.prototype=Object.assign(Object.create(vi.prototype),{constructor:ta,copy:function(e){vi.prototype.copy.call(this,e,!1);for(var t=e.levels,i=0,n=t.length;i<n;i++){var r=t[i];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var i=this.levels,n=0;n<i.length&&!(t<i[n].distance);n++);i.splice(n,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,i=1,n=t.length;i<n&&!(e<t[i].distance);i++);return t[i-1].object},raycast:(br=new Bt,function(e,t){br.setFromMatrixPosition(this.matrixWorld);var i=e.ray.origin.distanceTo(br);this.getObjectForDistance(i).raycast(e,t)}),update:function(){var e=new Bt,t=new Bt;return function(i){var n=this.levels;if(n.length>1){e.setFromMatrixPosition(i.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var r=e.distanceTo(t);n[0].object.visible=!0;for(var a=1,o=n.length;a<o&&r>=n[a].distance;a++)n[a-1].object.visible=!1,n[a].object.visible=!0;for(;a<o;a++)n[a].object.visible=!1}}}(),toJSON:function(e){var t=vi.prototype.toJSON.call(this,e);t.object.levels=[];for(var i=this.levels,n=0,r=i.length;n<r;n++){var a=i[n];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),Object.assign(ia.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var i=new Ut;this.bones[e]&&i.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(i)}},pose:function(){var e,t,i;for(t=0,i=this.bones.length;t<i;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,i=this.bones.length;t<i;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(Ir=new Ut,_r=new Ut,function(){for(var e=this.bones,t=this.boneInverses,i=this.boneMatrices,n=this.boneTexture,r=0,a=e.length;r<a;r++){var o=e[r]?e[r].matrixWorld:_r;Ir.multiplyMatrices(o,t[r]),Ir.toArray(i,16*r)}void 0!==n&&(n.needsUpdate=!0)}),clone:function(){return new ia(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,i=this.bones.length;t<i;t++){var n=this.bones[t];if(n.name===e)return n}}}),na.prototype=Object.assign(Object.create(vi.prototype),{constructor:na,isBone:!0}),ra.prototype=Object.assign(Object.create(on.prototype),{constructor:ra,isSkinnedMesh:!0,initBones:function(){var e,t,i,n,r=[];if(this.geometry&&void 0!==this.geometry.bones){for(i=0,n=this.geometry.bones.length;i<n;i++)t=this.geometry.bones[i],e=new na,r.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(i=0,n=this.geometry.bones.length;i<n;i++)-1!==(t=this.geometry.bones[i]).parent&&null!==t.parent&&void 0!==r[t.parent]?r[t.parent].add(r[i]):this.add(r[i])}return this.updateMatrixWorld(!0),r},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++){var i=this.geometry.skinWeights[t];(e=1/i.manhattanLength())!==1/0?i.multiplyScalar(e):i.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var n=new Xt,r=this.geometry.attributes.skinWeight;for(t=0;t<r.count;t++)n.x=r.getX(t),n.y=r.getY(t),n.z=r.getZ(t),n.w=r.getW(t),(e=1/n.manhattanLength())!==1/0?n.multiplyScalar(e):n.set(1,0,0,0),r.setXYZW(t,n.x,n.y,n.z,n.w)}},updateMatrixWorld:function(e){on.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),aa.prototype=Object.create($i.prototype),aa.prototype.constructor=aa,aa.prototype.isLineBasicMaterial=!0,aa.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},oa.prototype=Object.assign(Object.create(vi.prototype),{constructor:oa,isLine:!0,computeLineDistances:(Sr=new Bt,jr=new Bt,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,i=[0],n=1,r=t.count;n<r;n++)Sr.fromBufferAttribute(t,n-1),jr.fromBufferAttribute(t,n),i[n]=i[n-1],i[n]+=Sr.distanceTo(jr);e.addAttribute("lineDistance",new zi(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((i=e.lineDistances)[0]=0,n=1,r=a.length;n<r;n++)i[n]=i[n-1],i[n]+=a[n-1].distanceTo(a[n])}return this}),raycast:function(){var e=new Ut,t=new nn,i=new $t;return function(n,r){var a=n.linePrecision,o=a*a,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(c),!1!==n.ray.intersectsSphere(i)){e.getInverse(c),t.copy(n.ray).applyMatrix4(e);var u=new Bt,h=new Bt,l=new Bt,d=new Bt,p=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var f=s.index,g=s.attributes.position.array;if(null!==f)for(var m=f.array,M=0,y=m.length-1;M<y;M+=p){var v=m[M],A=m[M+1];if(u.fromArray(g,3*v),h.fromArray(g,3*A),!(t.distanceSqToSegment(u,h,d,l)>o))d.applyMatrix4(this.matrixWorld),(E=n.ray.origin.distanceTo(d))<n.near||E>n.far||r.push({distance:E,point:l.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}else for(M=0,y=g.length/3-1;M<y;M+=p){if(u.fromArray(g,3*M),h.fromArray(g,3*M+3),!(t.distanceSqToSegment(u,h,d,l)>o))d.applyMatrix4(this.matrixWorld),(E=n.ray.origin.distanceTo(d))<n.near||E>n.far||r.push({distance:E,point:l.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var w=s.vertices,x=w.length;for(M=0;M<x-1;M+=p){var E;if(!(t.distanceSqToSegment(w[M],w[M+1],d,l)>o))d.applyMatrix4(this.matrixWorld),(E=n.ray.origin.distanceTo(d))<n.near||E>n.far||r.push({distance:E,point:l.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),sa.prototype=Object.assign(Object.create(oa.prototype),{constructor:sa,isLineSegments:!0,computeLineDistances:function(){var e=new Bt,t=new Bt;return function(){var i=this.geometry;if(i.isBufferGeometry)if(null===i.index){for(var n=i.attributes.position,r=[],a=0,o=n.count;a<o;a+=2)e.fromBufferAttribute(n,a),t.fromBufferAttribute(n,a+1),r[a]=0===a?0:r[a-1],r[a+1]=r[a]+e.distanceTo(t);i.addAttribute("lineDistance",new zi(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(i.isGeometry){var s=i.vertices;for(r=i.lineDistances,a=0,o=s.length;a<o;a+=2)e.copy(s[a]),t.copy(s[a+1]),r[a]=0===a?0:r[a-1],r[a+1]=r[a]+e.distanceTo(t)}return this}}()}),ca.prototype=Object.assign(Object.create(oa.prototype),{constructor:ca,isLineLoop:!0}),ua.prototype=Object.create($i.prototype),ua.prototype.constructor=ua,ua.prototype.isPointsMaterial=!0,ua.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this},ha.prototype=Object.assign(Object.create(vi.prototype),{constructor:ha,isPoints:!0,raycast:function(){var e=new Ut,t=new nn,i=new $t;return function(n,r){var a=this,o=this.geometry,s=this.matrixWorld,c=n.params.Points.threshold;if(null===o.boundingSphere&&o.computeBoundingSphere(),i.copy(o.boundingSphere),i.applyMatrix4(s),i.radius+=c,!1!==n.ray.intersectsSphere(i)){e.getInverse(s),t.copy(n.ray).applyMatrix4(e);var u=c/((this.scale.x+this.scale.y+this.scale.z)/3),h=u*u,l=new Bt,d=new Bt;if(o.isBufferGeometry){var p=o.index,f=o.attributes.position.array;if(null!==p)for(var g=p.array,m=0,M=g.length;m<M;m++){var y=g[m];l.fromArray(f,3*y),w(l,y)}else{m=0;for(var v=f.length/3;m<v;m++)l.fromArray(f,3*m),w(l,m)}}else{var A=o.vertices;for(m=0,v=A.length;m<v;m++)w(A[m],m)}}function w(e,i){var o=t.distanceSqToPoint(e);if(o<h){t.closestPointToPoint(e,d),d.applyMatrix4(s);var c=n.ray.origin.distanceTo(d);if(c<n.near||c>n.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:d.clone(),index:i,face:null,object:a})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),la.prototype=Object.assign(Object.create(vi.prototype),{constructor:la,isGroup:!0}),da.prototype=Object.assign(Object.create(Wt.prototype),{constructor:da,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),pa.prototype=Object.create(Wt.prototype),pa.prototype.constructor=pa,pa.prototype.isCompressedTexture=!0,fa.prototype=Object.create(Wt.prototype),fa.prototype.constructor=fa,fa.prototype.isDepthTexture=!0,ga.prototype=Object.create(ki.prototype),ga.prototype.constructor=ga,ma.prototype=Object.create(Di.prototype),ma.prototype.constructor=ma,Ma.prototype=Object.create(ki.prototype),Ma.prototype.constructor=Ma,ya.prototype=Object.create(Di.prototype),ya.prototype.constructor=ya,va.prototype=Object.create(ki.prototype),va.prototype.constructor=va,Aa.prototype=Object.create(Di.prototype),Aa.prototype.constructor=Aa,wa.prototype=Object.create(va.prototype),wa.prototype.constructor=wa,xa.prototype=Object.create(Di.prototype),xa.prototype.constructor=xa,Ea.prototype=Object.create(va.prototype),Ea.prototype.constructor=Ea,Ta.prototype=Object.create(Di.prototype),Ta.prototype.constructor=Ta,Na.prototype=Object.create(va.prototype),Na.prototype.constructor=Na,Da.prototype=Object.create(Di.prototype),Da.prototype.constructor=Da,La.prototype=Object.create(va.prototype),La.prototype.constructor=La,ba.prototype=Object.create(Di.prototype),ba.prototype.constructor=ba,Ia.prototype=Object.create(ki.prototype),Ia.prototype.constructor=Ia,_a.prototype=Object.create(Di.prototype),_a.prototype.constructor=_a,Sa.prototype=Object.create(ki.prototype),Sa.prototype.constructor=Sa,ja.prototype=Object.create(Di.prototype),ja.prototype.constructor=ja,Ca.prototype=Object.create(ki.prototype),Ca.prototype.constructor=Ca;var Oa=function(e,t,i){i=i||2;var n,r,a,o,s,c,u,h=t&&t.length,l=h?t[0]*i:e.length,d=za(e,0,l,i,!0),p=[];if(!d)return p;if(h&&(d=function(e,t,i,n){var r,a,o,s,c,u=[];for(r=0,a=t.length;r<a;r++)o=t[r]*n,s=r<a-1?t[r+1]*n:e.length,(c=za(e,o,s,n,!1))===c.next&&(c.steiner=!0),u.push(Va(c));for(u.sort(Ga),r=0;r<u.length;r++)Qa(u[r],i),i=Ra(i,i.next);return i}(e,t,d,i)),e.length>80*i){n=a=e[0],r=o=e[1];for(var f=i;f<l;f+=i)(s=e[f])<n&&(n=s),(c=e[f+1])<r&&(r=c),s>a&&(a=s),c>o&&(o=c);u=0!==(u=Math.max(a-n,o-r))?1/u:0}return Ua(d,p,i,n,r,u),p};function za(e,t,i,n,r){var a,o;if(r===function(e,t,i,n){for(var r=0,a=t,o=i-n;a<i;a+=n)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}(e,t,i,n)>0)for(a=t;a<i;a+=n)o=$a(a,e[a],e[a+1],o);else for(a=i-n;a>=t;a-=n)o=$a(a,e[a],e[a+1],o);return o&&Za(o,o.next)&&(eo(o),o=o.next),o}function Ra(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!Za(n,n.next)&&0!==Xa(n.prev,n,n.next))n=n.next;else{if(eo(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function Ua(e,t,i,n,r,a,o){if(e){!o&&a&&function(e,t,i,n){var r=e;do{null===r.z&&(r.z=Ya(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,i,n,r,a,o,s,c,u=1;do{for(i=e,e=null,a=null,o=0;i;){for(o++,n=i,s=0,t=0;t<u&&(s++,n=n.nextZ);t++);for(c=u;s>0||c>0&&n;)0!==s&&(0===c||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,c--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=n}a.nextZ=null,u*=2}while(o>1)}(r)}(e,n,r,a);for(var s,c,u=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?Ba(e,n,r,a):Pa(e))t.push(s.i/i),t.push(e.i/i),t.push(c.i/i),eo(e),e=c.next,u=c.next;else if((e=c)===u){o?1===o?Ua(e=ka(e,t,i),t,i,n,r,a,2):2===o&&Fa(e,t,i,n,r,a):Ua(Ra(e),t,i,n,r,a,1);break}}}function Pa(e){var t=e.prev,i=e,n=e.next;if(Xa(t,i,n)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(Ha(t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Xa(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ba(e,t,i,n){var r=e.prev,a=e,o=e.next;if(Xa(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,c=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,u=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,h=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,l=Ya(s,c,t,i,n),d=Ya(u,h,t,i,n),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&Ha(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Xa(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=l;){if(p!==e.prev&&p!==e.next&&Ha(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Xa(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function ka(e,t,i){var n=e;do{var r=n.prev,a=n.next.next;!Za(r,a)&&qa(r,n,n.next,a)&&Ja(r,a)&&Ja(a,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(a.i/i),eo(n),eo(n.next),n=e=a),n=n.next}while(n!==e);return n}function Fa(e,t,i,n,r,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Wa(o,s)){var c=Ka(o,s);return o=Ra(o,o.next),c=Ra(c,c.next),Ua(o,t,i,n,r,a),void Ua(c,t,i,n,r,a)}s=s.next}o=o.next}while(o!==e)}function Ga(e,t){return e.x-t.x}function Qa(e,t){if(t=function(e,t){var i,n=t,r=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>o){if(o=s,s===r){if(a===n.y)return n;if(a===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!i)return null;if(r===o)return i.prev;var c,u=i,h=i.x,l=i.y,d=1/0;n=i.next;for(;n!==u;)r>=n.x&&n.x>=h&&r!==n.x&&Ha(a<l?r:o,a,h,l,a<l?o:r,a,n.x,n.y)&&((c=Math.abs(a-n.y)/(r-n.x))<d||c===d&&n.x>i.x)&&Ja(n,e)&&(i=n,d=c),n=n.next;return i}(e,t)){var i=Ka(t,e);Ra(i,i.next)}}function Ya(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Va(e){var t=e,i=e;do{t.x<i.x&&(i=t),t=t.next}while(t!==e);return i}function Ha(e,t,i,n,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(i-o)*(t-s)>=0&&(i-o)*(a-s)-(r-o)*(n-s)>=0}function Wa(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&qa(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&Ja(e,t)&&Ja(t,e)&&function(e,t){var i=e,n=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)}function Xa(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Za(e,t){return e.x===t.x&&e.y===t.y}function qa(e,t,i,n){return!!(Za(e,t)&&Za(i,n)||Za(e,n)&&Za(i,t))||Xa(e,t,i)>0!=Xa(e,t,n)>0&&Xa(i,n,e)>0!=Xa(i,n,t)>0}function Ja(e,t){return Xa(e.prev,e,e.next)<0?Xa(e,t,e.next)>=0&&Xa(e,e.prev,t)>=0:Xa(e,t,e.prev)<0||Xa(e,e.next,t)<0}function Ka(e,t){var i=new to(e.i,e.x,e.y),n=new to(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function $a(e,t,i,n){var r=new to(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function eo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function to(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var io={area:function(e){for(var t=e.length,i=0,n=t-1,r=0;r<t;n=r++)i+=e[n].x*e[r].y-e[r].x*e[n].y;return.5*i},isClockWise:function(e){return io.area(e)<0},triangulateShape:function(e,t){var i=[],n=[],r=[];no(e),ro(i,e);var a=e.length;t.forEach(no);for(var o=0;o<t.length;o++)n.push(a),a+=t[o].length,ro(i,t[o]);var s=Oa(i,n);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function no(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ro(e,t){for(var i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}function ao(e,t){Di.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new oo(e,t)),this.mergeVertices()}function oo(e,t){ki.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var i=this,n=[],r=[],a=0,o=e.length;a<o;a++){s(e[a])}function s(e){var a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,c=void 0!==t.depth?t.depth:100,u=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:6,l=void 0!==t.bevelSize?t.bevelSize:h-2,d=void 0!==t.bevelSegments?t.bevelSegments:3,p=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:so;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=t.amount);var g,m,M,y,v,A,w,x,E=!1;p&&(g=p.getSpacedPoints(s),E=!0,u=!1,m=p.computeFrenetFrames(s,!1),M=new Bt,y=new Bt,v=new Bt),u||(d=0,h=0,l=0);var T=e.extractPoints(o),N=T.shape,D=T.holes;if(!io.isClockWise(N))for(N=N.reverse(),w=0,x=D.length;w<x;w++)A=D[w],io.isClockWise(A)&&(D[w]=A.reverse());var L=io.triangulateShape(N,D),b=N;for(w=0,x=D.length;w<x;w++)A=D[w],N=N.concat(A);function I(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}var _,S,j,C,O,z,R=N.length,U=L.length;function P(e,t,i){var n,r,a,o=e.x-t.x,s=e.y-t.y,c=i.x-e.x,u=i.y-e.y,h=o*o+s*s,l=o*u-s*c;if(Math.abs(l)>Number.EPSILON){var d=Math.sqrt(h),p=Math.sqrt(c*c+u*u),f=t.x-s/d,g=t.y+o/d,m=((i.x-u/p-f)*u-(i.y+c/p-g)*c)/(o*u-s*c),M=(n=f+o*m-e.x)*n+(r=g+s*m-e.y)*r;if(M<=2)return new Rt(n,r);a=Math.sqrt(M/2)}else{var y=!1;o>Number.EPSILON?c>Number.EPSILON&&(y=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),y?(n=-s,r=o,a=Math.sqrt(h)):(n=o,r=s,a=Math.sqrt(h/2))}return new Rt(n/a,r/a)}for(var B=[],k=0,F=b.length,G=F-1,Q=k+1;k<F;k++,G++,Q++)G===F&&(G=0),Q===F&&(Q=0),B[k]=P(b[k],b[G],b[Q]);var Y,V,H=[],W=B.concat();for(w=0,x=D.length;w<x;w++){for(A=D[w],Y=[],k=0,G=(F=A.length)-1,Q=k+1;k<F;k++,G++,Q++)G===F&&(G=0),Q===F&&(Q=0),Y[k]=P(A[k],A[G],A[Q]);H.push(Y),W=W.concat(Y)}for(_=0;_<d;_++){for(j=_/d,C=h*Math.cos(j*Math.PI/2),S=l*Math.sin(j*Math.PI/2),k=0,F=b.length;k<F;k++)Z((O=I(b[k],B[k],S)).x,O.y,-C);for(w=0,x=D.length;w<x;w++)for(A=D[w],Y=H[w],k=0,F=A.length;k<F;k++)Z((O=I(A[k],Y[k],S)).x,O.y,-C)}for(S=l,k=0;k<R;k++)O=u?I(N[k],W[k],S):N[k],E?(y.copy(m.normals[0]).multiplyScalar(O.x),M.copy(m.binormals[0]).multiplyScalar(O.y),v.copy(g[0]).add(y).add(M),Z(v.x,v.y,v.z)):Z(O.x,O.y,0);for(V=1;V<=s;V++)for(k=0;k<R;k++)O=u?I(N[k],W[k],S):N[k],E?(y.copy(m.normals[V]).multiplyScalar(O.x),M.copy(m.binormals[V]).multiplyScalar(O.y),v.copy(g[V]).add(y).add(M),Z(v.x,v.y,v.z)):Z(O.x,O.y,c/s*V);for(_=d-1;_>=0;_--){for(j=_/d,C=h*Math.cos(j*Math.PI/2),S=l*Math.sin(j*Math.PI/2),k=0,F=b.length;k<F;k++)Z((O=I(b[k],B[k],S)).x,O.y,c+C);for(w=0,x=D.length;w<x;w++)for(A=D[w],Y=H[w],k=0,F=A.length;k<F;k++)O=I(A[k],Y[k],S),E?Z(O.x,O.y+g[s-1].y,g[s-1].x+C):Z(O.x,O.y,c+C)}function X(e,t){var i,n;for(k=e.length;--k>=0;){i=k,(n=k-1)<0&&(n=e.length-1);var r=0,a=s+2*d;for(r=0;r<a;r++){var o=R*r,c=R*(r+1);J(t+i+o,t+n+o,t+n+c,t+i+c)}}}function Z(e,t,i){a.push(e),a.push(t),a.push(i)}function q(e,t,r){K(e),K(t),K(r);var a=n.length/3,o=f.generateTopUV(i,n,a-3,a-2,a-1);$(o[0]),$(o[1]),$(o[2])}function J(e,t,r,a){K(e),K(t),K(a),K(t),K(r),K(a);var o=n.length/3,s=f.generateSideWallUV(i,n,o-6,o-3,o-2,o-1);$(s[0]),$(s[1]),$(s[3]),$(s[1]),$(s[2]),$(s[3])}function K(e){n.push(a[3*e+0]),n.push(a[3*e+1]),n.push(a[3*e+2])}function $(e){r.push(e.x),r.push(e.y)}!function(){var e=n.length/3;if(u){var t=0,r=R*t;for(k=0;k<U;k++)q((z=L[k])[2]+r,z[1]+r,z[0]+r);for(r=R*(t=s+2*d),k=0;k<U;k++)q((z=L[k])[0]+r,z[1]+r,z[2]+r)}else{for(k=0;k<U;k++)q((z=L[k])[2],z[1],z[0]);for(k=0;k<U;k++)q((z=L[k])[0]+R*s,z[1]+R*s,z[2]+R*s)}i.addGroup(e,n.length/3-e,0)}(),function(){var e=n.length/3,t=0;for(X(b,t),t+=b.length,w=0,x=D.length;w<x;w++)X(A=D[w],t),t+=A.length;i.addGroup(e,n.length/3-e,1)}()}this.addAttribute("position",new zi(n,3)),this.addAttribute("uv",new zi(r,2)),this.computeVertexNormals()}ao.prototype=Object.create(Di.prototype),ao.prototype.constructor=ao,ao.prototype.toJSON=function(){var e=Di.prototype.toJSON.call(this);return co(this.parameters.shapes,this.parameters.options,e)},oo.prototype=Object.create(ki.prototype),oo.prototype.constructor=oo,oo.prototype.toJSON=function(){var e=ki.prototype.toJSON.call(this);return co(this.parameters.shapes,this.parameters.options,e)};var so={generateTopUV:function(e,t,i,n,r){var a=t[3*i],o=t[3*i+1],s=t[3*n],c=t[3*n+1],u=t[3*r],h=t[3*r+1];return[new Rt(a,o),new Rt(s,c),new Rt(u,h)]},generateSideWallUV:function(e,t,i,n,r,a){var o=t[3*i],s=t[3*i+1],c=t[3*i+2],u=t[3*n],h=t[3*n+1],l=t[3*n+2],d=t[3*r],p=t[3*r+1],f=t[3*r+2],g=t[3*a],m=t[3*a+1],M=t[3*a+2];return Math.abs(s-h)<.01?[new Rt(o,1-c),new Rt(u,1-l),new Rt(d,1-f),new Rt(g,1-M)]:[new Rt(s,1-c),new Rt(h,1-l),new Rt(p,1-f),new Rt(m,1-M)]}};function co(e,t,i){if(i.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var a=e[n];i.shapes.push(a.uuid)}else i.shapes.push(e.uuid);return void 0!==t.extrudePath&&(i.options.extrudePath=t.extrudePath.toJSON()),i}function uo(e,t){Di.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new ho(e,t)),this.mergeVertices()}function ho(e,t){var i=(t=t||{}).font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Di;var n=i.generateShapes(e,t.size,t.curveSegments);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),oo.call(this,n,t),this.type="TextBufferGeometry"}function lo(e,t,i,n,r,a,o){Di.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new po(e,t,i,n,r,a,o)),this.mergeVertices()}function po(e,t,i,n,r,a,o){ki.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var s,c,u=(a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),h=0,l=[],d=new Bt,p=new Bt,f=[],g=[],m=[],M=[];for(c=0;c<=i;c++){var y=[],v=c/i;for(s=0;s<=t;s++){var A=s/t;d.x=-e*Math.cos(n+A*r)*Math.sin(a+v*o),d.y=e*Math.cos(a+v*o),d.z=e*Math.sin(n+A*r)*Math.sin(a+v*o),g.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),m.push(p.x,p.y,p.z),M.push(A,1-v),y.push(h++)}l.push(y)}for(c=0;c<i;c++)for(s=0;s<t;s++){var w=l[c][s+1],x=l[c][s],E=l[c+1][s],T=l[c+1][s+1];(0!==c||a>0)&&f.push(w,x,T),(c!==i-1||u<Math.PI)&&f.push(x,E,T)}this.setIndex(f),this.addAttribute("position",new zi(g,3)),this.addAttribute("normal",new zi(m,3)),this.addAttribute("uv",new zi(M,2))}function fo(e,t,i,n,r,a){Di.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new go(e,t,i,n,r,a)),this.mergeVertices()}function go(e,t,i,n,r,a){ki.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},e=e||.5,t=t||1,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,i=void 0!==i?Math.max(3,i):8;var o,s,c,u=[],h=[],l=[],d=[],p=e,f=(t-e)/(n=void 0!==n?Math.max(1,n):1),g=new Bt,m=new Rt;for(s=0;s<=n;s++){for(c=0;c<=i;c++)o=r+c/i*a,g.x=p*Math.cos(o),g.y=p*Math.sin(o),h.push(g.x,g.y,g.z),l.push(0,0,1),m.x=(g.x/t+1)/2,m.y=(g.y/t+1)/2,d.push(m.x,m.y);p+=f}for(s=0;s<n;s++){var M=s*(i+1);for(c=0;c<i;c++){var y=o=c+M,v=o+i+1,A=o+i+2,w=o+1;u.push(y,v,w),u.push(v,A,w)}}this.setIndex(u),this.addAttribute("position",new zi(h,3)),this.addAttribute("normal",new zi(l,3)),this.addAttribute("uv",new zi(d,2))}function mo(e,t,i,n){Di.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},this.fromBufferGeometry(new Mo(e,t,i,n)),this.mergeVertices()}function Mo(e,t,i,n){ki.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=Math.floor(t)||12,i=i||0,n=n||2*Math.PI,n=zt.clamp(n,0,2*Math.PI);var r,a,o,s=[],c=[],u=[],h=1/t,l=new Bt,d=new Rt;for(a=0;a<=t;a++){var p=i+a*h*n,f=Math.sin(p),g=Math.cos(p);for(o=0;o<=e.length-1;o++)l.x=e[o].x*f,l.y=e[o].y,l.z=e[o].x*g,c.push(l.x,l.y,l.z),d.x=a/t,d.y=o/(e.length-1),u.push(d.x,d.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var m=r=o+a*e.length,M=r+e.length,y=r+e.length+1,v=r+1;s.push(m,M,v),s.push(M,y,v)}if(this.setIndex(s),this.addAttribute("position",new zi(c,3)),this.addAttribute("uv",new zi(u,2)),this.computeVertexNormals(),n===2*Math.PI){var A=this.attributes.normal.array,w=new Bt,x=new Bt,E=new Bt;for(r=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)w.x=A[o+0],w.y=A[o+1],w.z=A[o+2],x.x=A[r+o+0],x.y=A[r+o+1],x.z=A[r+o+2],E.addVectors(w,x).normalize(),A[o+0]=A[r+o+0]=E.x,A[o+1]=A[r+o+1]=E.y,A[o+2]=A[r+o+2]=E.z}}function yo(e,t){Di.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new vo(e,t)),this.mergeVertices()}function vo(e,t){ki.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var i=[],n=[],r=[],a=[],o=0,s=0;if(!1===Array.isArray(e))u(e);else for(var c=0;c<e.length;c++)u(e[c]),this.addGroup(o,s,c),o+=s,s=0;function u(e){var o,c,u,h=n.length/3,l=e.extractPoints(t),d=l.shape,p=l.holes;if(!1===io.isClockWise(d))for(d=d.reverse(),o=0,c=p.length;o<c;o++)u=p[o],!0===io.isClockWise(u)&&(p[o]=u.reverse());var f=io.triangulateShape(d,p);for(o=0,c=p.length;o<c;o++)u=p[o],d=d.concat(u);for(o=0,c=d.length;o<c;o++){var g=d[o];n.push(g.x,g.y,0),r.push(0,0,1),a.push(g.x,g.y)}for(o=0,c=f.length;o<c;o++){var m=f[o],M=m[0]+h,y=m[1]+h,v=m[2]+h;i.push(M,y,v),s+=3}}this.setIndex(i),this.addAttribute("position",new zi(n,3)),this.addAttribute("normal",new zi(r,3)),this.addAttribute("uv",new zi(a,2))}function Ao(e,t){if(t.shapes=[],Array.isArray(e))for(var i=0,n=e.length;i<n;i++){var r=e[i];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}function wo(e,t){ki.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var i,n,r,a,o=[],s=Math.cos(zt.DEG2RAD*t),c=[0,0],u={},h=["a","b","c"];e.isBufferGeometry?(a=new Di).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var l=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var g=d[p],m=0;m<3;m++)i=g[h[m]],n=g[h[(m+1)%3]],c[0]=Math.min(i,n),c[1]=Math.max(i,n),void 0===u[r=c[0]+","+c[1]]?u[r]={index1:c[0],index2:c[1],face1:p,face2:void 0}:u[r].face2=p;for(r in u){var M=u[r];if(void 0===M.face2||d[M.face1].normal.dot(d[M.face2].normal)<=s){var y=l[M.index1];o.push(y.x,y.y,y.z),y=l[M.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new zi(o,3))}function xo(e,t,i,n,r,a,o,s){Di.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Eo(e,t,i,n,r,a,o,s)),this.mergeVertices()}function Eo(e,t,i,n,r,a,o,s){ki.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,i=i||1,n=Math.floor(n)||8,r=Math.floor(r)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var u=[],h=[],l=[],d=[],p=0,f=[],g=i/2,m=0;function M(i){var r,a,f,M=new Rt,y=new Bt,v=0,A=!0===i?e:t,w=!0===i?1:-1;for(a=p,r=1;r<=n;r++)h.push(0,g*w,0),l.push(0,w,0),d.push(.5,.5),p++;for(f=p,r=0;r<=n;r++){var x=r/n*s+o,E=Math.cos(x),T=Math.sin(x);y.x=A*T,y.y=g*w,y.z=A*E,h.push(y.x,y.y,y.z),l.push(0,w,0),M.x=.5*E+.5,M.y=.5*T*w+.5,d.push(M.x,M.y),p++}for(r=0;r<n;r++){var N=a+r,D=f+r;!0===i?u.push(D,D+1,N):u.push(D+1,D,N),v+=3}c.addGroup(m,v,!0===i?1:2),m+=v}!function(){var a,M,y=new Bt,v=new Bt,A=0,w=(t-e)/i;for(M=0;M<=r;M++){var x=[],E=M/r,T=E*(t-e)+e;for(a=0;a<=n;a++){var N=a/n,D=N*s+o,L=Math.sin(D),b=Math.cos(D);v.x=T*L,v.y=-E*i+g,v.z=T*b,h.push(v.x,v.y,v.z),y.set(L,w,b).normalize(),l.push(y.x,y.y,y.z),d.push(N,1-E),x.push(p++)}f.push(x)}for(a=0;a<n;a++)for(M=0;M<r;M++){var I=f[M][a],_=f[M+1][a],S=f[M+1][a+1],j=f[M][a+1];u.push(I,_,j),u.push(_,S,j),A+=6}c.addGroup(m,A,0),m+=A}(),!1===a&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(u),this.addAttribute("position",new zi(h,3)),this.addAttribute("normal",new zi(l,3)),this.addAttribute("uv",new zi(d,2))}function To(e,t,i,n,r,a,o){xo.call(this,0,e,t,i,n,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function No(e,t,i,n,r,a,o){Eo.call(this,0,e,t,i,n,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function Do(e,t,i,n){Di.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new Lo(e,t,i,n)),this.mergeVertices()}function Lo(e,t,i,n){ki.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},e=e||1,t=void 0!==t?Math.max(3,t):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;var r,a,o=[],s=[],c=[],u=[],h=new Bt,l=new Rt;for(s.push(0,0,0),c.push(0,0,1),u.push(.5,.5),a=0,r=3;a<=t;a++,r+=3){var d=i+a/t*n;h.x=e*Math.cos(d),h.y=e*Math.sin(d),s.push(h.x,h.y,h.z),c.push(0,0,1),l.x=(s[r]/e+1)/2,l.y=(s[r+1]/e+1)/2,u.push(l.x,l.y)}for(r=1;r<=t;r++)o.push(r,r+1,0);this.setIndex(o),this.addAttribute("position",new zi(s,3)),this.addAttribute("normal",new zi(c,3)),this.addAttribute("uv",new zi(u,2))}uo.prototype=Object.create(Di.prototype),uo.prototype.constructor=uo,ho.prototype=Object.create(oo.prototype),ho.prototype.constructor=ho,lo.prototype=Object.create(Di.prototype),lo.prototype.constructor=lo,po.prototype=Object.create(ki.prototype),po.prototype.constructor=po,fo.prototype=Object.create(Di.prototype),fo.prototype.constructor=fo,go.prototype=Object.create(ki.prototype),go.prototype.constructor=go,mo.prototype=Object.create(Di.prototype),mo.prototype.constructor=mo,Mo.prototype=Object.create(ki.prototype),Mo.prototype.constructor=Mo,yo.prototype=Object.create(Di.prototype),yo.prototype.constructor=yo,yo.prototype.toJSON=function(){var e=Di.prototype.toJSON.call(this);return Ao(this.parameters.shapes,e)},vo.prototype=Object.create(ki.prototype),vo.prototype.constructor=vo,vo.prototype.toJSON=function(){var e=ki.prototype.toJSON.call(this);return Ao(this.parameters.shapes,e)},wo.prototype=Object.create(ki.prototype),wo.prototype.constructor=wo,xo.prototype=Object.create(Di.prototype),xo.prototype.constructor=xo,Eo.prototype=Object.create(ki.prototype),Eo.prototype.constructor=Eo,To.prototype=Object.create(xo.prototype),To.prototype.constructor=To,No.prototype=Object.create(Eo.prototype),No.prototype.constructor=No,Do.prototype=Object.create(Di.prototype),Do.prototype.constructor=Do,Lo.prototype=Object.create(ki.prototype),Lo.prototype.constructor=Lo;var bo=Object.freeze({WireframeGeometry:ga,ParametricGeometry:ma,ParametricBufferGeometry:Ma,TetrahedronGeometry:Aa,TetrahedronBufferGeometry:wa,OctahedronGeometry:xa,OctahedronBufferGeometry:Ea,IcosahedronGeometry:Ta,IcosahedronBufferGeometry:Na,DodecahedronGeometry:Da,DodecahedronBufferGeometry:La,PolyhedronGeometry:ya,PolyhedronBufferGeometry:va,TubeGeometry:ba,TubeBufferGeometry:Ia,TorusKnotGeometry:_a,TorusKnotBufferGeometry:Sa,TorusGeometry:ja,TorusBufferGeometry:Ca,TextGeometry:uo,TextBufferGeometry:ho,SphereGeometry:lo,SphereBufferGeometry:po,RingGeometry:fo,RingBufferGeometry:go,PlaneGeometry:Qi,PlaneBufferGeometry:Yi,LatheGeometry:mo,LatheBufferGeometry:Mo,ShapeGeometry:yo,ShapeBufferGeometry:vo,ExtrudeGeometry:ao,ExtrudeBufferGeometry:oo,EdgesGeometry:wo,ConeGeometry:To,ConeBufferGeometry:No,CylinderGeometry:xo,CylinderBufferGeometry:Eo,CircleGeometry:Do,CircleBufferGeometry:Lo,BoxGeometry:Fi,BoxBufferGeometry:Gi});function Io(e){$i.call(this),this.type="ShadowMaterial",this.color=new oi(0),this.transparent=!0,this.setValues(e)}function _o(e){tn.call(this,e),this.type="RawShaderMaterial"}function So(e){$i.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new oi(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function jo(e){So.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function Co(e){$i.call(this),this.type="MeshPhongMaterial",this.color=new oi(16777215),this.specular=new oi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ue,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Oo(e){Co.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function zo(e){$i.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Ro(e){$i.call(this),this.type="MeshLambertMaterial",this.color=new oi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new oi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ue,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Uo(e){aa.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Io.prototype=Object.create($i.prototype),Io.prototype.constructor=Io,Io.prototype.isShadowMaterial=!0,Io.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.color.copy(e.color),this},_o.prototype=Object.create(tn.prototype),_o.prototype.constructor=_o,_o.prototype.isRawShaderMaterial=!0,So.prototype=Object.create($i.prototype),So.prototype.constructor=So,So.prototype.isMeshStandardMaterial=!0,So.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},jo.prototype=Object.create(So.prototype),jo.prototype.constructor=jo,jo.prototype.isMeshPhysicalMaterial=!0,jo.prototype.copy=function(e){return So.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},Co.prototype=Object.create($i.prototype),Co.prototype.constructor=Co,Co.prototype.isMeshPhongMaterial=!0,Co.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Oo.prototype=Object.create(Co.prototype),Oo.prototype.constructor=Oo,Oo.prototype.isMeshToonMaterial=!0,Oo.prototype.copy=function(e){return Co.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},zo.prototype=Object.create($i.prototype),zo.prototype.constructor=zo,zo.prototype.isMeshNormalMaterial=!0,zo.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ro.prototype=Object.create($i.prototype),Ro.prototype.constructor=Ro,Ro.prototype.isMeshLambertMaterial=!0,Ro.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Uo.prototype=Object.create(aa.prototype),Uo.prototype.constructor=Uo,Uo.prototype.isLineDashedMaterial=!0,Uo.prototype.copy=function(e){return aa.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Po=Object.freeze({ShadowMaterial:Io,SpriteMaterial:$r,RawShaderMaterial:_o,ShaderMaterial:tn,PointsMaterial:ua,MeshPhysicalMaterial:jo,MeshStandardMaterial:So,MeshPhongMaterial:Co,MeshToonMaterial:Oo,MeshNormalMaterial:zo,MeshLambertMaterial:Ro,MeshDepthMaterial:Ur,MeshDistanceMaterial:Pr,MeshBasicMaterial:en,LineDashedMaterial:Uo,LineBasicMaterial:aa,Material:$i}),Bo={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ko(e,t,i){var n=this,r=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++,!1===r&&void 0!==n.onStart&&n.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==n.onProgress&&n.onProgress(e,a,o),a===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var Fo=new ko,Go={};function Qo(e){this.manager=void 0!==e?e:Fo}function Yo(e){this.manager=void 0!==e?e:Fo}function Vo(e){this.manager=void 0!==e?e:Fo}function Ho(){this.type="Curve",this.arcLengthDivisions=200}function Wo(e,t,i,n,r,a,o,s){Ho.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=i||1,this.yRadius=n||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function Xo(e,t,i,n,r,a){Wo.call(this,e,t,i,i,n,r,a),this.type="ArcCurve"}function Zo(){var e=0,t=0,i=0,n=0;function r(r,a,o,s){e=r,t=o,i=-3*r+3*a-2*o-s,n=2*r-2*a+o+s}return{initCatmullRom:function(e,t,i,n,a){r(t,i,a*(i-e),a*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,a,o,s){var c=(t-e)/a-(i-e)/(a+o)+(i-t)/o,u=(i-t)/o-(n-t)/(o+s)+(n-i)/s;r(t,i,c*=o,u*=o)},calc:function(r){var a=r*r;return e+t*r+i*a+n*(a*r)}}}Object.assign(Qo.prototype,{load:function(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Bo.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;if(void 0===Go[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],u=o[3];u=window.decodeURIComponent(u),c&&(u=window.atob(u));try{var h,l=(this.responseType||"").toLowerCase();switch(l){case"arraybuffer":case"blob":for(var d=new Uint8Array(u.length),p=0;p<u.length;p++)d[p]=u.charCodeAt(p);h="blob"===l?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(u,s);break;case"json":h=JSON.parse(u);break;default:h=u}window.setTimeout(function(){t&&t(h),r.manager.itemEnd(e)},0)}catch(t){window.setTimeout(function(){n&&n(t),r.manager.itemEnd(e),r.manager.itemError(e)},0)}}else{Go[e]=[],Go[e].push({onLoad:t,onProgress:i,onError:n});var g=new XMLHttpRequest;for(var m in g.open("GET",e,!0),g.addEventListener("load",function(t){var i=this.response;Bo.add(e,i);var n=Go[e];if(delete Go[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var a=0,o=n.length;a<o;a++){(s=n[a]).onLoad&&s.onLoad(i)}r.manager.itemEnd(e)}else{for(a=0,o=n.length;a<o;a++){var s;(s=n[a]).onError&&s.onError(t)}r.manager.itemEnd(e),r.manager.itemError(e)}},!1),g.addEventListener("progress",function(t){for(var i=Go[e],n=0,r=i.length;n<r;n++){var a=i[n];a.onProgress&&a.onProgress(t)}},!1),g.addEventListener("error",function(t){var i=Go[e];delete Go[e];for(var n=0,a=i.length;n<a;n++){var o=i[n];o.onError&&o.onError(t)}r.manager.itemEnd(e),r.manager.itemError(e)},!1),void 0!==this.responseType&&(g.responseType=this.responseType),void 0!==this.withCredentials&&(g.withCredentials=this.withCredentials),g.overrideMimeType&&g.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)g.setRequestHeader(m,this.requestHeader[m]);g.send(null)}return r.manager.itemStart(e),g}Go[e].push({onLoad:t,onProgress:i,onError:n})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:Fo,this._parser=null}.prototype,{load:function(e,t,i,n){var r=this,a=[],o=new pa;o.image=a;var s=new Qo(this.manager);function c(c){s.load(e[c],function(e){var i=r._parser(e,!0);a[c]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},6===(u+=1)&&(1===i.mipmapCount&&(o.minFilter=_e),o.format=i.format,o.needsUpdate=!0,t&&t(o))},i,n)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var u=0,h=0,l=e.length;h<l;++h)c(h);else s.load(e,function(e){var i=r._parser(e,!0);if(i.isCubemap)for(var n=i.mipmaps.length/i.mipmapCount,s=0;s<n;s++){a[s]={mipmaps:[]};for(var c=0;c<i.mipmapCount;c++)a[s].mipmaps.push(i.mipmaps[s*i.mipmapCount+c]),a[s].format=i.format,a[s].width=i.width,a[s].height=i.height}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=_e),o.format=i.format,o.needsUpdate=!0,t&&t(o)},i,n);return o},setPath:function(e){return this.path=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:Fo,this._parser=null}.prototype,{load:function(e,t,i,n){var r=this,a=new Jt,o=new Qo(this.manager);return o.setResponseType("arraybuffer"),o.load(e,function(e){var i=r._parser(e);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:Ne,a.wrapT=void 0!==i.wrapT?i.wrapT:Ne,a.magFilter=void 0!==i.magFilter?i.magFilter:_e,a.minFilter=void 0!==i.minFilter?i.minFilter:je,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps),1===i.mipmapCount&&(a.minFilter=_e),a.needsUpdate=!0,t&&t(a,i))},i,n),a}}),Object.assign(Yo.prototype,{crossOrigin:"Anonymous",load:function(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Bo.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),Bo.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),n&&n(t),r.manager.itemEnd(e),r.manager.itemError(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",c,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:Fo}.prototype,{crossOrigin:"Anonymous",load:function(e,t,i,n){var r=new yn,a=new Yo(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(i){a.load(e[i],function(e){r.images[i]=e,6===++o&&(r.needsUpdate=!0,t&&t(r))},void 0,n)}for(var c=0;c<e.length;++c)s(c);return r},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Vo.prototype,{crossOrigin:"Anonymous",load:function(e,t,i,n){var r=new Wt,a=new Yo(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(i){r.image=i;var n=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);r.format=n?He:We,r.needsUpdate=!0,void 0!==t&&t(r)},i,n),r},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Ho.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var i=this.getUtoTmapping(e);return this.getPoint(i,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,n=[],r=this.getPoint(0),a=0;for(n.push(0),i=1;i<=e;i++)a+=(t=this.getPoint(i/e)).distanceTo(r),n.push(a),r=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var i,n=this.getLengths(),r=0,a=n.length;i=t||e*n[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=n[r=Math.floor(s+(c-s)/2)]-i)<0)s=r+1;else{if(!(o>0)){c=r;break}c=r-1}if(n[r=c]===i)return r/(a-1);var u=n[r];return(r+(i-u)/(n[r+1]-u))/(a-1)},getTangent:function(e){var t=e-1e-4,i=e+1e-4;t<0&&(t=0),i>1&&(i=1);var n=this.getPoint(t);return this.getPoint(i).clone().sub(n).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var i,n,r,a=new Bt,o=[],s=[],c=[],u=new Bt,h=new Ut;for(i=0;i<=e;i++)n=i/e,o[i]=this.getTangentAt(n),o[i].normalize();s[0]=new Bt,c[0]=new Bt;var l=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=l&&(l=d,a.set(1,0,0)),p<=l&&(l=p,a.set(0,1,0)),f<=l&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),c[0].crossVectors(o[0],s[0]),i=1;i<=e;i++)s[i]=s[i-1].clone(),c[i]=c[i-1].clone(),u.crossVectors(o[i-1],o[i]),u.length()>Number.EPSILON&&(u.normalize(),r=Math.acos(zt.clamp(o[i-1].dot(o[i]),-1,1)),s[i].applyMatrix4(h.makeRotationAxis(u,r))),c[i].crossVectors(o[i],s[i]);if(!0===t)for(r=Math.acos(zt.clamp(s[0].dot(s[e]),-1,1)),r/=e,o[0].dot(u.crossVectors(s[0],s[e]))>0&&(r=-r),i=1;i<=e;i++)s[i].applyMatrix4(h.makeRotationAxis(o[i],r*i)),c[i].crossVectors(o[i],s[i]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Wo.prototype=Object.create(Ho.prototype),Wo.prototype.constructor=Wo,Wo.prototype.isEllipseCurve=!0,Wo.prototype.getPoint=function(e,t){for(var i=t||new Rt,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=a?0:n),!0!==this.aClockwise||a||(r===n?r=-n:r-=n);var o=this.aStartAngle+e*r,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),l=s-this.aX,d=c-this.aY;s=l*u-d*h+this.aX,c=l*h+d*u+this.aY}return i.set(s,c)},Wo.prototype.copy=function(e){return Ho.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Wo.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},Wo.prototype.fromJSON=function(e){return Ho.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Xo.prototype=Object.create(Wo.prototype),Xo.prototype.constructor=Xo,Xo.prototype.isArcCurve=!0;var qo=new Bt,Jo=new Zo,Ko=new Zo,$o=new Zo;function es(e,t,i,n){Ho.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=i||"centripetal",this.tension=n||.5}function ts(e,t,i,n,r){var a=.5*(n-t),o=.5*(r-i),s=e*e;return(2*i-2*n+a+o)*(e*s)+(-3*i+3*n-2*a-o)*s+a*e+i}function is(e,t,i,n){return function(e,t){var i=1-e;return i*i*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,i)+function(e,t){return e*e*t}(e,n)}function ns(e,t,i,n,r){return function(e,t){var i=1-e;return i*i*i*t}(e,t)+function(e,t){var i=1-e;return 3*i*i*e*t}(e,i)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,r)}function rs(e,t,i,n){Ho.call(this),this.type="CubicBezierCurve",this.v0=e||new Rt,this.v1=t||new Rt,this.v2=i||new Rt,this.v3=n||new Rt}function as(e,t,i,n){Ho.call(this),this.type="CubicBezierCurve3",this.v0=e||new Bt,this.v1=t||new Bt,this.v2=i||new Bt,this.v3=n||new Bt}function os(e,t){Ho.call(this),this.type="LineCurve",this.v1=e||new Rt,this.v2=t||new Rt}function ss(e,t){Ho.call(this),this.type="LineCurve3",this.v1=e||new Bt,this.v2=t||new Bt}function cs(e,t,i){Ho.call(this),this.type="QuadraticBezierCurve",this.v0=e||new Rt,this.v1=t||new Rt,this.v2=i||new Rt}function us(e,t,i){Ho.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Bt,this.v1=t||new Bt,this.v2=i||new Bt}function hs(e){Ho.call(this),this.type="SplineCurve",this.points=e||[]}es.prototype=Object.create(Ho.prototype),es.prototype.constructor=es,es.prototype.isCatmullRomCurve3=!0,es.prototype.getPoint=function(e,t){var i,n,r,a,o=t||new Bt,s=this.points,c=s.length,u=(c-(this.closed?0:1))*e,h=Math.floor(u),l=u-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/c)+1)*c:0===l&&h===c-1&&(h=c-2,l=1),this.closed||h>0?i=s[(h-1)%c]:(qo.subVectors(s[0],s[1]).add(s[0]),i=qo),n=s[h%c],r=s[(h+1)%c],this.closed||h+2<c?a=s[(h+2)%c]:(qo.subVectors(s[c-1],s[c-2]).add(s[c-1]),a=qo),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(i.distanceToSquared(n),d),f=Math.pow(n.distanceToSquared(r),d),g=Math.pow(r.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),g<1e-4&&(g=f),Jo.initNonuniformCatmullRom(i.x,n.x,r.x,a.x,p,f,g),Ko.initNonuniformCatmullRom(i.y,n.y,r.y,a.y,p,f,g),$o.initNonuniformCatmullRom(i.z,n.z,r.z,a.z,p,f,g)}else"catmullrom"===this.curveType&&(Jo.initCatmullRom(i.x,n.x,r.x,a.x,this.tension),Ko.initCatmullRom(i.y,n.y,r.y,a.y,this.tension),$o.initCatmullRom(i.z,n.z,r.z,a.z,this.tension));return o.set(Jo.calc(l),Ko.calc(l),$o.calc(l)),o},es.prototype.copy=function(e){Ho.prototype.copy.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},es.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);e.points=[];for(var t=0,i=this.points.length;t<i;t++){var n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},es.prototype.fromJSON=function(e){Ho.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var n=e.points[t];this.points.push((new Bt).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},rs.prototype=Object.create(Ho.prototype),rs.prototype.constructor=rs,rs.prototype.isCubicBezierCurve=!0,rs.prototype.getPoint=function(e,t){var i=t||new Rt,n=this.v0,r=this.v1,a=this.v2,o=this.v3;return i.set(ns(e,n.x,r.x,a.x,o.x),ns(e,n.y,r.y,a.y,o.y)),i},rs.prototype.copy=function(e){return Ho.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},rs.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},rs.prototype.fromJSON=function(e){return Ho.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},as.prototype=Object.create(Ho.prototype),as.prototype.constructor=as,as.prototype.isCubicBezierCurve3=!0,as.prototype.getPoint=function(e,t){var i=t||new Bt,n=this.v0,r=this.v1,a=this.v2,o=this.v3;return i.set(ns(e,n.x,r.x,a.x,o.x),ns(e,n.y,r.y,a.y,o.y),ns(e,n.z,r.z,a.z,o.z)),i},as.prototype.copy=function(e){return Ho.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},as.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},as.prototype.fromJSON=function(e){return Ho.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},os.prototype=Object.create(Ho.prototype),os.prototype.constructor=os,os.prototype.isLineCurve=!0,os.prototype.getPoint=function(e,t){var i=t||new Rt;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i},os.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},os.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},os.prototype.copy=function(e){return Ho.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},os.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},os.prototype.fromJSON=function(e){return Ho.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},ss.prototype=Object.create(Ho.prototype),ss.prototype.constructor=ss,ss.prototype.isLineCurve3=!0,ss.prototype.getPoint=function(e,t){var i=t||new Bt;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i},ss.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},ss.prototype.copy=function(e){return Ho.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ss.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ss.prototype.fromJSON=function(e){return Ho.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},cs.prototype=Object.create(Ho.prototype),cs.prototype.constructor=cs,cs.prototype.isQuadraticBezierCurve=!0,cs.prototype.getPoint=function(e,t){var i=t||new Rt,n=this.v0,r=this.v1,a=this.v2;return i.set(is(e,n.x,r.x,a.x),is(e,n.y,r.y,a.y)),i},cs.prototype.copy=function(e){return Ho.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},cs.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},cs.prototype.fromJSON=function(e){return Ho.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},us.prototype=Object.create(Ho.prototype),us.prototype.constructor=us,us.prototype.isQuadraticBezierCurve3=!0,us.prototype.getPoint=function(e,t){var i=t||new Bt,n=this.v0,r=this.v1,a=this.v2;return i.set(is(e,n.x,r.x,a.x),is(e,n.y,r.y,a.y),is(e,n.z,r.z,a.z)),i},us.prototype.copy=function(e){return Ho.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},us.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},us.prototype.fromJSON=function(e){return Ho.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},hs.prototype=Object.create(Ho.prototype),hs.prototype.constructor=hs,hs.prototype.isSplineCurve=!0,hs.prototype.getPoint=function(e,t){var i=t||new Rt,n=this.points,r=(n.length-1)*e,a=Math.floor(r),o=r-a,s=n[0===a?a:a-1],c=n[a],u=n[a>n.length-2?n.length-1:a+1],h=n[a>n.length-3?n.length-1:a+2];return i.set(ts(o,s.x,c.x,u.x,h.x),ts(o,s.y,c.y,u.y,h.y)),i},hs.prototype.copy=function(e){Ho.prototype.copy.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var n=e.points[t];this.points.push(n.clone())}return this},hs.prototype.toJSON=function(){var e=Ho.prototype.toJSON.call(this);e.points=[];for(var t=0,i=this.points.length;t<i;t++){var n=this.points[t];e.points.push(n.toArray())}return e},hs.prototype.fromJSON=function(e){Ho.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var n=e.points[t];this.points.push((new Rt).fromArray(n))}return this};var ls=Object.freeze({ArcCurve:Xo,CatmullRomCurve3:es,CubicBezierCurve:rs,CubicBezierCurve3:as,EllipseCurve:Wo,LineCurve:os,LineCurve3:ss,QuadraticBezierCurve:cs,QuadraticBezierCurve3:us,SplineCurve:hs});function ds(){Ho.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function ps(e){ds.call(this),this.type="Path",this.currentPoint=new Rt,e&&this.setFromPoints(e)}function fs(e){ps.call(this,e),this.uuid=zt.generateUUID(),this.type="Shape",this.holes=[]}function gs(e,t){vi.call(this),this.type="Light",this.color=new oi(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function ms(e,t,i){gs.call(this,e,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(vi.DefaultUp),this.updateMatrix(),this.groundColor=new oi(t)}function Ms(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new Rt(512,512),this.map=null,this.matrix=new Ut}function ys(){Ms.call(this,new Vr(50,1,.5,500))}function vs(e,t,i,n,r,a){gs.call(this,e,t),this.type="SpotLight",this.position.copy(vi.DefaultUp),this.updateMatrix(),this.target=new vi,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new ys}function As(e,t,i,n){gs.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new Ms(new Vr(90,1,.5,500))}function ws(){Ms.call(this,new wi(-5,5,5,-5,.5,500))}function xs(e,t){gs.call(this,e,t),this.type="DirectionalLight",this.position.copy(vi.DefaultUp),this.updateMatrix(),this.target=new vi,this.shadow=new ws}function Es(e,t){gs.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Ts(e,t,i,n){gs.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function Ns(e,t,i,n){Rs.call(this,e,t,i,n)}function Ds(e,t,i){Rs.call(this,e,t,i)}function Ls(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i}function bs(e,t,i,n){Ls.call(this,e,t,i,n)}function Is(e,t,i,n){Rs.call(this,e,t,i,n)}function _s(e,t,i,n){Rs.call(this,e,t,i,n)}function Ss(e,t,i,n){Rs.call(this,e,t,i,n)}function js(e,t,i,n){Ls.call(this,e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Cs(e,t,i,n){Ls.call(this,e,t,i,n)}function Os(e,t,i,n){Ls.call(this,e,t,i,n)}ds.prototype=Object.assign(Object.create(Ho.prototype),{constructor:ds,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new os(t,e))},getPoint:function(e){for(var t=e*this.getLength(),i=this.getCurveLengths(),n=0;n<i.length;){if(i[n]>=t){var r=i[n]-t,a=this.curves[n],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}n++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0,n=this.curves.length;i<n;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,i=[],n=0,r=this.curves;n<r.length;n++)for(var a=r[n],o=a&&a.isEllipseCurve?2*e:a&&a.isLineCurve?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var u=s[c];t&&t.equals(u)||(i.push(u),t=u)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},copy:function(e){Ho.prototype.copy.call(this,e),this.curves=[];for(var t=0,i=e.curves.length;t<i;t++){var n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Ho.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,i=this.curves.length;t<i;t++){var n=this.curves[t];e.curves.push(n.toJSON())}return e},fromJSON:function(e){Ho.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,i=e.curves.length;t<i;t++){var n=e.curves[t];this.curves.push((new ls[n.type]).fromJSON(n))}return this}}),ps.prototype=Object.assign(Object.create(ds.prototype),{constructor:ps,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var i=new os(this.currentPoint.clone(),new Rt(e,t));this.curves.push(i),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,i,n){var r=new cs(this.currentPoint.clone(),new Rt(e,t),new Rt(i,n));this.curves.push(r),this.currentPoint.set(i,n)},bezierCurveTo:function(e,t,i,n,r,a){var o=new rs(this.currentPoint.clone(),new Rt(e,t),new Rt(i,n),new Rt(r,a));this.curves.push(o),this.currentPoint.set(r,a)},splineThru:function(e){var t=new hs([this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,i,n,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,i,n,r,a)},absarc:function(e,t,i,n,r,a){this.absellipse(e,t,i,i,n,r,a)},ellipse:function(e,t,i,n,r,a,o,s){var c=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(e+c,t+u,i,n,r,a,o,s)},absellipse:function(e,t,i,n,r,a,o,s){var c=new Wo(e,t,i,n,r,a,o,s);if(this.curves.length>0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var h=c.getPoint(1);this.currentPoint.copy(h)},copy:function(e){return ds.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=ds.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ds.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),fs.prototype=Object.assign(Object.create(ps.prototype),{constructor:fs,getPointsHoles:function(e){for(var t=[],i=0,n=this.holes.length;i<n;i++)t[i]=this.holes[i].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){ps.prototype.copy.call(this,e),this.holes=[];for(var t=0,i=e.holes.length;t<i;t++){var n=e.holes[t];this.holes.push(n.clone())}return this},toJSON:function(){var e=ps.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,i=this.holes.length;t<i;t++){var n=this.holes[t];e.holes.push(n.toJSON())}return e},fromJSON:function(e){ps.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,i=e.holes.length;t<i;t++){var n=e.holes[t];this.holes.push((new ps).fromJSON(n))}return this}}),gs.prototype=Object.assign(Object.create(vi.prototype),{constructor:gs,isLight:!0,copy:function(e){return vi.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=vi.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),ms.prototype=Object.assign(Object.create(gs.prototype),{constructor:ms,isHemisphereLight:!0,copy:function(e){return gs.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Ms.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),ys.prototype=Object.assign(Object.create(Ms.prototype),{constructor:ys,isSpotLightShadow:!0,update:function(e){var t=this.camera,i=2*zt.RAD2DEG*e.angle,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;i===t.fov&&n===t.aspect&&r===t.far||(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix())}}),vs.prototype=Object.assign(Object.create(gs.prototype),{constructor:vs,isSpotLight:!0,copy:function(e){return gs.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),As.prototype=Object.assign(Object.create(gs.prototype),{constructor:As,isPointLight:!0,copy:function(e){return gs.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),ws.prototype=Object.assign(Object.create(Ms.prototype),{constructor:ws}),xs.prototype=Object.assign(Object.create(gs.prototype),{constructor:xs,isDirectionalLight:!0,copy:function(e){return gs.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Es.prototype=Object.assign(Object.create(gs.prototype),{constructor:Es,isAmbientLight:!0}),Ts.prototype=Object.assign(Object.create(gs.prototype),{constructor:Ts,isRectAreaLight:!0,copy:function(e){return gs.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=gs.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Ns.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Ns,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ds.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Ds,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign(Ls.prototype,{evaluate:function(e){var t=this.parameterPositions,i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{var a;i:{n:if(!(e<n)){for(var o=i+2;;){if(void 0===n){if(e<r)break n;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,r)}if(i===o)break;if(r=n,e<(n=t[++i]))break t}a=t.length;break i}if(e>=r)break e;var s=t[1];e<s&&(i=2,r=s);for(o=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(i===o)break;if(n=r,e>=(r=t[--i-1]))break t}a=i,i=0}for(;i<a;){var c=i+a>>>1;e<t[c]?a=c:i=c+1}if(n=t[i],void 0===(r=t[i-1]))return this._cachedIndex=0,this.beforeStart_(0,e,n);if(void 0===n)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,r,e)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,e,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n,a=0;a!==n;++a)t[a]=i[r+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Ls.prototype,{beforeStart_:Ls.prototype.copySampleValue_,afterEnd_:Ls.prototype.copySampleValue_}),bs.prototype=Object.assign(Object.create(Ls.prototype),{constructor:bs,interpolate_:function(e,t,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(i-t)/(n-t),u=s+o;s!==u;s+=4)Pt.slerpFlat(r,0,a,s-o,a,s,c);return r}}),Is.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Is,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new bs(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),_s.prototype=Object.assign(Object.create(Rs.prototype),{constructor:_s,ValueTypeName:"color"}),Ss.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Ss,ValueTypeName:"number"}),js.prototype=Object.assign(Object.create(Ls.prototype),{constructor:js,DefaultSettings_:{endingStart:xt,endingEnd:xt},intervalChanged_:function(e,t,i){var n=this.parameterPositions,r=e-2,a=e+1,o=n[r],s=n[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=e,o=2*t-i;break;case 2402:o=t+n[r=n.length-2]-n[r+1];break;default:r=e,o=i}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*i-t;break;case 2402:a=1,s=i+n[1]-n[0];break;default:a=e-1,s=t}var c=.5*(i-t),u=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-i),this._offsetPrev=r*u,this._offsetNext=a*u},interpolate_:function(e,t,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,u=this._offsetPrev,h=this._offsetNext,l=this._weightPrev,d=this._weightNext,p=(i-t)/(n-t),f=p*p,g=f*p,m=-l*g+2*l*f-l*p,M=(1+l)*g+(-1.5-2*l)*f+(-.5+l)*p+1,y=(-1-d)*g+(1.5+d)*f+.5*p,v=d*g-d*f,A=0;A!==o;++A)r[A]=m*a[u+A]+M*a[c+A]+y*a[s+A]+v*a[h+A];return r}}),Cs.prototype=Object.assign(Object.create(Ls.prototype),{constructor:Cs,interpolate_:function(e,t,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,u=(i-t)/(n-t),h=1-u,l=0;l!==o;++l)r[l]=a[c+l]*h+a[s+l]*u;return r}}),Os.prototype=Object.assign(Object.create(Ls.prototype),{constructor:Os,interpolate_:function(e){return this.copySampleValue_(e-1)}});var zs={arraySlice:function(e,t,i){return zs.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,i=new Array(t),n=0;n!==t;++n)i[n]=n;return i.sort(function(t,i){return e[t]-e[i]}),i},sortedArray:function(e,t,i){for(var n=e.length,r=new e.constructor(n),a=0,o=0;o!==n;++a)for(var s=i[a]*t,c=0;c!==t;++c)r[o++]=e[s+c];return r},flattenJSON:function(e,t,i,n){for(var r=1,a=e[0];void 0!==a&&void 0===a[n];)a=e[r++];if(void 0!==a){var o=a[n];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[n])&&(t.push(a.time),i.push.apply(i,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[n])&&(t.push(a.time),o.toArray(i,i.length)),a=e[r++]}while(void 0!==a);else do{void 0!==(o=a[n])&&(t.push(a.time),i.push(o)),a=e[r++]}while(void 0!==a)}}};function Rs(e,t,i,n){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=zs.convertArray(t,this.TimeBufferType),this.values=zs.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation),this.validate(),this.optimize()}function Us(e,t,i,n){Rs.call(this,e,t,i,n)}function Ps(e,t,i){this.name=e,this.tracks=i,this.duration=void 0!==t?t:-1,this.uuid=zt.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function Bs(e){this.manager=void 0!==e?e:Fo,this.textures={}}function ks(e){this.manager=void 0!==e?e:Fo}Object.assign(Rs,{parse:function(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=Rs._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var i=[],n=[];zs.flattenJSON(e.keys,i,n,"value"),e.times=i,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,i=e.constructor;if(void 0!==i.toJSON)t=i.toJSON(e);else{t={name:e.name,times:zs.convertArray(e.times,Array),values:zs.convertArray(e.values,Array)};var n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ss;case"vector":case"vector2":case"vector3":case"vector4":return Us;case"color":return _s;case"quaternion":return Is;case"bool":case"boolean":return Ds;case"string":return Ns}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}}),Object.assign(Rs.prototype,{constructor:Rs,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new Os(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Cs(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new js(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)this.createInterpolant=t;else{var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",i)}},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,i=0,n=t.length;i!==n;++i)t[i]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,i=0,n=t.length;i!==n;++i)t[i]*=e;return this},trim:function(e,t){for(var i=this.times,n=i.length,r=0,a=n-1;r!==n&&i[r]<e;)++r;for(;-1!==a&&i[a]>t;)--a;if(++a,0!==r||a!==n){r>=a&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=zs.arraySlice(i,r,a),this.values=zs.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==r;o++){var s=i[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==n&&zs.isTypedArray(n)){o=0;for(var c=n.length;o!==c;++o){var u=n[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,i=this.getValueSize(),n=2302===this.getInterpolation(),r=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(n)s=!0;else for(var u=o*i,h=u-i,l=u+i,d=0;d!==i;++d){var p=t[u+d];if(p!==t[h+d]||p!==t[l+d]){s=!0;break}}if(s){if(o!==r){e[r]=e[o];var f=o*i,g=r*i;for(d=0;d!==i;++d)t[g+d]=t[f+d]}++r}}if(a>0){e[r]=e[a];for(f=a*i,g=r*i,d=0;d!==i;++d)t[g+d]=t[f+d];++r}return r!==e.length&&(this.times=zs.arraySlice(e,0,r),this.values=zs.arraySlice(t,0,r*i)),this}}),Us.prototype=Object.assign(Object.create(Rs.prototype),{constructor:Us,ValueTypeName:"vector"}),Object.assign(Ps,{parse:function(e){for(var t=[],i=e.tracks,n=1/(e.fps||1),r=0,a=i.length;r!==a;++r)t.push(Rs.parse(i[r]).scale(n));return new Ps(e.name,e.duration,t)},toJSON:function(e){for(var t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},r=0,a=i.length;r!==a;++r)t.push(Rs.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(e,t,i,n){for(var r=t.length,a=[],o=0;o<r;o++){var s=[],c=[];s.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);var u=zs.getKeyframeOrder(s);s=zs.sortedArray(s,1,u),c=zs.sortedArray(c,1,u),n||0!==s[0]||(s.push(r),c.push(c[0])),a.push(new Ss(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/i))}return new Ps(e,-1,a)},findByName:function(e,t){var i=e;if(!Array.isArray(e)){var n=e;i=n.geometry&&n.geometry.animations||n.animations}for(var r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null},CreateClipsFromMorphTargetSequences:function(e,t,i){for(var n={},r=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(r);if(c&&c.length>1){var u=n[l=c[1]];u||(n[l]=u=[]),u.push(s)}}var h=[];for(var l in n)h.push(Ps.CreateFromMorphTargetSequence(l,n[l],t,i));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var i=function(e,t,i,n,r){if(0!==i.length){var a=[],o=[];zs.flattenJSON(i,a,o,n),0!==a.length&&r.push(new e(t,a,o))}},n=[],r=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var u=s[c].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var h={},l=0;l<u.length;l++)if(u[l].morphTargets)for(var d=0;d<u[l].morphTargets.length;d++)h[u[l].morphTargets[d]]=-1;for(var p in h){var f=[],g=[];for(d=0;d!==u[l].morphTargets.length;++d){var m=u[l];f.push(m.time),g.push(m.morphTarget===p?1:0)}n.push(new Ss(".morphTargetInfluence["+p+"]",f,g))}a=h.length*(o||1)}else{var M=".bones["+t[c].name+"]";i(Us,M+".position",u,"pos",n),i(Is,M+".quaternion",u,"rot",n),i(Us,M+".scale",u,"scl",n)}}return 0===n.length?null:new Ps(r,a,n)}}),Object.assign(Ps.prototype,{resetDuration:function(){for(var e=0,t=0,i=this.tracks.length;t!==i;++t){var n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}this.duration=e},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}}),Object.assign(Bs.prototype,{load:function(e,t,i,n){var r=this;new Qo(r.manager).load(e,function(e){t(r.parse(JSON.parse(e)))},i,n)},setTextures:function(e){this.textures=e},parse:function(e){var t=this.textures;function i(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var n=new Po[e.type];if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&n.specular.setHex(e.specular),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearCoat&&(n.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(n.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(n.uniforms=e.uniforms),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(n.vertexColors=e.vertexColors),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.flatShading&&(n.flatShading=e.flatShading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.side&&(n.side=e.side),void 0!==e.opacity&&(n.opacity=e.opacity),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(n.rotation=e.rotation),1!==e.linewidth&&(n.linewidth=e.linewidth),void 0!==e.dashSize&&(n.dashSize=e.dashSize),void 0!==e.gapSize&&(n.gapSize=e.gapSize),void 0!==e.scale&&(n.scale=e.scale),void 0!==e.polygonOffset&&(n.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(n.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(n.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(n.skinning=e.skinning),void 0!==e.morphTargets&&(n.morphTargets=e.morphTargets),void 0!==e.dithering&&(n.dithering=e.dithering),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.shading&&(n.flatShading=1===e.shading),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=i(e.map)),void 0!==e.alphaMap&&(n.alphaMap=i(e.alphaMap),n.transparent=!0),void 0!==e.bumpMap&&(n.bumpMap=i(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=i(e.normalMap)),void 0!==e.normalScale){var r=e.normalScale;!1===Array.isArray(r)&&(r=[r,r]),n.normalScale=(new Rt).fromArray(r)}return void 0!==e.displacementMap&&(n.displacementMap=i(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=i(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=i(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=i(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=i(e.specularMap)),void 0!==e.envMap&&(n.envMap=i(e.envMap)),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.lightMap&&(n.lightMap=i(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=i(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=i(e.gradientMap)),n}}),Object.assign(ks.prototype,{load:function(e,t,i,n){var r=this;new Qo(r.manager).load(e,function(e){t(r.parse(JSON.parse(e)))},i,n)},parse:function(e){var t=new ki,i=e.data.index;if(void 0!==i){var n=new Vs[i.type](i.array);t.setIndex(new Li(n,1))}var r=e.data.attributes;for(var a in r){var o=r[a];n=new Vs[o.type](o.array);t.addAttribute(a,new Li(n,o.itemSize,o.normalized))}var s=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==s)for(var c=0,u=s.length;c!==u;++c){var h=s[c];t.addGroup(h.start,h.count,h.materialIndex)}var l=e.data.boundingSphere;if(void 0!==l){var d=new Bt;void 0!==l.center&&d.fromArray(l.center),t.boundingSphere=new $t(d,l.radius)}return t}});var Fs,Gs,Qs,Ys,Vs={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Hs(){}Hs.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,i=0,n=t.length;i<n;i+=2){var r=t[i],a=t[i+1];if(r.test(e))return a}return null}},Object.assign(Hs.prototype,{crossOrigin:void 0,onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(e,t,i){for(var n=[],r=0;r<e.length;++r)n[r]=this.createMaterial(e[r],t,i);return n},createMaterial:(Fs={NoBlending:C,NormalBlending:O,AdditiveBlending:z,SubtractiveBlending:R,MultiplyBlending:U,CustomBlending:P},Gs=new oi,Qs=new Vo,Ys=new Bs,function(e,t,i){var n={};function r(e,r,a,o,s){var c,u=t+e,h=Hs.Handlers.get(u);null!==h?c=h.load(u):(Qs.setCrossOrigin(i),c=Qs.load(u)),void 0!==r&&(c.repeat.fromArray(r),1!==r[0]&&(c.wrapS=Te),1!==r[1]&&(c.wrapT=Te)),void 0!==a&&c.offset.fromArray(a),void 0!==o&&("repeat"===o[0]&&(c.wrapS=Te),"mirror"===o[0]&&(c.wrapS=De),"repeat"===o[1]&&(c.wrapT=Te),"mirror"===o[1]&&(c.wrapT=De)),void 0!==s&&(c.anisotropy=s);var l=zt.generateUUID();return n[l]=c,l}var a={uuid:zt.generateUUID(),type:"MeshLambertMaterial"};for(var o in e){var s=e[o];switch(o){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":a.name=s;break;case"blending":a.blending=Fs[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",o,"is no longer supported.");break;case"colorDiffuse":a.color=Gs.fromArray(s).getHex();break;case"colorSpecular":a.specular=Gs.fromArray(s).getHex();break;case"colorEmissive":a.emissive=Gs.fromArray(s).getHex();break;case"specularCoef":a.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(a.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(a.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(a.type="MeshStandardMaterial");break;case"mapDiffuse":a.map=r(s,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":a.emissiveMap=r(s,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":a.lightMap=r(s,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":a.aoMap=r(s,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":a.bumpMap=r(s,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":a.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":a.normalMap=r(s,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":a.normalScale=s;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":a.specularMap=r(s,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":a.metalnessMap=r(s,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":a.roughnessMap=r(s,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":a.alphaMap=r(s,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":a.side=b;break;case"doubleSided":a.side=I;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),a.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":a[o]=s;break;case"vertexColors":!0===s&&(a.vertexColors=j),"face"===s&&(a.vertexColors=S);break;default:console.error("THREE.Loader.createMaterial: Unsupported",o,s)}}return"MeshBasicMaterial"===a.type&&delete a.emissive,"MeshPhongMaterial"!==a.type&&delete a.specular,a.opacity<1&&(a.transparent=!0),Ys.setTextures(n),Ys.parse(a)})});var Ws=function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)};function Xs(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:Fo,this.withCredentials=!1}Object.assign(Xs.prototype,{load:function(e,t,i,n){var r=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:Ws(e),o=new Qo(this.manager);o.setWithCredentials(this.withCredentials),o.load(e,function(i){var n=JSON.parse(i),o=n.metadata;if(void 0!==o){var s=o.type;if(void 0!==s&&"object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.")}var c=r.parse(n,a);t(c.geometry,c.materials)},i,n)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){void 0!==e.data&&(e=e.data),void 0!==e.scale?e.scale=1/e.scale:e.scale=1;var i=new Di;return function(e,t){function i(e,t){return e&1<<t}var n,r,a,o,s,c,u,h,l,d,p,f,g,m,M,y,v,A,w,x,E,T,N,D,L,b=e.faces,I=e.vertices,_=e.normals,S=e.colors,j=e.scale,C=0;if(void 0!==e.uvs){for(n=0;n<e.uvs.length;n++)e.uvs[n].length&&C++;for(n=0;n<C;n++)t.faceVertexUvs[n]=[]}for(o=0,s=I.length;o<s;)(A=new Bt).x=I[o++]*j,A.y=I[o++]*j,A.z=I[o++]*j,t.vertices.push(A);for(o=0,s=b.length;o<s;)if(p=i(d=b[o++],0),f=i(d,1),g=i(d,3),m=i(d,4),M=i(d,5),y=i(d,6),v=i(d,7),p){if((x=new xi).a=b[o],x.b=b[o+1],x.c=b[o+3],(E=new xi).a=b[o+1],E.b=b[o+2],E.c=b[o+3],o+=4,f&&(l=b[o++],x.materialIndex=l,E.materialIndex=l),a=t.faces.length,g)for(n=0;n<C;n++)for(D=e.uvs[n],t.faceVertexUvs[n][a]=[],t.faceVertexUvs[n][a+1]=[],r=0;r<4;r++)L=new Rt(D[2*(h=b[o++])],D[2*h+1]),2!==r&&t.faceVertexUvs[n][a].push(L),0!==r&&t.faceVertexUvs[n][a+1].push(L);if(m&&(u=3*b[o++],x.normal.set(_[u++],_[u++],_[u]),E.normal.copy(x.normal)),M)for(n=0;n<4;n++)u=3*b[o++],N=new Bt(_[u++],_[u++],_[u]),2!==n&&x.vertexNormals.push(N),0!==n&&E.vertexNormals.push(N);if(y&&(T=S[c=b[o++]],x.color.setHex(T),E.color.setHex(T)),v)for(n=0;n<4;n++)T=S[c=b[o++]],2!==n&&x.vertexColors.push(new oi(T)),0!==n&&E.vertexColors.push(new oi(T));t.faces.push(x),t.faces.push(E)}else{if((w=new xi).a=b[o++],w.b=b[o++],w.c=b[o++],f&&(l=b[o++],w.materialIndex=l),a=t.faces.length,g)for(n=0;n<C;n++)for(D=e.uvs[n],t.faceVertexUvs[n][a]=[],r=0;r<3;r++)L=new Rt(D[2*(h=b[o++])],D[2*h+1]),t.faceVertexUvs[n][a].push(L);if(m&&(u=3*b[o++],w.normal.set(_[u++],_[u++],_[u])),M)for(n=0;n<3;n++)u=3*b[o++],N=new Bt(_[u++],_[u++],_[u]),w.vertexNormals.push(N);if(y&&(c=b[o++],w.color.setHex(S[c])),v)for(n=0;n<3;n++)c=b[o++],w.vertexColors.push(new oi(S[c]));t.faces.push(w)}}(e,i),function(e,t){var i=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var n=0,r=e.skinWeights.length;n<r;n+=i){var a=e.skinWeights[n],o=i>1?e.skinWeights[n+1]:0,s=i>2?e.skinWeights[n+2]:0,c=i>3?e.skinWeights[n+3]:0;t.skinWeights.push(new Xt(a,o,s,c))}if(e.skinIndices)for(n=0,r=e.skinIndices.length;n<r;n+=i){var u=e.skinIndices[n],h=i>1?e.skinIndices[n+1]:0,l=i>2?e.skinIndices[n+2]:0,d=i>3?e.skinIndices[n+3]:0;t.skinIndices.push(new Xt(u,h,l,d))}t.bones=e.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}(e,i),function(e,t){var i=e.scale;if(void 0!==e.morphTargets)for(var n=0,r=e.morphTargets.length;n<r;n++){t.morphTargets[n]={},t.morphTargets[n].name=e.morphTargets[n].name,t.morphTargets[n].vertices=[];for(var a=t.morphTargets[n].vertices,o=e.morphTargets[n].vertices,s=0,c=o.length;s<c;s+=3){var u=new Bt;u.x=o[s]*i,u.y=o[s+1]*i,u.z=o[s+2]*i,a.push(u)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var h=t.faces,l=e.morphColors[0].colors;for(n=0,r=h.length;n<r;n++)h[n].color.fromArray(l,3*n)}}(e,i),function(e,t){var i=[],n=[];void 0!==e.animation&&n.push(e.animation),void 0!==e.animations&&(e.animations.length?n=n.concat(e.animations):n.push(e.animations));for(var r=0;r<n.length;r++){var a=Ps.parseAnimation(n[r],t.bones);a&&i.push(a)}if(t.morphTargets){var o=Ps.CreateClipsFromMorphTargetSequences(t.morphTargets,10);i=i.concat(o)}i.length>0&&(t.animations=i)}(e,i),i.computeFaceNormals(),i.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:i}:{geometry:i,materials:Hs.prototype.initMaterials(e.materials,t,this.crossOrigin)}}}),Object.assign(function(e){this.manager=void 0!==e?e:Fo,this.texturePath=""}.prototype,{load:function(e,t,i,n){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var r=this;new Qo(r.manager).load(e,function(i){var a=null;try{a=JSON.parse(i)}catch(t){return void 0!==n&&n(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead.")},i,n)},setTexturePath:function(e){return this.texturePath=e,this},setCrossOrigin:function(e){return this.crossOrigin=e,this},parse:function(e,t){var i=this.parseShape(e.shapes),n=this.parseGeometries(e.geometries,i),r=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,n,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var i=0,n=e.length;i<n;i++){var r=(new fs).fromJSON(e[i]);t[r.uuid]=r}return t},parseGeometries:function(e,t){var i={};if(void 0!==e)for(var n=new Xs,r=new ks,a=0,o=e.length;a<o;a++){var s,c=e[a];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new bo[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new bo[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new bo[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new bo[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new bo[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new bo[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new bo[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new bo[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new bo[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new bo[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new bo[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new bo[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var u=[],h=0,l=c.shapes.length;h<l;h++){var d=t[c.shapes[h]];u.push(d)}s=new bo[c.type](u,c.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(u=[],h=0,l=c.shapes.length;h<l;h++){d=t[c.shapes[h]];u.push(d)}var p=c.options.extrudePath;void 0!==p&&(c.options.extrudePath=(new ls[p.type]).fromJSON(p)),s=new bo[c.type](u,c.options);break;case"BufferGeometry":s=r.parse(c);break;case"Geometry":s=n.parse(c,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),!0===s.isBufferGeometry&&void 0!==c.userData&&(s.userData=c.userData),i[c.uuid]=s}return i},parseMaterials:function(e,t){var i={};if(void 0!==e){var n=new Bs;n.setTextures(t);for(var r=0,a=e.length;r<a;r++){var o=e[r];if("MultiMaterial"===o.type){for(var s=[],c=0;c<o.materials.length;c++)s.push(n.parse(o.materials[c]));i[o.uuid]=s}else i[o.uuid]=n.parse(o)}}return i},parseAnimations:function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i],r=Ps.parse(n);void 0!==n.uuid&&(r.uuid=n.uuid),t.push(r)}return t},parseImages:function(e,t){var i=this,n={};function r(e){return i.manager.itemStart(e),a.load(e,function(){i.manager.itemEnd(e)},void 0,function(){i.manager.itemEnd(e),i.manager.itemError(e)})}if(void 0!==e&&e.length>0){var a=new Yo(new ko(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:i.texturePath+c.url;n[c.uuid]=r(u)}}return n},parseTextures:function(e,t){function i(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var n={};if(void 0!==e)for(var r=0,a=e.length;r<a;r++){var o=e[r];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===t[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=new Wt(t[o.image]);s.needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=i(o.mapping,qs)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=i(o.wrap[0],Js),s.wrapT=i(o.wrap[1],Js)),void 0!==o.format&&(s.format=o.format),void 0!==o.minFilter&&(s.minFilter=i(o.minFilter,Ks)),void 0!==o.magFilter&&(s.magFilter=i(o.magFilter,Ks)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),n[o.uuid]=s}return n},parseObject:function(e,t,i){var n;function r(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],n=0,r=e.length;n<r;n++){var a=e[n];void 0===i[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(i[a])}return t}return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),i[e]}}switch(e.type){case"Scene":n=new Kr,void 0!==e.background&&Number.isInteger(e.background)&&(n.background=new oi(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?n.fog=new Jr(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(n.fog=new qr(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":n=new Vr(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(n.focus=e.focus),void 0!==e.zoom&&(n.zoom=e.zoom),void 0!==e.filmGauge&&(n.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(n.filmOffset=e.filmOffset),void 0!==e.view&&(n.view=Object.assign({},e.view));break;case"OrthographicCamera":n=new wi(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(n.zoom=e.zoom),void 0!==e.view&&(n.view=Object.assign({},e.view));break;case"AmbientLight":n=new Es(e.color,e.intensity);break;case"DirectionalLight":n=new xs(e.color,e.intensity);break;case"PointLight":n=new As(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":n=new Ts(e.color,e.intensity,e.width,e.height);break;case"SpotLight":n=new vs(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":n=new ms(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(e.geometry),s=a(e.material);n=o.bones&&o.bones.length>0?new ra(o,s):new on(o,s);break;case"LOD":n=new ta;break;case"Line":n=new oa(r(e.geometry),a(e.material),e.mode);break;case"LineLoop":n=new ca(r(e.geometry),a(e.material));break;case"LineSegments":n=new sa(r(e.geometry),a(e.material));break;case"PointCloud":case"Points":n=new ha(r(e.geometry),a(e.material));break;case"Sprite":n=new ea(a(e.material));break;case"Group":n=new la;break;default:n=new vi}if(n.uuid=e.uuid,void 0!==e.name&&(n.name=e.name),void 0!==e.matrix?(n.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(n.matrixAutoUpdate=e.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==e.position&&n.position.fromArray(e.position),void 0!==e.rotation&&n.rotation.fromArray(e.rotation),void 0!==e.quaternion&&n.quaternion.fromArray(e.quaternion),void 0!==e.scale&&n.scale.fromArray(e.scale)),void 0!==e.castShadow&&(n.castShadow=e.castShadow),void 0!==e.receiveShadow&&(n.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(n.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(n.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&n.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(n.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.frustumCulled&&(n.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(n.renderOrder=e.renderOrder),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.children)for(var c=e.children,u=0;u<c.length;u++)n.add(this.parseObject(c[u],t,i));if("LOD"===e.type)for(var h=e.levels,l=0;l<h.length;l++){var d=h[l],p=n.getObjectByProperty("uuid",d.object);void 0!==p&&n.addLevel(p,d.distance)}return n}});var Zs,qs={UVMapping:300,CubeReflectionMapping:Me,CubeRefractionMapping:ye,EquirectangularReflectionMapping:ve,EquirectangularRefractionMapping:Ae,SphericalReflectionMapping:we,CubeUVReflectionMapping:xe,CubeUVRefractionMapping:Ee},Js={RepeatWrapping:Te,ClampToEdgeWrapping:Ne,MirroredRepeatWrapping:De},Ks={NearestFilter:Le,NearestMipMapNearestFilter:be,NearestMipMapLinearFilter:Ie,LinearFilter:_e,LinearMipMapNearestFilter:Se,LinearMipMapLinearFilter:je};function $s(){this.type="ShapePath",this.color=new oi,this.subPaths=[],this.currentPath=null}function ec(e){this.type="Font",this.data=e}function tc(e,t,i,n,r,a){var o=a.glyphs[e]||a.glyphs["?"];if(o){var s,c,u,h,l,d,p,f,g=new $s;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),M=0,y=m.length;M<y;){switch(m[M++]){case"m":s=m[M++]*i+n,c=m[M++]*i+r,g.moveTo(s,c);break;case"l":s=m[M++]*i+n,c=m[M++]*i+r,g.lineTo(s,c);break;case"q":u=m[M++]*i+n,h=m[M++]*i+r,l=m[M++]*i+n,d=m[M++]*i+r,g.quadraticCurveTo(l,d,u,h);break;case"b":u=m[M++]*i+n,h=m[M++]*i+r,l=m[M++]*i+n,d=m[M++]*i+r,p=m[M++]*i+n,f=m[M++]*i+r,g.bezierCurveTo(l,d,p,f,u,h)}}return{offsetX:o.ha*i,path:g}}}Object.assign($s.prototype,{moveTo:function(e,t){this.currentPath=new ps,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,i,n){this.currentPath.quadraticCurveTo(e,t,i,n)},bezierCurveTo:function(e,t,i,n,r,a){this.currentPath.bezierCurveTo(e,t,i,n,r,a)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function i(e){for(var t=[],i=0,n=e.length;i<n;i++){var r=e[i],a=new fs;a.curves=r.curves,t.push(a)}return t}function n(e,t){for(var i=t.length,n=!1,r=i-1,a=0;a<i;r=a++){var o=t[r],s=t[a],c=s.x-o.x,u=s.y-o.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(o=t[a],c=-c,s=t[r],u=-u),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=u*(e.x-o.x)-c*(e.y-o.y);if(0===h)return!0;if(h<0)continue;n=!n}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return n}var r=io.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return i(a);var o,s,c,u=[];if(1===a.length)return s=a[0],(c=new fs).curves=s.curves,u.push(c),u;var h=!r(a[0].getPoints());h=e?!h:h;var l,d,p=[],f=[],g=[],m=0;f[m]=void 0,g[m]=[];for(var M=0,y=a.length;M<y;M++)o=r(l=(s=a[M]).getPoints()),(o=e?!o:o)?(!h&&f[m]&&m++,f[m]={s:new fs,p:l},f[m].s.curves=s.curves,h&&m++,g[m]=[]):g[m].push({h:s,p:l[0]});if(!f[0])return i(a);if(f.length>1){for(var v=!1,A=[],w=0,x=f.length;w<x;w++)p[w]=[];for(w=0,x=f.length;w<x;w++)for(var E=g[w],T=0;T<E.length;T++){for(var N=E[T],D=!0,L=0;L<f.length;L++)n(N.p,f[L].p)&&(w!==L&&A.push({froms:w,tos:L,hole:T}),D?(D=!1,p[L].push(N)):v=!0);D&&p[w].push(N)}A.length>0&&(v||(g=p))}M=0;for(var b=f.length;M<b;M++){c=f[M].s,u.push(c);for(var I=0,_=(d=g[M]).length;I<_;I++)c.holes.push(d[I].h)}return u}}),Object.assign(ec.prototype,{isFont:!0,generateShapes:function(e,t,i){void 0===t&&(t=100),void 0===i&&(i=4);for(var n=[],r=function(e,t,i,n){for(var r=Array.from?Array.from(e):String(e).split(""),a=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*a,s=[],c=0,u=0,h=0;h<r.length;h++){var l=r[h];if("\n"===l)c=0,u-=o;else{var d=tc(l,i,a,c,u,n);c+=d.offsetX,s.push(d.path)}}return s}(e,t,i,this.data),a=0,o=r.length;a<o;a++)Array.prototype.push.apply(n,r[a].toShapes());return n}}),Object.assign(function(e){this.manager=void 0!==e?e:Fo}.prototype,{load:function(e,t,i,n){var r=this,a=new Qo(this.manager);a.setPath(this.path),a.load(e,function(e){var i;try{i=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(e.substring(65,e.length-2))}var n=r.parse(i);t&&t(n)},i,n)},parse:function(e){return new ec(e)},setPath:function(e){return this.path=e,this}});var ic,nc,rc,ac,oc,sc,cc,uc,hc,lc,dc={getContext:function(){return void 0===Zs&&(Zs=new(window.AudioContext||window.webkitAudioContext)),Zs},setContext:function(e){Zs=e}};function pc(e){this.manager=void 0!==e?e:Fo}function fc(e,t,i){vi.call(this),this.type="CubeCamera";var n=new Vr(90,1,e,t);n.up.set(0,-1,0),n.lookAt(new Bt(1,0,0)),this.add(n);var r=new Vr(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new Bt(-1,0,0)),this.add(r);var a=new Vr(90,1,e,t);a.up.set(0,0,1),a.lookAt(new Bt(0,1,0)),this.add(a);var o=new Vr(90,1,e,t);o.up.set(0,0,-1),o.lookAt(new Bt(0,-1,0)),this.add(o);var s=new Vr(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new Bt(0,0,1)),this.add(s);var c=new Vr(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new Bt(0,0,-1)),this.add(c);var u={format:He,magFilter:_e,minFilter:_e};this.renderTarget=new qt(i,i,u),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,n,i),i.activeCubeFace=1,e.render(t,r,i),i.activeCubeFace=2,e.render(t,a,i),i.activeCubeFace=3,e.render(t,o,i),i.activeCubeFace=4,e.render(t,s,i),i.texture.generateMipmaps=u,i.activeCubeFace=5,e.render(t,c,i),e.setRenderTarget(null)},this.clear=function(e,t,i,n){for(var r=this.renderTarget,a=0;a<6;a++)r.activeCubeFace=a,e.setRenderTarget(r),e.clear(t,i,n);e.setRenderTarget(null)}}function gc(){vi.call(this),this.type="AudioListener",this.context=dc.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function mc(e){vi.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Mc(e){mc.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function yc(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function vc(e,t,i){this.binding=e,this.valueSize=i;var n,r=Float64Array;switch(t){case"quaternion":n=this._slerp;break;case"string":case"bool":r=Array,n=this._select;break;default:n=this._lerp}this.buffer=new r(4*i),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(pc.prototype,{load:function(e,t,i,n){var r=new Qo(this.manager);r.setResponseType("arraybuffer"),r.load(e,function(e){dc.getContext().decodeAudioData(e,function(e){t(e)})},i,n)}}),Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Vr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Vr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}.prototype,{update:(hc=new Ut,lc=new Ut,function(e){if(ic!==this||nc!==e.focus||rc!==e.fov||ac!==e.aspect*this.aspect||oc!==e.near||sc!==e.far||cc!==e.zoom||uc!==this.eyeSep){ic=this,nc=e.focus,rc=e.fov,ac=e.aspect*this.aspect,oc=e.near,sc=e.far,cc=e.zoom;var t,i,n=e.projectionMatrix.clone(),r=(uc=this.eyeSep/2)*oc/nc,a=oc*Math.tan(zt.DEG2RAD*rc*.5)/cc;lc.elements[12]=-uc,hc.elements[12]=uc,t=-a*ac+r,i=a*ac+r,n.elements[0]=2*oc/(i-t),n.elements[8]=(i+t)/(i-t),this.cameraL.projectionMatrix.copy(n),t=-a*ac-r,i=a*ac-r,n.elements[0]=2*oc/(i-t),n.elements[8]=(i+t)/(i-t),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(lc),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(hc)})}),fc.prototype=Object.create(vi.prototype),fc.prototype.constructor=fc,gc.prototype=Object.assign(Object.create(vi.prototype),{constructor:gc,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01)},updateMatrixWorld:function(){var e=new Bt,t=new Pt,i=new Bt,n=new Bt;return function(r){vi.prototype.updateMatrixWorld.call(this,r);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(e,t,i),n.set(0,0,-1).applyQuaternion(t),a.positionX?(a.positionX.setValueAtTime(e.x,this.context.currentTime),a.positionY.setValueAtTime(e.y,this.context.currentTime),a.positionZ.setValueAtTime(e.z,this.context.currentTime),a.forwardX.setValueAtTime(n.x,this.context.currentTime),a.forwardY.setValueAtTime(n.y,this.context.currentTime),a.forwardZ.setValueAtTime(n.z,this.context.currentTime),a.upX.setValueAtTime(o.x,this.context.currentTime),a.upY.setValueAtTime(o.y,this.context.currentTime),a.upZ.setValueAtTime(o.z,this.context.currentTime)):(a.setPosition(e.x,e.y,e.z),a.setOrientation(n.x,n.y,n.z,o.x,o.y,o.z))}}()}),mc.prototype=Object.assign(Object.create(vi.prototype),{constructor:mc,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}),Mc.prototype=Object.assign(Object.create(mc.prototype),{constructor:Mc,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new Bt;return function(t){vi.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),Object.assign(yc.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),i=0;i<t.length;i++)e+=t[i];return e/t.length}}),Object.assign(vc.prototype,{accumulate:function(e,t){var i=this.buffer,n=this.valueSize,r=e*n+n,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==n;++o)i[r+o]=i[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(i,r,0,s,n)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,i=this.buffer,n=e*t+t,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*t;this._mixBufferRegion(i,n,o,1-r,t)}for(var s=t,c=t+t;s!==c;++s)if(i[s]!==i[s+t]){a.setValue(i,n);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,i=this.valueSize,n=3*i;e.getValue(t,n);for(var r=i,a=n;r!==a;++r)t[r]=t[n+r%i];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,i,n,r){if(n>=.5)for(var a=0;a!==r;++a)e[t+a]=e[i+a]},_slerp:function(e,t,i,n){Pt.slerpFlat(e,t,e,t,e,i,n)},_lerp:function(e,t,i,n,r){for(var a=1-n,o=0;o!==r;++o){var s=t+o;e[s]=e[s]*a+e[i+o]*n}}});var Ac,wc,xc,Ec,Tc,Nc,Dc,Lc,bc,Ic,_c,Sc,jc;function Cc(e,t,i){var n=i||Oc.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}function Oc(e,t,i){this.path=t,this.parsedPath=i||Oc.parseTrackName(t),this.node=Oc.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function zc(e,t,i){this._mixer=e,this._clip=t,this._localRoot=i||null;for(var n=t.tracks,r=n.length,a=new Array(r),o={endingStart:xt,endingEnd:xt},s=0;s!==r;++s){var c=n[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=wt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Rc(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Uc(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Pc(){ki.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Bc(e,t,i,n){this.data=e,this.itemSize=t,this.offset=i,this.normalized=!0===n}function kc(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Fc(e,t,i){kc.call(this,e,t),this.meshPerAttribute=i||1}function Gc(e,t,i){Li.call(this,e,t),this.meshPerAttribute=i||1}function Qc(e,t){return e.distance-t.distance}function Yc(e,t,i,n){if(!1!==e.visible&&(e.raycast(t,i),!0===n))for(var r=e.children,a=0,o=r.length;a<o;a++)Yc(r[a],t,i,!0)}function Vc(e,t,i){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==i?i:0,this}function Hc(e,t){this.min=void 0!==e?e:new Rt(1/0,1/0),this.max=void 0!==t?t:new Rt(-1/0,-1/0)}function Wc(e){vi.call(this),this.material=e,this.render=function(){}}function Xc(e,t,i,n){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==i?i:16711680,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new ki,u=new zi(2*o*3,3);c.addAttribute("position",u),sa.call(this,c,new aa({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Zc(e,t){vi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var i=new ki,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;n.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}i.addAttribute("position",new zi(n,3));var c=new aa({fog:!1});this.cone=new sa(i,c),this.add(this.cone),this.update()}function qc(e){for(var t=function e(t){var i=[];t&&t.isBone&&i.push(t);for(var n=0;n<t.children.length;n++)i.push.apply(i,e(t.children[n]));return i}(e),i=new ki,n=[],r=[],a=new oi(0,0,1),o=new oi(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}i.addAttribute("position",new zi(n,3)),i.addAttribute("color",new zi(r,3));var u=new aa({vertexColors:j,depthTest:!1,depthWrite:!1,transparent:!0});sa.call(this,i,u),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function Jc(e,t,i){this.light=e,this.light.updateMatrixWorld(),this.color=i;var n=new po(t,4,2),r=new en({wireframe:!0,fog:!1});on.call(this,n,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Kc(e,t){vi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var i=new aa({fog:!1}),n=new ki;n.addAttribute("position",new Li(new Float32Array(15),3)),this.line=new oa(n,i),this.add(this.line),this.update()}function $c(e,t,i){vi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;var n=new Ea(t);n.rotateY(.5*Math.PI),this.material=new en({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=j);var r=n.getAttribute("position"),a=new Float32Array(3*r.count);n.addAttribute("color",new Li(a,3)),this.add(new on(n,this.material)),this.update()}function eu(e,t,i,n){e=e||10,t=t||10,i=new oi(void 0!==i?i:4473924),n=new oi(void 0!==n?n:8947848);for(var r=t/2,a=e/t,o=e/2,s=[],c=[],u=0,h=0,l=-o;u<=t;u++,l+=a){s.push(-o,0,l,o,0,l),s.push(l,0,-o,l,0,o);var d=u===r?i:n;d.toArray(c,h),h+=3,d.toArray(c,h),h+=3,d.toArray(c,h),h+=3,d.toArray(c,h),h+=3}var p=new ki;p.addAttribute("position",new zi(s,3)),p.addAttribute("color",new zi(c,3));var f=new aa({vertexColors:j});sa.call(this,p,f)}function tu(e,t,i,n,r,a){e=e||10,t=t||16,i=i||8,n=n||64,r=new oi(void 0!==r?r:4473924),a=new oi(void 0!==a?a:8947848);var o,s,c,u,h,l,d,p=[],f=[];for(u=0;u<=t;u++)c=u/t*(2*Math.PI),o=Math.sin(c)*e,s=Math.cos(c)*e,p.push(0,0,0),p.push(o,0,s),d=1&u?r:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(u=0;u<=i;u++)for(d=1&u?r:a,l=e-e/i*u,h=0;h<n;h++)c=h/n*(2*Math.PI),o=Math.sin(c)*l,s=Math.cos(c)*l,p.push(o,0,s),f.push(d.r,d.g,d.b),c=(h+1)/n*(2*Math.PI),o=Math.sin(c)*l,s=Math.cos(c)*l,p.push(o,0,s),f.push(d.r,d.g,d.b);var g=new ki;g.addAttribute("position",new zi(p,3)),g.addAttribute("color",new zi(f,3));var m=new aa({vertexColors:j});sa.call(this,g,m)}function iu(e,t,i,n){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==i?i:16776960,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new ki,u=new zi(2*o*3,3);c.addAttribute("position",u),sa.call(this,c,new aa({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function nu(e,t,i){vi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===t&&(t=1);var n=new ki;n.addAttribute("position",new zi([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var r=new aa({fog:!1});this.lightPlane=new oa(n,r),this.add(this.lightPlane),(n=new ki).addAttribute("position",new zi([0,0,0,0,0,1],3)),this.targetLine=new oa(n,r),this.add(this.targetLine),this.update()}function ru(e){var t=new ki,i=new aa({color:16777215,vertexColors:S}),n=[],r=[],a={},o=new oi(16755200),s=new oi(16711680),c=new oi(43775),u=new oi(16777215),h=new oi(3355443);function l(e,t,i){d(e,i),d(t,i)}function d(e,t){n.push(0,0,0),r.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(n.length/3-1)}l("n1","n2",o),l("n2","n4",o),l("n4","n3",o),l("n3","n1",o),l("f1","f2",o),l("f2","f4",o),l("f4","f3",o),l("f3","f1",o),l("n1","f1",o),l("n2","f2",o),l("n3","f3",o),l("n4","f4",o),l("p","n1",s),l("p","n2",s),l("p","n3",s),l("p","n4",s),l("u1","u2",c),l("u2","u3",c),l("u3","u1",c),l("c","t",u),l("p","c",h),l("cn1","cn2",h),l("cn3","cn4",h),l("cf1","cf2",h),l("cf3","cf4",h),t.addAttribute("position",new zi(n,3)),t.addAttribute("color",new zi(r,3)),sa.call(this,t,i),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function au(e,t){this.object=e,void 0===t&&(t=16776960);var i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new ki;r.setIndex(new Li(i,1)),r.addAttribute("position",new Li(n,3)),sa.call(this,r,new aa({color:t})),this.matrixAutoUpdate=!1,this.update()}function ou(e,t){this.type="Box3Helper",this.box=e;var i=void 0!==t?t:16776960,n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new ki;r.setIndex(new Li(n,1)),r.addAttribute("position",new zi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),sa.call(this,r,new aa({color:i})),this.geometry.computeBoundingSphere()}function su(e,t,i){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var n=void 0!==i?i:16776960,r=new ki;r.addAttribute("position",new zi([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),oa.call(this,r,new aa({color:n}));var a=new ki;a.addAttribute("position",new zi([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new on(a,new en({color:n,opacity:.2,transparent:!0,depthWrite:!1})))}function cu(e,t,i,n,r,a){vi.call(this),void 0===n&&(n=16776960),void 0===i&&(i=1),void 0===r&&(r=.2*i),void 0===a&&(a=.2*r),void 0===Ic&&((Ic=new ki).addAttribute("position",new zi([0,0,0,0,1,0],3)),(_c=new Eo(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new oa(Ic,new aa({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new on(_c,new en({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,r,a)}function uu(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=new ki;i.addAttribute("position",new zi(t,3)),i.addAttribute("color",new zi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var n=new aa({vertexColors:j});sa.call(this,i,n)}function hu(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),es.call(this,e),this.type="catmullrom"}Object.assign(Cc.prototype,{getValue:function(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(e,t)},setValue:function(e,t){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}),Object.assign(Oc,{Composite:Cc,create:function(e,t,i){return e&&e.isAnimationObjectGroup?new Oc.Composite(e,t,i):new Oc(e,t,i)},sanitizeNodeName:(bc=new RegExp("[\\[\\]\\.:\\/]","g"),function(e){return e.replace(/\s/g,"_").replace(bc,"")}),parseTrackName:(Ac="[^\\[\\]\\.:\\/]",wc="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",xc=/((?:WC+[\/:])*)/.source.replace("WC",Ac),Ec=/(WCOD+)?/.source.replace("WCOD",wc),Tc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ac),Nc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ac),Dc=new RegExp("^"+xc+Ec+Tc+Nc+"$"),Lc=["material","materials","bones"],function(e){var t=Dc.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var r=i.nodeName.substring(n+1);-1!==Lc.indexOf(r)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=r)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){var n=function(e){for(var i=0;i<e.length;i++){var r=e[i];if(r.name===t||r.uuid===t)return r;var a=n(r.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}}),Object.assign(Oc.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)e[t++]=i[n]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=e[t++]},function(e,t){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,i=t.objectName,n=t.propertyName,r=t.propertyIndex;if(e||(e=Oc.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(i){var a=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[i]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[n];if(void 0!==s){var c=this.Versioning.None;void 0!==e.needsUpdate?(c=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var u=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===r){r=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===r){r=o;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+n+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Oc.prototype,{_getValue_unbound:Oc.prototype.getValue,_setValue_unbound:Oc.prototype.setValue}),Object.assign(function(){this.uuid=zt.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,u=0,h=arguments.length;u!==h;++u){var l=arguments[u],d=l.uuid,p=n[d];if(void 0===p){p=t++,n[d]=p,e.push(l);for(var f=0,g=s;f!==g;++f)o[f].push(new Oc(l,r[f],a[f]))}else if(p<i){c=e[p];var m=--i,M=e[m];n[M.uuid]=p,e[p]=M,n[d]=m,e[m]=l;for(f=0,g=s;f!==g;++f){var y=o[f],v=y[m],A=y[p];y[p]=v,void 0===A&&(A=new Oc(l,r[f],a[f])),y[m]=A}}else e[p]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=i},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,i=this._indicesByUUID,n=this._bindings,r=n.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,u=i[c];if(void 0!==u&&u>=t){var h=t++,l=e[h];i[l.uuid]=u,e[u]=l,i[c]=h,e[h]=s;for(var d=0,p=r;d!==p;++d){var f=n[d],g=f[h],m=f[u];f[u]=g,f[h]=m}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],u=c.uuid,h=n[u];if(void 0!==h)if(delete n[u],h<i){var l=--i,d=e[l],p=e[y=--t];n[d.uuid]=h,e[h]=d,n[p.uuid]=l,e[l]=p,e.pop();for(var f=0,g=a;f!==g;++f){var m=(v=r[f])[l],M=v[y];v[h]=m,v[l]=M,v.pop()}}else{var y;n[(p=e[y=--t]).uuid]=h,e[h]=p,e.pop();for(f=0,g=a;f!==g;++f){var v;(v=r[f])[h]=v[y],v.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var i=this._bindingsIndicesByPath,n=i[e],r=this._bindings;if(void 0!==n)return r[n];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,h=new Array(c);n=r.length,i[e]=n,a.push(e),o.push(t),r.push(h);for(var l=u,d=s.length;l!==d;++l){var p=s[l];h[l]=new Oc(p,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){var n=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=i,a[i]=s,a.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}}),Object.assign(zc.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){var n=this._clip.duration,r=e._clip.duration,a=r/n,o=n/r;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,i){return e.crossFadeFrom(this,t,i)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,i){var n=this._mixer,r=n.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=r,s[1]=r+i,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,i,n){if(this.enabled){var r=this._startTime;if(null!==r){var a=(e-r)*i;if(a<0||0===i)return;this._startTime=null,t=i*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,u=this._propertyBindings,h=0,l=c.length;h!==l;++h)c[h].evaluate(o),u[h].accumulate(n,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i)t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var i=this._clip.duration,n=this.loop,r=this._loopCount;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=i)t=i;else{if(!(t<0))break e;t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{var a=2202===n;if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=i||t<0){var o=Math.floor(t/i);t-=i*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1==(1&r))return this.time=t,i-t}return this.time=t,t},_setEndings:function(e,t,i){var n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=e?this.zeroSlopeAtStart?2401:xt:2402,n.endingEnd=t?this.zeroSlopeAtEnd?2401:xt:2402)},_scheduleFading:function(e,t,i){var n=this._mixer,r=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=t,o[1]=r+e,s[1]=i,this}}),Rc.prototype=Object.assign(Object.create(u.prototype),{constructor:Rc,_bindAction:function(e,t){var i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,a=e._propertyBindings,o=e._interpolants,s=i.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var h=0;h!==r;++h){var l=n[h],d=l.name,p=u[d];if(void 0!==p)a[h]=p;else{if(void 0!==(p=a[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[h].binding.parsedPath;++(p=new vc(Oc.create(i,d,f),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[h]=p}o[h].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}for(var r=e._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,i=0,n=t.length;i!==n;++i){var r=t[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,i){var n=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=n.length,n.push(e),a.actionByRoot[i]=e},_removeInactiveAction:function(e){var t=this._actions,i=t[t.length-1],n=e._cacheIndex;i._cacheIndex=n,t[n]=i,t.pop(),e._cacheIndex=null;var r=e._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,c=s[s.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,i=0,n=t.length;i!==n;++i){var r=t[i];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(e){var t=this._actions,i=e._cacheIndex,n=this._nActiveActions++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r},_takeBackAction:function(e){var t=this._actions,i=e._cacheIndex,n=--this._nActiveActions,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r},_addInactiveBinding:function(e,t,i){var n=this._bindingsByRootAndName,r=n[t],a=this._bindings;void 0===r&&(r={},n[t]=r),r[i]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,i=e.binding,n=i.rootNode.uuid,r=i.path,a=this._bindingsByRootAndName,o=a[n],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[r];e:{for(var u in o)break e;delete a[n]}},_lendBinding:function(e){var t=this._bindings,i=e._cacheIndex,n=this._nActiveBindings++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r},_takeBackBinding:function(e){var t=this._bindings,i=e._cacheIndex,n=--this._nActiveBindings,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&((i=new Cs(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=i),i},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,i=e.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];e.__cacheIndex=n,t[n]=e,r.__cacheIndex=i,t[i]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var i=t||this._root,n=i.uuid,r="string"==typeof e?Ps.findByName(i,e):e,a=null!==r?r.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[n];if(void 0!==c)return c;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var u=new zc(this,r,t);return this._bindAction(u,s),this._addInactiveAction(u,a,n),u},existingAction:function(e,t){var i=t||this._root,n=i.uuid,r="string"==typeof e?Ps.findByName(i,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[n]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,i=this._bindings,n=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==t;++r)e[r].reset();for(r=0;r!==n;++r)i[r].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1,o=0;o!==i;++o){t[o]._update(n,e,r,a)}var s=this._bindings,c=this._nActiveBindings;for(o=0;o!==c;++o)s[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,i=e.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var u=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=u,t[u]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete n[i]}},uncacheRoot:function(e){var t=e.uuid,i=this._actionsByClip;for(var n in i){var r=i[n].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),Uc.prototype.clone=function(){return new Uc(void 0===this.value.clone?this.value:this.value.clone())},Pc.prototype=Object.assign(Object.create(ki.prototype),{constructor:Pc,isInstancedBufferGeometry:!0,copy:function(e){return ki.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Object.defineProperties(Bc.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Bc.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this},setXYZ:function(e,t,i,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this},setXYZW:function(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}}),Object.defineProperty(kc.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(kc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.stride:0,this.array=e,this},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.stride,i*=t.stride;for(var n=0,r=this.stride;n<r;n++)this.array[e+n]=t.array[i+n];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),Fc.prototype=Object.assign(Object.create(kc.prototype),{constructor:Fc,isInstancedInterleavedBuffer:!0,copy:function(e){return kc.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Gc.prototype=Object.assign(Object.create(Li.prototype),{constructor:Gc,isInstancedBufferAttribute:!0,copy:function(e){return Li.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(function(e,t,i,n){this.ray=new nn(e,t),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,i){var n=i||[];return Yc(e,this,n,t),n.sort(Qc),n},intersectObjects:function(e,t,i){var n=i||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var r=0,a=e.length;r<a;r++)Yc(e[r],this,n,t);return n.sort(Qc),n}}),Object.assign(function(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),Object.assign(Vc.prototype,{set:function(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(zt.clamp(e.y/this.radius,-1,1))),this}}),Object.assign(function(e,t,i){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==i?i:0,this}.prototype,{set:function(e,t,i){return this.radius=e,this.theta=t,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.radius=Math.sqrt(e.x*e.x+e.z*e.z),this.theta=Math.atan2(e.x,e.z),this.y=e.y,this}}),Object.assign(Hc.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new Rt;return function(t,i){var n=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new Rt),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new Rt),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Rt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Rt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Rt;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Wc.prototype=Object.create(vi.prototype),Wc.prototype.constructor=Wc,Wc.prototype.isImmediateRenderObject=!0,Xc.prototype=Object.create(sa.prototype),Xc.prototype.constructor=Xc,Xc.prototype.update=function(){var e=new Bt,t=new Bt,i=new kt;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o&&o.isGeometry)for(var s=o.vertices,c=o.faces,u=0,h=0,l=c.length;h<l;h++)for(var d=c[h],p=0,f=d.vertexNormals.length;p<f;p++){var g=s[d[n[p]]],m=d.vertexNormals[p];e.copy(g).applyMatrix4(r),t.copy(m).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(u,e.x,e.y,e.z),u+=1,a.setXYZ(u,t.x,t.y,t.z),u+=1}else if(o&&o.isBufferGeometry){var M=o.attributes.position,y=o.attributes.normal;for(u=0,p=0,f=M.count;p<f;p++)e.set(M.getX(p),M.getY(p),M.getZ(p)).applyMatrix4(r),t.set(y.getX(p),y.getY(p),y.getZ(p)),t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(u,e.x,e.y,e.z),u+=1,a.setXYZ(u,t.x,t.y,t.z),u+=1}a.needsUpdate=!0}}(),Zc.prototype=Object.create(vi.prototype),Zc.prototype.constructor=Zc,Zc.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Zc.prototype.update=function(){var e=new Bt,t=new Bt;return function(){this.light.updateMatrixWorld();var i=this.light.distance?this.light.distance:1e3,n=i*Math.tan(this.light.angle);this.cone.scale.set(n,n,i),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),qc.prototype=Object.create(sa.prototype),qc.prototype.constructor=qc,qc.prototype.updateMatrixWorld=function(){var e=new Bt,t=new Ut,i=new Ut;return function(n){var r=this.bones,a=this.geometry,o=a.getAttribute("position");i.getInverse(this.root.matrixWorld);for(var s=0,c=0;s<r.length;s++){var u=r[s];u.parent&&u.parent.isBone&&(t.multiplyMatrices(i,u.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(c,e.x,e.y,e.z),t.multiplyMatrices(i,u.parent.matrixWorld),e.setFromMatrixPosition(t),o.setXYZ(c+1,e.x,e.y,e.z),c+=2)}a.getAttribute("position").needsUpdate=!0,vi.prototype.updateMatrixWorld.call(this,n)}}(),Jc.prototype=Object.create(on.prototype),Jc.prototype.constructor=Jc,Jc.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Jc.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},Kc.prototype=Object.create(vi.prototype),Kc.prototype.constructor=Kc,Kc.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Kc.prototype.update=function(){var e=.5*this.light.width,t=.5*this.light.height,i=this.line.geometry.attributes.position,n=i.array;n[0]=e,n[1]=-t,n[2]=0,n[3]=e,n[4]=t,n[5]=0,n[6]=-e,n[7]=t,n[8]=0,n[9]=-e,n[10]=-t,n[11]=0,n[12]=e,n[13]=-t,n[14]=0,i.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},$c.prototype=Object.create(vi.prototype),$c.prototype.constructor=$c,$c.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},$c.prototype.update=function(){var e=new Bt,t=new oi,i=new oi;return function(){var n=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=n.geometry.getAttribute("color");t.copy(this.light.color),i.copy(this.light.groundColor);for(var a=0,o=r.count;a<o;a++){var s=a<o/2?t:i;r.setXYZ(a,s.r,s.g,s.b)}r.needsUpdate=!0}n.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),eu.prototype=Object.create(sa.prototype),eu.prototype.constructor=eu,tu.prototype=Object.create(sa.prototype),tu.prototype.constructor=tu,iu.prototype=Object.create(sa.prototype),iu.prototype.constructor=iu,iu.prototype.update=function(){var e=new Bt,t=new Bt,i=new kt;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,r=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,c=0,u=0,h=s.length;u<h;u++){var l=s[u],d=l.normal;e.copy(o[l.a]).add(o[l.b]).add(o[l.c]).divideScalar(3).applyMatrix4(n),t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),r.setXYZ(c,e.x,e.y,e.z),c+=1,r.setXYZ(c,t.x,t.y,t.z),c+=1}r.needsUpdate=!0}}(),nu.prototype=Object.create(vi.prototype),nu.prototype.constructor=nu,nu.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},nu.prototype.update=function(){var e=new Bt,t=new Bt,i=new Bt;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(t,e),this.lightPlane.lookAt(i),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(i),this.targetLine.scale.z=i.length()}}(),ru.prototype=Object.create(sa.prototype),ru.prototype.constructor=ru,ru.prototype.update=function(){var e,t,i=new Bt,n=new Ai;function r(r,a,o,s){i.set(a,o,s).unproject(n);var c=t[r];if(void 0!==c)for(var u=e.getAttribute("position"),h=0,l=c.length;h<l;h++)u.setXYZ(c[h],i.x,i.y,i.z)}return function(){e=this.geometry,t=this.pointMap;n.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),e.getAttribute("position").needsUpdate=!0}}(),au.prototype=Object.create(sa.prototype),au.prototype.constructor=au,au.prototype.update=function(){var e=new Kt;return function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&e.setFromObject(this.object),!e.isEmpty()){var i=e.min,n=e.max,r=this.geometry.attributes.position,a=r.array;a[0]=n.x,a[1]=n.y,a[2]=n.z,a[3]=i.x,a[4]=n.y,a[5]=n.z,a[6]=i.x,a[7]=i.y,a[8]=n.z,a[9]=n.x,a[10]=i.y,a[11]=n.z,a[12]=n.x,a[13]=n.y,a[14]=i.z,a[15]=i.x,a[16]=n.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=n.x,a[22]=i.y,a[23]=i.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),au.prototype.setFromObject=function(e){return this.object=e,this.update(),this},ou.prototype=Object.create(sa.prototype),ou.prototype.constructor=ou,ou.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),vi.prototype.updateMatrixWorld.call(this,e))},su.prototype=Object.create(oa.prototype),su.prototype.constructor=su,su.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?b:L,this.lookAt(this.plane.normal),vi.prototype.updateMatrixWorld.call(this,e)},cu.prototype=Object.create(vi.prototype),cu.prototype.constructor=cu,cu.prototype.setDirection=(jc=new Bt,function(e){e.y>.99999?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(jc.set(e.z,0,-e.x).normalize(),Sc=Math.acos(e.y),this.quaternion.setFromAxisAngle(jc,Sc))}),cu.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},cu.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},uu.prototype=Object.create(sa.prototype),uu.prototype.constructor=uu,Ho.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Ho.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(ds.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Di,i=0,n=e.length;i<n;i++){var r=e[i];t.vertices.push(new Bt(r.x,r.y,r.z||0))}return t}}),Object.assign(ps.prototype,{fromPoints:function(e){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),hu.prototype=Object.create(es.prototype),Object.assign(hu.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),eu.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},qc.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Hs.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Ws(e)}}),Object.assign(Hc.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Kt.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),rn.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(zt,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),zt.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),zt.ceilPowerOfTwo(e)}}),Object.assign(kt.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Ut.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new Bt),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,i,n,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,i,r,a)}}),ei.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Pt.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(nn.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(an.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(an,{barycoordFromPoint:function(e,t,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),an.getBarycoord(e,t,i,n,r)},normal:function(e,t,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),an.getNormal(e,t,i,n)}}),Object.assign(fs.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ao(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new yo(this,e)}}),Object.assign(Rt.prototype,{fromAttribute:function(e,t,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Bt.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Xt.prototype,{fromAttribute:function(e,t,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Di.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(vi.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(vi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(ta.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(ia.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(Ho.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Vr.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(gs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Li.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(ki.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(ki.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.assign(oo.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Uc.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties($i.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new oi}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}}}),Object.defineProperties(Co.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(tn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Zr.prototype,{animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}}),Object.defineProperties(Zr.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Br.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Zt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Wr.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}}}),mc.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new pc).load(e,function(e){t.setBuffer(e)}),this},yc.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},fc.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var lu=function(e,t){var i,n,r=this,a=new Ut,o=null;"VRFrameData"in window&&(o=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(function(e){n=e,e.length>0?i=e[0]:t&&t("VR input not available.")}).catch(function(){console.warn("VRControls: Unable to get VR Displays")}),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return i},this.setVRDisplay=function(e){i=e},this.getVRDisplays=function(){return console.warn("VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return a},this.update=function(){var t;i&&(i.getFrameData?(i.getFrameData(o),t=o.pose):i.getPose&&(t=i.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(i.stageParameters?(e.updateMatrix(),a.fromArray(i.stageParameters.sittingToStandingTransform),e.applyMatrix(a)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(r.scale))},this.dispose=function(){i=null}},du=function(e,t){var i,n,r,a,o=new Bt,s=new Bt,c=new Ut,u=new Ut,h=new Ut,l=null;"VRFrameData"in window&&(l=new window.VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(function(e){n=e,e.length>0?i=e[0]:t&&t("HMD not available")}).catch(function(){console.warn("VREffect: Unable to get VR Displays")}),this.isPresenting=!1;var d=this,p=e.getSize(),f=!1,g=e.getPixelRatio();this.getVRDisplay=function(){return i},this.setVRDisplay=function(e){i=e},this.getVRDisplays=function(){return console.warn("VREffect: getVRDisplays() is being deprecated."),n},this.setSize=function(t,n,r){if(p={width:t,height:n},f=r,d.isPresenting){var a=i.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*a.renderWidth,a.renderHeight,!1)}else e.setPixelRatio(g),e.setSize(t,n,r)};var m=e.domElement,M=[0,0,.5,1],y=[.5,0,.5,1];function v(){var t=d.isPresenting;if(d.isPresenting=void 0!==i&&i.isPresenting,d.isPresenting){var n=i.getEyeParameters("left"),r=n.renderWidth,a=n.renderHeight;t||(g=e.getPixelRatio(),p=e.getSize(),e.setPixelRatio(1),e.setSize(2*r,a,!1))}else t&&(e.setPixelRatio(g),e.setSize(p.width,p.height,f))}window.addEventListener("vrdisplaypresentchange",v,!1),this.setFullScreen=function(e){return new Promise(function(t,n){void 0!==i?d.isPresenting!==e?t(e?i.requestPresent([{source:m}]):i.exitPresent()):t():n(new Error("No VR hardware found."))})},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)},this.requestAnimationFrame=function(e){return void 0!==i?i.requestAnimationFrame(e):window.requestAnimationFrame(e)},this.cancelAnimationFrame=function(e){void 0!==i?i.cancelAnimationFrame(e):window.cancelAnimationFrame(e)},this.submitFrame=function(){void 0!==i&&d.isPresenting&&i.submitFrame()},this.autoSubmitFrame=!0;var A=new Vr;A.layers.enable(1);var w=new Vr;w.layers.enable(2),this.render=function(t,n,p,f){if(i&&d.isPresenting){var g=t.autoUpdate;g&&(t.updateMatrixWorld(),t.autoUpdate=!1),Array.isArray(t)&&(console.warn("VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var m,v,N=e.getSize(),D=i.getLayers();if(D.length){var L=D[0];m=null!==L.leftBounds&&4===L.leftBounds.length?L.leftBounds:M,v=null!==L.rightBounds&&4===L.rightBounds.length?L.rightBounds:y}else m=M,v=y;if(r={x:Math.round(N.width*m[0]),y:Math.round(N.height*m[1]),width:Math.round(N.width*m[2]),height:Math.round(N.height*m[3])},a={x:Math.round(N.width*v[0]),y:Math.round(N.height*v[1]),width:Math.round(N.width*v[2]),height:Math.round(N.height*v[3])},p?(e.setRenderTarget(p),p.scissorTest=!0):(e.setRenderTarget(null),e.setScissorTest(!0)),(e.autoClear||f)&&e.clear(),null===n.parent&&n.updateMatrixWorld(),n.matrixWorld.decompose(A.position,A.quaternion,A.scale),w.position.copy(A.position),w.quaternion.copy(A.quaternion),w.scale.copy(A.scale),i.getFrameData)i.depthNear=n.near,i.depthFar=n.far,i.getFrameData(l),A.projectionMatrix.elements=l.leftProjectionMatrix,w.projectionMatrix.elements=l.rightProjectionMatrix,function(e){e.pose.orientation?(x.fromArray(e.pose.orientation),c.makeRotationFromQuaternion(x)):c.identity();e.pose.position&&(E.fromArray(e.pose.position),c.setPosition(E));u.fromArray(e.leftViewMatrix),u.multiply(c),h.fromArray(e.rightViewMatrix),h.multiply(c),u.getInverse(u),h.getInverse(h)}(l),A.updateMatrix(),A.matrix.multiply(u),A.matrix.decompose(A.position,A.quaternion,A.scale),w.updateMatrix(),w.matrix.multiply(h),w.matrix.decompose(w.position,w.quaternion,w.scale);else{var b=i.getEyeParameters("left"),I=i.getEyeParameters("right");A.projectionMatrix=T(b.fieldOfView,!0,n.near,n.far),w.projectionMatrix=T(I.fieldOfView,!0,n.near,n.far),o.fromArray(b.offset),s.fromArray(I.offset),A.translateOnAxis(o,A.scale.x),w.translateOnAxis(s,w.scale.x)}return p?(p.viewport.set(r.x,r.y,r.width,r.height),p.scissor.set(r.x,r.y,r.width,r.height)):(e.setViewport(r.x,r.y,r.width,r.height),e.setScissor(r.x,r.y,r.width,r.height)),e.render(t,A,p,f),p?(p.viewport.set(a.x,a.y,a.width,a.height),p.scissor.set(a.x,a.y,a.width,a.height)):(e.setViewport(a.x,a.y,a.width,a.height),e.setScissor(a.x,a.y,a.width,a.height)),e.render(t,w,p,f),p?(p.viewport.set(0,0,N.width,N.height),p.scissor.set(0,0,N.width,N.height),p.scissorTest=!1,e.setRenderTarget(null)):(e.setViewport(0,0,N.width,N.height),e.setScissorTest(!1)),g&&(t.autoUpdate=!0),void(d.autoSubmitFrame&&d.submitFrame())}e.render(t,n,p,f)},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",v,!1)};var x=new Pt,E=new Bt;function T(e,t,i,n){var r=Math.PI/180;return function(e,t,i,n){i=void 0===i?.01:i,n=void 0===n?1e4:n;var r=(t=void 0===t||t)?-1:1,a=new Ut,o=a.elements,s=function(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,n=2/(e.upTan+e.downTan);return{scale:[t,n],offset:[i,(e.upTan-e.downTan)*n*.5]}}(e);return o[0]=s.scale[0],o[1]=0,o[2]=s.offset[0]*r,o[3]=0,o[4]=0,o[5]=s.scale[1],o[6]=-s.offset[1]*r,o[7]=0,o[8]=0,o[9]=0,o[10]=n/(i-n)*-r,o[11]=n*i/(i-n),o[12]=0,o[13]=0,o[14]=r,o[15]=0,a.transpose(),a}({upTan:Math.tan(e.upDegrees*r),downTan:Math.tan(e.downDegrees*r),leftTan:Math.tan(e.leftDegrees*r),rightTan:Math.tan(e.rightDegrees*r)},t,i,n)}},pu=function(e,t){this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new Bt,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:v,ZOOM:A,PAN:w},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return u.phi},this.getAzimuthalAngle=function(){return u.theta},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(n),i.update(),s=o.NONE},this.update=function(){var t=new Bt,r=(new Pt).setFromUnitVectors(e.up,new Bt(0,1,0)),a=r.clone().inverse(),f=new Bt,g=new Pt;return function(){var e=i.object.position;return t.copy(e).sub(i.target),t.applyQuaternion(r),u.setFromVector3(t),i.autoRotate&&s===o.NONE&&i.rotateLeft(2*Math.PI/60/60*i.autoRotateSpeed),u.theta+=h.theta,u.phi+=h.phi,u.theta=Math.max(i.minAzimuthAngle,Math.min(i.maxAzimuthAngle,u.theta)),u.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,u.phi)),u.makeSafe(),u.radius*=l,u.radius=Math.max(i.minDistance,Math.min(i.maxDistance,u.radius)),i.target.add(d),t.setFromSpherical(u),t.applyQuaternion(a),e.copy(i.target).add(t),i.object.lookAt(i.target),!0===i.enableDamping?(h.theta*=1-i.dampingFactor,h.phi*=1-i.dampingFactor,d.multiplyScalar(1-i.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),l=1,!!(p||f.distanceToSquared(i.object.position)>c||8*(1-g.dot(i.object.quaternion))>c)&&(i.dispatchEvent(n),f.copy(i.object.position),g.copy(i.object.quaternion),p=!1,!0)}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",k,!1),i.domElement.removeEventListener("mousedown",j,!1),i.domElement.removeEventListener("wheel",z,!1),i.domElement.removeEventListener("touchstart",U,!1),i.domElement.removeEventListener("touchend",B,!1),i.domElement.removeEventListener("touchmove",P,!1),document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",O,!1),window.removeEventListener("keydown",R,!1)};var i=this,n={type:"change"},r={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},s=o.NONE,c=1e-6,u=new Vc,h=new Vc,l=1,d=new Bt,p=!1,f=new Rt,g=new Rt,m=new Rt,M=new Rt,y=new Rt,x=new Rt,E=new Rt,T=new Rt,N=new Rt;function D(){return Math.pow(.95,i.zoomSpeed)}i.rotateLeft=function(e){h.theta-=e},i.rotateUp=function(e){h.phi-=e};var L=function(){var e=new Bt;return function(t,i){e.setFromMatrixColumn(i,0),e.multiplyScalar(-t),d.add(e)}}(),b=function(){var e=new Bt;return function(t,n){!0===i.screenSpacePanning?e.setFromMatrixColumn(n,1):(e.setFromMatrixColumn(n,0),e.crossVectors(i.object.up,e)),e.multiplyScalar(t),d.add(e)}}(),I=function(){var e=new Bt;return function(t,n){var r=i.domElement===document?i.domElement.body:i.domElement;if(i.object.isPerspectiveCamera){var a=i.object.position;e.copy(a).sub(i.target);var o=e.length();o*=Math.tan(i.object.fov/2*Math.PI/180),L(2*t*o/r.clientHeight,i.object.matrix),b(2*n*o/r.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(L(t*(i.object.right-i.object.left)/i.object.zoom/r.clientWidth,i.object.matrix),b(n*(i.object.top-i.object.bottom)/i.object.zoom/r.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function _(e){i.object.isPerspectiveCamera?l/=e:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*e)),i.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function S(e){i.object.isPerspectiveCamera?l*=e:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/e)),i.object.updateProjectionMatrix(),p=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function j(e){if(!1!==i.enabled){switch(e.preventDefault(),e.button){case i.mouseButtons.ORBIT:if(!1===i.enableRotate)return;!function(e){f.set(e.clientX,e.clientY)}(e),s=o.ROTATE;break;case i.mouseButtons.ZOOM:if(!1===i.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),s=o.DOLLY;break;case i.mouseButtons.PAN:if(!1===i.enablePan)return;!function(e){M.set(e.clientX,e.clientY)}(e),s=o.PAN}s!==o.NONE&&(document.addEventListener("mousemove",C,!1),document.addEventListener("mouseup",O,!1),i.dispatchEvent(r))}}function C(e){if(!1!==i.enabled)switch(e.preventDefault(),s){case o.ROTATE:if(!1===i.enableRotate)return;!function(e){g.set(e.clientX,e.clientY),m.subVectors(g,f).multiplyScalar(i.rotateSpeed);var t=i.domElement===document?i.domElement.body:i.domElement;i.rotateLeft(2*Math.PI*m.x/t.clientHeight),i.rotateUp(2*Math.PI*m.y/t.clientHeight),f.copy(g),i.update()}(e);break;case o.DOLLY:if(!1===i.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),N.subVectors(T,E),N.y>0?_(D()):N.y<0&&S(D()),E.copy(T),i.update()}(e);break;case o.PAN:if(!1===i.enablePan)return;!function(e){y.set(e.clientX,e.clientY),x.subVectors(y,M).multiplyScalar(i.panSpeed),I(x.x,x.y),M.copy(y),i.update()}(e)}}function O(e){!1!==i.enabled&&(document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",O,!1),i.dispatchEvent(a),s=o.NONE)}function z(e){!1===i.enabled||!1===i.enableZoom||s!==o.NONE&&s!==o.ROTATE||(e.preventDefault(),e.stopPropagation(),i.dispatchEvent(r),function(e){e.deltaY<0?S(D()):e.deltaY>0&&_(D()),i.update()}(e),i.dispatchEvent(a))}function R(e){!1!==i.enabled&&!1!==i.enableKeys&&!1!==i.enablePan&&function(e){switch(e.keyCode){case i.keys.UP:I(0,i.keyPanSpeed),i.update();break;case i.keys.BOTTOM:I(0,-i.keyPanSpeed),i.update();break;case i.keys.LEFT:I(i.keyPanSpeed,0),i.update();break;case i.keys.RIGHT:I(-i.keyPanSpeed,0),i.update()}}(e)}function U(e){if(!1!==i.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===i.enableRotate)return;!function(e){f.set(e.touches[0].pageX,e.touches[0].pageY)}(e),s=o.TOUCH_ROTATE;break;case 2:if(!1===i.enableZoom&&!1===i.enablePan)return;!function(e){if(i.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);E.set(0,r)}if(i.enablePan){var a=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);M.set(a,o)}}(e),s=o.TOUCH_DOLLY_PAN;break;default:s=o.NONE}s!==o.NONE&&i.dispatchEvent(r)}}function P(e){if(!1!==i.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===i.enableRotate)return;if(s!==o.TOUCH_ROTATE)return;!function(e){g.set(e.touches[0].pageX,e.touches[0].pageY),m.subVectors(g,f).multiplyScalar(i.rotateSpeed);var t=i.domElement===document?i.domElement.body:i.domElement;i.rotateLeft(2*Math.PI*m.x/t.clientHeight),i.rotateUp(2*Math.PI*m.y/t.clientHeight),f.copy(g),i.update()}(e);break;case 2:if(!1===i.enableZoom&&!1===i.enablePan)return;if(s!==o.TOUCH_DOLLY_PAN)return;!function(e){if(i.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);T.set(0,r),N.set(0,Math.pow(T.y/E.y,i.zoomSpeed)),_(N.y),E.copy(T)}if(i.enablePan){var a=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);y.set(a,o),x.subVectors(y,M).multiplyScalar(i.panSpeed),I(x.x,x.y),M.copy(y)}i.update()}(e);break;default:s=o.NONE}}function B(e){!1!==i.enabled&&(i.dispatchEvent(a),s=o.NONE)}function k(e){!1!==i.enabled&&e.preventDefault()}i.domElement.addEventListener("mousedown",j,!1),i.domElement.addEventListener("wheel",z,!1),i.domElement.addEventListener("touchstart",U,!1),i.domElement.addEventListener("touchend",B,!1),i.domElement.addEventListener("touchmove",P,!1),window.addEventListener("keydown",R,!1),this.update()};pu.prototype=Object.create(u.prototype),pu.prototype.constructor=pu,Object.defineProperties(pu.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var fu=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var i=function(e){t.deviceOrientation=e},n=function(){t.screenOrientation=window.orientation||0},r=function(){var e=new Bt(0,0,1),t=new di,i=new Pt,n=new Pt(-Math.sqrt(.5),0,0,Math.sqrt(.5));return function(r,a,o,s,c){t.set(o,a,-s,"YXZ"),r.setFromEuler(t),r.multiply(n),r.multiply(i.setFromAxisAngle(e,-c))}}();this.connect=function(){n(),window.addEventListener("orientationchange",n,!1),window.addEventListener("deviceorientation",i,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",n,!1),window.removeEventListener("deviceorientation",i,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var i=e.alpha?zt.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?zt.degToRad(e.beta):0,a=e.gamma?zt.degToRad(e.gamma):0,o=t.screenOrientation?zt.degToRad(t.screenOrientation):0;r(t.object.quaternion,i,n,a,o)}}},this.dispose=function(){t.disconnect()},this.connect()};var gu,mu=function(){function e(e){this.object=e.camera,this.domElement=e.canvas,this.orbit=new pu(this.object,this.domElement),this.speed=.5,this.orbit.target.set(0,0,-1),this.orbit.enableZoom=!1,this.orbit.enablePan=!1,this.orbit.rotateSpeed=-this.speed,e.orientation&&(this.orientation=new fu(this.object)),e.halfView&&(this.orbit.minAzimuthAngle=-Math.PI/4,this.orbit.maxAzimuthAngle=Math.PI/4)}var t=e.prototype;return t.update=function(){if(this.orientation){this.orientation.update();var e=this.orientation.object.quaternion,t=function(e,t,i,n){var r=e*t+i*n;if(r>.499){var a=2*Math.atan2(e,n);return new Bt(Math.PI/2,0,a)}if(r<-.499){var o=-2*Math.atan2(e,n);return new Bt(-Math.PI/2,0,o)}var s=e*e,c=t*t,u=i*i,h=Math.atan2(2*t*n-2*e*i,1-2*c-2*u);return new Bt(Math.asin(2*r),Math.atan2(2*e*n-2*t*i,1-2*s-2*u),h)}(e.x,e.y,e.z,e.w);void 0===this.lastAngle_&&(this.lastAngle_=t),this.orbit.rotateLeft((this.lastAngle_.z-t.z)*(1+this.speed)),this.orbit.rotateUp((this.lastAngle_.y-t.y)*(1+this.speed)),this.lastAngle_=t}this.orbit.update()},t.dispose=function(){this.orbit.dispose(),this.orientation&&this.orientation.dispose()},e}(),Mu=((gu=t.createElement("video")).crossOrigin="anonymous",gu.hasAttribute("crossorigin")),yu=["360","360_LR","360_TB","360_CUBE","EAC","EAC_LR","NONE","AUTO","Sphere","Cube","equirectangular","180"],vu=function(e){if(e){if(e=e.toString().trim(),/sphere/i.test(e))return"360";if(/cube/i.test(e))return"360_CUBE";if(/equirectangular/i.test(e))return"360";for(var t=0;t<yu.length;t++)if(new RegExp("^"+yu[t]+"$","i").test(e))return yu[t]}},Au=function(e){function t(t,r){var a;return(a=e.call(this)||this).player=t,a.canvas=r,a.onMoveEnd=i.bind(n(a),a.onMoveEnd),a.onMoveStart=i.bind(n(a),a.onMoveStart),a.onMove=i.bind(n(a),a.onMove),a.onControlBarMove=i.bind(n(a),a.onControlBarMove),a.player.controlBar.on(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend"],a.onControlBarMove),a.oldReportUserActivity=a.player.reportUserActivity,a.player.reportUserActivity=function(){},a.canvas.addEventListener("mousedown",a.onMoveStart),a.canvas.addEventListener("touchstart",a.onMoveStart),a.canvas.addEventListener("mousemove",a.onMove),a.canvas.addEventListener("touchmove",a.onMove),a.canvas.addEventListener("mouseup",a.onMoveEnd),a.canvas.addEventListener("touchend",a.onMoveEnd),a.shouldTogglePlay=!1,a}r(t,e);var a=t.prototype;return a.togglePlay=function(){this.player.paused()?this.player.play():this.player.pause()},a.onMoveStart=function(e){this.player.controls()&&("mousedown"!==e.type||i.dom.isSingleLeftClick(e))?(this.shouldTogglePlay=!0,this.touchMoveCount_=0):this.shouldTogglePlay=!1},a.onMoveEnd=function(e){if("touchend"===e.type&&this.touchMoveCount_<10)return!1===this.player.userActive()?void this.player.userActive(!0):void this.player.userActive(!1);this.shouldTogglePlay&&"mouseup"==e.type&&this.togglePlay()},a.onMove=function(e){this.touchMoveCount_++,this.shouldTogglePlay=!1},a.onControlBarMove=function(e){this.player.userActive(!0)},a.dispose=function(){this.canvas.removeEventListener("mousedown",this.onMoveStart),this.canvas.removeEventListener("touchstart",this.onMoveStart),this.canvas.removeEventListener("mousemove",this.onMove),this.canvas.removeEventListener("touchmove",this.onMove),this.canvas.removeEventListener("mouseup",this.onMoveEnd),this.canvas.removeEventListener("touchend",this.onMoveEnd),this.player.controlBar.off(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend"],this.onControlBarMove),this.player.reportUserActivity=this.oldReportUserActivity},t}(i.EventTarget),wu=function(e){function t(t,n,r,a){var o;o=e.call(this)||this;var s=i.mergeOptions({channelMap:i.browser.IS_SAFARI?[2,0,1,3]:[0,1,2,3],ambisonicOrder:1},a);return o.videoElementSource=t.createMediaElementSource(r),o.foaRenderer=n.createFOARenderer(t,s),o.foaRenderer.initialize().then(function(){"suspended"===t.state&&o.trigger({type:"audiocontext-suspended"}),o.videoElementSource.connect(o.foaRenderer.input),o.foaRenderer.output.connect(t.destination),o.initialized=!0,o.trigger({type:"omnitone-ready"})},function(e){i.log.warn("videojs-vr: Omnitone initializes failed with the following error: "+e+")")}),o}r(t,e);var n=t.prototype;return n.update=function(e){this.initialized&&this.foaRenderer.setRotationMatrixFromCamera(e.matrix)},n.dispose=function(){this.initialized=!1,this.foaRenderer.setRenderingMode("bypass"),this.foaRenderer=null},t}(i.EventTarget),xu=function(t){function a(r,a){var o;return(o=t.call(this,r,a)||this).handleVrDisplayActivate_=i.bind(n(o),o.handleVrDisplayActivate_),o.handleVrDisplayDeactivate_=i.bind(n(o),o.handleVrDisplayDeactivate_),o.handleVrDisplayPresentChange_=i.bind(n(o),o.handleVrDisplayPresentChange_),o.handleOrientationChange_=i.bind(n(o),o.handleOrientationChange_),e.addEventListener("orientationchange",o.handleOrientationChange_),e.addEventListener("vrdisplayactivate",o.handleVrDisplayActivate_),e.addEventListener("vrdisplaydeactivate",o.handleVrDisplayDeactivate_),e.addEventListener("vrdisplaypresentchange",o.handleVrDisplayPresentChange_),i.browser.IS_ANDROID&&o.on(r,"fullscreenchange",function(){r.isFullscreen()?o.hide():o.show()}),o}r(a,t);var o=a.prototype;return o.buildCSSClass=function(){return"vjs-button-vr "+t.prototype.buildCSSClass.call(this)},o.handleVrDisplayPresentChange_=function(){!this.player_.vr().vrDisplay.isPresenting&&this.active_&&this.handleVrDisplayDeactivate_(),this.player_.vr().vrDisplay.isPresenting&&!this.active_&&this.handleVrDisplayActivate_()},o.handleOrientationChange_=function(){this.active_&&i.browser.IS_IOS&&this.changeSize_()},o.changeSize_=function(){this.player_.width(e.innerWidth),this.player_.height(e.innerHeight),e.dispatchEvent(new e.Event("resize"))},o.handleVrDisplayActivate_=function(){i.browser.IS_IOS&&(this.oldWidth_=this.player_.currentWidth(),this.oldHeight_=this.player_.currentHeight(),this.player_.enterFullWindow(),this.changeSize_()),this.active_=!0},o.handleVrDisplayDeactivate_=function(){i.browser.IS_IOS&&(this.oldWidth_&&this.player_.width(this.oldWidth_),this.oldHeight_&&this.player_.height(this.oldHeight_),this.player_.exitFullWindow()),this.active_=!1},o.handleClick=function(t){this.active_?e.dispatchEvent(new e.Event("vrdisplaydeactivate")):(!this.player_.hasStarted()&&i.browser.IS_ANDROID&&this.player_.play(),e.dispatchEvent(new e.Event("vrdisplayactivate")))},o.dispose=function(){t.prototype.dispose.call(this),e.removeEventListener("vrdisplayactivate",this.handleVrDisplayActivate_),e.removeEventListener("vrdisplaydeactivate",this.handleVrDisplayDeactivate_),e.removeEventListener("vrdisplaypresentchange",this.handleVrDisplayPresentChange_)},a}(i.getComponent("Button"));i.registerComponent("CardboardButton",xu);var Eu=function(e){function t(){return e.apply(this,arguments)||this}return r(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-vr-play-button "+e.prototype.buildCSSClass.call(this)},t}(i.getComponent("BigPlayButton"));i.registerComponent("BigVrPlayButton",Eu);var Tu={debug:!1,omnitone:!1,forceCardboard:!1,omnitoneOptions:{},projection:"AUTO"},Nu={"web-vr-out-of-date":{headline:"360 is out of date",type:"360_OUT_OF_DATE",message:"Your browser supports 360 but not the latest version. See <a href='http://webvr.info'>http://webvr.info</a> for more info."},"web-vr-not-supported":{headline:"360 not supported on this device",type:"360_NOT_SUPPORTED",message:"Your browser does not support 360. See <a href='http://webvr.info'>http://webvr.info</a> for assistance."},"web-vr-hls-cors-not-supported":{headline:"360 HLS video not supported on this device",type:"360_NOT_SUPPORTED",message:"Your browser/device does not support HLS 360 video. See <a href='http://webvr.info'>http://webvr.info</a> for assistance."}},Du=i.getPlugin("plugin"),Lu=i.getComponent("Component"),bu=function(a){function o(e,t){var r,o=i.mergeOptions(Tu,t);return(r=a.call(this,e,o)||this).options_=o,r.player_=e,r.bigPlayButtonIndex_=e.children().indexOf(e.getChild("BigPlayButton"))||0,r.videojsErrorsSupport_=!!i.errors,r.videojsErrorsSupport_&&e.errors({errors:Nu}),i.browser.IE_VERSION||!Mu?(r.player_.on("loadstart",function(){r.triggerError_({code:"web-vr-not-supported",dismiss:!1})}),n(r)):(r.polyfill_=new c({ROTATE_INSTRUCTIONS_DISABLED:!0}),r.polyfill_=new c,r.handleVrDisplayActivate_=i.bind(n(r),r.handleVrDisplayActivate_),r.handleVrDisplayDeactivate_=i.bind(n(r),r.handleVrDisplayDeactivate_),r.handleResize_=i.bind(n(r),r.handleResize_),r.animate_=i.bind(n(r),r.animate_),r.setProjection(r.options_.projection),r.on(e,"adstart",function(){return e.setTimeout(function(){e.ads&&e.ads.videoElementRecycled()?(r.log("video element recycled for this ad, reseting"),r.reset(),r.one(e,"playing",r.init)):r.log("video element not recycled for this ad, no need to reset")})},1),r.on(e,"loadedmetadata",r.init),r)}r(o,a);var s=o.prototype;return s.changeProjection_=function(e){var t=this;(e=vu(e))||(e="NONE");var i=0,n=0,r=0;if(this.scene&&this.scene.remove(this.movieScreen),"AUTO"===e){if(this.player_.mediainfo&&this.player_.mediainfo.projection&&"AUTO"!==this.player_.mediainfo.projection){var a=vu(this.player_.mediainfo.projection);return this.changeProjection_(a)}return this.changeProjection_("NONE")}if("360"===e)this.movieGeometry=new po(256,32,32),this.movieMaterial=new en({map:this.videoTexture,overdraw:!0,side:b}),this.movieScreen=new on(this.movieGeometry,this.movieMaterial),this.movieScreen.position.set(i,n,r),this.movieScreen.scale.x=-1,this.movieScreen.quaternion.setFromAxisAngle({x:0,y:1,z:0},-Math.PI/2),this.scene.add(this.movieScreen);else if("360_LR"===e||"360_TB"===e){for(var o=new lo(256,32,32),s=o.faceVertexUvs[0],c=0;c<s.length;c++)for(var u=0;u<3;u++)"360_LR"===e?s[c][u].x*=.5:(s[c][u].y*=.5,s[c][u].y+=.5);this.movieGeometry=(new ki).fromGeometry(o),this.movieMaterial=new en({map:this.videoTexture,overdraw:!0,side:b}),this.movieScreen=new on(this.movieGeometry,this.movieMaterial),this.movieScreen.scale.x=-1,this.movieScreen.quaternion.setFromAxisAngle({x:0,y:1,z:0},-Math.PI/2),this.movieScreen.layers.set(1),this.scene.add(this.movieScreen),s=(o=new lo(256,32,32)).faceVertexUvs[0];for(var h=0;h<s.length;h++)for(var l=0;l<3;l++)"360_LR"===e?(s[h][l].x*=.5,s[h][l].x+=.5):s[h][l].y*=.5;this.movieGeometry=(new ki).fromGeometry(o),this.movieMaterial=new en({map:this.videoTexture,overdraw:!0,side:b}),this.movieScreen=new on(this.movieGeometry,this.movieMaterial),this.movieScreen.scale.x=-1,this.movieScreen.quaternion.setFromAxisAngle({x:0,y:1,z:0},-Math.PI/2),this.movieScreen.layers.set(2),this.scene.add(this.movieScreen)}else if("360_CUBE"===e){this.movieGeometry=new Fi(256,256,256),this.movieMaterial=new en({map:this.videoTexture,overdraw:!0,side:b});var d=[new Rt(0,.5),new Rt(.333,.5),new Rt(.333,1),new Rt(0,1)],p=[new Rt(.333,.5),new Rt(.666,.5),new Rt(.666,1),new Rt(.333,1)],f=[new Rt(.666,.5),new Rt(1,.5),new Rt(1,1),new Rt(.666,1)],g=[new Rt(0,0),new Rt(.333,0),new Rt(.333,.5),new Rt(0,.5)],m=[new Rt(.333,0),new Rt(.666,0),new Rt(.666,.5),new Rt(.333,.5)],M=[new Rt(.666,0),new Rt(1,0),new Rt(1,.5),new Rt(.666,.5)];this.movieGeometry.faceVertexUvs[0]=[],this.movieGeometry.faceVertexUvs[0][0]=[p[2],p[1],p[3]],this.movieGeometry.faceVertexUvs[0][1]=[p[1],p[0],p[3]],this.movieGeometry.faceVertexUvs[0][2]=[d[2],d[1],d[3]],this.movieGeometry.faceVertexUvs[0][3]=[d[1],d[0],d[3]],this.movieGeometry.faceVertexUvs[0][4]=[f[2],f[1],f[3]],this.movieGeometry.faceVertexUvs[0][5]=[f[1],f[0],f[3]],this.movieGeometry.faceVertexUvs[0][6]=[g[2],g[1],g[3]],this.movieGeometry.faceVertexUvs[0][7]=[g[1],g[0],g[3]],this.movieGeometry.faceVertexUvs[0][8]=[m[2],m[1],m[3]],this.movieGeometry.faceVertexUvs[0][9]=[m[1],m[0],m[3]],this.movieGeometry.faceVertexUvs[0][10]=[M[2],M[1],M[3]],this.movieGeometry.faceVertexUvs[0][11]=[M[1],M[0],M[3]],this.movieScreen=new on(this.movieGeometry,this.movieMaterial),this.movieScreen.position.set(i,n,r),this.movieScreen.rotation.y=-Math.PI,this.scene.add(this.movieScreen)}else if("180"===e){var y=new lo(256,32,32,Math.PI,Math.PI);y.scale(-1,1,1);for(var v=y.faceVertexUvs[0],A=0;A<v.length;A++)for(var w=0;w<3;w++)v[A][w].x*=.5;this.movieGeometry=(new ki).fromGeometry(y),this.movieMaterial=new en({map:this.videoTexture,overdraw:!0}),this.movieScreen=new on(this.movieGeometry,this.movieMaterial),this.movieScreen.layers.set(1),this.scene.add(this.movieScreen),(y=new lo(256,32,32,Math.PI,Math.PI)).scale(-1,1,1),v=y.faceVertexUvs[0];for(var x=0;x<v.length;x++)for(var E=0;E<3;E++)v[x][E].x*=.5,v[x][E].x+=.5;this.movieGeometry=(new ki).fromGeometry(y),this.movieMaterial=new en({map:this.videoTexture,overdraw:!0}),this.movieScreen=new on(this.movieGeometry,this.movieMaterial),this.movieScreen.layers.set(2),this.scene.add(this.movieScreen)}else if("EAC"===e||"EAC_LR"===e){var T=function(e,a){t.movieGeometry=new Fi(256,256,256),t.movieMaterial=new tn({overdraw:!0,side:b,uniforms:{mapped:{value:t.videoTexture},mapMatrix:{value:e},contCorrect:{value:2},faceWH:{value:new Rt(1/3,.5).applyMatrix3(a)},vidWH:{value:new Rt(t.videoTexture.image.videoWidth,t.videoTexture.image.videoHeight).applyMatrix3(a)}},vertexShader:"\nvarying vec2 vUv;\nuniform mat3 mapMatrix;\n\nvoid main() {\n vUv = (mapMatrix * vec3(uv, 1.)).xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.);\n}",fragmentShader:"\nvarying vec2 vUv;\nuniform sampler2D mapped;\nuniform vec2 faceWH;\nuniform vec2 vidWH;\nuniform float contCorrect;\n\nconst float PI = 3.1415926535897932384626433832795;\n\nvoid main() {\n vec2 corner = vUv - mod(vUv, faceWH) + vec2(0, contCorrect / vidWH.y);\n\n vec2 faceWHadj = faceWH - vec2(0, contCorrect * 2. / vidWH.y);\n\n vec2 p = (vUv - corner) / faceWHadj - .5;\n vec2 q = 2. / PI * atan(2. * p) + .5;\n\n vec2 eUv = corner + q * faceWHadj;\n\n gl_FragColor = texture2D(mapped, eUv);\n}"});for(var o=[new Rt(0,.5),new Rt(1/3,.5),new Rt(1/3,1),new Rt(0,1)],s=[new Rt(1/3,.5),new Rt(2/3,.5),new Rt(2/3,1),new Rt(1/3,1)],c=[new Rt(2/3,.5),new Rt(1,.5),new Rt(1,1),new Rt(2/3,1)],u=[new Rt(1/3,0),new Rt(1/3,.5),new Rt(0,.5),new Rt(0,0)],h=[new Rt(1/3,.5),new Rt(1/3,0),new Rt(2/3,0),new Rt(2/3,.5)],l=[new Rt(1,0),new Rt(1,.5),new Rt(2/3,.5),new Rt(2/3,0)],d=0,p=[o,s,c,u,h,l];d<p.length;d++){var f=p[d],g=t.videoTexture.image.videoHeight,m=1,M=0,y=f,v=Array.isArray(y),A=0;for(y=v?y:y[Symbol.iterator]();;){var w;if(v){if(A>=y.length)break;w=y[A++]}else{if((A=y.next()).done)break;w=A.value}var x=w;x.y<m&&(m=x.y),x.y>M&&(M=x.y)}var E=f,T=Array.isArray(E),N=0;for(E=T?E:E[Symbol.iterator]();;){var D;if(T){if(N>=E.length)break;D=E[N++]}else{if((N=E.next()).done)break;D=N.value}var L=D;Math.abs(L.y-m)<Number.EPSILON&&(L.y+=2/g),Math.abs(L.y-M)<Number.EPSILON&&(L.y-=2/g),L.x=L.x/g*(g-4)+2/g}}return t.movieGeometry.faceVertexUvs[0]=[],t.movieGeometry.faceVertexUvs[0][0]=[o[2],o[1],o[3]],t.movieGeometry.faceVertexUvs[0][1]=[o[1],o[0],o[3]],t.movieGeometry.faceVertexUvs[0][2]=[c[2],c[1],c[3]],t.movieGeometry.faceVertexUvs[0][3]=[c[1],c[0],c[3]],t.movieGeometry.faceVertexUvs[0][4]=[l[2],l[1],l[3]],t.movieGeometry.faceVertexUvs[0][5]=[l[1],l[0],l[3]],t.movieGeometry.faceVertexUvs[0][6]=[u[2],u[1],u[3]],t.movieGeometry.faceVertexUvs[0][7]=[u[1],u[0],u[3]],t.movieGeometry.faceVertexUvs[0][8]=[s[2],s[1],s[3]],t.movieGeometry.faceVertexUvs[0][9]=[s[1],s[0],s[3]],t.movieGeometry.faceVertexUvs[0][10]=[h[2],h[1],h[3]],t.movieGeometry.faceVertexUvs[0][11]=[h[1],h[0],h[3]],t.movieScreen=new on(t.movieGeometry,t.movieMaterial),t.movieScreen.position.set(i,n,r),t.movieScreen.rotation.y=-Math.PI,t.movieScreen};if("EAC"===e)this.scene.add(T(new kt,new kt));else{var N=(new kt).set(0,.5,0,1,0,0,0,0,1);T((new kt).set(0,-.5,.5,1,0,0,0,0,1),N),this.movieScreen.layers.set(1),this.scene.add(this.movieScreen),T((new kt).set(0,-.5,1,1,0,0,0,0,1),N),this.movieScreen.layers.set(2),this.scene.add(this.movieScreen)}}this.currentProjection_=e},s.triggerError_=function(e){if(this.videojsErrorsSupport_)this.player_.error(e);else{var i=t.createElement("div");i.innerHTML=Nu[e.code].message;var n=i.textContent||i.innerText||"";this.player_.error({code:e.code,message:n})}},s.log=function(){if(this.options_.debug){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(function(e){i.log("VR: ",e)})}},s.handleVrDisplayActivate_=function(){var t=this;this.vrDisplay&&this.vrDisplay.requestPresent([{source:this.renderedCanvas}]).then(function(){if(t.vrDisplay.cardboardUI_&&i.browser.IS_IOS){var n=[],r=function(e){for(var t=0;t<e.touches.length;t++)n.push(e.touches[t])},a=function(i){n.length&&(n.forEach(function(i){var n=new e.MouseEvent("click",{screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY});t.renderedCanvas.dispatchEvent(n)}),n=[])};t.renderedCanvas.addEventListener("touchstart",r),t.renderedCanvas.addEventListener("touchend",a),t.iosRevertTouchToClick_=function(){t.renderedCanvas.removeEventListener("touchstart",r),t.renderedCanvas.removeEventListener("touchend",a),t.iosRevertTouchToClick_=null}}})},s.handleVrDisplayDeactivate_=function(){this.vrDisplay&&this.vrDisplay.isPresenting&&(this.iosRevertTouchToClick_&&this.iosRevertTouchToClick_(),this.vrDisplay.exitPresent())},s.requestAnimationFrame=function(e){return this.vrDisplay?this.vrDisplay.requestAnimationFrame(e):this.player_.requestAnimationFrame(e)},s.cancelAnimationFrame=function(e){return this.vrDisplay?this.vrDisplay.cancelAnimationFrame(e):this.player_.cancelAnimationFrame(e)},s.togglePlay_=function(){this.player_.paused()?this.player_.play():this.player_.pause()},s.animate_=function(){if(this.initialized_){if(this.getVideoEl_().readyState===this.getVideoEl_().HAVE_ENOUGH_DATA&&this.videoTexture&&(this.videoTexture.needsUpdate=!0),this.controls3d.update(),this.omniController&&this.omniController.update(this.camera),this.effect.render(this.scene,this.camera),e.navigator.getGamepads)for(var t=e.navigator.getGamepads(),i=0;i<t.length;++i){var n=t[i];if(n&&n.timestamp&&n.timestamp!==this.prevTimestamps_[i])for(var r=0;r<n.buttons.length;++r)if(n.buttons[r].pressed){this.togglePlay_(),this.prevTimestamps_[i]=n.timestamp;break}}this.camera.getWorldDirection(this.cameraVector),this.animationFrameId_=this.requestAnimationFrame(this.animate_)}},s.handleResize_=function(){var e=this.player_.currentWidth(),t=this.player_.currentHeight();this.effect.setSize(e,t,!1),this.camera.aspect=e/t,this.camera.updateProjectionMatrix()},s.setProjection=function(e){vu(e)?(this.currentProjection_=e,this.defaultProjection_=e):i.log.error("videojs-vr: please pass a valid projection "+yu.join(", "))},s.init=function(){var t=this;if(this.reset(),this.camera=new Vr(75,this.player_.currentWidth()/this.player_.currentHeight(),1,1e3),this.cameraVector=new Bt,"360_LR"!==this.currentProjection_&&"360_TB"!==this.currentProjection_&&"180"!==this.currentProjection_&&"EAC_LR"!==this.currentProjection_||this.camera.layers.enable(1),this.scene=new Kr,this.videoTexture=new da(this.getVideoEl_()),this.videoTexture.generateMipmaps=!1,this.videoTexture.minFilter=_e,this.videoTexture.magFilter=_e,this.videoTexture.format=He,this.changeProjection_(this.currentProjection_),"NONE"===this.currentProjection_)return this.log("Projection is NONE, dont init"),void this.reset();this.player_.removeChild("BigPlayButton"),this.player_.addChild("BigVrPlayButton",{},this.bigPlayButtonIndex_),this.player_.bigPlayButton=this.player_.getChild("BigVrPlayButton"),(this.options_.forceCardboard||i.browser.IS_ANDROID||i.browser.IS_IOS)&&this.addCardboardButton_(),i.browser.IS_IOS&&this.player_.controlBar.fullscreenToggle.hide(),this.camera.position.set(0,0,0),this.renderer=new Zr({devicePixelRatio:e.devicePixelRatio,alpha:!1,clearColor:16777215,antialias:!0});var n=this.renderer.getContext("webgl"),r=n.texImage2D;n.texImage2D=function(){try{for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];return r.apply(n,i)}catch(e){throw t.reset(),t.player_.pause(),t.triggerError_({code:"web-vr-hls-cors-not-supported",dismiss:!1}),new Error(e)}},this.renderer.setSize(this.player_.currentWidth(),this.player_.currentHeight(),!1),this.effect=new du(this.renderer),this.effect.setSize(this.player_.currentWidth(),this.player_.currentHeight(),!1),this.vrDisplay=null,this.prevTimestamps_=[],this.renderedCanvas=this.renderer.domElement,this.renderedCanvas.setAttribute("style","width: 100%; height: 100%; position: absolute; top:0;");var a=this.getVideoEl_().style;if(this.player_.el().insertBefore(this.renderedCanvas,this.player_.el().firstChild),a.zIndex="-1",a.opacity="0",e.navigator.getVRDisplays?(this.log("is supported, getting vr displays"),e.navigator.getVRDisplays().then(function(e){if(e.length>0&&(t.log("Displays found",e),t.vrDisplay=e[0],t.vrDisplay.isPolyfilled||(t.log("Real HMD found using VRControls",t.vrDisplay),t.addCardboardButton_(),t.controls3d=new lu(t.camera))),!t.controls3d){t.log("no HMD found Using Orbit & Orientation Controls");var n={camera:t.camera,canvas:t.renderedCanvas,halfView:"180"===t.currentProjection_,orientation:i.browser.IS_IOS||i.browser.IS_ANDROID||!1};!1===t.options_.motionControls&&(n.orientation=!1),t.controls3d=new mu(n),t.canvasPlayerControls=new Au(t.player_,t.renderedCanvas)}t.animationFrameId_=t.requestAnimationFrame(t.animate_)})):e.navigator.getVRDevices?this.triggerError_({code:"web-vr-out-of-date",dismiss:!1}):this.triggerError_({code:"web-vr-not-supported",dismiss:!1}),this.options_.omnitone){var o=dc.getContext();this.omniController=new wu(o,this.options_.omnitone,this.getVideoEl_(),this.options_.omnitoneOptions),this.omniController.one("audiocontext-suspended",function(){t.player.pause(),t.player.one("playing",function(){o.resume()})})}this.on(this.player_,"fullscreenchange",this.handleResize_),e.addEventListener("vrdisplaypresentchange",this.handleResize_,!0),e.addEventListener("resize",this.handleResize_,!0),e.addEventListener("vrdisplayactivate",this.handleVrDisplayActivate_,!0),e.addEventListener("vrdisplaydeactivate",this.handleVrDisplayDeactivate_,!0),this.initialized_=!0,this.trigger("initialized")},s.addCardboardButton_=function(){this.player_.controlBar.getChild("CardboardButton")||this.player_.controlBar.addChild("CardboardButton",{})},s.getVideoEl_=function(){return this.player_.el().getElementsByTagName("video")[0]},s.reset=function(){if(this.initialized_){this.omniController&&(this.omniController.off("audiocontext-suspended"),this.omniController.dispose(),this.omniController=void 0),this.controls3d&&(this.controls3d.dispose(),this.controls3d=null),this.canvasPlayerControls&&(this.canvasPlayerControls.dispose(),this.canvasPlayerControls=null),this.effect&&(this.effect.dispose(),this.effect=null),e.removeEventListener("resize",this.handleResize_,!0),e.removeEventListener("vrdisplaypresentchange",this.handleResize_,!0),e.removeEventListener("vrdisplayactivate",this.handleVrDisplayActivate_,!0),e.removeEventListener("vrdisplaydeactivate",this.handleVrDisplayDeactivate_,!0),this.player_.getChild("BigPlayButton")||this.player_.addChild("BigPlayButton",{},this.bigPlayButtonIndex_),this.player_.getChild("BigVrPlayButton")&&this.player_.removeChild("BigVrPlayButton"),this.player_.getChild("CardboardButton")&&this.player_.controlBar.removeChild("CardboardButton"),i.browser.IS_IOS&&this.player_.controlBar.fullscreenToggle.show();var t=this.getVideoEl_().style;t.zIndex="",t.opacity="",this.currentProjection_=this.defaultProjection_,this.iosRevertTouchToClick_&&this.iosRevertTouchToClick_(),this.renderedCanvas&&this.renderedCanvas.parentNode.removeChild(this.renderedCanvas),this.animationFrameId_&&this.cancelAnimationFrame(this.animationFrameId_),this.initialized_=!1}},s.dispose=function(){a.prototype.dispose.call(this),this.reset()},s.polyfillVersion=function(){return c.version},o}(Du);return bu.prototype.setTimeout=Lu.prototype.setTimeout,bu.prototype.clearTimeout=Lu.prototype.clearTimeout,bu.VERSION="1.7.1",i.registerPlugin("vr",bu),bu});
|