13 lines
564 KiB
JavaScript
13 lines
564 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(t,e,n){"use strict";function r(){}n.r(e),n.d(e,"WebGLRenderTargetCube",function(){return Bn}),n.d(e,"WebGLRenderTarget",function(){return Dn}),n.d(e,"WebGLRenderer",function(){return ko}),n.d(e,"ShaderLib",function(){return $n}),n.d(e,"UniformsLib",function(){return Kn}),n.d(e,"UniformsUtils",function(){return Xn}),n.d(e,"ShaderChunk",function(){return Hn}),n.d(e,"FogExp2",function(){return Vo}),n.d(e,"Fog",function(){return jo}),n.d(e,"Scene",function(){return Wo}),n.d(e,"Sprite",function(){return Jo}),n.d(e,"LOD",function(){return Zo}),n.d(e,"SkinnedMesh",function(){return Qo}),n.d(e,"Skeleton",function(){return Ko}),n.d(e,"Bone",function(){return $o}),n.d(e,"Mesh",function(){return Gi}),n.d(e,"LineSegments",function(){return ns}),n.d(e,"LineLoop",function(){return rs}),n.d(e,"Line",function(){return es}),n.d(e,"Points",function(){return as}),n.d(e,"Group",function(){return vo}),n.d(e,"VideoTexture",function(){return os}),n.d(e,"DataTexture",function(){return Nn}),n.d(e,"DataTexture3D",function(){return Ki}),n.d(e,"CompressedTexture",function(){return ss}),n.d(e,"CubeTexture",function(){return Qi}),n.d(e,"CanvasTexture",function(){return cs}),n.d(e,"DepthTexture",function(){return us}),n.d(e,"Texture",function(){return On}),n.d(e,"AnimationLoader",function(){return $c}),n.d(e,"CompressedTextureLoader",function(){return tu}),n.d(e,"DataTextureLoader",function(){return eu}),n.d(e,"CubeTextureLoader",function(){return ru}),n.d(e,"TextureLoader",function(){return iu}),n.d(e,"ObjectLoader",function(){return Vu}),n.d(e,"MaterialLoader",function(){return Gu}),n.d(e,"BufferGeometryLoader",function(){return Hu}),n.d(e,"DefaultLoadingManager",function(){return Zc}),n.d(e,"LoadingManager",function(){return Jc}),n.d(e,"ImageLoader",function(){return nu}),n.d(e,"ImageBitmapLoader",function(){return Ku}),n.d(e,"FontLoader",function(){return nh}),n.d(e,"FileLoader",function(){return Kc}),n.d(e,"Loader",function(){return rh}),n.d(e,"LoaderUtils",function(){return Fu}),n.d(e,"Cache",function(){return Yc}),n.d(e,"AudioLoader",function(){return Eh}),n.d(e,"SpotLightShadow",function(){return Ru}),n.d(e,"SpotLight",function(){return Ou}),n.d(e,"PointLight",function(){return Iu}),n.d(e,"RectAreaLight",function(){return Uu}),n.d(e,"HemisphereLight",function(){return Pu}),n.d(e,"DirectionalLightShadow",function(){return Bu}),n.d(e,"DirectionalLight",function(){return Nu}),n.d(e,"AmbientLight",function(){return zu}),n.d(e,"LightShadow",function(){return Cu}),n.d(e,"Light",function(){return Lu}),n.d(e,"StereoCamera",function(){return Sh}),n.d(e,"PerspectiveCamera",function(){return xo}),n.d(e,"OrthographicCamera",function(){return Du}),n.d(e,"CubeCamera",function(){return Th}),n.d(e,"ArrayCamera",function(){return bo}),n.d(e,"Camera",function(){return yo}),n.d(e,"AudioListener",function(){return Lh}),n.d(e,"PositionalAudio",function(){return Ch}),n.d(e,"AudioContext",function(){return Mh}),n.d(e,"AudioAnalyser",function(){return Rh}),n.d(e,"Audio",function(){return Ph}),n.d(e,"VectorKeyframeTrack",function(){return Wc}),n.d(e,"StringKeyframeTrack",function(){return jc}),n.d(e,"QuaternionKeyframeTrack",function(){return Vc}),n.d(e,"NumberKeyframeTrack",function(){return Hc}),n.d(e,"ColorKeyframeTrack",function(){return Fc}),n.d(e,"BooleanKeyframeTrack",function(){return Gc}),n.d(e,"PropertyMixer",function(){return Oh}),n.d(e,"PropertyBinding",function(){return ml}),n.d(e,"KeyframeTrack",function(){return Uc}),n.d(e,"AnimationUtils",function(){return Ic}),n.d(e,"AnimationObjectGroup",function(){return gl}),n.d(e,"AnimationMixer",function(){return yl}),n.d(e,"AnimationClip",function(){return qc}),n.d(e,"Uniform",function(){return xl}),n.d(e,"InstancedBufferGeometry",function(){return bl}),n.d(e,"BufferGeometry",function(){return ri}),n.d(e,"Geometry",function(){return Ir}),n.d(e,"InterleavedBufferAttribute",function(){return Xo}),n.d(e,"InstancedInterleavedBuffer",function(){return wl}),n.d(e,"InterleavedBuffer",function(){return qo}),n.d(e,"InstancedBufferAttribute",function(){return _l}),n.d(e,"Face3",function(){return nr}),n.d(e,"Object3D",function(){return Er}),n.d(e,"Raycaster",function(){return Ml}),n.d(e,"Layers",function(){return ir}),n.d(e,"EventDispatcher",function(){return r}),n.d(e,"Clock",function(){return Ah}),n.d(e,"QuaternionLinearInterpolant",function(){return kc}),n.d(e,"LinearInterpolant",function(){return Nc}),n.d(e,"DiscreteInterpolant",function(){return zc}),n.d(e,"CubicInterpolant",function(){return Bc}),n.d(e,"Interpolant",function(){return Dc}),n.d(e,"Triangle",function(){return zi}),n.d(e,"Math",function(){return cn}),n.d(e,"Spherical",function(){return Tl}),n.d(e,"Cylindrical",function(){return Al}),n.d(e,"Plane",function(){return Gn}),n.d(e,"Frustum",function(){return Fn}),n.d(e,"Sphere",function(){return Un}),n.d(e,"Ray",function(){return Ni}),n.d(e,"Matrix4",function(){return hn}),n.d(e,"Matrix3",function(){return pn}),n.d(e,"Box3",function(){return zn}),n.d(e,"Box2",function(){return Ll}),n.d(e,"Line3",function(){return Pl}),n.d(e,"Euler",function(){return rr}),n.d(e,"Vector4",function(){return In}),n.d(e,"Vector3",function(){return dn}),n.d(e,"Vector2",function(){return un}),n.d(e,"Quaternion",function(){return ln}),n.d(e,"Color",function(){return Jn}),n.d(e,"ImmediateRenderObject",function(){return Cl}),n.d(e,"VertexNormalsHelper",function(){return Rl}),n.d(e,"SpotLightHelper",function(){return Ol}),n.d(e,"SkeletonHelper",function(){return Il}),n.d(e,"PointLightHelper",function(){return Dl}),n.d(e,"RectAreaLightHelper",function(){return Bl}),n.d(e,"HemisphereLightHelper",function(){return Nl}),n.d(e,"GridHelper",function(){return zl}),n.d(e,"PolarGridHelper",function(){return Ul}),n.d(e,"FaceNormalsHelper",function(){return Gl}),n.d(e,"DirectionalLightHelper",function(){return Fl}),n.d(e,"CameraHelper",function(){return Hl}),n.d(e,"BoxHelper",function(){return kl}),n.d(e,"Box3Helper",function(){return Vl}),n.d(e,"PlaneHelper",function(){return jl}),n.d(e,"ArrowHelper",function(){return Wl}),n.d(e,"AxesHelper",function(){return ql}),n.d(e,"Shape",function(){return Au}),n.d(e,"Path",function(){return Tu}),n.d(e,"ShapePath",function(){return $u}),n.d(e,"Font",function(){return th}),n.d(e,"CurvePath",function(){return Su}),n.d(e,"Curve",function(){return au}),n.d(e,"ImageUtils",function(){return Cn}),n.d(e,"ShapeUtils",function(){return Zs}),n.d(e,"WebGLUtils",function(){return go}),n.d(e,"WireframeGeometry",function(){return hs}),n.d(e,"ParametricGeometry",function(){return ls}),n.d(e,"ParametricBufferGeometry",function(){return ds}),n.d(e,"TetrahedronGeometry",function(){return ms}),n.d(e,"TetrahedronBufferGeometry",function(){return gs}),n.d(e,"OctahedronGeometry",function(){return vs}),n.d(e,"OctahedronBufferGeometry",function(){return ys}),n.d(e,"IcosahedronGeometry",function(){return xs}),n.d(e,"IcosahedronBufferGeometry",function(){return bs}),n.d(e,"DodecahedronGeometry",function(){return ws}),n.d(e,"DodecahedronBufferGeometry",function(){return _s}),n.d(e,"PolyhedronGeometry",function(){return ps}),n.d(e,"PolyhedronBufferGeometry",function(){return fs}),n.d(e,"TubeGeometry",function(){return Ms}),n.d(e,"TubeBufferGeometry",function(){return Es}),n.d(e,"TorusKnotGeometry",function(){return Ss}),n.d(e,"TorusKnotBufferGeometry",function(){return Ts}),n.d(e,"TorusGeometry",function(){return As}),n.d(e,"TorusBufferGeometry",function(){return Ls}),n.d(e,"TextGeometry",function(){return rc}),n.d(e,"TextBufferGeometry",function(){return ic}),n.d(e,"SphereGeometry",function(){return ac}),n.d(e,"SphereBufferGeometry",function(){return oc}),n.d(e,"RingGeometry",function(){return sc}),n.d(e,"RingBufferGeometry",function(){return cc}),n.d(e,"PlaneGeometry",function(){return oi}),n.d(e,"PlaneBufferGeometry",function(){return si}),n.d(e,"LatheGeometry",function(){return uc}),n.d(e,"LatheBufferGeometry",function(){return hc}),n.d(e,"ShapeGeometry",function(){return lc}),n.d(e,"ShapeBufferGeometry",function(){return dc}),n.d(e,"ExtrudeGeometry",function(){return $s}),n.d(e,"ExtrudeBufferGeometry",function(){return tc}),n.d(e,"EdgesGeometry",function(){return fc}),n.d(e,"ConeGeometry",function(){return vc}),n.d(e,"ConeBufferGeometry",function(){return yc}),n.d(e,"CylinderGeometry",function(){return mc}),n.d(e,"CylinderBufferGeometry",function(){return gc}),n.d(e,"CircleGeometry",function(){return xc}),n.d(e,"CircleBufferGeometry",function(){return bc}),n.d(e,"BoxGeometry",function(){return ii}),n.d(e,"BoxBufferGeometry",function(){return ai}),n.d(e,"ShadowMaterial",function(){return _c}),n.d(e,"SpriteMaterial",function(){return Yo}),n.d(e,"RawShaderMaterial",function(){return Mc}),n.d(e,"ShaderMaterial",function(){return Bi}),n.d(e,"PointsMaterial",function(){return is}),n.d(e,"MeshPhysicalMaterial",function(){return Sc}),n.d(e,"MeshStandardMaterial",function(){return Ec}),n.d(e,"MeshPhongMaterial",function(){return Tc}),n.d(e,"MeshToonMaterial",function(){return Ac}),n.d(e,"MeshNormalMaterial",function(){return Lc}),n.d(e,"MeshLambertMaterial",function(){return Pc}),n.d(e,"MeshDepthMaterial",function(){return ho}),n.d(e,"MeshDistanceMaterial",function(){return lo}),n.d(e,"MeshBasicMaterial",function(){return Ui}),n.d(e,"MeshMatcapMaterial",function(){return Cc}),n.d(e,"LineDashedMaterial",function(){return Rc}),n.d(e,"LineBasicMaterial",function(){return ts}),n.d(e,"Material",function(){return Di}),n.d(e,"Float64BufferAttribute",function(){return Vr}),n.d(e,"Float32BufferAttribute",function(){return kr}),n.d(e,"Uint32BufferAttribute",function(){return Hr}),n.d(e,"Int32BufferAttribute",function(){return Fr}),n.d(e,"Uint16BufferAttribute",function(){return Gr}),n.d(e,"Int16BufferAttribute",function(){return Ur}),n.d(e,"Uint8ClampedBufferAttribute",function(){return zr}),n.d(e,"Uint8BufferAttribute",function(){return Nr}),n.d(e,"Int8BufferAttribute",function(){return Br}),n.d(e,"BufferAttribute",function(){return Dr}),n.d(e,"ArcCurve",function(){return su}),n.d(e,"CatmullRomCurve3",function(){return pu}),n.d(e,"CubicBezierCurve",function(){return vu}),n.d(e,"CubicBezierCurve3",function(){return yu}),n.d(e,"EllipseCurve",function(){return ou}),n.d(e,"LineCurve",function(){return xu}),n.d(e,"LineCurve3",function(){return bu}),n.d(e,"QuadraticBezierCurve",function(){return wu}),n.d(e,"QuadraticBezierCurve3",function(){return _u}),n.d(e,"SplineCurve",function(){return Mu}),n.d(e,"REVISION",function(){return _t}),n.d(e,"MOUSE",function(){return T}),n.d(e,"CullFaceNone",function(){return q}),n.d(e,"CullFaceBack",function(){return X}),n.d(e,"CullFaceFront",function(){return Y}),n.d(e,"CullFaceFrontBack",function(){return A}),n.d(e,"FrontFaceDirectionCW",function(){return L}),n.d(e,"FrontFaceDirectionCCW",function(){return P}),n.d(e,"BasicShadowMap",function(){return C}),n.d(e,"PCFShadowMap",function(){return G}),n.d(e,"PCFSoftShadowMap",function(){return F}),n.d(e,"FrontSide",function(){return B}),n.d(e,"BackSide",function(){return Mt}),n.d(e,"DoubleSide",function(){return tt}),n.d(e,"FlatShading",function(){return R}),n.d(e,"SmoothShading",function(){return O}),n.d(e,"NoColors",function(){return I}),n.d(e,"FaceColors",function(){return D}),n.d(e,"VertexColors",function(){return N}),n.d(e,"NoBlending",function(){return J}),n.d(e,"NormalBlending",function(){return Z}),n.d(e,"AdditiveBlending",function(){return Q}),n.d(e,"SubtractiveBlending",function(){return K}),n.d(e,"MultiplyBlending",function(){return $}),n.d(e,"CustomBlending",function(){return et}),n.d(e,"AddEquation",function(){return nt}),n.d(e,"SubtractEquation",function(){return z}),n.d(e,"ReverseSubtractEquation",function(){return U}),n.d(e,"MinEquation",function(){return H}),n.d(e,"MaxEquation",function(){return k}),n.d(e,"ZeroFactor",function(){return V}),n.d(e,"OneFactor",function(){return j}),n.d(e,"SrcColorFactor",function(){return W}),n.d(e,"OneMinusSrcColorFactor",function(){return rt}),n.d(e,"SrcAlphaFactor",function(){return it}),n.d(e,"OneMinusSrcAlphaFactor",function(){return at}),n.d(e,"DstAlphaFactor",function(){return ot}),n.d(e,"OneMinusDstAlphaFactor",function(){return st}),n.d(e,"DstColorFactor",function(){return ct}),n.d(e,"OneMinusDstColorFactor",function(){return ut}),n.d(e,"SrcAlphaSaturateFactor",function(){return ht}),n.d(e,"NeverDepth",function(){return lt}),n.d(e,"AlwaysDepth",function(){return dt}),n.d(e,"LessDepth",function(){return pt}),n.d(e,"LessEqualDepth",function(){return ft}),n.d(e,"EqualDepth",function(){return mt}),n.d(e,"GreaterEqualDepth",function(){return gt}),n.d(e,"GreaterDepth",function(){return vt}),n.d(e,"NotEqualDepth",function(){return yt}),n.d(e,"MultiplyOperation",function(){return xt}),n.d(e,"MixOperation",function(){return bt}),n.d(e,"AddOperation",function(){return wt}),n.d(e,"NoToneMapping",function(){return Et}),n.d(e,"LinearToneMapping",function(){return St}),n.d(e,"ReinhardToneMapping",function(){return Tt}),n.d(e,"Uncharted2ToneMapping",function(){return At}),n.d(e,"CineonToneMapping",function(){return Lt}),n.d(e,"ACESFilmicToneMapping",function(){return Pt}),n.d(e,"UVMapping",function(){return Ct}),n.d(e,"CubeReflectionMapping",function(){return Rt}),n.d(e,"CubeRefractionMapping",function(){return Ot}),n.d(e,"EquirectangularReflectionMapping",function(){return It}),n.d(e,"EquirectangularRefractionMapping",function(){return Dt}),n.d(e,"SphericalReflectionMapping",function(){return Bt}),n.d(e,"CubeUVReflectionMapping",function(){return Nt}),n.d(e,"CubeUVRefractionMapping",function(){return zt}),n.d(e,"RepeatWrapping",function(){return Ut}),n.d(e,"ClampToEdgeWrapping",function(){return Gt}),n.d(e,"MirroredRepeatWrapping",function(){return Ft}),n.d(e,"NearestFilter",function(){return Ht}),n.d(e,"NearestMipMapNearestFilter",function(){return kt}),n.d(e,"NearestMipMapLinearFilter",function(){return Vt}),n.d(e,"LinearFilter",function(){return jt}),n.d(e,"LinearMipMapNearestFilter",function(){return Wt}),n.d(e,"LinearMipMapLinearFilter",function(){return qt}),n.d(e,"UnsignedByteType",function(){return Xt}),n.d(e,"ByteType",function(){return Yt}),n.d(e,"ShortType",function(){return Jt}),n.d(e,"UnsignedShortType",function(){return Zt}),n.d(e,"IntType",function(){return Qt}),n.d(e,"UnsignedIntType",function(){return Kt}),n.d(e,"FloatType",function(){return $t}),n.d(e,"HalfFloatType",function(){return te}),n.d(e,"UnsignedShort4444Type",function(){return ee}),n.d(e,"UnsignedShort5551Type",function(){return ne}),n.d(e,"UnsignedShort565Type",function(){return re}),n.d(e,"UnsignedInt248Type",function(){return ie}),n.d(e,"AlphaFormat",function(){return ae}),n.d(e,"RGBFormat",function(){return oe}),n.d(e,"RGBAFormat",function(){return se}),n.d(e,"LuminanceFormat",function(){return ce}),n.d(e,"LuminanceAlphaFormat",function(){return ue}),n.d(e,"RGBEFormat",function(){return he}),n.d(e,"DepthFormat",function(){return le}),n.d(e,"DepthStencilFormat",function(){return de}),n.d(e,"RedFormat",function(){return pe}),n.d(e,"RGB_S3TC_DXT1_Format",function(){return fe}),n.d(e,"RGBA_S3TC_DXT1_Format",function(){return me}),n.d(e,"RGBA_S3TC_DXT3_Format",function(){return ge}),n.d(e,"RGBA_S3TC_DXT5_Format",function(){return ve}),n.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return ye}),n.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return xe}),n.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return be}),n.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return we}),n.d(e,"RGB_ETC1_Format",function(){return _e}),n.d(e,"RGBA_ASTC_4x4_Format",function(){return Me}),n.d(e,"RGBA_ASTC_5x4_Format",function(){return Ee}),n.d(e,"RGBA_ASTC_5x5_Format",function(){return Se}),n.d(e,"RGBA_ASTC_6x5_Format",function(){return Te}),n.d(e,"RGBA_ASTC_6x6_Format",function(){return Ae}),n.d(e,"RGBA_ASTC_8x5_Format",function(){return Le}),n.d(e,"RGBA_ASTC_8x6_Format",function(){return Pe}),n.d(e,"RGBA_ASTC_8x8_Format",function(){return Ce}),n.d(e,"RGBA_ASTC_10x5_Format",function(){return Re}),n.d(e,"RGBA_ASTC_10x6_Format",function(){return Oe}),n.d(e,"RGBA_ASTC_10x8_Format",function(){return Ie}),n.d(e,"RGBA_ASTC_10x10_Format",function(){return De}),n.d(e,"RGBA_ASTC_12x10_Format",function(){return Be}),n.d(e,"RGBA_ASTC_12x12_Format",function(){return Ne}),n.d(e,"LoopOnce",function(){return ze}),n.d(e,"LoopRepeat",function(){return Ue}),n.d(e,"LoopPingPong",function(){return Ge}),n.d(e,"InterpolateDiscrete",function(){return Fe}),n.d(e,"InterpolateLinear",function(){return He}),n.d(e,"InterpolateSmooth",function(){return ke}),n.d(e,"ZeroCurvatureEnding",function(){return Ve}),n.d(e,"ZeroSlopeEnding",function(){return je}),n.d(e,"WrapAroundEnding",function(){return We}),n.d(e,"TrianglesDrawMode",function(){return qe}),n.d(e,"TriangleStripDrawMode",function(){return Xe}),n.d(e,"TriangleFanDrawMode",function(){return Ye}),n.d(e,"LinearEncoding",function(){return Je}),n.d(e,"sRGBEncoding",function(){return Ze}),n.d(e,"GammaEncoding",function(){return Qe}),n.d(e,"RGBEEncoding",function(){return Ke}),n.d(e,"LogLuvEncoding",function(){return $e}),n.d(e,"RGBM7Encoding",function(){return tn}),n.d(e,"RGBM16Encoding",function(){return en}),n.d(e,"RGBDEncoding",function(){return nn}),n.d(e,"BasicDepthPacking",function(){return rn}),n.d(e,"RGBADepthPacking",function(){return an}),n.d(e,"TangentSpaceNormalMap",function(){return on}),n.d(e,"ObjectSpaceNormalMap",function(){return sn}),n.d(e,"CubeGeometry",function(){return ii}),n.d(e,"Face4",function(){return Xl}),n.d(e,"LineStrip",function(){return Jl}),n.d(e,"LinePieces",function(){return Zl}),n.d(e,"MeshFaceMaterial",function(){return Ql}),n.d(e,"MultiMaterial",function(){return Kl}),n.d(e,"PointCloud",function(){return $l}),n.d(e,"Particle",function(){return td}),n.d(e,"ParticleSystem",function(){return ed}),n.d(e,"PointCloudMaterial",function(){return nd}),n.d(e,"ParticleBasicMaterial",function(){return rd}),n.d(e,"ParticleSystemMaterial",function(){return id}),n.d(e,"Vertex",function(){return ad}),n.d(e,"DynamicBufferAttribute",function(){return od}),n.d(e,"Int8Attribute",function(){return sd}),n.d(e,"Uint8Attribute",function(){return cd}),n.d(e,"Uint8ClampedAttribute",function(){return ud}),n.d(e,"Int16Attribute",function(){return hd}),n.d(e,"Uint16Attribute",function(){return ld}),n.d(e,"Int32Attribute",function(){return dd}),n.d(e,"Uint32Attribute",function(){return pd}),n.d(e,"Float32Attribute",function(){return fd}),n.d(e,"Float64Attribute",function(){return md}),n.d(e,"ClosedSplineCurve3",function(){return gd}),n.d(e,"SplineCurve3",function(){return vd}),n.d(e,"Spline",function(){return yd}),n.d(e,"AxisHelper",function(){return xd}),n.d(e,"BoundingBoxHelper",function(){return bd}),n.d(e,"EdgesHelper",function(){return wd}),n.d(e,"WireframeHelper",function(){return _d}),n.d(e,"XHRLoader",function(){return Md}),n.d(e,"BinaryTextureLoader",function(){return Ed}),n.d(e,"GeometryUtils",function(){return Sd}),n.d(e,"Projector",function(){return Td}),n.d(e,"CanvasRenderer",function(){return Ad}),n.d(e,"JSONLoader",function(){return Ld}),n.d(e,"SceneUtils",function(){return Pd}),n.d(e,"LensFlare",function(){return Cd}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),"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(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}),Object.assign(r.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,t)}}}});var i,a,h,l,o,s,c,u,d,p,f,m,g,v,y,x,b,w,_,M,E,S,_t="100",T={LEFT:0,MIDDLE:1,RIGHT:2},q=0,X=1,Y=2,A=3,L=0,P=1,C=0,G=1,F=2,B=0,Mt=1,tt=2,R=1,O=2,I=0,D=1,N=2,J=0,Z=1,Q=2,K=3,$=4,et=5,nt=100,z=101,U=102,H=103,k=104,V=200,j=201,W=202,rt=203,it=204,at=205,ot=206,st=207,ct=208,ut=209,ht=210,lt=0,dt=1,pt=2,ft=3,mt=4,gt=5,vt=6,yt=7,xt=0,bt=1,wt=2,Et=0,St=1,Tt=2,At=3,Lt=4,Pt=5,Ct=300,Rt=301,Ot=302,It=303,Dt=304,Bt=305,Nt=306,zt=307,Ut=1e3,Gt=1001,Ft=1002,Ht=1003,kt=1004,Vt=1005,jt=1006,Wt=1007,qt=1008,Xt=1009,Yt=1010,Jt=1011,Zt=1012,Qt=1013,Kt=1014,$t=1015,te=1016,ee=1017,ne=1018,re=1019,ie=1020,ae=1021,oe=1022,se=1023,ce=1024,ue=1025,he=se,le=1026,de=1027,pe=1028,fe=33776,me=33777,ge=33778,ve=33779,ye=35840,xe=35841,be=35842,we=35843,_e=36196,Me=37808,Ee=37809,Se=37810,Te=37811,Ae=37812,Le=37813,Pe=37814,Ce=37815,Re=37816,Oe=37817,Ie=37818,De=37819,Be=37820,Ne=37821,ze=2200,Ue=2201,Ge=2202,Fe=2300,He=2301,ke=2302,Ve=2400,je=2401,We=2402,qe=0,Xe=1,Ye=2,Je=3e3,Ze=3001,Qe=3007,Ke=3002,$e=3003,tn=3004,en=3005,nn=3006,rn=3200,an=3201,on=0,sn=1,cn={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var i=[],t=0;t<256;t++)i[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(i[255&t]+i[t>>8&255]+i[t>>16&255]+i[t>>24&255]+"-"+i[255&e]+i[e>>8&255]+"-"+i[e>>16&15|64]+i[e>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&r]+i[r>>8&255]+i[r>>16&255]+i[r>>24&255]).toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*cn.DEG2RAD},radToDeg:function(t){return t*cn.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function un(t,e){this.x=t||0,this.y=e||0}function hn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function ln(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}function dn(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function pn(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(un.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(un.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:(i=new un,a=new un,function(t,e){return i.set(t,t),a.set(e,e),this.clamp(i,a)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},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(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},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 t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this}}),Object.assign(hn.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,a,o,s,c,u,h,l,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=u,g[10]=h,g[14]=l,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 hn).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:(f=new dn,function(t){var e=this.elements,n=t.elements,r=1/f.setFromMatrixColumn(t,0).length(),i=1/f.setFromMatrixColumn(t,1).length(),a=1/f.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),h=Math.sin(i);if("XYZ"===t.order){var l=a*u,d=a*h,p=o*u,f=o*h;e[0]=s*u,e[4]=-s*h,e[8]=c,e[1]=d+p*c,e[5]=l-f*c,e[9]=-o*s,e[2]=f-l*c,e[6]=p+d*c,e[10]=a*s}else if("YXZ"===t.order){var m=s*u,g=s*h,v=c*u,y=c*h;e[0]=m+y*o,e[4]=v*o-g,e[8]=a*c,e[1]=a*h,e[5]=a*u,e[9]=-o,e[2]=g*o-v,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){m=s*u,g=s*h,v=c*u,y=c*h;e[0]=m-y*o,e[4]=-a*h,e[8]=v+g*o,e[1]=g+v*o,e[5]=a*u,e[9]=y-m*o,e[2]=-a*c,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){l=a*u,d=a*h,p=o*u,f=o*h;e[0]=s*u,e[4]=p*c-d,e[8]=l*c+f,e[1]=s*h,e[5]=f*c+l,e[9]=d*c-p,e[2]=-c,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var x=a*s,b=a*c,w=o*s,_=o*c;e[0]=s*u,e[4]=_-x*h,e[8]=w*h+b,e[1]=h,e[5]=a*u,e[9]=-o*u,e[2]=-c*u,e[6]=b*h+w,e[10]=x-_*h}else if("XZY"===t.order){x=a*s,b=a*c,w=o*s,_=o*c;e[0]=s*u,e[4]=-h,e[8]=c*u,e[1]=x*h+_,e[5]=a*u,e[9]=b*h-w,e[2]=w*h-b,e[6]=o*u,e[10]=_*h+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:(d=new dn(0,0,0),p=new dn(1,1,1),function(t){return this.compose(d,t,p)}),lookAt:(s=new dn,c=new dn,u=new dn,function(t,e,n){var r=this.elements;return u.subVectors(t,e),0===u.lengthSq()&&(u.z=1),u.normalize(),s.crossVectors(n,u),0===s.lengthSq()&&(1===Math.abs(n.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),s.crossVectors(n,u)),s.normalize(),c.crossVectors(u,s),r[0]=s.x,r[4]=c.x,r[8]=u.x,r[1]=s.y,r[5]=c.y,r[9]=u.y,r[2]=s.z,r[6]=c.z,r[10]=u.z,this}),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],u=n[1],h=n[5],l=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],b=n[15],w=r[0],_=r[4],M=r[8],E=r[12],S=r[1],T=r[5],A=r[9],L=r[13],P=r[2],C=r[6],R=r[10],O=r[14],I=r[3],D=r[7],B=r[11],N=r[15];return i[0]=a*w+o*S+s*P+c*I,i[4]=a*_+o*T+s*C+c*D,i[8]=a*M+o*A+s*R+c*B,i[12]=a*E+o*L+s*O+c*N,i[1]=u*w+h*S+l*P+d*I,i[5]=u*_+h*T+l*C+d*D,i[9]=u*M+h*A+l*R+d*B,i[13]=u*E+h*L+l*O+d*N,i[2]=p*w+f*S+m*P+g*I,i[6]=p*_+f*T+m*C+g*D,i[10]=p*M+f*A+m*R+g*B,i[14]=p*E+f*L+m*O+g*N,i[3]=v*w+y*S+x*P+b*I,i[7]=v*_+y*T+x*C+b*D,i[11]=v*M+y*A+x*R+b*B,i[15]=v*E+y*L+x*O+b*N,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:(o=new dn,function(t){for(var e=0,n=t.count;e<n;e++)o.x=t.getX(e),o.y=t.getY(e),o.z=t.getZ(e),o.applyMatrix4(this),t.setXYZ(e,o.x,o.y,o.z);return t}),determinant:function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],c=t[13],u=t[2],h=t[6],l=t[10],d=t[14];return t[3]*(+i*s*h-r*c*h-i*o*l+n*c*l+r*o*d-n*s*d)+t[7]*(+e*s*d-e*c*l+i*a*l-r*a*d+r*c*u-i*s*u)+t[11]*(+e*c*h-e*o*d-i*a*h+n*a*d+i*o*u-n*c*u)+t[15]*(-r*o*u-e*s*h+e*o*l+r*a*h-n*a*l+n*s*u)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var n=this.elements,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],u=r[5],h=r[6],l=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],b=p*y*l-v*f*l+v*h*m-u*y*m-p*h*x+u*f*x,w=g*f*l-d*y*l-g*h*m+c*y*m+d*h*x-c*f*x,_=d*v*l-g*p*l+g*u*m-c*v*m-d*u*x+c*p*x,M=g*p*h-d*v*h-g*u*f+c*v*f+d*u*y-c*p*y,E=i*b+a*w+o*_+s*M;if(0===E){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(S);return console.warn(S),this.identity()}var T=1/E;return n[0]=b*T,n[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*x-a*f*x)*T,n[2]=(u*y*s-v*h*s+v*o*l-a*y*l-u*o*x+a*h*x)*T,n[3]=(p*h*s-u*f*s-p*o*l+a*f*l+u*o*m-a*h*m)*T,n[4]=w*T,n[5]=(d*y*s-g*f*s+g*o*m-i*y*m-d*o*x+i*f*x)*T,n[6]=(g*h*s-c*y*s-g*o*l+i*y*l+c*o*x-i*h*x)*T,n[7]=(c*f*s-d*h*s+d*o*l-i*f*l-c*o*m+i*h*m)*T,n[8]=_*T,n[9]=(g*p*s-d*v*s-g*a*m+i*v*m+d*a*x-i*p*x)*T,n[10]=(c*v*s-g*u*s+g*a*l-i*v*l-c*a*x+i*u*x)*T,n[11]=(d*u*s-c*p*s-d*a*l+i*p*l+c*a*m-i*u*m)*T,n[12]=M*T,n[13]=(d*v*o-g*p*o+g*a*f-i*v*f-d*a*y+i*p*y)*T,n[14]=(g*u*o-c*v*o-g*a*h+i*v*h+c*a*y-i*u*y)*T,n[15]=(c*p*o-d*u*o+d*a*h-i*p*h-c*a*f+i*u*f)*T,this},scale:function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,c=i*a,u=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,u*o+n,u*s-r*a,0,c*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,c=i+i,u=a+a,h=o+o,l=i*c,d=i*u,p=i*h,f=a*u,m=a*h,g=o*h,v=s*c,y=s*u,x=s*h,b=n.x,w=n.y,_=n.z;return r[0]=(1-(f+g))*b,r[1]=(d+x)*b,r[2]=(p-y)*b,r[3]=0,r[4]=(d-x)*w,r[5]=(1-(l+g))*w,r[6]=(m+v)*w,r[7]=0,r[8]=(p+y)*_,r[9]=(m-v)*_,r[10]=(1-(l+f))*_,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},decompose:(h=new dn,l=new hn,function(t,e,n){var r=this.elements,i=h.set(r[0],r[1],r[2]).length(),a=h.set(r[4],r[5],r[6]).length(),o=h.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],l.copy(this);var s=1/i,c=1/a,u=1/o;return l.elements[0]*=s,l.elements[1]*=s,l.elements[2]*=s,l.elements[4]*=c,l.elements[5]*=c,l.elements[6]*=c,l.elements[8]*=u,l.elements[9]*=u,l.elements[10]*=u,e.setFromRotationMatrix(l),n.x=i,n.y=a,n.z=o,this}),makePerspective:function(t,e,n,r,i,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*i/(e-t),c=2*i/(n-r),u=(e+t)/(e-t),h=(n+r)/(n-r),l=-(a+i)/(a-i),d=-2*a*i/(a-i);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(t,e,n,r,i,a){var o=this.elements,s=1/(e-t),c=1/(n-r),u=1/(a-i),h=(e+t)*s,l=(n+r)*c,d=(a+i)*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(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}),Object.assign(ln,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,a,o){var s=n[r+0],c=n[r+1],u=n[r+2],h=n[r+3],l=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(h!==f||s!==l||c!==d||u!==p){var m=1-o,g=s*l+c*d+u*p+h*f,v=0<=g?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var w=o*v;if(s=s*m+l*w,c=c*m+d*w,u=u*m+p*w,h=h*m+f*w,m===1-o){var _=1/Math.sqrt(s*s+c*c+u*u+h*h);s*=_,c*=_,u*=_,h*=_}}t[e]=s,t[e+1]=c,t[e+2]=u,t[e+3]=h}}),Object.defineProperties(ln.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(ln.prototype,{isQuaternion:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,a=t.order,o=Math.cos,s=Math.sin,c=o(n/2),u=o(r/2),h=o(i/2),l=s(n/2),d=s(r/2),p=s(i/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!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],c=n[9],u=n[2],h=n[6],l=n[10],d=r+s+l;return this._z=0<d?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(h-c)*e,this._y=(a-u)*e,(o-i)*e):s<r&&l<r?(e=2*Math.sqrt(1+r-s-l),this._w=(h-c)/e,this._x=.25*e,this._y=(i+o)/e,(a+u)/e):l<s?(e=2*Math.sqrt(1+s-r-l),this._w=(a-u)/e,this._x=(i+o)/e,this._y=.25*e,(c+h)/e):(e=2*Math.sqrt(1+l-r-s),this._w=(o-i)/e,this._x=(a+u)/e,this._y=(c+h)/e,.25*e),this.onChangeCallback(),this},setFromUnitVectors:(g=new dn,function(t,e){return void 0===g&&(g=new dn),(m=t.dot(e)+1)<1e-6?(m=0,Math.abs(t.x)>Math.abs(t.z)?g.set(-t.y,t.x,0):g.set(0,-t.z,t.y)):g.crossVectors(t,e),this._x=g.x,this._y=g.y,this._z=g.z,this._w=m,this.normalize()}),angleTo:function(t){return 2*Math.acos(Math.abs(cn.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return this._w=0===t?(this._x=0,this._y=0,this._z=0,1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,c=e._z,u=e._w;return this._x=n*u+a*o+r*c-i*s,this._y=r*u+a*s+i*o-n*c,this._z=i*u+a*c+n*s-r*o,this._w=a*u-n*o-r*s-i*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-e;return this._w=c*a+e*this._w,this._x=c*n+e*this._x,this._y=c*r+e*this._y,this._z=c*i+e*this._z,this.normalize()}var u=Math.sqrt(s),h=Math.atan2(u,o),l=Math.sin((1-e)*h)/u,d=Math.sin(e*h)/u;return this._w=a*l+this._w*d,this._x=n*l+this._x*d,this._y=r*l+this._y*d,this._z=i*l+this._z*d,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(dn.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(M=new ln,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(M.setFromEuler(t))}),applyAxisAngle:(_=new ln,function(t,e){return this.applyQuaternion(_.setFromAxisAngle(t,e))}),applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*r-o*n,u=s*n+o*e-i*r,h=s*r+i*n-a*e,l=-i*e-a*n-o*r;return this.x=c*s+l*-i+u*-o-h*-a,this.y=u*s+l*-a+h*-i-c*-o,this.z=h*s+l*-o+c*-a-u*-i,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:(w=new hn,function(t){return this.applyMatrix4(w.getInverse(t.projectionMatrix)).applyMatrix4(t.matrixWorld)}),transformDirection:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:(x=new dn,b=new dn,function(t,e){return x.set(t,t,t),b.set(e,e,e),this.clamp(x,b)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(y=new dn,function(t){return y.copy(this).projectOnVector(t),this.sub(y)}),reflect:(v=new dn,function(t){return this.sub(v.copy(t).multiplyScalar(2*this.dot(t)))}),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(cn.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(pn.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,a,o,s,c){var u=this.elements;return u[0]=t,u[1]=r,u[2]=o,u[3]=e,u[4]=i,u[5]=s,u[6]=n,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(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:(E=new dn,function(t){for(var e=0,n=t.count;e<n;e++)E.x=t.getX(e),E.y=t.getY(e),E.z=t.getZ(e),E.applyMatrix3(this),t.setXYZ(e,E.x,E.y,E.z);return t}),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],u=n[4],h=n[7],l=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],b=r[2],w=r[5],_=r[8];return i[0]=a*f+o*v+s*b,i[3]=a*m+o*y+s*w,i[6]=a*g+o*x+s*_,i[1]=c*f+u*v+h*b,i[4]=c*m+u*y+h*w,i[7]=c*g+u*x+h*_,i[2]=l*f+d*v+p*b,i[5]=l*m+d*y+p*w,i[8]=l*g+d*x+p*_,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8];return e*a*u-e*o*c-n*i*u+n*o*s+r*i*c-r*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,r=this.elements,i=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=d*c-u*l,f=u*h-d*s,m=l*s-c*h,g=i*p+a*f+o*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=p*y,r[1]=(o*l-d*a)*y,r[2]=(u*a-o*c)*y,r[3]=f*y,r[4]=(d*i-o*h)*y,r[5]=(o*s-u*i)*y,r[6]=m*y,r[7]=(a*h-l*i)*y,r[8]=(c*i-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+t,-r*c,r*s,-r*(-c*a+s*o)+o+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],u=r[7];return r[0]=e*i+n*s,r[3]=e*a+n*c,r[6]=e*o+n*u,r[1]=-n*i+e*s,r[4]=-n*a+e*c,r[7]=-n*o+e*u,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var fn,mn,gn,vn,yn,xn,bn,wn,_n,Mn,En,Sn,Tn,An,Ln,Pn,Cn={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===S&&(S=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),S.width=t.width,S.height=t.height;var n=S.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=S}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Rn=0;function On(t,e,n,r,i,a,o,s,c,u){Object.defineProperty(this,"id",{value:Rn++}),this.uuid=cn.generateUUID(),this.name="",this.image=void 0!==t?t:On.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:On.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:Gt,this.wrapT=void 0!==r?r:Gt,this.magFilter=void 0!==i?i:jt,this.minFilter=void 0!==a?a:qt,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:se,this.type=void 0!==s?s:Xt,this.offset=new un(0,0),this.repeat=new un(1,1),this.center=new un(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:Je,this.version=0,this.onUpdate=null}function In(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function Dn(t,e,n){this.width=t,this.height=e,this.scissor=new In(0,0,t,e),this.scissorTest=!1,this.viewport=new In(0,0,t,e),n=n||{},this.texture=new On(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:jt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Bn(t,e,n){Dn.call(this,t,e,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function Nn(t,e,n,r,i,a,o,s,c,u,h,l){On.call(this,null,a,o,s,c,u,r,i,h,l),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:Ht,this.minFilter=void 0!==u?u:Ht,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function zn(t,e){this.min=void 0!==t?t:new dn(1/0,1/0,1/0),this.max=void 0!==e?e:new dn(-1/0,-1/0,-1/0)}function Un(t,e){this.center=void 0!==t?t:new dn,this.radius=void 0!==e?e:0}function Gn(t,e){this.normal=void 0!==t?t:new dn(1,0,0),this.constant=void 0!==e?e:0}function Fn(t,e,n,r,i,a){this.planes=[void 0!==t?t:new Gn,void 0!==e?e:new Gn,void 0!==n?n:new Gn,void 0!==r?r:new Gn,void 0!==i?i:new Gn,void 0!==a?a:new Gn]}On.DEFAULT_IMAGE=void 0,On.DEFAULT_MAPPING=Ct,On.prototype=Object.assign(Object.create(r.prototype),{constructor:On,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(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=cn.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(Cn.getDataURL(r[a]))}else i=Cn.getDataURL(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==Ct)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case Ut:t.x=t.x-Math.floor(t.x);break;case Gt:t.x=t.x<0?0:1;break;case Ft:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case Ut:t.y=t.y-Math.floor(t.y);break;case Gt:t.y=t.y<0?0:1;break;case Ft:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(On.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(In.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){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: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return this.z=e<1e-4?(this.x=1,this.y=0):(this.x=t.x/e,this.y=t.y/e,t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,i,a=t.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;e=Math.PI;var m=(o+1)/2,g=(h+1)/2,v=(f+1)/2,y=(s+u)/4,x=(c+d)/4,b=(l+p)/4;return g<m&&v<m?i=m<.01?(n=0,r=.707106781):(r=y/(n=Math.sqrt(m)),x/n):v<g?i=g<.01?(r=0,n=.707106781):(n=y/(r=Math.sqrt(g)),b/r):v<.01?(r=n=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=b/i),this.set(n,r,i,e),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(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return void 0===fn&&(fn=new In,mn=new In),fn.set(t,t,t,t),mn.set(e,e,e,e),this.clamp(fn,mn)},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Dn.prototype=Object.assign(Object.create(r.prototype),{constructor:Dn,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((Bn.prototype=Object.create(Dn.prototype)).constructor=Bn).prototype.isWebGLRenderTargetCube=!0,((Nn.prototype=Object.create(On.prototype)).constructor=Nn).prototype.isDataTexture=!0,Object.assign(zn.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=t.length;s<c;s+=3){var u=t[s],h=t[s+1],l=t[s+2];u<e&&(e=u),h<n&&(n=h),l<r&&(r=l),i<u&&(i=u),a<h&&(a=h),o<l&&(o=l)}return this.min.set(e,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=t.count;s<c;s++){var u=t.getX(s),h=t.getY(s),l=t.getZ(s);u<e&&(e=u),h<n&&(n=h),l<r&&(r=l),i<u&&(i=u),a<h&&(a=h),o<l&&(o=l)}return this.min.set(e,n,r),this.max.set(i,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(bn=new dn,function(t,e){var n=bn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new dn),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new dn),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var i,a,o,s=new dn;function e(t){var e=t.geometry;if(void 0!==e)if(e.isGeometry){var n=e.vertices;for(a=0,o=n.length;a<o;a++)s.copy(n[a]),s.applyMatrix4(t.matrixWorld),i.expandByPoint(s)}else if(e.isBufferGeometry){var r=e.attributes.position;if(void 0!==r)for(a=0,o=r.count;a<o;a++)s.fromBufferAttribute(r,a).applyMatrix4(t.matrixWorld),i.expandByPoint(s)}}return function(t){return i=this,t.updateMatrixWorld(!0),t.traverse(e),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new dn),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:(xn=new dn,function(t){return this.clampPoint(t.center,xn),xn.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n;return n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(){var s=new dn,c=new dn,u=new dn,n=new dn,r=new dn,i=new dn,h=new dn,a=new dn,l=new dn,o=new dn;function d(t){var e,n;for(e=0,n=t.length-3;e<=n;e+=3){h.fromArray(t,e);var r=l.x*Math.abs(h.x)+l.y*Math.abs(h.y)+l.z*Math.abs(h.z),i=s.dot(h),a=c.dot(h),o=u.dot(h);if(Math.max(-Math.max(i,a,o),Math.min(i,a,o))>r)return!1}return!0}return function(t){if(this.isEmpty())return!1;this.getCenter(a),l.subVectors(this.max,a),s.subVectors(t.a,a),c.subVectors(t.b,a),u.subVectors(t.c,a),n.subVectors(c,s),r.subVectors(u,c),i.subVectors(s,u);var e=[0,-n.z,n.y,0,-r.z,r.y,0,-i.z,i.y,n.z,0,-n.x,r.z,0,-r.x,i.z,0,-i.x,-n.y,n.x,0,-r.y,r.x,0,-i.y,i.x,0];return!!d(e)&&(!!d(e=[1,0,0,0,1,0,0,0,1])&&(o.crossVectors(n,r),d(e=[o.x,o.y,o.z])))}}(),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new dn),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(yn=new dn,function(t){return yn.copy(t).clamp(this.min,this.max).sub(t).length()}),getBoundingSphere:(vn=new dn,function(t){return void 0===t&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),t=new Un),this.getCenter(t.center),t.radius=.5*this.getSize(vn).length(),t}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(gn=[new dn,new dn,new dn,new dn,new dn,new dn,new dn,new dn],function(t){return this.isEmpty()||(gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(gn)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Un.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(wn=new zn,function(t,e){var n=this.center;void 0!==e?n.copy(e):wn.setFromPoints(t).getCenter(n);for(var r=0,i=0,a=t.length;i<a;i++)r=Math.max(r,n.distanceToSquared(t[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new dn),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new zn),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(Gn.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:(Sn=new dn,Tn=new dn,function(t,e,n){var r=Sn.subVectors(n,e).cross(Tn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new dn),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:(En=new dn,function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new dn);var n=t.delta(En),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:e.copy(n).multiplyScalar(i).add(t.start)}),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new dn),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(_n=new dn,Mn=new pn,function(t,e){var n=e||Mn.getNormalMatrix(t),r=this.coplanarPoint(_n).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(Fn.prototype,{set:function(t,e,n,r,i,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],u=n[6],h=n[7],l=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(o-r,h-s,f-l,y-m).normalize(),e[1].setComponents(o+r,h+s,f+l,y+m).normalize(),e[2].setComponents(o+i,h+c,f+d,y+g).normalize(),e[3].setComponents(o-i,h-c,f-d,y-g).normalize(),e[4].setComponents(o-a,h-u,f-p,y-v).normalize(),e[5].setComponents(o+a,h+u,f+p,y+v).normalize(),this},intersectsObject:(Pn=new Un,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Pn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Pn)}),intersectsSprite:(Ln=new Un,function(t){return Ln.center.set(0,0,0),Ln.radius=.7071067811865476,Ln.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ln)}),intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:(An=new dn,function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(An.x=0<r.normal.x?t.max.x:t.min.x,An.y=0<r.normal.y?t.max.y:t.min.y,An.z=0<r.normal.z?t.max.z:t.min.z,r.distanceToPoint(An)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var Hn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",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",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\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}",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",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",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",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}",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( sampler2D envMap, 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",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",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.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\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.a );\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.a );\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.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, 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.r, 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}",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",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",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",envmap_physical_pars_fragment:"#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( envMap, 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( envMap, 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",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",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",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",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",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",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",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",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",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",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)",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",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}",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",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",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",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\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",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",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",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",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",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",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",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",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",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",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",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}",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",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",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",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",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}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\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",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",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\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}",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}",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}",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}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\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\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\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}",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}",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}",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}",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 <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}",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 <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}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_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 <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.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}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_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 <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\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\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\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_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}",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}",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 <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\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}",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}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_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}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_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 ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\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}",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\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\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}",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}",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}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_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_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"};function kn(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}return e}function Vn(t){for(var e={},n=0;n<t.length;n++){var r=kn(t[n]);for(var i in r)e[i]=r[i]}return e}var jn,Wn,qn,Xn={clone:kn,merge:Vn},Yn={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 Jn(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}Object.assign(Jn.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(){function a(t,e,n){return n<0&&(n+=1),1<n&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}return function(t,e,n){if(t=cn.euclideanModulo(t,1),e=cn.clamp(e,0,1),n=cn.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=a(i,r,t+1/3),this.g=a(i,r,t),this.b=a(i,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 n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var u,h=(u=n[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&&0<e.length&&(void 0!==(u=Yn[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(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=0<e?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(){function e(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),copyLinearToSRGB:function(){function e(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),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(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(s+o)/2;if(s===o)n=e=0;else{var u=o-s;switch(n=c<=.5?u/(o+s):u/(2-o-s),o){case r:e=(i-a)/u+(i<a?6:0);break;case i:e=(a-r)/u+2;break;case a:e=(r-i)/u+4}e/=6}return t.h=e,t.s=n,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(qn={},function(t,e,n){return this.getHSL(qn),qn.h+=t,qn.s+=e,qn.l+=n,this.setHSL(qn.h,qn.s,qn.l),this}),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:(jn={h:0,s:0,l:0},Wn={h:0,s:0,l:0},function(t,e){this.getHSL(jn),t.getHSL(Wn);var n=cn.lerp(jn.h,Wn.h,e),r=cn.lerp(jn.s,Wn.s,e),i=cn.lerp(jn.l,Wn.l,e);return this.setHSL(n,r,i),this}),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var Zn,Qn,Kn={common:{diffuse:{value:new Jn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new pn},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 un(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 Jn(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 Jn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new pn}},sprite:{diffuse:{value:new Jn(15658734)},opacity:{value:1},center:{value:new un(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new pn}}},$n={basic:{uniforms:Vn([Kn.common,Kn.specularmap,Kn.envmap,Kn.aomap,Kn.lightmap,Kn.fog]),vertexShader:Hn.meshbasic_vert,fragmentShader:Hn.meshbasic_frag},lambert:{uniforms:Vn([Kn.common,Kn.specularmap,Kn.envmap,Kn.aomap,Kn.lightmap,Kn.emissivemap,Kn.fog,Kn.lights,{emissive:{value:new Jn(0)}}]),vertexShader:Hn.meshlambert_vert,fragmentShader:Hn.meshlambert_frag},phong:{uniforms:Vn([Kn.common,Kn.specularmap,Kn.envmap,Kn.aomap,Kn.lightmap,Kn.emissivemap,Kn.bumpmap,Kn.normalmap,Kn.displacementmap,Kn.gradientmap,Kn.fog,Kn.lights,{emissive:{value:new Jn(0)},specular:{value:new Jn(1118481)},shininess:{value:30}}]),vertexShader:Hn.meshphong_vert,fragmentShader:Hn.meshphong_frag},standard:{uniforms:Vn([Kn.common,Kn.envmap,Kn.aomap,Kn.lightmap,Kn.emissivemap,Kn.bumpmap,Kn.normalmap,Kn.displacementmap,Kn.roughnessmap,Kn.metalnessmap,Kn.fog,Kn.lights,{emissive:{value:new Jn(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Hn.meshphysical_vert,fragmentShader:Hn.meshphysical_frag},matcap:{uniforms:Vn([Kn.common,Kn.bumpmap,Kn.normalmap,Kn.displacementmap,Kn.fog,{matcap:{value:null}}]),vertexShader:Hn.meshmatcap_vert,fragmentShader:Hn.meshmatcap_frag},points:{uniforms:Vn([Kn.points,Kn.fog]),vertexShader:Hn.points_vert,fragmentShader:Hn.points_frag},dashed:{uniforms:Vn([Kn.common,Kn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Hn.linedashed_vert,fragmentShader:Hn.linedashed_frag},depth:{uniforms:Vn([Kn.common,Kn.displacementmap]),vertexShader:Hn.depth_vert,fragmentShader:Hn.depth_frag},normal:{uniforms:Vn([Kn.common,Kn.bumpmap,Kn.normalmap,Kn.displacementmap,{opacity:{value:1}}]),vertexShader:Hn.normal_vert,fragmentShader:Hn.normal_frag},sprite:{uniforms:Vn([Kn.sprite,Kn.fog]),vertexShader:Hn.sprite_vert,fragmentShader:Hn.sprite_frag},background:{uniforms:{uvTransform:{value:new pn},t2D:{value:null}},vertexShader:Hn.background_vert,fragmentShader:Hn.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Hn.cube_vert,fragmentShader:Hn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Hn.equirect_vert,fragmentShader:Hn.equirect_frag},distanceRGBA:{uniforms:Vn([Kn.common,Kn.displacementmap,{referencePosition:{value:new dn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Hn.distanceRGBA_vert,fragmentShader:Hn.distanceRGBA_frag},shadow:{uniforms:Vn([Kn.lights,Kn.fog,{color:{value:new Jn(0)},opacity:{value:1}}]),vertexShader:Hn.shadow_vert,fragmentShader:Hn.shadow_frag}};function tr(){var n=null,r=!1,i=null;function a(t,e){!1!==r&&(i(t,e),n.requestAnimationFrame(a))}return{start:function(){!0!==r&&null!==i&&(n.requestAnimationFrame(a),r=!0)},stop:function(){r=!1},setAnimationLoop:function(t){i=t},setContext:function(t){n=t}}}function er(c){var u=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),u.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var e=u.get(t);e&&(c.deleteBuffer(e.buffer),u.delete(t))},update:function(t,e){t.isInterleavedBufferAttribute&&(t=t.data);var n,r,i,a,o,s=u.get(t);void 0===s?u.set(t,function(t,e){var n=t.array,r=t.dynamic?35048:35044,i=c.createBuffer();c.bindBuffer(e,i),c.bufferData(e,n,r),t.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array&&(a=5121),{buffer:i,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:t.version}}(t,e)):s.version<t.version&&(n=s.buffer,i=e,a=(r=t).array,o=r.updateRange,c.bindBuffer(i,n),!1===r.dynamic?c.bufferData(i,a,35044):-1===o.count?c.bufferSubData(i,0,a):0===o.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."):(c.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1),s.version=t.version)}}}function nr(t,e,n,r,i,a){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new dn,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new Jn,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}function rr(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||rr.DefaultOrder}function ir(){this.mask=1}$n.physical={uniforms:Vn([$n.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Hn.meshphysical_vert,fragmentShader:Hn.meshphysical_frag},Object.assign(nr.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}),rr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],rr.DefaultOrder="XYZ",Object.defineProperties(rr.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(rr.prototype,{isEuler:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var r=cn.clamp,i=t.elements,a=i[0],o=i[4],s=i[8],c=i[1],u=i[5],h=i[9],l=i[2],d=i[6],p=i[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(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"===e?(this._x=Math.asin(-r(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"===e?(this._x=Math.asin(r(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"===e?(this._y=Math.asin(-r(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"===e?(this._z=Math.asin(r(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"===e?(this._z=Math.asin(-r(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: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:(Qn=new hn,function(t,e,n){return Qn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Qn,e,n)}),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(Zn=new ln,function(t){return Zn.setFromEuler(this),this.setFromQuaternion(Zn,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new dn(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(ir.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var ar,or,sr,cr,ur,hr,lr,dr,pr,fr,mr,gr,vr,yr,xr,br,wr,_r,Mr=0;function Er(){Object.defineProperty(this,"id",{value:Mr++}),this.uuid=cn.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Er.DefaultUp.clone();var t=new dn,e=new rr,n=new ln,r=new dn(1,1,1);e.onChange(function(){n.setFromEuler(e,!1)}),n.onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new hn},normalMatrix:{value:new pn}}),this.matrix=new hn,this.matrixWorld=new hn,this.matrixAutoUpdate=Er.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ir,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}Er.DefaultUp=new dn(0,1,0),Er.DefaultMatrixAutoUpdate=!0,Er.prototype=Object.assign(Object.create(r.prototype),{constructor:Er,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:(_r=new ln,function(t,e){return _r.setFromAxisAngle(t,e),this.quaternion.multiply(_r),this}),rotateOnWorldAxis:(wr=new ln,function(t,e){return wr.setFromAxisAngle(t,e),this.quaternion.premultiply(wr),this}),rotateX:(br=new dn(1,0,0),function(t){return this.rotateOnAxis(br,t)}),rotateY:(xr=new dn(0,1,0),function(t){return this.rotateOnAxis(xr,t)}),rotateZ:(yr=new dn(0,0,1),function(t){return this.rotateOnAxis(yr,t)}),translateOnAxis:(vr=new dn,function(t,e){return vr.copy(t).applyQuaternion(this.quaternion),this.position.add(vr.multiplyScalar(e)),this}),translateX:(gr=new dn(1,0,0),function(t){return this.translateOnAxis(gr,t)}),translateY:(mr=new dn(0,1,0),function(t){return this.translateOnAxis(mr,t)}),translateZ:(fr=new dn(0,0,1),function(t){return this.translateOnAxis(fr,t)}),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(pr=new hn,function(t){return t.applyMatrix4(pr.getInverse(this.matrixWorld))}),lookAt:(ur=new ln,hr=new hn,lr=new dn,dr=new dn,function(t,e,n){t.isVector3?lr.copy(t):lr.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),dr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?hr.lookAt(dr,lr,this.up):hr.lookAt(lr,dr,this.up),this.quaternion.setFromRotationMatrix(hr),r&&(hr.extractRotation(r.matrixWorld),ur.setFromRotationMatrix(hr),this.quaternion.premultiply(ur.inverse()))}),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new dn),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(sr=new dn,cr=new dn,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new ln),this.updateMatrixWorld(!0),this.matrixWorld.decompose(sr,t,cr),t}),getWorldScale:(ar=new dn,or=new ln,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new dn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(ar,or,t),t}),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new dn),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(n){var t=void 0===n||"string"==typeof n,e={};t&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},e.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,e){return void 0===t[e.uuid]&&(t[e.uuid]=e.toJSON(n)),e.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isMesh||this.isLine||this.isPoints){r.geometry=i(n.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];i(n.shapes,u)}else i(n.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(i(n.materials,this.material[s]));r.material=h}else r.material=i(n.materials,this.material);if(0<this.children.length){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(n).object)}if(t){var l=m(n.geometries),d=m(n.materials),p=m(n.textures),f=m(n.images);o=m(n.shapes);0<l.length&&(e.geometries=l),0<d.length&&(e.materials=d),0<p.length&&(e.textures=p),0<f.length&&(e.images=f),0<o.length&&(e.shapes=o)}return e.object=r,e;function m(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var r=t.children[n];this.add(r.clone())}return this}});var Sr,Tr,Ar,Lr,Pr,Cr,Rr,Or=0;function Ir(){Object.defineProperty(this,"id",{value:Or+=2}),this.uuid=cn.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 Dr(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Br(t,e,n){Dr.call(this,new Int8Array(t),e,n)}function Nr(t,e,n){Dr.call(this,new Uint8Array(t),e,n)}function zr(t,e,n){Dr.call(this,new Uint8ClampedArray(t),e,n)}function Ur(t,e,n){Dr.call(this,new Int16Array(t),e,n)}function Gr(t,e,n){Dr.call(this,new Uint16Array(t),e,n)}function Fr(t,e,n){Dr.call(this,new Int32Array(t),e,n)}function Hr(t,e,n){Dr.call(this,new Uint32Array(t),e,n)}function kr(t,e,n){Dr.call(this,new Float32Array(t),e,n)}function Vr(t,e,n){Dr.call(this,new Float64Array(t),e,n)}function jr(){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 Wr(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Ir.prototype=Object.assign(Object.create(r.prototype),{constructor:Ir,isGeometry:!0,applyMatrix:function(t){for(var e=(new pn).getNormalMatrix(t),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(t)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(e).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:(Rr=new hn,function(t){return Rr.makeRotationX(t),this.applyMatrix(Rr),this}),rotateY:(Cr=new hn,function(t){return Cr.makeRotationY(t),this.applyMatrix(Cr),this}),rotateZ:(Pr=new hn,function(t){return Pr.makeRotationZ(t),this.applyMatrix(Pr),this}),translate:(Lr=new hn,function(t,e,n){return Lr.makeTranslation(t,e,n),this.applyMatrix(Lr),this}),scale:(Ar=new hn,function(t,e,n){return Ar.makeScale(t,e,n),this.applyMatrix(Ar),this}),lookAt:(Tr=new Er,function(t){Tr.lookAt(t),Tr.updateMatrix(),this.applyMatrix(Tr.matrix)}),fromBufferGeometry:function(t){var o=this,e=null!==t.index?t.index.array:void 0,n=t.attributes,r=n.position.array,s=void 0!==n.normal?n.normal.array:void 0,c=void 0!==n.color?n.color.array:void 0,u=void 0!==n.uv?n.uv.array:void 0,h=void 0!==n.uv2?n.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var i=0,a=0;i<r.length;i+=3,a+=2)o.vertices.push((new dn).fromArray(r,i)),void 0!==c&&o.colors.push((new Jn).fromArray(c,i));function l(t,e,n,r){var i=void 0===c?[]:[o.colors[t].clone(),o.colors[e].clone(),o.colors[n].clone()],a=new nr(t,e,n,void 0===s?[]:[(new dn).fromArray(s,3*t),(new dn).fromArray(s,3*e),(new dn).fromArray(s,3*n)],i,r);o.faces.push(a),void 0!==u&&o.faceVertexUvs[0].push([(new un).fromArray(u,2*t),(new un).fromArray(u,2*e),(new un).fromArray(u,2*n)]),void 0!==h&&o.faceVertexUvs[1].push([(new un).fromArray(h,2*t),(new un).fromArray(h,2*e),(new un).fromArray(h,2*n)])}var d=t.groups;if(0<d.length)for(i=0;i<d.length;i++)for(var p=d[i],f=p.start,m=(a=f,f+p.count);a<m;a+=3)void 0!==e?l(e[a],e[a+1],e[a+2],p.materialIndex):l(a,a+1,a+2,p.materialIndex);else if(void 0!==e)for(i=0;i<e.length;i+=3)l(e[i],e[i+1],e[i+2]);else for(i=0;i<r.length/3;i+=3)l(i,i+1,i+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:(Sr=new dn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Sr).negate(),this.translate(Sr.x,Sr.y,Sr.z),this}),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new hn;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=new dn,e=new dn,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){var e,n,r,i,a,o;for(void 0===t&&(t=!0),o=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)o[e]=new dn;if(t){var s,c,u,h=new dn,l=new dn;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],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(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,n=this.vertices.length;e<n;e++)o[e].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(a=this.faces[r]).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())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var r=(n=this.faces[t]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),t=0,e=i.vertexNormals.length;t<e;t++)i.__originalVertexNormals[t]?i.__originalVertexNormals[t].copy(i.vertexNormals[t]):i.__originalVertexNormals[t]=i.vertexNormals[t].clone();var a=new Ir;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new dn,u={a:new dn,b:new dn,c:new dn},o.push(c),s.push(u)}var c,u,h=this.morphNormals[t];for(a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=h.faceNormals[n],u=h.vertexNormals[n],c.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new zn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Un),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,c=t.faces,u=this.faceVertexUvs[0],h=t.faceVertexUvs[0],l=this.colors,d=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new pn).getNormalMatrix(e));for(var p=0,f=o.length;p<f;p++){var m=o[p].clone();void 0!==e&&m.applyMatrix4(e),a.push(m)}for(p=0,f=d.length;p<f;p++)l.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var g,v,y,x=c[p],b=x.vertexNormals,w=x.vertexColors;(g=new nr(x.a+i,x.b+i,x.c+i)).normal.copy(x.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var _=0,M=b.length;_<M;_++)v=b[_].clone(),void 0!==r&&v.applyMatrix3(r).normalize(),g.vertexNormals.push(v);g.color.copy(x.color);for(_=0,M=w.length;_<M;_++)y=w[_],g.vertexColors.push(y.clone());g.materialIndex=x.materialIndex+n,s.push(g)}for(p=0,f=h.length;p<f;p++){var E=h[p],S=[];if(void 0!==E){for(_=0,M=E.length;_<M;_++)S.push(E[_].clone());u.push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,r,i,a,o,s,c={},u=[],h=[],l=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)t=this.vertices[n],void 0===c[e=Math.round(t.x*l)+"_"+Math.round(t.y*l)+"_"+Math.round(t.z*l)]?(c[e]=n,u.push(this.vertices[n]),h[n]=u.length-1):h[n]=h[c[e]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=h[i.a],i.b=h[i.b],i.c=h[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;0<=n;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var r=t[e];this.vertices.push(new dn(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===e&&(r=[]),o&&o.length===e&&(i=[]);for(n=0;n<e;n++){var s=t[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],c={},u=[],h={},l=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=0<p.normal.length(),g=0<p.vertexNormals.length,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=0<p.vertexColors.length,x=0;if(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x,0,0),1,!0),2,!1),3,f),4,m),5,g),6,v),7,y),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var b=this.faceVertexUvs[0][i];o.push(T(b[0]),T(b[1]),T(b[2]))}if(m&&o.push(E(p.normal)),g){var w=p.vertexNormals;o.push(E(w[0]),E(w[1]),E(w[2]))}if(v&&o.push(S(p.color)),y){var _=p.vertexColors;o.push(S(_[0]),S(_[1]),S(_[2]))}}function M(t,e,n){return n?t|1<<e:t&~(1<<e)}function E(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]||(c[e]=s.length/3,s.push(t.x,t.y,t.z)),c[e]}function S(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==h[e]||(h[e]=u.length,u.push(t.getHex())),h[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=l.length/2,l.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=r,t.data.normals=s,0<u.length&&(t.data.colors=u),0<l.length&&(t.data.uvs=[l]),t.data.faces=o,t},clone:function(){return(new Ir).copy(this)},copy:function(t){var e,n,r,i,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=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,n=c.length;e<n;e++)this.colors.push(c[e].clone());var u=t.faces;for(e=0,n=u.length;e<n;e++)this.faces.push(u[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var h=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),r=0,i=h.length;r<i;r++){var l=h[r],d=[];for(a=0,o=l.length;a<o;a++){var p=l[a];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],r=0,i=f[e].vertices.length;r<i;r++)m.vertices.push(f[e].vertices[r].clone());if(void 0!==f[e].normals)for(m.normals=[],r=0,i=f[e].normals.length;r<i;r++)m.normals.push(f[e].normals[r].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],r=0,i=g[e].vertexNormals.length;r<i;r++){var y=g[e].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],r=0,i=g[e].faceNormals.length;r<i;r++)v.faceNormals.push(g[e].faceNormals[r].clone());this.morphNormals.push(v)}var b=t.skinWeights;for(e=0,n=b.length;e<n;e++)this.skinWeights.push(b[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var _=t.lineDistances;for(e=0,n=_.length;e<n;e++)this.lineDistances.push(_[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=t.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Dr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Dr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new Jn),e[n++]=a.r,e[n++]=a.g,e[n++]=a.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new un),e[n++]=a.x,e[n++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new dn),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new In),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n++]=a.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(Br.prototype=Object.create(Dr.prototype)).constructor=Br,(Nr.prototype=Object.create(Dr.prototype)).constructor=Nr,(zr.prototype=Object.create(Dr.prototype)).constructor=zr,(Ur.prototype=Object.create(Dr.prototype)).constructor=Ur,(Gr.prototype=Object.create(Dr.prototype)).constructor=Gr,(Fr.prototype=Object.create(Dr.prototype)).constructor=Fr,(Hr.prototype=Object.create(Dr.prototype)).constructor=Hr,(kr.prototype=Object.create(Dr.prototype)).constructor=kr,(Vr.prototype=Object.create(Dr.prototype)).constructor=Vr,Object.assign(jr.prototype,{computeGroups:function(t){for(var e,n=[],r=void 0,i=t.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,n.push(e)),e={start:3*a,materialIndex:r})}void 0!==e&&(e.count=3*a-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,a=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=t.morphTargets,c=s.length;if(0<c){e=[];for(var u=0;u<c;u++)e[u]={name:s[u].name,data:[]};this.morphTargets.position=e}var h,l=t.morphNormals,d=l.length;if(0<d){h=[];for(u=0;u<d;u++)h[u]={name:l[u].name,data:[]};this.morphTargets.normal=h}var p=t.skinIndices,f=t.skinWeights,m=p.length===r.length,g=f.length===r.length;0<r.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u<n.length;u++){var v=n[u];this.vertices.push(r[v.a],r[v.b],r[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var b,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var _=v.color;this.colors.push(_,_,_)}if(!0===a)void 0!==(b=i[0][u])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new un,new un,new un));if(!0===o)void 0!==(b=i[1][u])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new un,new un,new un));for(var M=0;M<c;M++){var E=s[M].vertices;e[M].data.push(E[v.a],E[v.b],E[v.c])}for(M=0;M<d;M++){var S=l[M].vertexNormals[u];h[M].data.push(S.a,S.b,S.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var qr,Xr,Yr,Jr,Zr,Qr,Kr,$r,ti,ei,ni=1;function ri(){Object.defineProperty(this,"id",{value:ni+=2}),this.uuid=cn.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 ii(t,e,n,r,i,a){Ir.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new ai(t,e,n,r,i,a)),this.mergeVertices()}function ai(t,e,n,r,i,a){ri.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var P=this;t=t||1,e=e||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var C=[],R=[],O=[],I=[],D=0,B=0;function o(t,e,n,r,i,a,o,s,c,u,h){var l,d,p=a/c,f=o/u,m=a/2,g=o/2,v=s/2,y=c+1,x=u+1,b=0,w=0,_=new dn;for(d=0;d<x;d++){var M=d*f-g;for(l=0;l<y;l++){var E=l*p-m;_[t]=E*r,_[e]=M*i,_[n]=v,R.push(_.x,_.y,_.z),_[t]=0,_[e]=0,_[n]=0<s?1:-1,O.push(_.x,_.y,_.z),I.push(l/c),I.push(1-d/u),b+=1}}for(d=0;d<u;d++)for(l=0;l<c;l++){var S=D+l+y*d,T=D+l+y*(d+1),A=D+(l+1)+y*(d+1),L=D+(l+1)+y*d;C.push(S,T,L),C.push(T,A,L),w+=6}P.addGroup(B,w,h),B+=w,D+=b}o("z","y","x",-1,-1,n,e,t,a,i,0),o("z","y","x",1,-1,n,e,-t,a,i,1),o("x","z","y",1,1,t,n,e,r,a,2),o("x","z","y",1,-1,t,n,-e,r,a,3),o("x","y","z",1,-1,t,e,n,r,i,4),o("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(C),this.addAttribute("position",new kr(R,3)),this.addAttribute("normal",new kr(O,3)),this.addAttribute("uv",new kr(I,2))}function oi(t,e,n,r){Ir.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new si(t,e,n,r)),this.mergeVertices()}function si(t,e,n,r){ri.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};var i,a,o=(t=t||1)/2,s=(e=e||1)/2,c=Math.floor(n)||1,u=Math.floor(r)||1,h=c+1,l=u+1,d=t/c,p=e/u,f=[],m=[],g=[],v=[];for(a=0;a<l;a++){var y=a*p-s;for(i=0;i<h;i++){var x=i*d-o;m.push(x,-y,0),g.push(0,0,1),v.push(i/c),v.push(1-a/u)}}for(a=0;a<u;a++)for(i=0;i<c;i++){var b=i+h*a,w=i+h*(a+1),_=i+1+h*(a+1),M=i+1+h*a;f.push(b,w,M),f.push(w,_,M)}this.setIndex(f),this.addAttribute("position",new kr(m,3)),this.addAttribute("normal",new kr(g,3)),this.addAttribute("uv",new kr(v,2))}ri.prototype=Object.assign(Object.create(r.prototype),{constructor:ri,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Wr(t)?Hr:Gr)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?("index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)):this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new Dr(e,arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new pn).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:(ei=new hn,function(t){return ei.makeRotationX(t),this.applyMatrix(ei),this}),rotateY:(ti=new hn,function(t){return ti.makeRotationY(t),this.applyMatrix(ti),this}),rotateZ:($r=new hn,function(t){return $r.makeRotationZ(t),this.applyMatrix($r),this}),translate:(Kr=new hn,function(t,e,n){return Kr.makeTranslation(t,e,n),this.applyMatrix(Kr),this}),scale:(Qr=new hn,function(t,e,n){return Qr.makeScale(t,e,n),this.applyMatrix(Qr),this}),lookAt:(Zr=new Er,function(t){Zr.lookAt(t),Zr.updateMatrix(),this.applyMatrix(Zr.matrix)}),center:(Jr=new dn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Jr).negate(),this.translate(Jr.x,Jr.y,Jr.z),this}),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new kr(3*e.vertices.length,3),r=new kr(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new kr(e.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];e.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new kr(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new jr).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Dr(e,3).copyVector3sArray(t.vertices)),0<t.normals.length){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Dr(n,3).copyVector3sArray(t.normals))}if(0<t.colors.length){var r=new Float32Array(3*t.colors.length);this.addAttribute("color",new Dr(r,3).copyColorsArray(t.colors))}if(0<t.uvs.length){var i=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Dr(i,2).copyVector2sArray(t.uvs))}if(0<t.uvs2.length){var a=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Dr(a,2).copyVector2sArray(t.uvs2))}for(var o in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[o],u=0,h=c.length;u<h;u++){var l=c[u],d=new kr(3*l.data.length,3);d.name=l.name,s.push(d.copyVector3sArray(l.data))}this.morphAttributes[o]=s}if(0<t.skinIndices.length){var p=new kr(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(0<t.skinWeights.length){var f=new kr(4*t.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new zn);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):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:(Xr=new zn,Yr=new dn,function(){null===this.boundingSphere&&(this.boundingSphere=new Un);var t=this.attributes.position;if(t){var e=this.boundingSphere.center;Xr.setFromBufferAttribute(t),Xr.getCenter(e);for(var n=0,r=0,i=t.count;r<i;r++)Yr.x=t.getX(r),Yr.y=t.getY(r),Yr.z=t.getZ(r),n=Math.max(n,e.distanceToSquared(Yr));this.boundingSphere.radius=Math.sqrt(n),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 t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new Dr(new Float32Array(n.length),3));else for(var r=e.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,c,u=e.normal.array,h=new dn,l=new dn,d=new dn,p=new dn,f=new dn;if(t){var m=t.array;for(i=0,a=t.count;i<a;i+=3)o=3*m[i+0],s=3*m[i+1],c=3*m[i+2],h.fromArray(n,o),l.fromArray(n,s),d.fromArray(n,c),p.subVectors(d,l),f.subVectors(h,l),p.cross(f),u[o]+=p.x,u[o+1]+=p.y,u[o+2]+=p.z,u[s]+=p.x,u[s+1]+=p.y,u[s+2]+=p.z,u[c]+=p.x,u[c+1]+=p.y,u[c+2]+=p.z}else for(i=0,a=n.length;i<a;i+=9)h.fromArray(n,i),l.fromArray(n,i+3),d.fromArray(n,i+6),p.subVectors(d,l),f.subVectors(h,l),p.cross(f),u[i]=p.x,u[i+1]=p.y,u[i+2]=p.z,u[i+3]=p.x,u[i+4]=p.y,u[i+5]=p.z,u[i+6]=p.x,u[i+7]=p.y,u[i+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r].array,a=t.attributes[r],o=a.array,s=0,c=a.itemSize*e;s<o.length;s++,c++)i[c]=o[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:(qr=new dn,function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)qr.x=t.getX(e),qr.y=t.getY(e),qr.z=t.getZ(e),qr.normalize(),t.setXYZ(e,qr.x,qr.y,qr.z)}),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new ri,e=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],a=i.array,o=i.itemSize,s=new a.constructor(e.length*o),c=0,u=0,h=0,l=e.length;h<l;h++){c=e[h]*o;for(var d=0;d<o;d++)s[u++]=a[c++]}t.addAttribute(r,new Dr(s,o))}var p=this.groups;for(h=0,l=p.length;h<l;h++){var f=p[h];t.addGroup(f.start,f.count,f.materialIndex)}return t},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),0<Object.keys(this.userData).length&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;if(null!==r){var i=Array.prototype.slice.call(r.array);t.data.index={type:r.array.constructor.name,array:i}}var a=this.attributes;for(var n in a){var o=a[n];i=Array.prototype.slice.call(o.array);t.data.attributes[n]={itemSize:o.itemSize,type:o.array.constructor.name,array:i,normalized:o.normalized}}var s=this.groups;0<s.length&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new ri).copy(this)},copy:function(t){var e,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var a=t.attributes;for(e in a){var o=a[e];this.addAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var c=[],u=s[e];for(n=0,r=u.length;n<r;n++)c.push(u[n].clone());this.morphAttributes[e]=c}var h=t.groups;for(n=0,r=h.length;n<r;n++){var l=h[n];this.addGroup(l.start,l.count,l.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(ii.prototype=Object.create(Ir.prototype)).constructor=ii,(ai.prototype=Object.create(ri.prototype)).constructor=ai,(oi.prototype=Object.create(Ir.prototype)).constructor=oi,(si.prototype=Object.create(ri.prototype)).constructor=si;var ci,ui,hi,li,di,pi,fi,mi,gi,vi,yi,xi,bi,wi,_i,Mi,Ei,Si,Ti,Ai,Li,Pi,Ci,Ri,Oi,Ii=0;function Di(){Object.defineProperty(this,"id",{value:Ii++}),this.uuid=cn.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=Z,this.side=B,this.flatShading=!1,this.vertexColors=I,this.opacity=1,this.transparent=!1,this.blendSrc=it,this.blendDst=at,this.blendEquation=nt,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=ft,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.visible=!0,this.userData={},this.needsUpdate=!0}function Bi(t){Di.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!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Ni(t,e){this.origin=void 0!==t?t:new dn,this.direction=void 0!==e?e:new dn}function zi(t,e,n){this.a=void 0!==t?t:new dn,this.b=void 0!==e?e:new dn,this.c=void 0!==n?n:new dn}function Ui(t){Di.call(this),this.type="MeshBasicMaterial",this.color=new Jn(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=xt,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(t)}function Gi(t,e){Er.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new ri,this.material=void 0!==e?e:new Ui({color:16777215*Math.random()}),this.drawMode=qe,this.updateMorphTargets()}function Fi(o,n,s,r){var c,u,h=new Jn(0),l=0,d=null,p=0;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return h},setClearColor:function(t,e){h.set(t),f(h,l=void 0!==e?e:1)},getClearAlpha:function(){return l},setClearAlpha:function(t){f(h,l=t)},render:function(t,e,n,r){var i=e.background;if(null===i?(f(h,l),d=null,p=0):i&&i.isColor&&(f(i,1),r=!0,d=null,p=0),(o.autoClear||r)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),i&&(i.isCubeTexture||i.isWebGLRenderTargetCube)){void 0===u&&((u=new Gi(new ai(1,1,1),new Bi({type:"BackgroundCubeMaterial",uniforms:kn($n.cube.uniforms),vertexShader:$n.cube.vertexShader,fragmentShader:$n.cube.fragmentShader,side:Mt,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),u.geometry.removeAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.tCube.value}}),s.update(u));var a=i.isWebGLRenderTargetCube?i.texture:i;u.material.uniforms.tCube.value=a,u.material.uniforms.tFlip.value=i.isWebGLRenderTargetCube?1:-1,d===i&&p===a.version||(u.material.needsUpdate=!0,d=i,p=a.version),t.unshift(u,u.geometry,u.material,0,null)}else i&&i.isTexture&&(void 0===c&&((c=new Gi(new si(2,2),new Bi({type:"BackgroundMaterial",uniforms:kn($n.background.uniforms),vertexShader:$n.background.vertexShader,fragmentShader:$n.background.fragmentShader,side:B,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),!0===(c.material.uniforms.t2D.value=i).matrixAutoUpdate&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),d===i&&p===i.version||(c.material.needsUpdate=!0,p=(d=i).version),t.unshift(c,c.geometry,c.material,0,null))}}}function Hi(i,a,o,s){var c;this.setMode=function(t){c=t},this.render=function(t,e){i.drawArrays(c,t,e),o.update(e,c)},this.renderInstances=function(t,e,n){var r;if(s.isWebGL2)r=i;else if(null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[s.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](c,e,n,t.maxInstancedCount),o.update(n,c,t.maxInstancedCount)}}function ki(e,n,t){var r;function i(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(35633,36338).precision&&0<e.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(35633,36337).precision&&0<e.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,o=void 0!==t.precision?t.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===t.logarithmicDepthBuffer,u=e.getParameter(34930),h=e.getParameter(35660),l=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=0<h,y=a||!!n.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var t=n.get("EXT_texture_filter_anisotropic");return r=null!==t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:l,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y}}function Vi(){var h=this,l=null,d=0,p=!1,f=!1,m=new Gn,g=new pn,v={value:null,needsUpdate:!1};function y(){v.value!==l&&(v.value=l,v.needsUpdate=0<d),h.numPlanes=d,h.numIntersection=0}function x(t,e,n,r){var i=null!==t?t.length:0,a=null;if(0!==i){if(a=v.value,!0!==r||null===a){var o=n+4*i,s=e.matrixWorldInverse;g.getNormalMatrix(s),(null===a||a.length<o)&&(a=new Float32Array(o));for(var c=0,u=n;c!==i;++c,u+=4)m.copy(t[c]).applyMatrix4(s,g),m.normal.toArray(a,u),a[u+3]=m.constant}v.value=a,v.needsUpdate=!0}return h.numPlanes=i,a}this.uniform=v,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,n){var r=0!==t.length||e||0!==d||p;return p=e,l=x(t,n,0),d=t.length,r},this.beginShadows=function(){f=!0,x(null)},this.endShadows=function(){f=!1,y()},this.setState=function(t,e,n,r,i,a){if(!p||null===t||0===t.length||f&&!n)f?x(null):y();else{var o=f?0:d,s=4*o,c=i.clippingState||null;v.value=c,c=x(t,r,s,a);for(var u=0;u!==s;++u)c[u]=l[u];i.clippingState=c,this.numIntersection=e?this.numPlanes:0,this.numPlanes+=o}}}function ji(n){var r={};return{get:function(t){if(void 0!==r[t])return r[t];var e;switch(t){case"WEBGL_depth_texture":e=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":e=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:e=n.getExtension(t)}return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),r[t]=e}}}function Wi(t,l,a){var o={},d={};function s(t){var e=t.target,n=o[e.id];for(var r in null!==n.index&&l.remove(n.index),n.attributes)l.remove(n.attributes[r]);e.removeEventListener("dispose",s),delete o[e.id];var i=d[n.id];i&&(l.remove(i),delete d[n.id]),a.memory.geometries--}return{get:function(t,e){var n=o[e.id];return n||(e.addEventListener("dispose",s),e.isBufferGeometry?n=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new ri).setFromObject(t)),n=e._bufferGeometry),o[e.id]=n,a.memory.geometries++,n)},update:function(t){var e=t.index,n=t.attributes;for(var r in null!==e&&l.update(e,34963),n)l.update(n[r],34962);var i=t.morphAttributes;for(var r in i)for(var a=i[r],o=0,s=a.length;o<s;o++)l.update(a[o],34962)},getWireframeAttribute:function(t){var e=d[t.id];if(e)return e;var n,r=[],i=t.index,a=t.attributes;if(null!==i)for(var o=0,s=(n=i.array).length;o<s;o+=3){var c=n[o+0],u=n[o+1],h=n[o+2];r.push(c,u,u,h,h,c)}else for(o=0,s=(n=a.position.array).length/3-1;o<s;o+=3)c=o+0,u=o+1,h=o+2,r.push(c,u,u,h,h,c);return e=new(65535<Wr(r)?Hr:Gr)(r,1),l.update(e,34963),d[t.id]=e}}}function qi(i,a,o,s){var c,u,h;this.setMode=function(t){c=t},this.setIndex=function(t){u=t.type,h=t.bytesPerElement},this.render=function(t,e){i.drawElements(c,e,u,t*h),o.update(e,c)},this.renderInstances=function(t,e,n){var r;if(s.isWebGL2)r=i;else if(null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[s.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](c,n,u,e*h,t.maxInstancedCount),o.update(n,c,t.maxInstancedCount)}}function Xi(t){var r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:r,programs:null,autoReset:!0,reset:function(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0},update:function(t,e,n){switch(n=n||1,r.calls++,e){case 4:r.triangles+=n*(t/3);break;case 5:case 6:r.triangles+=n*(t-2);break;case 1:r.lines+=n*(t/2);break;case 3:r.lines+=n*(t-1);break;case 2:r.lines+=n*t;break;case 0:r.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}}}function Yi(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Ji(p){var f={},m=new Float32Array(8);return{update:function(t,e,n,r){var i=t.morphTargetInfluences,a=i.length,o=f[e.id];if(void 0===o){o=[];for(var s=0;s<a;s++)o[s]=[s,0];f[e.id]=o}var c=n.morphTargets&&e.morphAttributes.position,u=n.morphNormals&&e.morphAttributes.normal;for(s=0;s<a;s++)0!==(h=o[s])[1]&&(c&&e.removeAttribute("morphTarget"+s),u&&e.removeAttribute("morphNormal"+s));for(s=0;s<a;s++)(h=o[s])[0]=s,h[1]=i[s];for(o.sort(Yi),s=0;s<8;s++){var h;if(h=o[s]){var l=h[0],d=h[1];if(d){c&&e.addAttribute("morphTarget"+s,c[l]),u&&e.addAttribute("morphNormal"+s,u[l]),m[s]=d;continue}}m[s]=0}r.getUniforms().setValue(p,"morphTargetInfluences",m)}}}function Zi(i,a){var o={};return{update:function(t){var e=a.render.frame,n=t.geometry,r=i.get(t,n);return o[r.id]!==e&&(n.isGeometry&&r.updateFromObject(t),i.update(r),o[r.id]=e),r},dispose:function(){o={}}}}function Qi(t,e,n,r,i,a,o,s,c,u){On.call(this,t=void 0!==t?t:[],e=void 0!==e?e:Rt,n,r,i,a,o,s,c,u),this.flipY=!1}function Ki(t,e,n,r){On.call(this,null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=Ht,this.minFilter=Ht,this.generateMipmaps=!1,this.flipY=!1}Di.prototype=Object.assign(Object.create(r.prototype),{constructor:Di,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===R;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Z&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==B&&(n.side=this.side),this.vertexColors!==I&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),a=r(t.images);0<i.length&&(n.textures=i),0<a.length&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((Bi.prototype=Object.create(Di.prototype)).constructor=Bi).prototype.isShaderMaterial=!0,Bi.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=kn(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},Bi.prototype.toJSON=function(t){var e=Di.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return 0<Object.keys(i).length&&(e.extensions=i),e},Object.assign(Ni.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new dn),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:(yi=new dn,function(t){return this.origin.copy(this.at(t,yi)),this}),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new dn),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:(vi=new dn,function(t){var e=vi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(vi.copy(this.direction).multiplyScalar(e).add(this.origin),vi.distanceToSquared(t))}),distanceSqToSegment:(fi=new dn,mi=new dn,gi=new dn,function(t,e,n,r){fi.copy(t).add(e).multiplyScalar(.5),mi.copy(e).sub(t).normalize(),gi.copy(this.origin).sub(fi);var i,a,o,s,c=.5*t.distanceTo(e),u=-this.direction.dot(mi),h=gi.dot(this.direction),l=-gi.dot(mi),d=gi.lengthSq(),p=Math.abs(1-u*u);if(0<p)if(a=u*h-l,s=c*p,0<=(i=u*l-h))if(-s<=a)if(a<=s){var f=1/p;o=(i*=f)*(i+u*(a*=f)+2*h)+a*(u*i+a+2*l)+d}else a=c,o=-(i=Math.max(0,-(u*a+h)))*i+a*(a+2*l)+d;else a=-c,o=-(i=Math.max(0,-(u*a+h)))*i+a*(a+2*l)+d;else o=a<=-s?-(i=Math.max(0,-(-u*c+h)))*i+(a=0<i?-c:Math.min(Math.max(-c,-l),c))*(a+2*l)+d:a<=s?(i=0,(a=Math.min(Math.max(-c,-l),c))*(a+2*l)+d):-(i=Math.max(0,-(u*c+h)))*i+(a=0<i?c:Math.min(Math.max(-c,-l),c))*(a+2*l)+d;else a=0<u?-c:c,o=-(i=Math.max(0,-(u*a+h)))*i+a*(a+2*l)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(mi).multiplyScalar(a).add(fi),o}),intersectSphere:(pi=new dn,function(t,e){pi.subVectors(t.center,this.origin);var n=pi.dot(this.direction),r=pi.dot(pi)-n*n,i=t.radius*t.radius;if(i<r)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)}),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,r,i,a,o,s,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,l=this.origin;return r=0<=c?(n=(t.min.x-l.x)*c,(t.max.x-l.x)*c):(n=(t.max.x-l.x)*c,(t.min.x-l.x)*c),(a=0<=u?(i=(t.min.y-l.y)*u,(t.max.y-l.y)*u):(i=(t.max.y-l.y)*u,(t.min.y-l.y)*u))<n||r<i?null:((n<i||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),(s=0<=h?(o=(t.min.z-l.z)*h,(t.max.z-l.z)*h):(o=(t.max.z-l.z)*h,(t.min.z-l.z)*h))<n||r<o?null:((n<o||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,e)))},intersectsBox:(di=new dn,function(t){return null!==this.intersectBox(t,di)}),intersectTriangle:(ci=new dn,ui=new dn,hi=new dn,li=new dn,function(t,e,n,r,i){ui.subVectors(e,t),hi.subVectors(n,t),li.crossVectors(ui,hi);var a,o=this.direction.dot(li);if(0<o){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}ci.subVectors(this.origin,t);var s=a*this.direction.dot(hi.crossVectors(ci,hi));if(s<0)return null;var c=a*this.direction.dot(ui.cross(ci));if(c<0)return null;if(o<s+c)return null;var u=-a*ci.dot(li);return u<0?null:this.at(u/o,i)}),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(zi,{getNormal:(Ei=new dn,function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new dn),r.subVectors(n,e),Ei.subVectors(t,e),r.cross(Ei);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}),getBarycoord:(wi=new dn,_i=new dn,Mi=new dn,function(t,e,n,r,i){wi.subVectors(r,e),_i.subVectors(n,e),Mi.subVectors(t,e);var a=wi.dot(wi),o=wi.dot(_i),s=wi.dot(Mi),c=_i.dot(_i),u=_i.dot(Mi),h=a*c-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new dn),0===h)return i.set(-2,-1,-1);var l=1/h,d=(c*s-o*u)*l,p=(a*u-o*s)*l;return i.set(1-d-p,p,d)}),containsPoint:(bi=new dn,function(t,e,n,r){return zi.getBarycoord(t,e,n,r,bi),0<=bi.x&&0<=bi.y&&bi.x+bi.y<=1}),getUV:(xi=new dn,function(t,e,n,r,i,a,o,s){return this.getBarycoord(t,e,n,r,xi),s.set(0,0),s.addScaledVector(i,xi.x),s.addScaledVector(a,xi.y),s.addScaledVector(o,xi.z),s})}),Object.assign(zi.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:(Ri=new dn,Oi=new dn,function(){return Ri.subVectors(this.c,this.b),Oi.subVectors(this.a,this.b),.5*Ri.cross(Oi).length()}),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new dn),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return zi.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new dn),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return zi.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return zi.containsPoint(t,this.a,this.b,this.c)},getUV:function(t,e,n,r,i){return zi.getUV(t,this.a,this.b,this.c,e,n,r,i)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(Si=new dn,Ti=new dn,Ai=new dn,Li=new dn,Pi=new dn,Ci=new dn,function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new dn);var n,r,i=this.a,a=this.b,o=this.c;Si.subVectors(a,i),Ti.subVectors(o,i),Li.subVectors(t,i);var s=Si.dot(Li),c=Ti.dot(Li);if(s<=0&&c<=0)return e.copy(i);Pi.subVectors(t,a);var u=Si.dot(Pi),h=Ti.dot(Pi);if(0<=u&&h<=u)return e.copy(a);var l=s*h-u*c;if(l<=0&&0<=s&&u<=0)return n=s/(s-u),e.copy(i).addScaledVector(Si,n);Ci.subVectors(t,o);var d=Si.dot(Ci),p=Ti.dot(Ci);if(0<=p&&d<=p)return e.copy(o);var f=d*c-s*p;if(f<=0&&0<=c&&p<=0)return r=c/(c-p),e.copy(i).addScaledVector(Ti,r);var m=u*p-d*h;if(m<=0&&0<=h-u&&0<=d-p)return Ai.subVectors(o,a),r=(h-u)/(h-u+(d-p)),e.copy(a).addScaledVector(Ai,r);var g=1/(m+f+l);return n=f*g,r=l*g,e.copy(i).addScaledVector(Si,n).addScaledVector(Ti,r)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((Ui.prototype=Object.create(Di.prototype)).constructor=Ui).prototype.isMeshBasicMaterial=!0,Ui.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},Gi.prototype=Object.assign(Object.create(Er.prototype),{constructor:Gi,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Er.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(){var G=new hn,F=new Ni,H=new Un,k=new dn,V=new dn,j=new dn,W=new dn,q=new dn,X=new dn,Y=new un,J=new un,Z=new un,Q=new dn,u=new dn;function K(t,e,n,r,i,a,o,s){if(null===(e.side===Mt?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,e.side!==tt,s)))return null;u.copy(s),u.applyMatrix4(t.matrixWorld);var c=n.ray.origin.distanceTo(u);return c<n.near||c>n.far?null:{distance:c,point:u.clone(),object:t}}function $(t,e,n,r,i,a,o,s,c){k.fromBufferAttribute(i,o),V.fromBufferAttribute(i,s),j.fromBufferAttribute(i,c);var u=K(t,e,n,r,k,V,j,Q);if(u){a&&(Y.fromBufferAttribute(a,o),J.fromBufferAttribute(a,s),Z.fromBufferAttribute(a,c),u.uv=zi.getUV(Q,k,V,j,Y,J,Z,new un));var h=new nr(o,s,c);zi.getNormal(k,V,j,h.normal),u.face=h}return u}return function(t,e){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),H.copy(r.boundingSphere),H.applyMatrix4(a),!1!==t.ray.intersectsSphere(H)&&(G.getInverse(a),F.copy(t.ray).applyMatrix4(G),null===r.boundingBox||!1!==F.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o,s,c,u,h,l,d,p,f,m=r.index,g=r.attributes.position,v=r.attributes.uv,y=r.groups,x=r.drawRange;if(null!==m)if(Array.isArray(i))for(u=0,l=y.length;u<l;u++)for(f=i[(p=y[u]).materialIndex],h=Math.max(p.start,x.start),d=Math.min(p.start+p.count,x.start+x.count);h<d;h+=3)o=m.getX(h),s=m.getX(h+1),c=m.getX(h+2),(n=$(this,f,t,F,g,v,o,s,c))&&(n.faceIndex=Math.floor(h/3),e.push(n));else for(u=Math.max(0,x.start),l=Math.min(m.count,x.start+x.count);u<l;u+=3)o=m.getX(u),s=m.getX(u+1),c=m.getX(u+2),(n=$(this,i,t,F,g,v,o,s,c))&&(n.faceIndex=Math.floor(u/3),e.push(n));else if(void 0!==g)if(Array.isArray(i))for(u=0,l=y.length;u<l;u++)for(f=i[(p=y[u]).materialIndex],h=Math.max(p.start,x.start),d=Math.min(p.start+p.count,x.start+x.count);h<d;h+=3)(n=$(this,f,t,F,g,v,o=h,s=h+1,c=h+2))&&(n.faceIndex=Math.floor(h/3),e.push(n));else for(u=Math.max(0,x.start),l=Math.min(g.count,x.start+x.count);u<l;u+=3)(n=$(this,i,t,F,g,v,o=u,s=u+1,c=u+2))&&(n.faceIndex=Math.floor(u/3),e.push(n))}else if(r.isGeometry){var b,w,_,M,E=Array.isArray(i),S=r.vertices,T=r.faces,A=r.faceVertexUvs[0];0<A.length&&(M=A);for(var L=0,P=T.length;L<P;L++){var C=T[L],R=E?i[C.materialIndex]:i;if(void 0!==R){if(b=S[C.a],w=S[C.b],_=S[C.c],!0===R.morphTargets){var O=r.morphTargets,I=this.morphTargetInfluences;k.set(0,0,0),V.set(0,0,0),j.set(0,0,0);for(var D=0,B=O.length;D<B;D++){var N=I[D];if(0!==N){var z=O[D].vertices;k.addScaledVector(W.subVectors(z[C.a],b),N),V.addScaledVector(q.subVectors(z[C.b],w),N),j.addScaledVector(X.subVectors(z[C.c],_),N)}}k.add(b),V.add(w),j.add(_),b=k,w=V,_=j}if(n=K(this,R,t,F,b,w,_,Q)){if(M&&M[L]){var U=M[L];Y.copy(U[0]),J.copy(U[1]),Z.copy(U[2]),n.uv=zi.getUV(Q,b,w,_,Y,J,Z,new un)}n.face=C,n.faceIndex=L,e.push(n)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),((Qi.prototype=Object.create(On.prototype)).constructor=Qi).prototype.isCubeTexture=!0,Object.defineProperty(Qi.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Ki.prototype=Object.create(On.prototype)).constructor=Ki).prototype.isDataTexture3D=!0;var $i=new On,ta=new Ki,ea=new Qi;function na(){this.seq=[],this.map={}}var ra=[],ia=[],aa=new Float32Array(16),oa=new Float32Array(9),sa=new Float32Array(4);function ca(t,e,n){var r=t[0];if(r<=0||0<r)return t;var i=e*n,a=ra[i];if(void 0===a&&(a=new Float32Array(i),ra[i]=a),0!==e){r.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function ua(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function ha(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function la(t,e){var n=ia[e];void 0===n&&(n=new Int32Array(e),ia[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocTextureUnit();return n}function da(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function pa(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function fa(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(ua(n,e))return;t.uniform2fv(this.addr,e),ha(n,e)}}function ma(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(ua(n,e))return;t.uniform3fv(this.addr,e),ha(n,e)}}function ga(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(ua(n,e))return;t.uniform4fv(this.addr,e),ha(n,e)}}function va(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(ua(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),ha(n,e)}else{if(ua(n,r))return;sa.set(r),t.uniformMatrix2fv(this.addr,!1,sa),ha(n,r)}}function ya(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(ua(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),ha(n,e)}else{if(ua(n,r))return;oa.set(r),t.uniformMatrix3fv(this.addr,!1,oa),ha(n,r)}}function xa(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(ua(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),ha(n,e)}else{if(ua(n,r))return;aa.set(r),t.uniformMatrix4fv(this.addr,!1,aa),ha(n,r)}}function ba(t,e,n){var r=this.cache,i=n.allocTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(e||$i,i)}function wa(t,e,n){var r=this.cache,i=n.allocTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||ta,i)}function _a(t,e,n){var r=this.cache,i=n.allocTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||ea,i)}function Ma(t,e){var n=this.cache;ua(n,e)||(t.uniform2iv(this.addr,e),ha(n,e))}function Ea(t,e){var n=this.cache;ua(n,e)||(t.uniform3iv(this.addr,e),ha(n,e))}function Sa(t,e){var n=this.cache;ua(n,e)||(t.uniform4iv(this.addr,e),ha(n,e))}function Ta(t,e){var n=this.cache;ua(n,e)||(t.uniform1fv(this.addr,e),ha(n,e))}function Aa(t,e){var n=this.cache;ua(n,e)||(t.uniform1iv(this.addr,e),ha(n,e))}function La(t,e){var n=this.cache,r=ca(e,this.size,2);ua(n,r)||(t.uniform2fv(this.addr,r),this.updateCache(r))}function Pa(t,e){var n=this.cache,r=ca(e,this.size,3);ua(n,r)||(t.uniform3fv(this.addr,r),this.updateCache(r))}function Ca(t,e){var n=this.cache,r=ca(e,this.size,4);ua(n,r)||(t.uniform4fv(this.addr,r),this.updateCache(r))}function Ra(t,e){var n=this.cache,r=ca(e,this.size,4);ua(n,r)||(t.uniformMatrix2fv(this.addr,!1,r),this.updateCache(r))}function Oa(t,e){var n=this.cache,r=ca(e,this.size,9);ua(n,r)||(t.uniformMatrix3fv(this.addr,!1,r),this.updateCache(r))}function Ia(t,e){var n=this.cache,r=ca(e,this.size,16);ua(n,r)||(t.uniformMatrix4fv(this.addr,!1,r),this.updateCache(r))}function Da(t,e,n){var r=this.cache,i=e.length,a=la(n,i);!1===ua(r,a)&&(t.uniform1iv(this.addr,a),ha(r,a));for(var o=0;o!==i;++o)n.setTexture2D(e[o]||$i,a[o])}function Ba(t,e,n){var r=this.cache,i=e.length,a=la(n,i);!1===ua(r,a)&&(t.uniform1iv(this.addr,a),ha(r,a));for(var o=0;o!==i;++o)n.setTextureCube(e[o]||ea,a[o])}function Na(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return da;case 35664:return fa;case 35665:return ma;case 35666:return ga;case 35674:return va;case 35675:return ya;case 35676:return xa;case 35678:case 36198:return ba;case 35679:return wa;case 35680:return _a;case 5124:case 35670:return pa;case 35667:case 35671:return Ma;case 35668:case 35672:return Ea;case 35669:case 35673:return Sa}}(e.type)}function za(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Ta;case 35664:return La;case 35665:return Pa;case 35666:return Ca;case 35674:return Ra;case 35675:return Oa;case 35676:return Ia;case 35678:return Da;case 35680:return Ba;case 5124:case 35670:return Aa;case 35667:case 35671:return Ma;case 35668:case 35672:return Ea;case 35669:case 35673:return Sa}}(e.type)}function Ua(t){this.id=t,na.call(this)}za.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),ha(e,t)},Ua.prototype.setValue=function(t,e,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(t,e[o.id],n)}};var Ga=/([\w\d_]+)(\])?(\[|\.)?/g;function Fa(t,e){t.seq.push(e),t.map[e.id]=e}function Ha(t,e,n){var r=t.name,i=r.length;for(Ga.lastIndex=0;;){var a=Ga.exec(r),o=Ga.lastIndex,s=a[1],c="]"===a[2],u=a[3];if(c&&(s|=0),void 0===u||"["===u&&o+2===i){Fa(n,void 0===u?new Na(s,t,e):new za(s,t,e));break}var h=n.map[s];void 0===h&&Fa(n,h=new Ua(s)),n=h}}function ka(t,e,n){na.call(this),this.renderer=n;for(var r=t.getProgramParameter(e,35718),i=0;i<r;++i){var a=t.getActiveUniform(e,i);Ha(a,t.getUniformLocation(e,a.name),this)}}function Va(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),!1===t.getShaderParameter(r,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===e?"vertex":"fragment",t.getShaderInfoLog(r),function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(n)),r}ka.prototype.setValue=function(t,e,n){var r=this.map[e];void 0!==r&&r.setValue(t,n,this.renderer)},ka.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},ka.upload=function(t,e,n,r){for(var i=0,a=e.length;i!==a;++i){var o=e[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,r)}},ka.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var a=t[r];a.id in e&&n.push(a)}return n};var ja=0;function Wa(t){switch(t){case Je:return["Linear","( value )"];case Ze:return["sRGB","( value )"];case Ke:return["RGBE","( value )"];case tn:return["RGBM","( value, 7.0 )"];case en:return["RGBM","( value, 16.0 )"];case nn:return["RGBD","( value, 256.0 )"];case Qe:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function qa(t,e){var n=Wa(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Xa(t){return""!==t}function Ya(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function Ja(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function Za(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,function(t,e){var n=Hn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Za(n)})}function Qa(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,r){for(var i="",a=parseInt(e);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]");return i})}function Ka(t,e,n,r,i,a,o){var s=t.context,c=r.defines,u=i.vertexShader,h=i.fragmentShader,l="SHADOWMAP_TYPE_BASIC";a.shadowMapType===G?l="SHADOWMAP_TYPE_PCF":a.shadowMapType===F&&(l="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(r.envMap.mapping){case Rt:case Ot:d="ENVMAP_TYPE_CUBE";break;case Nt:case zt:d="ENVMAP_TYPE_CUBE_UV";break;case It:case Dt:d="ENVMAP_TYPE_EQUIREC";break;case Bt:d="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case Ot:case Dt:p="ENVMAP_MODE_REFRACTION"}switch(r.combine){case xt:f="ENVMAP_BLENDING_MULTIPLY";break;case bt:f="ENVMAP_BLENDING_MIX";break;case wt:f="ENVMAP_BLENDING_ADD"}}var m,g,v,y,x,b,w,_,M=0<t.gammaFactor?t.gammaFactor:1,E=o.isWebGL2?"":(m=r.extensions,g=a,v=e,[(m=m||{}).derivatives||g.envMapCubeUV||g.bumpMap||g.normalMap&&!g.objectSpaceNormalMap||g.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(m.fragDepth||g.logarithmicDepthBuffer)&&v.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",m.drawBuffers&&v.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(m.shaderTextureLOD||g.envMap)&&v.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Xa).join("\n")),S=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(c),T=s.createProgram();if(r.isRawShaderMaterial?(0<(y=[S].filter(Xa).join("\n")).length&&(y+="\n"),0<(x=[E,S].filter(Xa).join("\n")).length&&(x+="\n")):(y=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,S,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+M,"#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 "+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.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_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 "+l:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||e.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(Xa).join("\n"),x=[E,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,S,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+M,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.envMap?"#define "+p:"",a.envMap?"#define "+f:"",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.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_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 "+l:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&(o.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==Et?"#define TONE_MAPPING":"",a.toneMapping!==Et?Hn.tonemapping_pars_fragment:"",a.toneMapping!==Et?function(t,e){var n;switch(e){case St:n="Linear";break;case Tt:n="Reinhard";break;case At:n="Uncharted2";break;case Lt:n="OptimizedCineon";break;case Pt:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.matcapEncoding||a.envMapEncoding||a.emissiveMapEncoding?Hn.encodings_pars_fragment:"",a.mapEncoding?qa("mapTexelToLinear",a.mapEncoding):"",a.matcapEncoding?qa("matcapTexelToLinear",a.matcapEncoding):"",a.envMapEncoding?qa("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?qa("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(b="linearToOutputTexel",w=a.outputEncoding,_=Wa(w),"vec4 "+b+"( vec4 value ) { return LinearTo"+_[0]+_[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Xa).join("\n")),u=Ja(u=Ya(u=Za(u),a),a),h=Ja(h=Ya(h=Za(h),a),a),u=Qa(u),h=Qa(h),o.isWebGL2&&!r.isRawShaderMaterial){var A=!1,L=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==u.match(L)&&null!==h.match(L)&&(A=!0,u=u.replace(L,""),h=h.replace(L,"")),y=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,x=["#version 300 es\n","#define varying in",A?"":"out highp vec4 pc_fragColor;",A?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x}var P=x+h,C=Va(s,35633,y+u),R=Va(s,35632,P);s.attachShader(T,C),s.attachShader(T,R),void 0!==r.index0AttributeName?s.bindAttribLocation(T,0,r.index0AttributeName):!0===a.morphTargets&&s.bindAttribLocation(T,0,"position"),s.linkProgram(T);var O,I,D=s.getProgramInfoLog(T).trim(),B=s.getShaderInfoLog(C).trim(),N=s.getShaderInfoLog(R).trim(),z=!0,U=!0;return!1===s.getProgramParameter(T,35714)?(z=!1,console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(T,35715),"gl.getProgramInfoLog",D,B,N)):""!==D?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",D):""!==B&&""!==N||(U=!1),U&&(this.diagnostics={runnable:z,material:r,programLog:D,vertexShader:{log:B,prefix:y},fragmentShader:{log:N,prefix:x}}),s.deleteShader(C),s.deleteShader(R),this.getUniforms=function(){return void 0===O&&(O=new ka(s,T,t)),O},this.getAttributes=function(){return void 0===I&&(I=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i<r;i++){var a=t.getActiveAttrib(e,i).name;n[a]=t.getAttribLocation(e,a)}return n}(s,T)),I},this.destroy=function(){s.deleteProgram(T),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=i.name,this.id=ja++,this.code=n,this.usedTimes=1,this.program=T,this.vertexShader=C,this.fragmentShader=R,this}function $a(l,c,d){var u=[],p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},a=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","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 f(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Je,n===Je&&e&&(n=Qe),n}this.getParameters=function(t,e,n,r,i,a,o){var s=p[t.type],c=o.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(d.floatVertexTextures)return 1024;var n=d.maxVertexUniforms,r=Math.floor((n-20)/4),i=Math.min(r,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}(o):0,u=d.precision;null!==t.precision&&(u=d.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",u,"instead.");var h=l.getRenderTarget();return{shaderID:s,precision:u,supportsVertexTextures:d.vertexTextures,outputEncoding:f(h?h.texture:null,l.gammaOutput),map:!!t.map,mapEncoding:f(t.map,l.gammaInput),matcap:!!t.matcap,matcapEncoding:f(t.matcap,l.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:f(t.envMap,l.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===Nt||t.envMap.mapping===zt),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:f(t.emissiveMap,l.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===sn,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:!!r,useFog:t.fog,fogExp:r&&r.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:d.logarithmicDepthBuffer,skinning:t.skinning&&0<c,maxBones:c,useVertexTexture:d.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:l.maxMorphTargets,maxMorphNormals:l.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:i,numClipIntersection:a,dithering:t.dithering,shadowMapEnabled:l.shadowMap.enabled&&o.receiveShadow&&0<n.length,shadowMapType:l.shadowMap.type,toneMapping:l.toneMapping,physicallyCorrectLights:l.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===tt,flipSided:t.side===Mt,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,e){var n=[];if(e.shaderID?n.push(e.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 i=0;i<a.length;i++)n.push(e[a[i]]);return n.push(t.onBeforeCompile.toString()),n.push(l.gammaOutput),n.push(l.gammaFactor),n.join()},this.acquireProgram=function(t,e,n,r){for(var i,a=0,o=u.length;a<o;a++){var s=u[a];if(s.code===r){++(i=s).usedTimes;break}}return void 0===i&&(i=new Ka(l,c,r,t,e,n,d),u.push(i)),i},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=u.indexOf(t);u[e]=u[u.length-1],u.pop(),t.destroy()}},this.programs=u}function to(){var r=new WeakMap;return{get:function(t){var e=r.get(t);return void 0===e&&(e={},r.set(t,e)),e},remove:function(t){r.delete(t)},update:function(t,e,n){r.get(t)[e]=n},dispose:function(){r=new WeakMap}}}function eo(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function no(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function ro(){var o=[],s=0,c=[],u=[];function h(t,e,n,r,i){var a=o[s];return void 0===a?(a={id:t.id,object:t,geometry:e,material:n,program:n.program,renderOrder:t.renderOrder,z:r,group:i},o[s]=a):(a.id=t.id,a.object=t,a.geometry=e,a.material=n,a.program=n.program,a.renderOrder=t.renderOrder,a.z=r,a.group=i),s++,a}return{opaque:c,transparent:u,init:function(){s=0,c.length=0,u.length=0},push:function(t,e,n,r,i){var a=h(t,e,n,r,i);(!0===n.transparent?u:c).push(a)},unshift:function(t,e,n,r,i){var a=h(t,e,n,r,i);(!0===n.transparent?u:c).unshift(a)},sort:function(){1<c.length&&c.sort(eo),1<u.length&&u.sort(no)}}}function io(){var i={};return{get:function(t,e){var n,r=i[t.id];return void 0===r?(n=new ro,i[t.id]={},i[t.id][e.id]=n):void 0===(n=r[e.id])&&(n=new ro,r[e.id]=n),n},dispose:function(){i={}}}}function ao(){var n={};return{get:function(t){if(void 0!==n[t.id])return n[t.id];var e;switch(t.type){case"DirectionalLight":e={direction:new dn,color:new Jn,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new un};break;case"SpotLight":e={position:new dn,direction:new dn,color:new Jn,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new un};break;case"PointLight":e={position:new dn,color:new Jn,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new un,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":e={direction:new dn,skyColor:new Jn,groundColor:new Jn};break;case"RectAreaLight":e={color:new Jn,position:new dn,halfWidth:new dn,halfHeight:new dn}}return n[t.id]=e}}}var oo=0;function so(){var w=new ao,_={id:oo++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},M=new dn,E=new hn,S=new hn;return{setup:function(t,e,n){for(var r=0,i=0,a=0,o=0,s=0,c=0,u=0,h=0,l=n.matrixWorldInverse,d=0,p=t.length;d<p;d++){var f=t[d],m=f.color,g=f.intensity,v=f.distance,y=f.shadow&&f.shadow.map?f.shadow.map.texture:null;if(f.isAmbientLight)r+=m.r*g,i+=m.g*g,a+=m.b*g;else if(f.isDirectionalLight){if((b=w.get(f)).color.copy(f.color).multiplyScalar(f.intensity),b.direction.setFromMatrixPosition(f.matrixWorld),M.setFromMatrixPosition(f.target.matrixWorld),b.direction.sub(M),b.direction.transformDirection(l),b.shadow=f.castShadow,f.castShadow){var x=f.shadow;b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize}_.directionalShadowMap[o]=y,_.directionalShadowMatrix[o]=f.shadow.matrix,_.directional[o]=b,o++}else if(f.isSpotLight)(b=w.get(f)).position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(l),b.color.copy(m).multiplyScalar(g),b.distance=v,b.direction.setFromMatrixPosition(f.matrixWorld),M.setFromMatrixPosition(f.target.matrixWorld),b.direction.sub(M),b.direction.transformDirection(l),b.coneCos=Math.cos(f.angle),b.penumbraCos=Math.cos(f.angle*(1-f.penumbra)),b.decay=f.decay,b.shadow=f.castShadow,f.castShadow&&(x=f.shadow,b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize),_.spotShadowMap[c]=y,_.spotShadowMatrix[c]=f.shadow.matrix,_.spot[c]=b,c++;else if(f.isRectAreaLight)(b=w.get(f)).color.copy(m).multiplyScalar(g),b.position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(l),S.identity(),E.copy(f.matrixWorld),E.premultiply(l),S.extractRotation(E),b.halfWidth.set(.5*f.width,0,0),b.halfHeight.set(0,.5*f.height,0),b.halfWidth.applyMatrix4(S),b.halfHeight.applyMatrix4(S),_.rectArea[u]=b,u++;else if(f.isPointLight)(b=w.get(f)).position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(l),b.color.copy(f.color).multiplyScalar(f.intensity),b.distance=f.distance,b.decay=f.decay,b.shadow=f.castShadow,f.castShadow&&(x=f.shadow,b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,b.shadowCameraNear=x.camera.near,b.shadowCameraFar=x.camera.far),_.pointShadowMap[s]=y,_.pointShadowMatrix[s]=f.shadow.matrix,_.point[s]=b,s++;else if(f.isHemisphereLight){var b;(b=w.get(f)).direction.setFromMatrixPosition(f.matrixWorld),b.direction.transformDirection(l),b.direction.normalize(),b.skyColor.copy(f.color).multiplyScalar(g),b.groundColor.copy(f.groundColor).multiplyScalar(g),_.hemi[h]=b,h++}}_.ambient[0]=r,_.ambient[1]=i,_.ambient[2]=a,_.directional.length=o,_.spot.length=c,_.rectArea.length=u,_.point.length=s,_.hemi.length=h,_.hash.stateID=_.id,_.hash.directionalLength=o,_.hash.pointLength=s,_.hash.spotLength=c,_.hash.rectAreaLength=u,_.hash.hemiLength=h,_.hash.shadowsLength=e.length},state:_}}function co(){var e=new so,n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:e},setupLights:function(t){e.setup(n,r,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){r.push(t)}}}function uo(){var r={};return{get:function(t,e){var n;return void 0===r[t.id]?(n=new co,r[t.id]={},r[t.id][e.id]=n):void 0===r[t.id][e.id]?(n=new co,r[t.id][e.id]=n):n=r[t.id][e.id],n},dispose:function(){r={}}}}function ho(t){Di.call(this),this.type="MeshDepthMaterial",this.depthPacking=rn,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(t)}function lo(t){Di.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new dn,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(t)}function po(y,m,t){for(var x=new Fn,b=new hn,w=new un,_=new un(t,t),M=new dn,E=new dn,v=1,S=2,e=1+(v|S),T=new Array(e),A=new Array(e),L={},P={0:Mt,1:B,2:tt},C=[new dn(1,0,0),new dn(-1,0,0),new dn(0,0,1),new dn(0,0,-1),new dn(0,1,0),new dn(0,-1,0)],R=[new dn(0,1,0),new dn(0,1,0),new dn(0,1,0),new dn(0,1,0),new dn(0,0,1),new dn(0,0,-1)],O=[new In,new In,new In,new In,new In,new In],n=0;n!==e;++n){var r=0!=(n&v),i=0!=(n&S),a=new ho({depthPacking:an,morphTargets:r,skinning:i});T[n]=a;var o=new lo({morphTargets:r,skinning:i});A[n]=o}var I=this;function g(t,e,n,r,i,a){var o=t.geometry,s=null,c=T,u=t.customDepthMaterial;if(n&&(c=A,u=t.customDistanceMaterial),u)s=u;else{var h=!1;e.morphTargets&&(o&&o.isBufferGeometry?h=o.morphAttributes&&o.morphAttributes.position&&0<o.morphAttributes.position.length:o&&o.isGeometry&&(h=o.morphTargets&&0<o.morphTargets.length)),t.isSkinnedMesh&&!1===e.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var l=t.isSkinnedMesh&&e.skinning,d=0;h&&(d|=v),l&&(d|=S),s=c[d]}if(y.localClippingEnabled&&!0===e.clipShadows&&0!==e.clippingPlanes.length){var p=s.uuid,f=e.uuid,m=L[p];void 0===m&&(m={},L[p]=m);var g=m[f];void 0===g&&(g=s.clone(),m[f]=g),s=g}return s.visible=e.visible,s.wireframe=e.wireframe,s.side=null!=e.shadowSide?e.shadowSide:P[e.side],s.clipShadows=e.clipShadows,s.clippingPlanes=e.clippingPlanes,s.clipIntersection=e.clipIntersection,s.wireframeLinewidth=e.wireframeLinewidth,s.linewidth=e.linewidth,n&&s.isMeshDistanceMaterial&&(s.referencePosition.copy(r),s.nearDistance=i,s.farDistance=a),s}function D(t,e,n,r){if(!1!==t.visible){if(t.layers.test(e.layers)&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!t.frustumCulled||x.intersectsObject(t))){t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld);var i=m.update(t),a=t.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var u=o[s],h=a[u.materialIndex];if(h&&h.visible){var l=g(t,h,r,E,n.near,n.far);y.renderBufferDirect(n,null,i,l,t,u)}}else if(a.visible){l=g(t,a,r,E,n.near,n.far);y.renderBufferDirect(n,null,i,l,t,null)}}for(var d=t.children,p=0,f=d.length;p<f;p++)D(d[p],e,n,r)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=G,this.render=function(t,e,n){if(!1!==I.enabled&&(!1!==I.autoUpdate||!1!==I.needsUpdate)&&0!==t.length){y.context;var r,i=y.state;i.disable(3042),i.buffers.color.setClear(1,1,1,1),i.buffers.depth.setTest(!0),i.setScissorTest(!1);for(var a=0,o=t.length;a<o;a++){var s=t[a],c=s.shadow,u=s&&s.isPointLight;if(void 0!==c){var h=c.camera;if(w.copy(c.mapSize),w.min(_),u){var l=w.x,d=w.y;O[0].set(2*l,d,l,d),O[1].set(0,d,l,d),O[2].set(3*l,d,l,d),O[3].set(l,d,l,d),O[4].set(3*l,0,l,d),O[5].set(l,0,l,d),w.x*=4,w.y*=2}if(null===c.map){var p={minFilter:Ht,magFilter:Ht,format:se};c.map=new Dn(w.x,w.y,p),c.map.texture.name=s.name+".shadowMap",h.updateProjectionMatrix()}c.isSpotLightShadow&&c.update(s);var f=c.map,m=c.matrix;E.setFromMatrixPosition(s.matrixWorld),h.position.copy(E),u?(r=6,m.makeTranslation(-E.x,-E.y,-E.z)):(r=1,M.setFromMatrixPosition(s.target.matrixWorld),h.lookAt(M),h.updateMatrixWorld(),m.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),m.multiply(h.projectionMatrix),m.multiply(h.matrixWorldInverse)),y.setRenderTarget(f),y.clear();for(var g=0;g<r;g++){if(u){M.copy(h.position),M.add(C[g]),h.up.copy(R[g]),h.lookAt(M),h.updateMatrixWorld();var v=O[g];i.viewport(v)}b.multiplyMatrices(h.projectionMatrix,h.matrixWorldInverse),x.setFromMatrix(b),D(e,n,h,u)}}else console.warn("THREE.WebGLShadowMap:",s,"has no shadow.")}I.needsUpdate=!1}}}function fo(h,n,c,r){var i=new function(){var e=!1,a=new In,n=null,o=new In(0,0,0,0);return{setMask:function(t){n===t||e||(h.colorMask(t,t,t,t),n=t)},setLocked:function(t){e=t},setClear:function(t,e,n,r,i){!0===i&&(t*=r,e*=r,n*=r),a.set(t,e,n,r),!1===o.equals(a)&&(h.clearColor(t,e,n,r),o.copy(a))},reset:function(){e=!1,n=null,o.set(-1,0,0,0)}}},a=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(t){t?G(2929):F(2929)},setMask:function(t){n===t||e||(h.depthMask(t),n=t)},setFunc:function(t){if(r!==t){if(t)switch(t){case lt:h.depthFunc(512);break;case dt:h.depthFunc(519);break;case pt:h.depthFunc(513);break;case ft:h.depthFunc(515);break;case mt:h.depthFunc(514);break;case gt:h.depthFunc(518);break;case vt:h.depthFunc(516);break;case yt:h.depthFunc(517);break;default:h.depthFunc(515)}else h.depthFunc(515);r=t}},setLocked:function(t){e=t},setClear:function(t){i!==t&&(h.clearDepth(t),i=t)},reset:function(){e=!1,i=r=n=null}}},e=new function(){var e=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,u=null;return{setTest:function(t){t?G(2960):F(2960)},setMask:function(t){n===t||e||(h.stencilMask(t),n=t)},setFunc:function(t,e,n){r===t&&i===e&&a===n||(h.stencilFunc(t,e,n),r=t,i=e,a=n)},setOp:function(t,e,n){o===t&&s===e&&c===n||(h.stencilOp(t,e,n),o=t,s=e,c=n)},setLocked:function(t){e=t},setClear:function(t){u!==t&&(h.clearStencil(t),u=t)},reset:function(){e=!1,u=c=s=o=a=i=r=n=null}}},t=h.getParameter(34921),o=new Uint8Array(t),s=new Uint8Array(t),u=new Uint8Array(t),l={},d=null,p=null,f=null,m=null,g=null,v=null,y=null,x=null,b=null,w=null,_=!1,M=null,E=null,S=null,T=null,A=null,L=h.getParameter(35661),P=!1,C=0,R=h.getParameter(7938);-1!==R.indexOf("WebGL")?(C=parseFloat(/^WebGL\ ([0-9])/.exec(R)[1]),P=1<=C):-1!==R.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(R)[1]),P=2<=C);var O=null,I={},D=new In,B=new In;function N(t,e,n){var r=new Uint8Array(4),i=h.createTexture();h.bindTexture(t,i),h.texParameteri(t,10241,9728),h.texParameteri(t,10240,9728);for(var a=0;a<n;a++)h.texImage2D(e+a,0,6408,1,1,0,6408,5121,r);return i}var z={};function U(t,e){(o[t]=1,0===s[t]&&(h.enableVertexAttribArray(t),s[t]=1),u[t]!==e)&&((r.isWebGL2?h:n.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,e),u[t]=e)}function G(t){!0!==l[t]&&(h.enable(t),l[t]=!0)}function F(t){!1!==l[t]&&(h.disable(t),l[t]=!1)}function H(t,e,n,r,i,a,o,s){if(t!==J){if(f||(G(3042),f=!0),t===et)i=i||e,a=a||n,o=o||r,e===g&&i===x||(h.blendEquationSeparate(c.convert(e),c.convert(i)),g=e,x=i),n===v&&r===y&&a===b&&o===w||(h.blendFuncSeparate(c.convert(n),c.convert(r),c.convert(a),c.convert(o)),v=n,y=r,b=a,w=o),m=t,_=null;else if(t!==m||s!==_){if(g===nt&&x===nt||(h.blendEquation(32774),x=g=nt),s)switch(t){case Z:h.blendFuncSeparate(1,771,1,771);break;case Q:h.blendFunc(1,1);break;case K:h.blendFuncSeparate(0,0,769,771);break;case $:h.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case Z:h.blendFuncSeparate(770,771,1,771);break;case Q:h.blendFunc(770,1);break;case K:h.blendFunc(0,769);break;case $:h.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}w=b=y=v=null,m=t,_=s}}else f&&(F(3042),f=!1)}function k(t){M!==t&&(t?h.frontFace(2304):h.frontFace(2305),M=t)}function V(t){t!==q?(G(2884),t!==E&&(t===X?h.cullFace(1029):t===Y?h.cullFace(1028):h.cullFace(1032))):F(2884),E=t}function j(t,e,n){t?(G(32823),T===e&&A===n||(h.polygonOffset(e,n),T=e,A=n)):F(32823)}function W(t){void 0===t&&(t=33984+L-1),O!==t&&(h.activeTexture(t),O=t)}return z[3553]=N(3553,3553,1),z[34067]=N(34067,34069,6),i.setClear(0,0,0,1),a.setClear(1),e.setClear(0),G(2929),a.setFunc(ft),k(!1),V(X),G(2884),H(J),{buffers:{color:i,depth:a,stencil:e},initAttributes:function(){for(var t=0,e=o.length;t<e;t++)o[t]=0},enableAttribute:function(t){U(t,0)},enableAttributeAndDivisor:U,disableUnusedAttributes:function(){for(var t=0,e=s.length;t!==e;++t)s[t]!==o[t]&&(h.disableVertexAttribArray(t),s[t]=0)},enable:G,disable:F,getCompressedTextureFormats:function(){if(null===d&&(d=[],n.get("WEBGL_compressed_texture_pvrtc")||n.get("WEBGL_compressed_texture_s3tc")||n.get("WEBGL_compressed_texture_etc1")||n.get("WEBGL_compressed_texture_astc")))for(var t=h.getParameter(34467),e=0;e<t.length;e++)d.push(t[e]);return d},useProgram:function(t){return p!==t&&(h.useProgram(t),p=t,!0)},setBlending:H,setMaterial:function(t,e){t.side===tt?F(2884):G(2884);var n=t.side===Mt;e&&(n=!n),k(n),t.blending===Z&&!1===t.transparent?H(J):H(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),a.setFunc(t.depthFunc),a.setTest(t.depthTest),a.setMask(t.depthWrite),i.setMask(t.colorWrite),j(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:k,setCullFace:V,setLineWidth:function(t){t!==S&&(P&&h.lineWidth(t),S=t)},setPolygonOffset:j,setScissorTest:function(t){t?G(3089):F(3089)},activeTexture:W,bindTexture:function(t,e){null===O&&W();var n=I[O];void 0===n&&(n={type:void 0,texture:void 0},I[O]=n),n.type===t&&n.texture===e||(h.bindTexture(t,e||z[t]),n.type=t,n.texture=e)},compressedTexImage2D:function(){try{h.compressedTexImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{h.texImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{h.texImage3D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===D.equals(t)&&(h.scissor(t.x,t.y,t.z,t.w),D.copy(t))},viewport:function(t){!1===B.equals(t)&&(h.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){for(var t=0;t<s.length;t++)1===s[t]&&(h.disableVertexAttribArray(t),s[t]=0);l={},I={},E=M=m=p=O=d=null,i.reset(),a.reset(),e.reset()}}}function mo(g,i,v,y,x,b,w){var m,s={};function _(t,e){if(t.width>e||t.height>e){if("data"in t)return void console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+t.width+"x"+t.height+").");var n=e/Math.max(t.width,t.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(t.width*n),r.height=Math.floor(t.height*n),r.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+r.width+"x"+r.height),r}return t}function M(t){return cn.isPowerOfTwo(t.width)&&cn.isPowerOfTwo(t.height)}function E(t,e){return t.generateMipmaps&&e&&t.minFilter!==Ht&&t.minFilter!==jt}function S(t,e,n,r){g.generateMipmap(t),y.get(e).__maxMipLevel=Math.log(Math.max(n,r))*Math.LOG2E}function T(t,e){if(!x.isWebGL2)return t;if(6403===t){if(5126===e)return 33326;if(5131===e)return 33325;if(5121===e)return 33321}if(6407===t){if(5126===e)return 34837;if(5131===e)return 34843;if(5121===e)return 32849}if(6408===t){if(5126===e)return 34836;if(5131===e)return 34842;if(5121===e)return 32856}return t}function a(t){return t===Ht||t===kt||t===Vt?9728:9729}function A(t){var e=t.target;e.removeEventListener("dispose",A),function(t){var e=y.get(t);if(t.image&&e.__image__webglTextureCube)g.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)return;g.deleteTexture(e.__webglTexture)}y.remove(t)}(e),e.isVideoTexture&&delete s[e.id],w.memory.textures--}function o(t){var e=t.target;e.removeEventListener("dispose",o),function(t){var e=y.get(t),n=y.get(t.texture);if(!t)return;void 0!==n.__webglTexture&&g.deleteTexture(n.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var r=0;r<6;r++)g.deleteFramebuffer(e.__webglFramebuffer[r]),e.__webglDepthbuffer&&g.deleteRenderbuffer(e.__webglDepthbuffer[r]);else g.deleteFramebuffer(e.__webglFramebuffer),e.__webglDepthbuffer&&g.deleteRenderbuffer(e.__webglDepthbuffer);y.remove(t.texture),y.remove(t)}(e),w.memory.textures--}function c(t,e){var n,r,i,a=y.get(t);if(t.isVideoTexture&&(r=(n=t).id,i=w.render.frame,s[r]!==i&&(s[r]=i,n.update())),0<t.version&&a.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void u(a,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}v.activeTexture(33984+e),v.bindTexture(3553,a.__webglTexture)}function L(t,e,n){var r;if(n?(g.texParameteri(t,10242,b.convert(e.wrapS)),g.texParameteri(t,10243,b.convert(e.wrapT)),g.texParameteri(t,10240,b.convert(e.magFilter)),g.texParameteri(t,10241,b.convert(e.minFilter))):(g.texParameteri(t,10242,33071),g.texParameteri(t,10243,33071),e.wrapS===Gt&&e.wrapT===Gt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),g.texParameteri(t,10240,a(e.magFilter)),g.texParameteri(t,10241,a(e.minFilter)),e.minFilter!==Ht&&e.minFilter!==jt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),r=i.get("EXT_texture_filter_anisotropic")){if(e.type===$t&&null===i.get("OES_texture_float_linear"))return;if(e.type===te&&null===(x.isWebGL2||i.get("OES_texture_half_float_linear")))return;(1<e.anisotropy||y.get(e).__currentAnisotropy)&&(g.texParameterf(t,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,x.getMaxAnisotropy())),y.get(e).__currentAnisotropy=e.anisotropy)}}function u(t,e,n){var r;r=e.isDataTexture3D?32879:3553,void 0===t.__webglInit&&(t.__webglInit=!0,e.addEventListener("dispose",A),t.__webglTexture=g.createTexture(),w.memory.textures++),v.activeTexture(33984+n),v.bindTexture(r,t.__webglTexture),g.pixelStorei(37440,e.flipY),g.pixelStorei(37441,e.premultiplyAlpha),g.pixelStorei(3317,e.unpackAlignment);var i,a,o=_(e.image,x.maxTextureSize);a=e,x.isWebGL2||a.wrapS===Gt&&a.wrapT===Gt&&(a.minFilter===Ht||a.minFilter===jt)||!1!==M(o)||(o=(i=o)instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof ImageBitmap?(void 0===m&&(m=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),m.width=cn.floorPowerOfTwo(i.width),m.height=cn.floorPowerOfTwo(i.height),m.getContext("2d").drawImage(i,0,0,m.width,m.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+i.width+"x"+i.height+"). Resized to "+m.width+"x"+m.height),m):i);var s=M(o),c=b.convert(e.format),u=b.convert(e.type),h=T(c,u);L(r,e,s);var l,d=e.mipmaps;if(e.isDepthTexture){if(h=6402,e.type===$t){if(!x.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");h=36012}else x.isWebGL2&&(h=33189);e.format===le&&6402===h&&e.type!==Zt&&e.type!==Kt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),e.type=Zt,u=b.convert(e.type)),e.format===de&&(h=34041,e.type!==ie&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),e.type=ie,u=b.convert(e.type))),v.texImage2D(3553,0,h,o.width,o.height,0,c,u,null)}else if(e.isDataTexture)if(0<d.length&&s){for(var p=0,f=d.length;p<f;p++)l=d[p],v.texImage2D(3553,p,h,l.width,l.height,0,c,u,l.data);e.generateMipmaps=!1,t.__maxMipLevel=d.length-1}else v.texImage2D(3553,0,h,o.width,o.height,0,c,u,o.data),t.__maxMipLevel=0;else if(e.isCompressedTexture){for(p=0,f=d.length;p<f;p++)l=d[p],e.format!==se&&e.format!==oe?-1<v.getCompressedTextureFormats().indexOf(c)?v.compressedTexImage2D(3553,p,h,l.width,l.height,0,l.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):v.texImage2D(3553,p,h,l.width,l.height,0,c,u,l.data);t.__maxMipLevel=d.length-1}else if(e.isDataTexture3D)v.texImage3D(32879,0,h,o.width,o.height,o.depth,0,c,u,o.data),t.__maxMipLevel=0;else if(0<d.length&&s){for(p=0,f=d.length;p<f;p++)l=d[p],v.texImage2D(3553,p,h,c,u,l);e.generateMipmaps=!1,t.__maxMipLevel=d.length-1}else v.texImage2D(3553,0,h,c,u,o),t.__maxMipLevel=0;E(e,s)&&S(3553,e,o.width,o.height),t.__version=e.version,e.onUpdate&&e.onUpdate(e)}function h(t,e,n,r){var i=b.convert(e.texture.format),a=b.convert(e.texture.type),o=T(i,a);v.texImage2D(r,0,o,e.width,e.height,0,i,a,null),g.bindFramebuffer(36160,t),g.framebufferTexture2D(36160,n,r,y.get(e.texture).__webglTexture,0),g.bindFramebuffer(36160,null)}function l(t,e){g.bindRenderbuffer(36161,t),e.depthBuffer&&!e.stencilBuffer?(g.renderbufferStorage(36161,33189,e.width,e.height),g.framebufferRenderbuffer(36160,36096,36161,t)):e.depthBuffer&&e.stencilBuffer?(g.renderbufferStorage(36161,34041,e.width,e.height),g.framebufferRenderbuffer(36160,33306,36161,t)):g.renderbufferStorage(36161,32854,e.width,e.height),g.bindRenderbuffer(36161,null)}function d(t){var e=y.get(t),n=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,e){if(e&&e.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(g.bindFramebuffer(36160,t),!e.depthTexture||!e.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");y.get(e.depthTexture).__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0),c(e.depthTexture,0);var n=y.get(e.depthTexture).__webglTexture;if(e.depthTexture.format===le)g.framebufferTexture2D(36160,36096,3553,n,0);else{if(e.depthTexture.format!==de)throw new Error("Unknown depthTexture format");g.framebufferTexture2D(36160,33306,3553,n,0)}}(e.__webglFramebuffer,t)}else if(n){e.__webglDepthbuffer=[];for(var r=0;r<6;r++)g.bindFramebuffer(36160,e.__webglFramebuffer[r]),e.__webglDepthbuffer[r]=g.createRenderbuffer(),l(e.__webglDepthbuffer[r],t)}else g.bindFramebuffer(36160,e.__webglFramebuffer),e.__webglDepthbuffer=g.createRenderbuffer(),l(e.__webglDepthbuffer,t);g.bindFramebuffer(36160,null)}this.setTexture2D=c,this.setTexture3D=function(t,e){var n=y.get(t);0<t.version&&n.__version!==t.version?u(n,t,e):(v.activeTexture(33984+e),v.bindTexture(32879,n.__webglTexture))},this.setTextureCube=function(t,e){var n=y.get(t);if(6===t.image.length)if(0<t.version&&n.__version!==t.version){n.__image__webglTextureCube||(t.addEventListener("dispose",A),n.__image__webglTextureCube=g.createTexture(),w.memory.textures++),v.activeTexture(33984+e),v.bindTexture(34067,n.__image__webglTextureCube),g.pixelStorei(37440,t.flipY);for(var r=t&&t.isCompressedTexture,i=t.image[0]&&t.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=r||i?i?t.image[o].image:t.image[o]:_(t.image[o],x.maxCubemapSize);var s=a[0],c=M(s),u=b.convert(t.format),h=b.convert(t.type),l=T(u,h);for(L(34067,t,c),o=0;o<6;o++)if(r)for(var d,p=a[o].mipmaps,f=0,m=p.length;f<m;f++)d=p[f],t.format!==se&&t.format!==oe?-1<v.getCompressedTextureFormats().indexOf(u)?v.compressedTexImage2D(34069+o,f,l,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v.texImage2D(34069+o,f,l,d.width,d.height,0,u,h,d.data);else i?v.texImage2D(34069+o,0,l,a[o].width,a[o].height,0,u,h,a[o].data):v.texImage2D(34069+o,0,l,u,h,a[o]);n.__maxMipLevel=r?p.length-1:0,E(t,c)&&S(34067,t,s.width,s.height),n.__version=t.version,t.onUpdate&&t.onUpdate(t)}else v.activeTexture(33984+e),v.bindTexture(34067,n.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,e){v.activeTexture(33984+e),v.bindTexture(34067,y.get(t).__webglTexture)},this.setupRenderTarget=function(t){var e=y.get(t),n=y.get(t.texture);t.addEventListener("dispose",o),n.__webglTexture=g.createTexture(),w.memory.textures++;var r=!0===t.isWebGLRenderTargetCube,i=M(t);if(r){e.__webglFramebuffer=[];for(var a=0;a<6;a++)e.__webglFramebuffer[a]=g.createFramebuffer()}else e.__webglFramebuffer=g.createFramebuffer();if(r){for(v.bindTexture(34067,n.__webglTexture),L(34067,t.texture,i),a=0;a<6;a++)h(e.__webglFramebuffer[a],t,36064,34069+a);E(t.texture,i)&&S(34067,t.texture,t.width,t.height),v.bindTexture(34067,null)}else v.bindTexture(3553,n.__webglTexture),L(3553,t.texture,i),h(e.__webglFramebuffer,t,36064,3553),E(t.texture,i)&&S(3553,t.texture,t.width,t.height),v.bindTexture(3553,null);t.depthBuffer&&d(t)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(E(e,M(t))){var n=t.isWebGLRenderTargetCube?34067:3553,r=y.get(e).__webglTexture;v.bindTexture(n,r),S(n,e,t.width,t.height),v.bindTexture(n,null)}}}function go(t,n,r){return{convert:function(t){var e;if(t===Ut)return 10497;if(t===Gt)return 33071;if(t===Ft)return 33648;if(t===Ht)return 9728;if(t===kt)return 9984;if(t===Vt)return 9986;if(t===jt)return 9729;if(t===Wt)return 9985;if(t===qt)return 9987;if(t===Xt)return 5121;if(t===ee)return 32819;if(t===ne)return 32820;if(t===re)return 33635;if(t===Yt)return 5120;if(t===Jt)return 5122;if(t===Zt)return 5123;if(t===Qt)return 5124;if(t===Kt)return 5125;if(t===$t)return 5126;if(t===te){if(r.isWebGL2)return 5131;if(null!==(e=n.get("OES_texture_half_float")))return e.HALF_FLOAT_OES}if(t===ae)return 6406;if(t===oe)return 6407;if(t===se)return 6408;if(t===ce)return 6409;if(t===ue)return 6410;if(t===le)return 6402;if(t===de)return 34041;if(t===pe)return 6403;if(t===nt)return 32774;if(t===z)return 32778;if(t===U)return 32779;if(t===V)return 0;if(t===j)return 1;if(t===W)return 768;if(t===rt)return 769;if(t===it)return 770;if(t===at)return 771;if(t===ot)return 772;if(t===st)return 773;if(t===ct)return 774;if(t===ut)return 775;if(t===ht)return 776;if((t===fe||t===me||t===ge||t===ve)&&null!==(e=n.get("WEBGL_compressed_texture_s3tc"))){if(t===fe)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===me)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===ge)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===ve)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===ye||t===xe||t===be||t===we)&&null!==(e=n.get("WEBGL_compressed_texture_pvrtc"))){if(t===ye)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===xe)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===be)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===we)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===_e&&null!==(e=n.get("WEBGL_compressed_texture_etc1")))return e.COMPRESSED_RGB_ETC1_WEBGL;if((t===Me||t===Ee||t===Se||t===Te||t===Ae||t===Le||t===Pe||t===Ce||t===Re||t===Oe||t===Ie||t===De||t===Be||t===Ne)&&null!==(e=n.get("WEBGL_compressed_texture_astc")))return t;if(t===H||t===k){if(r.isWebGL2){if(t===H)return 32775;if(t===k)return 32776}if(null!==(e=n.get("EXT_blend_minmax"))){if(t===H)return e.MIN_EXT;if(t===k)return e.MAX_EXT}}if(t===ie){if(r.isWebGL2)return 34042;if(null!==(e=n.get("WEBGL_depth_texture")))return e.UNSIGNED_INT_24_8_WEBGL}return 0}}}function vo(){Er.call(this),this.type="Group"}function yo(){Er.call(this),this.type="Camera",this.matrixWorldInverse=new hn,this.projectionMatrix=new hn,this.projectionMatrixInverse=new hn}function xo(t,e,n,r){yo.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function bo(t){xo.call(this),this.cameras=t||[]}((ho.prototype=Object.create(Di.prototype)).constructor=ho).prototype.isMeshDepthMaterial=!0,ho.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((lo.prototype=Object.create(Di.prototype)).constructor=lo).prototype.isMeshDistanceMaterial=!0,lo.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},vo.prototype=Object.assign(Object.create(Er.prototype),{constructor:vo,isGroup:!0}),yo.prototype=Object.assign(Object.create(Er.prototype),{constructor:yo,isCamera:!0,copy:function(t,e){return Er.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new dn),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Er.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),xo.prototype=Object.assign(Object.create(yo.prototype),{constructor:xo,isPerspectiveCamera:!0,copy:function(t,e){return yo.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*cn.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*cn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*cn.RAD2DEG*Math.atan(Math.tan(.5*cn.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(t,e,n,r,i,a){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*cn.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,e-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Er.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),bo.prototype=Object.assign(Object.create(xo.prototype),{constructor:bo,isArrayCamera:!0});var wo,_o,Mo,Eo,So,To,Ao,Lo,Po,Co,Ro,Oo,Io,Do,Bo,No,zo=new dn,Uo=new dn;function Go(t,e,n){zo.setFromMatrixPosition(e.matrixWorld),Uo.setFromMatrixPosition(n.matrixWorld);var r=zo.distanceTo(Uo),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],u=(i[9]-1)/i[5],h=(i[8]-1)/i[0],l=(a[8]+1)/a[0],d=o*h,p=o*l,f=r/(-h+l),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=o+f,v=s+f,y=d-m,x=p+(r-m),b=c*s/v*g,w=u*s/v*g;t.projectionMatrix.makePerspective(y,x,b,w,g,v)}function Fo(r){var i=this,c=null,u=null,h=null,l=[],d=new hn,p=new hn,a=1,f="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(u=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",t,!1));var m=new hn,g=new ln,v=new dn,y=new xo;y.bounds=new In(0,0,.5,1),y.layers.enable(1);var x=new xo;x.bounds=new In(.5,0,.5,1),x.layers.enable(2);var o,s,b=new bo([y,x]);function w(){return null!==c&&!0===c.isPresenting}function t(){if(w()){var t=c.getEyeParameters("left"),e=t.renderWidth*a,n=t.renderHeight*a;s=r.getPixelRatio(),o=r.getSize(),r.setDrawingBufferSize(2*e,n,1),E.start()}else i.enabled&&r.setDrawingBufferSize(o.width,o.height,s),E.stop()}b.layers.enable(1),b.layers.enable(2);var _=[];function M(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),n=0,r=0,i=e.length;n<i;n++){var a=e[n];if(a&&("Daydream Controller"===a.id||"Gear VR Controller"===a.id||"Oculus Go Controller"===a.id||"OpenVR Gamepad"===a.id||a.id.startsWith("Oculus Touch")||a.id.startsWith("Spatial Controller"))){if(r===t)return a;r++}}}this.enabled=!1,this.getController=function(t){var e=l[t];return void 0===e&&((e=new vo).matrixAutoUpdate=!1,e.visible=!1,l[t]=e),e},this.getDevice=function(){return c},this.setDevice=function(t){void 0!==t&&(c=t),E.setContext(t)},this.setFramebufferScaleFactor=function(t){a=t},this.setFrameOfReferenceType=function(t){f=t},this.setPoseTarget=function(t){void 0!==t&&(h=t)},this.getCamera=function(t){var e="stage"===f?1.6:0;if(null===c)return t.position.set(0,e,0),t;if(c.depthNear=t.near,c.depthFar=t.far,c.getFrameData(u),"stage"===f){var n=c.stageParameters;n?d.fromArray(n.sittingToStandingTransform):d.makeTranslation(0,e,0)}var r=u.pose,i=null!==h?h:t;if(i.matrix.copy(d),i.matrix.decompose(i.position,i.quaternion,i.scale),null!==r.orientation&&(g.fromArray(r.orientation),i.quaternion.multiply(g)),null!==r.position&&(g.setFromRotationMatrix(d),v.fromArray(r.position),v.applyQuaternion(g),i.position.add(v)),i.updateMatrixWorld(),!1===c.isPresenting)return t;y.near=t.near,x.near=t.near,y.far=t.far,x.far=t.far,y.matrixWorldInverse.fromArray(u.leftViewMatrix),x.matrixWorldInverse.fromArray(u.rightViewMatrix),p.getInverse(d),"stage"===f&&(y.matrixWorldInverse.multiply(p),x.matrixWorldInverse.multiply(p));var a=i.parent;null!==a&&(m.getInverse(a.matrixWorld),y.matrixWorldInverse.multiply(m),x.matrixWorldInverse.multiply(m)),y.matrixWorld.getInverse(y.matrixWorldInverse),x.matrixWorld.getInverse(x.matrixWorldInverse),y.projectionMatrix.fromArray(u.leftProjectionMatrix),x.projectionMatrix.fromArray(u.rightProjectionMatrix),Go(b,y,x);var o=c.getLayers();if(o.length){var s=o[0];null!==s.leftBounds&&4===s.leftBounds.length&&y.bounds.fromArray(s.leftBounds),null!==s.rightBounds&&4===s.rightBounds.length&&x.bounds.fromArray(s.rightBounds)}return function(){for(var t=0;t<l.length;t++){var e=l[t],n=M(t);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var r=n.pose;!1===r.hasPosition&&e.position.set(.2,-.6,-.05),null!==r.position&&e.position.fromArray(r.position),null!==r.orientation&&e.quaternion.fromArray(r.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(d),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var i="Daydream Controller"===n.id?0:1;_[t]!==n.buttons[i].pressed&&(_[t]=n.buttons[i].pressed,!0===_[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}(),b},this.getStandingMatrix=function(){return d},this.isPresenting=w;var E=new tr;this.setAnimationLoop=function(t){E.setAnimationLoop(t)},this.submitFrame=function(){w()&&c.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",t)}}function Ho(e){var n=e.context,r=null,d=null,i=1,p=null,a="stage",f=null,m=[],g=[];function o(){return null!==d&&null!==p}var s=new xo;s.layers.enable(1),s.viewport=new In;var c=new xo;c.layers.enable(2),c.viewport=new In;var v=new bo([s,c]);function u(t){var e=m[g.indexOf(t.inputSource)];e&&e.dispatchEvent({type:t.type})}function h(){e.setFramebuffer(null),x.stop()}function l(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}v.layers.enable(1),v.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=m[t];return void 0===e&&((e=new vo).matrixAutoUpdate=!1,e.visible=!1,m[t]=e),e},this.getDevice=function(){return r},this.setDevice=function(t){void 0!==t&&(r=t),t instanceof XRDevice&&n.setCompatibleXRDevice(t)},this.setFramebufferScaleFactor=function(t){i=t},this.setFrameOfReferenceType=function(t){a=t},this.setSession=function(t){null!==(d=t)&&(d.addEventListener("select",u),d.addEventListener("selectstart",u),d.addEventListener("selectend",u),d.addEventListener("end",h),d.baseLayer=new XRWebGLLayer(d,n,{framebufferScaleFactor:i}),d.requestFrameOfReference(a).then(function(t){p=t,e.setFramebuffer(d.baseLayer.framebuffer),x.setContext(d),x.start()}),g=d.getInputSources(),d.addEventListener("inputsourceschange",function(){g=d.getInputSources(),console.log(g);for(var t=0;t<m.length;t++){m[t].userData.inputSource=g[t]}}))},this.getCamera=function(t){if(o()){var e=t.parent,n=v.cameras;l(v,e);for(var r=0;r<n.length;r++)l(n[r],e);t.matrixWorld.copy(v.matrixWorld);for(var i=t.children,a=(r=0,i.length);r<a;r++)i[r].updateMatrixWorld(!0);return Go(v,s,c),v}return t},this.isPresenting=o;var y=null;var x=new tr;x.setAnimationLoop(function(t,e){if(null!==(f=e.getDevicePose(p)))for(var n=d.baseLayer,r=e.views,i=0;i<r.length;i++){var a=r[i],o=n.getViewport(a),s=f.getViewMatrix(a),c=v.cameras[i];c.matrix.fromArray(s).getInverse(c.matrix),c.projectionMatrix.fromArray(a.projectionMatrix),c.viewport.set(o.x,o.y,o.width,o.height),0===i&&v.matrix.copy(c.matrix)}for(i=0;i<m.length;i++){var u=m[i],h=g[i];if(h){var l=e.getInputPose(h,p);if(null!==l){"targetRay"in l?u.matrix.elements=l.targetRay.transformMatrix:"pointerMatrix"in l&&(u.matrix.elements=l.pointerMatrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.visible=!0;continue}}u.visible=!1}y&&y(t)}),this.setAnimationLoop=function(t){y=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new THREE.Matrix4},this.submitFrame=function(){}}function ko(t){console.log("THREE.WebGLRenderer",_t);var r=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",p=null,H=null;this.domElement=r,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=St,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var k,M,V,j,h,W,l,E,S,f,y,d,m,g,T,A,L,v,q=this,x=!1,b=null,w=null,_=null,X=-1,P={geometry:null,program:null,wireframe:!1},Y=null,C=null,R=new In,O=new In,I=null,J=0,D=r.width,Z=r.height,Q=1,B=new In(0,0,D,Z),N=new In(0,0,D,Z),z=!1,U=new Fn,K=new Vi,$=!1,tt=!1,G=new hn,et=new dn;function F(){return null===w?Q:1}try{var nt={alpha:n,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u};if(r.addEventListener("webglcontextlost",ot,!1),r.addEventListener("webglcontextrestored",st,!1),null===(k=e||r.getContext("webgl",nt)||r.getContext("experimental-webgl",nt)))throw null!==r.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===k.getShaderPrecisionFormat&&(k.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){console.error("THREE.WebGLRenderer: "+t.message)}function rt(){M=new ji(k),(V=new ki(k,M,t)).isWebGL2||(M.get("WEBGL_depth_texture"),M.get("OES_texture_float"),M.get("OES_texture_half_float"),M.get("OES_texture_half_float_linear"),M.get("OES_standard_derivatives"),M.get("OES_element_index_uint"),M.get("ANGLE_instanced_arrays")),M.get("OES_texture_float_linear"),v=new go(k,M,V),(j=new fo(k,M,v,V)).scissor(O.copy(N).multiplyScalar(Q)),j.viewport(R.copy(B).multiplyScalar(Q)),h=new Xi(k),W=new to,l=new mo(k,M,j,W,V,v,h),E=new er(k),S=new Wi(k,E,h),f=new Zi(S,h),T=new Ji(k),y=new $a(q,M,V),d=new io,m=new uo,g=new Fi(q,j,f,s),A=new Hi(k,M,h,V),L=new qi(k,M,h,V),h.programs=y.programs,q.context=k,q.capabilities=V,q.extensions=M,q.properties=W,q.renderLists=d,q.state=j,q.info=h}rt();var it=null;"undefined"!=typeof navigator&&(it="xr"in navigator?new Ho(q):new Fo(q)),this.vr=it;var at=new po(q,f,V.maxTextureSize);function ot(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function st(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1,rt()}function ct(t){var e,n=t.target;n.removeEventListener("dispose",ct),ut(e=n),W.remove(e)}function ut(t){var e=W.get(t).program;(t.program=void 0)!==e&&y.releaseProgram(e)}this.shadowMap=at,this.getContext=function(){return k},this.getContextAttributes=function(){return k.getContextAttributes()},this.forceContextLoss=function(){var t=M.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=M.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return Q},this.setPixelRatio=function(t){void 0!==t&&(Q=t,this.setSize(D,Z,!1))},this.getSize=function(){return{width:D,height:Z}},this.setSize=function(t,e,n){it.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(D=t,Z=e,r.width=t*Q,r.height=e*Q,!1!==n&&(r.style.width=t+"px",r.style.height=e+"px"),this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(){return{width:D*Q,height:Z*Q}},this.setDrawingBufferSize=function(t,e,n){D=t,Z=e,Q=n,r.width=t*n,r.height=e*n,this.setViewport(0,0,t,e)},this.getCurrentViewport=function(){return R},this.setViewport=function(t,e,n,r){B.set(t,Z-e-r,n,r),j.viewport(R.copy(B).multiplyScalar(Q))},this.setScissor=function(t,e,n,r){N.set(t,Z-e-r,n,r),j.scissor(O.copy(N).multiplyScalar(Q))},this.setScissorTest=function(t){j.setScissorTest(z=t)},this.getClearColor=function(){return g.getClearColor()},this.setClearColor=function(){g.setClearColor.apply(g,arguments)},this.getClearAlpha=function(){return g.getClearAlpha()},this.setClearAlpha=function(){g.setClearAlpha.apply(g,arguments)},this.clear=function(t,e,n){var r=0;(void 0===t||t)&&(r|=16384),(void 0===e||e)&&(r|=256),(void 0===n||n)&&(r|=1024),k.clear(r)},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.dispose=function(){r.removeEventListener("webglcontextlost",ot,!1),r.removeEventListener("webglcontextrestored",st,!1),d.dispose(),m.dispose(),W.dispose(),f.dispose(),it.dispose(),ft.stop()},this.renderBufferImmediate=function(t,e){j.initAttributes();var n=W.get(t);t.hasPositions&&!n.position&&(n.position=k.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=k.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=k.createBuffer()),t.hasColors&&!n.color&&(n.color=k.createBuffer());var r=e.getAttributes();t.hasPositions&&(k.bindBuffer(34962,n.position),k.bufferData(34962,t.positionArray,35048),j.enableAttribute(r.position),k.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(k.bindBuffer(34962,n.normal),k.bufferData(34962,t.normalArray,35048),j.enableAttribute(r.normal),k.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(k.bindBuffer(34962,n.uv),k.bufferData(34962,t.uvArray,35048),j.enableAttribute(r.uv),k.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(k.bindBuffer(34962,n.color),k.bufferData(34962,t.colorArray,35048),j.enableAttribute(r.color),k.vertexAttribPointer(r.color,3,5126,!1,0,0)),j.disableUnusedAttributes(),k.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,r,i,a){var o=i.isMesh&&i.normalMatrix.determinant()<0;j.setMaterial(r,o);var s=yt(t,e,r,i),c=!1;P.geometry===n.id&&P.program===s.id&&P.wireframe===(!0===r.wireframe)||(P.geometry=n.id,P.program=s.id,P.wireframe=!0===r.wireframe,c=!0),i.morphTargetInfluences&&(T.update(i,n,r,s),c=!0);var u,h=n.index,l=n.attributes.position,d=1;!0===r.wireframe&&(h=S.getWireframeAttribute(n),d=2);var p=A;null!==h&&(u=E.get(h),(p=L).setIndex(u)),c&&(!function(t,e,n){if(n&&n.isInstancedBufferGeometry&!V.isWebGL2&&null===M.get("ANGLE_instanced_arrays"))return console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");j.initAttributes();var r=n.attributes,i=e.getAttributes(),a=t.defaultAttributeValues;for(var o in i){var s=i[o];if(0<=s){var c=r[o];if(void 0!==c){var u=c.normalized,h=c.itemSize,l=E.get(c);if(void 0===l)continue;var d=l.buffer,p=l.type,f=l.bytesPerElement;if(c.isInterleavedBufferAttribute){var m=c.data,g=m.stride,v=c.offset;m&&m.isInstancedInterleavedBuffer?(j.enableAttributeAndDivisor(s,m.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=m.meshPerAttribute*m.count)):j.enableAttribute(s),k.bindBuffer(34962,d),k.vertexAttribPointer(s,h,p,u,g*f,v*f)}else c.isInstancedBufferAttribute?(j.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):j.enableAttribute(s),k.bindBuffer(34962,d),k.vertexAttribPointer(s,h,p,u,0,0)}else if(void 0!==a){var y=a[o];if(void 0!==y)switch(y.length){case 2:k.vertexAttrib2fv(s,y);break;case 3:k.vertexAttrib3fv(s,y);break;case 4:k.vertexAttrib4fv(s,y);break;default:k.vertexAttrib1fv(s,y)}}}}j.disableUnusedAttributes()}(r,s,n),null!==h&&k.bindBuffer(34963,u.buffer));var f=1/0;null!==h?f=h.count:void 0!==l&&(f=l.count);var m=n.drawRange.start*d,g=n.drawRange.count*d,v=null!==a?a.start*d:0,y=null!==a?a.count*d:1/0,x=Math.max(m,v),b=Math.min(f,m+g,v+y)-1,w=Math.max(0,b-x+1);if(0!==w){if(i.isMesh)if(!0===r.wireframe)j.setLineWidth(r.wireframeLinewidth*F()),p.setMode(1);else switch(i.drawMode){case qe:p.setMode(4);break;case Xe:p.setMode(5);break;case Ye:p.setMode(6)}else if(i.isLine){var _=r.linewidth;void 0===_&&(_=1),j.setLineWidth(_*F()),i.isLineSegments?p.setMode(1):i.isLineLoop?p.setMode(2):p.setMode(3)}else i.isPoints?p.setMode(0):i.isSprite&&p.setMode(4);n&&n.isInstancedBufferGeometry?0<n.maxInstancedCount&&p.renderInstances(n,x,w):p.render(x,w)}},this.compile=function(n,t){(H=m.get(n,t)).init(),n.traverse(function(t){t.isLight&&(H.pushLight(t),t.castShadow&&H.pushShadow(t))}),H.setupLights(t),n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var e=0;e<t.material.length;e++)vt(t.material[e],n.fog,t);else vt(t.material,n.fog,t)})};var ht=null;var lt,dt,pt,ft=new tr;function mt(t,e,n,r){for(var i=0,a=t.length;i<a;i++){var o=t[i],s=o.object,c=o.geometry,u=void 0===r?o.material:r,h=o.group;if(n.isArrayCamera)for(var l=(C=n).cameras,d=0,p=l.length;d<p;d++){var f=l[d];if(s.layers.test(f.layers)){if("viewport"in f)j.viewport(R.copy(f.viewport));else{var m=f.bounds,g=m.x*D,v=m.y*Z,y=m.z*D,x=m.w*Z;j.viewport(R.set(g,v,y,x).multiplyScalar(Q))}H.setupLights(f),gt(s,e,f,c,u,h)}}else C=null,gt(s,e,n,c,u,h)}}function gt(t,e,n,r,i,a){if(t.onBeforeRender(q,e,n,r,i,a),H=m.get(e,C||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){j.setMaterial(i);var o=yt(n,e.fog,i,t);P.geometry=null,P.program=null,P.wireframe=!1,s=o,t.render(function(t){q.renderBufferImmediate(t,s)})}else q.renderBufferDirect(n,e.fog,r,i,t,a);var s;t.onAfterRender(q,e,n,r,i,a),H=m.get(e,C||n)}function vt(t,e,n){var r=W.get(t),i=H.state.lights,a=H.state.shadowsArray,o=r.lightsHash,s=i.state.hash,c=y.getParameters(t,i.state,a,e,K.numPlanes,K.numIntersection,n),u=y.getProgramCode(t,c),h=r.program,l=!0;if(void 0===h)t.addEventListener("dispose",ct);else if(h.code!==u)ut(t);else if(o.stateID!==s.stateID||o.directionalLength!==s.directionalLength||o.pointLength!==s.pointLength||o.spotLength!==s.spotLength||o.rectAreaLength!==s.rectAreaLength||o.hemiLength!==s.hemiLength||o.shadowsLength!==s.shadowsLength)o.stateID=s.stateID,o.directionalLength=s.directionalLength,o.pointLength=s.pointLength,o.spotLength=s.spotLength,o.rectAreaLength=s.rectAreaLength,o.hemiLength=s.hemiLength,o.shadowsLength=s.shadowsLength,l=!1;else{if(void 0!==c.shaderID)return;l=!1}if(l){if(c.shaderID){var d=$n[c.shaderID];r.shader={name:t.type,uniforms:kn(d.uniforms),vertexShader:d.vertexShader,fragmentShader:d.fragmentShader}}else r.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(r.shader,q),u=y.getProgramCode(t,c),h=y.acquireProgram(t,r.shader,c,u),r.program=h,t.program=h}var p=h.getAttributes();if(t.morphTargets)for(var f=t.numSupportedMorphTargets=0;f<q.maxMorphTargets;f++)0<=p["morphTarget"+f]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(f=t.numSupportedMorphNormals=0;f<q.maxMorphNormals;f++)0<=p["morphNormal"+f]&&t.numSupportedMorphNormals++;var m=r.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=K.numPlanes,r.numIntersection=K.numIntersection,m.clippingPlanes=K.uniform),r.fog=e,void 0===o&&(r.lightsHash=o={}),o.stateID=s.stateID,o.directionalLength=s.directionalLength,o.pointLength=s.pointLength,o.spotLength=s.spotLength,o.rectAreaLength=s.rectAreaLength,o.hemiLength=s.hemiLength,o.shadowsLength=s.shadowsLength,t.lights&&(m.ambientLightColor.value=i.state.ambient,m.directionalLights.value=i.state.directional,m.spotLights.value=i.state.spot,m.rectAreaLights.value=i.state.rectArea,m.pointLights.value=i.state.point,m.hemisphereLights.value=i.state.hemi,m.directionalShadowMap.value=i.state.directionalShadowMap,m.directionalShadowMatrix.value=i.state.directionalShadowMatrix,m.spotShadowMap.value=i.state.spotShadowMap,m.spotShadowMatrix.value=i.state.spotShadowMatrix,m.pointShadowMap.value=i.state.pointShadowMap,m.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms(),v=ka.seqWithValue(g.seq,m);r.uniformsList=v}function yt(t,e,n,r){J=0;var i=W.get(n),a=H.state.lights,o=i.lightsHash,s=a.state.hash;if($&&(tt||t!==Y)){var c=t===Y&&n.id===X;K.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,i,c)}!1===n.needsUpdate&&(void 0===i.program?n.needsUpdate=!0:n.fog&&i.fog!==e?n.needsUpdate=!0:(!n.lights||o.stateID===s.stateID&&o.directionalLength===s.directionalLength&&o.pointLength===s.pointLength&&o.spotLength===s.spotLength&&o.rectAreaLength===s.rectAreaLength&&o.hemiLength===s.hemiLength&&o.shadowsLength===s.shadowsLength)&&(void 0===i.numClippingPlanes||i.numClippingPlanes===K.numPlanes&&i.numIntersection===K.numIntersection)||(n.needsUpdate=!0)),n.needsUpdate&&(vt(n,e,r),n.needsUpdate=!1);var u,h,l,d,p,f,m,g,v,y,x,b,w,_,M,E,S,T,A,L,P=!1,C=!1,R=!1,O=i.program,I=O.getUniforms(),D=i.shader.uniforms;if(j.useProgram(O.program)&&(R=C=P=!0),n.id!==X&&(X=n.id,C=!0),P||Y!==t){if(I.setValue(k,"projectionMatrix",t.projectionMatrix),V.logarithmicDepthBuffer&&I.setValue(k,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),Y!==t&&(Y=t,R=C=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var B=I.map.cameraPosition;void 0!==B&&B.setValue(k,et.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&I.setValue(k,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){I.setOptional(k,r,"bindMatrix"),I.setOptional(k,r,"bindMatrixInverse");var N=r.skeleton;if(N){var z=N.bones;if(V.floatVertexTextures){if(void 0===N.boneTexture){var U=Math.sqrt(4*z.length);U=cn.ceilPowerOfTwo(U),U=Math.max(U,4);var G=new Float32Array(U*U*4);G.set(N.boneMatrices);var F=new Nn(G,U,U,se,$t);F.needsUpdate=!0,N.boneMatrices=G,N.boneTexture=F,N.boneTextureSize=U}I.setValue(k,"boneTexture",N.boneTexture),I.setValue(k,"boneTextureSize",N.boneTextureSize)}else I.setOptional(k,N,"boneMatrices")}}return C&&(I.setValue(k,"toneMappingExposure",q.toneMappingExposure),I.setValue(k,"toneMappingWhitePoint",q.toneMappingWhitePoint),n.lights&&(L=R,(A=D).ambientLightColor.needsUpdate=L,A.directionalLights.needsUpdate=L,A.pointLights.needsUpdate=L,A.spotLights.needsUpdate=L,A.rectAreaLights.needsUpdate=L,A.hemisphereLights.needsUpdate=L),e&&n.fog&&(T=e,(S=D).fogColor.value=T.color,T.isFog?(S.fogNear.value=T.near,S.fogFar.value=T.far):T.isFogExp2&&(S.fogDensity.value=T.density)),n.isMeshBasicMaterial?xt(D,n):n.isMeshLambertMaterial?(xt(D,n),M=D,(E=n).emissiveMap&&(M.emissiveMap.value=E.emissiveMap)):n.isMeshPhongMaterial?(xt(D,n),n.isMeshToonMaterial?(bt(w=D,_=n),_.gradientMap&&(w.gradientMap.value=_.gradientMap)):bt(D,n)):n.isMeshStandardMaterial?(xt(D,n),n.isMeshPhysicalMaterial?(wt(x=D,b=n),x.reflectivity.value=b.reflectivity,x.clearCoat.value=b.clearCoat,x.clearCoatRoughness.value=b.clearCoatRoughness):wt(D,n)):n.isMeshMatcapMaterial?(xt(D,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(D,n)):n.isMeshDepthMaterial?(xt(D,n),v=D,(y=n).displacementMap&&(v.displacementMap.value=y.displacementMap,v.displacementScale.value=y.displacementScale,v.displacementBias.value=y.displacementBias)):n.isMeshDistanceMaterial?(xt(D,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(D,n)):n.isMeshNormalMaterial?(xt(D,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(D,n)):n.isLineBasicMaterial?(g=n,(m=D).diffuse.value=g.color,m.opacity.value=g.opacity,n.isLineDashedMaterial&&(f=n,(p=D).dashSize.value=f.dashSize,p.totalSize.value=f.dashSize+f.gapSize,p.scale.value=f.scale)):n.isPointsMaterial?(d=n,(l=D).diffuse.value=d.color,l.opacity.value=d.opacity,l.size.value=d.size*Q,l.scale.value=.5*Z,l.map.value=d.map,null!==d.map&&(!0===d.map.matrixAutoUpdate&&d.map.updateMatrix(),l.uvTransform.value.copy(d.map.matrix))):n.isSpriteMaterial?(h=n,(u=D).diffuse.value=h.color,u.opacity.value=h.opacity,u.rotation.value=h.rotation,u.map.value=h.map,null!==h.map&&(!0===h.map.matrixAutoUpdate&&h.map.updateMatrix(),u.uvTransform.value.copy(h.map.matrix))):n.isShadowMaterial&&(D.color.value=n.color,D.opacity.value=n.opacity),void 0!==D.ltc_1&&(D.ltc_1.value=Kn.LTC_1),void 0!==D.ltc_2&&(D.ltc_2.value=Kn.LTC_2),ka.upload(k,i.uniformsList,D,q)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(ka.upload(k,i.uniformsList,D,q),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&I.setValue(k,"center",r.center),I.setValue(k,"modelViewMatrix",r.modelViewMatrix),I.setValue(k,"normalMatrix",r.normalMatrix),I.setValue(k,"modelMatrix",r.matrixWorld),O}function xt(t,e){var n;t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=W.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function bt(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function wt(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Mt&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Mt&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}ft.setAnimationLoop(function(t){it.isPresenting()||ht&&ht(t)}),"undefined"!=typeof window&&ft.setContext(window),this.setAnimationLoop=function(t){ht=t,it.setAnimationLoop(t),ft.start()},this.render=function(t,e,n,r){if(e&&e.isCamera){if(!x){P.geometry=null,P.program=null,P.wireframe=!1,X=-1,!(Y=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),it.enabled&&(e=it.getCamera(e)),(H=m.get(t,e)).init(),t.onBeforeRender(q,t,e,n),G.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),U.setFromMatrix(G),tt=this.localClippingEnabled,$=K.init(this.clippingPlanes,tt,e),(p=d.get(t,e)).init(),function t(e,n,r){if(!1===e.visible)return;var i=e.layers.test(n.layers);if(i)if(e.isLight)H.pushLight(e),e.castShadow&&H.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||U.intersectsSprite(e)){r&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);var a=f.update(e),o=e.material;p.push(e,a,o,et.z,null)}}else if(e.isImmediateRenderObject)r&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G),p.push(e,null,e.material,et.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||U.intersectsObject(e))){r&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);var a=f.update(e),o=e.material;if(Array.isArray(o))for(var s=a.groups,c=0,u=s.length;c<u;c++){var h=s[c],l=o[h.materialIndex];l&&l.visible&&p.push(e,a,l,et.z,h)}else o.visible&&p.push(e,a,o,et.z,null)}var d=e.children;for(var c=0,u=d.length;c<u;c++)t(d[c],n,r)}(t,e,q.sortObjects),!0===q.sortObjects&&p.sort(),$&&K.beginShadows();var i=H.state.shadowsArray;at.render(i,t,e),H.setupLights(e),$&&K.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),g.render(p,t,e,r);var a=p.opaque,o=p.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;a.length&&mt(a,t,e,s),o.length&&mt(o,t,e,s)}else a.length&&mt(a,t,e),o.length&&mt(o,t,e);n&&l.updateRenderTargetMipmap(n),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),t.onAfterRender(q,t,e),it.enabled&&it.submitFrame(),H=p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var t=J;return t>=V.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+V.maxTextures),J+=1,t},this.setTexture2D=(lt=!1,function(t,e){t&&t.isWebGLRenderTarget&&(lt||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),lt=!0),t=t.texture),l.setTexture2D(t,e)}),this.setTexture3D=function(t,e){l.setTexture3D(t,e)},this.setTexture=(dt=!1,function(t,e){dt||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),dt=!0),l.setTexture2D(t,e)}),this.setTextureCube=(pt=!1,function(t,e){t&&t.isWebGLRenderTargetCube&&(pt||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),pt=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?l.setTextureCube(t,e):l.setTextureCubeDynamic(t,e)}),this.setFramebuffer=function(t){b=t},this.getRenderTarget=function(){return w},this.setRenderTarget=function(t){(w=t)&&void 0===W.get(t).__webglFramebuffer&&l.setupRenderTarget(t);var e=b,n=!1;if(t){var r=W.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=r[t.activeCubeFace],n=!0):e=r,R.copy(t.viewport),O.copy(t.scissor),I=t.scissorTest}else R.copy(B).multiplyScalar(Q),O.copy(N).multiplyScalar(Q),I=z;if(_!==e&&(k.bindFramebuffer(36160,e),_=e),j.viewport(R),j.scissor(O),j.setScissorTest(I),n){var i=W.get(t.texture);k.framebufferTexture2D(36160,36064,34069+t.activeCubeFace,i.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,n,r,i,a){if(t&&t.isWebGLRenderTarget){var o=W.get(t).__webglFramebuffer;if(o){var s=!1;o!==_&&(k.bindFramebuffer(36160,o),s=!0);try{var c=t.texture,u=c.format,h=c.type;if(u!==se&&v.convert(u)!==k.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===Xt||v.convert(h)===k.getParameter(35738)||h===$t&&(V.isWebGL2||M.get("OES_texture_float")||M.get("WEBGL_color_buffer_float"))||h===te&&(V.isWebGL2?M.get("EXT_color_buffer_float"):M.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===k.checkFramebufferStatus(36160)?0<=e&&e<=t.width-r&&0<=n&&n<=t.height-i&&k.readPixels(e,n,r,i,v.convert(u),v.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&k.bindFramebuffer(36160,_)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var r=e.image.width,i=e.image.height,a=v.convert(e.format);this.setTexture2D(e,0),k.copyTexImage2D(3553,n||0,a,t.x,t.y,r,i,0)},this.copyTextureToTexture=function(t,e,n,r){var i=e.image.width,a=e.image.height,o=v.convert(n.format),s=v.convert(n.type);this.setTexture2D(n,0),e.isDataTexture?k.texSubImage2D(3553,r||0,t.x,t.y,i,a,o,s,e.image.data):k.texSubImage2D(3553,r||0,t.x,t.y,o,s,e.image)}}function Vo(t,e){this.name="",this.color=new Jn(t),this.density=void 0!==e?e:25e-5}function jo(t,e,n){this.name="",this.color=new Jn(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Wo(){Er.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function qo(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Xo(t,e,n,r){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function Yo(t){Di.call(this),this.type="SpriteMaterial",this.color=new Jn(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function Jo(t){if(Er.call(this),this.type="Sprite",void 0===wo){wo=new ri;var e=new qo(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);wo.setIndex([0,1,2,0,2,3]),wo.addAttribute("position",new Xo(e,3,0,!1)),wo.addAttribute("uv",new Xo(e,2,3,!1))}this.geometry=wo,this.material=void 0!==t?t:new Yo,this.center=new un(.5,.5)}function Zo(){Er.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Qo(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Gi.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new hn,this.bindMatrixInverse=new hn}function Ko(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new hn)}}function $o(){Er.call(this),this.type="Bone"}function ts(t){Di.call(this),this.type="LineBasicMaterial",this.color=new Jn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function es(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Er.call(this),this.type="Line",this.geometry=void 0!==t?t:new ri,this.material=void 0!==e?e:new ts({color:16777215*Math.random()})}function ns(t,e){es.call(this,t,e),this.type="LineSegments"}function rs(t,e){es.call(this,t,e),this.type="LineLoop"}function is(t){Di.call(this),this.type="PointsMaterial",this.color=new Jn(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function as(t,e){Er.call(this),this.type="Points",this.geometry=void 0!==t?t:new ri,this.material=void 0!==e?e:new is({color:16777215*Math.random()})}function os(t,e,n,r,i,a,o,s,c){On.call(this,t,e,n,r,i,a,o,s,c),this.format=void 0!==o?o:oe,this.minFilter=void 0!==a?a:jt,this.magFilter=void 0!==i?i:jt,this.generateMipmaps=!1}function ss(t,e,n,r,i,a,o,s,c,u,h,l){On.call(this,null,a,o,s,c,u,r,i,h,l),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function cs(t,e,n,r,i,a,o,s,c){On.call(this,t,e,n,r,i,a,o,s,c),this.needsUpdate=!0}function us(t,e,n,r,i,a,o,s,c,u){if((u=void 0!==u?u:le)!==le&&u!==de)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===le&&(n=Zt),void 0===n&&u===de&&(n=ie),On.call(this,null,r,i,a,o,s,u,n,c),this.image={width:t,height:e},this.magFilter=void 0!==o?o:Ht,this.minFilter=void 0!==s?s:Ht,this.flipY=!1,this.generateMipmaps=!1}function hs(t){ri.call(this),this.type="WireframeGeometry";var e,n,r,i,a,o,s,c,u,h,l=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,r=m.length;e<r;e++){var g=m[e];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+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=t.vertices[o.index1],l.push(h.x,h.y,h.z),h=t.vertices[o.index2],l.push(h.x,h.y,h.z)}else if(t&&t.isBufferGeometry){var v,y,x,b,w,_;if(h=new dn,null!==t.index){for(v=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),i=0,a=x.length;i<a;++i)for(r=(e=(b=x[i]).start)+b.count;e<r;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),c=y.getX(e+(n+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(v,o.index1),l.push(h.x,h.y,h.z),h.fromBufferAttribute(v,o.index2),l.push(h.x,h.y,h.z)}else for(e=0,r=(v=t.attributes.position).count/3;e<r;e++)for(n=0;n<3;n++)w=3*e+n,h.fromBufferAttribute(v,w),l.push(h.x,h.y,h.z),_=3*e+(n+1)%3,h.fromBufferAttribute(v,_),l.push(h.x,h.y,h.z)}this.addAttribute("position",new kr(l,3))}function ls(t,e,n){Ir.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new ds(t,e,n)),this.mergeVertices()}function ds(t,e,n){ri.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var r,i,a=[],o=[],s=[],c=[],u=new dn,h=new dn,l=new dn,d=new dn,p=new dn;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=e+1;for(r=0;r<=n;r++){var m=r/n;for(i=0;i<=e;i++){var g=i/e;t(g,m,h),o.push(h.x,h.y,h.z),0<=g-1e-5?(t(g-1e-5,m,l),d.subVectors(h,l)):(t(g+1e-5,m,l),d.subVectors(l,h)),0<=m-1e-5?(t(g,m-1e-5,l),p.subVectors(h,l)):(t(g,m+1e-5,l),p.subVectors(l,h)),u.crossVectors(d,p).normalize(),s.push(u.x,u.y,u.z),c.push(g,m)}}for(r=0;r<n;r++)for(i=0;i<e;i++){var v=r*f+i,y=r*f+i+1,x=(r+1)*f+i+1,b=(r+1)*f+i;a.push(v,y,b),a.push(y,x,b)}this.setIndex(a),this.addAttribute("position",new kr(o,3)),this.addAttribute("normal",new kr(s,3)),this.addAttribute("uv",new kr(c,2))}function ps(t,e,n,r){Ir.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},this.fromBufferGeometry(new fs(t,e,n,r)),this.mergeVertices()}function fs(r,a,t,e){ri.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:a,radius:t,detail:e},t=t||1;var h=[],l=[];function o(t,e,n,r){var i,a,o=Math.pow(2,r),s=[];for(i=0;i<=o;i++){s[i]=[];var c=t.clone().lerp(n,i/o),u=e.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)s[i][a]=0===a&&i===o?c:c.clone().lerp(u,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var l=Math.floor(a/2);a%2==0?(d(s[i][l+1]),d(s[i+1][l]),d(s[i][l])):(d(s[i][l+1]),d(s[i+1][l+1]),d(s[i+1][l]))}}function d(t){h.push(t.x,t.y,t.z)}function s(t,e){var n=3*t;e.x=r[n+0],e.y=r[n+1],e.z=r[n+2]}function p(t,e,n,r){r<0&&1===t.x&&(l[e]=t.x-1),0===n.x&&0===n.z&&(l[e]=r/2/Math.PI+.5)}function f(t){return Math.atan2(t.z,-t.x)}!function(t){for(var e=new dn,n=new dn,r=new dn,i=0;i<a.length;i+=3)s(a[i+0],e),s(a[i+1],n),s(a[i+2],r),o(e,n,r,t)}(e=e||0),function(t){for(var e=new dn,n=0;n<h.length;n+=3)e.x=h[n+0],e.y=h[n+1],e.z=h[n+2],e.normalize().multiplyScalar(t),h[n+0]=e.x,h[n+1]=e.y,h[n+2]=e.z}(t),function(){for(var t=new dn,e=0;e<h.length;e+=3){t.x=h[e+0],t.y=h[e+1],t.z=h[e+2];var n=f(t)/2/Math.PI+.5,r=(i=t,Math.atan2(-i.y,Math.sqrt(i.x*i.x+i.z*i.z))/Math.PI+.5);l.push(n,1-r)}var i;(function(){for(var t=new dn,e=new dn,n=new dn,r=new dn,i=new un,a=new un,o=new un,s=0,c=0;s<h.length;s+=9,c+=6){t.set(h[s+0],h[s+1],h[s+2]),e.set(h[s+3],h[s+4],h[s+5]),n.set(h[s+6],h[s+7],h[s+8]),i.set(l[c+0],l[c+1]),a.set(l[c+2],l[c+3]),o.set(l[c+4],l[c+5]),r.copy(t).add(e).add(n).divideScalar(3);var u=f(r);p(i,c+0,t,u),p(a,c+2,e,u),p(o,c+4,n,u)}})(),function(){for(var t=0;t<l.length;t+=6){var e=l[t+0],n=l[t+2],r=l[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);.9<i&&a<.1&&(e<.2&&(l[t+0]+=1),n<.2&&(l[t+2]+=1),r<.2&&(l[t+4]+=1))}}()}(),this.addAttribute("position",new kr(h,3)),this.addAttribute("normal",new kr(h.slice(),3)),this.addAttribute("uv",new kr(l,2)),0===e?this.computeVertexNormals():this.normalizeNormals()}function ms(t,e){Ir.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new gs(t,e)),this.mergeVertices()}function gs(t,e){fs.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],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function vs(t,e){Ir.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ys(t,e)),this.mergeVertices()}function ys(t,e){fs.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],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function xs(t,e){Ir.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new bs(t,e)),this.mergeVertices()}function bs(t,e){var n=(1+Math.sqrt(5))/2;fs.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[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],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ws(t,e){Ir.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new _s(t,e)),this.mergeVertices()}function _s(t,e){var n=(1+Math.sqrt(5))/2,r=1/n;fs.call(this,[-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,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,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],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ms(t,e,n,r,i,a){Ir.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Es(t,e,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Es(o,s,c,u,t){ri.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:s,radius:c,radialSegments:u,closed:t},s=s||64,c=c||1,u=u||8,t=t||!1;var h=o.computeFrenetFrames(s,t);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var i,l,d=new dn,p=new dn,e=new un,f=new dn,m=[],g=[],n=[],a=[];function r(t){f=o.getPointAt(t/s,f);var e=h.normals[t],n=h.binormals[t];for(l=0;l<=u;l++){var r=l/u*Math.PI*2,i=Math.sin(r),a=-Math.cos(r);p.x=a*e.x+i*n.x,p.y=a*e.y+i*n.y,p.z=a*e.z+i*n.z,p.normalize(),g.push(p.x,p.y,p.z),d.x=f.x+c*p.x,d.y=f.y+c*p.y,d.z=f.z+c*p.z,m.push(d.x,d.y,d.z)}}!function(){for(i=0;i<s;i++)r(i);r(!1===t?s:0),function(){for(i=0;i<=s;i++)for(l=0;l<=u;l++)e.x=i/s,e.y=l/u,n.push(e.x,e.y)}(),function(){for(l=1;l<=s;l++)for(i=1;i<=u;i++){var t=(u+1)*(l-1)+(i-1),e=(u+1)*l+(i-1),n=(u+1)*l+i,r=(u+1)*(l-1)+i;a.push(t,e,r),a.push(e,n,r)}}()}(),this.setIndex(a),this.addAttribute("position",new kr(m,3)),this.addAttribute("normal",new kr(g,3)),this.addAttribute("uv",new kr(n,2))}function Ss(t,e,n,r,i,a,o){Ir.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Ts(t,e,n,r,i,a)),this.mergeVertices()}function Ts(t,e,n,r,i,a){ri.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:a},t=t||1,e=e||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,c=[],u=[],h=[],l=[],d=new dn,p=new dn,f=new dn,m=new dn,g=new dn,v=new dn,y=new dn;for(o=0;o<=n;++o){var x=o/n*i*Math.PI*2;for(A(x,i,a,t,f),A(x+.01,i,a,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=r;++s){var b=s/r*Math.PI*2,w=-e*Math.cos(b),_=e*Math.sin(b);d.x=f.x+(w*y.x+_*g.x),d.y=f.y+(w*y.y+_*g.y),d.z=f.z+(w*y.z+_*g.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/n),l.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var M=(r+1)*(s-1)+(o-1),E=(r+1)*s+(o-1),S=(r+1)*s+o,T=(r+1)*(s-1)+o;c.push(M,E,T),c.push(E,S,T)}function A(t,e,n,r,i){var a=Math.cos(t),o=Math.sin(t),s=n/e*t,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new kr(u,3)),this.addAttribute("normal",new kr(h,3)),this.addAttribute("uv",new kr(l,2))}function As(t,e,n,r,i){Ir.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new Ls(t,e,n,r,i)),this.mergeVertices()}function Ls(t,e,n,r,i){ri.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||1,e=e||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],c=[],u=[],h=[],l=new dn,d=new dn,p=new dn;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),c.push(d.x,d.y,d.z),l.x=t*Math.cos(f),l.y=t*Math.sin(f),p.subVectors(d,l).normalize(),u.push(p.x,p.y,p.z),h.push(o/r),h.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,v=(r+1)*(a-1)+o-1,y=(r+1)*(a-1)+o,x=(r+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.addAttribute("position",new kr(c,3)),this.addAttribute("normal",new kr(u,3)),this.addAttribute("uv",new kr(h,2))}Vo.prototype.isFogExp2=!0,Vo.prototype.clone=function(){return new Vo(this.color,this.density)},Vo.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},jo.prototype.isFog=!0,jo.prototype.clone=function(){return new jo(this.color,this.near,this.far)},jo.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Wo.prototype=Object.assign(Object.create(Er.prototype),{constructor:Wo,copy:function(t,e){return Er.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Er.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),Object.defineProperty(qo.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(qo.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(Xo.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Xo.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}}),((Yo.prototype=Object.create(Di.prototype)).constructor=Yo).prototype.isSpriteMaterial=!0,Yo.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},Jo.prototype=Object.assign(Object.create(Er.prototype),{constructor:Jo,isSprite:!0,raycast:function(){var c=new dn,u=new dn,h=new dn,o=new un,s=new un,l=new hn,d=new dn,p=new dn,f=new dn,m=new un,g=new un,v=new un;function y(t,e,n,r,i,a){o.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(s.x=a*o.x-i*o.y,s.y=i*o.x+a*o.y):s.copy(o),t.copy(e),t.x+=s.x,t.y+=s.y,t.applyMatrix4(l)}return function(t,e){u.setFromMatrixScale(this.matrixWorld),l.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),h.setFromMatrixPosition(this.modelViewMatrix);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;y(d.set(-.5,-.5,0),h,a,u,n,r),y(p.set(.5,-.5,0),h,a,u,n,r),y(f.set(.5,.5,0),h,a,u,n,r),m.set(0,0),g.set(1,0),v.set(1,1);var o=t.ray.intersectTriangle(d,p,f,!1,c);if(null!==o||(y(p.set(-.5,.5,0),h,a,u,n,r),g.set(0,1),null!==(o=t.ray.intersectTriangle(d,f,p,!1,c)))){var s=t.ray.origin.distanceTo(c);s<t.near||s>t.far||e.push({distance:s,point:c.clone(),uv:zi.getUV(c,d,p,f,m,g,v,new un),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Er.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),Zo.prototype=Object.assign(Object.create(Er.prototype),{constructor:Zo,copy:function(t){Er.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n<r;n++){var i=e[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,r=0;r<n.length&&!(e<n[r].distance);r++);n.splice(r,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object},raycast:(Eo=new dn,function(t,e){Eo.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Eo);this.getObjectForDistance(n).raycast(t,e)}),update:(_o=new dn,Mo=new dn,function(t){var e=this.levels;if(1<e.length){_o.setFromMatrixPosition(t.matrixWorld),Mo.setFromMatrixPosition(this.matrixWorld);var n=_o.distanceTo(Mo);e[0].object.visible=!0;for(var r=1,i=e.length;r<i&&n>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(;r<i;r++)e[r].object.visible=!1}}),toJSON:function(t){var e=Er.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),Qo.prototype=Object.assign(Object.create(Gi.prototype),{constructor:Qo,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new In,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Gi.prototype.updateMatrixWorld.call(this,t),"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)}}),Object.assign(Ko.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new hn;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:(So=new hn,To=new hn,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=t.length;i<a;i++){var o=t[i]?t[i].matrixWorld:To;So.multiplyMatrices(o,e[i]),So.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new Ko(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}}}),$o.prototype=Object.assign(Object.create(Er.prototype),{constructor:$o,isBone:!0}),((ts.prototype=Object.create(Di.prototype)).constructor=ts).prototype.isLineBasicMaterial=!0,ts.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},es.prototype=Object.assign(Object.create(Er.prototype),{constructor:es,isLine:!0,computeLineDistances:(Co=new dn,Ro=new dn,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)Co.fromBufferAttribute(e,r-1),Ro.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=Co.distanceTo(Ro);t.addAttribute("lineDistance",new kr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for((n=t.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this}),raycast:(Ao=new hn,Lo=new Ni,Po=new Un,function(t,e){var n=t.linePrecision,r=this.geometry,i=this.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),Po.copy(r.boundingSphere),Po.applyMatrix4(i),Po.radius+=n,!1!==t.ray.intersectsSphere(Po)){Ao.getInverse(i),Lo.copy(t.ray).applyMatrix4(Ao);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new dn,c=new dn,u=new dn,h=new dn,l=this&&this.isLineSegments?2:1;if(r.isBufferGeometry){var d=r.index,p=r.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length-1;m<g;m+=l){var v=f[m],y=f[m+1];s.fromArray(p,3*v),c.fromArray(p,3*y),o<Lo.distanceSqToSegment(s,c,h,u)||(h.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(h))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else for(m=0,g=p.length/3-1;m<g;m+=l)s.fromArray(p,3*m),c.fromArray(p,3*m+3),o<Lo.distanceSqToSegment(s,c,h,u)||(h.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(h))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var x=r.vertices,b=x.length;for(m=0;m<b-1;m+=l){var w;o<Lo.distanceSqToSegment(x[m],x[m+1],h,u)||(h.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(h))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}}}}),copy:function(t){return Er.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),ns.prototype=Object.assign(Object.create(es.prototype),{constructor:ns,isLineSegments:!0,computeLineDistances:(Oo=new dn,Io=new dn,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;r<i;r+=2)Oo.fromBufferAttribute(e,r),Io.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Oo.distanceTo(Io);t.addAttribute("lineDistance",new kr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for(n=t.lineDistances,r=0,i=a.length;r<i;r+=2)Oo.copy(a[r]),Io.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Oo.distanceTo(Io)}return this})}),rs.prototype=Object.assign(Object.create(es.prototype),{constructor:rs,isLineLoop:!0}),((is.prototype=Object.create(Di.prototype)).constructor=is).prototype.isPointsMaterial=!0,is.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},as.prototype=Object.assign(Object.create(Er.prototype),{constructor:as,isPoints:!0,raycast:(Do=new hn,Bo=new Ni,No=new Un,function(i,a){var o=this,t=this.geometry,s=this.matrixWorld,e=i.params.Points.threshold;if(null===t.boundingSphere&&t.computeBoundingSphere(),No.copy(t.boundingSphere),No.applyMatrix4(s),No.radius+=e,!1!==i.ray.intersectsSphere(No)){Do.getInverse(s),Bo.copy(i.ray).applyMatrix4(Do);var n=e/((this.scale.x+this.scale.y+this.scale.z)/3),c=n*n,r=new dn,u=new dn;if(t.isBufferGeometry){var h=t.index,l=t.attributes.position.array;if(null!==h)for(var d=h.array,p=0,f=d.length;p<f;p++){var m=d[p];r.fromArray(l,3*m),y(r,m)}else{p=0;for(var g=l.length/3;p<g;p++)r.fromArray(l,3*p),y(r,p)}}else{var v=t.vertices;for(p=0,g=v.length;p<g;p++)y(v[p],p)}}function y(t,e){var n=Bo.distanceSqToPoint(t);if(n<c){Bo.closestPointToPoint(t,u),u.applyMatrix4(s);var r=i.ray.origin.distanceTo(u);if(r<i.near||r>i.far)return;a.push({distance:r,distanceToRay:Math.sqrt(n),point:u.clone(),index:e,face:null,object:o})}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),os.prototype=Object.assign(Object.create(On.prototype),{constructor:os,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((ss.prototype=Object.create(On.prototype)).constructor=ss).prototype.isCompressedTexture=!0,((cs.prototype=Object.create(On.prototype)).constructor=cs).prototype.isCanvasTexture=!0,((us.prototype=Object.create(On.prototype)).constructor=us).prototype.isDepthTexture=!0,(hs.prototype=Object.create(ri.prototype)).constructor=hs,(ls.prototype=Object.create(Ir.prototype)).constructor=ls,(ds.prototype=Object.create(ri.prototype)).constructor=ds,(ps.prototype=Object.create(Ir.prototype)).constructor=ps,(fs.prototype=Object.create(ri.prototype)).constructor=fs,(ms.prototype=Object.create(Ir.prototype)).constructor=ms,(gs.prototype=Object.create(fs.prototype)).constructor=gs,(vs.prototype=Object.create(Ir.prototype)).constructor=vs,(ys.prototype=Object.create(fs.prototype)).constructor=ys,(xs.prototype=Object.create(Ir.prototype)).constructor=xs,(bs.prototype=Object.create(fs.prototype)).constructor=bs,(ws.prototype=Object.create(Ir.prototype)).constructor=ws,(_s.prototype=Object.create(fs.prototype)).constructor=_s,(Ms.prototype=Object.create(Ir.prototype)).constructor=Ms,(Es.prototype=Object.create(ri.prototype)).constructor=Es,(Ss.prototype=Object.create(Ir.prototype)).constructor=Ss,(Ts.prototype=Object.create(ri.prototype)).constructor=Ts,(As.prototype=Object.create(Ir.prototype)).constructor=As,(Ls.prototype=Object.create(ri.prototype)).constructor=Ls;var Ps=function(t,e,n){n=n||2;var r,i,a,o,s,c,u,h=e&&e.length,l=h?e[0]*n:t.length,d=Cs(t,0,l,n,!0),p=[];if(!d)return p;if(h&&(d=function(t,e,n,r){var i,a,o,s,c,u=[];for(i=0,a=e.length;i<a;i++)o=e[i]*r,s=i<a-1?e[i+1]*r:t.length,(c=Cs(t,o,s,r,!1))===c.next&&(c.steiner=!0),u.push(Fs(c));for(u.sort(zs),i=0;i<u.length;i++)Us(u[i],n),n=Rs(n,n.next);return n}(t,e,d,n)),t.length>80*n){r=a=t[0],i=o=t[1];for(var f=n;f<l;f+=n)(s=t[f])<r&&(r=s),(c=t[f+1])<i&&(i=c),a<s&&(a=s),o<c&&(o=c);u=0!==(u=Math.max(a-r,o-i))?1/u:0}return Os(d,p,n,r,i,u),p};function Cs(t,e,n,r,i){var a,o;if(i===0<function(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,n,r))for(a=e;a<n;a+=r)o=Xs(a,t[a],t[a+1],o);else for(a=n-r;e<=a;a-=r)o=Xs(a,t[a],t[a+1],o);return o&&Vs(o,o.next)&&(Ys(o),o=o.next),o}function Rs(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Vs(r,r.next)&&0!==ks(r.prev,r,r.next))r=r.next;else{if(Ys(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function Os(t,e,n,r,i,a,o){if(t){!o&&a&&function(t,e,n,r){var i=t;for(;null===i.z&&(i.z=Gs(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==t;);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,a,o,s,c,u=1;do{for(n=t,a=t=null,o=0;n;){for(o++,r=n,e=s=0;e<u&&(s++,r=r.nextZ);e++);for(c=u;0<s||0<c&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(n=(i=n).nextZ,s--):(r=(i=r).nextZ,c--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(1<o)}(i)}(t,r,i,a);for(var s,c,u=t;t.prev!==t.next;)if(s=t.prev,c=t.next,a?Ds(t,r,i,a):Is(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),Ys(t),t=c.next,u=c.next;else if((t=c)===u){o?1===o?Os(t=Bs(t,e,n),e,n,r,i,a,2):2===o&&Ns(t,e,n,r,i,a):Os(Rs(t),e,n,r,i,a,1);break}}}function Is(t){var e=t.prev,n=t,r=t.next;if(0<=ks(e,n,r))return!1;for(var i=t.next.next;i!==t.prev;){if(Hs(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=ks(i.prev,i,i.next))return!1;i=i.next}return!0}function Ds(t,e,n,r){var i=t.prev,a=t,o=t.next;if(0<=ks(i,a,o))return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,h=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=Gs(s,c,e,n,r),d=Gs(u,h,e,n,r),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&Hs(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ks(p.prev,p,p.next))return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&Hs(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ks(p.prev,p,p.next))return!1;p=p.prevZ}return!0}function Bs(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!Vs(i,a)&&js(i,r,r.next,a)&&Ws(i,a)&&Ws(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),Ys(r),Ys(r.next),r=t=a),r=r.next}while(r!==t);return r}function Ns(t,e,n,r,i,a){var o,s,c=t;do{for(var u=c.next.next;u!==c.prev;){if(c.i!==u.i&&(s=u,(o=c).next.i!==s.i&&o.prev.i!==s.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&js(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(o,s)&&Ws(o,s)&&Ws(s,o)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;for(;n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==t;);return r}(o,s))){var h=qs(c,u);return c=Rs(c,c.next),h=Rs(h,h.next),Os(c,e,n,r,i,a),void Os(h,e,n,r,i,a)}u=u.next}c=c.next}while(c!==t)}function zs(t,e){return t.x-e.x}function Us(t,e){if(e=function(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&o<s){if((o=s)===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===o)return n.prev;var c,u=n,h=n.x,l=n.y,d=1/0;r=n.next;for(;r!==u;)i>=r.x&&r.x>=h&&i!==r.x&&Hs(a<l?i:o,a,h,l,a<l?o:i,a,r.x,r.y)&&((c=Math.abs(a-r.y)/(i-r.x))<d||c===d&&r.x>n.x)&&Ws(r,t)&&(n=r,d=c),r=r.next;return n}(t,e)){var n=qs(e,t);Rs(n,n.next)}}function Gs(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Fs(t){for(var e=t,n=t;e.x<n.x&&(n=e),(e=e.next)!==t;);return n}function Hs(t,e,n,r,i,a,o,s){return 0<=(i-o)*(e-s)-(t-o)*(a-s)&&0<=(t-o)*(r-s)-(n-o)*(e-s)&&0<=(n-o)*(a-s)-(i-o)*(r-s)}function ks(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Vs(t,e){return t.x===e.x&&t.y===e.y}function js(t,e,n,r){return!!(Vs(t,e)&&Vs(n,r)||Vs(t,r)&&Vs(n,e))||0<ks(t,e,n)!=0<ks(t,e,r)&&0<ks(n,r,t)!=0<ks(n,r,e)}function Ws(t,e){return ks(t.prev,t,t.next)<0?0<=ks(t,e,t.next)&&0<=ks(t,t.prev,e):ks(t,e,t.prev)<0||ks(t,t.next,e)<0}function qs(t,e){var n=new Js(t.i,t.x,t.y),r=new Js(e.i,e.x,e.y),i=t.next,a=e.prev;return(t.next=e).prev=t,(n.next=i).prev=n,(r.next=n).prev=r,(a.next=r).prev=a,r}function Xs(t,e,n,r){var i=new Js(t,e,n);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function Ys(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Js(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Zs={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return Zs.area(t)<0},triangulateShape:function(t,e){var n=[],r=[],i=[];Qs(t),Ks(n,t);var a=t.length;e.forEach(Qs);for(var o=0;o<e.length;o++)r.push(a),a+=e[o].length,Ks(n,e[o]);var s=Ps(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function Qs(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function Ks(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function $s(t,e){Ir.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new tc(t,e)),this.mergeVertices()}function tc(t,Z){ri.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:Z},t=Array.isArray(t)?t:[t];for(var Q=this,K=[],$=[],e=0,n=t.length;e<n;e++){r(t[e])}function r(t){var r=[],e=void 0!==Z.curveSegments?Z.curveSegments:12,c=void 0!==Z.steps?Z.steps:1,n=void 0!==Z.depth?Z.depth:100,i=void 0===Z.bevelEnabled||Z.bevelEnabled,a=void 0!==Z.bevelThickness?Z.bevelThickness:6,o=void 0!==Z.bevelSize?Z.bevelSize:a-2,u=void 0!==Z.bevelSegments?Z.bevelSegments:3,s=Z.extrudePath,h=void 0!==Z.UVGenerator?Z.UVGenerator:ec;void 0!==Z.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),n=Z.amount);var l,d,p,f,m,g,v,y,x=!1;s&&(l=s.getSpacedPoints(c),i=!(x=!0),d=s.computeFrenetFrames(c,!1),p=new dn,f=new dn,m=new dn),i||(o=a=u=0);var b=t.extractPoints(e),w=b.shape,_=b.holes;if(!Zs.isClockWise(w))for(w=w.reverse(),v=0,y=_.length;v<y;v++)g=_[v],Zs.isClockWise(g)&&(_[v]=g.reverse());var M=Zs.triangulateShape(w,_),E=w;for(v=0,y=_.length;v<y;v++)g=_[v],w=w.concat(g);function S(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var T,A,L,P,C,R,O=w.length,I=M.length;function D(t,e,n){var r,i,a,o=t.x-e.x,s=t.y-e.y,c=n.x-t.x,u=n.y-t.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=e.x-s/d,m=e.y+o/d,g=((n.x-u/p-f)*u-(n.y+c/p-m)*c)/(o*u-s*c),v=(r=f+o*g-t.x)*r+(i=m+s*g-t.y)*i;if(v<=2)return new un(r,i);a=Math.sqrt(v/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),a=y?(r=-s,i=o,Math.sqrt(h)):(r=o,i=s,Math.sqrt(h/2))}return new un(r/a,i/a)}for(var B=[],N=0,z=E.length,U=z-1,G=N+1;N<z;N++,U++,G++)U===z&&(U=0),G===z&&(G=0),B[N]=D(E[N],E[U],E[G]);var F,H,k=[],V=B.concat();for(v=0,y=_.length;v<y;v++){for(g=_[v],F=[],N=0,U=(z=g.length)-1,G=N+1;N<z;N++,U++,G++)U===z&&(U=0),G===z&&(G=0),F[N]=D(g[N],g[U],g[G]);k.push(F),V=V.concat(F)}for(T=0;T<u;T++){for(L=T/u,P=a*Math.cos(L*Math.PI/2),A=o*Math.sin(L*Math.PI/2),N=0,z=E.length;N<z;N++)W((C=S(E[N],B[N],A)).x,C.y,-P);for(v=0,y=_.length;v<y;v++)for(g=_[v],F=k[v],N=0,z=g.length;N<z;N++)W((C=S(g[N],F[N],A)).x,C.y,-P)}for(A=o,N=0;N<O;N++)C=i?S(w[N],V[N],A):w[N],x?(f.copy(d.normals[0]).multiplyScalar(C.x),p.copy(d.binormals[0]).multiplyScalar(C.y),m.copy(l[0]).add(f).add(p),W(m.x,m.y,m.z)):W(C.x,C.y,0);for(H=1;H<=c;H++)for(N=0;N<O;N++)C=i?S(w[N],V[N],A):w[N],x?(f.copy(d.normals[H]).multiplyScalar(C.x),p.copy(d.binormals[H]).multiplyScalar(C.y),m.copy(l[H]).add(f).add(p),W(m.x,m.y,m.z)):W(C.x,C.y,n/c*H);for(T=u-1;0<=T;T--){for(L=T/u,P=a*Math.cos(L*Math.PI/2),A=o*Math.sin(L*Math.PI/2),N=0,z=E.length;N<z;N++)W((C=S(E[N],B[N],A)).x,C.y,n+P);for(v=0,y=_.length;v<y;v++)for(g=_[v],F=k[v],N=0,z=g.length;N<z;N++)C=S(g[N],F[N],A),x?W(C.x,C.y+l[c-1].y,l[c-1].x+P):W(C.x,C.y,n+P)}function j(t,e){var n,r;for(N=t.length;0<=--N;){(r=(n=N)-1)<0&&(r=t.length-1);var i=0,a=c+2*u;for(i=0;i<a;i++){var o=O*i,s=O*(i+1);X(e+n+o,e+r+o,e+r+s,e+n+s)}}}function W(t,e,n){r.push(t),r.push(e),r.push(n)}function q(t,e,n){Y(t),Y(e),Y(n);var r=K.length/3,i=h.generateTopUV(Q,K,r-3,r-2,r-1);J(i[0]),J(i[1]),J(i[2])}function X(t,e,n,r){Y(t),Y(e),Y(r),Y(e),Y(n),Y(r);var i=K.length/3,a=h.generateSideWallUV(Q,K,i-6,i-3,i-2,i-1);J(a[0]),J(a[1]),J(a[3]),J(a[1]),J(a[2]),J(a[3])}function Y(t){K.push(r[3*t+0]),K.push(r[3*t+1]),K.push(r[3*t+2])}function J(t){$.push(t.x),$.push(t.y)}!function(){var t=K.length/3;if(i){var e=0,n=O*e;for(N=0;N<I;N++)q((R=M[N])[2]+n,R[1]+n,R[0]+n);for(n=O*(e=c+2*u),N=0;N<I;N++)q((R=M[N])[0]+n,R[1]+n,R[2]+n)}else{for(N=0;N<I;N++)q((R=M[N])[2],R[1],R[0]);for(N=0;N<I;N++)q((R=M[N])[0]+O*c,R[1]+O*c,R[2]+O*c)}Q.addGroup(t,K.length/3-t,0)}(),function(){var t=K.length/3,e=0;for(j(E,e),e+=E.length,v=0,y=_.length;v<y;v++)j(g=_[v],e),e+=g.length;Q.addGroup(t,K.length/3-t,1)}()}this.addAttribute("position",new kr(K,3)),this.addAttribute("uv",new kr($,2)),this.computeVertexNormals()}(($s.prototype=Object.create(Ir.prototype)).constructor=$s).prototype.toJSON=function(){var t=Ir.prototype.toJSON.call(this);return nc(this.parameters.shapes,this.parameters.options,t)},((tc.prototype=Object.create(ri.prototype)).constructor=tc).prototype.toJSON=function(){var t=ri.prototype.toJSON.call(this);return nc(this.parameters.shapes,this.parameters.options,t)};var ec={generateTopUV:function(t,e,n,r,i){var a=e[3*n],o=e[3*n+1],s=e[3*r],c=e[3*r+1],u=e[3*i],h=e[3*i+1];return[new un(a,o),new un(s,c),new un(u,h)]},generateSideWallUV:function(t,e,n,r,i,a){var o=e[3*n],s=e[3*n+1],c=e[3*n+2],u=e[3*r],h=e[3*r+1],l=e[3*r+2],d=e[3*i],p=e[3*i+1],f=e[3*i+2],m=e[3*a],g=e[3*a+1],v=e[3*a+2];return Math.abs(s-h)<.01?[new un(o,1-c),new un(u,1-l),new un(d,1-f),new un(m,1-v)]:[new un(s,1-c),new un(h,1-l),new un(p,1-f),new un(g,1-v)]}};function nc(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var a=t[r];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function rc(t,e){Ir.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new ic(t,e)),this.mergeVertices()}function ic(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Ir;var r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),tc.call(this,r,e),this.type="TextBufferGeometry"}function ac(t,e,n,r,i,a,o){Ir.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new oc(t,e,n,r,i,a,o)),this.mergeVertices()}function oc(t,e,n,r,i,a,o){ri.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i: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 dn,p=new dn,f=[],m=[],g=[],v=[];for(c=0;c<=n;c++){var y=[],x=c/n;for(s=0;s<=e;s++){var b=s/e;d.x=-t*Math.cos(r+b*i)*Math.sin(a+x*o),d.y=t*Math.cos(a+x*o),d.z=t*Math.sin(r+b*i)*Math.sin(a+x*o),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),v.push(b,1-x),y.push(h++)}l.push(y)}for(c=0;c<n;c++)for(s=0;s<e;s++){var w=l[c][s+1],_=l[c][s],M=l[c+1][s],E=l[c+1][s+1];(0!==c||0<a)&&f.push(w,_,E),(c!==n-1||u<Math.PI)&&f.push(_,M,E)}this.setIndex(f),this.addAttribute("position",new kr(m,3)),this.addAttribute("normal",new kr(g,3)),this.addAttribute("uv",new kr(v,2))}function sc(t,e,n,r,i,a){Ir.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new cc(t,e,n,r,i,a)),this.mergeVertices()}function cc(t,e,n,r,i,a){ri.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},t=t||.5,e=e||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,c,u=[],h=[],l=[],d=[],p=t,f=(e-t)/(r=void 0!==r?Math.max(1,r):1),m=new dn,g=new un;for(s=0;s<=r;s++){for(c=0;c<=n;c++)o=i+c/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),h.push(m.x,m.y,m.z),l.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var y=o=c+v,x=o+n+1,b=o+n+2,w=o+1;u.push(y,x,w),u.push(x,b,w)}}this.setIndex(u),this.addAttribute("position",new kr(h,3)),this.addAttribute("normal",new kr(l,3)),this.addAttribute("uv",new kr(d,2))}function uc(t,e,n,r){Ir.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},this.fromBufferGeometry(new hc(t,e,n,r)),this.mergeVertices()}function hc(t,e,n,r){ri.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=cn.clamp(r,0,2*Math.PI);var i,a,o,s=[],c=[],u=[],h=1/e,l=new dn,d=new un;for(a=0;a<=e;a++){var p=n+a*h*r,f=Math.sin(p),m=Math.cos(p);for(o=0;o<=t.length-1;o++)l.x=t[o].x*f,l.y=t[o].y,l.z=t[o].x*m,c.push(l.x,l.y,l.z),d.x=a/e,d.y=o/(t.length-1),u.push(d.x,d.y)}for(a=0;a<e;a++)for(o=0;o<t.length-1;o++){var g=i=o+a*t.length,v=i+t.length,y=i+t.length+1,x=i+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.addAttribute("position",new kr(c,3)),this.addAttribute("uv",new kr(u,2)),this.computeVertexNormals(),r===2*Math.PI){var b=this.attributes.normal.array,w=new dn,_=new dn,M=new dn;for(i=e*t.length*3,o=a=0;a<t.length;a++,o+=3)w.x=b[o+0],w.y=b[o+1],w.z=b[o+2],_.x=b[i+o+0],_.y=b[i+o+1],_.z=b[i+o+2],M.addVectors(w,_).normalize(),b[o+0]=b[i+o+0]=M.x,b[o+1]=b[i+o+1]=M.y,b[o+2]=b[i+o+2]=M.z}}function lc(t,e){Ir.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new dc(t,e)),this.mergeVertices()}function dc(t,f){ri.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:f},f=f||12;var m=[],g=[],v=[],y=[],e=0,x=0;if(!1===Array.isArray(t))r(t);else for(var n=0;n<t.length;n++)r(t[n]),this.addGroup(e,x,n),e+=x,x=0;function r(t){var e,n,r,i=g.length/3,a=t.extractPoints(f),o=a.shape,s=a.holes;for(!1===Zs.isClockWise(o)&&(o=o.reverse()),e=0,n=s.length;e<n;e++)r=s[e],!0===Zs.isClockWise(r)&&(s[e]=r.reverse());var c=Zs.triangulateShape(o,s);for(e=0,n=s.length;e<n;e++)r=s[e],o=o.concat(r);for(e=0,n=o.length;e<n;e++){var u=o[e];g.push(u.x,u.y,0),v.push(0,0,1),y.push(u.x,u.y)}for(e=0,n=c.length;e<n;e++){var h=c[e],l=h[0]+i,d=h[1]+i,p=h[2]+i;m.push(l,d,p),x+=3}}this.setIndex(m),this.addAttribute("position",new kr(g,3)),this.addAttribute("normal",new kr(v,3)),this.addAttribute("uv",new kr(y,2))}function pc(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}function fc(t,e){ri.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,i,a,o=[],s=Math.cos(cn.DEG2RAD*e),c=[0,0],u={},h=["a","b","c"];t.isBufferGeometry?(a=new Ir).fromBufferGeometry(t):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var l=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)n=m[h[g]],r=m[h[(g+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===u[i=c[0]+","+c[1]]?u[i]={index1:c[0],index2:c[1],face1:p,face2:void 0}:u[i].face2=p;for(i in u){var v=u[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var y=l[v.index1];o.push(y.x,y.y,y.z),y=l[v.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new kr(o,3))}function mc(t,e,n,r,i,a,o,s){Ir.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new gc(t,e,n,r,i,a,o,s)),this.mergeVertices()}function gc(v,y,x,b,w,t,_,M){ri.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:v,radiusBottom:y,height:x,radialSegments:b,heightSegments:w,openEnded:t,thetaStart:_,thetaLength:M};var E=this;v=void 0!==v?v:1,y=void 0!==y?y:1,x=x||1,b=Math.floor(b)||8,w=Math.floor(w)||1,t=void 0!==t&&t,_=void 0!==_?_:0,M=void 0!==M?M:2*Math.PI;var S=[],T=[],A=[],L=[],P=0,C=[],R=x/2,O=0;function e(t){var e,n,r,i=new un,a=new dn,o=0,s=!0===t?v:y,c=!0===t?1:-1;for(n=P,e=1;e<=b;e++)T.push(0,R*c,0),A.push(0,c,0),L.push(.5,.5),P++;for(r=P,e=0;e<=b;e++){var u=e/b*M+_,h=Math.cos(u),l=Math.sin(u);a.x=s*l,a.y=R*c,a.z=s*h,T.push(a.x,a.y,a.z),A.push(0,c,0),i.x=.5*h+.5,i.y=.5*l*c+.5,L.push(i.x,i.y),P++}for(e=0;e<b;e++){var d=n+e,p=r+e;!0===t?S.push(p,p+1,d):S.push(p+1,p,d),o+=3}E.addGroup(O,o,!0===t?1:2),O+=o}!function(){var t,e,n=new dn,r=new dn,i=0,a=(y-v)/x;for(e=0;e<=w;e++){var o=[],s=e/w,c=s*(y-v)+v;for(t=0;t<=b;t++){var u=t/b,h=u*M+_,l=Math.sin(h),d=Math.cos(h);r.x=c*l,r.y=-s*x+R,r.z=c*d,T.push(r.x,r.y,r.z),n.set(l,a,d).normalize(),A.push(n.x,n.y,n.z),L.push(u,1-s),o.push(P++)}C.push(o)}for(t=0;t<b;t++)for(e=0;e<w;e++){var p=C[e][t],f=C[e+1][t],m=C[e+1][t+1],g=C[e][t+1];S.push(p,f,g),S.push(f,m,g),i+=6}E.addGroup(O,i,0),O+=i}(),!1===t&&(0<v&&e(!0),0<y&&e(!1)),this.setIndex(S),this.addAttribute("position",new kr(T,3)),this.addAttribute("normal",new kr(A,3)),this.addAttribute("uv",new kr(L,2))}function vc(t,e,n,r,i,a,o){mc.call(this,0,t,e,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function yc(t,e,n,r,i,a,o){gc.call(this,0,t,e,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function xc(t,e,n,r){Ir.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new bc(t,e,n,r)),this.mergeVertices()}function bc(t,e,n,r){ri.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],c=[],u=[],h=new dn,l=new un;for(s.push(0,0,0),c.push(0,0,1),u.push(.5,.5),a=0,i=3;a<=e;a++,i+=3){var d=n+a/e*r;h.x=t*Math.cos(d),h.y=t*Math.sin(d),s.push(h.x,h.y,h.z),c.push(0,0,1),l.x=(s[i]/t+1)/2,l.y=(s[i+1]/t+1)/2,u.push(l.x,l.y)}for(i=1;i<=e;i++)o.push(i,i+1,0);this.setIndex(o),this.addAttribute("position",new kr(s,3)),this.addAttribute("normal",new kr(c,3)),this.addAttribute("uv",new kr(u,2))}(rc.prototype=Object.create(Ir.prototype)).constructor=rc,(ic.prototype=Object.create(tc.prototype)).constructor=ic,(ac.prototype=Object.create(Ir.prototype)).constructor=ac,(oc.prototype=Object.create(ri.prototype)).constructor=oc,(sc.prototype=Object.create(Ir.prototype)).constructor=sc,(cc.prototype=Object.create(ri.prototype)).constructor=cc,(uc.prototype=Object.create(Ir.prototype)).constructor=uc,(hc.prototype=Object.create(ri.prototype)).constructor=hc,((lc.prototype=Object.create(Ir.prototype)).constructor=lc).prototype.toJSON=function(){var t=Ir.prototype.toJSON.call(this);return pc(this.parameters.shapes,t)},((dc.prototype=Object.create(ri.prototype)).constructor=dc).prototype.toJSON=function(){var t=ri.prototype.toJSON.call(this);return pc(this.parameters.shapes,t)},(fc.prototype=Object.create(ri.prototype)).constructor=fc,(mc.prototype=Object.create(Ir.prototype)).constructor=mc,(gc.prototype=Object.create(ri.prototype)).constructor=gc,(vc.prototype=Object.create(mc.prototype)).constructor=vc,(yc.prototype=Object.create(gc.prototype)).constructor=yc,(xc.prototype=Object.create(Ir.prototype)).constructor=xc,(bc.prototype=Object.create(ri.prototype)).constructor=bc;var wc=Object.freeze({WireframeGeometry:hs,ParametricGeometry:ls,ParametricBufferGeometry:ds,TetrahedronGeometry:ms,TetrahedronBufferGeometry:gs,OctahedronGeometry:vs,OctahedronBufferGeometry:ys,IcosahedronGeometry:xs,IcosahedronBufferGeometry:bs,DodecahedronGeometry:ws,DodecahedronBufferGeometry:_s,PolyhedronGeometry:ps,PolyhedronBufferGeometry:fs,TubeGeometry:Ms,TubeBufferGeometry:Es,TorusKnotGeometry:Ss,TorusKnotBufferGeometry:Ts,TorusGeometry:As,TorusBufferGeometry:Ls,TextGeometry:rc,TextBufferGeometry:ic,SphereGeometry:ac,SphereBufferGeometry:oc,RingGeometry:sc,RingBufferGeometry:cc,PlaneGeometry:oi,PlaneBufferGeometry:si,LatheGeometry:uc,LatheBufferGeometry:hc,ShapeGeometry:lc,ShapeBufferGeometry:dc,ExtrudeGeometry:$s,ExtrudeBufferGeometry:tc,EdgesGeometry:fc,ConeGeometry:vc,ConeBufferGeometry:yc,CylinderGeometry:mc,CylinderBufferGeometry:gc,CircleGeometry:xc,CircleBufferGeometry:bc,BoxGeometry:ii,BoxBufferGeometry:ai});function _c(t){Di.call(this),this.type="ShadowMaterial",this.color=new Jn(0),this.transparent=!0,this.setValues(t)}function Mc(t){Bi.call(this,t),this.type="RawShaderMaterial"}function Ec(t){Di.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Jn(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 Jn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(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(t)}function Sc(t){Ec.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function Tc(t){Di.call(this),this.type="MeshPhongMaterial",this.color=new Jn(16777215),this.specular=new Jn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=xt,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(t)}function Ac(t){Tc.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function Lc(t){Di.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(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(t)}function Pc(t){Di.call(this),this.type="MeshLambertMaterial",this.color=new Jn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=xt,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(t)}function Cc(t){Di.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Jn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new un(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function Rc(t){ts.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((_c.prototype=Object.create(Di.prototype)).constructor=_c).prototype.isShadowMaterial=!0,_c.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.color.copy(t.color),this},((Mc.prototype=Object.create(Bi.prototype)).constructor=Mc).prototype.isRawShaderMaterial=!0,((Ec.prototype=Object.create(Di.prototype)).constructor=Ec).prototype.isMeshStandardMaterial=!0,Ec.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Sc.prototype=Object.create(Ec.prototype)).constructor=Sc).prototype.isMeshPhysicalMaterial=!0,Sc.prototype.copy=function(t){return Ec.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},((Tc.prototype=Object.create(Di.prototype)).constructor=Tc).prototype.isMeshPhongMaterial=!0,Tc.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Ac.prototype=Object.create(Tc.prototype)).constructor=Ac).prototype.isMeshToonMaterial=!0,Ac.prototype.copy=function(t){return Tc.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},((Lc.prototype=Object.create(Di.prototype)).constructor=Lc).prototype.isMeshNormalMaterial=!0,Lc.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Pc.prototype=Object.create(Di.prototype)).constructor=Pc).prototype.isMeshLambertMaterial=!0,Pc.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Cc.prototype=Object.create(Di.prototype)).constructor=Cc).prototype.isMeshMatcapMaterial=!0,Cc.prototype.copy=function(t){return Di.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Rc.prototype=Object.create(ts.prototype)).constructor=Rc).prototype.isLineDashedMaterial=!0,Rc.prototype.copy=function(t){return ts.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Oc=Object.freeze({ShadowMaterial:_c,SpriteMaterial:Yo,RawShaderMaterial:Mc,ShaderMaterial:Bi,PointsMaterial:is,MeshPhysicalMaterial:Sc,MeshStandardMaterial:Ec,MeshPhongMaterial:Tc,MeshToonMaterial:Ac,MeshNormalMaterial:Lc,MeshLambertMaterial:Pc,MeshDepthMaterial:ho,MeshDistanceMaterial:lo,MeshBasicMaterial:Ui,MeshMatcapMaterial:Cc,LineDashedMaterial:Rc,LineBasicMaterial:ts,Material:Di}),Ic={arraySlice:function(t,e,n){return Ic.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(n){for(var t=n.length,e=new Array(t),r=0;r!==t;++r)e[r]=r;return e.sort(function(t,e){return n[t]-n[e]}),e},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*e,c=0;c!==e;++c)i[o++]=t[s+c];return i},flattenJSON:function(t,e,n,r){for(var i=1,a=t[0];void 0!==a&&void 0===a[r];)a=t[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[r])&&(e.push(a.time),n.push.apply(n,o)),void 0!==(a=t[i++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[r])&&(e.push(a.time),o.toArray(n,n.length)),void 0!==(a=t[i++]););else for(;void 0!==(o=a[r])&&(e.push(a.time),n.push(o)),void 0!==(a=t[i++]););}}};function Dc(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Bc(t,e,n,r){Dc.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Nc(t,e,n,r){Dc.call(this,t,e,n,r)}function zc(t,e,n,r){Dc.call(this,t,e,n,r)}function Uc(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Ic.convertArray(e,this.TimeBufferType),this.values=Ic.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Gc(t,e,n){Uc.call(this,t,e,n)}function Fc(t,e,n,r){Uc.call(this,t,e,n,r)}function Hc(t,e,n,r){Uc.call(this,t,e,n,r)}function kc(t,e,n,r){Dc.call(this,t,e,n,r)}function Vc(t,e,n,r){Uc.call(this,t,e,n,r)}function jc(t,e,n,r){Uc.call(this,t,e,n,r)}function Wc(t,e,n,r){Uc.call(this,t,e,n,r)}function qc(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=cn.generateUUID(),this.duration<0&&this.resetDuration()}function Xc(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Hc;case"vector":case"vector2":case"vector3":case"vector4":return Wc;case"color":return Fc;case"quaternion":return Vc;case"bool":case"boolean":return Gc;case"string":return jc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],r=[];Ic.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Dc.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var a;n:{r:if(!(t<r)){for(var o=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===o)break;if(i=r,t<(r=e[++n]))break e}a=e.length;break n}if(i<=t)break t;var s=e[1];t<s&&(n=2,i=s);for(o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===o)break;if(r=i,(i=e[--n-1])<=t)break e}a=n,n=0}for(;n<a;){var c=n+a>>>1;t<e[c]?a=c:n=c+1}if(r=e[n],void 0===(i=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r,a=0;a!==r;++a)e[a]=n[i+a];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
|
|
//!\ DECLARE ALIAS AFTER assign prototype !
|
|
Object.assign(Dc.prototype,{beforeStart_:Dc.prototype.copySampleValue_,afterEnd_:Dc.prototype.copySampleValue_}),Bc.prototype=Object.assign(Object.create(Dc.prototype),{constructor:Bc,DefaultSettings_:{endingStart:Ve,endingEnd:Ve},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,a=t+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case je:i=t,o=2*e-n;break;case We:o=e+r[i=r.length-2]-r[i+1];break;default:i=t,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case je:a=t,s=2*n-e;break;case We:s=n+r[a=1]-r[0];break;default:a=t-1,s=e}var c=.5*(n-e),u=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,u=this._offsetPrev,h=this._offsetNext,l=this._weightPrev,d=this._weightNext,p=(n-e)/(r-e),f=p*p,m=f*p,g=-l*m+2*l*f-l*p,v=(1+l)*m+(-1.5-2*l)*f+(-.5+l)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,b=0;b!==o;++b)i[b]=g*a[u+b]+v*a[c+b]+y*a[s+b]+x*a[h+b];return i}}),Nc.prototype=Object.assign(Object.create(Dc.prototype),{constructor:Nc,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,u=(n-e)/(r-e),h=1-u,l=0;l!==o;++l)i[l]=a[c+l]*h+a[s+l]*u;return i}}),zc.prototype=Object.assign(Object.create(Dc.prototype),{constructor:zc,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Uc,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:Ic.convertArray(t.times,Array),values:Ic.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}),Object.assign(Uc.prototype,{constructor:Uc,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:He,InterpolantFactoryMethodDiscrete:function(t){return new zc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Nc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Bc(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Fe:e=this.InterpolantFactoryMethodDiscrete;break;case He:e=this.InterpolantFactoryMethodLinear;break;case ke:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Fe;case this.InterpolantFactoryMethodLinear:return He;case this.InterpolantFactoryMethodSmooth:return ke}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<t;)++i;for(;-1!==a&&n[a]>e;)--a;if(++a,0!==i||a!==r){a<=i&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Ic.arraySlice(n,i,a),this.values=Ic.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==r&&Ic.isTypedArray(r)){o=0;for(var c=r.length;o!==c;++o){var u=r[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),r=this.getInterpolation()===ke,i=1,a=t.length-1,o=1;o<a;++o){var s=!1,c=t[o];if(c!==t[o+1]&&(1!==o||c!==c[0]))if(r)s=!0;else for(var u=o*n,h=u-n,l=u+n,d=0;d!==n;++d){var p=e[u+d];if(p!==e[h+d]||p!==e[l+d]){s=!0;break}}if(s){if(o!==i){t[i]=t[o];var f=o*n,m=i*n;for(d=0;d!==n;++d)e[m+d]=e[f+d]}++i}}if(0<a){t[i]=t[a];for(f=a*n,m=i*n,d=0;d!==n;++d)e[m+d]=e[f+d];++i}return i!==t.length&&(this.times=Ic.arraySlice(t,0,i),this.values=Ic.arraySlice(e,0,i*n)),this}}),Gc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Gc,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Fe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Fc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Fc,ValueTypeName:"color"}),Hc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Hc,ValueTypeName:"number"}),kc.prototype=Object.assign(Object.create(Dc.prototype),{constructor:kc,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=(n-e)/(r-e),u=s+o;s!==u;s+=4)ln.slerpFlat(i,0,a,s-o,a,s,c);return i}}),Vc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Vc,ValueTypeName:"quaternion",DefaultInterpolation:He,InterpolantFactoryMethodLinear:function(t){return new kc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),jc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:jc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Fe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Wc.prototype=Object.assign(Object.create(Uc.prototype),{constructor:Wc,ValueTypeName:"vector"}),Object.assign(qc,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,a=n.length;i!==a;++i)e.push(Xc(n[i]).scale(r));return new qc(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},i=0,a=n.length;i!==a;++i)e.push(Uc.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var u=Ic.getKeyframeOrder(s);s=Ic.sortedArray(s,1,u),c=Ic.sortedArray(c,1,u),r||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new Hc(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/n))}return new qc(t,-1,a)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var r=t;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(i);if(c&&1<c.length){var u=r[l=c[1]];u||(r[l]=u=[]),u.push(s)}}var h=[];for(var l in r)h.push(qc.CreateFromMorphTargetSequence(l,r[l],e,n));return h},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var a=[],o=[];Ic.flattenJSON(n,a,o,r),0!==a.length&&i.push(new t(e,a,o))}},r=[],i=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.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=[],m=[];for(d=0;d!==u[l].morphTargets.length;++d){var g=u[l];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new Hc(".morphTargetInfluence["+p+"]",f,m))}a=h.length*(o||1)}else{var v=".bones["+e[c].name+"]";n(Wc,v+".position",u,"pos",r),n(Vc,v+".quaternion",u,"rot",r),n(Wc,v+".scale",u,"scl",r)}}return 0===r.length?null:new qc(i,a,r)}}),Object.assign(qc.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}});var Yc={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function Jc(t,e,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===i&&void 0!==r.onStart&&r.onStart(t,a,o),i=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var Zc=new Jc,Qc={};function Kc(t){this.manager=void 0!==t?t:Zc}function $c(t){this.manager=void 0!==t?t:Zc}function tu(t){this.manager=void 0!==t?t:Zc,this._parser=null}function eu(t){this.manager=void 0!==t?t:Zc,this._parser=null}function nu(t){this.manager=void 0!==t?t:Zc}function ru(t){this.manager=void 0!==t?t:Zc}function iu(t){this.manager=void 0!==t?t:Zc}function au(){this.type="Curve",this.arcLengthDivisions=200}function ou(t,e,n,r,i,a,o,s){au.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function su(t,e,n,r,i,a){ou.call(this,t,e,n,n,r,i,a),this.type="ArcCurve"}function cu(){var i=0,a=0,o=0,s=0;function u(t,e,n,r){o=-3*(i=t)+3*e-2*(a=n)-r,s=2*t-2*e+n+r}return{initCatmullRom:function(t,e,n,r,i){u(e,n,i*(n-t),i*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,i,a,o){var s=(e-t)/i-(n-t)/(i+a)+(n-e)/a,c=(n-e)/a-(r-e)/(a+o)+(r-n)/o;u(e,n,s*=a,c*=a)},calc:function(t){var e=t*t;return i+a*t+o*e+s*(e*t)}}}Object.assign(Kc.prototype,{load:function(o,t,e,n){void 0===o&&(o=""),void 0!==this.path&&(o=this.path+o),o=this.manager.resolveURL(o);var s=this,r=Yc.get(o);if(void 0!==r)return s.manager.itemStart(o),setTimeout(function(){t&&t(r),s.manager.itemEnd(o)},0),r;if(void 0===Qc[o]){var i=o.match(/^data:(.*?)(;base64)?,(.*)$/);if(i){var a=i[1],c=!!i[2],u=i[3];u=decodeURIComponent(u),c&&(u=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:a}):d.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(u,a);break;case"json":h=JSON.parse(u);break;default:h=u}setTimeout(function(){t&&t(h),s.manager.itemEnd(o)},0)}catch(t){setTimeout(function(){n&&n(t),s.manager.itemError(o),s.manager.itemEnd(o)},0)}}else{Qc[o]=[],Qc[o].push({onLoad:t,onProgress:e,onError:n});var m=new XMLHttpRequest;for(var g in m.open("GET",o,!0),m.addEventListener("load",function(t){var e=this.response;Yc.add(o,e);var n=Qc[o];if(delete Qc[o],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var r=0,i=n.length;r<i;r++){(a=n[r]).onLoad&&a.onLoad(e)}s.manager.itemEnd(o)}else{for(r=0,i=n.length;r<i;r++){var a;(a=n[r]).onError&&a.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)}},!1),m.addEventListener("progress",function(t){for(var e=Qc[o],n=0,r=e.length;n<r;n++){var i=e[n];i.onProgress&&i.onProgress(t)}},!1),m.addEventListener("error",function(t){var e=Qc[o];delete Qc[o];for(var n=0,r=e.length;n<r;n++){var i=e[n];i.onError&&i.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),m.addEventListener("abort",function(t){var e=Qc[o];delete Qc[o];for(var n=0,r=e.length;n<r;n++){var i=e[n];i.onError&&i.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return s.manager.itemStart(o),m}Qc[o].push({onLoad:t,onProgress:e,onError:n})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign($c.prototype,{load:function(t,e,n,r){var i=this,a=new Kc(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=qc.parse(t[r]);n.push(i)}e(n)},setPath:function(t){return this.path=t,this}}),Object.assign(tu.prototype,{load:function(t,a,e,r){var o=this,s=[],c=new ss;c.image=s;var i=new Kc(this.manager);function n(n){i.load(t[n],function(t){var e=o._parser(t,!0);s[n]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(u+=1)&&(1===e.mipmapCount&&(c.minFilter=jt),c.format=e.format,c.needsUpdate=!0,a&&a(c))},e,r)}if(i.setPath(this.path),i.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,h=0,l=t.length;h<l;++h)n(h);else i.load(t,function(t){var e=o._parser(t,!0);if(e.isCubemap)for(var n=e.mipmaps.length/e.mipmapCount,r=0;r<n;r++){s[r]={mipmaps:[]};for(var i=0;i<e.mipmapCount;i++)s[r].mipmaps.push(e.mipmaps[r*e.mipmapCount+i]),s[r].format=e.format,s[r].width=e.width,s[r].height=e.height}else c.image.width=e.width,c.image.height=e.height,c.mipmaps=e.mipmaps;1===e.mipmapCount&&(c.minFilter=jt),c.format=e.format,c.needsUpdate=!0,a&&a(c)},e,r);return c},setPath:function(t){return this.path=t,this}}),Object.assign(eu.prototype,{load:function(t,n,e,r){var i=this,a=new Nn,o=new Kc(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(t,function(t){var e=i._parser(t);e&&(void 0!==e.image?a.image=e.image:void 0!==e.data&&(a.image.width=e.width,a.image.height=e.height,a.image.data=e.data),a.wrapS=void 0!==e.wrapS?e.wrapS:Gt,a.wrapT=void 0!==e.wrapT?e.wrapT:Gt,a.magFilter=void 0!==e.magFilter?e.magFilter:jt,a.minFilter=void 0!==e.minFilter?e.minFilter:qt,a.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.format&&(a.format=e.format),void 0!==e.type&&(a.type=e.type),void 0!==e.mipmaps&&(a.mipmaps=e.mipmaps),1===e.mipmapCount&&(a.minFilter=jt),a.needsUpdate=!0,n&&n(a,e))},e,r),a},setPath:function(t){return this.path=t,this}}),Object.assign(nu.prototype,{crossOrigin:"anonymous",load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Yc.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.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),Yc.add(e,this),t&&t(this),i.manager.itemEnd(e)}function c(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",c,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(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),i.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(ru.prototype,{crossOrigin:"anonymous",load:function(t,n,e,r){var i=new Qi,a=new nu(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(e){a.load(t[e],function(t){i.images[e]=t,6===++o&&(i.needsUpdate=!0,n&&n(i))},void 0,r)}for(var c=0;c<t.length;++c)s(c);return i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(iu.prototype,{crossOrigin:"anonymous",load:function(n,r,t,e){var i=new On,a=new nu(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(n,function(t){i.image=t;var e=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);i.format=e?oe:se,i.needsUpdate=!0,void 0!==r&&r(i)},t,e),i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(au.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=t;n++)a+=(e=this.getPoint(n/t)).distanceTo(i),r.push(a),i=e;return this.cacheArcLengths=r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,a=r.length;n=e||t*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(0<o)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(a-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var r=this.getPoint(e);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,r,i,a=new dn,o=[],s=[],c=[],u=new dn,h=new hn;for(n=0;n<=t;n++)r=n/t,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new dn,c[0]=new dn;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]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),u.crossVectors(o[n-1],o[n]),u.length()>Number.EPSILON&&(u.normalize(),i=Math.acos(cn.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(h.makeRotationAxis(u,i))),c[n].crossVectors(o[n],s[n]);if(!0===e)for(i=Math.acos(cn.clamp(s[0].dot(s[t]),-1,1)),i/=t,0<o[0].dot(u.crossVectors(s[0],s[t]))&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(h.makeRotationAxis(o[n],i*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((ou.prototype=Object.create(au.prototype)).constructor=ou).prototype.isEllipseCurve=!0,ou.prototype.getPoint=function(t,e){for(var n=e||new un,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;r<i;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+t*i,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 n.set(s,c)},ou.prototype.copy=function(t){return au.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ou.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},ou.prototype.fromJSON=function(t){return au.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((su.prototype=Object.create(ou.prototype)).constructor=su).prototype.isArcCurve=!0;var uu=new dn,hu=new cu,lu=new cu,du=new cu;function pu(t,e,n,r){au.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=r||.5}function fu(t,e,n,r,i){var a=.5*(r-e),o=.5*(i-n),s=t*t;return(2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function mu(t,e,n,r){return(o=1-t)*o*e+2*(1-(a=t))*a*n+(i=t)*i*r;var i,a,o}function gu(t,e,n,r,i){return(u=1-t)*u*u*e+3*(c=1-(s=t))*c*s*n+3*(1-(o=t))*o*o*r+(a=t)*a*a*i;var a,o,s,c,u}function vu(t,e,n,r){au.call(this),this.type="CubicBezierCurve",this.v0=t||new un,this.v1=e||new un,this.v2=n||new un,this.v3=r||new un}function yu(t,e,n,r){au.call(this),this.type="CubicBezierCurve3",this.v0=t||new dn,this.v1=e||new dn,this.v2=n||new dn,this.v3=r||new dn}function xu(t,e){au.call(this),this.type="LineCurve",this.v1=t||new un,this.v2=e||new un}function bu(t,e){au.call(this),this.type="LineCurve3",this.v1=t||new dn,this.v2=e||new dn}function wu(t,e,n){au.call(this),this.type="QuadraticBezierCurve",this.v0=t||new un,this.v1=e||new un,this.v2=n||new un}function _u(t,e,n){au.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new dn,this.v1=e||new dn,this.v2=n||new dn}function Mu(t){au.call(this),this.type="SplineCurve",this.points=t||[]}((pu.prototype=Object.create(au.prototype)).constructor=pu).prototype.isCatmullRomCurve3=!0,pu.prototype.getPoint=function(t,e){var n,r,i,a,o=e||new dn,s=this.points,c=s.length,u=(c-(this.closed?0:1))*t,h=Math.floor(u),l=u-h;if(this.closed?h+=0<h?0:(Math.floor(Math.abs(h)/c)+1)*c:0===l&&h===c-1&&(h=c-2,l=1),n=this.closed||0<h?s[(h-1)%c]:(uu.subVectors(s[0],s[1]).add(s[0]),uu),r=s[h%c],i=s[(h+1)%c],a=this.closed||h+2<c?s[(h+2)%c]:(uu.subVectors(s[c-1],s[c-2]).add(s[c-1]),uu),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),hu.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,p,f,m),lu.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,p,f,m),du.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(hu.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),lu.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),du.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(hu.calc(l),lu.calc(l),du.calc(l)),o},pu.prototype.copy=function(t){au.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},pu.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},pu.prototype.fromJSON=function(t){au.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new dn).fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((vu.prototype=Object.create(au.prototype)).constructor=vu).prototype.isCubicBezierCurve=!0,vu.prototype.getPoint=function(t,e){var n=e||new un,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(gu(t,r.x,i.x,a.x,o.x),gu(t,r.y,i.y,a.y,o.y)),n},vu.prototype.copy=function(t){return au.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},vu.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},vu.prototype.fromJSON=function(t){return au.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((yu.prototype=Object.create(au.prototype)).constructor=yu).prototype.isCubicBezierCurve3=!0,yu.prototype.getPoint=function(t,e){var n=e||new dn,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(gu(t,r.x,i.x,a.x,o.x),gu(t,r.y,i.y,a.y,o.y),gu(t,r.z,i.z,a.z,o.z)),n},yu.prototype.copy=function(t){return au.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},yu.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},yu.prototype.fromJSON=function(t){return au.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((xu.prototype=Object.create(au.prototype)).constructor=xu).prototype.isLineCurve=!0,xu.prototype.getPoint=function(t,e){var n=e||new un;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},xu.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},xu.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},xu.prototype.copy=function(t){return au.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},xu.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},xu.prototype.fromJSON=function(t){return au.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((bu.prototype=Object.create(au.prototype)).constructor=bu).prototype.isLineCurve3=!0,bu.prototype.getPoint=function(t,e){var n=e||new dn;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},bu.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},bu.prototype.copy=function(t){return au.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},bu.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},bu.prototype.fromJSON=function(t){return au.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((wu.prototype=Object.create(au.prototype)).constructor=wu).prototype.isQuadraticBezierCurve=!0,wu.prototype.getPoint=function(t,e){var n=e||new un,r=this.v0,i=this.v1,a=this.v2;return n.set(mu(t,r.x,i.x,a.x),mu(t,r.y,i.y,a.y)),n},wu.prototype.copy=function(t){return au.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},wu.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},wu.prototype.fromJSON=function(t){return au.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((_u.prototype=Object.create(au.prototype)).constructor=_u).prototype.isQuadraticBezierCurve3=!0,_u.prototype.getPoint=function(t,e){var n=e||new dn,r=this.v0,i=this.v1,a=this.v2;return n.set(mu(t,r.x,i.x,a.x),mu(t,r.y,i.y,a.y),mu(t,r.z,i.z,a.z)),n},_u.prototype.copy=function(t){return au.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},_u.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},_u.prototype.fromJSON=function(t){return au.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Mu.prototype=Object.create(au.prototype)).constructor=Mu).prototype.isSplineCurve=!0,Mu.prototype.getPoint=function(t,e){var n=e||new un,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],c=r[a],u=r[a>r.length-2?r.length-1:a+1],h=r[a>r.length-3?r.length-1:a+2];return n.set(fu(o,s.x,c.x,u.x,h.x),fu(o,s.y,c.y,u.y,h.y)),n},Mu.prototype.copy=function(t){au.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this},Mu.prototype.toJSON=function(){var t=au.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t},Mu.prototype.fromJSON=function(t){au.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new un).fromArray(r))}return this};var Eu=Object.freeze({ArcCurve:su,CatmullRomCurve3:pu,CubicBezierCurve:vu,CubicBezierCurve3:yu,EllipseCurve:ou,LineCurve:xu,LineCurve3:bu,QuadraticBezierCurve:wu,QuadraticBezierCurve3:_u,SplineCurve:Mu});function Su(){au.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Tu(t){Su.call(this),this.type="Path",this.currentPoint=new un,t&&this.setFromPoints(t)}function Au(t){Tu.call(this,t),this.uuid=cn.generateUUID(),this.type="Shape",this.holes=[]}function Lu(t,e){Er.call(this),this.type="Light",this.color=new Jn(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Pu(t,e,n){Lu.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Er.DefaultUp),this.updateMatrix(),this.groundColor=new Jn(e)}function Cu(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new un(512,512),this.map=null,this.matrix=new hn}function Ru(){Cu.call(this,new xo(50,1,.5,500))}function Ou(t,e,n,r,i,a){Lu.call(this,t,e),this.type="SpotLight",this.position.copy(Er.DefaultUp),this.updateMatrix(),this.target=new Er,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Ru}function Iu(t,e,n,r){Lu.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Cu(new xo(90,1,.5,500))}function Du(t,e,n,r,i,a){yo.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Bu(){Cu.call(this,new Du(-5,5,5,-5,.5,500))}function Nu(t,e){Lu.call(this,t,e),this.type="DirectionalLight",this.position.copy(Er.DefaultUp),this.updateMatrix(),this.target=new Er,this.shadow=new Bu}function zu(t,e){Lu.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Uu(t,e,n,r){Lu.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Gu(t){this.manager=void 0!==t?t:Zc,this.textures={}}Su.prototype=Object.assign(Object.create(au.prototype),{constructor:Su,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new xu(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.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 t=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),c=0;c<s.length;c++){var u=s[c];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){au.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=au.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var r=this.curves[e];t.curves.push(r.toJSON())}return t},fromJSON:function(t){au.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push((new Eu[r.type]).fromJSON(r))}return this}}),Tu.prototype=Object.assign(Object.create(Su.prototype),{constructor:Tu,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new xu(this.currentPoint.clone(),new un(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,r){var i=new wu(this.currentPoint.clone(),new un(t,e),new un(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(t,e,n,r,i,a){var o=new vu(this.currentPoint.clone(),new un(t,e),new un(n,r),new un(i,a));this.curves.push(o),this.currentPoint.set(i,a)},splineThru:function(t){var e=new Mu([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+o,e+s,n,r,i,a)},absarc:function(t,e,n,r,i,a){this.absellipse(t,e,n,n,r,i,a)},ellipse:function(t,e,n,r,i,a,o,s){var c=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(t+c,e+u,n,r,i,a,o,s)},absellipse:function(t,e,n,r,i,a,o,s){var c=new ou(t,e,n,r,i,a,o,s);if(0<this.curves.length){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(t){return Su.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Su.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Su.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Au.prototype=Object.assign(Object.create(Tu.prototype),{constructor:Au,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Tu.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push(r.clone())}return this},toJSON:function(){var t=Tu.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var r=this.holes[e];t.holes.push(r.toJSON())}return t},fromJSON:function(t){Tu.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push((new Tu).fromJSON(r))}return this}}),Lu.prototype=Object.assign(Object.create(Er.prototype),{constructor:Lu,isLight:!0,copy:function(t){return Er.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Er.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Pu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Pu,isHemisphereLight:!0,copy:function(t){return Lu.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Cu.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Ru.prototype=Object.assign(Object.create(Cu.prototype),{constructor:Ru,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*cn.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix())}}),Ou.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Ou,isSpotLight:!0,copy:function(t){return Lu.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Iu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Iu,isPointLight:!0,copy:function(t){return Lu.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Du.prototype=Object.assign(Object.create(yo.prototype),{constructor:Du,isOrthographicCamera:!0,copy:function(t,e){return yo.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,r,i,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-t,a=n+t,o=r+e,s=r-e;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=(i+=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(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Er.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Bu.prototype=Object.assign(Object.create(Cu.prototype),{constructor:Bu}),Nu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Nu,isDirectionalLight:!0,copy:function(t){return Lu.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),zu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:zu,isAmbientLight:!0}),Uu.prototype=Object.assign(Object.create(Lu.prototype),{constructor:Uu,isRectAreaLight:!0,copy:function(t){return Lu.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Lu.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(Gu.prototype,{load:function(t,e,n,r){var i=this,a=new Kc(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var r=new Oc[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearCoat&&(r.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(r.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(r.vertexColors=t.vertexColors),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.uniforms)for(var i in t.uniforms){var a=t.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new Jn).setHex(a.value);break;case"v2":r.uniforms[i].value=(new un).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new dn).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new In).fromArray(a.value);break;case"m4":r.uniforms[i].value=(new hn).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)r.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=n(t.map)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap),r.transparent=!0),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new un).fromArray(s)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.lightMap&&(r.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),r},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var Fu={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(escape(e))},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function Hu(t){this.manager=void 0!==t?t:Zc}Object.assign(Hu.prototype,{load:function(t,e,n,r){var i=this,a=new Kc(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=new ri,n=t.data.index;if(void 0!==n){var r=new ku[n.type](n.array);e.setIndex(new Dr(r,1))}var i=t.data.attributes;for(var a in i){var o=i[a];r=new ku[o.type](o.array);e.addAttribute(a,new Dr(r,o.itemSize,o.normalized))}var s=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==s)for(var c=0,u=s.length;c!==u;++c){var h=s[c];e.addGroup(h.start,h.count,h.materialIndex)}var l=t.data.boundingSphere;if(void 0!==l){var d=new dn;void 0!==l.center&&d.fromArray(l.center),e.boundingSphere=new Un(d,l.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var ku={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Vu(t){this.manager=void 0!==t?t:Zc,this.resourcePath=""}Object.assign(Vu.prototype,{crossOrigin:"anonymous",load:function(r,i,t,a){var o=this,e=void 0===this.path?Fu.extractUrlBase(r):this.path;this.resourcePath=this.resourcePath||e;var n=new Kc(o.manager);n.setPath(this.path),n.load(r,function(t){var e=null;try{e=JSON.parse(t)}catch(t){return void 0!==a&&a(t),void console.error("THREE:ObjectLoader: Can't parse "+r+".",t.message)}var n=e.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?o.parse(e,i):console.error("THREE.ObjectLoader: Can't load "+r)},t,a)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var n=this.parseShape(t.shapes),r=this.parseGeometries(t.geometries,n),i=this.parseImages(t.images,function(){void 0!==e&&e(s)}),a=this.parseTextures(t.textures,i),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,r,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,r=t.length;n<r;n++){var i=(new Au).fromJSON(t[n]);e[i.uuid]=i}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var r=new Hu,i=0,a=t.length;i<a;i++){var o,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new wc[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new wc[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new wc[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new wc[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new wc[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new wc[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new wc[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new wc[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new wc[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new wc[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new wc[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new wc[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],u=0,h=s.shapes.length;u<h;u++){var l=e[s.shapes[u]];c.push(l)}o=new wc[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],u=0,h=s.shapes.length;u<h;u++){l=e[s.shapes[u]];c.push(l)}var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new Eu[d.type]).fromJSON(d)),o=new wc[s.type](c,s.options);break;case"BufferGeometry":o=r.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(t,e){var n={},r={};if(void 0!==t){var i=new Gu;i.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[a];if("MultiMaterial"===s.type){for(var c=[],u=0;u<s.materials.length;u++){var h=s.materials[u];void 0===n[h.uuid]&&(n[h.uuid]=i.parse(h)),c.push(n[h.uuid])}r[s.uuid]=c}else r[s.uuid]=i.parse(s),n[s.uuid]=r[s.uuid]}}return r},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=qc.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),e.push(i)}return e},parseImages:function(t,e){var n=this,r={};function i(t){return n.manager.itemStart(t),a.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}if(void 0!==t&&0<t.length){var a=new nu(new Jc(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var c=t[o],u=c.url;if(Array.isArray(u)){r[c.uuid]=[];for(var h=0,l=u.length;h<l;h++){var d=u[h],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[c.uuid].push(i(p))}}else{p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url;r[c.uuid]=i(p)}}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var r={};if(void 0!==t)for(var i=0,a=t.length;i<a;i++){var o,s=t[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=Array.isArray(e[s.image])?new Qi(e[s.image]):new On(e[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,Ju)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],Zu),o.wrapT=n(s.wrap[1],Zu)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,Qu)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,Qu)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(t,e,a){var n;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function i(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];void 0===a[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),e.push(a[i])}return e}return void 0===a[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),a[t]}}switch(t.type){case"Scene":n=new Wo,void 0!==t.background&&Number.isInteger(t.background)&&(n.background=new Jn(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new jo(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new Vo(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":n=new xo(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new Du(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new zu(t.color,t.intensity);break;case"DirectionalLight":n=new Nu(t.color,t.intensity);break;case"PointLight":n=new Iu(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new Uu(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new Ou(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new Pu(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(t.geometry),s=i(t.material);n=o.bones&&0<o.bones.length?new Qo(o,s):new Gi(o,s);break;case"LOD":n=new Zo;break;case"Line":n=new es(r(t.geometry),i(t.material),t.mode);break;case"LineLoop":n=new rs(r(t.geometry),i(t.material));break;case"LineSegments":n=new ns(r(t.geometry),i(t.material));break;case"PointCloud":case"Points":n=new as(r(t.geometry),i(t.material));break;case"Sprite":n=new Jo(i(t.material));break;case"Group":n=new vo;break;default:n=new Er}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children)for(var c=t.children,u=0;u<c.length;u++)n.add(this.parseObject(c[u],e,a));if("LOD"===t.type)for(var h=t.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 ju,Wu,qu,Xu,Yu,Ju={UVMapping:Ct,CubeReflectionMapping:Rt,CubeRefractionMapping:Ot,EquirectangularReflectionMapping:It,EquirectangularRefractionMapping:Dt,SphericalReflectionMapping:Bt,CubeUVReflectionMapping:Nt,CubeUVRefractionMapping:zt},Zu={RepeatWrapping:Ut,ClampToEdgeWrapping:Gt,MirroredRepeatWrapping:Ft},Qu={NearestFilter:Ht,NearestMipMapNearestFilter:kt,NearestMipMapLinearFilter:Vt,LinearFilter:jt,LinearMipMapNearestFilter:Wt,LinearMipMapLinearFilter:qt};function Ku(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:Zc,this.options=void 0}function $u(){this.type="ShapePath",this.color=new Jn,this.subPaths=[],this.currentPath=null}function th(t){this.type="Font",this.data=t}function eh(t,e,n,r,i){var a=i.glyphs[t]||i.glyphs["?"];if(a){var o,s,c,u,h,l,d,p,f=new $u;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":o=m[g++]*e+n,s=m[g++]*e+r,f.moveTo(o,s);break;case"l":o=m[g++]*e+n,s=m[g++]*e+r,f.lineTo(o,s);break;case"q":c=m[g++]*e+n,u=m[g++]*e+r,h=m[g++]*e+n,l=m[g++]*e+r,f.quadraticCurveTo(h,l,c,u);break;case"b":c=m[g++]*e+n,u=m[g++]*e+r,h=m[g++]*e+n,l=m[g++]*e+r,d=m[g++]*e+n,p=m[g++]*e+r,f.bezierCurveTo(h,l,d,p,c,u)}}return{offsetX:a.ha*e,path:f}}}function nh(t){this.manager=void 0!==t?t:Zc}function rh(){}Ku.prototype={constructor:Ku,setOptions:function(t){return this.options=t,this},load:function(e,n,t,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Yc.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){n&&n(a),i.manager.itemEnd(e)},0),a;fetch(e).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,i.options)}).then(function(t){Yc.add(e,t),n&&n(t),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign($u.prototype,{moveTo:function(t,e){this.currentPath=new Tu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,r){this.currentPath.quadraticCurveTo(t,e,n,r)},bezierCurveTo:function(t,e,n,r,i,a){this.currentPath.bezierCurveTo(t,e,n,r,i,a)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],a=new Au;a.curves=i.curves,e.push(a)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=e[i],s=e[a],c=s.x-o.x,u=s.y-o.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(o=e[a],c=-c,s=e[i],u=-u),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var h=u*(t.x-o.x)-c*(t.y-o.y);if(0===h)return!0;if(h<0)continue;r=!r}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return r}var i=Zs.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===e)return n(a);var o,s,c,u=[];if(1===a.length)return s=a[0],(c=new Au).curves=s.curves,u.push(c),u;var h=!i(a[0].getPoints());h=t?!h:h;var l,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=i(l=(s=a[v]).getPoints()),(o=t?!o:o)?(!h&&f[g]&&g++,f[g]={s:new Au,p:l},f[g].s.curves=s.curves,h&&g++,m[g]=[]):m[g].push({h:s,p:l[0]});if(!f[0])return n(a);if(1<f.length){for(var x=!1,b=[],w=0,_=f.length;w<_;w++)p[w]=[];for(w=0,_=f.length;w<_;w++)for(var M=m[w],E=0;E<M.length;E++){for(var S=M[E],T=!0,A=0;A<f.length;A++)r(S.p,f[A].p)&&(w!==A&&b.push({froms:w,tos:A,hole:E}),T?(T=!1,p[A].push(S)):x=!0);T&&p[w].push(S)}0<b.length&&(x||(m=p))}v=0;for(var L=f.length;v<L;v++){c=f[v].s,u.push(c);for(var P=0,C=(d=m[v]).length;P<C;P++)c.holes.push(d[P].h)}return u}}),Object.assign(th.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],r=function(t,e,n){for(var r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,c=0,u=0;u<r.length;u++){var h=r[u];if("\n"===h)s=0,c-=a;else{var l=eh(h,i,s,c,n);s+=l.offsetX,o.push(l.path)}}return o}(t,e,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),Object.assign(nh.prototype,{load:function(t,r,e,n){var i=this,a=new Kc(this.manager);a.setPath(this.path),a.load(t,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var t=i.parse(n);r&&r(t)},e,n)},parse:function(t){return new th(t)},setPath:function(t){return this.path=t,this}}),rh.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,r=e.length;n<r;n+=2){var i=e[n],a=e[n+1];if(i.test(t))return a}return null}},Object.assign(rh.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var r=[],i=0;i<t.length;++i)r[i]=this.createMaterial(t[i],e,n);return r},createMaterial:(ju={NoBlending:J,NormalBlending:Z,AdditiveBlending:Q,SubtractiveBlending:K,MultiplyBlending:$,CustomBlending:et},Wu=new Jn,qu=new iu,Xu=new Gu,function(t,u,h){var l={};function e(t,e,n,r,i){var a,o=u+t,s=rh.Handlers.get(o);a=null!==s?s.load(o):(qu.setCrossOrigin(h),qu.load(o)),void 0!==e&&(a.repeat.fromArray(e),1!==e[0]&&(a.wrapS=Ut),1!==e[1]&&(a.wrapT=Ut)),void 0!==n&&a.offset.fromArray(n),void 0!==r&&("repeat"===r[0]&&(a.wrapS=Ut),"mirror"===r[0]&&(a.wrapS=Ft),"repeat"===r[1]&&(a.wrapT=Ut),"mirror"===r[1]&&(a.wrapT=Ft)),void 0!==i&&(a.anisotropy=i);var c=cn.generateUUID();return l[c]=a,c}var n={uuid:cn.generateUUID(),type:"MeshLambertMaterial"};for(var r in t){var i=t[r];switch(r){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":n.name=i;break;case"blending":n.blending=ju[i];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",r,"is no longer supported.");break;case"colorDiffuse":n.color=Wu.fromArray(i).getHex();break;case"colorSpecular":n.specular=Wu.fromArray(i).getHex();break;case"colorEmissive":n.emissive=Wu.fromArray(i).getHex();break;case"specularCoef":n.shininess=i;break;case"shading":"basic"===i.toLowerCase()&&(n.type="MeshBasicMaterial"),"phong"===i.toLowerCase()&&(n.type="MeshPhongMaterial"),"standard"===i.toLowerCase()&&(n.type="MeshStandardMaterial");break;case"mapDiffuse":n.map=e(i,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":n.emissiveMap=e(i,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":n.lightMap=e(i,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":n.aoMap=e(i,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":n.bumpMap=e(i,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":n.bumpScale=i;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":n.normalMap=e(i,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":n.normalScale=i;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":n.specularMap=e(i,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":n.metalnessMap=e(i,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":n.roughnessMap=e(i,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":n.alphaMap=e(i,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":n.side=Mt;break;case"doubleSided":n.side=tt;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),n.opacity=i;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":n[r]=i;break;case"vertexColors":!0===i&&(n.vertexColors=N),"face"===i&&(n.vertexColors=D);break;default:console.error("THREE.Loader.createMaterial: Unsupported",r,i)}}return"MeshBasicMaterial"===n.type&&delete n.emissive,"MeshPhongMaterial"!==n.type&&delete n.specular,n.opacity<1&&(n.transparent=!0),Xu.setTextures(l),Xu.parse(n)})});var ih,ah,oh,sh,ch,uh,hh,lh,dh,ph,fh,mh,gh,vh,yh,xh,bh,wh,_h,Mh={getContext:function(){return void 0===Yu&&(Yu=new(window.AudioContext||window.webkitAudioContext)),Yu},setContext:function(t){Yu=t}};function Eh(t){this.manager=void 0!==t?t:Zc}function Sh(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new xo,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new xo,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Th(t,e,n,r){Er.call(this),this.type="CubeCamera";var i=new xo(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new dn(1,0,0)),this.add(i);var a=new xo(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new dn(-1,0,0)),this.add(a);var o=new xo(90,1,t,e);o.up.set(0,0,1),o.lookAt(new dn(0,1,0)),this.add(o);var s=new xo(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new dn(0,-1,0)),this.add(s);var c=new xo(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new dn(0,0,1)),this.add(c);var u=new xo(90,1,t,e);u.up.set(0,-1,0),u.lookAt(new dn(0,0,-1)),this.add(u),r=r||{format:oe,magFilter:jt,minFilter:jt},this.renderTarget=new Bn(n,n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,r=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,t.render(e,i,n),n.activeCubeFace=1,t.render(e,a,n),n.activeCubeFace=2,t.render(e,o,n),n.activeCubeFace=3,t.render(e,s,n),n.activeCubeFace=4,t.render(e,c,n),n.texture.generateMipmaps=r,n.activeCubeFace=5,t.render(e,u,n),t.setRenderTarget(null)},this.clear=function(t,e,n,r){for(var i=this.renderTarget,a=0;a<6;a++)i.activeCubeFace=a,t.setRenderTarget(i),t.clear(e,n,r);t.setRenderTarget(null)}}function Ah(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Lh(){Er.call(this),this.type="AudioListener",this.context=Mh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function Ph(t){Er.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Ch(t){Ph.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Rh(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Oh(t,e,n){this.binding=t,this.valueSize=n;var r,i=Float64Array;switch(e){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(Eh.prototype,{load:function(t,n,e,r){var i=new Kc(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(t,function(t){var e=t.slice(0);Mh.getContext().decodeAudioData(e,function(t){n(t)})},e,r)},setPath:function(t){return this.path=t,this}}),Object.assign(Sh.prototype,{update:(dh=new hn,ph=new hn,function(t){if(ih!==this||ah!==t.focus||oh!==t.fov||sh!==t.aspect*this.aspect||ch!==t.near||uh!==t.far||hh!==t.zoom||lh!==this.eyeSep){ih=this,ah=t.focus,oh=t.fov,sh=t.aspect*this.aspect,ch=t.near,uh=t.far,hh=t.zoom;var e,n,r=t.projectionMatrix.clone(),i=(lh=this.eyeSep/2)*ch/ah,a=ch*Math.tan(cn.DEG2RAD*oh*.5)/hh;ph.elements[12]=-lh,dh.elements[12]=lh,e=-a*sh+i,n=a*sh+i,r.elements[0]=2*ch/(n-e),r.elements[8]=(n+e)/(n-e),this.cameraL.projectionMatrix.copy(r),e=-a*sh-i,n=a*sh-i,r.elements[0]=2*ch/(n-e),r.elements[8]=(n+e)/(n-e),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(ph),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(dh)})}),(Th.prototype=Object.create(Er.prototype)).constructor=Th,Object.assign(Ah.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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),Lh.prototype=Object.assign(Object.create(Er.prototype),{constructor:Lh,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:(fh=new dn,mh=new ln,gh=new dn,vh=new dn,yh=new Ah,function(t){Er.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=yh.getDelta(),this.matrixWorld.decompose(fh,mh,gh),vh.set(0,0,-1).applyQuaternion(mh),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(fh.x,r),e.positionY.linearRampToValueAtTime(fh.y,r),e.positionZ.linearRampToValueAtTime(fh.z,r),e.forwardX.linearRampToValueAtTime(vh.x,r),e.forwardY.linearRampToValueAtTime(vh.y,r),e.forwardZ.linearRampToValueAtTime(vh.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(fh.x,fh.y,fh.z),e.setOrientation(vh.x,vh.y,vh.z,n.x,n.y,n.z)})}),Ph.prototype=Object.assign(Object.create(Er.prototype),{constructor:Ph,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.detune.value=this.detune,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,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.source.onended=null,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.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){return this.detune=t,!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),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(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!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(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),Ch.prototype=Object.assign(Object.create(Ph.prototype),{constructor:Ch,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:(xh=new dn,bh=new ln,wh=new dn,_h=new dn,function(t){if(Er.prototype.updateMatrixWorld.call(this,t),!1!==this.isPlaying){this.matrixWorld.decompose(xh,bh,wh),_h.set(0,0,1).applyQuaternion(bh);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(xh.x,n),e.positionY.linearRampToValueAtTime(xh.y,n),e.positionZ.linearRampToValueAtTime(xh.z,n),e.orientationX.linearRampToValueAtTime(_h.x,n),e.orientationY.linearRampToValueAtTime(_h.y,n),e.orientationZ.linearRampToValueAtTime(_h.z,n)}else e.setPosition(xh.x,xh.y,xh.z),e.setOrientation(_h.x,_h.y,_h.z)}})}),Object.assign(Rh.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Oh.prototype,{accumulate:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=e}else{var s=e/(a+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*e;this._mixBufferRegion(n,r,o,1-i,e)}for(var s=e,c=e+e;s!==c;++s)if(n[s]!==n[s+e]){a.setValue(n,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=3*n;t.getValue(e,r);for(var i=n,a=r;i!==a;++i)e[i]=e[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,r,i){if(.5<=r)for(var a=0;a!==i;++a)t[e+a]=t[n+a]},_slerp:function(t,e,n,r){ln.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*r}}});var Ih,Dh,Bh,Nh,zh,Uh,Gh,Fh,Hh,kh,Vh,jh,Wh,qh,Xh,Yh,Jh,Zh,Qh,Kh,$h,tl,el,nl,rl,il,al,ol,sl,cl,ul,hl,ll,dl,pl="\\[\\]\\.:\\/";function fl(t,e,n){var r=n||ml.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function ml(t,e,n){this.path=e,this.parsedPath=n||ml.parseTrackName(e),this.node=ml.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function gl(){this.uuid=cn.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function vl(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var r=e.tracks,i=r.length,a=new Array(i),o={endingStart:Ve,endingEnd:Ve},s=0;s!==i;++s){var c=r[s].createInterpolant(null);(a[s]=c).settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ue,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 yl(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function xl(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function bl(){ri.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function wl(t,e,n){qo.call(this,t,e),this.meshPerAttribute=n||1}function _l(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Dr.call(this,t,e,n),this.meshPerAttribute=r||1}function Ml(t,e,n,r){this.ray=new Ni(t,e),this.near=n||0,this.far=r||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}}})}function El(t,e){return t.distance-e.distance}function Sl(t,e,n,r){if(!1!==t.visible&&(t.raycast(e,n),!0===r))for(var i=t.children,a=0,o=i.length;a<o;a++)Sl(i[a],e,n,!0)}function Tl(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function Al(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}function Ll(t,e){this.min=void 0!==t?t:new un(1/0,1/0),this.max=void 0!==e?e:new un(-1/0,-1/0)}function Pl(t,e){this.start=void 0!==t?t:new dn,this.end=void 0!==e?e:new dn}function Cl(t){Er.call(this),this.material=t,this.render=function(){}}function Rl(t,e,n,r){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==n?n:16711680,a=void 0!==r?r: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 ri,u=new kr(2*o*3,3);c.addAttribute("position",u),ns.call(this,c,new ts({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Ol(t,e){Er.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new ri,r=[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],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new kr(r,3));var c=new ts({fog:!1});this.cone=new ns(n,c),this.add(this.cone),this.update()}function Il(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var r=0;r<e.children.length;r++)n.push.apply(n,t(e.children[r]));return n}(t),n=new ri,r=[],i=[],a=new Jn(0,0,1),o=new Jn(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.addAttribute("position",new kr(r,3)),n.addAttribute("color",new kr(i,3));var u=new ts({vertexColors:N,depthTest:!1,depthWrite:!1,transparent:!0});ns.call(this,n,u),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Dl(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var r=new oc(e,4,2),i=new Ui({wireframe:!0,fog:!1});Gi.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Bl(t,e){this.type="RectAreaLightHelper",this.light=t,this.color=e;var n=new ri;n.addAttribute("position",new kr([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();var r=new ts({fog:!1});es.call(this,n,r);var i=new ri;i.addAttribute("position",new kr([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),i.computeBoundingSphere(),this.add(new Gi(i,new Ui({side:THREE.BackSide,fog:!1}))),this.update()}function Nl(t,e,n){Er.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new ys(e);r.rotateY(.5*Math.PI),this.material=new Ui({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=N);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.addAttribute("color",new Dr(a,3)),this.add(new Gi(r,this.material)),this.update()}function zl(t,e,n,r){t=t||10,e=e||10,n=new Jn(void 0!==n?n:4473924),r=new Jn(void 0!==r?r:8947848);for(var i=e/2,a=t/e,o=t/2,s=[],c=[],u=0,h=0,l=-o;u<=e;u++,l+=a){s.push(-o,0,l,o,0,l),s.push(l,0,-o,l,0,o);var d=u===i?n:r;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 ri;p.addAttribute("position",new kr(s,3)),p.addAttribute("color",new kr(c,3));var f=new ts({vertexColors:N});ns.call(this,p,f)}function Ul(t,e,n,r,i,a){t=t||10,e=e||16,n=n||8,r=r||64,i=new Jn(void 0!==i?i:4473924),a=new Jn(void 0!==a?a:8947848);var o,s,c,u,h,l,d,p=[],f=[];for(u=0;u<=e;u++)c=u/e*(2*Math.PI),o=Math.sin(c)*t,s=Math.cos(c)*t,p.push(0,0,0),p.push(o,0,s),d=1&u?i:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(u=0;u<=n;u++)for(d=1&u?i:a,l=t-t/n*u,h=0;h<r;h++)c=h/r*(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)/r*(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 m=new ri;m.addAttribute("position",new kr(p,3)),m.addAttribute("color",new kr(f,3));var g=new ts({vertexColors:N});ns.call(this,m,g)}function Gl(t,e,n,r){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==n?n:16776960,a=void 0!==r?r: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 ri,u=new kr(2*o*3,3);c.addAttribute("position",u),ns.call(this,c,new ts({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Fl(t,e,n){Er.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var r=new ri;r.addAttribute("position",new kr([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new ts({fog:!1});this.lightPlane=new es(r,i),this.add(this.lightPlane),(r=new ri).addAttribute("position",new kr([0,0,0,0,0,1],3)),this.targetLine=new es(r,i),this.add(this.targetLine),this.update()}function Hl(t){var e=new ri,n=new ts({color:16777215,vertexColors:D}),r=[],i=[],a={},o=new Jn(16755200),s=new Jn(16711680),c=new Jn(43775),u=new Jn(16777215),h=new Jn(3355443);function l(t,e,n){d(t,n),d(e,n)}function d(t,e){r.push(0,0,0),i.push(e.r,e.g,e.b),void 0===a[t]&&(a[t]=[]),a[t].push(r.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),e.addAttribute("position",new kr(r,3)),e.addAttribute("color",new kr(i,3)),ns.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function kl(t,e){this.object=t,void 0===e&&(e=16776960);var 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 Float32Array(24),i=new ri;i.setIndex(new Dr(n,1)),i.addAttribute("position",new Dr(r,3)),ns.call(this,i,new ts({color:e})),this.matrixAutoUpdate=!1,this.update()}function Vl(t,e){this.type="Box3Helper",this.box=t;var n=void 0!==e?e:16776960,r=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]),i=new ri;i.setIndex(new Dr(r,1)),i.addAttribute("position",new kr([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)),ns.call(this,i,new ts({color:n})),this.geometry.computeBoundingSphere()}function jl(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var r=void 0!==n?n:16776960,i=new ri;i.addAttribute("position",new kr([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)),i.computeBoundingSphere(),es.call(this,i,new ts({color:r}));var a=new ri;a.addAttribute("position",new kr([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Gi(a,new Ui({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}function Wl(t,e,n,r,i,a){Er.call(this),void 0===t&&(t=new THREE.Vector3(0,0,1)),void 0===e&&(e=new THREE.Vector3(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===ul&&((ul=new ri).addAttribute("position",new kr([0,0,0,0,1,0],3)),(hl=new gc(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new es(ul,new ts({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Gi(hl,new Ui({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,a)}function ql(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new ri;n.addAttribute("position",new kr(e,3)),n.addAttribute("color",new kr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new ts({vertexColors:N});ns.call(this,n,r)}function Xl(t,e,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new nr(t,e,n,i,a,o)}Object.assign(fl.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(ml,{Composite:fl,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new ml.Composite(t,e,n):new ml(t,e,n)},sanitizeNodeName:(Hh=new RegExp("["+pl+"]","g"),function(t){return t.replace(/\s/g,"_").replace(Hh,"")}),parseTrackName:(Ih="[^"+pl+"]",Dh="[^"+pl.replace("\\.","")+"]",Bh=/((?:WC+[\/:])*)/.source.replace("WC",Ih),Nh=/(WCOD+)?/.source.replace("WCOD",Dh),zh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ih),Uh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ih),Gh=new RegExp("^"+Bh+Nh+zh+Uh+"$"),Fh=["material","materials","bones"],function(t){var e=Gh.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Fh.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,i){if(!i||""===i||"root"===i||"."===i||-1===i||i===t.name||i===t.uuid)return t;if(t.skeleton){var e=t.skeleton.getBoneByName(i);if(void 0!==e)return e}if(t.children){var a=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.name===i||n.uuid===i)return n;var r=a(n.children);if(r)return r}return null},n=a(t.children);if(n)return n}return null}}),Object.assign(ml.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(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=ml.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[r];if(void 0!==s){var c=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.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(t.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!t.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(t.geometry.morphTargets[o].name===i){i=o;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}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=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var h=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+r+" but it wasn't found.",t)}}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}}),
|
|
//!\ DECLARE ALIAS AFTER assign prototype !
|
|
Object.assign(ml.prototype,{_getValue_unbound:ml.prototype.getValue,_setValue_unbound:ml.prototype.setValue}),Object.assign(gl.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=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=r[d];if(void 0===p){p=e++,r[d]=p,t.push(l);for(var f=0,m=s;f!==m;++f)o[f].push(new ml(l,i[f],a[f]))}else if(p<n){c=t[p];var g=--n,v=t[g];t[r[v.uuid]=p]=v,t[r[d]=g]=l;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],b=y[p];y[p]=x,void 0===b&&(b=new ml(l,i[f],a[f])),y[g]=b}}else t[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_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,u=n[c];if(void 0!==u&&e<=u){var h=e++,l=t[h];t[n[l.uuid]=u]=l,t[n[c]=h]=s;for(var d=0,p=i;d!==p;++d){var f=r[d],m=f[h],g=f[u];f[u]=m,f[h]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o].uuid,u=r[c];if(void 0!==u)if(delete r[c],u<n){var h=--n,l=t[h],d=t[v=--e];t[r[l.uuid]=u]=l,t[r[d.uuid]=h]=d,t.pop();for(var p=0,f=a;p!==f;++p){var m=(y=i[p])[h],g=y[v];y[u]=m,y[h]=g,y.pop()}}else{var v;t[r[(d=t[v=--e]).uuid]=u]=d,t.pop();for(p=0,f=a;p!==f;++p){var y;(y=i[p])[u]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,h=new Array(c);r=i.length,n[t]=r,a.push(t),o.push(e),i.push(h);for(var l=u,d=s.length;l!==d;++l){var p=s[l];h[l]=new ml(p,t,e)}return h},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];a[e[t[o]]=n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(vl.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(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,a=i/r,o=r/i;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=t/o,c[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(t-i)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(0<s)for(var c=this._interpolants,u=this._propertyBindings,h=0,l=c.length;h!==l;++h)c[h].evaluate(o),u[h].accumulate(r,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===Ge;if(0===t)return-1===i?e:a&&1==(1&i)?n-e:e;if(r===ze){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n<=e)e=n;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(0<=t?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=e||e<0){var o=Math.floor(e/n);e-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1==(1&i))return n-(this.time=e)}return this.time=e},_setEndings:function(t,e,n){var r=this._interpolantSettings;r.endingEnd=n?r.endingStart=je:(r.endingStart=t?this.zeroSlopeAtStart?je:Ve:We,e?this.zeroSlopeAtEnd?je:Ve:We)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=e,o[1]=i+t,s[1]=n,this}}),yl.prototype=Object.assign(Object.create(r.prototype),{constructor:yl,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var h=0;h!==i;++h){var l=r[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=e&&e._propertyBindings[h].binding.parsedPath;++(p=new Oh(ml.create(n,d,f),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[h]=p}o[h].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var r=this._actions,i=this._actionsByClip,a=i[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=r.length,r.push(t),a.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;e[n._cacheIndex=r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],u=t._byClipCacheIndex;s[c._byClipCacheIndex=u]=c,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_addInactiveBinding:function(t,e,n){var r=this._bindingsByRootAndName,i=r[e],a=this._bindings;void 0===i&&(i={},r[e]=i),(i[n]=t)._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=e[e.length-1],c=t._cacheIndex;e[s._cacheIndex=c]=s,e.pop(),delete o[i];t:{for(var u in o)break t;delete a[r]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new Nc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];e[t.__cacheIndex=r]=t,e[i.__cacheIndex=n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?qc.findByName(n,t):t,a=null!==i?i.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[r];if(void 0!==c)return c;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var u=new vl(this,i,e);return this._bindAction(u,s),this._addInactiveAction(u,a,r),u},existingAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?qc.findByName(n,t):t,a=i?i.uuid:t,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0;for(var i=this._nActiveBindings=0;i!==e;++i)t[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o){e[o]._update(r,t,i,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(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var u=c._cacheIndex,h=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,e[h._cacheIndex=u]=h,e.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[e];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),xl.prototype.clone=function(){return new xl(void 0===this.value.clone?this.value:this.value.clone())},bl.prototype=Object.assign(Object.create(ri.prototype),{constructor:bl,isInstancedBufferGeometry:!0,copy:function(t){return ri.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),wl.prototype=Object.assign(Object.create(qo.prototype),{constructor:wl,isInstancedInterleavedBuffer:!0,copy:function(t){return qo.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),_l.prototype=Object.assign(Object.create(Dr.prototype),{constructor:_l,isInstancedBufferAttribute:!0,copy:function(t){return Dr.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Ml.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var r=n||[];return Sl(t,this,r,e),r.sort(El),r},intersectObjects:function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=t.length;i<a;i++)Sl(t[i],this,r,e);return r.sort(El),r}}),Object.assign(Tl.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(cn.clamp(e/this.radius,-1,1))),this}}),Object.assign(Al.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}}),Object.assign(Ll.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(Vh=new un,function(t,e){var n=Vh.copy(e).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(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new un),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new un),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new un),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new un),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(kh=new un,function(t){return kh.copy(t).clamp(this.min,this.max).sub(t).length()}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Pl.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new dn),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new dn),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new dn),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(jh=new dn,Wh=new dn,function(t,e){jh.subVectors(t,this.start),Wh.subVectors(this.end,this.start);var n=Wh.dot(Wh),r=Wh.dot(jh)/n;return e&&(r=cn.clamp(r,0,1)),r}),closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new dn),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),((Cl.prototype=Object.create(Er.prototype)).constructor=Cl).prototype.isImmediateRenderObject=!0,((Rl.prototype=Object.create(ns.prototype)).constructor=Rl).prototype.update=(qh=new dn,Xh=new dn,Yh=new pn,function(){var t=["a","b","c"];this.object.updateMatrixWorld(!0),Yh.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,n=this.geometry.attributes.position,r=this.object.geometry;if(r&&r.isGeometry)for(var i=r.vertices,a=r.faces,o=0,s=0,c=a.length;s<c;s++)for(var u=a[s],h=0,l=u.vertexNormals.length;h<l;h++){var d=i[u[t[h]]],p=u.vertexNormals[h];qh.copy(d).applyMatrix4(e),Xh.copy(p).applyMatrix3(Yh).normalize().multiplyScalar(this.size).add(qh),n.setXYZ(o,qh.x,qh.y,qh.z),o+=1,n.setXYZ(o,Xh.x,Xh.y,Xh.z),o+=1}else if(r&&r.isBufferGeometry){var f=r.attributes.position,m=r.attributes.normal;for(h=o=0,l=f.count;h<l;h++)qh.set(f.getX(h),f.getY(h),f.getZ(h)).applyMatrix4(e),Xh.set(m.getX(h),m.getY(h),m.getZ(h)),Xh.applyMatrix3(Yh).normalize().multiplyScalar(this.size).add(qh),n.setXYZ(o,qh.x,qh.y,qh.z),o+=1,n.setXYZ(o,Xh.x,Xh.y,Xh.z),o+=1}n.needsUpdate=!0}),((Ol.prototype=Object.create(Er.prototype)).constructor=Ol).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ol.prototype.update=(Jh=new dn,function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Jh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Jh),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}),((Il.prototype=Object.create(ns.prototype)).constructor=Il).prototype.updateMatrixWorld=(Zh=new dn,Qh=new hn,Kh=new hn,function(t){var e=this.bones,n=this.geometry,r=n.getAttribute("position");Kh.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<e.length;i++){var o=e[i];o.parent&&o.parent.isBone&&(Qh.multiplyMatrices(Kh,o.matrixWorld),Zh.setFromMatrixPosition(Qh),r.setXYZ(a,Zh.x,Zh.y,Zh.z),Qh.multiplyMatrices(Kh,o.parent.matrixWorld),Zh.setFromMatrixPosition(Qh),r.setXYZ(a+1,Zh.x,Zh.y,Zh.z),a+=2)}n.getAttribute("position").needsUpdate=!0,Er.prototype.updateMatrixWorld.call(this,t)}),((Dl.prototype=Object.create(Gi.prototype)).constructor=Dl).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Dl.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},((Bl.prototype=Object.create(es.prototype)).constructor=Bl).prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var t=this.material.color,e=Math.max(t.r,t.g,t.b);1<e&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},Bl.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},((Nl.prototype=Object.create(Er.prototype)).constructor=Nl).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Nl.prototype.update=($h=new dn,tl=new Jn,el=new Jn,function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");tl.copy(this.light.color),el.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?tl:el;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt($h.setFromMatrixPosition(this.light.matrixWorld).negate())}),(zl.prototype=Object.create(ns.prototype)).constructor=zl,(Ul.prototype=Object.create(ns.prototype)).constructor=Ul,((Gl.prototype=Object.create(ns.prototype)).constructor=Gl).prototype.update=(nl=new dn,rl=new dn,il=new pn,function(){this.object.updateMatrixWorld(!0),il.getNormalMatrix(this.object.matrixWorld);for(var t=this.object.matrixWorld,e=this.geometry.attributes.position,n=this.object.geometry,r=n.vertices,i=n.faces,a=0,o=0,s=i.length;o<s;o++){var c=i[o],u=c.normal;nl.copy(r[c.a]).add(r[c.b]).add(r[c.c]).divideScalar(3).applyMatrix4(t),rl.copy(u).applyMatrix3(il).normalize().multiplyScalar(this.size).add(nl),e.setXYZ(a,nl.x,nl.y,nl.z),a+=1,e.setXYZ(a,rl.x,rl.y,rl.z),a+=1}e.needsUpdate=!0}),((Fl.prototype=Object.create(Er.prototype)).constructor=Fl).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Fl.prototype.update=(al=new dn,ol=new dn,sl=new dn,function(){al.setFromMatrixPosition(this.light.matrixWorld),ol.setFromMatrixPosition(this.light.target.matrixWorld),sl.subVectors(ol,al),this.lightPlane.lookAt(ol),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(ol),this.targetLine.scale.z=sl.length()}),((Hl.prototype=Object.create(ns.prototype)).constructor=Hl).prototype.update=function(){var c,u,h=new dn,l=new yo;function t(t,e,n,r){h.set(e,n,r).unproject(l);var i=u[t];if(void 0!==i)for(var a=c.getAttribute("position"),o=0,s=i.length;o<s;o++)a.setXYZ(i[o],h.x,h.y,h.z)}return function(){c=this.geometry,u=this.pointMap;l.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-1,-1,-1),t("n2",1,-1,-1),t("n3",-1,1,-1),t("n4",1,1,-1),t("f1",-1,-1,1),t("f2",1,-1,1),t("f3",-1,1,1),t("f4",1,1,1),t("u1",.7,1.1,-1),t("u2",-.7,1.1,-1),t("u3",0,2,-1),t("cf1",-1,0,1),t("cf2",1,0,1),t("cf3",0,-1,1),t("cf4",0,1,1),t("cn1",-1,0,-1),t("cn2",1,0,-1),t("cn3",0,-1,-1),t("cn4",0,1,-1),c.getAttribute("position").needsUpdate=!0}}(),((kl.prototype=Object.create(ns.prototype)).constructor=kl).prototype.update=(cl=new zn,function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&cl.setFromObject(this.object),!cl.isEmpty()){var e=cl.min,n=cl.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}),kl.prototype.setFromObject=function(t){return this.object=t,this.update(),this},kl.prototype.copy=function(t){return ns.prototype.copy.call(this,t),this.object=t.object,this},kl.prototype.clone=function(){return(new this.constructor).copy(this)},((Vl.prototype=Object.create(ns.prototype)).constructor=Vl).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Er.prototype.updateMatrixWorld.call(this,t))},((jl.prototype=Object.create(es.prototype)).constructor=jl).prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?Mt:B,this.lookAt(this.plane.normal),Er.prototype.updateMatrixWorld.call(this,t)},((Wl.prototype=Object.create(Er.prototype)).constructor=Wl).prototype.setDirection=(dl=new dn,function(t){.99999<t.y?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(dl.set(t.z,0,-t.x).normalize(),ll=Math.acos(t.y),this.quaternion.setFromAxisAngle(dl,ll))}),Wl.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Wl.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Wl.prototype.copy=function(t){return Er.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Wl.prototype.clone=function(){return(new this.constructor).copy(this)},(ql.prototype=Object.create(ns.prototype)).constructor=ql;var Yl,Jl=0,Zl=1;function Ql(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Kl(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,(t.materials=t).clone=function(){return t.slice()},t}function $l(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new as(t,e)}function td(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Jo(t)}function ed(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new as(t,e)}function nd(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new is(t)}function rd(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new is(t)}function id(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new is(t)}function ad(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new dn(t,e,n)}function od(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new Dr(t,e).setDynamic(!0)}function sd(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Br(t,e)}function cd(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Nr(t,e)}function ud(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new zr(t,e)}function hd(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Ur(t,e)}function ld(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Gr(t,e)}function dd(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Fr(t,e)}function pd(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Hr(t,e)}function fd(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new kr(t,e)}function md(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Vr(t,e)}function gd(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),pu.call(this,t),this.type="catmullrom",this.closed=!0}function vd(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),pu.call(this,t),this.type="catmullrom"}function yd(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),pu.call(this,t),this.type="catmullrom"}function xd(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new ql(t)}function bd(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new kl(t,e)}function wd(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new ns(new fc(t.geometry),new ts({color:void 0!==e?e:16777215}))}function _d(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new ns(new hs(t.geometry),new ts({color:void 0!==e?e:16777215}))}function Md(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Kc(t)}function Ed(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new eu(t)}au.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(au.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(Su.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new Ir,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new dn(i.x,i.y,i.z||0))}return e}}),Object.assign(Tu.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),gd.prototype=Object.create(pu.prototype),vd.prototype=Object.create(pu.prototype),yd.prototype=Object.create(pu.prototype),Object.assign(yd.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.")}}),zl.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Il.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(rh.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Fu.extractUrlBase(t)}}),Object.assign(Vu.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Ll.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(zn.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Pl.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(cn,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),cn.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),cn.ceilPowerOfTwo(t)}}),Object.assign(pn.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(hn.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return void 0===Yl&&(Yl=new dn),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),Yl.setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.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(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,a)}}),Gn.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},ln.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Ni.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(zi.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(zi,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),zi.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),zi.getNormal(t,e,n,r)}}),Object.assign(Au.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new $s(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new lc(this,t)}}),Object.assign(un.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(dn.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(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(In.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ir.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(Er.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(Er.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},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(Zo.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Ko.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Qo.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(au.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),xo.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Lu.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Dr.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(ri.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},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(ri.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(tc.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(xl.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(Di.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Jn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===R}}}),Object.defineProperties(Tc.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(Bi.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(ko.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},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(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},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(ko.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},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(po.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(Dn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Fo.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),Ph.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Eh).load(t,function(t){e.setBuffer(t)}),this},Rh.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Th.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var Sd={merge:function(t,e,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),r=e.matrix,e=e.geometry),t.merge(e,r,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};function Td(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function Ad(){console.error("THREE.CanvasRenderer has been removed")}function Ld(){console.error("THREE.JSONLoader has been removed.")}Cn.crossOrigin=void 0,Cn.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new iu;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},Cn.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new ru;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},Cn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Cn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Pd={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function Cd(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}},function(n,a,t){(function(e){var t,r,i,s=s||(r=[],{getAll:function(){return r},removeAll:function(){r=[]},add:function(t){r.push(t)},remove:function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,1)},update:function(t,e){if(0===r.length)return!1;var n=0;for(t=void 0!==t?t:s.now();n<r.length;)r[n].update(t)||e?n++:r.splice(n,1);return!0}});"undefined"==typeof window&&void 0!==e?s.now=function(){var t=e.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?s.now=window.performance.now.bind(window.performance):void 0!==Date.now?s.now=Date.now:s.now=function(){return(new Date).getTime()},s.Tween=function(t){var u,h=t,l={},d={},p={},f=1e3,m=0,g=!1,n=!1,v=!1,y=0,x=null,b=s.Easing.Linear.None,w=s.Interpolation.Linear,_=[],M=null,E=!1,S=null,T=null,e=null;this.to=function(t,e){return d=t,void 0!==e&&(f=e),this},this.start=function(t){for(var e in s.add(this),E=!(n=!0),x=void 0!==t?t:s.now(),x+=y,d){if(d[e]instanceof Array){if(0===d[e].length)continue;d[e]=[h[e]].concat(d[e])}void 0!==h[e]&&(l[e]=h[e],l[e]instanceof Array==!1&&(l[e]*=1),p[e]=l[e]||0)}return this},this.stop=function(){return n&&(s.remove(this),n=!1,null!==e&&e.call(h,h),this.stopChainedTweens()),this},this.end=function(){return this.update(x+f),this},this.stopChainedTweens=function(){for(var t=0,e=_.length;t<e;t++)_[t].stop()},this.delay=function(t){return y=t,this},this.repeat=function(t){return m=t,this},this.repeatDelay=function(t){return u=t,this},this.yoyo=function(t){return g=t,this},this.easing=function(t){return b=t,this},this.interpolation=function(t){return w=t,this},this.chain=function(){return _=arguments,this},this.onStart=function(t){return M=t,this},this.onUpdate=function(t){return S=t,this},this.onComplete=function(t){return T=t,this},this.onStop=function(t){return e=t,this},this.update=function(t){var e,n,r;if(t<x)return!0;for(e in!1===E&&(null!==M&&M.call(h,h),E=!0),r=b(n=1<(n=(t-x)/f)?1:n),d)if(void 0!==l[e]){var i=l[e]||0,a=d[e];a instanceof Array?h[e]=w(a,r):("string"==typeof a&&(a="+"===a.charAt(0)||"-"===a.charAt(0)?i+parseFloat(a):parseFloat(a)),"number"==typeof a&&(h[e]=i+(a-i)*r))}if(null!==S&&S.call(h,r),1!==n)return!0;if(0<m){for(e in isFinite(m)&&m--,p){if("string"==typeof d[e]&&(p[e]=p[e]+parseFloat(d[e])),g){var o=p[e];p[e]=d[e],d[e]=o}l[e]=p[e]}return g&&(v=!v),x=void 0!==u?t+u:t+y,!0}null!==T&&T.call(h,h);for(var s=0,c=_.length;s<c;s++)_[s].start(x+f);return!1}},s.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-s.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*s.Easing.Bounce.In(2*t):.5*s.Easing.Bounce.Out(2*t-1)+.5}}},s.Interpolation={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=s.Interpolation.Utils.Linear;return e<0?a(t[0],t[1],r):1<e?a(t[n],t[n-1],n-r):a(t[i],t[n<i+1?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,a=s.Interpolation.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-e,r-o)*i(e,o)*t[o]*a(r,o);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=s.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),a(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-r)-t[0]):1<e?t[n]-(a(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):a(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=s.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(i=[1],function(t){var e=1;if(i[t])return i[t];for(var n=t;1<n;n--)e*=n;return i[t]=e}),CatmullRom:function(t,e,n,r,i){var a=.5*(n-t),o=.5*(r-e),s=i*i;return(2*e-2*n+a+o)*(i*s)+(-3*e+3*n-2*a-o)*s+a*i+e}}},void 0===(t=function(){return s}.apply(a,[]))||(n.exports=t)}).call(this,t(3))},function(t,e,n){(function(H,k){
|
|
/*!
|
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
* @license Licensed under MIT license
|
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
* @version v4.2.5+7f2b526d
|
|
*/
|
|
t.exports=function(){"use strict";function u(t){return"function"==typeof t}var n=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,e=void 0,i=void 0,s=function(t,e){d[r]=t,d[r+1]=e,2===(r+=2)&&(i?i(p):y())},t="undefined"!=typeof window?window:void 0,a=t||{},o=a.MutationObserver||a.WebKitMutationObserver,c="undefined"==typeof self&&void 0!==H&&"[object process]"==={}.toString.call(H),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var t=setTimeout;return function(){return t(p,1)}}var d=new Array(1e3);function p(){for(var t=0;t<r;t+=2){var e=d[t],n=d[t+1];e(n),d[t]=void 0,d[t+1]=void 0}r=0}var f,m,g,v,y=void 0;function x(t,e){var n=this,r=new this.constructor(_);void 0===r[w]&&U(r);var i=n._state;if(i){var a=arguments[i-1];s(function(){return N(i,r,a,n._result)})}else D(n,r,t,e);return r}function b(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(_);return C(e,t),e}y=c?function(){return H.nextTick(p)}:o?(m=0,g=new o(p),v=document.createTextNode(""),g.observe(v,{characterData:!0}),function(){v.data=m=++m%2}):h?((f=new MessageChannel).port1.onmessage=p,function(){return f.port2.postMessage(0)}):void 0===t?function(){try{var t=Function("return this")().require("vertx");return void 0===(e=t.runOnLoop||t.runOnContext)?l():function(){e(p)}}catch(t){return l()}}():l();var w=Math.random().toString(36).substring(2);function _(){}var M=void 0,E=1,S=2,T={error:null};function A(t){try{return t.then}catch(t){return T.error=t,T}}function L(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}function P(t,e,n){var r,i,a,o;e.constructor===t.constructor&&n===x&&e.constructor.resolve===b?(a=t,(o=e)._state===E?O(a,o._result):o._state===S?I(a,o._result):D(o,void 0,function(t){return C(a,t)},function(t){return I(a,t)})):n===T?(I(t,T.error),T.error=null):void 0===n?O(t,e):u(n)?(r=e,i=n,s(function(e){var n=!1,t=L(i,r,function(t){n||(n=!0,r!==t?C(e,t):O(e,t))},function(t){n||(n=!0,I(e,t))},e._label);!n&&t&&(n=!0,I(e,t))},t)):O(t,e)}function C(t,e){var n,r;t===e?I(t,new TypeError("You cannot resolve a promise with itself")):(r=typeof(n=e),null===n||"object"!==r&&"function"!==r?O(t,e):P(t,e,A(e)))}function R(t){t._onerror&&t._onerror(t._result),B(t)}function O(t,e){t._state===M&&(t._result=e,t._state=E,0!==t._subscribers.length&&s(B,t))}function I(t,e){t._state===M&&(t._state=S,t._result=e,s(R,t))}function D(t,e,n,r){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+E]=n,i[a+S]=r,0===a&&t._state&&s(B,t)}function B(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)r=e[o],i=e[o+n],r?N(n,r,i,a):i(a);t._subscribers.length=0}}function N(t,e,n,r){var i=u(n),a=void 0,o=void 0,s=void 0,c=void 0;if(i){if((a=function(t,e){try{return t(e)}catch(t){return T.error=t,T}}(n,r))===T?(c=!0,o=a.error,a.error=null):s=!0,e===a)return void I(e,new TypeError("A promises callback cannot return that same promise."))}else a=r,s=!0;e._state!==M||(i&&s?C(e,a):c?I(e,o):t===E?O(e,a):t===S&&I(e,a))}var z=0;function U(t){t[w]=z++,t._state=void 0,t._result=void 0,t._subscribers=[]}var G=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(_),this.promise[w]||U(this.promise),n(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&O(this.promise,this._result))):I(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===M&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===b){var i=A(e);if(i===x&&e._state!==M)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===F){var a=new n(_);P(a,e,i),this._willSettleAt(a,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(r(e),t)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===M&&(this._remaining--,t===S?I(r,n):this._result[e]=n),0===this._remaining&&O(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;D(t,void 0,function(t){return n._settledAt(E,e,t)},function(t){return n._settledAt(S,e,t)})},t}(),F=function(){function e(t){this[w]=z++,this._result=this._state=void 0,this._subscribers=[],_!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,t){try{t(function(t){C(e,t)},function(t){I(e,t)})}catch(t){I(e,t)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return u(e)?this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})}):this.then(e,e)},e}();return F.prototype.then=x,F.all=function(t){return new G(this,t).promise},F.race=function(i){var a=this;return n(i)?new a(function(t,e){for(var n=i.length,r=0;r<n;r++)a.resolve(i[r]).then(t,e)}):new a(function(t,e){return e(new TypeError("You must pass an array to race."))})},F.resolve=b,F.reject=function(t){var e=new this(_);return I(e,t),e},F._setScheduler=function(t){i=t},F._setAsap=function(t){s=t},F._asap=s,F.polyfill=function(){var t=void 0;if(void 0!==k)t=k;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=F},F.Promise=F}()}).call(this,n(3),n(6))},function(t,e){var n,r,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var c,u=[],h=!1,l=-1;function d(){h&&c&&(h=!1,c.length?u=c.concat(u):l=-1,u.length&&p())}function p(){if(!h){var t=s(d);h=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,h=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||h||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,,function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n}]]); |