Files
coins/public/bundle.js
T
2023-09-11 22:26:59 +01:00

13 lines
596 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){"use strict";function r(){}n.r(e),n.d(e,"WebGLRenderTargetCube",function(){return ze}),n.d(e,"WebGLRenderTarget",function(){return Be}),n.d(e,"WebGLRenderer",function(){return Pi}),n.d(e,"ShaderLib",function(){return Dn}),n.d(e,"UniformsLib",function(){return On}),n.d(e,"UniformsUtils",function(){return Un}),n.d(e,"ShaderChunk",function(){return Nn}),n.d(e,"FogExp2",function(){return Ci}),n.d(e,"Fog",function(){return Ii}),n.d(e,"Scene",function(){return Oi}),n.d(e,"LensFlare",function(){return Ui}),n.d(e,"Sprite",function(){return Di}),n.d(e,"LOD",function(){return Fi}),n.d(e,"SkinnedMesh",function(){return Gi}),n.d(e,"Skeleton",function(){return Bi}),n.d(e,"Bone",function(){return zi}),n.d(e,"Mesh",function(){return Yr}),n.d(e,"LineSegments",function(){return ji}),n.d(e,"LineLoop",function(){return Vi}),n.d(e,"Line",function(){return ki}),n.d(e,"Points",function(){return Xi}),n.d(e,"Group",function(){return qi}),n.d(e,"VideoTexture",function(){return Yi}),n.d(e,"DataTexture",function(){return je}),n.d(e,"CompressedTexture",function(){return Zi}),n.d(e,"CubeTexture",function(){return Ve}),n.d(e,"CanvasTexture",function(){return Ji}),n.d(e,"DepthTexture",function(){return Ki}),n.d(e,"Texture",function(){return De}),n.d(e,"CompressedTextureLoader",function(){return $o}),n.d(e,"DataTextureLoader",function(){return ta}),n.d(e,"CubeTextureLoader",function(){return na}),n.d(e,"TextureLoader",function(){return ra}),n.d(e,"ObjectLoader",function(){return za}),n.d(e,"MaterialLoader",function(){return Pa}),n.d(e,"BufferGeometryLoader",function(){return Ca}),n.d(e,"DefaultLoadingManager",function(){return Ko}),n.d(e,"LoadingManager",function(){return Jo}),n.d(e,"JSONLoader",function(){return Ba}),n.d(e,"ImageLoader",function(){return ea}),n.d(e,"FontLoader",function(){return os}),n.d(e,"FileLoader",function(){return Qo}),n.d(e,"Loader",function(){return Fa}),n.d(e,"Cache",function(){return Zo}),n.d(e,"AudioLoader",function(){return Ts}),n.d(e,"SpotLightShadow",function(){return sa}),n.d(e,"SpotLight",function(){return ca}),n.d(e,"PointLight",function(){return ua}),n.d(e,"RectAreaLight",function(){return da}),n.d(e,"HemisphereLight",function(){return oa}),n.d(e,"DirectionalLightShadow",function(){return la}),n.d(e,"DirectionalLight",function(){return ha}),n.d(e,"AmbientLight",function(){return fa}),n.d(e,"LightShadow",function(){return aa}),n.d(e,"Light",function(){return ia}),n.d(e,"StereoCamera",function(){return Ss}),n.d(e,"PerspectiveCamera",function(){return pr}),n.d(e,"OrthographicCamera",function(){return dr}),n.d(e,"CubeCamera",function(){return As}),n.d(e,"ArrayCamera",function(){return Si}),n.d(e,"Camera",function(){return fr}),n.d(e,"AudioListener",function(){return Rs}),n.d(e,"PositionalAudio",function(){return Ps}),n.d(e,"AudioContext",function(){return Es}),n.d(e,"AudioAnalyser",function(){return Cs}),n.d(e,"Audio",function(){return Ls}),n.d(e,"VectorKeyframeTrack",function(){return ba}),n.d(e,"StringKeyframeTrack",function(){return Ta}),n.d(e,"QuaternionKeyframeTrack",function(){return Ma}),n.d(e,"NumberKeyframeTrack",function(){return Ea}),n.d(e,"ColorKeyframeTrack",function(){return Aa}),n.d(e,"BooleanKeyframeTrack",function(){return Sa}),n.d(e,"PropertyMixer",function(){return Is}),n.d(e,"PropertyBinding",function(){return Us}),n.d(e,"KeyframeTrack",function(){return Ra}),n.d(e,"AnimationUtils",function(){return ma}),n.d(e,"AnimationObjectGroup",function(){return Ns}),n.d(e,"AnimationMixer",function(){return Fs}),n.d(e,"AnimationClip",function(){return La}),n.d(e,"Uniform",function(){return Bs}),n.d(e,"InstancedBufferGeometry",function(){return zs}),n.d(e,"BufferGeometry",function(){return zr}),n.d(e,"GeometryIdCount",function(){return Tr}),n.d(e,"Geometry",function(){return Sr}),n.d(e,"InterleavedBufferAttribute",function(){return Gs}),n.d(e,"InstancedInterleavedBuffer",function(){return ks}),n.d(e,"InterleavedBuffer",function(){return Hs}),n.d(e,"InstancedBufferAttribute",function(){return js}),n.d(e,"Face3",function(){return mr}),n.d(e,"Object3D",function(){return hr}),n.d(e,"Raycaster",function(){return Vs}),n.d(e,"Layers",function(){return or}),n.d(e,"EventDispatcher",function(){return r}),n.d(e,"Clock",function(){return qs}),n.d(e,"QuaternionLinearInterpolant",function(){return wa}),n.d(e,"LinearInterpolant",function(){return ya}),n.d(e,"DiscreteInterpolant",function(){return xa}),n.d(e,"CubicInterpolant",function(){return va}),n.d(e,"Interpolant",function(){return ga}),n.d(e,"Triangle",function(){return qr}),n.d(e,"Math",function(){return Ae}),n.d(e,"Spherical",function(){return Ys}),n.d(e,"Cylindrical",function(){return Zs}),n.d(e,"Plane",function(){return tr}),n.d(e,"Frustum",function(){return er}),n.d(e,"Sphere",function(){return Qn}),n.d(e,"Ray",function(){return Wr}),n.d(e,"Matrix4",function(){return ke}),n.d(e,"Matrix3",function(){return $n}),n.d(e,"Box3",function(){return Kn}),n.d(e,"Box2",function(){return Fn}),n.d(e,"Line3",function(){return Xr}),n.d(e,"Euler",function(){return ir}),n.d(e,"Vector4",function(){return Fe}),n.d(e,"Vector3",function(){return He}),n.d(e,"Vector2",function(){return Re}),n.d(e,"Quaternion",function(){return Ge}),n.d(e,"Color",function(){return In}),n.d(e,"MorphBlendMesh",function(){return Js}),n.d(e,"ImmediateRenderObject",function(){return Ks}),n.d(e,"VertexNormalsHelper",function(){return Qs}),n.d(e,"SpotLightHelper",function(){return $s}),n.d(e,"SkeletonHelper",function(){return tc}),n.d(e,"PointLightHelper",function(){return ec}),n.d(e,"RectAreaLightHelper",function(){return nc}),n.d(e,"HemisphereLightHelper",function(){return rc}),n.d(e,"GridHelper",function(){return ic}),n.d(e,"PolarGridHelper",function(){return oc}),n.d(e,"FaceNormalsHelper",function(){return ac}),n.d(e,"DirectionalLightHelper",function(){return sc}),n.d(e,"CameraHelper",function(){return cc}),n.d(e,"BoxHelper",function(){return uc}),n.d(e,"ArrowHelper",function(){return lc}),n.d(e,"AxisHelper",function(){return hc}),n.d(e,"CatmullRomCurve3",function(){return vc}),n.d(e,"CubicBezierCurve3",function(){return yc}),n.d(e,"QuadraticBezierCurve3",function(){return xc}),n.d(e,"LineCurve3",function(){return _c}),n.d(e,"ArcCurve",function(){return bc}),n.d(e,"EllipseCurve",function(){return Za}),n.d(e,"SplineCurve",function(){return Ja}),n.d(e,"CubicBezierCurve",function(){return Ka}),n.d(e,"QuadraticBezierCurve",function(){return Qa}),n.d(e,"LineCurve",function(){return qa}),n.d(e,"Shape",function(){return ns}),n.d(e,"Path",function(){return es}),n.d(e,"ShapePath",function(){return rs}),n.d(e,"Font",function(){return is}),n.d(e,"CurvePath",function(){return Ya}),n.d(e,"Curve",function(){return Xa}),n.d(e,"ShapeUtils",function(){return yo}),n.d(e,"SceneUtils",function(){return wc}),n.d(e,"WireframeGeometry",function(){return Qi}),n.d(e,"ParametricGeometry",function(){return $i}),n.d(e,"ParametricBufferGeometry",function(){return to}),n.d(e,"TetrahedronGeometry",function(){return ro}),n.d(e,"TetrahedronBufferGeometry",function(){return io}),n.d(e,"OctahedronGeometry",function(){return oo}),n.d(e,"OctahedronBufferGeometry",function(){return ao}),n.d(e,"IcosahedronGeometry",function(){return so}),n.d(e,"IcosahedronBufferGeometry",function(){return co}),n.d(e,"DodecahedronGeometry",function(){return uo}),n.d(e,"DodecahedronBufferGeometry",function(){return lo}),n.d(e,"PolyhedronGeometry",function(){return eo}),n.d(e,"PolyhedronBufferGeometry",function(){return no}),n.d(e,"TubeGeometry",function(){return ho}),n.d(e,"TubeBufferGeometry",function(){return fo}),n.d(e,"TorusKnotGeometry",function(){return po}),n.d(e,"TorusKnotBufferGeometry",function(){return mo}),n.d(e,"TorusGeometry",function(){return go}),n.d(e,"TorusBufferGeometry",function(){return vo}),n.d(e,"TextGeometry",function(){return bo}),n.d(e,"TextBufferGeometry",function(){return wo}),n.d(e,"SphereGeometry",function(){return Mo}),n.d(e,"SphereBufferGeometry",function(){return Eo}),n.d(e,"RingGeometry",function(){return To}),n.d(e,"RingBufferGeometry",function(){return So}),n.d(e,"PlaneGeometry",function(){return kr}),n.d(e,"PlaneBufferGeometry",function(){return jr}),n.d(e,"LatheGeometry",function(){return Ao}),n.d(e,"LatheBufferGeometry",function(){return Ro}),n.d(e,"ShapeGeometry",function(){return Lo}),n.d(e,"ShapeBufferGeometry",function(){return Po}),n.d(e,"ExtrudeGeometry",function(){return xo}),n.d(e,"ExtrudeBufferGeometry",function(){return _o}),n.d(e,"EdgesGeometry",function(){return Co}),n.d(e,"ConeGeometry",function(){return Uo}),n.d(e,"ConeBufferGeometry",function(){return No}),n.d(e,"CylinderGeometry",function(){return Io}),n.d(e,"CylinderBufferGeometry",function(){return Oo}),n.d(e,"CircleGeometry",function(){return Do}),n.d(e,"CircleBufferGeometry",function(){return Fo}),n.d(e,"BoxGeometry",function(){return Gr}),n.d(e,"BoxBufferGeometry",function(){return Hr}),n.d(e,"ShadowMaterial",function(){return zo}),n.d(e,"SpriteMaterial",function(){return Ni}),n.d(e,"RawShaderMaterial",function(){return Go}),n.d(e,"ShaderMaterial",function(){return Zn}),n.d(e,"PointsMaterial",function(){return Wi}),n.d(e,"MeshPhysicalMaterial",function(){return ko}),n.d(e,"MeshStandardMaterial",function(){return Ho}),n.d(e,"MeshPhongMaterial",function(){return jo}),n.d(e,"MeshToonMaterial",function(){return Vo}),n.d(e,"MeshNormalMaterial",function(){return Wo}),n.d(e,"MeshLambertMaterial",function(){return Xo}),n.d(e,"MeshDepthMaterial",function(){return Jn}),n.d(e,"MeshBasicMaterial",function(){return Vr}),n.d(e,"LineDashedMaterial",function(){return qo}),n.d(e,"LineBasicMaterial",function(){return Hi}),n.d(e,"Material",function(){return Yn}),n.d(e,"Float64BufferAttribute",function(){return Dr}),n.d(e,"Float32BufferAttribute",function(){return Nr}),n.d(e,"Uint32BufferAttribute",function(){return Ur}),n.d(e,"Int32BufferAttribute",function(){return Or}),n.d(e,"Uint16BufferAttribute",function(){return Ir}),n.d(e,"Int16BufferAttribute",function(){return Cr}),n.d(e,"Uint8ClampedBufferAttribute",function(){return Pr}),n.d(e,"Uint8BufferAttribute",function(){return Lr}),n.d(e,"Int8BufferAttribute",function(){return Rr}),n.d(e,"BufferAttribute",function(){return Ar}),n.d(e,"REVISION",function(){return l}),n.d(e,"MOUSE",function(){return h}),n.d(e,"CullFaceNone",function(){return f}),n.d(e,"CullFaceBack",function(){return d}),n.d(e,"CullFaceFront",function(){return p}),n.d(e,"CullFaceFrontBack",function(){return m}),n.d(e,"FrontFaceDirectionCW",function(){return g}),n.d(e,"FrontFaceDirectionCCW",function(){return v}),n.d(e,"BasicShadowMap",function(){return y}),n.d(e,"PCFShadowMap",function(){return x}),n.d(e,"PCFSoftShadowMap",function(){return _}),n.d(e,"FrontSide",function(){return b}),n.d(e,"BackSide",function(){return w}),n.d(e,"DoubleSide",function(){return M}),n.d(e,"FlatShading",function(){return E}),n.d(e,"SmoothShading",function(){return T}),n.d(e,"NoColors",function(){return S}),n.d(e,"FaceColors",function(){return A}),n.d(e,"VertexColors",function(){return R}),n.d(e,"NoBlending",function(){return L}),n.d(e,"NormalBlending",function(){return P}),n.d(e,"AdditiveBlending",function(){return C}),n.d(e,"SubtractiveBlending",function(){return I}),n.d(e,"MultiplyBlending",function(){return O}),n.d(e,"CustomBlending",function(){return U}),n.d(e,"AddEquation",function(){return N}),n.d(e,"SubtractEquation",function(){return D}),n.d(e,"ReverseSubtractEquation",function(){return F}),n.d(e,"MinEquation",function(){return B}),n.d(e,"MaxEquation",function(){return z}),n.d(e,"ZeroFactor",function(){return G}),n.d(e,"OneFactor",function(){return H}),n.d(e,"SrcColorFactor",function(){return k}),n.d(e,"OneMinusSrcColorFactor",function(){return j}),n.d(e,"SrcAlphaFactor",function(){return V}),n.d(e,"OneMinusSrcAlphaFactor",function(){return W}),n.d(e,"DstAlphaFactor",function(){return X}),n.d(e,"OneMinusDstAlphaFactor",function(){return q}),n.d(e,"DstColorFactor",function(){return Y}),n.d(e,"OneMinusDstColorFactor",function(){return Z}),n.d(e,"SrcAlphaSaturateFactor",function(){return J}),n.d(e,"NeverDepth",function(){return K}),n.d(e,"AlwaysDepth",function(){return Q}),n.d(e,"LessDepth",function(){return $}),n.d(e,"LessEqualDepth",function(){return tt}),n.d(e,"EqualDepth",function(){return et}),n.d(e,"GreaterEqualDepth",function(){return nt}),n.d(e,"GreaterDepth",function(){return rt}),n.d(e,"NotEqualDepth",function(){return it}),n.d(e,"MultiplyOperation",function(){return ot}),n.d(e,"MixOperation",function(){return at}),n.d(e,"AddOperation",function(){return st}),n.d(e,"NoToneMapping",function(){return ct}),n.d(e,"LinearToneMapping",function(){return ut}),n.d(e,"ReinhardToneMapping",function(){return lt}),n.d(e,"Uncharted2ToneMapping",function(){return ht}),n.d(e,"CineonToneMapping",function(){return ft}),n.d(e,"UVMapping",function(){return dt}),n.d(e,"CubeReflectionMapping",function(){return pt}),n.d(e,"CubeRefractionMapping",function(){return mt}),n.d(e,"EquirectangularReflectionMapping",function(){return gt}),n.d(e,"EquirectangularRefractionMapping",function(){return vt}),n.d(e,"SphericalReflectionMapping",function(){return yt}),n.d(e,"CubeUVReflectionMapping",function(){return xt}),n.d(e,"CubeUVRefractionMapping",function(){return _t}),n.d(e,"RepeatWrapping",function(){return bt}),n.d(e,"ClampToEdgeWrapping",function(){return wt}),n.d(e,"MirroredRepeatWrapping",function(){return Mt}),n.d(e,"NearestFilter",function(){return Et}),n.d(e,"NearestMipMapNearestFilter",function(){return Tt}),n.d(e,"NearestMipMapLinearFilter",function(){return St}),n.d(e,"LinearFilter",function(){return At}),n.d(e,"LinearMipMapNearestFilter",function(){return Rt}),n.d(e,"LinearMipMapLinearFilter",function(){return Lt}),n.d(e,"UnsignedByteType",function(){return Pt}),n.d(e,"ByteType",function(){return Ct}),n.d(e,"ShortType",function(){return It}),n.d(e,"UnsignedShortType",function(){return Ot}),n.d(e,"IntType",function(){return Ut}),n.d(e,"UnsignedIntType",function(){return Nt}),n.d(e,"FloatType",function(){return Dt}),n.d(e,"HalfFloatType",function(){return Ft}),n.d(e,"UnsignedShort4444Type",function(){return Bt}),n.d(e,"UnsignedShort5551Type",function(){return zt}),n.d(e,"UnsignedShort565Type",function(){return Gt}),n.d(e,"UnsignedInt248Type",function(){return Ht}),n.d(e,"AlphaFormat",function(){return kt}),n.d(e,"RGBFormat",function(){return jt}),n.d(e,"RGBAFormat",function(){return Vt}),n.d(e,"LuminanceFormat",function(){return Wt}),n.d(e,"LuminanceAlphaFormat",function(){return Xt}),n.d(e,"RGBEFormat",function(){return qt}),n.d(e,"DepthFormat",function(){return Yt}),n.d(e,"DepthStencilFormat",function(){return Zt}),n.d(e,"RGB_S3TC_DXT1_Format",function(){return Jt}),n.d(e,"RGBA_S3TC_DXT1_Format",function(){return Kt}),n.d(e,"RGBA_S3TC_DXT3_Format",function(){return Qt}),n.d(e,"RGBA_S3TC_DXT5_Format",function(){return $t}),n.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return te}),n.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return ee}),n.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return ne}),n.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return re}),n.d(e,"RGB_ETC1_Format",function(){return ie}),n.d(e,"LoopOnce",function(){return oe}),n.d(e,"LoopRepeat",function(){return ae}),n.d(e,"LoopPingPong",function(){return se}),n.d(e,"InterpolateDiscrete",function(){return ce}),n.d(e,"InterpolateLinear",function(){return ue}),n.d(e,"InterpolateSmooth",function(){return le}),n.d(e,"ZeroCurvatureEnding",function(){return he}),n.d(e,"ZeroSlopeEnding",function(){return fe}),n.d(e,"WrapAroundEnding",function(){return de}),n.d(e,"TrianglesDrawMode",function(){return pe}),n.d(e,"TriangleStripDrawMode",function(){return me}),n.d(e,"TriangleFanDrawMode",function(){return ge}),n.d(e,"LinearEncoding",function(){return ve}),n.d(e,"sRGBEncoding",function(){return ye}),n.d(e,"GammaEncoding",function(){return xe}),n.d(e,"RGBEEncoding",function(){return _e}),n.d(e,"LogLuvEncoding",function(){return be}),n.d(e,"RGBM7Encoding",function(){return we}),n.d(e,"RGBM16Encoding",function(){return Me}),n.d(e,"RGBDEncoding",function(){return Ee}),n.d(e,"BasicDepthPacking",function(){return Te}),n.d(e,"RGBADepthPacking",function(){return Se}),n.d(e,"CubeGeometry",function(){return Gr}),n.d(e,"Face4",function(){return Mc}),n.d(e,"LineStrip",function(){return Ec}),n.d(e,"LinePieces",function(){return Tc}),n.d(e,"MeshFaceMaterial",function(){return Sc}),n.d(e,"MultiMaterial",function(){return Ac}),n.d(e,"PointCloud",function(){return Rc}),n.d(e,"Particle",function(){return Lc}),n.d(e,"ParticleSystem",function(){return Pc}),n.d(e,"PointCloudMaterial",function(){return Cc}),n.d(e,"ParticleBasicMaterial",function(){return Ic}),n.d(e,"ParticleSystemMaterial",function(){return Oc}),n.d(e,"Vertex",function(){return Uc}),n.d(e,"DynamicBufferAttribute",function(){return Nc}),n.d(e,"Int8Attribute",function(){return Dc}),n.d(e,"Uint8Attribute",function(){return Fc}),n.d(e,"Uint8ClampedAttribute",function(){return Bc}),n.d(e,"Int16Attribute",function(){return zc}),n.d(e,"Uint16Attribute",function(){return Gc}),n.d(e,"Int32Attribute",function(){return Hc}),n.d(e,"Uint32Attribute",function(){return kc}),n.d(e,"Float32Attribute",function(){return jc}),n.d(e,"Float64Attribute",function(){return Vc}),n.d(e,"ClosedSplineCurve3",function(){return Wc}),n.d(e,"SplineCurve3",function(){return Xc}),n.d(e,"Spline",function(){return qc}),n.d(e,"BoundingBoxHelper",function(){return Yc}),n.d(e,"EdgesHelper",function(){return Zc}),n.d(e,"WireframeHelper",function(){return Jc}),n.d(e,"XHRLoader",function(){return Kc}),n.d(e,"BinaryTextureLoader",function(){return Qc}),n.d(e,"GeometryUtils",function(){return $c}),n.d(e,"ImageUtils",function(){return tu}),n.d(e,"Projector",function(){return eu}),n.d(e,"CanvasRenderer",function(){return nu}),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:t>0?1:+t}),void 0===Function.prototype.name&&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,o,a,s,c,u,l="86",h={LEFT:0,MIDDLE:1,RIGHT:2},f=0,d=1,p=2,m=3,g=0,v=1,y=0,x=1,_=2,b=0,w=1,M=2,E=1,T=2,S=0,A=1,R=2,L=0,P=1,C=2,I=3,O=4,U=5,N=100,D=101,F=102,B=103,z=104,G=200,H=201,k=202,j=203,V=204,W=205,X=206,q=207,Y=208,Z=209,J=210,K=0,Q=1,$=2,tt=3,et=4,nt=5,rt=6,it=7,ot=0,at=1,st=2,ct=0,ut=1,lt=2,ht=3,ft=4,dt=300,pt=301,mt=302,gt=303,vt=304,yt=305,xt=306,_t=307,bt=1e3,wt=1001,Mt=1002,Et=1003,Tt=1004,St=1005,At=1006,Rt=1007,Lt=1008,Pt=1009,Ct=1010,It=1011,Ot=1012,Ut=1013,Nt=1014,Dt=1015,Ft=1016,Bt=1017,zt=1018,Gt=1019,Ht=1020,kt=1021,jt=1022,Vt=1023,Wt=1024,Xt=1025,qt=Vt,Yt=1026,Zt=1027,Jt=2001,Kt=2002,Qt=2003,$t=2004,te=2100,ee=2101,ne=2102,re=2103,ie=2151,oe=2200,ae=2201,se=2202,ce=2300,ue=2301,le=2302,he=2400,fe=2401,de=2402,pe=0,me=1,ge=2,ve=3e3,ye=3001,xe=3007,_e=3002,be=3003,we=3004,Me=3005,Ee=3006,Te=3200,Se=3201,Ae={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=new Array(36),s=0,function(){for(var t=0;t<36;t++)8===t||13===t||18===t||23===t?a[t]="-":14===t?a[t]="4":(s<=2&&(s=33554432+16777216*Math.random()|0),i=15&s,s>>=4,a[t]=o[19===t?3&i|8:i]);return a.join("")}),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:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?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*Ae.DEG2RAD},radToDeg:function(t){return t*Ae.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};function Re(t,e){this.x=t||0,this.y=e||0}Object.defineProperties(Re.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(Re.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)},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:(c=new Re,u=new Re,function(t,e){return c.set(t,t),u.set(e,e),this.clamp(c,u)}),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},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan: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},distanceToManhattan: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,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}});var Le,Pe,Ce,Ie,Oe,Ue,Ne=0;function De(t,e,n,r,i,o,a,s,c,u){Object.defineProperty(this,"id",{value:Ne++}),this.uuid=Ae.generateUUID(),this.name="",this.image=void 0!==t?t:De.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:De.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:wt,this.wrapT=void 0!==r?r:wt,this.magFilter=void 0!==i?i:At,this.minFilter=void 0!==o?o:Lt,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:Vt,this.type=void 0!==s?s:Pt,this.offset=new Re(0,0),this.repeat=new Re(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:ve,this.version=0,this.onUpdate=null}function Fe(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function Be(t,e,n){this.uuid=Ae.generateUUID(),this.width=t,this.height=e,this.scissor=new Fe(0,0,t,e),this.scissorTest=!1,this.viewport=new Fe(0,0,t,e),void 0===(n=n||{}).minFilter&&(n.minFilter=At),this.texture=new De(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),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 ze(t,e,n){Be.call(this,t,e,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function Ge(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}function He(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function ke(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function je(t,e,n,r,i,o,a,s,c,u,l,h){De.call(this,null,o,a,s,c,u,r,i,l,h),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:Et,this.minFilter=void 0!==u?u:Et,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Ve(t,e,n,r,i,o,a,s,c,u){t=void 0!==t?t:[],e=void 0!==e?e:pt,De.call(this,t,e,n,r,i,o,a,s,c,u),this.flipY=!1}De.DEFAULT_IMAGE=void 0,De.DEFAULT_MAPPING=dt,Object.defineProperty(De.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(De.prototype,r.prototype,{constructor:De,isTexture:!0,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.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var e={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],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var n=this.image;void 0===n.uuid&&(n.uuid=Ae.generateUUID()),void 0===t.images[n.uuid]&&(t.images[n.uuid]={uuid:n.uuid,url:function(t){var e;return void 0!==t.toDataURL?e=t:((e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0,t.width,t.height)),e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}(n)}),e.image=n.uuid}return t.textures[this.uuid]=e,e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===dt){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case bt:t.x=t.x-Math.floor(t.x);break;case wt:t.x=t.x<0?0:1;break;case Mt: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||t.y>1)switch(this.wrapT){case bt:t.y=t.y-Math.floor(t.y);break;case wt:t.y=t.y<0?0:1;break;case Mt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}}),Object.assign(Fe.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,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[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 e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,i,o=t.elements,a=o[0],s=o[4],c=o[8],u=o[1],l=o[5],h=o[9],f=o[2],d=o[6],p=o[10];if(Math.abs(s-u)<.01&&Math.abs(c-f)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+u)<.1&&Math.abs(c+f)<.1&&Math.abs(h+d)<.1&&Math.abs(a+l+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(l+1)/2,v=(p+1)/2,y=(s+u)/4,x=(c+f)/4,_=(h+d)/4;return m>g&&m>v?m<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(m)),i=x/n):g>v?g<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(g)),i=_/r):v<.01?(n=.707106781,r=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=_/i),this.set(n,r,i,e),this}var b=Math.sqrt((d-h)*(d-h)+(c-f)*(c-f)+(u-s)*(u-s));return Math.abs(b)<.001&&(b=1),this.x=(d-h)/b,this.y=(c-f)/b,this.z=(u-s)/b,this.w=Math.acos((a+l+p-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(){var t,e;return function(n,r){return void 0===t&&(t=new Fe,e=new Fe),t.set(n,n,n,n),e.set(r,r,r,r),this.clamp(t,e)}}(),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)},lengthManhattan: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}}),Object.assign(Be.prototype,r.prototype,{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"})}}),ze.prototype=Object.create(Be.prototype),ze.prototype.constructor=ze,ze.prototype.isWebGLRenderTargetCube=!0,Object.assign(Ge,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,o,a){var s=n[r+0],c=n[r+1],u=n[r+2],l=n[r+3],h=i[o+0],f=i[o+1],d=i[o+2],p=i[o+3];if(l!==p||s!==h||c!==f||u!==d){var m=1-a,g=s*h+c*f+u*d+l*p,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,a=Math.sin(a*_)/x}var b=a*v;if(s=s*m+h*b,c=c*m+f*b,u=u*m+d*b,l=l*m+p*b,m===1-a){var w=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=w,c*=w,u*=w,l*=w}}t[e]=s,t[e+1]=c,t[e+2]=u,t[e+3]=l}}),Object.defineProperties(Ge.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(Ge.prototype,{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,o=t.order,a=Math.cos,s=Math.sin,c=a(n/2),u=a(r/2),l=a(i/2),h=s(n/2),f=s(r/2),d=s(i/2);return"XYZ"===o?(this._x=h*u*l+c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l-h*f*d):"YXZ"===o?(this._x=h*u*l+c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l+h*f*d):"ZXY"===o?(this._x=h*u*l-c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l-h*f*d):"ZYX"===o?(this._x=h*u*l-c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l+h*f*d):"YZX"===o?(this._x=h*u*l+c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l-h*f*d):"XZY"===o&&(this._x=h*u*l-c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l+h*f*d),!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],o=n[8],a=n[1],s=n[5],c=n[9],u=n[2],l=n[6],h=n[10],f=r+s+h;return f>0?(e=.5/Math.sqrt(f+1),this._w=.25/e,this._x=(l-c)*e,this._y=(o-u)*e,this._z=(a-i)*e):r>s&&r>h?(e=2*Math.sqrt(1+r-s-h),this._w=(l-c)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+u)/e):s>h?(e=2*Math.sqrt(1+s-r-h),this._w=(o-u)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(a-i)/e,this._x=(o+u)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new He;return function(n,r){return void 0===e&&(e=new He),(t=n.dot(r)+1)<1e-6?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,r),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},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 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=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,o=t._w,a=e._x,s=e._y,c=e._z,u=e._w;return this._x=n*u+o*a+r*c-i*s,this._y=r*u+o*s+i*a-n*c,this._z=i*u+o*c+n*s-r*a,this._w=o*u-n*a-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,o=this._w,a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(n+this._x),this._y=.5*(r+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,a),u=Math.sin((1-e)*c)/s,l=Math.sin(e*c)/s;return this._w=o*u+this._w*l,this._x=n*u+this._x*l,this._y=r*u+this._y*l,this._z=i*u+this._z*l,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(He.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:(Ce=new Ge,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ce.setFromEuler(t))}),applyAxisAngle:function(){var t=new Ge;return function(e,n){return this.applyQuaternion(t.setFromAxisAngle(e,n))}}(),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,o=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])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*r-a*n,u=s*n+a*e-i*r,l=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=c*s+h*-i+u*-a-l*-o,this.y=u*s+h*-o+l*-i-c*-a,this.z=l*s+h*-a+c*-o-u*-i,this},project:(Pe=new ke,function(t){return Pe.multiplyMatrices(t.projectionMatrix,Pe.getInverse(t.matrixWorld)),this.applyMatrix4(Pe)}),unproject:function(){var t=new ke;return function(e){return t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyMatrix4(t)}}(),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:function(){var t=new He,e=new He;return function(n,r){return t.set(n,n,n),e.set(r,r,r),this.clamp(t,e)}}(),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)},lengthManhattan: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){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var n=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-n*t.z,this.z=n*t.y-r*t.x,this},crossVectors:function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(Le=new He,function(t){return Le.copy(this).projectOnVector(t),this.sub(Le)}),reflect:function(){var t=new He;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Ae.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},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromCylindrical:function(t){return this.x=t.radius*Math.sin(t.theta),this.y=t.y,this.z=t.radius*Math.cos(t.theta),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(ke.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,o,a,s,c,u,l,h,f,d,p,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=l,g[14]=h,g[3]=f,g[7]=d,g[11]=p,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 ke).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:function(){var t=new He;return function(e){var n=this.elements,r=e.elements,i=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),a=1/t.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix: .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,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*u,f=o*l,d=a*u,p=a*l;e[0]=s*u,e[4]=-s*l,e[8]=c,e[1]=f+d*c,e[5]=h-p*c,e[9]=-a*s,e[2]=p-h*c,e[6]=d+f*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,g=s*l,v=c*u,y=c*l;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*u,g=s*l,v=c*u,y=c*l;e[0]=m-y*a,e[4]=-o*l,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*u,f=o*l,d=a*u,p=a*l;e[0]=s*u,e[4]=d*c-f,e[8]=h*c+p,e[1]=s*l,e[5]=p*c+h,e[9]=f*c-d,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var x=o*s,_=o*c,b=a*s,w=a*c;e[0]=s*u,e[4]=w-x*l,e[8]=b*l+_,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=_*l+b,e[10]=x-w*l}else if("XZY"===t.order){x=o*s,_=o*c,b=a*s,w=a*c;e[0]=s*u,e[4]=-l,e[8]=c*u,e[1]=x*l+w,e[5]=o*u,e[9]=_*l-b,e[2]=b*l-_,e[6]=a*u,e[10]=w*l+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:function(t){var e=this.elements,n=t._x,r=t._y,i=t._z,o=t._w,a=n+n,s=r+r,c=i+i,u=n*a,l=n*s,h=n*c,f=r*s,d=r*c,p=i*c,m=o*a,g=o*s,v=o*c;return e[0]=1-(f+p),e[4]=l-v,e[8]=h+g,e[1]=l+v,e[5]=1-(u+p),e[9]=d-m,e[2]=h-g,e[6]=d+m,e[10]=1-(u+f),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:(Ie=new He,Oe=new He,Ue=new He,function(t,e,n){var r=this.elements;return Ue.subVectors(t,e),0===Ue.lengthSq()&&(Ue.z=1),Ue.normalize(),Ie.crossVectors(n,Ue),0===Ie.lengthSq()&&(1===Math.abs(n.z)?Ue.x+=1e-4:Ue.z+=1e-4,Ue.normalize(),Ie.crossVectors(n,Ue)),Ie.normalize(),Oe.crossVectors(Ue,Ie),r[0]=Ie.x,r[4]=Oe.x,r[8]=Ue.x,r[1]=Ie.y,r[5]=Oe.y,r[9]=Ue.y,r[2]=Ie.z,r[6]=Oe.z,r[10]=Ue.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,o=n[0],a=n[4],s=n[8],c=n[12],u=n[1],l=n[5],h=n[9],f=n[13],d=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=r[0],w=r[4],M=r[8],E=r[12],T=r[1],S=r[5],A=r[9],R=r[13],L=r[2],P=r[6],C=r[10],I=r[14],O=r[3],U=r[7],N=r[11],D=r[15];return i[0]=o*b+a*T+s*L+c*O,i[4]=o*w+a*S+s*P+c*U,i[8]=o*M+a*A+s*C+c*N,i[12]=o*E+a*R+s*I+c*D,i[1]=u*b+l*T+h*L+f*O,i[5]=u*w+l*S+h*P+f*U,i[9]=u*M+l*A+h*C+f*N,i[13]=u*E+l*R+h*I+f*D,i[2]=d*b+p*T+m*L+g*O,i[6]=d*w+p*S+m*P+g*U,i[10]=d*M+p*A+m*C+g*N,i[14]=d*E+p*R+m*I+g*D,i[3]=v*b+y*T+x*L+_*O,i[7]=v*w+y*S+x*P+_*U,i[11]=v*M+y*A+x*C+_*N,i[15]=v*E+y*R+x*I+_*D,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:function(){var t=new He;return function(e){for(var n=0,r=e.count;n<r;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix4(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],c=t[13],u=t[2],l=t[6],h=t[10],f=t[14];return t[3]*(+i*s*l-r*c*l-i*a*h+n*c*h+r*a*f-n*s*f)+t[7]*(+e*s*f-e*c*h+i*o*h-r*o*f+r*c*u-i*s*u)+t[11]*(+e*c*l-e*a*f-i*o*l+n*o*f+i*a*u-n*c*u)+t[15]*(-r*a*u-e*s*l+e*a*h+r*o*l-n*o*h+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],o=r[1],a=r[2],s=r[3],c=r[4],u=r[5],l=r[6],h=r[7],f=r[8],d=r[9],p=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],_=d*y*h-v*p*h+v*l*m-u*y*m-d*l*x+u*p*x,b=g*p*h-f*y*h-g*l*m+c*y*m+f*l*x-c*p*x,w=f*v*h-g*d*h+g*u*m-c*v*m-f*u*x+c*d*x,M=g*d*l-f*v*l-g*u*p+c*v*p+f*u*y-c*d*y,E=i*_+o*b+a*w+s*M;if(0===E){var T="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(!0===e)throw new Error(T);return console.warn(T),this.identity()}var S=1/E;return n[0]=_*S,n[1]=(v*p*s-d*y*s-v*a*m+o*y*m+d*a*x-o*p*x)*S,n[2]=(u*y*s-v*l*s+v*a*h-o*y*h-u*a*x+o*l*x)*S,n[3]=(d*l*s-u*p*s-d*a*h+o*p*h+u*a*m-o*l*m)*S,n[4]=b*S,n[5]=(f*y*s-g*p*s+g*a*m-i*y*m-f*a*x+i*p*x)*S,n[6]=(g*l*s-c*y*s-g*a*h+i*y*h+c*a*x-i*l*x)*S,n[7]=(c*p*s-f*l*s+f*a*h-i*p*h-c*a*m+i*l*m)*S,n[8]=w*S,n[9]=(g*d*s-f*v*s-g*o*m+i*v*m+f*o*x-i*d*x)*S,n[10]=(c*v*s-g*u*s+g*o*h-i*v*h-c*o*x+i*u*x)*S,n[11]=(f*u*s-c*d*s-f*o*h+i*d*h+c*o*m-i*u*m)*S,n[12]=M*S,n[13]=(f*v*a-g*d*a+g*o*p-i*v*p-f*o*y+i*d*y)*S,n[14]=(g*u*a-c*v*a-g*o*l+i*v*l+c*o*y-i*u*y)*S,n[15]=(c*d*a-f*u*a+f*o*l-i*d*l-c*o*p+i*u*p)*S,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,o=t.x,a=t.y,s=t.z,c=i*o,u=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+n,u*s-r*o,0,c*s-r*a,u*s+r*o,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){return this.makeRotationFromQuaternion(e),this.scale(n),this.setPosition(t),this},decompose:function(){var t=new He,e=new ke;return function(n,r,i){var o=this.elements,a=t.set(o[0],o[1],o[2]).length(),s=t.set(o[4],o[5],o[6]).length(),c=t.set(o[8],o[9],o[10]).length();this.determinant()<0&&(a=-a),n.x=o[12],n.y=o[13],n.z=o[14],e.copy(this);var u=1/a,l=1/s,h=1/c;return e.elements[0]*=u,e.elements[1]*=u,e.elements[2]*=u,e.elements[4]*=l,e.elements[5]*=l,e.elements[6]*=l,e.elements[8]*=h,e.elements[9]*=h,e.elements[10]*=h,r.setFromRotationMatrix(e),i.x=a,i.y=s,i.z=c,this}}(),makePerspective:function(t,e,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(e-t),c=2*i/(n-r),u=(e+t)/(e-t),l=(n+r)/(n-r),h=-(o+i)/(o-i),f=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,r,i,o){var a=this.elements,s=1/(e-t),c=1/(n-r),u=1/(o-i),l=(e+t)*s,h=(n+r)*c,f=(o+i)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[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}}),je.prototype=Object.create(De.prototype),je.prototype.constructor=je,je.prototype.isDataTexture=!0,Ve.prototype=Object.create(De.prototype),Ve.prototype.constructor=Ve,Ve.prototype.isCubeTexture=!0,Object.defineProperty(Ve.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var We=new De,Xe=new Ve;function qe(){this.seq=[],this.map={}}var Ye=[],Ze=[],Je=new Float32Array(16),Ke=new Float32Array(9);function Qe(t,e,n){var r=t[0];if(r<=0||r>0)return t;var i=e*n,o=Ye[i];if(void 0===o&&(o=new Float32Array(i),Ye[i]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function $e(t,e){var n=Ze[e];void 0===n&&(n=new Int32Array(e),Ze[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocTextureUnit();return n}function tn(t,e){t.uniform1f(this.addr,e)}function en(t,e){t.uniform1i(this.addr,e)}function nn(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function rn(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function on(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function an(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function sn(t,e){void 0===e.elements?t.uniformMatrix3fv(this.addr,!1,e):(Ke.set(e.elements),t.uniformMatrix3fv(this.addr,!1,Ke))}function cn(t,e){void 0===e.elements?t.uniformMatrix4fv(this.addr,!1,e):(Je.set(e.elements),t.uniformMatrix4fv(this.addr,!1,Je))}function un(t,e,n){var r=n.allocTextureUnit();t.uniform1i(this.addr,r),n.setTexture2D(e||We,r)}function ln(t,e,n){var r=n.allocTextureUnit();t.uniform1i(this.addr,r),n.setTextureCube(e||Xe,r)}function hn(t,e){t.uniform2iv(this.addr,e)}function fn(t,e){t.uniform3iv(this.addr,e)}function dn(t,e){t.uniform4iv(this.addr,e)}function pn(t,e){t.uniform1fv(this.addr,e)}function mn(t,e){t.uniform1iv(this.addr,e)}function gn(t,e){t.uniform2fv(this.addr,Qe(e,this.size,2))}function vn(t,e){t.uniform3fv(this.addr,Qe(e,this.size,3))}function yn(t,e){t.uniform4fv(this.addr,Qe(e,this.size,4))}function xn(t,e){t.uniformMatrix2fv(this.addr,!1,Qe(e,this.size,4))}function _n(t,e){t.uniformMatrix3fv(this.addr,!1,Qe(e,this.size,9))}function bn(t,e){t.uniformMatrix4fv(this.addr,!1,Qe(e,this.size,16))}function wn(t,e,n){var r=e.length,i=$e(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTexture2D(e[o]||We,i[o])}function Mn(t,e,n){var r=e.length,i=$e(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTextureCube(e[o]||Xe,i[o])}function En(t,e,n){this.id=t,this.addr=n,this.setValue=function(t){switch(t){case 5126:return tn;case 35664:return nn;case 35665:return rn;case 35666:return on;case 35674:return an;case 35675:return sn;case 35676:return cn;case 35678:case 36198:return un;case 35680:return ln;case 5124:case 35670:return en;case 35667:case 35671:return hn;case 35668:case 35672:return fn;case 35669:case 35673:return dn}}(e.type)}function Tn(t,e,n){this.id=t,this.addr=n,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return pn;case 35664:return gn;case 35665:return vn;case 35666:return yn;case 35674:return xn;case 35675:return _n;case 35676:return bn;case 35678:return wn;case 35680:return Mn;case 5124:case 35670:return mn;case 35667:case 35671:return hn;case 35668:case 35672:return fn;case 35669:case 35673:return dn}}(e.type)}function Sn(t){this.id=t,qe.call(this)}Sn.prototype.setValue=function(t,e){for(var n=this.seq,r=0,i=n.length;r!==i;++r){var o=n[r];o.setValue(t,e[o.id])}};var An=/([\w\d_]+)(\])?(\[|\.)?/g;function Rn(t,e){t.seq.push(e),t.map[e.id]=e}function Ln(t,e,n){var r=t.name,i=r.length;for(An.lastIndex=0;;){var o=An.exec(r),a=An.lastIndex,s=o[1],c="]"===o[2],u=o[3];if(c&&(s|=0),void 0===u||"["===u&&a+2===i){Rn(n,void 0===u?new En(s,t,e):new Tn(s,t,e));break}var l=n.map[s];void 0===l&&Rn(n,l=new Sn(s)),n=l}}function Pn(t,e,n){qe.call(this),this.renderer=n;for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=0;i<r;++i){var o=t.getActiveUniform(e,i),a=o.name;Ln(o,t.getUniformLocation(e,a),this)}}Pn.prototype.setValue=function(t,e,n){var r=this.map[e];void 0!==r&&r.setValue(t,n,this.renderer)},Pn.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},Pn.upload=function(t,e,n,r){for(var i=0,o=e.length;i!==o;++i){var a=e[i],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,r)}},Pn.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var o=t[r];o.id in e&&n.push(o)}return n};var Cn={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,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 In(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}Object.assign(In.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 t(t,e,n){return n<0&&(n+=1),n>1&&(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(e,n,r){if(e=Ae.euclideanModulo(e,1),n=Ae.clamp(n,0,1),r=Ae.clamp(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,o=2*r-i;this.r=t(o,i,e+1/3),this.g=t(o,i,e),this.b=t(o,i,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],o=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(o))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,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))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,e(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(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u,l=(u=n[1]).length;if(3===l)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===l)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}t&&t.length>0&&(void 0!==(u=Cn[t])?this.setHex(u):console.warn("THREE.Color: Unknown color "+t));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=e>0?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(){var t=this.r,e=this.g,n=this.b;return this.r=t*t,this.g=e*e,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),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){var e,n,r=t||{h:0,s:0,l:0},i=this.r,o=this.g,a=this.b,s=Math.max(i,o,a),c=Math.min(i,o,a),u=(c+s)/2;if(c===s)e=0,n=0;else{var l=s-c;switch(n=u<=.5?l/(s+c):l/(2-s-c),s){case i:e=(o-a)/l+(o<a?6:0);break;case o:e=(a-i)/l+2;break;case a:e=(i-o)/l+4}e/=6}return r.h=e,r.s=n,r.l=u,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){var r=this.getHSL();return r.h+=t,r.s+=e,r.l+=n,this.setHSL(r.h,r.s,r.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},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 On={common:{diffuse:{value:new In(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new Fe(0,0,1,1)},specularMap:{value:null},alphaMap:{value:null},envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},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 Re(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 In(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:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new In(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new Fe(0,0,1,1)}}},Un={merge:function(t){for(var e={},n=0;n<t.length;n++){var r=this.clone(t[n]);for(var i in r)e[i]=r[i]}return e},clone:function(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}},Nn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\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.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - 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 * transpose( 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\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = asin( flipNormal * reflectVec.y ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\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\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\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\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars:"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};\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 ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_template:"\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\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 ] ) : 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\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\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\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#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 ( NUM_HEMI_LIGHTS > 0 )\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\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_flip:"#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",normal_fragment:"#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 ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\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\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\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\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\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\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 ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.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( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\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( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",distanceRGBA_vert:"varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\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 <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\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_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\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_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_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 <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n",shadow_vert:"#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}\n"},Dn={basic:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.fog]),vertexShader:Nn.meshbasic_vert,fragmentShader:Nn.meshbasic_frag},lambert:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.emissivemap,On.fog,On.lights,{emissive:{value:new In(0)}}]),vertexShader:Nn.meshlambert_vert,fragmentShader:Nn.meshlambert_frag},phong:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.emissivemap,On.bumpmap,On.normalmap,On.displacementmap,On.gradientmap,On.fog,On.lights,{emissive:{value:new In(0)},specular:{value:new In(1118481)},shininess:{value:30}}]),vertexShader:Nn.meshphong_vert,fragmentShader:Nn.meshphong_frag},standard:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.emissivemap,On.bumpmap,On.normalmap,On.displacementmap,On.roughnessmap,On.metalnessmap,On.fog,On.lights,{emissive:{value:new In(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Nn.meshphysical_vert,fragmentShader:Nn.meshphysical_frag},points:{uniforms:Un.merge([On.points,On.fog]),vertexShader:Nn.points_vert,fragmentShader:Nn.points_frag},dashed:{uniforms:Un.merge([On.common,On.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nn.linedashed_vert,fragmentShader:Nn.linedashed_frag},depth:{uniforms:Un.merge([On.common,On.displacementmap]),vertexShader:Nn.depth_vert,fragmentShader:Nn.depth_frag},normal:{uniforms:Un.merge([On.common,On.bumpmap,On.normalmap,On.displacementmap,{opacity:{value:1}}]),vertexShader:Nn.normal_vert,fragmentShader:Nn.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nn.cube_vert,fragmentShader:Nn.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:Nn.equirect_vert,fragmentShader:Nn.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new He}},vertexShader:Nn.distanceRGBA_vert,fragmentShader:Nn.distanceRGBA_frag}};function Fn(t,e){this.min=void 0!==t?t:new Re(1/0,1/0),this.max=void 0!==e?e:new Re(-1/0,-1/0)}function Bn(t,e){var n,r,i,o,a,s,c,u,l=t.context,h=t.state;function f(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),f=new Uint16Array([0,1,2,0,2,3]);n=l.createBuffer(),r=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,n),l.bufferData(l.ARRAY_BUFFER,e,l.STATIC_DRAW),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,r),l.bufferData(l.ELEMENT_ARRAY_BUFFER,f,l.STATIC_DRAW),c=l.createTexture(),u=l.createTexture(),h.bindTexture(l.TEXTURE_2D,c),l.texImage2D(l.TEXTURE_2D,0,l.RGB,16,16,0,l.RGB,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),h.bindTexture(l.TEXTURE_2D,u),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,16,16,0,l.RGBA,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),i={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},o=function(e){var n=l.createProgram(),r=l.createShader(l.FRAGMENT_SHADER),i=l.createShader(l.VERTEX_SHADER),o="precision "+t.getPrecision()+" float;\n";return l.shaderSource(r,o+e.fragmentShader),l.shaderSource(i,o+e.vertexShader),l.compileShader(r),l.compileShader(i),l.attachShader(n,r),l.attachShader(n,i),l.linkProgram(n),n}(i),a={vertex:l.getAttribLocation(o,"position"),uv:l.getAttribLocation(o,"uv")},s={renderType:l.getUniformLocation(o,"renderType"),map:l.getUniformLocation(o,"map"),occlusionMap:l.getUniformLocation(o,"occlusionMap"),opacity:l.getUniformLocation(o,"opacity"),color:l.getUniformLocation(o,"color"),scale:l.getUniformLocation(o,"scale"),rotation:l.getUniformLocation(o,"rotation"),screenPosition:l.getUniformLocation(o,"screenPosition")}}this.render=function(i,d,p){if(0!==e.length){var m=new He,g=p.w/p.z,v=.5*p.z,y=.5*p.w,x=16/p.w,_=new Re(x*g,x),b=new He(1,1,0),w=new Re(1,1),M=new Fn;M.min.set(p.x,p.y),M.max.set(p.x+(p.z-16),p.y+(p.w-16)),void 0===o&&f(),l.useProgram(o),h.initAttributes(),h.enableAttribute(a.vertex),h.enableAttribute(a.uv),h.disableUnusedAttributes(),l.uniform1i(s.occlusionMap,0),l.uniform1i(s.map,1),l.bindBuffer(l.ARRAY_BUFFER,n),l.vertexAttribPointer(a.vertex,2,l.FLOAT,!1,16,0),l.vertexAttribPointer(a.uv,2,l.FLOAT,!1,16,8),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,r),h.disable(l.CULL_FACE),h.buffers.depth.setMask(!1);for(var E=0,T=e.length;E<T;E++){x=16/p.w,_.set(x*g,x);var S=e[E];if(m.set(S.matrixWorld.elements[12],S.matrixWorld.elements[13],S.matrixWorld.elements[14]),m.applyMatrix4(d.matrixWorldInverse),m.applyMatrix4(d.projectionMatrix),b.copy(m),w.x=p.x+b.x*v+v-8,w.y=p.y+b.y*y+y-8,!0===M.containsPoint(w)){h.activeTexture(l.TEXTURE0),h.bindTexture(l.TEXTURE_2D,null),h.activeTexture(l.TEXTURE1),h.bindTexture(l.TEXTURE_2D,c),l.copyTexImage2D(l.TEXTURE_2D,0,l.RGB,w.x,w.y,16,16,0),l.uniform1i(s.renderType,0),l.uniform2f(s.scale,_.x,_.y),l.uniform3f(s.screenPosition,b.x,b.y,b.z),h.disable(l.BLEND),h.enable(l.DEPTH_TEST),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0),h.activeTexture(l.TEXTURE0),h.bindTexture(l.TEXTURE_2D,u),l.copyTexImage2D(l.TEXTURE_2D,0,l.RGBA,w.x,w.y,16,16,0),l.uniform1i(s.renderType,1),h.disable(l.DEPTH_TEST),h.activeTexture(l.TEXTURE1),h.bindTexture(l.TEXTURE_2D,c),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0),S.positionScreen.copy(b),S.customUpdateCallback?S.customUpdateCallback(S):S.updateLensFlares(),l.uniform1i(s.renderType,2),h.enable(l.BLEND);for(var A=0,R=S.lensFlares.length;A<R;A++){var L=S.lensFlares[A];L.opacity>.001&&L.scale>.001&&(b.x=L.x,b.y=L.y,b.z=L.z,x=L.size*L.scale/p.w,_.x=x*g,_.y=x,l.uniform3f(s.screenPosition,b.x,b.y,b.z),l.uniform2f(s.scale,_.x,_.y),l.uniform1f(s.rotation,L.rotation),l.uniform1f(s.opacity,L.opacity),l.uniform3f(s.color,L.color.r,L.color.g,L.color.b),h.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),t.setTexture2D(L.texture,1),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0))}}}h.enable(l.CULL_FACE),h.enable(l.DEPTH_TEST),h.buffers.depth.setMask(!0),t.resetGLState()}}}function zn(t,e){var n,r,i,o,a,s,c=t.context,u=t.state,l=new He,h=new Ge,f=new He;function d(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),u=new Uint16Array([0,1,2,0,2,3]);n=c.createBuffer(),r=c.createBuffer(),c.bindBuffer(c.ARRAY_BUFFER,n),c.bufferData(c.ARRAY_BUFFER,e,c.STATIC_DRAW),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,r),c.bufferData(c.ELEMENT_ARRAY_BUFFER,u,c.STATIC_DRAW),i=function(){var e=c.createProgram(),n=c.createShader(c.VERTEX_SHADER),r=c.createShader(c.FRAGMENT_SHADER);return c.shaderSource(n,["precision "+t.getPrecision()+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),c.shaderSource(r,["precision "+t.getPrecision()+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),c.compileShader(n),c.compileShader(r),c.attachShader(e,n),c.attachShader(e,r),c.linkProgram(e),e}(),o={position:c.getAttribLocation(i,"position"),uv:c.getAttribLocation(i,"uv")},a={uvOffset:c.getUniformLocation(i,"uvOffset"),uvScale:c.getUniformLocation(i,"uvScale"),rotation:c.getUniformLocation(i,"rotation"),scale:c.getUniformLocation(i,"scale"),color:c.getUniformLocation(i,"color"),map:c.getUniformLocation(i,"map"),opacity:c.getUniformLocation(i,"opacity"),modelViewMatrix:c.getUniformLocation(i,"modelViewMatrix"),projectionMatrix:c.getUniformLocation(i,"projectionMatrix"),fogType:c.getUniformLocation(i,"fogType"),fogDensity:c.getUniformLocation(i,"fogDensity"),fogNear:c.getUniformLocation(i,"fogNear"),fogFar:c.getUniformLocation(i,"fogFar"),fogColor:c.getUniformLocation(i,"fogColor"),alphaTest:c.getUniformLocation(i,"alphaTest")};var l=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");l.width=8,l.height=8;var h=l.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),(s=new De(l)).needsUpdate=!0}function p(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}this.render=function(m,g){if(0!==e.length){void 0===i&&d(),c.useProgram(i),u.initAttributes(),u.enableAttribute(o.position),u.enableAttribute(o.uv),u.disableUnusedAttributes(),u.disable(c.CULL_FACE),u.enable(c.BLEND),c.bindBuffer(c.ARRAY_BUFFER,n),c.vertexAttribPointer(o.position,2,c.FLOAT,!1,16,0),c.vertexAttribPointer(o.uv,2,c.FLOAT,!1,16,8),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,r),c.uniformMatrix4fv(a.projectionMatrix,!1,g.projectionMatrix.elements),u.activeTexture(c.TEXTURE0),c.uniform1i(a.map,0);var v=0,y=0,x=m.fog;x?(c.uniform3f(a.fogColor,x.color.r,x.color.g,x.color.b),x.isFog?(c.uniform1f(a.fogNear,x.near),c.uniform1f(a.fogFar,x.far),c.uniform1i(a.fogType,1),v=1,y=1):x.isFogExp2&&(c.uniform1f(a.fogDensity,x.density),c.uniform1i(a.fogType,2),v=2,y=2)):(c.uniform1i(a.fogType,0),v=0,y=0);for(var _=0,b=e.length;_<b;_++){(M=e[_]).modelViewMatrix.multiplyMatrices(g.matrixWorldInverse,M.matrixWorld),M.z=-M.modelViewMatrix.elements[14]}e.sort(p);var w=[];for(_=0,b=e.length;_<b;_++){var M,E=(M=e[_]).material;if(!1!==E.visible){M.onBeforeRender(t,m,g,void 0,E,void 0),c.uniform1f(a.alphaTest,E.alphaTest),c.uniformMatrix4fv(a.modelViewMatrix,!1,M.modelViewMatrix.elements),M.matrixWorld.decompose(l,h,f),w[0]=f.x,w[1]=f.y;var T=0;m.fog&&E.fog&&(T=y),v!==T&&(c.uniform1i(a.fogType,T),v=T),null!==E.map?(c.uniform2f(a.uvOffset,E.map.offset.x,E.map.offset.y),c.uniform2f(a.uvScale,E.map.repeat.x,E.map.repeat.y)):(c.uniform2f(a.uvOffset,0,0),c.uniform2f(a.uvScale,1,1)),c.uniform1f(a.opacity,E.opacity),c.uniform3f(a.color,E.color.r,E.color.g,E.color.b),c.uniform1f(a.rotation,E.rotation),c.uniform2fv(a.scale,w),u.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst,E.blendEquationAlpha,E.blendSrcAlpha,E.blendDstAlpha,E.premultipliedAlpha),u.buffers.depth.setTest(E.depthTest),u.buffers.depth.setMask(E.depthWrite),E.map?t.setTexture2D(E.map,0):t.setTexture2D(s,0),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0),M.onAfterRender(t,m,g,void 0,E,void 0)}}u.enable(c.CULL_FACE),t.resetGLState()}}}Dn.physical={uniforms:Un.merge([Dn.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Nn.meshphysical_vert,fragmentShader:Nn.meshphysical_frag},Object.assign(Fn.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:function(){var t=new Re;return function(e,n){var r=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),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){var e=t||new Re;return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new Re;return this.isEmpty()?e.set(0,0):e.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(e||new Re).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(e||new Re).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Re;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).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)}});var Gn,Hn,kn,jn,Vn,Wn,Xn,qn=0;function Yn(){Object.defineProperty(this,"id",{value:qn++}),this.uuid=Ae.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=P,this.side=b,this.shading=T,this.vertexColors=S,this.opacity=1,this.transparent=!1,this.blendSrc=V,this.blendDst=W,this.blendEquation=N,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=tt,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.needsUpdate=!0}function Zn(t){Yn.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,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Jn(t){Yn.call(this),this.type="MeshDepthMaterial",this.depthPacking=Te,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 Kn(t,e){this.min=void 0!==t?t:new He(1/0,1/0,1/0),this.max=void 0!==e?e:new He(-1/0,-1/0,-1/0)}function Qn(t,e){this.center=void 0!==t?t:new He,this.radius=void 0!==e?e:0}function $n(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function tr(t,e){this.normal=void 0!==t?t:new He(1,0,0),this.constant=void 0!==e?e:0}function er(t,e,n,r,i,o){this.planes=[void 0!==t?t:new tr,void 0!==e?e:new tr,void 0!==n?n:new tr,void 0!==r?r:new tr,void 0!==i?i:new tr,void 0!==o?o:new tr]}function nr(t,e,n,r){var i=t.context,o=t.state,a=new er,s=new ke,c=e.shadows,u=new Re,l=new Re(r.maxTextureSize,r.maxTextureSize),h=new He,f=new He,d=1,p=2,m=1+(d|p),g=new Array(m),v=new Array(m),y={},_=[new He(1,0,0),new He(-1,0,0),new He(0,0,1),new He(0,0,-1),new He(0,1,0),new He(0,-1,0)],E=[new He(0,1,0),new He(0,1,0),new He(0,1,0),new He(0,1,0),new He(0,0,1),new He(0,0,-1)],T=[new Fe,new Fe,new Fe,new Fe,new Fe,new Fe],S=new Jn;S.depthPacking=Se,S.clipping=!0;for(var A=Dn.distanceRGBA,R=Un.clone(A.uniforms),L=0;L!==m;++L){var P=0!=(L&d),C=0!=(L&p),I=S.clone();I.morphTargets=P,I.skinning=C,g[L]=I;var O=new Zn({defines:{USE_SHADOWMAP:""},uniforms:R,vertexShader:A.vertexShader,fragmentShader:A.fragmentShader,morphTargets:P,skinning:C,clipping:!0});v[L]=O}var U=this;function N(e,n,r,i){var o=e.geometry,a=null,s=g,c=e.customDepthMaterial;if(r&&(s=v,c=e.customDistanceMaterial),c)a=c;else{var u=!1;n.morphTargets&&(o&&o.isBufferGeometry?u=o.morphAttributes&&o.morphAttributes.position&&o.morphAttributes.position.length>0:o&&o.isGeometry&&(u=o.morphTargets&&o.morphTargets.length>0)),e.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var l=e.isSkinnedMesh&&n.skinning,h=0;u&&(h|=d),l&&(h|=p),a=s[h]}if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var f=a.uuid,m=n.uuid,x=y[f];void 0===x&&(x={},y[f]=x);var _=x[m];void 0===_&&(_=a.clone(),x[m]=_),a=_}a.visible=n.visible,a.wireframe=n.wireframe;var E=n.side;return U.renderSingleSided&&E==M&&(E=b),U.renderReverseSided&&(E===b?E=w:E===w&&(E=b)),a.side=E,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r&&void 0!==a.uniforms.lightPos&&a.uniforms.lightPos.value.copy(i),a}function D(e,r,i,o){if(!1!==e.visible){if(e.layers.test(r.layers)&&(e.isMesh||e.isLine||e.isPoints)&&e.castShadow&&(!e.frustumCulled||a.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld);var s=n.update(e),c=e.material;if(Array.isArray(c))for(var u=s.groups,l=0,h=u.length;l<h;l++){var d=u[l],p=c[d.materialIndex];if(p&&p.visible){var m=N(e,p,o,f);t.renderBufferDirect(i,null,s,m,e,d)}}else if(c.visible){m=N(e,c,o,f);t.renderBufferDirect(i,null,s,m,e,null)}}for(var g=e.children,v=0,y=g.length;v<y;v++)D(g[v],r,i,o)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=x,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(e,n){if(!1!==U.enabled&&(!1!==U.autoUpdate||!1!==U.needsUpdate)&&0!==c.length){var r;o.disable(i.BLEND),o.buffers.color.setClear(1,1,1,1),o.buffers.depth.setTest(!0),o.setScissorTest(!1);for(var d=0,p=c.length;d<p;d++){var m=c[d],g=m.shadow,v=m&&m.isPointLight;if(void 0!==g){var y=g.camera;if(u.copy(g.mapSize),u.min(l),v){var x=u.x,b=u.y;T[0].set(2*x,b,x,b),T[1].set(0,b,x,b),T[2].set(3*x,b,x,b),T[3].set(x,b,x,b),T[4].set(3*x,0,x,b),T[5].set(x,0,x,b),u.x*=4,u.y*=2}if(null===g.map){var w={minFilter:Et,magFilter:Et,format:Vt};g.map=new Be(u.x,u.y,w),g.map.texture.name=m.name+".shadowMap",y.updateProjectionMatrix()}g.isSpotLightShadow&&g.update(m);var M=g.map,S=g.matrix;f.setFromMatrixPosition(m.matrixWorld),y.position.copy(f),v?(r=6,S.makeTranslation(-f.x,-f.y,-f.z)):(r=1,h.setFromMatrixPosition(m.target.matrixWorld),y.lookAt(h),y.updateMatrixWorld(),S.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),S.multiply(y.projectionMatrix),S.multiply(y.matrixWorldInverse)),t.setRenderTarget(M),t.clear();for(var A=0;A<r;A++){if(v){h.copy(y.position),h.add(_[A]),y.up.copy(E[A]),y.lookAt(h),y.updateMatrixWorld();var R=T[A];o.viewport(R)}s.multiplyMatrices(y.projectionMatrix,y.matrixWorldInverse),a.setFromMatrix(s),D(e,n,y,v)}}else console.warn("THREE.WebGLShadowMap:",m,"has no shadow.")}var L=t.getClearColor(),P=t.getClearAlpha();t.setClearColor(L,P),U.needsUpdate=!1}}}function rr(t){var e={};return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e[t.uuid]},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=e[n.uuid];r&&(t.deleteBuffer(r.buffer),delete e[n.uuid])},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var i=e[n.uuid];void 0===i?e[n.uuid]=function(e,n){var r=e.array,i=e.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,r,i),e.onUploadCallback();var a=t.FLOAT;return r instanceof Float32Array?a=t.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?a=t.UNSIGNED_SHORT:r instanceof Int16Array?a=t.SHORT:r instanceof Uint32Array?a=t.UNSIGNED_INT:r instanceof Int32Array?a=t.INT:r instanceof Int8Array?a=t.BYTE:r instanceof Uint8Array&&(a=t.UNSIGNED_BYTE),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(n,r):i.version<n.version&&(function(e,n,r){var i=n.array,o=n.updateRange;t.bindBuffer(r,e),!1===n.dynamic?t.bufferData(r,i,t.STATIC_DRAW):-1===o.count?t.bufferSubData(r,0,i):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."):(t.bufferSubData(r,o.offset*i.BYTES_PER_ELEMENT,i.subarray(o.offset,o.offset+o.count)),o.count=-1)}(i.buffer,n,r),i.version=n.version)}}}function ir(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||ir.DefaultOrder}function or(){this.mask=1}Object.assign(Yn.prototype,r.prototype,{isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]="overdraw"===e?Number(n):n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===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()),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.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.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),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!==P&&(n.blending=this.blending),this.shading!==T&&(n.shading=this.shading),this.side!==b&&(n.side=this.side),this.vertexColors!==S&&(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,this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),n.skinning=this.skinning,n.morphTargets=this.morphTargets,n.dithering=this.dithering,e){var i=r(t.textures),o=r(t.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}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.shading=t.shading,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.overdraw=t.overdraw,this.visible=t.visible,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},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Zn.prototype=Object.create(Yn.prototype),Zn.prototype.constructor=Zn,Zn.prototype.isShaderMaterial=!0,Zn.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Un.clone(t.uniforms),this.defines=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},Zn.prototype.toJSON=function(t){var e=Yn.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},Jn.prototype=Object.create(Yn.prototype),Jn.prototype.constructor=Jn,Jn.prototype.isMeshDepthMaterial=!0,Jn.prototype.copy=function(t){return Yn.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},Object.assign(Kn.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,o=-1/0,a=-1/0,s=0,c=t.length;s<c;s+=3){var u=t[s],l=t[s+1],h=t[s+2];u<e&&(e=u),l<n&&(n=l),h<r&&(r=h),u>i&&(i=u),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=t.count;s<c;s++){var u=t.getX(s),l=t.getY(s),h=t.getZ(s);u<e&&(e=u),l<n&&(n=l),h<r&&(r=h),u>i&&(i=u),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new He;return function(e,n){var r=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),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){var e=t||new He;return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new He;return this.isEmpty()?e.set(0,0,0):e.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 t=new He;return function(e){var n=this;return e.updateMatrixWorld(!0),e.traverse(function(e){var r,i,o=e.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(r=0,i=a.length;r<i;r++)t.copy(a[r]),t.applyMatrix4(e.matrixWorld),n.expandByPoint(t)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(r=0,i=s.count;r<i;r++)t.fromBufferAttribute(s,r).applyMatrix4(e.matrixWorld),n.expandByPoint(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||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(e||new He).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:(Hn=new He,function(t){return this.clampPoint(t.center,Hn),Hn.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(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),t.normal.z>0?(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},clampPoint:function(t,e){return(e||new He).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new He;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new He;return function(e){var n=e||new Qn;return this.getCenter(n.center),n.radius=.5*this.getSize(t).length(),n}}(),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 He,new He,new He,new He,new He,new He,new He,new He],function(t){return this.isEmpty()?this:(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(Qn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(kn=new Kn,function(t,e){var n=this.center;void 0!==e?n.copy(e):kn.setFromPoints(t).getCenter(n);for(var r=0,i=0,o=t.length;i<o;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(this.center.dot(t.normal)-t.constant)<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t),r=e||new He;return r.copy(t),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(t){var e=t||new Kn;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},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($n.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,o,a,s,c){var u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=i,u[5]=s,u[6]=n,u[7]=o,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:function(){var t=new He;return function(e){for(var n=0,r=e.count;n<r;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix3(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),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,o=n[0],a=n[3],s=n[6],c=n[1],u=n[4],l=n[7],h=n[2],f=n[5],d=n[8],p=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],_=r[2],b=r[5],w=r[8];return i[0]=o*p+a*v+s*_,i[3]=o*m+a*y+s*b,i[6]=o*g+a*x+s*w,i[1]=c*p+u*v+l*_,i[4]=c*m+u*y+l*b,i[7]=c*g+u*x+l*w,i[2]=h*p+f*v+d*_,i[5]=h*m+f*y+d*b,i[8]=h*g+f*x+d*w,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],o=t[4],a=t[5],s=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-n*i*u+n*a*s+r*i*c-r*o*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],o=n[1],a=n[2],s=n[3],c=n[4],u=n[5],l=n[6],h=n[7],f=n[8],d=f*c-u*h,p=u*l-f*s,m=h*s-c*l,g=i*d+o*p+a*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]=d*y,r[1]=(a*h-f*o)*y,r[2]=(u*o-a*c)*y,r[3]=p*y,r[4]=(f*i-a*l)*y,r[5]=(a*s-u*i)*y,r[6]=m*y,r[7]=(o*l-h*i)*y,r[8]=(c*i-o*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},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}}),Object.assign(tr.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:function(){var t=new He,e=new He;return function(n,r,i){var o=t.subVectors(i,r).cross(e.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),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 this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var n=this.distanceToPoint(t);return(e||new He).copy(this.normal).multiplyScalar(n)},intersectLine:function(){var t=new He;return function(e,n){var r=n||new He,i=e.delta(t),o=this.normal.dot(i);if(0===o)return 0===this.distanceToPoint(e.start)?r.copy(e.start):void 0;var a=-(e.start.dot(this.normal)+this.constant)/o;return a<0||a>1?void 0:r.copy(i).multiplyScalar(a).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return(t||new He).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new He,e=new $n;return function(n,r){var i=this.coplanarPoint(t).applyMatrix4(n),o=r||e.getNormalMatrix(n),a=this.normal.applyMatrix3(o).normalize();return this.constant=-i.dot(a),this}}(),translate:function(t){return this.constant=this.constant-t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(er.prototype,{set:function(t,e,n,r,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),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],o=n[2],a=n[3],s=n[4],c=n[5],u=n[6],l=n[7],h=n[8],f=n[9],d=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-r,l-s,p-h,y-m).normalize(),e[1].setComponents(a+r,l+s,p+h,y+m).normalize(),e[2].setComponents(a+i,l+c,p+f,y+g).normalize(),e[3].setComponents(a-i,l-c,p-f,y-g).normalize(),e[4].setComponents(a-o,l-u,p-d,y-v).normalize(),e[5].setComponents(a+o,l+u,p+d,y+v).normalize(),this},intersectsObject:(Wn=new Qn,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Wn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Wn)}),intersectsSprite:function(){var t=new Qn;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),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:(jn=new He,Vn=new He,function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];jn.x=r.normal.x>0?t.min.x:t.max.x,Vn.x=r.normal.x>0?t.max.x:t.min.x,jn.y=r.normal.y>0?t.min.y:t.max.y,Vn.y=r.normal.y>0?t.max.y:t.min.y,jn.z=r.normal.z>0?t.min.z:t.max.z,Vn.z=r.normal.z>0?t.max.z:t.min.z;var i=r.distanceToPoint(jn),o=r.distanceToPoint(Vn);if(i<0&&o<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}}),ir.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ir.DefaultOrder="XYZ",Object.defineProperties(ir.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(ir.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=Ae.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],c=i[1],u=i[5],l=i[9],h=i[2],f=i[6],d=i[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,u),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.99999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(f,d),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,u))):"YZX"===e?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(f,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new ke;return function(e,n,r){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,n,r)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(Xn=new Ge,function(t){return Xn.setFromEuler(this),this.setFromQuaternion(Xn,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 He(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(or.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,sr,cr,ur,lr=0;function hr(){Object.defineProperty(this,"id",{value:lr++}),this.uuid=Ae.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hr.DefaultUp.clone();var t=new He,e=new ir,n=new Ge,r=new He(1,1,1);e.onChange(function(){n.setFromEuler(e,!1)}),n.onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:t},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:r},modelViewMatrix:{value:new ke},normalMatrix:{value:new $n}}),this.matrix=new ke,this.matrixWorld=new ke,this.matrixAutoUpdate=hr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new or,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function fr(){hr.call(this),this.type="Camera",this.matrixWorldInverse=new ke,this.projectionMatrix=new ke}function dr(t,e,n,r,i,o){fr.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=void 0!==i?i:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function pr(t,e,n,r){fr.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 mr(t,e,n,r,i,o){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new He,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new In,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}hr.DefaultUp=new He(0,1,0),hr.DefaultMatrixAutoUpdate=!0,Object.assign(hr.prototype,r.prototype,{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:(ur=new Ge,function(t,e){return ur.setFromAxisAngle(t,e),this.quaternion.multiply(ur),this}),rotateX:function(){var t=new He(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new He(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new He(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new He;return function(e,n){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(n)),this}}(),translateX:function(){var t=new He(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new He(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new He(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(cr=new ke,function(t){return t.applyMatrix4(cr.getInverse(this.matrixWorld))}),lookAt:function(){var t=new ke;return function(e){this.isCamera?t.lookAt(this.position,e,this.up):t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(arguments.length>1){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),this):(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(arguments.length>1){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){var e=t||new He;return this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(ar=new He,sr=new He,function(t){var e=t||new Ge;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(ar,e,sr),e}),getWorldRotation:function(){var t=new Ge;return function(e){var n=e||new ir;return this.getWorldQuaternion(t),n.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new He,e=new Ge;return function(n){var r=n||new He;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,r),r}}(),getWorldDirection:function(){var t=new Ge;return function(e){var n=e||new He;return this.getWorldQuaternion(t),n.set(0,0,1).applyQuaternion(t)}}(),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),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},toJSON:function(t){var e=void 0===t||""===t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),r.matrix=this.matrix.toArray(),void 0!==this.geometry&&(r.geometry=i(t.geometries,this.geometry)),void 0!==this.material)if(Array.isArray(this.material)){for(var o=[],a=0,s=this.material.length;a<s;a++)o.push(i(t.materials,this.material[a]));r.material=o}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(t).object)}if(e){var c=f(t.geometries),u=f(t.materials),l=f(t.textures),h=f(t.images);c.length>0&&(n.geometries=c),u.length>0&&(n.materials=u),l.length>0&&(n.textures=l),h.length>0&&(n.images=h)}return n.object=r,n;function f(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}}),fr.prototype=Object.assign(Object.create(hr.prototype),{constructor:fr,isCamera:!0,copy:function(t,e){return hr.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},getWorldDirection:function(){var t=new Ge;return function(e){var n=e||new He;return this.getWorldQuaternion(t),n.set(0,0,-1).applyQuaternion(t)}}(),updateMatrixWorld:function(t){hr.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),dr.prototype=Object.assign(Object.create(fr.prototype),{constructor:dr,isOrthographicCamera:!0,copy:function(t,e){return fr.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,o){this.view={fullWidth:t,fullHeight:e,offsetX:n,offsetY:r,width:i,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,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,o=n+t,a=r+e,s=r-e;if(null!==this.view){var c=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),l=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;o=(i+=l*(this.view.offsetX/c))+l*(this.view.width/c),s=(a-=h*(this.view.offsetY/u))-h*(this.view.height/u)}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far)},toJSON:function(t){var e=hr.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}}),pr.prototype=Object.assign(Object.create(fr.prototype),{constructor:pr,isPerspectiveCamera:!0,copy:function(t,e){return fr.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*Ae.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Ae.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Ae.RAD2DEG*Math.atan(Math.tan(.5*Ae.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,o){this.aspect=t/e,this.view={fullWidth:t,fullHeight:e,offsetX:n,offsetY:r,width:i,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Ae.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==o){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,e-=o.offsetY*n/s,r*=o.width/a,n*=o.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)},toJSON:function(t){var e=hr.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}}),Object.assign(mr.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}});var gr,vr,yr,xr,_r,br,wr,Mr,Er=0;function Tr(){return Er++}function Sr(){Object.defineProperty(this,"id",{value:Tr()}),this.uuid=Ae.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 Ar(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=Ae.generateUUID(),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.onUploadCallback=function(){},this.version=0}function Rr(t,e){Ar.call(this,new Int8Array(t),e)}function Lr(t,e){Ar.call(this,new Uint8Array(t),e)}function Pr(t,e){Ar.call(this,new Uint8ClampedArray(t),e)}function Cr(t,e){Ar.call(this,new Int16Array(t),e)}function Ir(t,e){Ar.call(this,new Uint16Array(t),e)}function Or(t,e){Ar.call(this,new Int32Array(t),e)}function Ur(t,e){Ar.call(this,new Uint32Array(t),e)}function Nr(t,e){Ar.call(this,new Float32Array(t),e)}function Dr(t,e){Ar.call(this,new Float64Array(t),e)}function Fr(){this.indices=[],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 Br(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}function zr(){Object.defineProperty(this,"id",{value:Tr()}),this.uuid=Ae.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}}function Gr(t,e,n,r,i,o){Sr.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o},this.fromBufferGeometry(new Hr(t,e,n,r,i,o)),this.mergeVertices()}function Hr(t,e,n,r,i,o){zr.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};var a=this;r=Math.floor(r)||1,i=Math.floor(i)||1,o=Math.floor(o)||1;var s=[],c=[],u=[],l=[],h=0,f=0;function d(t,e,n,r,i,o,d,p,m,g,v){var y,x,_=o/m,b=d/g,w=o/2,M=d/2,E=p/2,T=m+1,S=g+1,A=0,R=0,L=new He;for(x=0;x<S;x++){var P=x*b-M;for(y=0;y<T;y++){var C=y*_-w;L[t]=C*r,L[e]=P*i,L[n]=E,c.push(L.x,L.y,L.z),L[t]=0,L[e]=0,L[n]=p>0?1:-1,u.push(L.x,L.y,L.z),l.push(y/m),l.push(1-x/g),A+=1}}for(x=0;x<g;x++)for(y=0;y<m;y++){var I=h+y+T*x,O=h+y+T*(x+1),U=h+(y+1)+T*(x+1),N=h+(y+1)+T*x;s.push(I,O,N),s.push(O,U,N),R+=6}a.addGroup(f,R,v),f+=R,h+=A}d("z","y","x",-1,-1,n,e,t,o,i,0),d("z","y","x",1,-1,n,e,-t,o,i,1),d("x","z","y",1,1,t,n,e,r,o,2),d("x","z","y",1,-1,t,n,-e,r,o,3),d("x","y","z",1,-1,t,e,n,r,i,4),d("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.addAttribute("position",new Nr(c,3)),this.addAttribute("normal",new Nr(u,3)),this.addAttribute("uv",new Nr(l,2))}function kr(t,e,n,r){Sr.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new jr(t,e,n,r)),this.mergeVertices()}function jr(t,e,n,r){zr.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};var i,o,a=t/2,s=e/2,c=Math.floor(n)||1,u=Math.floor(r)||1,l=c+1,h=u+1,f=t/c,d=e/u,p=[],m=[],g=[],v=[];for(o=0;o<h;o++){var y=o*d-s;for(i=0;i<l;i++){var x=i*f-a;m.push(x,-y,0),g.push(0,0,1),v.push(i/c),v.push(1-o/u)}}for(o=0;o<u;o++)for(i=0;i<c;i++){var _=i+l*o,b=i+l*(o+1),w=i+1+l*(o+1),M=i+1+l*o;p.push(_,b,M),p.push(b,w,M)}this.setIndex(p),this.addAttribute("position",new Nr(m,3)),this.addAttribute("normal",new Nr(g,3)),this.addAttribute("uv",new Nr(v,2))}function Vr(t){Yn.call(this),this.type="MeshBasicMaterial",this.color=new In(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=ot,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 Wr(t,e){this.origin=void 0!==t?t:new He,this.direction=void 0!==e?e:new He}function Xr(t,e){this.start=void 0!==t?t:new He,this.end=void 0!==e?e:new He}function qr(t,e,n){this.a=void 0!==t?t:new He,this.b=void 0!==e?e:new He,this.c=void 0!==n?n:new He}function Yr(t,e){hr.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new zr,this.material=void 0!==e?e:new Vr({color:16777215*Math.random()}),this.drawMode=pe,this.updateMorphTargets()}function Zr(t,e,n,r){var i,o,a,s,c=new In(0),u=0;function l(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,r)}return{getClearColor:function(){return c},setClearColor:function(t,e){c.set(t),l(c,u=void 0!==e?e:1)},getClearAlpha:function(){return u},setClearAlpha:function(t){l(c,u=t)},render:function(e,r,h){var f=e.background;null===f?l(c,u):f&&f.isColor&&(l(f,1),h=!0),(t.autoClear||h)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&f.isCubeTexture?(void 0===a&&(a=new pr,s=new Yr(new Hr(5,5,5),new Zn({uniforms:Dn.cube.uniforms,vertexShader:Dn.cube.vertexShader,fragmentShader:Dn.cube.fragmentShader,side:w,depthTest:!1,depthWrite:!1,fog:!1}))),a.projectionMatrix.copy(r.projectionMatrix),a.matrixWorld.extractRotation(r.matrixWorld),a.matrixWorldInverse.getInverse(a.matrixWorld),s.material.uniforms.tCube.value=f,s.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,s.matrixWorld),n.update(s),t.renderBufferDirect(a,null,s.geometry,s.material,s,null)):f&&f.isTexture&&(void 0===i&&(i=new dr(-1,1,1,-1,0,1),o=new Yr(new jr(2,2),new Vr({depthTest:!1,depthWrite:!1,fog:!1}))),o.material.map=f,n.update(o),t.renderBufferDirect(i,null,o.geometry,o.material,o,null))}}}function Jr(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 Kr(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Qr(){var t=[],e=-1,n=[],r=-1;return{opaque:t,transparent:n,init:function(){e=-1,r=-1},push:function(i,o,a,s,c){var u,l;a.transparent?(u=n,l=++r):(u=t,l=++e);var h=u[l];h?(h.id=i.id,h.object=i,h.geometry=o,h.material=a,h.program=a.program,h.renderOrder=i.renderOrder,h.z=s,h.group=c):(h={id:i.id,object:i,geometry:o,material:a,program:a.program,renderOrder:i.renderOrder,z:s,group:c},u.push(h))},finish:function(){t.length=e+1,n.length=r+1},sort:function(){t.sort(Jr),n.sort(Kr)}}}function $r(){var t={};return{get:function(e,n){var r=e.id+","+n.id,i=t[r];return void 0===i&&(i=new Qr,t[r]=i),i},dispose:function(){t={}}}}function ti(t,e,n){var r,i,o;this.setMode=function(t){r=t},this.setIndex=function(t){i=t.type,o=t.bytesPerElement},this.render=function(e,a){t.drawElements(r,a,i,e*o),n.calls++,n.vertices+=a,r===t.TRIANGLES&&(n.faces+=a/3)},this.renderInstances=function(a,s,c){var u=e.get("ANGLE_instanced_arrays");null!==u?(u.drawElementsInstancedANGLE(r,c,i,s*o,a.maxInstancedCount),n.calls++,n.vertices+=c*a.maxInstancedCount,r===t.TRIANGLES&&(n.faces+=a.maxInstancedCount*c/3)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function ei(t,e,n){var r;this.setMode=function(t){r=t},this.render=function(e,i){t.drawArrays(r,e,i),n.calls++,n.vertices+=i,r===t.TRIANGLES&&(n.faces+=i/3)},this.renderInstances=function(i,o,a){var s=e.get("ANGLE_instanced_arrays");if(null!==s){var c=i.attributes.position;c.isInterleavedBufferAttribute?(a=c.data.count,s.drawArraysInstancedANGLE(r,0,a,i.maxInstancedCount)):s.drawArraysInstancedANGLE(r,o,a,i.maxInstancedCount),n.calls++,n.vertices+=a*i.maxInstancedCount,r===t.TRIANGLES&&(n.faces+=i.maxInstancedCount*a/3)}else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function ni(t,e,n){var r={},i={};function o(t){var a=t.target,s=r[a.id];for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);a.removeEventListener("dispose",o),delete r[a.id];var u=i[a.id];u&&(e.remove(u),delete i[a.id]),(u=i[s.id])&&(e.remove(u),delete i[s.id]),n.geometries--}return{get:function(t,e){var i=r[e.id];return i||(e.addEventListener("dispose",o),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new zr).setFromObject(t)),i=e._bufferGeometry),r[e.id]=i,n.geometries++,i)},update:function(n){var r=n.index,i=n.attributes;for(var o in null!==r&&e.update(r,t.ELEMENT_ARRAY_BUFFER),i)e.update(i[o],t.ARRAY_BUFFER);var a=n.morphAttributes;for(var o in a)for(var s=a[o],c=0,u=s.length;c<u;c++)e.update(s[c],t.ARRAY_BUFFER)},getWireframeAttribute:function(n){var r=i[n.id];if(r)return r;var o,a=[],s=n.index,c=n.attributes;if(null!==s)for(var u=0,l=(o=s.array).length;u<l;u+=3){var h=o[u+0],f=o[u+1],d=o[u+2];a.push(h,f,f,d,d,h)}else for(u=0,l=(o=c.position.array).length/3-1;u<l;u+=3)h=u+0,f=u+1,d=u+2,a.push(h,f,f,d,d,h);return r=new(Br(a)>65535?Ur:Ir)(a,1),e.update(r,t.ELEMENT_ARRAY_BUFFER),i[n.id]=r,r}}}function ri(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new He,color:new In,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"SpotLight":n={position:new He,direction:new He,color:new In,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"PointLight":n={position:new He,color:new In,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"HemisphereLight":n={direction:new He,skyColor:new In,groundColor:new In};break;case"RectAreaLight":n={color:new In,position:new He,halfWidth:new He,halfHeight:new He}}return t[e.id]=n,n}}}function ii(t,e,n){var r={};return{update:function(t){var i=n.frame,o=t.geometry,a=e.get(t,o);return r[a.id]!==i&&(o.isGeometry&&a.updateFromObject(t),e.update(a),r[a.id]=i),a},clear:function(){r={}}}}function oi(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),!1===t.getShaderParameter(r,t.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"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}Object.assign(Sr.prototype,r.prototype,{isGeometry:!0,applyMatrix:function(t){for(var e=(new $n).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 o=0,a=i.vertexNormals.length;o<a;o++)i.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new ke;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new ke;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new ke;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new ke;return function(e,n,r){return t.makeTranslation(e,n,r),this.applyMatrix(t),this}}(),scale:function(){var t=new ke;return function(e,n,r){return t.makeScale(e,n,r),this.applyMatrix(t),this}}(),lookAt:(gr=new hr,function(t){gr.lookAt(t),gr.updateMatrix(),this.applyMatrix(gr.matrix)}),fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,r=t.attributes,i=r.position.array,o=void 0!==r.normal?r.normal.array:void 0,a=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var u=[],l=[],h=[],f=0,d=0;f<i.length;f+=3,d+=2)e.vertices.push(new He(i[f],i[f+1],i[f+2])),void 0!==o&&u.push(new He(o[f],o[f+1],o[f+2])),void 0!==a&&e.colors.push(new In(a[f],a[f+1],a[f+2])),void 0!==s&&l.push(new Re(s[d],s[d+1])),void 0!==c&&h.push(new Re(c[d],c[d+1]));function p(t,n,r,i){var f=new mr(t,n,r,void 0!==o?[u[t].clone(),u[n].clone(),u[r].clone()]:[],void 0!==a?[e.colors[t].clone(),e.colors[n].clone(),e.colors[r].clone()]:[],i);e.faces.push(f),void 0!==s&&e.faceVertexUvs[0].push([l[t].clone(),l[n].clone(),l[r].clone()]),void 0!==c&&e.faceVertexUvs[1].push([h[t].clone(),h[n].clone(),h[r].clone()])}var m=t.groups;if(m.length>0)for(f=0;f<m.length;f++)for(var g=m[f],v=g.start,y=(d=v,v+g.count);d<y;d+=3)void 0!==n?p(n[d],n[d+1],n[d+2],g.materialIndex):p(d,d+1,d+2,g.materialIndex);else if(void 0!==n)for(f=0;f<n.length;f+=3)p(n[f],n[f+1],n[f+2]);else for(f=0;f<i.length/3;f+=3)p(f,f+1,f+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new ke;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 He,e=new He,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],o=this.vertices[i.a],a=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){var e,n,r,i,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)a[e]=new He;if(t){var s,c,u,l=new He,h=new He;for(r=0,i=this.faces.length;r<i;r++)o=this.faces[r],s=this.vertices[o.a],c=this.vertices[o.b],u=this.vertices[o.c],l.subVectors(u,c),h.subVectors(s,c),l.cross(h),a[o.a].add(l),a[o.b].add(l),a[o.c].add(l)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a[(o=this.faces[r]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,n=this.vertices.length;e<n;e++)a[e].normalize();for(r=0,i=this.faces.length;r<i;r++){var f=(o=this.faces[r]).vertexNormals;3===f.length?(f[0].copy(a[o.a]),f[1].copy(a[o.b]),f[2].copy(a[o.c])):(f[0]=a[o.a].clone(),f[1]=a[o.b].clone(),f[2]=a[o.c].clone())}this.faces.length>0&&(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())}this.faces.length>0&&(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 o=new Sr;for(o.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 a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new He,u={a:new He,b:new He,c:new He},a.push(c),s.push(u)}var c,u,l=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=l.faceNormals[n],u=l.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},computeLineDistances:function(){for(var t=0,e=this.vertices,n=0,r=e.length;n<r;n++)n>0&&(t+=e[n].distanceTo(e[n-1])),this.lineDistances[n]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Qn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,u=this.faceVertexUvs[0],l=t.faceVertexUvs[0],h=this.colors,f=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new $n).getNormalMatrix(e));for(var d=0,p=a.length;d<p;d++){var m=a[d].clone();void 0!==e&&m.applyMatrix4(e),o.push(m)}for(d=0,p=f.length;d<p;d++)h.push(f[d].clone());for(d=0,p=c.length;d<p;d++){var g,v,y,x=c[d],_=x.vertexNormals,b=x.vertexColors;(g=new mr(x.a+i,x.b+i,x.c+i)).normal.copy(x.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var w=0,M=_.length;w<M;w++)v=_[w].clone(),void 0!==r&&v.applyMatrix3(r).normalize(),g.vertexNormals.push(v);g.color.copy(x.color);for(w=0,M=b.length;w<M;w++)y=b[w],g.vertexColors.push(y.clone());g.materialIndex=x.materialIndex+n,s.push(g)}for(d=0,p=l.length;d<p;d++){var E=l[d],T=[];if(void 0!==E){for(w=0,M=E.length;w<M;w++)T.push(E[w].clone());u.push(T)}}}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,o,a,s,c={},u=[],l=[],h=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*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(c[e]=n,u.push(this.vertices[n]),l[n]=u.length-1):l[n]=l[c[e]];var f=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=l[i.a],i.b=l[i.b],i.c=l[i.c],o=[i.a,i.b,i.c];for(var d=0;d<3;d++)if(o[d]===o[(d+1)%3]){f.push(n);break}}for(n=f.length-1;n>=0;n--){var p=f[n];for(this.faces.splice(p,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(p,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},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,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(r=[]),a&&a.length===e&&(i=[]);for(n=0;n<e;n++){var s=t[n]._id;r&&r.push(o[s]),i&&i.push(a[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 o=this.vertices[i];r.push(o.x,o.y,o.z)}var a=[],s=[],c={},u=[],l={},h=[],f={};for(i=0;i<this.faces.length;i++){var d=this.faces[i],p=void 0!==this.faceVertexUvs[0][i],m=d.normal.length()>0,g=d.vertexNormals.length>0,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,p),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),a.push(x),a.push(d.a,d.b,d.c),a.push(d.materialIndex),p){var _=this.faceVertexUvs[0][i];a.push(S(_[0]),S(_[1]),S(_[2]))}if(m&&a.push(E(d.normal)),g){var b=d.vertexNormals;a.push(E(b[0]),E(b[1]),E(b[2]))}if(v&&a.push(T(d.color)),y){var w=d.vertexColors;a.push(T(w[0]),T(w[1]),T(w[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]:(c[e]=s.length/3,s.push(t.x,t.y,t.z),c[e])}function T(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==l[e]?l[e]:(l[e]=u.length,u.push(t.getHex()),l[e])}function S(t){var e=t.x.toString()+t.y.toString();return void 0!==f[e]?f[e]:(f[e]=h.length/2,h.push(t.x,t.y),f[e])}return t.data={},t.data.vertices=r,t.data.normals=s,u.length>0&&(t.data.colors=u),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new Sr).copy(this)},copy:function(t){var e,n,r,i,o,a;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 l=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),r=0,i=l.length;r<i;r++){var h=l[r],f=[];for(o=0,a=h.length;o<a;o++){var d=h[o];f.push(d.clone())}this.faceVertexUvs[e].push(f)}}var p=t.morphTargets;for(e=0,n=p.length;e<n;e++){var m={};if(m.name=p[e].name,void 0!==p[e].vertices)for(m.vertices=[],r=0,i=p[e].vertices.length;r<i;r++)m.vertices.push(p[e].vertices[r].clone());if(void 0!==p[e].normals)for(m.normals=[],r=0,i=p[e].normals.length;r<i;r++)m.normals.push(p[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 _=t.skinWeights;for(e=0,n=_.length;e<n;e++)this.skinWeights.push(_[e].clone());var b=t.skinIndices;for(e=0,n=b.length;e<n;e++)this.skinIndices.push(b[e].clone());var w=t.lineDistances;for(e=0,n=w.length;e<n;e++)this.lineDistances.push(w[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(Ar.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ar.prototype,{isBufferAttribute:!0,setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.itemSize:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return 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 o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new In),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyIndicesArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];e[n++]=o.a,e[n++]=o.b,e[n++]=o.c}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new Re),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new He),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new Fe),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.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)}}),Rr.prototype=Object.create(Ar.prototype),Rr.prototype.constructor=Rr,Lr.prototype=Object.create(Ar.prototype),Lr.prototype.constructor=Lr,Pr.prototype=Object.create(Ar.prototype),Pr.prototype.constructor=Pr,Cr.prototype=Object.create(Ar.prototype),Cr.prototype.constructor=Cr,Ir.prototype=Object.create(Ar.prototype),Ir.prototype.constructor=Ir,Or.prototype=Object.create(Ar.prototype),Or.prototype.constructor=Or,Ur.prototype=Object.create(Ar.prototype),Ur.prototype.constructor=Ur,Nr.prototype=Object.create(Ar.prototype),Nr.prototype.constructor=Nr,Dr.prototype=Object.create(Ar.prototype),Dr.prototype.constructor=Dr,Object.assign(Fr.prototype,{computeGroups:function(t){for(var e,n=[],r=void 0,i=t.faces,o=0;o<i.length;o++){var a=i[o];a.materialIndex!==r&&(r=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:r})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,o=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var u=0;u<c;u++)e[u]=[];this.morphTargets.position=e}var l,h=t.morphNormals,f=h.length;if(f>0){l=[];for(u=0;u<f;u++)l[u]=[];this.morphTargets.normal=l}var d=t.skinIndices,p=t.skinWeights,m=d.length===r.length,g=p.length===r.length;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=v.vertexColors;if(3===b.length)this.colors.push(b[0],b[1],b[2]);else{var w=v.color;this.colors.push(w,w,w)}if(!0===o)void 0!==(_=i[0][u])?this.uvs.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new Re,new Re,new Re));if(!0===a)void 0!==(_=i[1][u])?this.uvs2.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new Re,new Re,new Re));for(var M=0;M<c;M++){var E=s[M].vertices;e[M].push(E[v.a],E[v.b],E[v.c])}for(M=0;M<f;M++){var T=h[M].vertexNormals[u];l[M].push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[v.a],d[v.b],d[v.c]),g&&this.skinWeights.push(p[v.a],p[v.b],p[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}}),zr.MaxIndex=65535,Object.assign(zr.prototype,r.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Br(t)>65535?Ur:Ir)(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."),void this.setIndex(e)):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new Ar(arguments[1],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 $n).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new ke;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new ke;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new ke;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new ke;return function(e,n,r){return t.makeTranslation(e,n,r),this.applyMatrix(t),this}}(),scale:function(){var t=new ke;return function(e,n,r){return t.makeScale(e,n,r),this.applyMatrix(t),this}}(),lookAt:function(){var t=new hr;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Nr(3*e.vertices.length,3),r=new Nr(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 Nr(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},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 Fr).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Ar(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Ar(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var r=new Float32Array(3*t.colors.length);this.addAttribute("color",new Ar(r,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Ar(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Ar(o,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var a=new(Br(t.indices)>65535?Uint32Array:Uint16Array)(3*t.indices.length);this.setIndex(new Ar(a,1).copyIndicesArray(t.indices))}for(var s in this.groups=t.groups,t.morphTargets){for(var c=[],u=t.morphTargets[s],l=0,h=u.length;l<h;l++){var f=u[l],d=new Nr(3*f.length,3);c.push(d.copyVector3sArray(f))}this.morphAttributes[s]=c}if(t.skinIndices.length>0){var p=new Nr(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var m=new Nr(4*t.skinWeights.length,4);this.addAttribute("skinWeight",m.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 Kn);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:function(){var t=new Kn,e=new He;return function(){null===this.boundingSphere&&(this.boundingSphere=new Qn);var n=this.attributes.position;if(n){var r=this.boundingSphere.center;t.setFromBufferAttribute(n),t.getCenter(r);for(var i=0,o=0,a=n.count;o<a;o++)e.x=n.getX(o),e.y=n.getY(o),e.z=n.getZ(o),i=Math.max(i,r.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(i),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,n=this.groups;if(e.position){var r=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new Ar(new Float32Array(r.length),3));else for(var i=e.normal.array,o=0,a=i.length;o<a;o++)i[o]=0;var s,c,u,l=e.normal.array,h=new He,f=new He,d=new He,p=new He,m=new He;if(t){var g=t.array;0===n.length&&this.addGroup(0,g.length);for(var v=0,y=n.length;v<y;++v){var x=n[v],_=x.start;for(o=_,a=_+x.count;o<a;o+=3)s=3*g[o+0],c=3*g[o+1],u=3*g[o+2],h.fromArray(r,s),f.fromArray(r,c),d.fromArray(r,u),p.subVectors(d,f),m.subVectors(h,f),p.cross(m),l[s]+=p.x,l[s+1]+=p.y,l[s+2]+=p.z,l[c]+=p.x,l[c+1]+=p.y,l[c+2]+=p.z,l[u]+=p.x,l[u+1]+=p.y,l[u+2]+=p.z}}else for(o=0,a=r.length;o<a;o+=9)h.fromArray(r,o),f.fromArray(r,o+3),d.fromArray(r,o+6),p.subVectors(d,f),m.subVectors(h,f),p.cross(m),l[o]=p.x,l[o+1]=p.y,l[o+2]=p.z,l[o+3]=p.x,l[o+4]=p.y,l[o+5]=p.z,l[o+6]=p.x,l[o+7]=p.y,l[o+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0);var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r].array,o=t.attributes[r],a=o.array,s=0,c=o.itemSize*e;s<a.length;s++,c++)i[c]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t,e,n,r,i=this.attributes.normal,o=0,a=i.count;o<a;o++)t=i.getX(o),e=i.getY(o),n=i.getZ(o),r=1/Math.sqrt(t*t+e*e+n*n),i.setXYZ(o,t*r,e*r,n*r)},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new zr,e=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],o=i.array,a=i.itemSize,s=new o.constructor(e.length*a),c=0,u=0,l=0,h=e.length;l<h;l++){c=e[l]*a;for(var f=0;f<a;f++)s[u++]=o[c++]}t.addAttribute(r,new Ar(s,a))}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),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 o=this.attributes;for(var n in o){var a=o[n];i=Array.prototype.slice.call(a.array);t.data.attributes[n]={itemSize:a.itemSize,type:a.array.constructor.name,array:i,normalized:a.normalized}}var s=this.groups;s.length>0&&(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 zr).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 o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.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 l=t.groups;for(n=0,r=l.length;n<r;n++){var h=l[n];this.addGroup(h.start,h.count,h.materialIndex)}var f=t.boundingBox;null!==f&&(this.boundingBox=f.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Gr.prototype=Object.create(Sr.prototype),Gr.prototype.constructor=Gr,Hr.prototype=Object.create(zr.prototype),Hr.prototype.constructor=Hr,kr.prototype=Object.create(Sr.prototype),kr.prototype.constructor=kr,jr.prototype=Object.create(zr.prototype),jr.prototype.constructor=jr,Vr.prototype=Object.create(Yn.prototype),Vr.prototype.constructor=Vr,Vr.prototype.isMeshBasicMaterial=!0,Vr.prototype.copy=function(t){return Yn.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},Object.assign(Wr.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(e||new He).copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new He;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var n=e||new He;n.subVectors(t,this.origin);var r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new He;return function(e){var n=t.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(n).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:(yr=new He,xr=new He,_r=new He,function(t,e,n,r){yr.copy(t).add(e).multiplyScalar(.5),xr.copy(e).sub(t).normalize(),_r.copy(this.origin).sub(yr);var i,o,a,s,c=.5*t.distanceTo(e),u=-this.direction.dot(xr),l=_r.dot(this.direction),h=-_r.dot(xr),f=_r.lengthSq(),d=Math.abs(1-u*u);if(d>0)if(o=u*l-h,s=c*d,(i=u*h-l)>=0)if(o>=-s)if(o<=s){var p=1/d;a=(i*=p)*(i+u*(o*=p)+2*l)+o*(u*i+o+2*h)+f}else o=c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+f;else o=-c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+f;else o<=-s?a=-(i=Math.max(0,-(-u*c+l)))*i+(o=i>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+f:o<=s?(i=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+f):a=-(i=Math.max(0,-(u*c+l)))*i+(o=i>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+f;else o=u>0?-c:c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+f;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(xr).multiplyScalar(o).add(yr),a}),intersectSphere:function(){var t=new He;return function(e,n){t.subVectors(e.center,this.origin);var r=t.dot(this.direction),i=t.dot(t)-r*r,o=e.radius*e.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=r-a,c=r+a;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=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 n>=0?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,o,a,s,c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,r=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,r=(t.min.x-h.x)*c),u>=0?(i=(t.min.y-h.y)*u,o=(t.max.y-h.y)*u):(i=(t.max.y-h.y)*u,o=(t.min.y-h.y)*u),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),l>=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))},intersectsBox:(vr=new He,function(t){return null!==this.intersectBox(t,vr)}),intersectTriangle:function(){var t=new He,e=new He,n=new He,r=new He;return function(i,o,a,s,c){e.subVectors(o,i),n.subVectors(a,i),r.crossVectors(e,n);var u,l=this.direction.dot(r);if(l>0){if(s)return null;u=1}else{if(!(l<0))return null;u=-1,l=-l}t.subVectors(this.origin,i);var h=u*this.direction.dot(n.crossVectors(t,n));if(h<0)return null;var f=u*this.direction.dot(e.cross(t));if(f<0)return null;if(h+f>l)return null;var d=-u*t.dot(r);return d<0?null:this.at(d/l,c)}}(),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(Xr.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(t||new He).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new He).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){var n=e||new He;return this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(br=new He,wr=new He,function(t,e){br.subVectors(t,this.start),wr.subVectors(this.end,this.start);var n=wr.dot(wr),r=wr.dot(br)/n;return e&&(r=Ae.clamp(r,0,1)),r}),closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e),i=n||new He;return this.delta(i).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)}}),Object.assign(qr,{normal:(Mr=new He,function(t,e,n,r){var i=r||new He;i.subVectors(n,e),Mr.subVectors(t,e),i.cross(Mr);var o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}),barycoordFromPoint:function(){var t=new He,e=new He,n=new He;return function(r,i,o,a,s){t.subVectors(a,i),e.subVectors(o,i),n.subVectors(r,i);var c=t.dot(t),u=t.dot(e),l=t.dot(n),h=e.dot(e),f=e.dot(n),d=c*h-u*u,p=s||new He;if(0===d)return p.set(-2,-1,-1);var m=1/d,g=(h*l-u*f)*m,v=(c*f-u*l)*m;return p.set(1-g-v,v,g)}}(),containsPoint:function(){var t=new He;return function(e,n,r,i){var o=qr.barycoordFromPoint(e,n,r,i,t);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}()}),Object.assign(qr.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},area:function(){var t=new He,e=new He;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){return(t||new He).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return qr.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new tr).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return qr.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return qr.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t=new tr,e=[new Xr,new Xr,new Xr],n=new He,r=new He;return function(i,o){var a=o||new He,s=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(i,n),!0===this.containsPoint(n))a.copy(n);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var c=0;c<e.length;c++){e[c].closestPointToPoint(n,!0,r);var u=n.distanceToSquared(r);u<s&&(s=u,a.copy(r))}}return a}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),Yr.prototype=Object.assign(Object.create(hr.prototype),{constructor:Yr,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return hr.prototype.copy.call(this,t),this.drawMode=t.drawMode,this},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(o.length>0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;t<e;t++)n=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}},raycast:function(){var t=new ke,e=new Wr,n=new Qn,r=new He,i=new He,o=new He,a=new He,s=new He,c=new He,u=new Re,l=new Re,h=new Re,f=new He,d=new He,p=new He;function m(t,e,n,r,i,o,a){return qr.barycoordFromPoint(t,e,n,r,f),i.multiplyScalar(f.x),o.multiplyScalar(f.y),a.multiplyScalar(f.z),i.add(o).add(a),i.clone()}function g(t,e,n,r,i,o,a){var s=t.material;if(null===(s.side===w?n.intersectTriangle(o,i,r,!0,a):n.intersectTriangle(r,i,o,s.side!==M,a)))return null;p.copy(a),p.applyMatrix4(t.matrixWorld);var c=e.ray.origin.distanceTo(p);return c<e.near||c>e.far?null:{distance:c,point:p.clone(),object:t}}function v(t,e,n,a,s,c,f,p){r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,f),o.fromBufferAttribute(a,p);var v=g(t,e,n,r,i,o,d);return v&&(s&&(u.fromBufferAttribute(s,c),l.fromBufferAttribute(s,f),h.fromBufferAttribute(s,p),v.uv=m(d,r,i,o,u,l,h)),v.face=new mr(c,f,p,qr.normal(r,i,o)),v.faceIndex=c),v}return function(f,p){var y,x=this.geometry,_=this.material,b=this.matrixWorld;if(void 0!==_&&(null===x.boundingSphere&&x.computeBoundingSphere(),n.copy(x.boundingSphere),n.applyMatrix4(b),!1!==f.ray.intersectsSphere(n)&&(t.getInverse(b),e.copy(f.ray).applyMatrix4(t),null===x.boundingBox||!1!==e.intersectsBox(x.boundingBox))))if(x.isBufferGeometry){var w,M,E,T,S,A=x.index,R=x.attributes.position,L=x.attributes.uv;if(null!==A)for(T=0,S=A.count;T<S;T+=3)w=A.getX(T),M=A.getX(T+1),E=A.getX(T+2),(y=v(this,f,e,R,L,w,M,E))&&(y.faceIndex=Math.floor(T/3),p.push(y));else for(T=0,S=R.count;T<S;T+=3)(y=v(this,f,e,R,L,w=T,M=T+1,E=T+2))&&(y.index=w,p.push(y))}else if(x.isGeometry){var P,C,I,O,U=Array.isArray(_),N=x.vertices,D=x.faces,F=x.faceVertexUvs[0];F.length>0&&(O=F);for(var B=0,z=D.length;B<z;B++){var G=D[B],H=U?_[G.materialIndex]:_;if(void 0!==H){if(P=N[G.a],C=N[G.b],I=N[G.c],!0===H.morphTargets){var k=x.morphTargets,j=this.morphTargetInfluences;r.set(0,0,0),i.set(0,0,0),o.set(0,0,0);for(var V=0,W=k.length;V<W;V++){var X=j[V];if(0!==X){var q=k[V].vertices;r.addScaledVector(a.subVectors(q[G.a],P),X),i.addScaledVector(s.subVectors(q[G.b],C),X),o.addScaledVector(c.subVectors(q[G.c],I),X)}}r.add(P),i.add(C),o.add(I),P=r,C=i,I=o}if(y=g(this,f,e,P,C,I,d)){if(O&&O[B]){var Y=O[B];u.copy(Y[0]),l.copy(Y[1]),h.copy(Y[2]),y.uv=m(d,P,C,I,u,l,h)}y.face=G,y.faceIndex=B,p.push(y)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ai,si,ci,ui,li,hi,fi=0;function di(t){switch(t){case ve:return["Linear","( value )"];case ye:return["sRGB","( value )"];case _e:return["RGBE","( value )"];case we:return["RGBM","( value, 7.0 )"];case Me:return["RGBM","( value, 16.0 )"];case Ee:return["RGBD","( value, 256.0 )"];case xe:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function pi(t,e){var n=di(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function mi(t,e){var n;switch(e){case ut:n="Linear";break;case lt:n="Reinhard";break;case ht:n="Uncharted2";break;case ft:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function gi(t){return""!==t}function vi(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 yi(t){return t.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,function(t,e){var n=Nn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return yi(n)})}function xi(t){return t.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,r){for(var i="",o=parseInt(e);o<parseInt(n);o++)i+=r.replace(/\[ i \]/g,"[ "+o+" ]");return i})}function _i(t,e,n,r,i){var o=t.context,a=n.extensions,s=n.defines,c=r.vertexShader,u=r.fragmentShader,l="SHADOWMAP_TYPE_BASIC";i.shadowMapType===x?l="SHADOWMAP_TYPE_PCF":i.shadowMapType===_&&(l="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",f="ENVMAP_MODE_REFLECTION",d="ENVMAP_BLENDING_MULTIPLY";if(i.envMap){switch(n.envMap.mapping){case pt:case mt:h="ENVMAP_TYPE_CUBE";break;case xt:case _t:h="ENVMAP_TYPE_CUBE_UV";break;case gt:case vt:h="ENVMAP_TYPE_EQUIREC";break;case yt:h="ENVMAP_TYPE_SPHERE"}switch(n.envMap.mapping){case mt:case vt:f="ENVMAP_MODE_REFRACTION"}switch(n.combine){case ot:d="ENVMAP_BLENDING_MULTIPLY";break;case at:d="ENVMAP_BLENDING_MIX";break;case st:d="ENVMAP_BLENDING_ADD"}}var p,m,g,v,y,b=t.gammaFactor>0?t.gammaFactor:1,w=function(t,e,n){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(gi).join("\n")}(a,i,t.extensions),M=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(s),E=o.createProgram();n.isRawShaderMaterial?(p=[M,"\n"].filter(gi).join("\n"),m=[w,M,"\n"].filter(gi).join("\n")):(p=["precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+r.name,M,i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&t.extensions.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(gi).join("\n"),m=[w,"precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+r.name,M,i.alphaTest?"#define ALPHATEST "+i.alphaTest:"","#define GAMMA_FACTOR "+b,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.envMap?"#define "+f:"",i.envMap?"#define "+d:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(i.numClippingPlanes-i.numClipIntersection),i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",i.envMap&&t.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",i.toneMapping!==ct?"#define TONE_MAPPING":"",i.toneMapping!==ct?Nn.tonemapping_pars_fragment:"",i.toneMapping!==ct?mi("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.outputEncoding||i.mapEncoding||i.envMapEncoding||i.emissiveMapEncoding?Nn.encodings_pars_fragment:"",i.mapEncoding?pi("mapTexelToLinear",i.mapEncoding):"",i.envMapEncoding?pi("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?pi("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.outputEncoding?(g="linearToOutputTexel",v=i.outputEncoding,y=di(v),"vec4 "+g+"( vec4 value ) { return LinearTo"+y[0]+y[1]+"; }"):"",i.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(gi).join("\n")),c=vi(c=yi(c),i),u=vi(u=yi(u),i),n.isShaderMaterial||(c=xi(c),u=xi(u));var T=p+c,S=m+u,A=oi(o,o.VERTEX_SHADER,T),R=oi(o,o.FRAGMENT_SHADER,S);o.attachShader(E,A),o.attachShader(E,R),void 0!==n.index0AttributeName?o.bindAttribLocation(E,0,n.index0AttributeName):!0===i.morphTargets&&o.bindAttribLocation(E,0,"position"),o.linkProgram(E);var L,P,C=o.getProgramInfoLog(E),I=o.getShaderInfoLog(A),O=o.getShaderInfoLog(R),U=!0,N=!0;return!1===o.getProgramParameter(E,o.LINK_STATUS)?(U=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(E,o.VALIDATE_STATUS),"gl.getProgramInfoLog",C,I,O)):""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==I&&""!==O||(N=!1),N&&(this.diagnostics={runnable:U,material:n,programLog:C,vertexShader:{log:I,prefix:p},fragmentShader:{log:O,prefix:m}}),o.deleteShader(A),o.deleteShader(R),this.getUniforms=function(){return void 0===L&&(L=new Pn(o,E,t)),L},this.getAttributes=function(){return void 0===P&&(P=function(t,e,n){for(var r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),o=0;o<i;o++){var a=t.getActiveAttrib(e,o).name;r[a]=t.getAttribLocation(e,a)}return r}(o,E)),P},this.destroy=function(){o.deleteProgram(E),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.id=fi++,this.code=e,this.usedTimes=1,this.program=E,this.vertexShader=A,this.fragmentShader=R,this}function bi(t,e){var n=[],r={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},i=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function o(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=ve,n===ve&&e&&(n=xe),n}this.getParameters=function(n,i,a,s,c,u){var l=r[n.type],h=u.isSkinnedMesh?function(t){var n=t.skeleton.bones;if(e.floatVertexTextures)return 1024;var r=e.maxVertexUniforms,i=Math.floor((r-20)/4),o=Math.min(i,n.length);return o<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+o+"."),0):o}(u):0,f=t.getPrecision();null!==n.precision&&(f=e.getMaxPrecision(n.precision))!==n.precision&&console.warn("THREE.WebGLProgram.getParameters:",n.precision,"not supported, using",f,"instead.");var d=t.getRenderTarget();return{shaderID:l,precision:f,supportsVertexTextures:e.vertexTextures,outputEncoding:o(d?d.texture:null,t.gammaOutput),map:!!n.map,mapEncoding:o(n.map,t.gammaInput),envMap:!!n.envMap,envMapMode:n.envMap&&n.envMap.mapping,envMapEncoding:o(n.envMap,t.gammaInput),envMapCubeUV:!!n.envMap&&(n.envMap.mapping===xt||n.envMap.mapping===_t),lightMap:!!n.lightMap,aoMap:!!n.aoMap,emissiveMap:!!n.emissiveMap,emissiveMapEncoding:o(n.emissiveMap,t.gammaInput),bumpMap:!!n.bumpMap,normalMap:!!n.normalMap,displacementMap:!!n.displacementMap,roughnessMap:!!n.roughnessMap,metalnessMap:!!n.metalnessMap,specularMap:!!n.specularMap,alphaMap:!!n.alphaMap,gradientMap:!!n.gradientMap,combine:n.combine,vertexColors:n.vertexColors,fog:!!a,useFog:n.fog,fogExp:a&&a.isFogExp2,flatShading:n.shading===E,sizeAttenuation:n.sizeAttenuation,logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:n.skinning&&h>0,maxBones:h,useVertexTexture:e.floatVertexTextures,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numClippingPlanes:s,numClipIntersection:c,dithering:n.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.receiveShadow&&i.shadows.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===M,flipSided:n.side===w,depthPacking:void 0!==n.depthPacking&&n.depthPacking}},this.getProgramCode=function(e,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var o in e.defines)r.push(o),r.push(e.defines[o]);for(var a=0;a<i.length;a++)r.push(n[i[a]]);return r.push(e.onBeforeCompile.toString()),r.push(t.gammaOutput),r.join()},this.acquireProgram=function(e,r,i,o){for(var a,s=0,c=n.length;s<c;s++){var u=n[s];if(u.code===o){++(a=u).usedTimes;break}}return void 0===a&&(a=new _i(t,o,e,r,i),n.push(a)),a},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=n.indexOf(t);n[e]=n[n.length-1],n.pop(),t.destroy()}},this.programs=n}function wi(t,e,n,r,i,o,a){var s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext;function c(t,e){if(t.width>e||t.height>e){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,t),r}return t}function u(t){return Ae.isPowerOfTwo(t.width)&&Ae.isPowerOfTwo(t.height)}function l(t,e){return t.generateMipmaps&&e&&t.minFilter!==Et&&t.minFilter!==At}function h(e){return e===Et||e===Tt||e===St?t.NEAREST:t.LINEAR}function f(e){var n=e.target;n.removeEventListener("dispose",f),function(e){var n=r.get(e);if(e.image&&n.__image__webglTextureCube)t.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture)}r.remove(e)}(n),a.textures--}function d(e){var n=e.target;n.removeEventListener("dispose",d),function(e){var n=r.get(e),i=r.get(e.texture);if(!e)return;void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);r.remove(e.texture),r.remove(e)}(n),a.textures--}function p(e,h){var d=r.get(e);if(e.version>0&&d.__version!==e.version){var p=e.image;if(void 0===p)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);else{if(!1!==p.complete)return void function(e,r,h){void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",f),e.__webglTexture=t.createTexture(),a.textures++);n.activeTexture(t.TEXTURE0+h),n.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment);var d=c(r.image,i.maxTextureSize);(function(t){return t.wrapS!==wt||t.wrapT!==wt||t.minFilter!==Et&&t.minFilter!==At})(r)&&!1===u(d)&&(d=function(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.width=Ae.nearestPowerOfTwo(t.width),e.height=Ae.nearestPowerOfTwo(t.height),e.getContext("2d").drawImage(t,0,0,e.width,e.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+e.width+"x"+e.height,t),e}return t}(d));var p=u(d),g=o(r.format),v=o(r.type);m(t.TEXTURE_2D,r,p);var y,x=r.mipmaps;if(r.isDepthTexture){var _=t.DEPTH_COMPONENT;if(r.type===Dt){if(!s)throw new Error("Float Depth Texture only supported in WebGL2.0");_=t.DEPTH_COMPONENT32F}else s&&(_=t.DEPTH_COMPONENT16);r.format===Yt&&_===t.DEPTH_COMPONENT&&r.type!==Ot&&r.type!==Nt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Ot,v=o(r.type)),r.format===Zt&&(_=t.DEPTH_STENCIL,r.type!==Ht&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ht,v=o(r.type))),n.texImage2D(t.TEXTURE_2D,0,_,d.width,d.height,0,g,v,null)}else if(r.isDataTexture)if(x.length>0&&p){for(var b=0,w=x.length;b<w;b++)y=x[b],n.texImage2D(t.TEXTURE_2D,b,g,y.width,y.height,0,g,v,y.data);r.generateMipmaps=!1}else n.texImage2D(t.TEXTURE_2D,0,g,d.width,d.height,0,g,v,d.data);else if(r.isCompressedTexture)for(var b=0,w=x.length;b<w;b++)y=x[b],r.format!==Vt&&r.format!==jt?n.getCompressedTextureFormats().indexOf(g)>-1?n.compressedTexImage2D(t.TEXTURE_2D,b,g,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(t.TEXTURE_2D,b,g,y.width,y.height,0,g,v,y.data);else if(x.length>0&&p){for(var b=0,w=x.length;b<w;b++)y=x[b],n.texImage2D(t.TEXTURE_2D,b,g,g,v,y);r.generateMipmaps=!1}else n.texImage2D(t.TEXTURE_2D,0,g,g,v,d);l(r,p)&&t.generateMipmap(t.TEXTURE_2D);e.__version=r.version,r.onUpdate&&r.onUpdate(r)}(d,e,h);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e)}}n.activeTexture(t.TEXTURE0+h),n.bindTexture(t.TEXTURE_2D,d.__webglTexture)}function m(n,a,s){var c;if(s?(t.texParameteri(n,t.TEXTURE_WRAP_S,o(a.wrapS)),t.texParameteri(n,t.TEXTURE_WRAP_T,o(a.wrapT)),t.texParameteri(n,t.TEXTURE_MAG_FILTER,o(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,o(a.minFilter))):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),a.wrapS===wt&&a.wrapT===wt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",a),t.texParameteri(n,t.TEXTURE_MAG_FILTER,h(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,h(a.minFilter)),a.minFilter!==Et&&a.minFilter!==At&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",a)),c=e.get("EXT_texture_filter_anisotropic")){if(a.type===Dt&&null===e.get("OES_texture_float_linear"))return;if(a.type===Ft&&null===e.get("OES_texture_half_float_linear"))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(t.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function g(e,i,a,s){var c=o(i.texture.format),u=o(i.texture.type);n.texImage2D(s,0,c,i.width,i.height,0,c,u,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,a,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function v(e,n){t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):n.depthBuffer&&n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,n.width,n.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function y(e){var n=r.get(e),i=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported!");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),p(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Yt)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,i,0);else{if(n.depthTexture.format!==Zt)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),v(n.__webglDepthbuffer[o],e)}else t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),v(n.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}this.setTexture2D=p,this.setTextureCube=function(e,s){var h=r.get(e);if(6===e.image.length)if(e.version>0&&h.__version!==e.version){h.__image__webglTextureCube||(e.addEventListener("dispose",f),h.__image__webglTextureCube=t.createTexture(),a.textures++),n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var d=e&&e.isCompressedTexture,p=e.image[0]&&e.image[0].isDataTexture,g=[],v=0;v<6;v++)g[v]=d||p?p?e.image[v].image:e.image[v]:c(e.image[v],i.maxCubemapSize);var y=u(g[0]),x=o(e.format),_=o(e.type);for(m(t.TEXTURE_CUBE_MAP,e,y),v=0;v<6;v++)if(d)for(var b,w=g[v].mipmaps,M=0,E=w.length;M<E;M++)b=w[M],e.format!==Vt&&e.format!==jt?n.getCompressedTextureFormats().indexOf(x)>-1?n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,M,x,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,M,x,b.width,b.height,0,x,_,b.data);else p?n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,g[v].width,g[v].height,0,x,_,g[v].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,x,_,g[v]);l(e,y)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),h.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube)},this.setTextureCubeDynamic=function(e,i){n.activeTexture(t.TEXTURE0+i),n.bindTexture(t.TEXTURE_CUBE_MAP,r.get(e).__webglTexture)},this.setupRenderTarget=function(e){var i=r.get(e),o=r.get(e.texture);e.addEventListener("dispose",d),o.__webglTexture=t.createTexture(),a.textures++;var s=!0===e.isWebGLRenderTargetCube,c=u(e);if(s){i.__webglFramebuffer=[];for(var h=0;h<6;h++)i.__webglFramebuffer[h]=t.createFramebuffer()}else i.__webglFramebuffer=t.createFramebuffer();if(s){for(n.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture),m(t.TEXTURE_CUBE_MAP,e.texture,c),h=0;h<6;h++)g(i.__webglFramebuffer[h],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+h);l(e.texture,c)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),n.bindTexture(t.TEXTURE_CUBE_MAP,null)}else n.bindTexture(t.TEXTURE_2D,o.__webglTexture),m(t.TEXTURE_2D,e.texture,c),g(i.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),l(e.texture,c)&&t.generateMipmap(t.TEXTURE_2D),n.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&y(e)},this.updateRenderTargetMipmap=function(e){var i=e.texture;if(l(i,u(e))){var o=e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=r.get(i).__webglTexture;n.bindTexture(o,a),t.generateMipmap(o),n.bindTexture(o,null)}}}function Mi(){var t={};return{get:function(e){var n=e.uuid,r=t[n];return void 0===r&&(r={},t[n]=r),r},remove:function(e){delete t[e.uuid]},clear:function(){t={}}}}function Ei(t,e,n){var r=new function(){var e=!1,n=new Fe,r=null,i=new Fe;return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,o,a,s){!0===s&&(e*=a,r*=a,o*=a),n.set(e,r,o,a),!1===i.equals(n)&&(t.clearColor(e,r,o,a),i.copy(n))},reset:function(){e=!1,r=null,i.set(0,0,0,1)}}},i=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(e){e?X(t.DEPTH_TEST):q(t.DEPTH_TEST)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case K:t.depthFunc(t.NEVER);break;case Q:t.depthFunc(t.ALWAYS);break;case $:t.depthFunc(t.LESS);break;case tt:t.depthFunc(t.LEQUAL);break;case et:t.depthFunc(t.EQUAL);break;case nt:t.depthFunc(t.GEQUAL);break;case rt:t.depthFunc(t.GREATER);break;case it:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},o=new function(){var e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null;return{setTest:function(e){e?X(t.STENCIL_TEST):q(t.STENCIL_TEST)},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&c===r||(t.stencilOp(e,n,r),a=e,s=n,c=r)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null}}},a=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),c=new Uint8Array(a),u=new Uint8Array(a),l={},h=null,m=null,g=null,v=null,y=null,x=null,_=null,b=null,E=!1,T=null,S=null,A=null,R=null,N=null,D=null,F=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),B=parseFloat(/^WebGL\ ([0-9])/.exec(t.getParameter(t.VERSION))[1]),z=parseFloat(B)>=1,G=null,H={},k=new Fe,j=new Fe;function V(e,n,r){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var a=0;a<r;a++)t.texImage2D(n+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i);return o}var W={};function X(e){!0!==l[e]&&(t.enable(e),l[e]=!0)}function q(e){!1!==l[e]&&(t.disable(e),l[e]=!1)}function Y(e,r,i,o,a,s,c,u){e!==L?X(t.BLEND):q(t.BLEND),e===U||e===m&&u===E||(e===C?u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)):e===I?u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR)):e===O?u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR)):u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)),m=e,E=u),e===U?(a=a||r,s=s||i,c=c||o,r===g&&a===x||(t.blendEquationSeparate(n(r),n(a)),g=r,x=a),i===v&&o===y&&s===_&&c===b||(t.blendFuncSeparate(n(i),n(o),n(s),n(c)),v=i,y=o,_=s,b=c)):(g=null,v=null,y=null,x=null,_=null,b=null)}function Z(e){T!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),T=e)}function J(e){e!==f?(X(t.CULL_FACE),e!==S&&(e===d?t.cullFace(t.BACK):e===p?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):q(t.CULL_FACE),S=e}function ot(e,n,r){e?(X(t.POLYGON_OFFSET_FILL),R===n&&N===r||(t.polygonOffset(n,r),R=n,N=r)):q(t.POLYGON_OFFSET_FILL)}function at(e){void 0===e&&(e=t.TEXTURE0+F-1),G!==e&&(t.activeTexture(e),G=e)}return W[t.TEXTURE_2D]=V(t.TEXTURE_2D,t.TEXTURE_2D,1),W[t.TEXTURE_CUBE_MAP]=V(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:r,depth:i,stencil:o},init:function(){r.setClear(0,0,0,1),i.setClear(1),o.setClear(0),X(t.DEPTH_TEST),i.setFunc(tt),Z(!1),J(d),X(t.CULL_FACE),X(t.BLEND),Y(P)},initAttributes:function(){for(var t=0,e=s.length;t<e;t++)s[t]=0},enableAttribute:function(n){s[n]=1,0===c[n]&&(t.enableVertexAttribArray(n),c[n]=1),0!==u[n]&&(e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,0),u[n]=0)},enableAttributeAndDivisor:function(n,r){s[n]=1,0===c[n]&&(t.enableVertexAttribArray(n),c[n]=1),u[n]!==r&&(e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,r),u[n]=r)},disableUnusedAttributes:function(){for(var e=0,n=c.length;e!==n;++e)c[e]!==s[e]&&(t.disableVertexAttribArray(e),c[e]=0)},enable:X,disable:q,getCompressedTextureFormats:function(){if(null===h&&(h=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var n=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),r=0;r<n.length;r++)h.push(n[r]);return h},setBlending:Y,setMaterial:function(e){e.side===M?q(t.CULL_FACE):X(t.CULL_FACE),Z(e.side===w),!0===e.transparent?Y(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha):Y(L),i.setFunc(e.depthFunc),i.setTest(e.depthTest),i.setMask(e.depthWrite),r.setMask(e.colorWrite),ot(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:Z,setCullFace:J,setLineWidth:function(e){e!==A&&(z&&t.lineWidth(e),A=e)},setPolygonOffset:ot,getScissorTest:function(){return D},setScissorTest:function(e){D=e,e?X(t.SCISSOR_TEST):q(t.SCISSOR_TEST)},activeTexture:at,bindTexture:function(e,n){null===G&&at();var r=H[G];void 0===r&&(r={type:void 0,texture:void 0},H[G]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||W[e]),r.type=e,r.texture=n)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===k.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),k.copy(e))},viewport:function(e){!1===j.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),j.copy(e))},reset:function(){for(var e=0;e<c.length;e++)1===c[e]&&(t.disableVertexAttribArray(e),c[e]=0);l={},h=null,G=null,H={},m=null,T=null,S=null,r.reset(),i.reset(),o.reset()}}}function Ti(t,e,n){var r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=void 0!==n.precision?n.precision:"highp",a=i(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);var s=!0===n.logarithmicDepthBuffer&&!!e.get("EXT_frag_depth"),c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_TEXTURE_SIZE),h=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),d=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),p=t.getParameter(t.MAX_VARYING_VECTORS),m=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),g=u>0,v=!!e.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:u,maxTextureSize:l,maxCubemapSize:h,maxAttributes:f,maxVertexUniforms:d,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:v,floatVertexTextures:g&&v}}function Si(t){pr.call(this),this.cameras=t||[]}function Ai(t){var e=this,n=null,r=null;"VRFrameData"in window&&(r=new window.VRFrameData);var i=new ke,o=new ke,a=new ke,s=new pr;s.bounds=new Fe(0,0,.5,1),s.layers.enable(1);var c=new pr;c.bounds=new Fe(.5,0,.5,1),c.layers.enable(2);var u,l,h=new Si([s,c]);h.layers.enable(1),h.layers.enable(2),window.addEventListener("vrdisplaypresentchange",function(){if(n.isPresenting){var r=n.getEyeParameters("left"),i=r.renderWidth,o=r.renderHeight;l=t.getPixelRatio(),u=t.getSize(),t.setDrawingBufferSize(2*i,o,1)}else e.enabled&&t.setDrawingBufferSize(u.width,u.height,l)},!1),this.enabled=!1,this.standing=!1,this.getDevice=function(){return n},this.setDevice=function(t){void 0!==t&&(n=t)},this.getCamera=function(t){if(null===n)return t;n.depthNear=t.near,n.depthFar=t.far,n.getFrameData(r);var e=r.pose;null!==e.position?t.position.fromArray(e.position):t.position.set(0,0,0),null!==e.orientation&&t.quaternion.fromArray(e.orientation),t.updateMatrixWorld();var u=n.stageParameters;if(this.standing&&u&&(o.fromArray(u.sittingToStandingTransform),a.getInverse(o),t.matrixWorld.multiply(o),t.matrixWorldInverse.multiply(a)),!1===n.isPresenting)return t;h.matrixWorld.copy(t.matrixWorld),h.matrixWorldInverse.copy(t.matrixWorldInverse),s.matrixWorldInverse.fromArray(r.leftViewMatrix),c.matrixWorldInverse.fromArray(r.rightViewMatrix),this.standing&&u&&(s.matrixWorldInverse.multiply(a),c.matrixWorldInverse.multiply(a));var l=t.parent;null!==l&&(i.getInverse(l.matrixWorld),s.matrixWorldInverse.multiply(i),c.matrixWorldInverse.multiply(i)),s.matrixWorld.getInverse(s.matrixWorldInverse),c.matrixWorld.getInverse(c.matrixWorldInverse),s.projectionMatrix.fromArray(r.leftProjectionMatrix),c.projectionMatrix.fromArray(r.rightProjectionMatrix),h.projectionMatrix.copy(s.projectionMatrix);var f=n.getLayers();if(f.length){var d=f[0];null!==d.leftBounds&&4===d.leftBounds.length&&s.bounds.fromArray(d.leftBounds),null!==d.rightBounds&&4===d.rightBounds.length&&c.bounds.fromArray(d.rightBounds)}return h},this.getStandingMatrix=function(){return o},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()}}function Ri(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=t.getExtension("WEBGL_compressed_texture_etc1");break;default:r=t.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=r,r}}}function Li(){var t=this,e=null,n=0,r=!1,i=!1,o=new tr,a=new $n,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(e,n,r,i){var c=null!==e?e.length:0,u=null;if(0!==c){if(u=s.value,!0!==i||null===u){var l=r+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===u||u.length<l)&&(u=new Float32Array(l));for(var f=0,d=r;f!==c;++f,d+=4)o.copy(e[f]).applyMatrix4(h,a),o.normal.toArray(u,d),u[d+3]=o.constant}s.value=u,s.needsUpdate=!0}return t.numPlanes=c,u}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,i,o){var a=0!==t.length||i||0!==n||r;return r=i,e=u(t,o,0),n=t.length,a},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1,c()},this.setState=function(t,o,a,l,h,f){if(!r||null===t||0===t.length||i&&!a)i?u(null):c();else{var d=i?0:n,p=4*d,m=h.clippingState||null;s.value=m,m=u(t,l,p,f);for(var g=0;g!==p;++g)m[g]=e[g];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=d}}}function Pi(t){console.log("THREE.WebGLRenderer",l);var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,r=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=[],h=null,f=new Float32Array(8),d=[],p=[];this.domElement=e,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=ut,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var m,v=this,y=null,x=null,_=null,b=-1,w="",M=null,T=null,A=new Fe,R=null,L=new Fe,P=0,C=e.width,I=e.height,O=1,U=new Fe(0,0,C,I),K=!1,Q=new Fe(0,0,C,I),$=new er,tt=new Li,et=!1,nt=!1,rt=new ke,it=new He,ot=new ke,at=new ke,st={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},ct={geometries:0,textures:0},lt={frame:0,calls:0,vertices:0,faces:0,points:0};this.info={render:lt,memory:ct,programs:null};try{var ht={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c};if(null===(m=n||e.getContext("webgl",ht)||e.getContext("experimental-webgl",ht)))throw null!==e.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),e.addEventListener("webglcontextlost",_e,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var ft=new Ri(m);ft.get("WEBGL_depth_texture"),ft.get("OES_texture_float"),ft.get("OES_texture_float_linear"),ft.get("OES_texture_half_float"),ft.get("OES_texture_half_float_linear"),ft.get("OES_standard_derivatives"),ft.get("ANGLE_instanced_arrays"),ft.get("OES_element_index_uint")&&(zr.MaxIndex=4294967296);var dt=new Ti(m,ft,t),pt=new Ei(m,ft,Oe),mt=new Mi,gt=new wi(m,ft,pt,mt,dt,Oe,ct),vt=new rr(m),yt=new ni(m,vt,ct),xt=new ii(m,yt,lt),_t=new bi(this,dt),qt=new ri,oe=new $r,ae=new Zr(this,pt,xt,s),se=new Ai(this);this.info.programs=_t.programs;var ce=new ei(m,ft,lt),ue=new ti(m,ft,lt);function le(){return null===x?O:1}function he(){pt.init(),pt.scissor(A.copy(U).multiplyScalar(O)),pt.viewport(L.copy(Q).multiplyScalar(O))}function fe(){y=null,M=null,w="",b=-1,pt.reset()}he(),this.context=m,this.capabilities=dt,this.extensions=ft,this.properties=mt,this.renderLists=oe,this.state=pt,this.vr=se;var de=new nr(this,st,xt,dt);this.shadowMap=de;var ve,ye=new zn(this,d),xe=new Bn(this,p);function _e(t){t.preventDefault(),fe(),he(),mt.clear(),xt.clear()}function be(t){var e=t.target;e.removeEventListener("dispose",be),function(t){we(t),mt.remove(t)}(e)}function we(t){var e=mt.get(t).program;t.program=void 0,void 0!==e&&_t.releaseProgram(e)}function Me(t,e){return Math.abs(e[0])-Math.abs(t[0])}function Ee(t,e,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i],s=a.object,c=a.geometry,u=void 0===r?a.material:r,l=a.group;if(n.isArrayCamera){T=n;for(var h=n.cameras,f=0,d=h.length;f<d;f++){var p=h[f];if(s.layers.test(p.layers)){var m=p.bounds,g=m.x*C,y=m.y*I,x=m.z*C,_=m.w*I;v.setViewport(g,y,x,_),v.setScissor(g,y,x,_),v.setScissorTest(!0),Te(s,e,p,c,u,l)}}}else T=null,Te(s,e,n,c,u,l)}}function Te(t,e,n,r,i,o){if(t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.onBeforeRender(v,e,n,r,i,o),t.isImmediateRenderObject){pt.setMaterial(i);var a=Re(n,e.fog,i,t);w="",function(t,e,n){t.render(function(t){v.renderBufferImmediate(t,e,n)})}(t,a,i)}else v.renderBufferDirect(n,e.fog,r,i,t,o);t.onAfterRender(v,e,n,r,i,o)}function Se(t,e,n){var r=mt.get(t),i=_t.getParameters(t,st,e,tt.numPlanes,tt.numIntersection,n),o=_t.getProgramCode(t,i),a=r.program,s=!0;if(void 0===a)t.addEventListener("dispose",be);else if(a.code!==o)we(t);else{if(void 0!==i.shaderID)return;s=!1}if(s){if(i.shaderID){var c=Dn[i.shaderID];r.shader={name:t.type,uniforms:Un.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}}else r.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(r.shader),a=_t.acquireProgram(t,r.shader,i,o),r.program=a,t.program=a}var u=a.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var l=0;l<v.maxMorphTargets;l++)u["morphTarget"+l]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(l=0;l<v.maxMorphNormals;l++)u["morphNormal"+l]>=0&&t.numSupportedMorphNormals++}var h=r.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=tt.numPlanes,r.numIntersection=tt.numIntersection,h.clippingPlanes=tt.uniform),r.fog=e,r.lightsHash=st.hash,t.lights&&(h.ambientLightColor.value=st.ambient,h.directionalLights.value=st.directional,h.spotLights.value=st.spot,h.rectAreaLights.value=st.rectArea,h.pointLights.value=st.point,h.hemisphereLights.value=st.hemi,h.directionalShadowMap.value=st.directionalShadowMap,h.directionalShadowMatrix.value=st.directionalShadowMatrix,h.spotShadowMap.value=st.spotShadowMap,h.spotShadowMatrix.value=st.spotShadowMatrix,h.pointShadowMap.value=st.pointShadowMap,h.pointShadowMatrix.value=st.pointShadowMatrix);var f=r.program.getUniforms(),d=Pn.seqWithValue(f.seq,h);r.uniformsList=d}function Re(t,e,n,r){P=0;var i=mt.get(n);if(et&&(nt||t!==M)){var o=t===M&&n.id===b;tt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,i,o)}!1===n.needsUpdate&&(void 0===i.program?n.needsUpdate=!0:n.fog&&i.fog!==e?n.needsUpdate=!0:n.lights&&i.lightsHash!==st.hash?n.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===tt.numPlanes&&i.numIntersection===tt.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(Se(n,e,r),n.needsUpdate=!1);var a,s,c=!1,u=!1,l=!1,h=i.program,f=h.getUniforms(),d=i.shader.uniforms;if(h.id!==y&&(m.useProgram(h.program),y=h.id,c=!0,u=!0,l=!0),n.id!==b&&(b=n.id,u=!0),c||t!==M){if(f.setValue(m,"projectionMatrix",t.projectionMatrix),dt.logarithmicDepthBuffer&&f.setValue(m,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),M!==(T||t)&&(M=T||t,u=!0,l=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var p=f.map.cameraPosition;void 0!==p&&p.setValue(m,it.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&f.setValue(m,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){f.setOptional(m,r,"bindMatrix"),f.setOptional(m,r,"bindMatrixInverse");var g=r.skeleton;if(g){var x=g.bones;if(dt.floatVertexTextures){if(void 0===g.boneTexture){var _=Math.sqrt(4*x.length);_=Ae.nextPowerOfTwo(Math.ceil(_)),_=Math.max(_,4);var w=new Float32Array(_*_*4);w.set(g.boneMatrices);var E=new je(w,_,_,Vt,Dt);g.boneMatrices=w,g.boneTexture=E,g.boneTextureSize=_}f.setValue(m,"boneTexture",g.boneTexture),f.setValue(m,"boneTextureSize",g.boneTextureSize)}else f.setOptional(m,g,"boneMatrices")}}return u&&(f.setValue(m,"toneMappingExposure",v.toneMappingExposure),f.setValue(m,"toneMappingWhitePoint",v.toneMappingWhitePoint),n.lights&&(s=l,(a=d).ambientLightColor.needsUpdate=s,a.directionalLights.needsUpdate=s,a.pointLights.needsUpdate=s,a.spotLights.needsUpdate=s,a.rectAreaLights.needsUpdate=s,a.hemisphereLights.needsUpdate=s),e&&n.fog&&function(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(d,e),(n.isMeshBasicMaterial||n.isMeshLambertMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isMeshNormalMaterial||n.isMeshDepthMaterial)&&function(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity);t.map.value=e.map,t.specularMap.value=e.specularMap,t.alphaMap.value=e.alphaMap,e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity);e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var n;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);if(void 0!==n){n.isWebGLRenderTarget&&(n=n.texture);var r=n.offset,i=n.repeat;t.offsetRepeat.value.set(r.x,r.y,i.x,i.y)}t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio}(d,n),n.isLineBasicMaterial?Le(d,n):n.isLineDashedMaterial?(Le(d,n),function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(d,n)):n.isPointsMaterial?function(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*O,t.scale.value=.5*I,t.map.value=e.map,null!==e.map){var n=e.map.offset,r=e.map.repeat;t.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}}(d,n):n.isMeshLambertMaterial?function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(d,n):n.isMeshToonMaterial?function(t,e){Pe(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(d,n):n.isMeshPhongMaterial?Pe(d,n):n.isMeshPhysicalMaterial?function(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,Ce(t,e)}(d,n):n.isMeshStandardMaterial?Ce(d,n):n.isMeshDepthMaterial?n.displacementMap&&(d.displacementMap.value=n.displacementMap,d.displacementScale.value=n.displacementScale,d.displacementBias.value=n.displacementBias):n.isMeshNormalMaterial&&function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale);e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale));e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(d,n),void 0!==d.ltcMat&&(d.ltcMat.value=On.LTC_MAT_TEXTURE),void 0!==d.ltcMag&&(d.ltcMag.value=On.LTC_MAG_TEXTURE),Pn.upload(m,i.uniformsList,d,v)),f.setValue(m,"modelViewMatrix",r.modelViewMatrix),f.setValue(m,"normalMatrix",r.normalMatrix),f.setValue(m,"modelMatrix",r.matrixWorld),h}function Le(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function Pe(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.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function Ce(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.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function Ie(t,e){var n,r,i,o,a,s,c,u,l=0,h=0,f=0,d=e.matrixWorldInverse,p=0,m=0,g=0,v=0,y=0;for(n=0,r=t.length;n<r;n++)if(a=(i=t[n]).color,s=i.intensity,c=i.distance,u=i.shadow&&i.shadow.map?i.shadow.map.texture:null,i.isAmbientLight)l+=a.r*s,h+=a.g*s,f+=a.b*s;else if(i.isDirectionalLight){(x=qt.get(i)).color.copy(i.color).multiplyScalar(i.intensity),x.direction.setFromMatrixPosition(i.matrixWorld),it.setFromMatrixPosition(i.target.matrixWorld),x.direction.sub(it),x.direction.transformDirection(d),x.shadow=i.castShadow,i.castShadow&&(o=i.shadow,x.shadowBias=o.bias,x.shadowRadius=o.radius,x.shadowMapSize=o.mapSize),st.directionalShadowMap[p]=u,st.directionalShadowMatrix[p]=i.shadow.matrix,st.directional[p]=x,p++}else if(i.isSpotLight){(x=qt.get(i)).position.setFromMatrixPosition(i.matrixWorld),x.position.applyMatrix4(d),x.color.copy(a).multiplyScalar(s),x.distance=c,x.direction.setFromMatrixPosition(i.matrixWorld),it.setFromMatrixPosition(i.target.matrixWorld),x.direction.sub(it),x.direction.transformDirection(d),x.coneCos=Math.cos(i.angle),x.penumbraCos=Math.cos(i.angle*(1-i.penumbra)),x.decay=0===i.distance?0:i.decay,x.shadow=i.castShadow,i.castShadow&&(o=i.shadow,x.shadowBias=o.bias,x.shadowRadius=o.radius,x.shadowMapSize=o.mapSize),st.spotShadowMap[g]=u,st.spotShadowMatrix[g]=i.shadow.matrix,st.spot[g]=x,g++}else if(i.isRectAreaLight){(x=qt.get(i)).color.copy(a).multiplyScalar(s/(i.width*i.height)),x.position.setFromMatrixPosition(i.matrixWorld),x.position.applyMatrix4(d),at.identity(),ot.copy(i.matrixWorld),ot.premultiply(d),at.extractRotation(ot),x.halfWidth.set(.5*i.width,0,0),x.halfHeight.set(0,.5*i.height,0),x.halfWidth.applyMatrix4(at),x.halfHeight.applyMatrix4(at),st.rectArea[v]=x,v++}else if(i.isPointLight){(x=qt.get(i)).position.setFromMatrixPosition(i.matrixWorld),x.position.applyMatrix4(d),x.color.copy(i.color).multiplyScalar(i.intensity),x.distance=i.distance,x.decay=0===i.distance?0:i.decay,x.shadow=i.castShadow,i.castShadow&&(o=i.shadow,x.shadowBias=o.bias,x.shadowRadius=o.radius,x.shadowMapSize=o.mapSize),st.pointShadowMap[m]=u,st.pointShadowMatrix[m]=i.shadow.matrix,st.point[m]=x,m++}else if(i.isHemisphereLight){var x;(x=qt.get(i)).direction.setFromMatrixPosition(i.matrixWorld),x.direction.transformDirection(d),x.direction.normalize(),x.skyColor.copy(i.color).multiplyScalar(s),x.groundColor.copy(i.groundColor).multiplyScalar(s),st.hemi[y]=x,y++}st.ambient[0]=l,st.ambient[1]=h,st.ambient[2]=f,st.directional.length=p,st.spot.length=g,st.rectArea.length=v,st.point.length=m,st.hemi.length=y,st.hash=p+","+m+","+g+","+v+","+y+","+st.shadows.length}function Oe(t){var e;if(t===bt)return m.REPEAT;if(t===wt)return m.CLAMP_TO_EDGE;if(t===Mt)return m.MIRRORED_REPEAT;if(t===Et)return m.NEAREST;if(t===Tt)return m.NEAREST_MIPMAP_NEAREST;if(t===St)return m.NEAREST_MIPMAP_LINEAR;if(t===At)return m.LINEAR;if(t===Rt)return m.LINEAR_MIPMAP_NEAREST;if(t===Lt)return m.LINEAR_MIPMAP_LINEAR;if(t===Pt)return m.UNSIGNED_BYTE;if(t===Bt)return m.UNSIGNED_SHORT_4_4_4_4;if(t===zt)return m.UNSIGNED_SHORT_5_5_5_1;if(t===Gt)return m.UNSIGNED_SHORT_5_6_5;if(t===Ct)return m.BYTE;if(t===It)return m.SHORT;if(t===Ot)return m.UNSIGNED_SHORT;if(t===Ut)return m.INT;if(t===Nt)return m.UNSIGNED_INT;if(t===Dt)return m.FLOAT;if(t===Ft&&null!==(e=ft.get("OES_texture_half_float")))return e.HALF_FLOAT_OES;if(t===kt)return m.ALPHA;if(t===jt)return m.RGB;if(t===Vt)return m.RGBA;if(t===Wt)return m.LUMINANCE;if(t===Xt)return m.LUMINANCE_ALPHA;if(t===Yt)return m.DEPTH_COMPONENT;if(t===Zt)return m.DEPTH_STENCIL;if(t===N)return m.FUNC_ADD;if(t===D)return m.FUNC_SUBTRACT;if(t===F)return m.FUNC_REVERSE_SUBTRACT;if(t===G)return m.ZERO;if(t===H)return m.ONE;if(t===k)return m.SRC_COLOR;if(t===j)return m.ONE_MINUS_SRC_COLOR;if(t===V)return m.SRC_ALPHA;if(t===W)return m.ONE_MINUS_SRC_ALPHA;if(t===X)return m.DST_ALPHA;if(t===q)return m.ONE_MINUS_DST_ALPHA;if(t===Y)return m.DST_COLOR;if(t===Z)return m.ONE_MINUS_DST_COLOR;if(t===J)return m.SRC_ALPHA_SATURATE;if((t===Jt||t===Kt||t===Qt||t===$t)&&null!==(e=ft.get("WEBGL_compressed_texture_s3tc"))){if(t===Jt)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Kt)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Qt)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===$t)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===te||t===ee||t===ne||t===re)&&null!==(e=ft.get("WEBGL_compressed_texture_pvrtc"))){if(t===te)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ee)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===ne)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===re)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===ie&&null!==(e=ft.get("WEBGL_compressed_texture_etc1")))return e.COMPRESSED_RGB_ETC1_WEBGL;if((t===B||t===z)&&null!==(e=ft.get("EXT_blend_minmax"))){if(t===B)return e.MIN_EXT;if(t===z)return e.MAX_EXT}return t===Ht&&null!==(e=ft.get("WEBGL_depth_texture"))?e.UNSIGNED_INT_24_8_WEBGL:0}this.getContext=function(){return m},this.getContextAttributes=function(){return m.getContextAttributes()},this.forceContextLoss=function(){var t=ft.get("WEBGL_lose_context");t&&t.loseContext()},this.getMaxAnisotropy=function(){return dt.getMaxAnisotropy()},this.getPrecision=function(){return dt.precision},this.getPixelRatio=function(){return O},this.setPixelRatio=function(t){void 0!==t&&(O=t,this.setSize(C,I,!1))},this.getSize=function(){return{width:C,height:I}},this.setSize=function(t,n,r){var i=se.getDevice();i&&i.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(C=t,I=n,e.width=t*O,e.height=n*O,!1!==r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(){return{width:C*O,height:I*O}},this.setDrawingBufferSize=function(t,n,r){C=t,I=n,O=r,e.width=t*r,e.height=n*r,this.setViewport(0,0,t,n)},this.setViewport=function(t,e,n,r){Q.set(t,I-e-r,n,r),pt.viewport(L.copy(Q).multiplyScalar(O))},this.setScissor=function(t,e,n,r){U.set(t,I-e-r,n,r),pt.scissor(A.copy(U).multiplyScalar(O))},this.setScissorTest=function(t){pt.setScissorTest(K=t)},this.getClearColor=ae.getClearColor,this.setClearColor=ae.setClearColor,this.getClearAlpha=ae.getClearAlpha,this.setClearAlpha=ae.setClearAlpha,this.clear=function(t,e,n){var r=0;(void 0===t||t)&&(r|=m.COLOR_BUFFER_BIT),(void 0===e||e)&&(r|=m.DEPTH_BUFFER_BIT),(void 0===n||n)&&(r|=m.STENCIL_BUFFER_BIT),m.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.clearTarget=function(t,e,n,r){this.setRenderTarget(t),this.clear(e,n,r)},this.resetGLState=fe,this.dispose=function(){e.removeEventListener("webglcontextlost",_e,!1),oe.dispose()},this.renderBufferImmediate=function(t,e,n){pt.initAttributes();var r=mt.get(t);t.hasPositions&&!r.position&&(r.position=m.createBuffer()),t.hasNormals&&!r.normal&&(r.normal=m.createBuffer()),t.hasUvs&&!r.uv&&(r.uv=m.createBuffer()),t.hasColors&&!r.color&&(r.color=m.createBuffer());var i=e.getAttributes();if(t.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,r.position),m.bufferData(m.ARRAY_BUFFER,t.positionArray,m.DYNAMIC_DRAW),pt.enableAttribute(i.position),m.vertexAttribPointer(i.position,3,m.FLOAT,!1,0,0)),t.hasNormals){if(m.bindBuffer(m.ARRAY_BUFFER,r.normal),!n.isMeshPhongMaterial&&!n.isMeshStandardMaterial&&!n.isMeshNormalMaterial&&n.shading===E)for(var o=0,a=3*t.count;o<a;o+=9){var s=t.normalArray,c=(s[o+0]+s[o+3]+s[o+6])/3,u=(s[o+1]+s[o+4]+s[o+7])/3,l=(s[o+2]+s[o+5]+s[o+8])/3;s[o+0]=c,s[o+1]=u,s[o+2]=l,s[o+3]=c,s[o+4]=u,s[o+5]=l,s[o+6]=c,s[o+7]=u,s[o+8]=l}m.bufferData(m.ARRAY_BUFFER,t.normalArray,m.DYNAMIC_DRAW),pt.enableAttribute(i.normal),m.vertexAttribPointer(i.normal,3,m.FLOAT,!1,0,0)}t.hasUvs&&n.map&&(m.bindBuffer(m.ARRAY_BUFFER,r.uv),m.bufferData(m.ARRAY_BUFFER,t.uvArray,m.DYNAMIC_DRAW),pt.enableAttribute(i.uv),m.vertexAttribPointer(vt.uv,2,m.FLOAT,!1,0,0)),t.hasColors&&n.vertexColors!==S&&(m.bindBuffer(m.ARRAY_BUFFER,r.color),m.bufferData(m.ARRAY_BUFFER,t.colorArray,m.DYNAMIC_DRAW),pt.enableAttribute(i.color),m.vertexAttribPointer(i.color,3,m.FLOAT,!1,0,0)),pt.disableUnusedAttributes(),m.drawArrays(m.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,r,i,o){pt.setMaterial(r);var a=Re(t,e,r,i),s=n.id+"_"+a.id+"_"+(!0===r.wireframe),c=!1;s!==w&&(w=s,c=!0);var u=i.morphTargetInfluences;if(void 0!==u){for(var l=[],h=0,d=u.length;h<d;h++){var p=u[h];l.push([p,h])}l.sort(Me),l.length>8&&(l.length=8);var g=n.morphAttributes;for(h=0,d=l.length;h<d;h++){p=l[h];if(f[h]=p[0],0!==p[0]){var v=p[1];!0===r.morphTargets&&g.position&&n.addAttribute("morphTarget"+h,g.position[v]),!0===r.morphNormals&&g.normal&&n.addAttribute("morphNormal"+h,g.normal[v])}else!0===r.morphTargets&&n.removeAttribute("morphTarget"+h),!0===r.morphNormals&&n.removeAttribute("morphNormal"+h)}h=l.length;for(var y=f.length;h<y;h++)f[h]=0;a.getUniforms().setValue(m,"morphTargetInfluences",f),c=!0}v=n.index;var x,_=n.attributes.position,b=1;!0===r.wireframe&&(v=yt.getWireframeAttribute(n),b=2);var M=ce;null!==v&&(x=vt.get(v),(M=ue).setIndex(x)),c&&(!function(t,e,n,r){if(n&&n.isInstancedBufferGeometry&&null===ft.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0);pt.initAttributes();var i=n.attributes,o=e.getAttributes(),a=t.defaultAttributeValues;for(var s in o){var c=o[s];if(c>=0){var u=i[s];if(void 0!==u){var l=u.normalized,h=u.itemSize,f=vt.get(u),d=f.buffer,p=f.type,g=f.bytesPerElement;if(u.isInterleavedBufferAttribute){var v=u.data,y=v.stride,x=u.offset;v&&v.isInstancedInterleavedBuffer?(pt.enableAttributeAndDivisor(c,v.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=v.meshPerAttribute*v.count)):pt.enableAttribute(c),m.bindBuffer(m.ARRAY_BUFFER,d),m.vertexAttribPointer(c,h,p,l,y*g,(r*y+x)*g)}else u.isInstancedBufferAttribute?(pt.enableAttributeAndDivisor(c,u.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=u.meshPerAttribute*u.count)):pt.enableAttribute(c),m.bindBuffer(m.ARRAY_BUFFER,d),m.vertexAttribPointer(c,h,p,l,0,r*h*g)}else if(void 0!==a){var _=a[s];if(void 0!==_)switch(_.length){case 2:m.vertexAttrib2fv(c,_);break;case 3:m.vertexAttrib3fv(c,_);break;case 4:m.vertexAttrib4fv(c,_);break;default:m.vertexAttrib1fv(c,_)}}}}pt.disableUnusedAttributes()}(r,a,n),null!==v&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,x.buffer));var E=0;null!==v?E=v.count:void 0!==_&&(E=_.count);var T=n.drawRange.start*b,S=n.drawRange.count*b,A=null!==o?o.start*b:0,R=null!==o?o.count*b:1/0,L=Math.max(T,A),P=Math.min(E,T+S,A+R)-1,C=Math.max(0,P-L+1);if(0!==C){if(i.isMesh)if(!0===r.wireframe)pt.setLineWidth(r.wireframeLinewidth*le()),M.setMode(m.LINES);else switch(i.drawMode){case pe:M.setMode(m.TRIANGLES);break;case me:M.setMode(m.TRIANGLE_STRIP);break;case ge:M.setMode(m.TRIANGLE_FAN)}else if(i.isLine){var I=r.linewidth;void 0===I&&(I=1),pt.setLineWidth(I*le()),i.isLineSegments?M.setMode(m.LINES):i.isLineLoop?M.setMode(m.LINE_LOOP):M.setMode(m.LINE_STRIP)}else i.isPoints&&M.setMode(m.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&M.renderInstances(n,L,C):M.render(L,C)}},this.compile=function(t,e){u=[],t.traverse(function(t){t.isLight&&u.push(t)}),Ie(u,e),t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)Se(e.material[n],t.fog,e);else Se(e.material,t.fog,e)})},this.animate=function(t){(se.getDevice()||window).requestAnimationFrame(function e(){t(),(se.getDevice()||window).requestAnimationFrame(e)})},this.render=function(t,e,n,r){if(e&&e.isCamera){w="",b=-1,M=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),se.enabled&&(e=se.getCamera(e)),rt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),$.setFromMatrix(rt),u.length=0,d.length=0,p.length=0,nt=this.localClippingEnabled,et=tt.init(this.clippingPlanes,nt,e),(h=oe.get(t,e)).init(),function t(e,n,r){if(!e.visible)return;var i=e.layers.test(n.layers);if(i)if(e.isLight)u.push(e);else if(e.isSprite)e.frustumCulled&&!$.intersectsSprite(e)||d.push(e);else if(e.isLensFlare)p.push(e);else if(e.isImmediateRenderObject)r&&it.setFromMatrixPosition(e.matrixWorld).applyMatrix4(rt),h.push(e,null,e.material,it.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||$.intersectsObject(e))){r&&it.setFromMatrixPosition(e.matrixWorld).applyMatrix4(rt);var o=xt.update(e),a=e.material;if(Array.isArray(a))for(var s=o.groups,c=0,l=s.length;c<l;c++){var f=s[c],m=a[f.materialIndex];m&&m.visible&&h.push(e,o,m,it.z,f)}else a.visible&&h.push(e,o,a,it.z,null)}var g=e.children;for(var c=0,l=g.length;c<l;c++)t(g[c],n,r)}(t,e,v.sortObjects),h.finish(),!0===v.sortObjects&&h.sort(),et&&tt.beginShadows(),function(t){for(var e=0,n=0,r=t.length;n<r;n++){var i=t[n];i.castShadow&&(st.shadows[e]=i,e++)}st.shadows.length=e}(u),de.render(t,e),Ie(u,e),et&&tt.endShadows(),lt.frame++,lt.calls=0,lt.vertices=0,lt.faces=0,lt.points=0,void 0===n&&(n=null),this.setRenderTarget(n),ae.render(t,e,r);var i=h.opaque,o=h.transparent;if(t.overrideMaterial){var a=t.overrideMaterial;i.length&&Ee(i,t,e,a),o.length&&Ee(o,t,e,a)}else i.length&&Ee(i,t,e),o.length&&Ee(o,t,e);ye.render(t,e),xe.render(t,e,L),n&&gt.updateRenderTargetMipmap(n),pt.buffers.depth.setTest(!0),pt.buffers.depth.setMask(!0),pt.buffers.color.setMask(!0),e.isArrayCamera&&v.setScissorTest(!1),se.enabled&&se.submitFrame()}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFaceCulling=function(t,e){pt.setCullFace(t),pt.setFlipSided(e===g)},this.allocTextureUnit=function(){var t=P;return t>=dt.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+dt.maxTextures),P+=1,t},this.setTexture2D=(ve=!1,function(t,e){t&&t.isWebGLRenderTarget&&(ve||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),ve=!0),t=t.texture),gt.setTexture2D(t,e)}),this.setTexture=function(){var t=!1;return function(e,n){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),gt.setTexture2D(e,n)}}(),this.setTextureCube=function(){var t=!1;return function(e,n){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?gt.setTextureCube(e,n):gt.setTextureCubeDynamic(e,n)}}(),this.getRenderTarget=function(){return x},this.setRenderTarget=function(t){x=t,t&&void 0===mt.get(t).__webglFramebuffer&&gt.setupRenderTarget(t);var e,n=t&&t.isWebGLRenderTargetCube;if(t){var r=mt.get(t);e=n?r.__webglFramebuffer[t.activeCubeFace]:r.__webglFramebuffer,A.copy(t.scissor),R=t.scissorTest,L.copy(t.viewport)}else e=null,A.copy(U).multiplyScalar(O),R=K,L.copy(Q).multiplyScalar(O);if(_!==e&&(m.bindFramebuffer(m.FRAMEBUFFER,e),_=e),pt.scissor(A),pt.setScissorTest(R),pt.viewport(L),n){var i=mt.get(t.texture);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,i.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,n,r,i,o){if(t&&t.isWebGLRenderTarget){var a=mt.get(t).__webglFramebuffer;if(a){var s=!1;a!==_&&(m.bindFramebuffer(m.FRAMEBUFFER,a),s=!0);try{var c=t.texture,u=c.format,l=c.type;if(u!==Vt&&Oe(u)!==m.getParameter(m.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===Pt||Oe(l)===m.getParameter(m.IMPLEMENTATION_COLOR_READ_TYPE)||l===Dt&&(ft.get("OES_texture_float")||ft.get("WEBGL_color_buffer_float"))||l===Ft&&ft.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");m.checkFramebufferStatus(m.FRAMEBUFFER)===m.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&m.readPixels(e,n,r,i,Oe(u),Oe(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&m.bindFramebuffer(m.FRAMEBUFFER,_)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")}}function Ci(t,e){this.name="",this.color=new In(t),this.density=void 0!==e?e:25e-5}function Ii(t,e,n){this.name="",this.color=new In(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Oi(){hr.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Ui(t,e,n,r,i){hr.call(this),this.lensFlares=[],this.positionScreen=new He,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,n,r,i)}function Ni(t){Yn.call(this),this.type="SpriteMaterial",this.color=new In(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(t)}function Di(t){hr.call(this),this.type="Sprite",this.material=void 0!==t?t:new Ni}function Fi(){hr.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Bi(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 ke)}}function zi(){hr.call(this),this.type="Bone"}function Gi(t,e){Yr.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new ke,this.bindMatrixInverse=new ke;var n=new Bi(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function Hi(t){Yn.call(this),this.type="LineBasicMaterial",this.color=new In(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function ki(t,e,n){if(1===n)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new ji(t,e);hr.call(this),this.type="Line",this.geometry=void 0!==t?t:new zr,this.material=void 0!==e?e:new Hi({color:16777215*Math.random()})}function ji(t,e){ki.call(this,t,e),this.type="LineSegments"}function Vi(t,e){ki.call(this,t,e),this.type="LineLoop"}function Wi(t){Yn.call(this),this.type="PointsMaterial",this.color=new In(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(t)}function Xi(t,e){hr.call(this),this.type="Points",this.geometry=void 0!==t?t:new zr,this.material=void 0!==e?e:new Wi({color:16777215*Math.random()})}function qi(){hr.call(this),this.type="Group"}function Yi(t,e,n,r,i,o,a,s,c){De.call(this,t,e,n,r,i,o,a,s,c),this.generateMipmaps=!1;var u=this;!function e(){requestAnimationFrame(e),t.readyState>=t.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}()}function Zi(t,e,n,r,i,o,a,s,c,u,l,h){De.call(this,null,o,a,s,c,u,r,i,l,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Ji(t,e,n,r,i,o,a,s,c){De.call(this,t,e,n,r,i,o,a,s,c),this.needsUpdate=!0}function Ki(t,e,n,r,i,o,a,s,c,u){if((u=void 0!==u?u:Yt)!==Yt&&u!==Zt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Yt&&(n=Ot),void 0===n&&u===Zt&&(n=Ht),De.call(this,null,r,i,o,a,s,u,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:Et,this.minFilter=void 0!==s?s:Et,this.flipY=!1,this.generateMipmaps=!1}function Qi(t){zr.call(this),this.type="WireframeGeometry";var e,n,r,i,o,a,s,c,u,l,h=[],f=[0,0],d={},p=["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[p[n]],c=g[p[(n+1)%3]],f[0]=Math.min(s,c),f[1]=Math.max(s,c),void 0===d[u=f[0]+","+f[1]]&&(d[u]={index1:f[0],index2:f[1]})}for(u in d)a=d[u],l=t.vertices[a.index1],h.push(l.x,l.y,l.z),l=t.vertices[a.index2],h.push(l.x,l.y,l.z)}else if(t&&t.isBufferGeometry){var v,y,x,_,b,w,M;if(l=new He,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,o=x.length;i<o;++i)for(e=b=(_=x[i]).start,r=b+_.count;e<r;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),c=y.getX(e+(n+1)%3),f[0]=Math.min(s,c),f[1]=Math.max(s,c),void 0===d[u=f[0]+","+f[1]]&&(d[u]={index1:f[0],index2:f[1]});for(u in d)a=d[u],l.fromBufferAttribute(v,a.index1),h.push(l.x,l.y,l.z),l.fromBufferAttribute(v,a.index2),h.push(l.x,l.y,l.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,l.fromBufferAttribute(v,w),h.push(l.x,l.y,l.z),M=3*e+(n+1)%3,l.fromBufferAttribute(v,M),h.push(l.x,l.y,l.z)}this.addAttribute("position",new Nr(h,3))}function $i(t,e,n){Sr.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new to(t,e,n)),this.mergeVertices()}function to(t,e,n){zr.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var r,i,o=[],a=[],s=[],c=[],u=new He,l=new He,h=new He,f=new He,d=new He,p=e+1;for(r=0;r<=n;r++){var m=r/n;for(i=0;i<=e;i++){var g=i/e;l=t(g,m,l),a.push(l.x,l.y,l.z),g-1e-5>=0?(h=t(g-1e-5,m,h),f.subVectors(l,h)):(h=t(g+1e-5,m,h),f.subVectors(h,l)),m-1e-5>=0?(h=t(g,m-1e-5,h),d.subVectors(l,h)):(h=t(g,m+1e-5,h),d.subVectors(h,l)),u.crossVectors(f,d).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*p+i,y=r*p+i+1,x=(r+1)*p+i+1,_=(r+1)*p+i;o.push(v,y,_),o.push(y,x,_)}this.setIndex(o),this.addAttribute("position",new Nr(a,3)),this.addAttribute("normal",new Nr(s,3)),this.addAttribute("uv",new Nr(c,2))}function eo(t,e,n,r){Sr.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},this.fromBufferGeometry(new no(t,e,n,r)),this.mergeVertices()}function no(t,e,n,r){zr.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1;var i=[],o=[];function a(t,e,n,r){var i,o,a=Math.pow(2,r),c=[];for(i=0;i<=a;i++){c[i]=[];var u=t.clone().lerp(n,i/a),l=e.clone().lerp(n,i/a),h=a-i;for(o=0;o<=h;o++)c[i][o]=0===o&&i===a?u:u.clone().lerp(l,o/h)}for(i=0;i<a;i++)for(o=0;o<2*(a-i)-1;o++){var f=Math.floor(o/2);o%2==0?(s(c[i][f+1]),s(c[i+1][f]),s(c[i][f])):(s(c[i][f+1]),s(c[i+1][f+1]),s(c[i+1][f]))}}function s(t){i.push(t.x,t.y,t.z)}function c(e,n){var r=3*e;n.x=t[r+0],n.y=t[r+1],n.z=t[r+2]}function u(t,e,n,r){r<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=r/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}!function(t){for(var n=new He,r=new He,i=new He,o=0;o<e.length;o+=3)c(e[o+0],n),c(e[o+1],r),c(e[o+2],i),a(n,r,i,t)}(r=r||0),function(t){for(var e=new He,n=0;n<i.length;n+=3)e.x=i[n+0],e.y=i[n+1],e.z=i[n+2],e.normalize().multiplyScalar(t),i[n+0]=e.x,i[n+1]=e.y,i[n+2]=e.z}(n),function(){for(var t=new He,e=0;e<i.length;e+=3){t.x=i[e+0],t.y=i[e+1],t.z=i[e+2];var n=l(t)/2/Math.PI+.5,r=(a=t,Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5);o.push(n,1-r)}var a;(function(){for(var t=new He,e=new He,n=new He,r=new He,a=new Re,s=new Re,c=new Re,h=0,f=0;h<i.length;h+=9,f+=6){t.set(i[h+0],i[h+1],i[h+2]),e.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),a.set(o[f+0],o[f+1]),s.set(o[f+2],o[f+3]),c.set(o[f+4],o[f+5]),r.copy(t).add(e).add(n).divideScalar(3);var d=l(r);u(a,f+0,t,d),u(s,f+2,e,d),u(c,f+4,n,d)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],r=o[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);i>.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),r<.2&&(o[t+4]+=1))}}()}(),this.addAttribute("position",new Nr(i,3)),this.addAttribute("normal",new Nr(i.slice(),3)),this.addAttribute("uv",new Nr(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function ro(t,e){Sr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new io(t,e)),this.mergeVertices()}function io(t,e){no.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 oo(t,e){Sr.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ao(t,e)),this.mergeVertices()}function ao(t,e){no.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 so(t,e){Sr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new co(t,e)),this.mergeVertices()}function co(t,e){var n=(1+Math.sqrt(5))/2,r=[-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];no.call(this,r,[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 uo(t,e){Sr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new lo(t,e)),this.mergeVertices()}function lo(t,e){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-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];no.call(this,i,[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 ho(t,e,n,r,i,o){Sr.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new fo(t,e,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function fo(t,e,n,r,i){zr.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},e=e||64,n=n||1,r=r||8,i=i||!1;var o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new He,u=new He,l=new Re,h=[],f=[],d=[],p=[];function m(i){var a=t.getPointAt(i/e),l=o.normals[i],d=o.binormals[i];for(s=0;s<=r;s++){var p=s/r*Math.PI*2,m=Math.sin(p),g=-Math.cos(p);u.x=g*l.x+m*d.x,u.y=g*l.y+m*d.y,u.z=g*l.z+m*d.z,u.normalize(),f.push(u.x,u.y,u.z),c.x=a.x+n*u.x,c.y=a.y+n*u.y,c.z=a.z+n*u.z,h.push(c.x,c.y,c.z)}}!function(){for(a=0;a<e;a++)m(a);m(!1===i?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=r;s++)l.x=a/e,l.y=s/r,d.push(l.x,l.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=r;a++){var t=(r+1)*(s-1)+(a-1),n=(r+1)*s+(a-1),i=(r+1)*s+a,o=(r+1)*(s-1)+a;p.push(t,n,o),p.push(n,i,o)}}()}(),this.setIndex(p),this.addAttribute("position",new Nr(h,3)),this.addAttribute("normal",new Nr(f,3)),this.addAttribute("uv",new Nr(d,2))}function po(t,e,n,r,i,o,a){Sr.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new mo(t,e,n,r,i,o)),this.mergeVertices()}function mo(t,e,n,r,i,o){zr.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},t=t||100,e=e||40,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,o=o||3;var a,s,c=[],u=[],l=[],h=[],f=new He,d=new He,p=new He,m=new He,g=new He,v=new He,y=new He;for(a=0;a<=n;++a){var x=a/n*i*Math.PI*2;for(A(x,i,o,t,p),A(x+.01,i,o,t,m),v.subVectors(m,p),y.addVectors(m,p),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=r;++s){var _=s/r*Math.PI*2,b=-e*Math.cos(_),w=e*Math.sin(_);f.x=p.x+(b*y.x+w*g.x),f.y=p.y+(b*y.y+w*g.y),f.z=p.z+(b*y.z+w*g.z),u.push(f.x,f.y,f.z),d.subVectors(f,p).normalize(),l.push(d.x,d.y,d.z),h.push(a/n),h.push(s/r)}}for(s=1;s<=n;s++)for(a=1;a<=r;a++){var M=(r+1)*(s-1)+(a-1),E=(r+1)*s+(a-1),T=(r+1)*s+a,S=(r+1)*(s-1)+a;c.push(M,E,S),c.push(E,T,S)}function A(t,e,n,r,i){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,c=Math.cos(s);i.x=r*(2+c)*.5*o,i.y=r*(2+c)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new Nr(u,3)),this.addAttribute("normal",new Nr(l,3)),this.addAttribute("uv",new Nr(h,2))}function go(t,e,n,r,i){Sr.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new vo(t,e,n,r,i)),this.mergeVertices()}function vo(t,e,n,r,i){zr.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||100,e=e||40,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var o,a,s=[],c=[],u=[],l=[],h=new He,f=new He,d=new He;for(o=0;o<=n;o++)for(a=0;a<=r;a++){var p=a/r*i,m=o/n*Math.PI*2;f.x=(t+e*Math.cos(m))*Math.cos(p),f.y=(t+e*Math.cos(m))*Math.sin(p),f.z=e*Math.sin(m),c.push(f.x,f.y,f.z),h.x=t*Math.cos(p),h.y=t*Math.sin(p),d.subVectors(f,h).normalize(),u.push(d.x,d.y,d.z),l.push(a/r),l.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=r;a++){var g=(r+1)*o+a-1,v=(r+1)*(o-1)+a-1,y=(r+1)*(o-1)+a,x=(r+1)*o+a;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.addAttribute("position",new Nr(c,3)),this.addAttribute("normal",new Nr(u,3)),this.addAttribute("uv",new Nr(l,2))}Si.prototype=Object.assign(Object.create(pr.prototype),{constructor:Si,isArrayCamera:!0}),Ci.prototype.isFogExp2=!0,Ci.prototype.clone=function(){return new Ci(this.color.getHex(),this.density)},Ci.prototype.toJSON=function(t){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Ii.prototype.isFog=!0,Ii.prototype.clone=function(){return new Ii(this.color.getHex(),this.near,this.far)},Ii.prototype.toJSON=function(t){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Oi.prototype=Object.assign(Object.create(hr.prototype),{constructor:Oi,copy:function(t,e){return hr.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=hr.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}}),Ui.prototype=Object.assign(Object.create(hr.prototype),{constructor:Ui,isLensFlare:!0,copy:function(t){hr.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,n=t.lensFlares.length;e<n;e++)this.lensFlares.push(t.lensFlares[e]);return this},add:function(t,e,n,r,i,o){void 0===e&&(e=-1),void 0===n&&(n=0),void 0===o&&(o=1),void 0===i&&(i=new In(16777215)),void 0===r&&(r=P),n=Math.min(n,Math.max(0,n)),this.lensFlares.push({texture:t,size:e,distance:n,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:i,blending:r})},updateLensFlares:function(){var t,e,n=this.lensFlares.length,r=2*-this.positionScreen.x,i=2*-this.positionScreen.y;for(t=0;t<n;t++)(e=this.lensFlares[t]).x=this.positionScreen.x+r*e.distance,e.y=this.positionScreen.y+i*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)}}),Ni.prototype=Object.create(Yn.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isSpriteMaterial=!0,Ni.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this},Di.prototype=Object.assign(Object.create(hr.prototype),{constructor:Di,isSprite:!0,raycast:(ai=new He,si=new He,ci=new He,function(t,e){si.setFromMatrixPosition(this.matrixWorld),t.ray.closestPointToPoint(si,ai),ci.setFromMatrixScale(this.matrixWorld);var n=ci.x*ci.y/4;if(!(si.distanceToSquared(ai)>n)){var r=t.ray.origin.distanceTo(ai);r<t.near||r>t.far||e.push({distance:r,point:ai.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)}}),Fi.prototype=Object.assign(Object.create(hr.prototype),{constructor:Fi,copy:function(t){hr.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:(ui=new He,function(t,e){ui.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(ui);this.getObjectForDistance(n).raycast(t,e)}),update:function(){var t=new He,e=new He;return function(n){var r=this.levels;if(r.length>1){t.setFromMatrixPosition(n.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var i=t.distanceTo(e);r[0].object.visible=!0;for(var o=1,a=r.length;o<a&&i>=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;o<a;o++)r[o].object.visible=!1}}}(),toJSON:function(t){var e=hr.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var o=n[r];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Object.assign(Bi.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new ke;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:(li=new ke,hi=new ke,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,o=t.length;i<o;i++){var a=t[i]?t[i].matrixWorld:hi;li.multiplyMatrices(a,e[i]),li.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new Bi(this.bones,this.boneInverses)}}),zi.prototype=Object.assign(Object.create(hr.prototype),{constructor:zi,isBone:!0}),Gi.prototype=Object.assign(Object.create(Yr.prototype),{constructor:Gi,isSkinnedMesh:!0,initBones:function(){var t,e,n,r,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,r=this.geometry.bones.length;n<r;n++)e=this.geometry.bones[n],t=new zi,i.push(t),t.name=e.name,t.position.fromArray(e.pos),t.quaternion.fromArray(e.rotq),void 0!==e.scl&&t.scale.fromArray(e.scl);for(n=0,r=this.geometry.bones.length;n<r;n++)-1!==(e=this.geometry.bones[n]).parent&&null!==e.parent&&void 0!==i[e.parent]?i[e.parent].add(i[n]):this.add(i[n])}return this.updateMatrixWorld(!0),i},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(){var t,e;if(this.geometry&&this.geometry.isGeometry)for(e=0;e<this.geometry.skinWeights.length;e++){var n=this.geometry.skinWeights[e];(t=1/n.lengthManhattan())!==1/0?n.multiplyScalar(t):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var r=new Fe,i=this.geometry.attributes.skinWeight;for(e=0;e<i.count;e++)r.x=i.getX(e),r.y=i.getY(e),r.z=i.getZ(e),r.w=i.getW(e),(t=1/r.lengthManhattan())!==1/0?r.multiplyScalar(t):r.set(1,0,0,0),i.setXYZW(e,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(t){Yr.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)}}),Hi.prototype=Object.create(Yn.prototype),Hi.prototype.constructor=Hi,Hi.prototype.isLineBasicMaterial=!0,Hi.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},ki.prototype=Object.assign(Object.create(hr.prototype),{constructor:ki,isLine:!0,raycast:function(){var t=new ke,e=new Wr,n=new Qn;return function(r,i){var o=r.linePrecision,a=o*o,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),n.copy(s.boundingSphere),n.applyMatrix4(c),!1!==r.ray.intersectsSphere(n)){t.getInverse(c),e.copy(r.ray).applyMatrix4(t);var u=new He,l=new He,h=new He,f=new He,d=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var p=s.index,m=s.attributes.position.array;if(null!==p)for(var g=p.array,v=0,y=g.length-1;v<y;v+=d){var x=g[v],_=g[v+1];if(u.fromArray(m,3*x),l.fromArray(m,3*_),!(e.distanceSqToSegment(u,l,f,h)>a))f.applyMatrix4(this.matrixWorld),(M=r.ray.origin.distanceTo(f))<r.near||M>r.far||i.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}else for(v=0,y=m.length/3-1;v<y;v+=d){if(u.fromArray(m,3*v),l.fromArray(m,3*v+3),!(e.distanceSqToSegment(u,l,f,h)>a))f.applyMatrix4(this.matrixWorld),(M=r.ray.origin.distanceTo(f))<r.near||M>r.far||i.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var b=s.vertices,w=b.length;for(v=0;v<w-1;v+=d){var M;if(!(e.distanceSqToSegment(b[v],b[v+1],f,h)>a))f.applyMatrix4(this.matrixWorld),(M=r.ray.origin.distanceTo(f))<r.near||M>r.far||i.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ji.prototype=Object.assign(Object.create(ki.prototype),{constructor:ji,isLineSegments:!0}),Vi.prototype=Object.assign(Object.create(ki.prototype),{constructor:Vi,isLineLoop:!0}),Wi.prototype=Object.create(Yn.prototype),Wi.prototype.constructor=Wi,Wi.prototype.isPointsMaterial=!0,Wi.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},Xi.prototype=Object.assign(Object.create(hr.prototype),{constructor:Xi,isPoints:!0,raycast:function(){var t=new ke,e=new Wr,n=new Qn;return function(r,i){var o=this,a=this.geometry,s=this.matrixWorld,c=r.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==r.ray.intersectsSphere(n)){t.getInverse(s),e.copy(r.ray).applyMatrix4(t);var u=c/((this.scale.x+this.scale.y+this.scale.z)/3),l=u*u,h=new He;if(a.isBufferGeometry){var f=a.index,d=a.attributes.position.array;if(null!==f)for(var p=f.array,m=0,g=p.length;m<g;m++){var v=p[m];h.fromArray(d,3*v),_(h,v)}else{m=0;for(var y=d.length/3;m<y;m++)h.fromArray(d,3*m),_(h,m)}}else{var x=a.vertices;for(m=0,y=x.length;m<y;m++)_(x[m],m)}}function _(t,n){var a=e.distanceSqToPoint(t);if(a<l){var c=e.closestPointToPoint(t);c.applyMatrix4(s);var u=r.ray.origin.distanceTo(c);if(u<r.near||u>r.far)return;i.push({distance:u,distanceToRay:Math.sqrt(a),point:c.clone(),index:n,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),qi.prototype=Object.assign(Object.create(hr.prototype),{constructor:qi}),Yi.prototype=Object.create(De.prototype),Yi.prototype.constructor=Yi,Zi.prototype=Object.create(De.prototype),Zi.prototype.constructor=Zi,Zi.prototype.isCompressedTexture=!0,Ji.prototype=Object.create(De.prototype),Ji.prototype.constructor=Ji,Ki.prototype=Object.create(De.prototype),Ki.prototype.constructor=Ki,Ki.prototype.isDepthTexture=!0,Qi.prototype=Object.create(zr.prototype),Qi.prototype.constructor=Qi,$i.prototype=Object.create(Sr.prototype),$i.prototype.constructor=$i,to.prototype=Object.create(zr.prototype),to.prototype.constructor=to,eo.prototype=Object.create(Sr.prototype),eo.prototype.constructor=eo,no.prototype=Object.create(zr.prototype),no.prototype.constructor=no,ro.prototype=Object.create(Sr.prototype),ro.prototype.constructor=ro,io.prototype=Object.create(no.prototype),io.prototype.constructor=io,oo.prototype=Object.create(Sr.prototype),oo.prototype.constructor=oo,ao.prototype=Object.create(no.prototype),ao.prototype.constructor=ao,so.prototype=Object.create(Sr.prototype),so.prototype.constructor=so,co.prototype=Object.create(no.prototype),co.prototype.constructor=co,uo.prototype=Object.create(Sr.prototype),uo.prototype.constructor=uo,lo.prototype=Object.create(no.prototype),lo.prototype.constructor=lo,ho.prototype=Object.create(Sr.prototype),ho.prototype.constructor=ho,fo.prototype=Object.create(zr.prototype),fo.prototype.constructor=fo,po.prototype=Object.create(Sr.prototype),po.prototype.constructor=po,mo.prototype=Object.create(zr.prototype),mo.prototype.constructor=mo,go.prototype=Object.create(Sr.prototype),go.prototype.constructor=go,vo.prototype=Object.create(zr.prototype),vo.prototype.constructor=vo;var yo={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},triangulate:function(){function t(t,e,n,r,i,o){var a,s,c,u,l,h,f,d,p,m,g,v,y,x,_,b,w;if(s=t[o[e]].x,c=t[o[e]].y,u=t[o[n]].x,l=t[o[n]].y,h=t[o[r]].x,(u-s)*((f=t[o[r]].y)-c)-(l-c)*(h-s)<=0)return!1;for(m=h-u,g=f-l,v=s-h,y=c-f,x=u-s,_=l-c,a=0;a<i;a++)if(d=t[o[a]].x,p=t[o[a]].y,!(d===s&&p===c||d===u&&p===l||d===h&&p===f)&&(b=x*(p-c)-_*(d-s),w=v*(p-f)-y*(d-h),m*(p-l)-g*(d-u)>=-Number.EPSILON&&w>=-Number.EPSILON&&b>=-Number.EPSILON))return!1;return!0}return function(e,n){var r=e.length;if(r<3)return null;var i,o,a,s=[],c=[],u=[];if(yo.area(e)>0)for(o=0;o<r;o++)c[o]=o;else for(o=0;o<r;o++)c[o]=r-1-o;var l=r,h=2*l;for(o=l-1;l>2;){if(h--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),n?u:s;if(l<=(i=o)&&(i=0),l<=(o=i+1)&&(o=0),l<=(a=o+1)&&(a=0),t(e,i,o,a,l,c)){var f,d,p,m,g;for(f=c[i],d=c[o],p=c[a],s.push([e[f],e[d],e[p]]),u.push([c[i],c[o],c[a]]),m=o,g=o+1;g<l;m++,g++)c[m]=c[g];h=2*--l}}return n?u:s}}(),triangulateShape:function(t,e){function n(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function r(t,e,n){return t.x!==e.x?t.x<e.x?t.x<=n.x&&n.x<=e.x:e.x<=n.x&&n.x<=t.x:t.y<e.y?t.y<=n.y&&n.y<=e.y:e.y<=n.y&&n.y<=t.y}function i(t,e,n,i,o){var a=e.x-t.x,s=e.y-t.y,c=i.x-n.x,u=i.y-n.y,l=t.x-n.x,h=t.y-n.y,f=s*c-a*u,d=s*l-a*h;if(Math.abs(f)>Number.EPSILON){var p;if(f>0){if(d<0||d>f)return[];if((p=u*l-c*h)<0||p>f)return[]}else{if(d>0||d<f)return[];if((p=u*l-c*h)>0||p<f)return[]}if(0===p)return!o||0!==d&&d!==f?[t]:[];if(p===f)return!o||0!==d&&d!==f?[e]:[];if(0===d)return[n];if(d===f)return[i];var m=p/f;return[{x:t.x+m*a,y:t.y+m*s}]}if(0!==d||u*l!=c*h)return[];var g,v,y,x,_,b,w,M,E=0===a&&0===s,T=0===c&&0===u;return E&&T?t.x!==n.x||t.y!==n.y?[]:[t]:E?r(n,i,t)?[t]:[]:T?r(t,e,n)?[n]:[]:(0!==a?(t.x<e.x?(g=t,y=t.x,v=e,x=e.x):(g=e,y=e.x,v=t,x=t.x),n.x<i.x?(_=n,w=n.x,b=i,M=i.x):(_=i,w=i.x,b=n,M=n.x)):(t.y<e.y?(g=t,y=t.y,v=e,x=e.y):(g=e,y=e.y,v=t,x=t.y),n.y<i.y?(_=n,w=n.y,b=i,M=i.y):(_=i,w=i.y,b=n,M=n.y)),y<=w?x<w?[]:x===w?o?[]:[_]:x<=M?[_,v]:[_,b]:y>M?[]:y===M?o?[]:[g]:x<=M?[g,v]:[g,b])}function o(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=n.x-t.x,s=n.y-t.y,c=r.x-t.x,u=r.y-t.y,l=i*s-o*a,h=i*u-o*c;if(Math.abs(l)>Number.EPSILON){var f=c*s-u*a;return l>0?h>=0&&f>=0:h>=0||f>=0}return h>0}n(t),e.forEach(n);for(var a,s,c,u,l,h,f={},d=t.concat(),p=0,m=e.length;p<m;p++)Array.prototype.push.apply(d,e[p]);for(a=0,s=d.length;a<s;a++)void 0!==f[l=d[a].x+":"+d[a].y]&&console.warn("THREE.ShapeUtils: Duplicate point",l,a),f[l]=a;var g=function(t,e){var n,r=t.concat();function a(t,e){var i=r.length-1,a=t-1;a<0&&(a=i);var s=t+1;s>i&&(s=0);var c=o(r[t],r[a],r[s],n[e]);if(!c)return!1;var u=n.length-1,l=e-1;l<0&&(l=u);var h=e+1;return h>u&&(h=0),!!(c=o(n[e],n[l],n[h],r[t]))}function s(t,e){var n,o;for(n=0;n<r.length;n++)if(o=n+1,o%=r.length,i(t,e,r[n],r[o],!0).length>0)return!0;return!1}var c=[];function u(t,n){var r,o,a,s;for(r=0;r<c.length;r++)for(o=e[c[r]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,i(t,n,o[a],o[s],!0).length>0)return!0;return!1}for(var l,h,f,d,p,m,g,v,y,x,_=[],b=0,w=e.length;b<w;b++)c.push(b);for(var M=0,E=2*c.length;c.length>0;){if(--E<0){console.log("Infinite Loop! Holes left:"+c.length+", Probably Hole outside Shape!");break}for(h=M;h<r.length;h++){for(f=r[h],l=-1,b=0;b<c.length;b++)if(p=c[b],void 0===_[m=f.x+":"+f.y+":"+p]){n=e[p];for(var T=0;T<n.length;T++)if(d=n[T],a(h,T)&&!s(f,d)&&!u(f,d)){l=T,c.splice(b,1),g=r.slice(0,h+1),v=r.slice(h),y=n.slice(l),x=n.slice(0,l+1),r=g.concat(y).concat(x).concat(v),M=h;break}if(l>=0)break;_[m]=!0}if(l>=0)break}}return r}(t,e),v=yo.triangulate(g,!1);for(a=0,s=v.length;a<s;a++)for(u=v[a],c=0;c<3;c++)void 0!==(h=f[l=u[c].x+":"+u[c].y])&&(u[c]=h);return v.concat()},isClockWise:function(t){return yo.area(t)<0}};function xo(t,e){Sr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new _o(t,e)),this.mergeVertices()}function _o(t,e){void 0!==t&&(zr.call(this),this.type="ExtrudeBufferGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeVertexNormals())}function bo(t,e){Sr.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new wo(t,e)),this.mergeVertices()}function wo(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 Sr;var r=n.generateShapes(t,e.size,e.curveSegments);e.amount=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),_o.call(this,r,e),this.type="TextBufferGeometry"}function Mo(t,e,n,r,i,o,a){Sr.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Eo(t,e,n,r,i,o,a)),this.mergeVertices()}function Eo(t,e,n,r,i,o,a){zr.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},t=t||50,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=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),l=0,h=[],f=new He,d=new He,p=[],m=[],g=[],v=[];for(c=0;c<=n;c++){var y=[],x=c/n;for(s=0;s<=e;s++){var _=s/e;f.x=-t*Math.cos(r+_*i)*Math.sin(o+x*a),f.y=t*Math.cos(o+x*a),f.z=t*Math.sin(r+_*i)*Math.sin(o+x*a),m.push(f.x,f.y,f.z),d.set(f.x,f.y,f.z).normalize(),g.push(d.x,d.y,d.z),v.push(_,1-x),y.push(l++)}h.push(y)}for(c=0;c<n;c++)for(s=0;s<e;s++){var b=h[c][s+1],w=h[c][s],M=h[c+1][s],E=h[c+1][s+1];(0!==c||o>0)&&p.push(b,w,E),(c!==n-1||u<Math.PI)&&p.push(w,M,E)}this.setIndex(p),this.addAttribute("position",new Nr(m,3)),this.addAttribute("normal",new Nr(g,3)),this.addAttribute("uv",new Nr(v,2))}function To(t,e,n,r,i,o){Sr.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new So(t,e,n,r,i,o)),this.mergeVertices()}function So(t,e,n,r,i,o){zr.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},t=t||20,e=e||50,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,c,u=[],l=[],h=[],f=[],d=t,p=(e-t)/(r=void 0!==r?Math.max(1,r):1),m=new He,g=new Re;for(s=0;s<=r;s++){for(c=0;c<=n;c++)a=i+c/n*o,m.x=d*Math.cos(a),m.y=d*Math.sin(a),l.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,f.push(g.x,g.y);d+=p}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var y=a=c+v,x=a+n+1,_=a+n+2,b=a+1;u.push(y,x,b),u.push(x,_,b)}}this.setIndex(u),this.addAttribute("position",new Nr(l,3)),this.addAttribute("normal",new Nr(h,3)),this.addAttribute("uv",new Nr(f,2))}function Ao(t,e,n,r){Sr.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},this.fromBufferGeometry(new Ro(t,e,n,r)),this.mergeVertices()}function Ro(t,e,n,r){zr.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=Ae.clamp(r,0,2*Math.PI);var i,o,a,s=[],c=[],u=[],l=1/e,h=new He,f=new Re;for(o=0;o<=e;o++){var d=n+o*l*r,p=Math.sin(d),m=Math.cos(d);for(a=0;a<=t.length-1;a++)h.x=t[a].x*p,h.y=t[a].y,h.z=t[a].x*m,c.push(h.x,h.y,h.z),f.x=o/e,f.y=a/(t.length-1),u.push(f.x,f.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var g=i=a+o*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 Nr(c,3)),this.addAttribute("uv",new Nr(u,2)),this.computeVertexNormals(),r===2*Math.PI){var _=this.attributes.normal.array,b=new He,w=new He,M=new He;for(i=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)b.x=_[a+0],b.y=_[a+1],b.z=_[a+2],w.x=_[i+a+0],w.y=_[i+a+1],w.z=_[i+a+2],M.addVectors(b,w).normalize(),_[a+0]=_[i+a+0]=M.x,_[a+1]=_[i+a+1]=M.y,_[a+2]=_[i+a+2]=M.z}}function Lo(t,e){Sr.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 Po(t,e)),this.mergeVertices()}function Po(t,e){zr.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],r=[],i=[],o=[],a=0,s=0;if(!1===Array.isArray(t))u(t);else for(var c=0;c<t.length;c++)u(t[c]),this.addGroup(a,s,c),a+=s,s=0;function u(t){var a,c,u,l=r.length/3,h=t.extractPoints(e),f=h.shape,d=h.holes;if(!1===yo.isClockWise(f))for(f=f.reverse(),a=0,c=d.length;a<c;a++)u=d[a],!0===yo.isClockWise(u)&&(d[a]=u.reverse());var p=yo.triangulateShape(f,d);for(a=0,c=d.length;a<c;a++)u=d[a],f=f.concat(u);for(a=0,c=f.length;a<c;a++){var m=f[a];r.push(m.x,m.y,0),i.push(0,0,1),o.push(m.x,m.y)}for(a=0,c=p.length;a<c;a++){var g=p[a],v=g[0]+l,y=g[1]+l,x=g[2]+l;n.push(v,y,x),s+=3}}this.setIndex(n),this.addAttribute("position",new Nr(r,3)),this.addAttribute("normal",new Nr(i,3)),this.addAttribute("uv",new Nr(o,2))}function Co(t,e){zr.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,i,o,a=[],s=Math.cos(Ae.DEG2RAD*e),c=[0,0],u={},l=["a","b","c"];t.isBufferGeometry?(o=new Sr).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,f=o.faces,d=0,p=f.length;d<p;d++)for(var m=f[d],g=0;g<3;g++)n=m[l[g]],r=m[l[(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:d,face2:void 0}:u[i].face2=d;for(i in u){var v=u[i];if(void 0===v.face2||f[v.face1].normal.dot(f[v.face2].normal)<=s){var y=h[v.index1];a.push(y.x,y.y,y.z),y=h[v.index2],a.push(y.x,y.y,y.z)}}this.addAttribute("position",new Nr(a,3))}function Io(t,e,n,r,i,o,a,s){Sr.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Oo(t,e,n,r,i,o,a,s)),this.mergeVertices()}function Oo(t,e,n,r,i,o,a,s){zr.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};var c=this;t=void 0!==t?t:20,e=void 0!==e?e:20,n=void 0!==n?n:100,r=Math.floor(r)||8,i=Math.floor(i)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var u=[],l=[],h=[],f=[],d=0,p=[],m=n/2,g=0;function v(n){var i,o,p,v=new Re,y=new He,x=0,_=!0===n?t:e,b=!0===n?1:-1;for(o=d,i=1;i<=r;i++)l.push(0,m*b,0),h.push(0,b,0),f.push(.5,.5),d++;for(p=d,i=0;i<=r;i++){var w=i/r*s+a,M=Math.cos(w),E=Math.sin(w);y.x=_*E,y.y=m*b,y.z=_*M,l.push(y.x,y.y,y.z),h.push(0,b,0),v.x=.5*M+.5,v.y=.5*E*b+.5,f.push(v.x,v.y),d++}for(i=0;i<r;i++){var T=o+i,S=p+i;!0===n?u.push(S,S+1,T):u.push(S+1,S,T),x+=3}c.addGroup(g,x,!0===n?1:2),g+=x}!function(){var o,v,y=new He,x=new He,_=0,b=(e-t)/n;for(v=0;v<=i;v++){var w=[],M=v/i,E=M*(e-t)+t;for(o=0;o<=r;o++){var T=o/r,S=T*s+a,A=Math.sin(S),R=Math.cos(S);x.x=E*A,x.y=-M*n+m,x.z=E*R,l.push(x.x,x.y,x.z),y.set(A,b,R).normalize(),h.push(y.x,y.y,y.z),f.push(T,1-M),w.push(d++)}p.push(w)}for(o=0;o<r;o++)for(v=0;v<i;v++){var L=p[v][o],P=p[v+1][o],C=p[v+1][o+1],I=p[v][o+1];u.push(L,P,I),u.push(P,C,I),_+=6}c.addGroup(g,_,0),g+=_}(),!1===o&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(u),this.addAttribute("position",new Nr(l,3)),this.addAttribute("normal",new Nr(h,3)),this.addAttribute("uv",new Nr(f,2))}function Uo(t,e,n,r,i,o,a){Io.call(this,0,t,e,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function No(t,e,n,r,i,o,a){Oo.call(this,0,t,e,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Do(t,e,n,r){Sr.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Fo(t,e,n,r)),this.mergeVertices()}function Fo(t,e,n,r){zr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||50,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,o,a=[],s=[],c=[],u=[],l=new He,h=new Re;for(s.push(0,0,0),c.push(0,0,1),u.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var f=n+o/e*r;l.x=t*Math.cos(f),l.y=t*Math.sin(f),s.push(l.x,l.y,l.z),c.push(0,0,1),h.x=(s[i]/t+1)/2,h.y=(s[i+1]/t+1)/2,u.push(h.x,h.y)}for(i=1;i<=e;i++)a.push(i,i+1,0);this.setIndex(a),this.addAttribute("position",new Nr(s,3)),this.addAttribute("normal",new Nr(c,3)),this.addAttribute("uv",new Nr(u,2))}xo.prototype=Object.create(Sr.prototype),xo.prototype.constructor=xo,_o.prototype=Object.create(zr.prototype),_o.prototype.constructor=_o,_o.prototype.getArrays=function(){var t=this.getAttribute("position"),e=t?Array.prototype.slice.call(t.array):[],n=this.getAttribute("uv"),r=n?Array.prototype.slice.call(n.array):[],i=this.index;return{position:e,uv:r,index:i?Array.prototype.slice.call(i.array):[]}},_o.prototype.addShapeList=function(t,e){var n=t.length;e.arrays=this.getArrays();for(var r=0;r<n;r++){var i=t[r];this.addShape(i,e)}this.setIndex(e.arrays.index),this.addAttribute("position",new Nr(e.arrays.position,3)),this.addAttribute("uv",new Nr(e.arrays.uv,2))},_o.prototype.addShape=function(t,e){var n,r,i,o,a,s,c,u,l=e.arrays?e.arrays:this.getArrays(),h=l.position,f=l.index,d=l.uv,p=[],m=void 0!==e.amount?e.amount:100,g=void 0!==e.bevelThickness?e.bevelThickness:6,v=void 0!==e.bevelSize?e.bevelSize:g-2,y=void 0!==e.bevelSegments?e.bevelSegments:3,x=void 0===e.bevelEnabled||e.bevelEnabled,_=void 0!==e.curveSegments?e.curveSegments:12,b=void 0!==e.steps?e.steps:1,w=e.extrudePath,M=!1,E=void 0!==e.UVGenerator?e.UVGenerator:xo.WorldUVGenerator;w&&(n=w.getSpacedPoints(b),M=!0,x=!1,r=void 0!==e.frames?e.frames:w.computeFrenetFrames(b,!1),i=new He,o=new He,a=new He),x||(y=0,g=0,v=0);var T=this,S=t.extractPoints(_),A=S.shape,R=S.holes;if(!yo.isClockWise(A))for(A=A.reverse(),c=0,u=R.length;c<u;c++)s=R[c],yo.isClockWise(s)&&(R[c]=s.reverse());var L=yo.triangulateShape(A,R),P=A;for(c=0,u=R.length;c<u;c++)s=R[c],A=A.concat(s);function C(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var I,O,U,N,D,F,B=A.length,z=L.length;function G(t,e,n){var r,i,o,a=t.x-e.x,s=t.y-e.y,c=n.x-t.x,u=n.y-t.y,l=a*a+s*s,h=a*u-s*c;if(Math.abs(h)>Number.EPSILON){var f=Math.sqrt(l),d=Math.sqrt(c*c+u*u),p=e.x-s/f,m=e.y+a/f,g=((n.x-u/d-p)*u-(n.y+c/d-m)*c)/(a*u-s*c),v=(r=p+a*g-t.x)*r+(i=m+s*g-t.y)*i;if(v<=2)return new Re(r,i);o=Math.sqrt(v/2)}else{var y=!1;a>Number.EPSILON?c>Number.EPSILON&&(y=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new Re(r/o,i/o)}for(var H=[],k=0,j=P.length,V=j-1,W=k+1;k<j;k++,V++,W++)V===j&&(V=0),W===j&&(W=0),H[k]=G(P[k],P[V],P[W]);var X,q,Y=[],Z=H.concat();for(c=0,u=R.length;c<u;c++){for(s=R[c],X=[],k=0,V=(j=s.length)-1,W=k+1;k<j;k++,V++,W++)V===j&&(V=0),W===j&&(W=0),X[k]=G(s[k],s[V],s[W]);Y.push(X),Z=Z.concat(X)}for(I=0;I<y;I++){for(U=I/y,N=g*Math.cos(U*Math.PI/2),O=v*Math.sin(U*Math.PI/2),k=0,j=P.length;k<j;k++)K((D=C(P[k],H[k],O)).x,D.y,-N);for(c=0,u=R.length;c<u;c++)for(s=R[c],X=Y[c],k=0,j=s.length;k<j;k++)K((D=C(s[k],X[k],O)).x,D.y,-N)}for(O=v,k=0;k<B;k++)D=x?C(A[k],Z[k],O):A[k],M?(o.copy(r.normals[0]).multiplyScalar(D.x),i.copy(r.binormals[0]).multiplyScalar(D.y),a.copy(n[0]).add(o).add(i),K(a.x,a.y,a.z)):K(D.x,D.y,0);for(q=1;q<=b;q++)for(k=0;k<B;k++)D=x?C(A[k],Z[k],O):A[k],M?(o.copy(r.normals[q]).multiplyScalar(D.x),i.copy(r.binormals[q]).multiplyScalar(D.y),a.copy(n[q]).add(o).add(i),K(a.x,a.y,a.z)):K(D.x,D.y,m/b*q);for(I=y-1;I>=0;I--){for(U=I/y,N=g*Math.cos(U*Math.PI/2),O=v*Math.sin(U*Math.PI/2),k=0,j=P.length;k<j;k++)K((D=C(P[k],H[k],O)).x,D.y,m+N);for(c=0,u=R.length;c<u;c++)for(s=R[c],X=Y[c],k=0,j=s.length;k<j;k++)D=C(s[k],X[k],O),M?K(D.x,D.y+n[b-1].y,n[b-1].x+N):K(D.x,D.y,m+N)}function J(t,e){var n,r;for(k=t.length;--k>=0;){n=k,(r=k-1)<0&&(r=t.length-1);var i=0,o=b+2*y;for(i=0;i<o;i++){var a=B*i,s=B*(i+1);$(e+n+a,e+r+a,e+r+s,e+n+s,t,i,o,n,r)}}}function K(t,e,n){p.push(t),p.push(e),p.push(n)}function Q(t,e,n){tt(t),tt(e),tt(n);var r=h.length/3,i=E.generateTopUV(T,h,r-3,r-2,r-1);et(i[0]),et(i[1]),et(i[2])}function $(t,e,n,r,i,o,a,s,c){tt(t),tt(e),tt(r),tt(e),tt(n),tt(r);var u=h.length/3,l=E.generateSideWallUV(T,h,u-6,u-3,u-2,u-1);et(l[0]),et(l[1]),et(l[3]),et(l[1]),et(l[2]),et(l[3])}function tt(t){f.push(h.length/3),h.push(p[3*t+0]),h.push(p[3*t+1]),h.push(p[3*t+2])}function et(t){d.push(t.x),d.push(t.y)}!function(){var t=h.length/3;if(x){var n=0,r=B*n;for(k=0;k<z;k++)Q((F=L[k])[2]+r,F[1]+r,F[0]+r);for(r=B*(n=b+2*y),k=0;k<z;k++)Q((F=L[k])[0]+r,F[1]+r,F[2]+r)}else{for(k=0;k<z;k++)Q((F=L[k])[2],F[1],F[0]);for(k=0;k<z;k++)Q((F=L[k])[0]+B*b,F[1]+B*b,F[2]+B*b)}T.addGroup(t,h.length/3-t,void 0!==e.material?e.material:0)}(),function(){var t=h.length/3,n=0;for(J(P,n),n+=P.length,c=0,u=R.length;c<u;c++)J(s=R[c],n),n+=s.length;T.addGroup(t,h.length/3-t,void 0!==e.extrudeMaterial?e.extrudeMaterial:1)}(),e.arrays||(this.setIndex(f),this.addAttribute("position",new Nr(h,3)),this.addAttribute("uv",new Nr(e.arrays.uv,2)))},xo.WorldUVGenerator={generateTopUV:function(t,e,n,r,i){var o=e[3*n],a=e[3*n+1],s=e[3*r],c=e[3*r+1],u=e[3*i],l=e[3*i+1];return[new Re(o,a),new Re(s,c),new Re(u,l)]},generateSideWallUV:function(t,e,n,r,i,o){var a=e[3*n],s=e[3*n+1],c=e[3*n+2],u=e[3*r],l=e[3*r+1],h=e[3*r+2],f=e[3*i],d=e[3*i+1],p=e[3*i+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(s-l)<.01?[new Re(a,1-c),new Re(u,1-h),new Re(f,1-p),new Re(m,1-v)]:[new Re(s,1-c),new Re(l,1-h),new Re(d,1-p),new Re(g,1-v)]}},bo.prototype=Object.create(Sr.prototype),bo.prototype.constructor=bo,wo.prototype=Object.create(_o.prototype),wo.prototype.constructor=wo,Mo.prototype=Object.create(Sr.prototype),Mo.prototype.constructor=Mo,Eo.prototype=Object.create(zr.prototype),Eo.prototype.constructor=Eo,To.prototype=Object.create(Sr.prototype),To.prototype.constructor=To,So.prototype=Object.create(zr.prototype),So.prototype.constructor=So,Ao.prototype=Object.create(Sr.prototype),Ao.prototype.constructor=Ao,Ro.prototype=Object.create(zr.prototype),Ro.prototype.constructor=Ro,Lo.prototype=Object.create(Sr.prototype),Lo.prototype.constructor=Lo,Po.prototype=Object.create(zr.prototype),Po.prototype.constructor=Po,Co.prototype=Object.create(zr.prototype),Co.prototype.constructor=Co,Io.prototype=Object.create(Sr.prototype),Io.prototype.constructor=Io,Oo.prototype=Object.create(zr.prototype),Oo.prototype.constructor=Oo,Uo.prototype=Object.create(Io.prototype),Uo.prototype.constructor=Uo,No.prototype=Object.create(Oo.prototype),No.prototype.constructor=No,Do.prototype=Object.create(Sr.prototype),Do.prototype.constructor=Do,Fo.prototype=Object.create(zr.prototype),Fo.prototype.constructor=Fo;var Bo=Object.freeze({WireframeGeometry:Qi,ParametricGeometry:$i,ParametricBufferGeometry:to,TetrahedronGeometry:ro,TetrahedronBufferGeometry:io,OctahedronGeometry:oo,OctahedronBufferGeometry:ao,IcosahedronGeometry:so,IcosahedronBufferGeometry:co,DodecahedronGeometry:uo,DodecahedronBufferGeometry:lo,PolyhedronGeometry:eo,PolyhedronBufferGeometry:no,TubeGeometry:ho,TubeBufferGeometry:fo,TorusKnotGeometry:po,TorusKnotBufferGeometry:mo,TorusGeometry:go,TorusBufferGeometry:vo,TextGeometry:bo,TextBufferGeometry:wo,SphereGeometry:Mo,SphereBufferGeometry:Eo,RingGeometry:To,RingBufferGeometry:So,PlaneGeometry:kr,PlaneBufferGeometry:jr,LatheGeometry:Ao,LatheBufferGeometry:Ro,ShapeGeometry:Lo,ShapeBufferGeometry:Po,ExtrudeGeometry:xo,ExtrudeBufferGeometry:_o,EdgesGeometry:Co,ConeGeometry:Uo,ConeBufferGeometry:No,CylinderGeometry:Io,CylinderBufferGeometry:Oo,CircleGeometry:Do,CircleBufferGeometry:Fo,BoxGeometry:Gr,BoxBufferGeometry:Hr});function zo(t){Zn.call(this,{uniforms:Un.merge([On.lights,{opacity:{value:1}}]),vertexShader:Nn.shadow_vert,fragmentShader:Nn.shadow_frag}),this.lights=!0,this.transparent=!0,Object.defineProperties(this,{opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}}}),this.setValues(t)}function Go(t){Zn.call(this,t),this.type="RawShaderMaterial"}function Ho(t){Yn.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new In(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 In(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Re(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 ko(t){Ho.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function jo(t){Yn.call(this),this.type="MeshPhongMaterial",this.color=new In(16777215),this.specular=new In(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new In(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ot,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 Vo(t){jo.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function Wo(t){Yn.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Re(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 Xo(t){Yn.call(this),this.type="MeshLambertMaterial",this.color=new In(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new In(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ot,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 qo(t){Yn.call(this),this.type="LineDashedMaterial",this.color=new In(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(t)}zo.prototype=Object.create(Zn.prototype),zo.prototype.constructor=zo,zo.prototype.isShadowMaterial=!0,Go.prototype=Object.create(Zn.prototype),Go.prototype.constructor=Go,Go.prototype.isRawShaderMaterial=!0,Ho.prototype=Object.create(Yn.prototype),Ho.prototype.constructor=Ho,Ho.prototype.isMeshStandardMaterial=!0,Ho.prototype.copy=function(t){return Yn.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.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},ko.prototype=Object.create(Ho.prototype),ko.prototype.constructor=ko,ko.prototype.isMeshPhysicalMaterial=!0,ko.prototype.copy=function(t){return Ho.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},jo.prototype=Object.create(Yn.prototype),jo.prototype.constructor=jo,jo.prototype.isMeshPhongMaterial=!0,jo.prototype.copy=function(t){return Yn.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.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},Vo.prototype=Object.create(jo.prototype),Vo.prototype.constructor=Vo,Vo.prototype.isMeshToonMaterial=!0,Vo.prototype.copy=function(t){return jo.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},Wo.prototype=Object.create(Yn.prototype),Wo.prototype.constructor=Wo,Wo.prototype.isMeshNormalMaterial=!0,Wo.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,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},Xo.prototype=Object.create(Yn.prototype),Xo.prototype.constructor=Xo,Xo.prototype.isMeshLambertMaterial=!0,Xo.prototype.copy=function(t){return Yn.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},qo.prototype=Object.create(Yn.prototype),qo.prototype.constructor=qo,qo.prototype.isLineDashedMaterial=!0,qo.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Yo=Object.freeze({ShadowMaterial:zo,SpriteMaterial:Ni,RawShaderMaterial:Go,ShaderMaterial:Zn,PointsMaterial:Wi,MeshPhysicalMaterial:ko,MeshStandardMaterial:Ho,MeshPhongMaterial:jo,MeshToonMaterial:Vo,MeshNormalMaterial:Wo,MeshLambertMaterial:Xo,MeshDepthMaterial:Jn,MeshBasicMaterial:Vr,LineDashedMaterial:qo,LineBasicMaterial:Hi,Material:Yn}),Zo={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 Jo(t,e,n){var r=this,i=!1,o=0,a=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===i&&void 0!==r.onStart&&r.onStart(t,o,a),i=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)}}var Ko=new Jo;function Qo(t){this.manager=void 0!==t?t:Ko}function $o(t){this.manager=void 0!==t?t:Ko,this._parser=null}function ta(t){this.manager=void 0!==t?t:Ko,this._parser=null}function ea(t){this.manager=void 0!==t?t:Ko}function na(t){this.manager=void 0!==t?t:Ko}function ra(t){this.manager=void 0!==t?t:Ko}function ia(t,e){hr.call(this),this.type="Light",this.color=new In(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function oa(t,e,n){ia.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(hr.DefaultUp),this.updateMatrix(),this.groundColor=new In(e)}function aa(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Re(512,512),this.map=null,this.matrix=new ke}function sa(){aa.call(this,new pr(50,1,.5,500))}function ca(t,e,n,r,i,o){ia.call(this,t,e),this.type="SpotLight",this.position.copy(hr.DefaultUp),this.updateMatrix(),this.target=new hr,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!==o?o:1,this.shadow=new sa}function ua(t,e,n,r){ia.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 aa(new pr(90,1,.5,500))}function la(){aa.call(this,new dr(-5,5,5,-5,.5,500))}function ha(t,e){ia.call(this,t,e),this.type="DirectionalLight",this.position.copy(hr.DefaultUp),this.updateMatrix(),this.target=new hr,this.shadow=new la}function fa(t,e){ia.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function da(t,e,n,r){ia.call(this,t,e),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}Object.assign(Qo.prototype,{load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var i=this,o=Zo.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout(function(){e&&e(o),i.manager.itemEnd(t)},0),o;var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],u=a[3];u=window.decodeURIComponent(u),c&&(u=window.atob(u));try{var l,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":l=new ArrayBuffer(u.length);for(var f=new Uint8Array(l),d=0;d<u.length;d++)f[d]=u.charCodeAt(d);"blob"===h&&(l=new Blob([l],{type:s}));break;case"document":var p=new DOMParser;l=p.parseFromString(u,s);break;case"json":l=JSON.parse(u);break;default:l=u}window.setTimeout(function(){e&&e(l),i.manager.itemEnd(t)},0)}catch(e){window.setTimeout(function(){r&&r(e),i.manager.itemEnd(t),i.manager.itemError(t)},0)}}else{var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",function(n){var o=n.target.response;Zo.add(t,o),200===this.status?(e&&e(o),i.manager.itemEnd(t)):0===this.status?(console.warn("THREE.FileLoader: HTTP Status 0 received."),e&&e(o),i.manager.itemEnd(t)):(r&&r(n),i.manager.itemEnd(t),i.manager.itemError(t))},!1),void 0!==n&&m.addEventListener("progress",function(t){n(t)},!1),m.addEventListener("error",function(e){r&&r(e),i.manager.itemEnd(t),i.manager.itemError(t)},!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 i.manager.itemStart(t),m},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($o.prototype,{load:function(t,e,n,r){var i=this,o=[],a=new Zi;a.image=o;var s=new Qo(this.manager);function c(c){s.load(t[c],function(t){var n=i._parser(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(u+=1)&&(1===n.mipmapCount&&(a.minFilter=At),a.format=n.format,a.needsUpdate=!0,e&&e(a))},n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,l=0,h=t.length;l<h;++l)c(l);else s.load(t,function(t){var n=i._parser(t,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){o[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=At),a.format=n.format,a.needsUpdate=!0,e&&e(a)},n,r);return a},setPath:function(t){return this.path=t,this}}),Object.assign(ta.prototype,{load:function(t,e,n,r){var i=this,o=new je,a=new Qo(this.manager);return a.setResponseType("arraybuffer"),a.load(t,function(t){var n=i._parser(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:wt,o.wrapT=void 0!==n.wrapT?n.wrapT:wt,o.magFilter=void 0!==n.magFilter?n.magFilter:At,o.minFilter=void 0!==n.minFilter?n.minFilter:Lt,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=At),o.needsUpdate=!0,e&&e(o,n))},n,r),o}}),Object.assign(ea.prototype,{load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var i=this,o=Zo.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout(function(){e&&e(o),i.manager.itemEnd(t)},0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");return a.addEventListener("load",function(){Zo.add(t,this),e&&e(this),i.manager.itemEnd(t)},!1),a.addEventListener("error",function(e){r&&r(e),i.manager.itemEnd(t),i.manager.itemError(t)},!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(na.prototype,{load:function(t,e,n,r){var i=new Ve,o=new ea(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],function(t){i.images[n]=t,6===++a&&(i.needsUpdate=!0,e&&e(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(ra.prototype,{load:function(t,e,n,r){var i=new ea(this.manager);i.setCrossOrigin(this.crossOrigin),i.setPath(this.path);var o=new De;return o.image=i.load(t,function(){var n=t.search(/\.(jpg|jpeg)$/)>0||0===t.search(/^data\:image\/jpeg/);o.format=n?jt:Vt,o.needsUpdate=!0,void 0!==e&&e(o)},n,r),o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),ia.prototype=Object.assign(Object.create(hr.prototype),{constructor:ia,isLight:!0,copy:function(t){return hr.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=hr.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}}),oa.prototype=Object.assign(Object.create(ia.prototype),{constructor:oa,isHemisphereLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(aa.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}}),sa.prototype=Object.assign(Object.create(aa.prototype),{constructor:sa,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*Ae.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())}}),ca.prototype=Object.assign(Object.create(ia.prototype),{constructor:ca,isSpotLight:!0,copy:function(t){return ia.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}}),ua.prototype=Object.assign(Object.create(ia.prototype),{constructor:ua,isPointLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),la.prototype=Object.assign(Object.create(aa.prototype),{constructor:la}),ha.prototype=Object.assign(Object.create(ia.prototype),{constructor:ha,isDirectionalLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),fa.prototype=Object.assign(Object.create(ia.prototype),{constructor:fa,isAmbientLight:!0}),da.prototype=Object.assign(Object.create(ia.prototype),{constructor:da,isRectAreaLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=ia.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});var pa,ma={arraySlice:function(t,e,n){return ma.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(t){for(var e=t.length,n=new Array(e),r=0;r!==e;++r)n[r]=r;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*e,c=0;c!==e;++c)i[a++]=t[s+c];return i},flattenJSON:function(t,e,n,r){for(var i=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)}}};function ga(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 va(t,e,n,r){ga.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ya(t,e,n,r){ga.call(this,t,e,n,r)}function xa(t,e,n,r){ga.call(this,t,e,n,r)}function _a(t,e,n,r){if(void 0===t)throw new Error("track name is undefined");if(void 0===e||0===e.length)throw new Error("no keyframes in track named "+t);this.name=t,this.times=ma.convertArray(e,this.TimeBufferType),this.values=ma.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function ba(t,e,n,r){_a.call(this,t,e,n,r)}function wa(t,e,n,r){ga.call(this,t,e,n,r)}function Ma(t,e,n,r){_a.call(this,t,e,n,r)}function Ea(t,e,n,r){_a.call(this,t,e,n,r)}function Ta(t,e,n,r){_a.call(this,t,e,n,r)}function Sa(t,e,n){_a.call(this,t,e,n)}function Aa(t,e,n,r){_a.call(this,t,e,n,r)}function Ra(t,e,n,r){_a.apply(this,arguments)}function La(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Ae.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function Pa(t){this.manager=void 0!==t?t:Ko,this.textures={}}function Ca(t){this.manager=void 0!==t?t:Ko}Object.assign(ga.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var o;n:{r:if(!(t<r)){for(var a=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===a)break;if(i=r,t<(r=e[++n]))break e}o=e.length;break n}if(t>=i)break t;var s=e[1];t<s&&(n=2,i=s);for(a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===a)break;if(r=i,t>=(i=e[--n-1]))break e}o=n,n=0}for(;n<o;){var c=n+o>>>1;t<e[c]?o=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,o=0;o!==r;++o)e[o]=n[i+o];return e},interpolate_:function(t,e,n,r){throw new Error("call to abstract method")},intervalChanged_:function(t,e,n){}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign(ga.prototype,{beforeStart_:ga.prototype.copySampleValue_,afterEnd_:ga.prototype.copySampleValue_}),va.prototype=Object.assign(Object.create(ga.prototype),{constructor:va,DefaultSettings_:{endingStart:he,endingEnd:he},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,o=t+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case fe:i=t,a=2*e-n;break;case de:a=e+r[i=r.length-2]-r[i+1];break;default:i=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case fe:o=t,s=2*n-e;break;case de:o=1,s=n+r[1]-r[0];break;default:o=t-1,s=e}var c=.5*(n-e),u=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-n),this._offsetPrev=i*u,this._offsetNext=o*u},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,f=this._weightNext,d=(n-e)/(r-e),p=d*d,m=p*d,g=-h*m+2*h*p-h*d,v=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*d+1,y=(-1-f)*m+(1.5+f)*p+.5*d,x=f*m-f*p,_=0;_!==a;++_)i[_]=g*o[u+_]+v*o[c+_]+y*o[s+_]+x*o[l+_];return i}}),ya.prototype=Object.assign(Object.create(ga.prototype),{constructor:ya,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=(n-e)/(r-e),l=1-u,h=0;h!==a;++h)i[h]=o[c+h]*l+o[s+h]*u;return i}}),xa.prototype=Object.assign(Object.create(ga.prototype),{constructor:xa,interpolate_:function(t,e,n,r){return this.copySampleValue_(t-1)}}),pa={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ue,InterpolantFactoryMethodDiscrete:function(t){return new xa(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new ya(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new va(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case ce:e=this.InterpolantFactoryMethodDiscrete;break;case ue:e=this.InterpolantFactoryMethodLinear;break;case le:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)this.createInterpolant=e;else{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)}console.warn("THREE.KeyframeTrackPrototype:",n)}},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ce;case this.InterpolantFactoryMethodLinear:return ue;case this.InterpolantFactoryMethodSmooth:return le}},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,o=r-1;i!==r&&n[i]<t;)++i;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=ma.arraySlice(n,i,o),this.values=ma.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrackPrototype: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrackPrototype: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrackPrototype: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrackPrototype: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==r&&ma.isTypedArray(r)){a=0;for(var c=r.length;a!==c;++a){var u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrackPrototype: Value is not a valid number.",this,a,u),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),r=this.getInterpolation()===le,i=1,o=t.length-1,a=1;a<o;++a){var s=!1,c=t[a];if(c!==t[a+1]&&(1!==a||c!==c[0]))if(r)s=!0;else for(var u=a*n,l=u-n,h=u+n,f=0;f!==n;++f){var d=e[u+f];if(d!==e[l+f]||d!==e[h+f]){s=!0;break}}if(s){if(a!==i){t[i]=t[a];var p=a*n,m=i*n;for(f=0;f!==n;++f)e[m+f]=e[p+f]}++i}}if(o>0){t[i]=t[o];for(p=o*n,m=i*n,f=0;f!==n;++f)e[m+f]=e[p+f];++i}return i!==t.length&&(this.times=ma.arraySlice(t,0,i),this.values=ma.arraySlice(e,0,i*n)),this}},ba.prototype=Object.assign(Object.create(pa),{constructor:ba,ValueTypeName:"vector"}),wa.prototype=Object.assign(Object.create(ga.prototype),{constructor:wa,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(n-e)/(r-e),u=s+a;s!==u;s+=4)Ge.slerpFlat(i,0,o,s-a,o,s,c);return i}}),Ma.prototype=Object.assign(Object.create(pa),{constructor:Ma,ValueTypeName:"quaternion",DefaultInterpolation:ue,InterpolantFactoryMethodLinear:function(t){return new wa(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ea.prototype=Object.assign(Object.create(pa),{constructor:Ea,ValueTypeName:"number"}),Ta.prototype=Object.assign(Object.create(pa),{constructor:Ta,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ce,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Sa.prototype=Object.assign(Object.create(pa),{constructor:Sa,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ce,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Aa.prototype=Object.assign(Object.create(pa),{constructor:Aa,ValueTypeName:"color"}),Ra.prototype=pa,pa.constructor=Ra,Object.assign(Ra,{parse:function(t){if(void 0===t.type)throw new Error("track type undefined, can not parse");var e=Ra._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var n=[],r=[];ma.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)},toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:ma.convertArray(t.times,Array),values:ma.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ea;case"vector":case"vector2":case"vector3":case"vector4":return ba;case"color":return Aa;case"quaternion":return Ma;case"bool":case"boolean":return Sa;case"string":return Ta}throw new Error("Unsupported typeName: "+t)}}),Object.assign(La,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(Ra.parse(n[i]).scale(r));return new La(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e},i=0,o=n.length;i!==o;++i)e.push(Ra.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,o=[],a=0;a<i;a++){var s=[],c=[];s.push((a+i-1)%i,a,(a+1)%i),c.push(0,1,0);var u=ma.getKeyframeOrder(s);s=ma.sortedArray(s,1,u),c=ma.sortedArray(c,1,u),r||0!==s[0]||(s.push(i),c.push(c[0])),o.push(new Ea(".morphTargetInfluences["+e[a].name+"]",s,c).scale(1/n))}return new La(t,-1,o)},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]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],c=s.name.match(i);if(c&&c.length>1){var u=r[h=c[1]];u||(r[h]=u=[]),u.push(s)}}var l=[];for(var h in r)l.push(La.CreateFromMorphTargetSequence(h,r[h],e,n));return l},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 o=[],a=[];ma.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.length||-1,a=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 l={},h=0;h<u.length;h++)if(u[h].morphTargets)for(var f=0;f<u[h].morphTargets.length;f++)l[u[h].morphTargets[f]]=-1;for(var d in l){var p=[],m=[];for(f=0;f!==u[h].morphTargets.length;++f){var g=u[h];p.push(g.time),m.push(g.morphTarget===d?1:0)}r.push(new Ea(".morphTargetInfluence["+d+"]",p,m))}o=l.length*(a||1)}else{var v=".bones["+e[c].name+"]";n(ba,v+".position",u,"pos",r),n(Ma,v+".quaternion",u,"rot",r),n(ba,v+".scale",u,"scl",r)}}return 0===r.length?null:new La(i,o,r)}}),Object.assign(La.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])}this.duration=t},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}}),Object.assign(Pa.prototype,{load:function(t,e,n,r){var i=this;new Qo(i.manager).load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},setTextures:function(t){this.textures=t},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 Yo[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.uniforms&&(r.uniforms=t.uniforms),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(r.vertexColors=t.vertexColors),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.shading&&(r.shading=t.shading),void 0!==t.blending&&(r.blending=t.blending),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.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),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.normalScale){var i=t.normalScale;!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new Re).fromArray(i)}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.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}}),Object.assign(Ca.prototype,{load:function(t,e,n,r){var i=this;new Qo(i.manager).load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=new zr,n=t.data.index;if(void 0!==n){var r=new Da[n.type](n.array);e.setIndex(new Ar(r,1))}var i=t.data.attributes;for(var o in i){var a=i[o];r=new Da[a.type](a.array);e.addAttribute(o,new Ar(r,a.itemSize,a.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 l=s[c];e.addGroup(l.start,l.count,l.materialIndex)}var h=t.data.boundingSphere;if(void 0!==h){var f=new He;void 0!==h.center&&f.fromArray(h.center),e.boundingSphere=new Qn(f,h.radius)}return e}});var Ia,Oa,Ua,Na,Da={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Fa(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function Ba(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:Ko,this.withCredentials=!1}function za(t){this.manager=void 0!==t?t:Ko,this.texturePath=""}Fa.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],o=e[n+1];if(i.test(t))return o}return null}},Object.assign(Fa.prototype,{crossOrigin:void 0,extractUrlBase:function(t){var e=t.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")},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:(Ia={NoBlending:L,NormalBlending:P,AdditiveBlending:C,SubtractiveBlending:I,MultiplyBlending:O,CustomBlending:U},Oa=new In,Ua=new ra,Na=new Pa,function(t,e,n){var r={};function i(t,i,o,a,s){var c,u=e+t,l=Fa.Handlers.get(u);null!==l?c=l.load(u):(Ua.setCrossOrigin(n),c=Ua.load(u)),void 0!==i&&(c.repeat.fromArray(i),1!==i[0]&&(c.wrapS=bt),1!==i[1]&&(c.wrapT=bt)),void 0!==o&&c.offset.fromArray(o),void 0!==a&&("repeat"===a[0]&&(c.wrapS=bt),"mirror"===a[0]&&(c.wrapS=Mt),"repeat"===a[1]&&(c.wrapT=bt),"mirror"===a[1]&&(c.wrapT=Mt)),void 0!==s&&(c.anisotropy=s);var h=Ae.generateUUID();return r[h]=c,h}var o={uuid:Ae.generateUUID(),type:"MeshLambertMaterial"};for(var a in t){var s=t[a];switch(a){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=Ia[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",a,"is no longer supported.");break;case"colorDiffuse":o.color=Oa.fromArray(s).getHex();break;case"colorSpecular":o.specular=Oa.fromArray(s).getHex();break;case"colorEmissive":o.emissive=Oa.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(o.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(o.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=i(s,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=i(s,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=i(s,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=i(s,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=i(s,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=i(s,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=[s,s];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=i(s,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=i(s,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=i(s,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=i(s,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=w;break;case"doubleSided":o.side=M;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[a]=s;break;case"vertexColors":!0===s&&(o.vertexColors=R),"face"===s&&(o.vertexColors=A);break;default:console.error("THREE.Loader.createMaterial: Unsupported",a,s)}}return"MeshBasicMaterial"===o.type&&delete o.emissive,"MeshPhongMaterial"!==o.type&&delete o.specular,o.opacity<1&&(o.transparent=!0),Na.setTextures(r),Na.parse(o)})}),Object.assign(Ba.prototype,{load:function(t,e,n,r){var i=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:Fa.prototype.extractUrlBase(t),a=new Qo(this.manager);a.setWithCredentials(this.withCredentials),a.load(t,function(n){var r=JSON.parse(n),a=r.metadata;if(void 0!==a){var s=a.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}}var c=i.parse(r,o);e(c.geometry,c.materials)},n,r)},setTexturePath:function(t){this.texturePath=t},parse:function(){return function(t,e){void 0!==t.data&&(t=t.data),void 0!==t.scale?t.scale=1/t.scale:t.scale=1;var n=new Sr;return function(t,e){function n(t,e){return t&1<<e}var r,i,o,a,s,c,u,l,h,f,d,p,m,g,v,y,x,_,b,w,M,E,T,S,A,R=t.faces,L=t.vertices,P=t.normals,C=t.colors,I=t.scale,O=0;if(void 0!==t.uvs){for(r=0;r<t.uvs.length;r++)t.uvs[r].length&&O++;for(r=0;r<O;r++)e.faceVertexUvs[r]=[]}for(a=0,s=L.length;a<s;)(_=new He).x=L[a++]*I,_.y=L[a++]*I,_.z=L[a++]*I,e.vertices.push(_);for(a=0,s=R.length;a<s;)if(d=n(f=R[a++],0),p=n(f,1),m=n(f,3),g=n(f,4),v=n(f,5),y=n(f,6),x=n(f,7),d){if((w=new mr).a=R[a],w.b=R[a+1],w.c=R[a+3],(M=new mr).a=R[a+1],M.b=R[a+2],M.c=R[a+3],a+=4,p&&(h=R[a++],w.materialIndex=h,M.materialIndex=h),o=e.faces.length,m)for(r=0;r<O;r++)for(S=t.uvs[r],e.faceVertexUvs[r][o]=[],e.faceVertexUvs[r][o+1]=[],i=0;i<4;i++)A=new Re(S[2*(l=R[a++])],S[2*l+1]),2!==i&&e.faceVertexUvs[r][o].push(A),0!==i&&e.faceVertexUvs[r][o+1].push(A);if(g&&(u=3*R[a++],w.normal.set(P[u++],P[u++],P[u]),M.normal.copy(w.normal)),v)for(r=0;r<4;r++)u=3*R[a++],T=new He(P[u++],P[u++],P[u]),2!==r&&w.vertexNormals.push(T),0!==r&&M.vertexNormals.push(T);if(y&&(E=C[c=R[a++]],w.color.setHex(E),M.color.setHex(E)),x)for(r=0;r<4;r++)E=C[c=R[a++]],2!==r&&w.vertexColors.push(new In(E)),0!==r&&M.vertexColors.push(new In(E));e.faces.push(w),e.faces.push(M)}else{if((b=new mr).a=R[a++],b.b=R[a++],b.c=R[a++],p&&(h=R[a++],b.materialIndex=h),o=e.faces.length,m)for(r=0;r<O;r++)for(S=t.uvs[r],e.faceVertexUvs[r][o]=[],i=0;i<3;i++)A=new Re(S[2*(l=R[a++])],S[2*l+1]),e.faceVertexUvs[r][o].push(A);if(g&&(u=3*R[a++],b.normal.set(P[u++],P[u++],P[u])),v)for(r=0;r<3;r++)u=3*R[a++],T=new He(P[u++],P[u++],P[u]),b.vertexNormals.push(T);if(y&&(c=R[a++],b.color.setHex(C[c])),x)for(r=0;r<3;r++)c=R[a++],b.vertexColors.push(new In(C[c]));e.faces.push(b)}}(t,n),function(t,e){var n=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var r=0,i=t.skinWeights.length;r<i;r+=n){var o=t.skinWeights[r],a=n>1?t.skinWeights[r+1]:0,s=n>2?t.skinWeights[r+2]:0,c=n>3?t.skinWeights[r+3]:0;e.skinWeights.push(new Fe(o,a,s,c))}if(t.skinIndices)for(r=0,i=t.skinIndices.length;r<i;r+=n){var u=t.skinIndices[r],l=n>1?t.skinIndices[r+1]:0,h=n>2?t.skinIndices[r+2]:0,f=n>3?t.skinIndices[r+3]:0;e.skinIndices.push(new Fe(u,l,h,f))}e.bones=t.bones,e.bones&&e.bones.length>0&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}(t,n),function(t,e){var n=t.scale;if(void 0!==t.morphTargets)for(var r=0,i=t.morphTargets.length;r<i;r++){e.morphTargets[r]={},e.morphTargets[r].name=t.morphTargets[r].name,e.morphTargets[r].vertices=[];for(var o=e.morphTargets[r].vertices,a=t.morphTargets[r].vertices,s=0,c=a.length;s<c;s+=3){var u=new He;u.x=a[s]*n,u.y=a[s+1]*n,u.z=a[s+2]*n,o.push(u)}}if(void 0!==t.morphColors&&t.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var l=e.faces,h=t.morphColors[0].colors;for(r=0,i=l.length;r<i;r++)l[r].color.fromArray(h,3*r)}}(t,n),function(t,e){var n=[],r=[];void 0!==t.animation&&r.push(t.animation),void 0!==t.animations&&(t.animations.length?r=r.concat(t.animations):r.push(t.animations));for(var i=0;i<r.length;i++){var o=La.parseAnimation(r[i],e.bones);o&&n.push(o)}if(e.morphTargets){var a=La.CreateClipsFromMorphTargetSequences(e.morphTargets,10);n=n.concat(a)}n.length>0&&(e.animations=n)}(t,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:n}:{geometry:n,materials:Fa.prototype.initMaterials(t.materials,e,this.crossOrigin)}}}()}),Object.assign(za.prototype,{load:function(t,e,n,r){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var i=this;new Qo(i.manager).load(t,function(n){var o=null;try{o=JSON.parse(n)}catch(e){return void 0!==r&&r(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t+". Use THREE.JSONLoader instead.")},n,r)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var n=this.parseGeometries(t.geometries),r=this.parseImages(t.images,function(){void 0!==e&&e(a)}),i=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,i),a=this.parseObject(t.object,n,o);return t.animations&&(a.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(a),a},parseGeometries:function(t){var e={};if(void 0!==t)for(var n=new Ba,r=new Ca,i=0,o=t.length;i<o;i++){var a,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new Bo[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new Bo[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new Bo[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new Bo[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new Bo[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new Bo[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":a=new Bo[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new Bo[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new Bo[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new Bo[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":a=new Bo[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":a=r.parse(s);break;case"Geometry":a=n.parse(s,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),e[s.uuid]=a}return e},parseMaterials:function(t,e){var n={};if(void 0!==t){var r=new Pa;r.setTextures(e);for(var i=0,o=t.length;i<o;i++){var a=t[i];if("MultiMaterial"===a.type){for(var s=[],c=0;c<a.materials.length;c++)s.push(r.parse(a.materials[c]));n[a.uuid]=s}else n[a.uuid]=r.parse(a)}}return n},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var r=La.parse(t[n]);e.push(r)}return e},parseImages:function(t,e){var n=this,r={};function i(t){return n.manager.itemStart(t),o.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemEnd(t),n.manager.itemError(t)})}if(void 0!==t&&t.length>0){var o=new ea(new Jo(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var c=t[a],u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.texturePath+c.url;r[c.uuid]=i(u)}}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,o=t.length;i<o;i++){var a=t[i];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);var s=new De(e[a.image]);s.needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=n(a.mapping,Ga)),void 0!==a.offset&&s.offset.fromArray(a.offset),void 0!==a.repeat&&s.repeat.fromArray(a.repeat),void 0!==a.wrap&&(s.wrapS=n(a.wrap[0],Ha),s.wrapT=n(a.wrap[1],Ha)),void 0!==a.minFilter&&(s.minFilter=n(a.minFilter,ka)),void 0!==a.magFilter&&(s.magFilter=n(a.magFilter,ka)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),void 0!==a.flipY&&(s.flipY=a.flipY),r[a.uuid]=s}return r},parseObject:function(){var t=new ke;return function(e,n,r){var i;function o(t){return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),n[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,i=t.length;n<i;n++){var o=t[n];void 0===r[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(r[o])}return e}return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),r[t]}}switch(e.type){case"Scene":i=new Oi,void 0!==e.background&&Number.isInteger(e.background)&&(i.background=new In(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?i.fog=new Ii(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(i.fog=new Ci(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":i=new pr(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(i.focus=e.focus),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.filmGauge&&(i.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(i.filmOffset=e.filmOffset),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new dr(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":i=new fa(e.color,e.intensity);break;case"DirectionalLight":i=new ha(e.color,e.intensity);break;case"PointLight":i=new ua(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":i=new da(e.color,e.intensity,e.width,e.height);break;case"SpotLight":i=new ca(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":i=new oa(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var s=o(e.geometry),c=a(e.material);i=s.bones&&s.bones.length>0?new Gi(s,c):new Yr(s,c);break;case"LOD":i=new Fi;break;case"Line":i=new ki(o(e.geometry),a(e.material),e.mode);break;case"LineLoop":i=new Vi(o(e.geometry),a(e.material));break;case"LineSegments":i=new ji(o(e.geometry),a(e.material));break;case"PointCloud":case"Points":i=new Xi(o(e.geometry),a(e.material));break;case"Sprite":i=new Di(a(e.material));break;case"Group":i=new qi;break;default:i=new hr}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.children)for(var u in e.children)i.add(this.parseObject(e.children[u],n,r));if("LOD"===e.type)for(var l=e.levels,h=0;h<l.length;h++){var f=l[h];void 0!==(u=i.getObjectByProperty("uuid",f.object))&&i.addLevel(u,f.distance)}return i}}()});var Ga={UVMapping:dt,CubeReflectionMapping:pt,CubeRefractionMapping:mt,EquirectangularReflectionMapping:gt,EquirectangularRefractionMapping:vt,SphericalReflectionMapping:yt,CubeUVReflectionMapping:xt,CubeUVRefractionMapping:_t},Ha={RepeatWrapping:bt,ClampToEdgeWrapping:wt,MirroredRepeatWrapping:Mt},ka={NearestFilter:Et,NearestMipMapNearestFilter:Tt,NearestMipMapLinearFilter:St,LinearFilter:At,LinearMipMapNearestFilter:Rt,LinearMipMapLinearFilter:Lt};function ja(t,e,n,r,i){var o=.5*(r-e),a=.5*(i-n),s=t*t;return(2*n-2*r+o+a)*(t*s)+(-3*n+3*r-2*o-a)*s+o*t+n}function Va(t,e,n,r){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function Wa(t,e,n,r,i){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}function Xa(){this.arcLengthDivisions=200}function qa(t,e){Xa.call(this),this.v1=t,this.v2=e}function Ya(){Xa.call(this),this.curves=[],this.autoClose=!1}function Za(t,e,n,r,i,o,a,s){Xa.call(this),this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0}function Ja(t){Xa.call(this),this.points=void 0===t?[]:t}function Ka(t,e,n,r){Xa.call(this),this.v0=t,this.v1=e,this.v2=n,this.v3=r}function Qa(t,e,n){Xa.call(this),this.v0=t,this.v1=e,this.v2=n}Object.assign(Xa.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t){var e=this.getUtoTmapping(t);return this.getPoint(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),o=0;for(r.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(i),r.push(o),i=e;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,o=r.length;n=e||t*r[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(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,o=new He,a=[],s=[],c=[],u=new He,l=new ke;for(n=0;n<=t;n++)r=n/t,a[n]=this.getTangentAt(r),a[n].normalize();s[0]=new He,c[0]=new He;var h=Number.MAX_VALUE,f=Math.abs(a[0].x),d=Math.abs(a[0].y),p=Math.abs(a[0].z);for(f<=h&&(h=f,o.set(1,0,0)),d<=h&&(h=d,o.set(0,1,0)),p<=h&&o.set(0,0,1),u.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],u),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),u.crossVectors(a[n-1],a[n]),u.length()>Number.EPSILON&&(u.normalize(),i=Math.acos(Ae.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(l.makeRotationAxis(u,i))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(i=Math.acos(Ae.clamp(s[0].dot(s[t]),-1,1)),i/=t,a[0].dot(u.crossVectors(s[0],s[t]))>0&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(l.makeRotationAxis(a[n],i*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}}}),qa.prototype=Object.create(Xa.prototype),qa.prototype.constructor=qa,qa.prototype.isLineCurve=!0,qa.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},qa.prototype.getPointAt=function(t){return this.getPoint(t)},qa.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},Ya.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ya,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 qa(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,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.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,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 o=i[r],a=o&&o.isEllipseCurve?2*t:o&&o.isLineCurve?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),c=0;c<s.length;c++){var u=s[c];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new Sr,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new He(i.x,i.y,i.z||0))}return e}}),Za.prototype=Object.create(Xa.prototype),Za.prototype.constructor=Za,Za.prototype.isEllipseCurve=!0,Za.prototype.getPoint=function(t){for(var e=2*Math.PI,n=this.aEndAngle-this.aStartAngle,r=Math.abs(n)<Number.EPSILON;n<0;)n+=e;for(;n>e;)n-=e;n<Number.EPSILON&&(n=r?0:e),!0!==this.aClockwise||r||(n===e?n=-e:n-=e);var i=this.aStartAngle+t*n,o=this.aX+this.xRadius*Math.cos(i),a=this.aY+this.yRadius*Math.sin(i);if(0!==this.aRotation){var s=Math.cos(this.aRotation),c=Math.sin(this.aRotation),u=o-this.aX,l=a-this.aY;o=u*s-l*c+this.aX,a=u*c+l*s+this.aY}return new Re(o,a)},Ja.prototype=Object.create(Xa.prototype),Ja.prototype.constructor=Ja,Ja.prototype.isSplineCurve=!0,Ja.prototype.getPoint=function(t){var e=this.points,n=(e.length-1)*t,r=Math.floor(n),i=n-r,o=e[0===r?r:r-1],a=e[r],s=e[r>e.length-2?e.length-1:r+1],c=e[r>e.length-3?e.length-1:r+2];return new Re(ja(i,o.x,a.x,s.x,c.x),ja(i,o.y,a.y,s.y,c.y))},Ka.prototype=Object.create(Xa.prototype),Ka.prototype.constructor=Ka,Ka.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2,i=this.v3;return new Re(Wa(t,e.x,n.x,r.x,i.x),Wa(t,e.y,n.y,r.y,i.y))},Qa.prototype=Object.create(Xa.prototype),Qa.prototype.constructor=Qa,Qa.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2;return new Re(Va(t,e.x,n.x,r.x),Va(t,e.y,n.y,r.y))};var $a,ts=Object.assign(Object.create(Ya.prototype),{fromPoints: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 qa(this.currentPoint.clone(),new Re(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,r){var i=new Qa(this.currentPoint.clone(),new Re(t,e),new Re(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(t,e,n,r,i,o){var a=new Ka(this.currentPoint.clone(),new Re(t,e),new Re(n,r),new Re(i,o));this.curves.push(a),this.currentPoint.set(i,o)},splineThru:function(t){var e=new Ja([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,n,r,i,o)},absarc:function(t,e,n,r,i,o){this.absellipse(t,e,n,n,r,i,o)},ellipse:function(t,e,n,r,i,o,a,s){var c=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(t+c,e+u,n,r,i,o,a,s)},absellipse:function(t,e,n,r,i,o,a,s){var c=new Za(t,e,n,r,i,o,a,s);if(this.curves.length>0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var l=c.getPoint(1);this.currentPoint.copy(l)}});function es(t){Ya.call(this),this.currentPoint=new Re,t&&this.fromPoints(t)}function ns(){es.apply(this,arguments),this.holes=[]}function rs(){this.subPaths=[],this.currentPath=null}function is(t){this.data=t}function os(t){this.manager=void 0!==t?t:Ko}es.prototype=ts,ts.constructor=es,ns.prototype=Object.assign(Object.create(ts),{constructor:ns,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},extractAllPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},extractPoints:function(t){return this.extractAllPoints(t)}}),Object.assign(rs.prototype,{moveTo:function(t,e){this.currentPath=new es,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,o){this.currentPath.bezierCurveTo(t,e,n,r,i,o)},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],o=new ns;o.curves=i.curves,e.push(o)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=e[i],s=e[o],c=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(a=e[o],c=-c,s=e[i],u=-u),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=u*(t.x-a.x)-c*(t.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return r}var i=yo.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,c,u=[];if(1===o.length)return s=o[0],(c=new ns).curves=s.curves,u.push(c),u;var l=!i(o[0].getPoints());l=t?!l:l;var h,f,d=[],p=[],m=[],g=0;p[g]=void 0,m[g]=[];for(var v=0,y=o.length;v<y;v++)a=i(h=(s=o[v]).getPoints()),(a=t?!a:a)?(!l&&p[g]&&g++,p[g]={s:new ns,p:h},p[g].s.curves=s.curves,l&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!p[0])return n(o);if(p.length>1){for(var x=!1,_=[],b=0,w=p.length;b<w;b++)d[b]=[];for(b=0,w=p.length;b<w;b++)for(var M=m[b],E=0;E<M.length;E++){for(var T=M[E],S=!0,A=0;A<p.length;A++)r(T.p,p[A].p)&&(b!==A&&_.push({froms:b,tos:A,hole:E}),S?(S=!1,d[A].push(T)):x=!0);S&&d[b].push(T)}_.length>0&&(x||(m=d))}v=0;for(var R=p.length;v<R;v++){c=p[v].s,u.push(c);for(var L=0,P=(f=m[v]).length;L<P;L++)c.holes.push(f[L].h)}return u}}),Object.assign(is.prototype,{isFont:!0,generateShapes:function(t,e,n){function r(t,e,r,o){var a=i.glyphs[t]||i.glyphs["?"];if(a){var s,c,u,l,h,f,d,p,m,g,v,y=new rs,x=[];if(a.o)for(var _=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),b=0,w=_.length;b<w;){switch(_[b++]){case"m":s=_[b++]*e+r,c=_[b++]*e+o,y.moveTo(s,c);break;case"l":s=_[b++]*e+r,c=_[b++]*e+o,y.lineTo(s,c);break;case"q":if(u=_[b++]*e+r,l=_[b++]*e+o,d=_[b++]*e+r,p=_[b++]*e+o,y.quadraticCurveTo(d,p,u,l),v=x[x.length-1]){h=v.x,f=v.y;for(var M=1;M<=n;M++){Va(E=M/n,h,d,u),Va(E,f,p,l)}}break;case"b":if(u=_[b++]*e+r,l=_[b++]*e+o,d=_[b++]*e+r,p=_[b++]*e+o,m=_[b++]*e+r,g=_[b++]*e+o,y.bezierCurveTo(d,p,m,g,u,l),v=x[x.length-1]){h=v.x,f=v.y;for(M=1;M<=n;M++){var E;Wa(E=M/n,h,d,m,u),Wa(E,f,p,g,l)}}}}return{offsetX:a.ha*e,path:y}}}void 0===e&&(e=100),void 0===n&&(n=4);for(var i=this.data,o=function(t){for(var n=String(t).split(""),o=e/i.resolution,a=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*o,s=0,c=0,u=[],l=0;l<n.length;l++){var h=n[l];if("\n"===h)s=0,c-=a;else{var f=r(h,o,s,c);s+=f.offsetX,u.push(f.path)}}return u}(t),a=[],s=0,c=o.length;s<c;s++)Array.prototype.push.apply(a,o[s].toShapes());return a}}),Object.assign(os.prototype,{load:function(t,e,n,r){var i=this;new Qo(this.manager).load(t,function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var r=i.parse(n);e&&e(r)},n,r)},parse:function(t){return new is(t)}});var as,ss,cs,us,ls,hs,fs,ds,ps,ms,gs,vs,ys,xs,_s,bs,ws,Ms,Es={getContext:function(){return void 0===$a&&($a=new(window.AudioContext||window.webkitAudioContext)),$a},setContext:function(t){$a=t}};function Ts(t){this.manager=void 0!==t?t:Ko}function Ss(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new pr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new pr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function As(t,e,n){hr.call(this),this.type="CubeCamera";var r=new pr(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new He(1,0,0)),this.add(r);var i=new pr(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new He(-1,0,0)),this.add(i);var o=new pr(90,1,t,e);o.up.set(0,0,1),o.lookAt(new He(0,1,0)),this.add(o);var a=new pr(90,1,t,e);a.up.set(0,0,-1),a.lookAt(new He(0,-1,0)),this.add(a);var s=new pr(90,1,t,e);s.up.set(0,-1,0),s.lookAt(new He(0,0,1)),this.add(s);var c=new pr(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new He(0,0,-1)),this.add(c);var u={format:jt,magFilter:At,minFilter:At};this.renderTarget=new ze(n,n,u),this.renderTarget.texture.name="CubeCamera",this.updateCubeMap=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,t.render(e,r,n),n.activeCubeFace=1,t.render(e,i,n),n.activeCubeFace=2,t.render(e,o,n),n.activeCubeFace=3,t.render(e,a,n),n.activeCubeFace=4,t.render(e,s,n),n.texture.generateMipmaps=u,n.activeCubeFace=5,t.render(e,c,n),t.setRenderTarget(null)}}function Rs(){hr.call(this),this.type="AudioListener",this.context=Es.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Ls(t){hr.call(this),this.type="Audio",this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Ps(t){Ls.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Cs(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 Is(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}function Os(t,e,n){var r=n||Us.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function Us(t,e,n){this.path=e,this.parsedPath=n||Us.parseTrackName(e),this.node=Us.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Ns(t){this.uuid=Ae.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Ds(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var r=e.tracks,i=r.length,o=new Array(i),a={endingStart:he,endingEnd:he},s=0;s!==i;++s){var c=r[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ae,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 Fs(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Bs(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function zs(){zr.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Gs(t,e,n,r){this.uuid=Ae.generateUUID(),this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function Hs(t,e){this.uuid=Ae.generateUUID(),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.onUploadCallback=function(){},this.version=0}function ks(t,e,n){Hs.call(this,t,e),this.meshPerAttribute=n||1}function js(t,e,n){Ar.call(this,t,e),this.meshPerAttribute=n||1}function Vs(t,e,n,r){this.ray=new Wr(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 Ws(t,e){return t.distance-e.distance}function Xs(t,e,n,r){if(!1!==t.visible&&(t.raycast(e,n),!0===r))for(var i=t.children,o=0,a=i.length;o<a;o++)Xs(i[o],e,n,!0)}function qs(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Ys(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 Zs(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 Js(t,e){Yr.call(this,t,e),this.animationsMap={},this.animationsList=[];var n=this.geometry.morphTargets.length,r=n-1,i=n/1;this.createAnimation("__default",0,r,i),this.setAnimationWeight("__default",1)}function Ks(t){hr.call(this),this.material=t,this.render=function(t){}}function Qs(t,e,n,r){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==n?n:16711680,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var c=new zr,u=new Nr(2*a*3,3);c.addAttribute("position",u),ji.call(this,c,new Hi({color:i,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function $s(t){hr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;for(var e=new zr,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,i=1;r<32;r++,i++){var o=r/32*Math.PI*2,a=i/32*Math.PI*2;n.push(Math.cos(o),Math.sin(o),1,Math.cos(a),Math.sin(a),1)}e.addAttribute("position",new Nr(n,3));var s=new Hi({fog:!1});this.cone=new ji(e,s),this.add(this.cone),this.update()}function tc(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 zr,r=[],i=[],o=new In(0,0,1),a=new In(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(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.addAttribute("position",new Nr(r,3)),n.addAttribute("color",new Nr(i,3));var u=new Hi({vertexColors:R,depthTest:!1,depthWrite:!1,transparent:!0});ji.call(this,n,u),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.onBeforeRender()}function ec(t,e){this.light=t,this.light.updateMatrixWorld();var n=new Eo(e,4,2),r=new Vr({wireframe:!0,fog:!1});r.color.copy(this.light.color),Yr.call(this,n,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1}function nc(t){hr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;var e=new Hi({color:t.color}),n=new zr;n.addAttribute("position",new Ar(new Float32Array(15),3)),this.add(new ki(n,e)),this.update()}function rc(t,e){hr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;var n=new ao(e);n.rotateY(.5*Math.PI);var r=new Vr({vertexColors:R,wireframe:!0}),i=n.getAttribute("position"),o=new Float32Array(3*i.count);n.addAttribute("color",new Ar(o,3)),this.add(new Yr(n,r)),this.update()}function ic(t,e,n,r){t=t||10,e=e||10,n=new In(void 0!==n?n:4473924),r=new In(void 0!==r?r:8947848);for(var i=e/2,o=t/e,a=t/2,s=[],c=[],u=0,l=0,h=-a;u<=e;u++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var f=u===i?n:r;f.toArray(c,l),l+=3,f.toArray(c,l),l+=3,f.toArray(c,l),l+=3,f.toArray(c,l),l+=3}var d=new zr;d.addAttribute("position",new Nr(s,3)),d.addAttribute("color",new Nr(c,3));var p=new Hi({vertexColors:R});ji.call(this,d,p)}function oc(t,e,n,r,i,o){t=t||10,e=e||16,n=n||8,r=r||64,i=new In(void 0!==i?i:4473924),o=new In(void 0!==o?o:8947848);var a,s,c,u,l,h,f,d=[],p=[];for(u=0;u<=e;u++)c=u/e*(2*Math.PI),a=Math.sin(c)*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(a,0,s),f=1&u?i:o,p.push(f.r,f.g,f.b),p.push(f.r,f.g,f.b);for(u=0;u<=n;u++)for(f=1&u?i:o,h=t-t/n*u,l=0;l<r;l++)c=l/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),p.push(f.r,f.g,f.b),c=(l+1)/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),p.push(f.r,f.g,f.b);var m=new zr;m.addAttribute("position",new Nr(d,3)),m.addAttribute("color",new Nr(p,3));var g=new Hi({vertexColors:R});ji.call(this,m,g)}function ac(t,e,n,r){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==n?n:16776960,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new zr,u=new Nr(2*a*3,3);c.addAttribute("position",u),ji.call(this,c,new Hi({color:i,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function sc(t,e){hr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,void 0===e&&(e=1);var n=new zr;n.addAttribute("position",new Nr([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new Hi({fog:!1});this.add(new ki(n,r)),(n=new zr).addAttribute("position",new Nr([0,0,0,0,0,1],3)),this.add(new ki(n,r)),this.update()}function cc(t){var e=new zr,n=new Hi({color:16777215,vertexColors:A}),r=[],i=[],o={},a=new In(16755200),s=new In(16711680),c=new In(43775),u=new In(16777215),l=new In(3355443);function h(t,e,n){f(t,n),f(e,n)}function f(t,e){r.push(0,0,0),i.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(r.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",u),h("p","c",l),h("cn1","cn2",l),h("cn3","cn4",l),h("cf1","cf2",l),h("cf3","cf4",l),e.addAttribute("position",new Nr(r,3)),e.addAttribute("color",new Nr(i,3)),ji.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function uc(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 zr;i.setIndex(new Ar(n,1)),i.addAttribute("position",new Ar(r,3)),ji.call(this,i,new Hi({color:e})),this.matrixAutoUpdate=!1,this.update()}function lc(t,e,n,r,i,o){hr.call(this),void 0===r&&(r=16776960),void 0===n&&(n=1),void 0===i&&(i=.2*n),void 0===o&&(o=.2*i),void 0===_s&&((_s=new zr).addAttribute("position",new Nr([0,0,0,0,1,0],3)),(bs=new Oo(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new ki(_s,new Hi({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Yr(bs,new Vr({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,o)}function hc(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 zr;n.addAttribute("position",new Nr(e,3)),n.addAttribute("color",new Nr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Hi({vertexColors:R});ji.call(this,n,r)}function fc(){var t=0,e=0,n=0,r=0;function i(i,o,a,s){t=i,e=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(t,e,n,r,o){i(e,n,o*(n-t),o*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,o,a,s){var c=(e-t)/o-(n-t)/(o+a)+(n-e)/a,u=(n-e)/a-(r-e)/(a+s)+(r-n)/s;i(e,n,c*=a,u*=a)},calc:function(i){var o=i*i;return t+e*i+n*o+r*(o*i)}}}Object.assign(Ts.prototype,{load:function(t,e,n,r){var i=new Qo(this.manager);i.setResponseType("arraybuffer"),i.load(t,function(t){Es.getContext().decodeAudioData(t,function(t){e(t)})},n,r)}}),Object.assign(Ss.prototype,{update:(ps=new ke,ms=new ke,function(t){if(as!==this||ss!==t.focus||cs!==t.fov||us!==t.aspect*this.aspect||ls!==t.near||hs!==t.far||fs!==t.zoom||ds!==this.eyeSep){as=this,ss=t.focus,cs=t.fov,us=t.aspect*this.aspect,ls=t.near,hs=t.far,fs=t.zoom;var e,n,r=t.projectionMatrix.clone(),i=(ds=this.eyeSep/2)*ls/ss,o=ls*Math.tan(Ae.DEG2RAD*cs*.5)/fs;ms.elements[12]=-ds,ps.elements[12]=ds,e=-o*us+i,n=o*us+i,r.elements[0]=2*ls/(n-e),r.elements[8]=(n+e)/(n-e),this.cameraL.projectionMatrix.copy(r),e=-o*us-i,n=o*us-i,r.elements[0]=2*ls/(n-e),r.elements[8]=(n+e)/(n-e),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(ms),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(ps)})}),As.prototype=Object.create(hr.prototype),As.prototype.constructor=As,Rs.prototype=Object.assign(Object.create(hr.prototype),{constructor:Rs,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(t){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)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){this.gain.gain.value=t},updateMatrixWorld:function(){var t=new He,e=new Ge,n=new He,r=new He;return function(i){hr.prototype.updateMatrixWorld.call(this,i);var o=this.context.listener,a=this.up;this.matrixWorld.decompose(t,e,n),r.set(0,0,-1).applyQuaternion(e),o.positionX?(o.positionX.setValueAtTime(t.x,this.context.currentTime),o.positionY.setValueAtTime(t.y,this.context.currentTime),o.positionZ.setValueAtTime(t.z,this.context.currentTime),o.forwardX.setValueAtTime(r.x,this.context.currentTime),o.forwardY.setValueAtTime(r.y,this.context.currentTime),o.forwardZ.setValueAtTime(r.z,this.context.currentTime),o.upX.setValueAtTime(a.x,this.context.currentTime),o.upY.setValueAtTime(a.y,this.context.currentTime),o.upZ.setValueAtTime(a.z,this.context.currentTime)):(o.setPosition(t.x,t.y,t.z),o.setOrientation(r.x,r.y,r.z,a.x,a.y,a.z))}}()}),Ls.prototype=Object.assign(Object.create(hr.prototype),{constructor:Ls,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=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.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),t.start(0,this.startTime),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 this.source.stop(),this.startTime=this.context.currentTime,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.startTime=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var 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(this.filters.length>0){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},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.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(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.value=t,this}}),Ps.prototype=Object.assign(Object.create(Ls.prototype),{constructor:Ps,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){this.panner.refDistance=t},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){this.panner.rolloffFactor=t},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){this.panner.distanceModel=t},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){this.panner.maxDistance=t},updateMatrixWorld:function(){var t=new He;return function(e){hr.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}()}),Object.assign(Cs.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(Is.prototype,{accumulate:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,i<1){var a=3*e;this._mixBufferRegion(n,r,a,1-i,e)}for(var s=e,c=e+e;s!==c;++s)if(n[s]!==n[s+e]){o.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,o=r;i!==o;++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(r>=.5)for(var o=0;o!==i;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,r){Ge.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*r}}}),Object.assign(Os.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(Us,{Composite:Os,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Us.Composite(t,e,n):new Us(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parseTrackName:(gs=new RegExp("^"+/((?:[\w-]+[\/:])*)/.source+/([\w-\.]+)?/.source+/(?:\.([\w-]+)(?:\[(.+)\])?)?/.source+/\.([\w-]+)(?:\[(.+)\])?/.source+"$"),vs=["material","materials","bones"],function(t){var e=gs.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!==vs.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,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=function(t){for(var n=0;n<t.bones.length;n++){var r=t.bones[n];if(r.name===e)return r}return null}(t.skeleton);if(n)return n}if(t.children){var r=function(t){for(var n=0;n<t.length;n++){var i=t[n];if(i.name===e||i.uuid===e)return i;var o=r(i.children);if(o)return o}return null},i=r(t.children);if(i)return i}return null}}),Object.assign(Us.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.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[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=Us.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=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 a=0;a<t.length;a++)if(t[a].name===o){o=a;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!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[r];if(void 0!==s){var c=this.Versioning.None;void 0!==t.needsUpdate?(c=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t);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(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===i){i=a;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(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===i){i=a;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 l=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+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(Us.prototype,{_getValue_unbound:Us.prototype.getValue,_setValue_unbound:Us.prototype.setValue}),Object.assign(Ns.prototype,{isAnimationObjectGroup:!0,add:function(t){for(var e=this._objects,n=e.length,r=this.nCachedObjects_,i=this._indicesByUUID,o=this._paths,a=this._parsedPaths,s=this._bindings,c=s.length,u=0,l=arguments.length;u!==l;++u){var h=arguments[u],f=h.uuid,d=i[f],p=void 0;if(void 0===d){d=n++,i[f]=d,e.push(h);for(var m=0,g=c;m!==g;++m)s[m].push(new Us(h,o[m],a[m]))}else if(d<r){p=e[d];var v=--r,y=e[v];i[y.uuid]=d,e[d]=y,i[f]=v,e[v]=h;for(m=0,g=c;m!==g;++m){var x=s[m],_=x[v],b=x[d];x[d]=_,void 0===b&&(b=new Us(h,o[m],a[m])),x[v]=b}}else e[d]!==p&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=r},remove:function(t){for(var e=this._objects,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],u=c.uuid,l=r[u];if(void 0!==l&&l>=n){var h=n++,f=e[h];r[f.uuid]=l,e[l]=f,r[u]=h,e[h]=c;for(var d=0,p=o;d!==p;++d){var m=i[d],g=m[h],v=m[l];m[l]=g,m[h]=v}}}this.nCachedObjects_=n},uncache:function(t){for(var e=this._objects,n=e.length,r=this.nCachedObjects_,i=this._indicesByUUID,o=this._bindings,a=o.length,s=0,c=arguments.length;s!==c;++s){var u=arguments[s].uuid,l=i[u];if(void 0!==l)if(delete i[u],l<r){var h=--r,f=e[h],d=e[y=--n];i[f.uuid]=l,e[l]=f,i[d.uuid]=h,e[h]=d,e.pop();for(var p=0,m=a;p!==m;++p){var g=(x=o[p])[h],v=x[y];x[l]=g,x[h]=v,x.pop()}}else{var y;i[(d=e[y=--n]).uuid]=l,e[l]=d,e.pop();for(p=0,m=a;p!==m;++p){var x;(x=o[p])[l]=x[y],x.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,l=new Array(c);r=i.length,n[t]=r,o.push(t),a.push(e),i.push(l);for(var h=u,f=s.length;h!==f;++h){var d=s[h];l[h]=new Us(d,t,e)}return l},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}),Object.assign(Ds.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,o=i/r,a=r/i;t.warp(1,o,e),this.warp(a,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,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=t/a,c[1]=e/a,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 o=(t-i)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var c=this._interpolants,u=this._propertyBindings,l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].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,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,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var n=this._clip.duration,r=this.loop,i=this._loopCount;if(r===oe){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)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{var o=r===se;if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(0===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&i))return this.time=e,n-e}return this.time=e,e},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=fe,r.endingEnd=fe):(r.endingStart=t?this.zeroSlopeAtStart?fe:he:de,r.endingEnd=e?this.zeroSlopeAtEnd?fe:he:de)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}),Object.assign(Fs.prototype,r.prototype,{_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var l=0;l!==i;++l){var h=r[l],f=h.name,d=u[f];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,f));continue}var p=e&&e._propertyBindings[l].binding.parsedPath;++(d=new Is(Us.create(n,f,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,f),o[l]=d}a[l].resultBuffer=d.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,o=0,a=i.length;o!==a;++o){var s=i[o];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,o=i[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;n._cacheIndex=r,e[r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,c=s[s.length-1],u=t._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[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];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_addInactiveBinding:function(t,e,n){var r=this._bindingsByRootAndName,i=r[e],o=this._bindings;void 0===i&&(i={},r[e]=i),i[n]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete a[i];t:{for(var u in a)break t;delete o[r]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new ya(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];t.__cacheIndex=r,e[r]=t,i.__cacheIndex=n,e[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?La.findByName(n,t):t,o=null!==i?i.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var c=a.actionByRoot[r];if(void 0!==c)return c;s=a.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var u=new Ds(this,i,e);return this._bindAction(u,s),this._addInactiveAction(u,o,r),u},existingAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?La.findByName(n,t):t,o=i?i.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=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),o=this._accuIndex^=1,a=0;a!==n;++a){e[a]._update(r,t,i,o)}var s=this._bindings,c=this._nActiveBindings;for(a=0;a!==c;++a)s[a].apply(o);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 o=i.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var u=c._cacheIndex,l=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=u,e[u]=l,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 o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Bs.prototype.clone=function(){return new Bs(void 0===this.value.clone?this.value:this.value.clone())},zs.prototype=Object.assign(Object.create(zr.prototype),{constructor:zs,isInstancedBufferGeometry:!0,addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:n})},copy:function(t){var e=t.index;null!==e&&this.setIndex(e.clone());var n=t.attributes;for(var r in n){var i=n[r];this.addAttribute(r,i.clone())}for(var o=t.groups,a=0,s=o.length;a<s;a++){var c=o[a];this.addGroup(c.start,c.count,c.materialIndex)}return this}}),Object.defineProperties(Gs.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Gs.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}}),Object.defineProperty(Hs.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Hs.prototype,{isInterleavedBuffer:!0,setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.stride:0,this.array=t},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}}),ks.prototype=Object.assign(Object.create(Hs.prototype),{constructor:ks,isInstancedInterleavedBuffer:!0,copy:function(t){return Hs.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),js.prototype=Object.assign(Object.create(Ar.prototype),{constructor:js,isInstancedBufferAttribute:!0,copy:function(t){return Ar.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Vs.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){var n=[];return Xs(t,this,n,e),n.sort(Ws),n},intersectObjects:function(t,e){var n=[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var r=0,i=t.length;r<i;r++)Xs(t[r],this,n,e);return n.sort(Ws),n}}),Object.assign(qs.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}}),Object.assign(Ys.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.radius=t.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos(Ae.clamp(t.y/this.radius,-1,1))),this}}),Object.assign(Zs.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.radius=Math.sqrt(t.x*t.x+t.z*t.z),this.theta=Math.atan2(t.x,t.z),this.y=t.y,this}}),Js.prototype=Object.create(Yr.prototype),Js.prototype.constructor=Js,Js.prototype.createAnimation=function(t,e,n,r){var i={start:e,end:n,length:n-e+1,fps:r,duration:(n-e)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[t]=i,this.animationsList.push(i)},Js.prototype.autoCreateAnimations=function(t){for(var e,n=/([a-z]+)_?(\d+)/i,r={},i=this.geometry,o=0,a=i.morphTargets.length;o<a;o++){var s=i.morphTargets[o].name.match(n);if(s&&s.length>1)r[c=s[1]]||(r[c]={start:1/0,end:-1/0}),o<(u=r[c]).start&&(u.start=o),o>u.end&&(u.end=o),e||(e=c)}for(var c in r){var u=r[c];this.createAnimation(c,u.start,u.end,t)}this.firstAnimation=e},Js.prototype.setAnimationDirectionForward=function(t){var e=this.animationsMap[t];e&&(e.direction=1,e.directionBackwards=!1)},Js.prototype.setAnimationDirectionBackward=function(t){var e=this.animationsMap[t];e&&(e.direction=-1,e.directionBackwards=!0)},Js.prototype.setAnimationFPS=function(t,e){var n=this.animationsMap[t];n&&(n.fps=e,n.duration=(n.end-n.start)/n.fps)},Js.prototype.setAnimationDuration=function(t,e){var n=this.animationsMap[t];n&&(n.duration=e,n.fps=(n.end-n.start)/n.duration)},Js.prototype.setAnimationWeight=function(t,e){var n=this.animationsMap[t];n&&(n.weight=e)},Js.prototype.setAnimationTime=function(t,e){var n=this.animationsMap[t];n&&(n.time=e)},Js.prototype.getAnimationTime=function(t){var e=0,n=this.animationsMap[t];return n&&(e=n.time),e},Js.prototype.getAnimationDuration=function(t){var e=-1,n=this.animationsMap[t];return n&&(e=n.duration),e},Js.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},Js.prototype.stopAnimation=function(t){var e=this.animationsMap[t];e&&(e.active=!1)},Js.prototype.update=function(t){for(var e=0,n=this.animationsList.length;e<n;e++){var r=this.animationsList[e];if(r.active){var i=r.duration/r.length;r.time+=r.direction*t,r.mirroredLoop?(r.time>r.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time=r.time%r.duration,r.time<0&&(r.time+=r.duration));var o=r.start+Ae.clamp(Math.floor(r.time/i),0,r.length-1),a=r.weight;o!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*a,this.morphTargetInfluences[o]=0,r.lastFrame=r.currentFrame,r.currentFrame=o);var s=r.time%i/i;r.directionBackwards&&(s=1-s),r.currentFrame!==r.lastFrame?(this.morphTargetInfluences[r.currentFrame]=s*a,this.morphTargetInfluences[r.lastFrame]=(1-s)*a):this.morphTargetInfluences[r.currentFrame]=a}}},Ks.prototype=Object.create(hr.prototype),Ks.prototype.constructor=Ks,Ks.prototype.isImmediateRenderObject=!0,Qs.prototype=Object.create(ji.prototype),Qs.prototype.constructor=Qs,Qs.prototype.update=function(){var t=new He,e=new He,n=new $n;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,c=a.faces,u=0,l=0,h=c.length;l<h;l++)for(var f=c[l],d=0,p=f.vertexNormals.length;d<p;d++){var m=s[f[r[d]]],g=f.vertexNormals[d];t.copy(m).applyMatrix4(i),e.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(u,t.x,t.y,t.z),u+=1,o.setXYZ(u,e.x,e.y,e.z),u+=1}else if(a&&a.isBufferGeometry){var v=a.attributes.position,y=a.attributes.normal;for(u=0,d=0,p=v.count;d<p;d++)t.set(v.getX(d),v.getY(d),v.getZ(d)).applyMatrix4(i),e.set(y.getX(d),y.getY(d),y.getZ(d)),e.applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(u,t.x,t.y,t.z),u+=1,o.setXYZ(u,e.x,e.y,e.z),u+=1}o.needsUpdate=!0}}(),$s.prototype=Object.create(hr.prototype),$s.prototype.constructor=$s,$s.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},$s.prototype.update=(ys=new He,xs=new He,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),ys.setFromMatrixPosition(this.light.matrixWorld),xs.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(xs.sub(ys)),this.cone.material.color.copy(this.light.color)}),tc.prototype=Object.create(ji.prototype),tc.prototype.constructor=tc,tc.prototype.onBeforeRender=function(){var t=new He,e=new ke,n=new ke;return function(){var r=this.bones,i=this.geometry,o=i.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var a=0,s=0;a<r.length;a++){var c=r[a];c.parent&&c.parent.isBone&&(e.multiplyMatrices(n,c.matrixWorld),t.setFromMatrixPosition(e),o.setXYZ(s,t.x,t.y,t.z),e.multiplyMatrices(n,c.parent.matrixWorld),t.setFromMatrixPosition(e),o.setXYZ(s+1,t.x,t.y,t.z),s+=2)}i.getAttribute("position").needsUpdate=!0}}(),ec.prototype=Object.create(Yr.prototype),ec.prototype.constructor=ec,ec.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},ec.prototype.update=function(){this.material.color.copy(this.light.color)},nc.prototype=Object.create(hr.prototype),nc.prototype.constructor=nc,nc.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},nc.prototype.update=function(){var t=this.children[0];t.material.color.copy(this.light.color);var e=.5*this.light.width,n=.5*this.light.height,r=t.geometry.attributes.position,i=r.array;i[0]=e,i[1]=-n,i[2]=0,i[3]=e,i[4]=n,i[5]=0,i[6]=-e,i[7]=n,i[8]=0,i[9]=-e,i[10]=-n,i[11]=0,i[12]=e,i[13]=-n,i[14]=0,r.needsUpdate=!0},rc.prototype=Object.create(hr.prototype),rc.prototype.constructor=rc,rc.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},rc.prototype.update=function(){var t=new He,e=new In,n=new In;return function(){var r=this.children[0],i=r.geometry.getAttribute("color");e.copy(this.light.color),n.copy(this.light.groundColor);for(var o=0,a=i.count;o<a;o++){var s=o<a/2?e:n;i.setXYZ(o,s.r,s.g,s.b)}r.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate()),i.needsUpdate=!0}}(),ic.prototype=Object.create(ji.prototype),ic.prototype.constructor=ic,oc.prototype=Object.create(ji.prototype),oc.prototype.constructor=oc,ac.prototype=Object.create(ji.prototype),ac.prototype.constructor=ac,ac.prototype.update=function(){var t=new He,e=new He,n=new $n;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var r=this.object.matrixWorld,i=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,u=0,l=s.length;u<l;u++){var h=s[u],f=h.normal;t.copy(a[h.a]).add(a[h.b]).add(a[h.c]).divideScalar(3).applyMatrix4(r),e.copy(f).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),i.setXYZ(c,t.x,t.y,t.z),c+=1,i.setXYZ(c,e.x,e.y,e.z),c+=1}i.needsUpdate=!0}}(),sc.prototype=Object.create(hr.prototype),sc.prototype.constructor=sc,sc.prototype.dispose=function(){var t=this.children[0],e=this.children[1];t.geometry.dispose(),t.material.dispose(),e.geometry.dispose(),e.material.dispose()},sc.prototype.update=function(){var t=new He,e=new He,n=new He;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(e,t);var r=this.children[0],i=this.children[1];r.lookAt(n),r.material.color.copy(this.light.color),i.lookAt(n),i.scale.z=n.length()}}(),cc.prototype=Object.create(ji.prototype),cc.prototype.constructor=cc,cc.prototype.update=function(){var t,e,n=new He,r=new fr;function i(i,o,a,s){n.set(o,a,s).unproject(r);var c=e[i];if(void 0!==c)for(var u=t.getAttribute("position"),l=0,h=c.length;l<h;l++)u.setXYZ(c[l],n.x,n.y,n.z)}return function(){t=this.geometry,e=this.pointMap;r.projectionMatrix.copy(this.camera.projectionMatrix),i("c",0,0,-1),i("t",0,0,1),i("n1",-1,-1,-1),i("n2",1,-1,-1),i("n3",-1,1,-1),i("n4",1,1,-1),i("f1",-1,-1,1),i("f2",1,-1,1),i("f3",-1,1,1),i("f4",1,1,1),i("u1",.7,1.1,-1),i("u2",-.7,1.1,-1),i("u3",0,2,-1),i("cf1",-1,0,1),i("cf2",1,0,1),i("cf3",0,-1,1),i("cf4",0,1,1),i("cn1",-1,0,-1),i("cn2",1,0,-1),i("cn3",0,-1,-1),i("cn4",0,1,-1),t.getAttribute("position").needsUpdate=!0}}(),uc.prototype=Object.create(ji.prototype),uc.prototype.constructor=uc,uc.prototype.update=function(){var t=new Kn;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var n=t.min,r=t.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),uc.prototype.setFromObject=function(t){return this.object=t,this.update(),this},lc.prototype=Object.create(hr.prototype),lc.prototype.constructor=lc,lc.prototype.setDirection=(Ms=new He,function(t){t.y>.99999?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(Ms.set(t.z,0,-t.x).normalize(),ws=Math.acos(t.y),this.quaternion.setFromAxisAngle(Ms,ws))}),lc.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()},lc.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},hc.prototype=Object.create(ji.prototype),hc.prototype.constructor=hc;var dc=new He,pc=new fc,mc=new fc,gc=new fc;function vc(t){Xa.call(this),t.length<2&&console.warn("THREE.CatmullRomCurve3: Points array needs at least two entries."),this.points=t||[],this.closed=!1}function yc(t,e,n,r){Xa.call(this),this.v0=t,this.v1=e,this.v2=n,this.v3=r}function xc(t,e,n){Xa.call(this),this.v0=t,this.v1=e,this.v2=n}function _c(t,e){Xa.call(this),this.v1=t,this.v2=e}function bc(t,e,n,r,i,o){Za.call(this,t,e,n,n,r,i,o)}vc.prototype=Object.create(Xa.prototype),vc.prototype.constructor=vc,vc.prototype.getPoint=function(t){var e,n,r,i,o=this.points,a=o.length,s=(a-(this.closed?0:1))*t,c=Math.floor(s),u=s-c;if(this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/o.length)+1)*o.length:0===u&&c===a-1&&(c=a-2,u=1),this.closed||c>0?e=o[(c-1)%a]:(dc.subVectors(o[0],o[1]).add(o[0]),e=dc),n=o[c%a],r=o[(c+1)%a],this.closed||c+2<a?i=o[(c+2)%a]:(dc.subVectors(o[a-1],o[a-2]).add(o[a-1]),i=dc),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var l="chordal"===this.type?.5:.25,h=Math.pow(e.distanceToSquared(n),l),f=Math.pow(n.distanceToSquared(r),l),d=Math.pow(r.distanceToSquared(i),l);f<1e-4&&(f=1),h<1e-4&&(h=f),d<1e-4&&(d=f),pc.initNonuniformCatmullRom(e.x,n.x,r.x,i.x,h,f,d),mc.initNonuniformCatmullRom(e.y,n.y,r.y,i.y,h,f,d),gc.initNonuniformCatmullRom(e.z,n.z,r.z,i.z,h,f,d)}else if("catmullrom"===this.type){var p=void 0!==this.tension?this.tension:.5;pc.initCatmullRom(e.x,n.x,r.x,i.x,p),mc.initCatmullRom(e.y,n.y,r.y,i.y,p),gc.initCatmullRom(e.z,n.z,r.z,i.z,p)}return new He(pc.calc(u),mc.calc(u),gc.calc(u))},yc.prototype=Object.create(Xa.prototype),yc.prototype.constructor=yc,yc.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2,i=this.v3;return new He(Wa(t,e.x,n.x,r.x,i.x),Wa(t,e.y,n.y,r.y,i.y),Wa(t,e.z,n.z,r.z,i.z))},xc.prototype=Object.create(Xa.prototype),xc.prototype.constructor=xc,xc.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2;return new He(Va(t,e.x,n.x,r.x),Va(t,e.y,n.y,r.y),Va(t,e.z,n.z,r.z))},_c.prototype=Object.create(Xa.prototype),_c.prototype.constructor=_c,_c.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=new He;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e},bc.prototype=Object.create(Za.prototype),bc.prototype.constructor=bc;var wc={createMultiMaterialObject:function(t,e){for(var n=new qi,r=0,i=e.length;r<i;r++)n.add(new Yr(t,e[r]));return n},detach:function(t,e,n){t.applyMatrix(e.matrixWorld),e.remove(t),n.add(t)},attach:function(t,e,n){t.applyMatrix((new ke).getInverse(n.matrixWorld)),e.remove(t),n.add(t)}};function Mc(t,e,n,r,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new mr(t,e,n,i,o,a)}var Ec=0,Tc=1;function Sc(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Ac(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Rc(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Xi(t,e)}function Lc(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Di(t)}function Pc(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Xi(t,e)}function Cc(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Wi(t)}function Ic(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Wi(t)}function Oc(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Wi(t)}function Uc(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new He(t,e,n)}function Nc(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new Ar(t,e).setDynamic(!0)}function Dc(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Rr(t,e)}function Fc(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Lr(t,e)}function Bc(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Pr(t,e)}function zc(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Cr(t,e)}function Gc(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Ir(t,e)}function Hc(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Or(t,e)}function kc(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ur(t,e)}function jc(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Nr(t,e)}function Vc(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Dr(t,e)}function Wc(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),vc.call(this,t),this.type="catmullrom",this.closed=!0}function Xc(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),vc.call(this,t),this.type="catmullrom"}function qc(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),vc.call(this,t),this.type="catmullrom"}function Yc(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new uc(t,e)}function Zc(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new ji(new Co(t.geometry),new Hi({color:void 0!==e?e:16777215}))}function Jc(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new ji(new Qi(t.geometry),new Hi({color:void 0!==e?e:16777215}))}function Kc(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Qo(t)}function Qc(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ta(t)}Xa.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Xa.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Wc.prototype=Object.create(vc.prototype),Xc.prototype=Object.create(vc.prototype),qc.prototype=Object.create(vc.prototype),Object.assign(qc.prototype,{initFromArray:function(t){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(t){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(t){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),ic.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},tc.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Fn.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(Kn.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)}}),Xr.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Ae.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},Object.assign($n.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(t){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t,e,n){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(t,e,n){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(ke.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(){var t;return function(){return void 0===t&&(t=new He),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.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(t){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,e,n){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(t,e,n){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,o){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,o)}}),tr.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Ge.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(Wr.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(ns.prototype,{extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new xo(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Lo(this,t)}}),Object.assign(Re.prototype,{fromAttribute:function(t,e,n){return console.error("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)}}),Object.assign(He.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.error("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)}}),Object.assign(Fe.prototype,{fromAttribute:function(t,e,n){return console.error("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)}}),Sr.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(hr.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)}}),Object.defineProperties(hr.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(Fi.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Bi.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(Xa.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}}),pr.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(ia.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(Ar.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(zr.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(zr.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.defineProperties(Bs.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(Yn.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new In}}}),Object.defineProperties(jo.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(Zn.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(Pi.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},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.")}}),Object.defineProperties(Pi.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(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(nr.prototype,{cullFace:{get:function(){return this.renderReverseSided?p:d},set:function(t){var e=t!==d;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+e+"."),this.renderReverseSided=e}}}),Object.defineProperties(Be.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}}}),Ls.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Ts).load(t,function(t){e.setBuffer(t)}),this},Cs.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};var $c={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()}},tu={crossOrigin:void 0,loadTexture:function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new ra;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},loadTextureCube:function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new na;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}};function eu(){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 nu(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}},function(t,e,n){(function(t,r){var i;
/**
* @license
* Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(){var o,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="__lodash_hash_undefined__",l=500,h="__lodash_placeholder__",f=1,d=2,p=4,m=1,g=2,v=1,y=2,x=4,_=8,b=16,w=32,M=64,E=128,T=256,S=512,A=30,R="...",L=800,P=16,C=1,I=2,O=1/0,U=9007199254740991,N=1.7976931348623157e308,D=NaN,F=4294967295,B=F-1,z=F>>>1,G=[["ary",E],["bind",v],["bindKey",y],["curry",_],["curryRight",b],["flip",S],["partial",w],["partialRight",M],["rearg",T]],H="[object Arguments]",k="[object Array]",j="[object AsyncFunction]",V="[object Boolean]",W="[object Date]",X="[object DOMException]",q="[object Error]",Y="[object Function]",Z="[object GeneratorFunction]",J="[object Map]",K="[object Number]",Q="[object Null]",$="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",it="[object Symbol]",ot="[object Undefined]",at="[object WeakMap]",st="[object WeakSet]",ct="[object ArrayBuffer]",ut="[object DataView]",lt="[object Float32Array]",ht="[object Float64Array]",ft="[object Int8Array]",dt="[object Int16Array]",pt="[object Int32Array]",mt="[object Uint8Array]",gt="[object Uint8ClampedArray]",vt="[object Uint16Array]",yt="[object Uint32Array]",xt=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,Mt=/[&<>"']/g,Et=RegExp(wt.source),Tt=RegExp(Mt.source),St=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,Lt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pt=/^\w*$/,Ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,It=/[\\^$.*+?()[\]{}|]/g,Ot=RegExp(It.source),Ut=/^\s+|\s+$/g,Nt=/^\s+/,Dt=/\s+$/,Ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,zt=/,? & /,Gt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ht=/\\(\\)?/g,kt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jt=/\w*$/,Vt=/^[-+]0x[0-9a-f]+$/i,Wt=/^0b[01]+$/i,Xt=/^\[object .+?Constructor\]$/,qt=/^0o[0-7]+$/i,Yt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jt=/($^)/,Kt=/['\n\r\u2028\u2029\\]/g,Qt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",$t="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+$t+"]",ne="["+Qt+"]",re="\\d+",ie="[\\u2700-\\u27bf]",oe="[a-z\\xdf-\\xf6\\xf8-\\xff]",ae="[^\\ud800-\\udfff"+$t+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",ce="[^\\ud800-\\udfff]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",fe="(?:"+oe+"|"+ae+")",de="(?:"+he+"|"+ae+")",pe="(?:"+ne+"|"+se+")"+"?",me="[\\ufe0e\\ufe0f]?"+pe+("(?:\\u200d(?:"+[ce,ue,le].join("|")+")[\\ufe0e\\ufe0f]?"+pe+")*"),ge="(?:"+[ie,ue,le].join("|")+")"+me,ve="(?:"+[ce+ne+"?",ne,ue,le,te].join("|")+")",ye=RegExp("[']","g"),xe=RegExp(ne,"g"),_e=RegExp(se+"(?="+se+")|"+ve+me,"g"),be=RegExp([he+"?"+oe+"+(?:['](?:d|ll|m|re|s|t|ve))?(?="+[ee,he,"$"].join("|")+")",de+"+(?:['](?:D|LL|M|RE|S|T|VE))?(?="+[ee,he+fe,"$"].join("|")+")",he+"?"+fe+"+(?:['](?:d|ll|m|re|s|t|ve))?",he+"+(?:['](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,ge].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Qt+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Te=-1,Se={};Se[lt]=Se[ht]=Se[ft]=Se[dt]=Se[pt]=Se[mt]=Se[gt]=Se[vt]=Se[yt]=!0,Se[H]=Se[k]=Se[ct]=Se[V]=Se[ut]=Se[W]=Se[q]=Se[Y]=Se[J]=Se[K]=Se[$]=Se[et]=Se[nt]=Se[rt]=Se[at]=!1;var Ae={};Ae[H]=Ae[k]=Ae[ct]=Ae[ut]=Ae[V]=Ae[W]=Ae[lt]=Ae[ht]=Ae[ft]=Ae[dt]=Ae[pt]=Ae[J]=Ae[K]=Ae[$]=Ae[et]=Ae[nt]=Ae[rt]=Ae[it]=Ae[mt]=Ae[gt]=Ae[vt]=Ae[yt]=!0,Ae[q]=Ae[Y]=Ae[at]=!1;var Re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Le=parseFloat,Pe=parseInt,Ce="object"==typeof t&&t&&t.Object===Object&&t,Ie="object"==typeof self&&self&&self.Object===Object&&self,Oe=Ce||Ie||Function("return this")(),Ue=e&&!e.nodeType&&e,Ne=Ue&&"object"==typeof r&&r&&!r.nodeType&&r,De=Ne&&Ne.exports===Ue,Fe=De&&Ce.process,Be=function(){try{var t=Ne&&Ne.require&&Ne.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),ze=Be&&Be.isArrayBuffer,Ge=Be&&Be.isDate,He=Be&&Be.isMap,ke=Be&&Be.isRegExp,je=Be&&Be.isSet,Ve=Be&&Be.isTypedArray;function We(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Xe(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function qe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ye(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ze(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Je(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Ke(t,e){return!!(null==t?0:t.length)&&cn(t,e,0)>-1}function Qe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function $e(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function tn(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function en(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function nn(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function rn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var on=fn("length");function an(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function sn(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function cn(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):sn(t,ln,n)}function un(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function ln(t){return t!=t}function hn(t,e){var n=null==t?0:t.length;return n?mn(t,e)/n:D}function fn(t){return function(e){return null==e?o:e[t]}}function dn(t){return function(e){return null==t?o:t[e]}}function pn(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function mn(t,e){for(var n,r=-1,i=t.length;++r<i;){var a=e(t[r]);a!==o&&(n=n===o?a:n+a)}return n}function gn(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function vn(t){return function(e){return t(e)}}function yn(t,e){return $e(e,function(e){return t[e]})}function xn(t,e){return t.has(e)}function _n(t,e){for(var n=-1,r=t.length;++n<r&&cn(e,t[n],0)>-1;);return n}function bn(t,e){for(var n=t.length;n--&&cn(e,t[n],0)>-1;);return n}var wn=dn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mn=dn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function En(t){return"\\"+Re[t]}function Tn(t){return we.test(t)}function Sn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function An(t,e){return function(n){return t(e(n))}}function Rn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==h||(t[n]=h,o[i++]=n)}return o}function Ln(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function Pn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}function Cn(t){return Tn(t)?function(t){var e=_e.lastIndex=0;for(;_e.test(t);)++e;return e}(t):on(t)}function In(t){return Tn(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.split("")}(t)}var On=dn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Un=function t(e){var n,r=(e=null==e?Oe:Un.defaults(Oe.Object(),e,Un.pick(Oe,Ee))).Array,i=e.Date,Qt=e.Error,$t=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,ie=e.TypeError,oe=r.prototype,ae=$t.prototype,se=ee.prototype,ce=e["__core-js_shared__"],ue=ae.toString,le=se.hasOwnProperty,he=0,fe=(n=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",de=se.toString,pe=ue.call(ee),me=Oe._,ge=ne("^"+ue.call(le).replace(It,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ve=De?e.Buffer:o,_e=e.Symbol,we=e.Uint8Array,Re=ve?ve.allocUnsafe:o,Ce=An(ee.getPrototypeOf,ee),Ie=ee.create,Ue=se.propertyIsEnumerable,Ne=oe.splice,Fe=_e?_e.isConcatSpreadable:o,Be=_e?_e.iterator:o,on=_e?_e.toStringTag:o,dn=function(){try{var t=zo(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Nn=e.clearTimeout!==Oe.clearTimeout&&e.clearTimeout,Dn=i&&i.now!==Oe.Date.now&&i.now,Fn=e.setTimeout!==Oe.setTimeout&&e.setTimeout,Bn=te.ceil,zn=te.floor,Gn=ee.getOwnPropertySymbols,Hn=ve?ve.isBuffer:o,kn=e.isFinite,jn=oe.join,Vn=An(ee.keys,ee),Wn=te.max,Xn=te.min,qn=i.now,Yn=e.parseInt,Zn=te.random,Jn=oe.reverse,Kn=zo(e,"DataView"),Qn=zo(e,"Map"),$n=zo(e,"Promise"),tr=zo(e,"Set"),er=zo(e,"WeakMap"),nr=zo(ee,"create"),rr=er&&new er,ir={},or=ha(Kn),ar=ha(Qn),sr=ha($n),cr=ha(tr),ur=ha(er),lr=_e?_e.prototype:o,hr=lr?lr.valueOf:o,fr=lr?lr.toString:o;function dr(t){if(Rs(t)&&!vs(t)&&!(t instanceof vr)){if(t instanceof gr)return t;if(le.call(t,"__wrapped__"))return fa(t)}return new gr(t)}var pr=function(){function t(){}return function(e){if(!As(e))return{};if(Ie)return Ie(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function mr(){}function gr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function vr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function yr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function xr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function _r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function br(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new _r;++e<n;)this.add(t[e])}function wr(t){var e=this.__data__=new xr(t);this.size=e.size}function Mr(t,e){var n=vs(t),r=!n&&gs(t),i=!n&&!r&&bs(t),o=!n&&!r&&!i&&Ds(t),a=n||r||i||o,s=a?gn(t.length,re):[],c=s.length;for(var u in t)!e&&!le.call(t,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Xo(u,c))||s.push(u);return s}function Er(t){var e=t.length;return e?t[bi(0,e-1)]:o}function Tr(t,e){return ca(no(t),Ur(e,0,t.length))}function Sr(t){return ca(no(t))}function Ar(t,e,n){(n===o||ds(t[e],n))&&(n!==o||e in t)||Ir(t,e,n)}function Rr(t,e,n){var r=t[e];le.call(t,e)&&ds(r,n)&&(n!==o||e in t)||Ir(t,e,n)}function Lr(t,e){for(var n=t.length;n--;)if(ds(t[n][0],e))return n;return-1}function Pr(t,e,n,r){return zr(t,function(t,i,o){e(r,t,n(t),o)}),r}function Cr(t,e){return t&&ro(e,ic(e),t)}function Ir(t,e,n){"__proto__"==e&&dn?dn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Or(t,e){for(var n=-1,i=e.length,a=r(i),s=null==t;++n<i;)a[n]=s?o:$s(t,e[n]);return a}function Ur(t,e,n){return t==t&&(n!==o&&(t=t<=n?t:n),e!==o&&(t=t>=e?t:e)),t}function Nr(t,e,n,r,i,a){var s,c=e&f,u=e&d,l=e&p;if(n&&(s=i?n(t,r,i,a):n(t)),s!==o)return s;if(!As(t))return t;var h=vs(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&le.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!c)return no(t,s)}else{var m=ko(t),g=m==Y||m==Z;if(bs(t))return Ji(t,c);if(m==$||m==H||g&&!i){if(s=u||g?{}:Vo(t),!c)return u?function(t,e){return ro(t,Ho(t),e)}(t,function(t,e){return t&&ro(e,oc(e),t)}(s,t)):function(t,e){return ro(t,Go(t),e)}(t,Cr(s,t))}else{if(!Ae[m])return i?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case ct:return Ki(t);case V:case W:return new i(+t);case ut:return function(t,e){var n=e?Ki(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case lt:case ht:case ft:case dt:case pt:case mt:case gt:case vt:case yt:return Qi(t,n);case J:return new i;case K:case rt:return new i(t);case et:return function(t){var e=new t.constructor(t.source,jt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case nt:return new i;case it:return r=t,hr?ee(hr.call(r)):{}}}(t,m,c)}}a||(a=new wr);var v=a.get(t);if(v)return v;if(a.set(t,s),Os(t))return t.forEach(function(r){s.add(Nr(r,e,n,r,t,a))}),s;if(Ls(t))return t.forEach(function(r,i){s.set(i,Nr(r,e,n,i,t,a))}),s;var y=h?o:(l?u?Io:Co:u?oc:ic)(t);return qe(y||t,function(r,i){y&&(r=t[i=r]),Rr(s,i,Nr(r,e,n,i,t,a))}),s}function Dr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var i=n[r],a=e[i],s=t[i];if(s===o&&!(i in t)||!a(s))return!1}return!0}function Fr(t,e,n){if("function"!=typeof t)throw new ie(c);return ia(function(){t.apply(o,n)},e)}function Br(t,e,n,r){var i=-1,o=Ke,s=!0,c=t.length,u=[],l=e.length;if(!c)return u;n&&(e=$e(e,vn(n))),r?(o=Qe,s=!1):e.length>=a&&(o=xn,s=!1,e=new br(e));t:for(;++i<c;){var h=t[i],f=null==n?h:n(h);if(h=r||0!==h?h:0,s&&f==f){for(var d=l;d--;)if(e[d]===f)continue t;u.push(h)}else o(e,f,r)||u.push(h)}return u}dr.templateSettings={escape:St,evaluate:At,interpolate:Rt,variable:"",imports:{_:dr}},dr.prototype=mr.prototype,dr.prototype.constructor=dr,gr.prototype=pr(mr.prototype),gr.prototype.constructor=gr,vr.prototype=pr(mr.prototype),vr.prototype.constructor=vr,yr.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},yr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},yr.prototype.get=function(t){var e=this.__data__;if(nr){var n=e[t];return n===u?o:n}return le.call(e,t)?e[t]:o},yr.prototype.has=function(t){var e=this.__data__;return nr?e[t]!==o:le.call(e,t)},yr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nr&&e===o?u:e,this},xr.prototype.clear=function(){this.__data__=[],this.size=0},xr.prototype.delete=function(t){var e=this.__data__,n=Lr(e,t);return!(n<0||(n==e.length-1?e.pop():Ne.call(e,n,1),--this.size,0))},xr.prototype.get=function(t){var e=this.__data__,n=Lr(e,t);return n<0?o:e[n][1]},xr.prototype.has=function(t){return Lr(this.__data__,t)>-1},xr.prototype.set=function(t,e){var n=this.__data__,r=Lr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},_r.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Qn||xr),string:new yr}},_r.prototype.delete=function(t){var e=Fo(this,t).delete(t);return this.size-=e?1:0,e},_r.prototype.get=function(t){return Fo(this,t).get(t)},_r.prototype.has=function(t){return Fo(this,t).has(t)},_r.prototype.set=function(t,e){var n=Fo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},br.prototype.add=br.prototype.push=function(t){return this.__data__.set(t,u),this},br.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.clear=function(){this.__data__=new xr,this.size=0},wr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},wr.prototype.get=function(t){return this.__data__.get(t)},wr.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof xr){var r=n.__data__;if(!Qn||r.length<a-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new _r(r)}return n.set(t,e),this.size=n.size,this};var zr=ao(qr),Gr=ao(Yr,!0);function Hr(t,e){var n=!0;return zr(t,function(t,r,i){return n=!!e(t,r,i)}),n}function kr(t,e,n){for(var r=-1,i=t.length;++r<i;){var a=t[r],s=e(a);if(null!=s&&(c===o?s==s&&!Ns(s):n(s,c)))var c=s,u=a}return u}function jr(t,e){var n=[];return zr(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Vr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Wo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?Vr(s,e-1,n,r,i):tn(i,s):r||(i[i.length]=s)}return i}var Wr=so(),Xr=so(!0);function qr(t,e){return t&&Wr(t,e,ic)}function Yr(t,e){return t&&Xr(t,e,ic)}function Zr(t,e){return Je(e,function(e){return Es(t[e])})}function Jr(t,e){for(var n=0,r=(e=Xi(e,t)).length;null!=t&&n<r;)t=t[la(e[n++])];return n&&n==r?t:o}function Kr(t,e,n){var r=e(t);return vs(t)?r:tn(r,n(t))}function Qr(t){return null==t?t===o?ot:Q:on&&on in ee(t)?function(t){var e=le.call(t,on),n=t[on];try{t[on]=o;var r=!0}catch(t){}var i=de.call(t);return r&&(e?t[on]=n:delete t[on]),i}(t):function(t){return de.call(t)}(t)}function $r(t,e){return t>e}function ti(t,e){return null!=t&&le.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ni(t,e,n){for(var i=n?Qe:Ke,a=t[0].length,s=t.length,c=s,u=r(s),l=1/0,h=[];c--;){var f=t[c];c&&e&&(f=$e(f,vn(e))),l=Xn(f.length,l),u[c]=!n&&(e||a>=120&&f.length>=120)?new br(c&&f):o}f=t[0];var d=-1,p=u[0];t:for(;++d<a&&h.length<l;){var m=f[d],g=e?e(m):m;if(m=n||0!==m?m:0,!(p?xn(p,g):i(h,g,n))){for(c=s;--c;){var v=u[c];if(!(v?xn(v,g):i(t[c],g,n)))continue t}p&&p.push(g),h.push(m)}}return h}function ri(t,e,n){var r=null==(t=ea(t,e=Xi(e,t)))?t:t[la(Ma(e))];return null==r?o:We(r,t,n)}function ii(t){return Rs(t)&&Qr(t)==H}function oi(t,e,n,r,i){return t===e||(null==t||null==e||!Rs(t)&&!Rs(e)?t!=t&&e!=e:function(t,e,n,r,i,a){var s=vs(t),c=vs(e),u=s?k:ko(t),l=c?k:ko(e),h=(u=u==H?$:u)==$,f=(l=l==H?$:l)==$,d=u==l;if(d&&bs(t)){if(!bs(e))return!1;s=!0,h=!1}if(d&&!h)return a||(a=new wr),s||Ds(t)?Lo(t,e,n,r,i,a):function(t,e,n,r,i,o,a){switch(n){case ut:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ct:return!(t.byteLength!=e.byteLength||!o(new we(t),new we(e)));case V:case W:case K:return ds(+t,+e);case q:return t.name==e.name&&t.message==e.message;case et:case rt:return t==e+"";case J:var s=Sn;case nt:var c=r&m;if(s||(s=Ln),t.size!=e.size&&!c)return!1;var u=a.get(t);if(u)return u==e;r|=g,a.set(t,e);var l=Lo(s(t),s(e),r,i,o,a);return a.delete(t),l;case it:if(hr)return hr.call(t)==hr.call(e)}return!1}(t,e,u,n,r,i,a);if(!(n&m)){var p=h&&le.call(t,"__wrapped__"),v=f&&le.call(e,"__wrapped__");if(p||v){var y=p?t.value():t,x=v?e.value():e;return a||(a=new wr),i(y,x,n,r,a)}}return!!d&&(a||(a=new wr),function(t,e,n,r,i,a){var s=n&m,c=Co(t),u=c.length,l=Co(e).length;if(u!=l&&!s)return!1;for(var h=u;h--;){var f=c[h];if(!(s?f in e:le.call(e,f)))return!1}var d=a.get(t);if(d&&a.get(e))return d==e;var p=!0;a.set(t,e),a.set(e,t);for(var g=s;++h<u;){f=c[h];var v=t[f],y=e[f];if(r)var x=s?r(y,v,f,e,t,a):r(v,y,f,t,e,a);if(!(x===o?v===y||i(v,y,n,r,a):x)){p=!1;break}g||(g="constructor"==f)}if(p&&!g){var _=t.constructor,b=e.constructor;_!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,i,a))}(t,e,n,r,oi,i))}function ai(t,e,n,r){var i=n.length,a=i,s=!r;if(null==t)return!a;for(t=ee(t);i--;){var c=n[i];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++i<a;){var u=(c=n[i])[0],l=t[u],h=c[1];if(s&&c[2]){if(l===o&&!(u in t))return!1}else{var f=new wr;if(r)var d=r(l,h,u,t,e,f);if(!(d===o?oi(h,l,m|g,r,f):d))return!1}}return!0}function si(t){return!(!As(t)||(e=t,fe&&fe in e))&&(Es(t)?ge:Xt).test(ha(t));var e}function ci(t){return"function"==typeof t?t:null==t?Pc:"object"==typeof t?vs(t)?pi(t[0],t[1]):di(t):zc(t)}function ui(t){if(!Ko(t))return Vn(t);var e=[];for(var n in ee(t))le.call(t,n)&&"constructor"!=n&&e.push(n);return e}function li(t){if(!As(t))return function(t){var e=[];if(null!=t)for(var n in ee(t))e.push(n);return e}(t);var e=Ko(t),n=[];for(var r in t)("constructor"!=r||!e&&le.call(t,r))&&n.push(r);return n}function hi(t,e){return t<e}function fi(t,e){var n=-1,i=xs(t)?r(t.length):[];return zr(t,function(t,r,o){i[++n]=e(t,r,o)}),i}function di(t){var e=Bo(t);return 1==e.length&&e[0][2]?$o(e[0][0],e[0][1]):function(n){return n===t||ai(n,t,e)}}function pi(t,e){return Yo(t)&&Qo(e)?$o(la(t),e):function(n){var r=$s(n,t);return r===o&&r===e?tc(n,t):oi(e,r,m|g)}}function mi(t,e,n,r,i){t!==e&&Wr(e,function(a,s){if(As(a))i||(i=new wr),function(t,e,n,r,i,a,s){var c=na(t,n),u=na(e,n),l=s.get(u);if(l)Ar(t,n,l);else{var h=a?a(c,u,n+"",t,e,s):o,f=h===o;if(f){var d=vs(u),p=!d&&bs(u),m=!d&&!p&&Ds(u);h=u,d||p||m?vs(c)?h=c:_s(c)?h=no(c):p?(f=!1,h=Ji(u,!0)):m?(f=!1,h=Qi(u,!0)):h=[]:Cs(u)||gs(u)?(h=c,gs(c)?h=Vs(c):As(c)&&!Es(c)||(h=Vo(u))):f=!1}f&&(s.set(u,h),i(h,u,r,a,s),s.delete(u)),Ar(t,n,h)}}(t,e,s,n,mi,r,i);else{var c=r?r(na(t,s),a,s+"",t,e,i):o;c===o&&(c=a),Ar(t,s,c)}},oc)}function gi(t,e){var n=t.length;if(n)return Xo(e+=e<0?n:0,n)?t[e]:o}function vi(t,e,n){var r=-1;return e=$e(e.length?e:[Pc],vn(Do())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(fi(t,function(t,n,i){return{criteria:$e(e,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var c=$i(i[r],o[r]);if(c){if(r>=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return t.index-e.index}(t,e,n)})}function yi(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=Jr(t,a);n(s,a)&&Si(o,Xi(a,t),s)}return o}function xi(t,e,n,r){var i=r?un:cn,o=-1,a=e.length,s=t;for(t===e&&(e=no(e)),n&&(s=$e(t,vn(n)));++o<a;)for(var c=0,u=e[o],l=n?n(u):u;(c=i(s,l,c,r))>-1;)s!==t&&Ne.call(s,c,1),Ne.call(t,c,1);return t}function _i(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Xo(i)?Ne.call(t,i,1):Bi(t,i)}}return t}function bi(t,e){return t+zn(Zn()*(e-t+1))}function wi(t,e){var n="";if(!t||e<1||e>U)return n;do{e%2&&(n+=t),(e=zn(e/2))&&(t+=t)}while(e);return n}function Mi(t,e){return oa(ta(t,e,Pc),t+"")}function Ei(t){return Er(dc(t))}function Ti(t,e){var n=dc(t);return ca(n,Ur(e,0,n.length))}function Si(t,e,n,r){if(!As(t))return t;for(var i=-1,a=(e=Xi(e,t)).length,s=a-1,c=t;null!=c&&++i<a;){var u=la(e[i]),l=n;if(i!=s){var h=c[u];(l=r?r(h,u,c):o)===o&&(l=As(h)?h:Xo(e[i+1])?[]:{})}Rr(c,u,l),c=c[u]}return t}var Ai=rr?function(t,e){return rr.set(t,e),t}:Pc,Ri=dn?function(t,e){return dn(t,"toString",{configurable:!0,enumerable:!1,value:Ac(e),writable:!0})}:Pc;function Li(t){return ca(dc(t))}function Pi(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function Ci(t,e){var n;return zr(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function Ii(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=z){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!Ns(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return Oi(t,e,Pc,n)}function Oi(t,e,n,r){e=n(e);for(var i=0,a=null==t?0:t.length,s=e!=e,c=null===e,u=Ns(e),l=e===o;i<a;){var h=zn((i+a)/2),f=n(t[h]),d=f!==o,p=null===f,m=f==f,g=Ns(f);if(s)var v=r||m;else v=l?m&&(r||d):c?m&&d&&(r||!p):u?m&&d&&!p&&(r||!g):!p&&!g&&(r?f<=e:f<e);v?i=h+1:a=h}return Xn(a,B)}function Ui(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!ds(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function Ni(t){return"number"==typeof t?t:Ns(t)?D:+t}function Di(t){if("string"==typeof t)return t;if(vs(t))return $e(t,Di)+"";if(Ns(t))return fr?fr.call(t):"";var e=t+"";return"0"==e&&1/t==-O?"-0":e}function Fi(t,e,n){var r=-1,i=Ke,o=t.length,s=!0,c=[],u=c;if(n)s=!1,i=Qe;else if(o>=a){var l=e?null:Mo(t);if(l)return Ln(l);s=!1,i=xn,u=new br}else u=e?[]:c;t:for(;++r<o;){var h=t[r],f=e?e(h):h;if(h=n||0!==h?h:0,s&&f==f){for(var d=u.length;d--;)if(u[d]===f)continue t;e&&u.push(f),c.push(h)}else i(u,f,n)||(u!==c&&u.push(f),c.push(h))}return c}function Bi(t,e){return null==(t=ea(t,e=Xi(e,t)))||delete t[la(Ma(e))]}function zi(t,e,n,r){return Si(t,e,n(Jr(t,e)),r)}function Gi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Pi(t,r?0:o,r?o+1:i):Pi(t,r?o+1:0,r?i:o)}function Hi(t,e){var n=t;return n instanceof vr&&(n=n.value()),en(e,function(t,e){return e.func.apply(e.thisArg,tn([t],e.args))},n)}function ki(t,e,n){var i=t.length;if(i<2)return i?Fi(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=t[o],c=-1;++c<i;)c!=o&&(a[o]=Br(a[o]||s,t[c],e,n));return Fi(Vr(a,1),e,n)}function ji(t,e,n){for(var r=-1,i=t.length,a=e.length,s={};++r<i;){var c=r<a?e[r]:o;n(s,t[r],c)}return s}function Vi(t){return _s(t)?t:[]}function Wi(t){return"function"==typeof t?t:Pc}function Xi(t,e){return vs(t)?t:Yo(t,e)?[t]:ua(Ws(t))}var qi=Mi;function Yi(t,e,n){var r=t.length;return n=n===o?r:n,!e&&n>=r?t:Pi(t,e,n)}var Zi=Nn||function(t){return Oe.clearTimeout(t)};function Ji(t,e){if(e)return t.slice();var n=t.length,r=Re?Re(n):new t.constructor(n);return t.copy(r),r}function Ki(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Qi(t,e){var n=e?Ki(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function $i(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,a=Ns(t),s=e!==o,c=null===e,u=e==e,l=Ns(e);if(!c&&!l&&!a&&t>e||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&t<e||l&&n&&i&&!r&&!a||c&&n&&i||!s&&i||!u)return-1}return 0}function to(t,e,n,i){for(var o=-1,a=t.length,s=n.length,c=-1,u=e.length,l=Wn(a-s,0),h=r(u+l),f=!i;++c<u;)h[c]=e[c];for(;++o<s;)(f||o<a)&&(h[n[o]]=t[o]);for(;l--;)h[c++]=t[o++];return h}function eo(t,e,n,i){for(var o=-1,a=t.length,s=-1,c=n.length,u=-1,l=e.length,h=Wn(a-c,0),f=r(h+l),d=!i;++o<h;)f[o]=t[o];for(var p=o;++u<l;)f[p+u]=e[u];for(;++s<c;)(d||o<a)&&(f[p+n[s]]=t[o++]);return f}function no(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function ro(t,e,n,r){var i=!n;n||(n={});for(var a=-1,s=e.length;++a<s;){var c=e[a],u=r?r(n[c],t[c],c,n,t):o;u===o&&(u=t[c]),i?Ir(n,c,u):Rr(n,c,u)}return n}function io(t,e){return function(n,r){var i=vs(n)?Xe:Pr,o=e?e():{};return i(n,t,Do(r,2),o)}}function oo(t){return Mi(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,s=i>2?n[2]:o;for(a=t.length>3&&"function"==typeof a?(i--,a):o,s&&qo(n[0],n[1],s)&&(a=i<3?o:a,i=1),e=ee(e);++r<i;){var c=n[r];c&&t(e,c,r,a)}return e})}function ao(t,e){return function(n,r){if(null==n)return n;if(!xs(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=ee(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function so(t){return function(e,n,r){for(var i=-1,o=ee(e),a=r(e),s=a.length;s--;){var c=a[t?s:++i];if(!1===n(o[c],c,o))break}return e}}function co(t){return function(e){var n=Tn(e=Ws(e))?In(e):o,r=n?n[0]:e.charAt(0),i=n?Yi(n,1).join(""):e.slice(1);return r[t]()+i}}function uo(t){return function(e){return en(Ec(gc(e).replace(ye,"")),t,"")}}function lo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=pr(t.prototype),r=t.apply(n,e);return As(r)?r:n}}function ho(t){return function(e,n,r){var i=ee(e);if(!xs(e)){var a=Do(n,3);e=ic(e),n=function(t){return a(i[t],t,i)}}var s=t(e,n,r);return s>-1?i[a?e[s]:s]:o}}function fo(t){return Po(function(e){var n=e.length,r=n,i=gr.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new ie(c);if(i&&!s&&"wrapper"==Uo(a))var s=new gr([],!0)}for(r=s?r:n;++r<n;){var u=Uo(a=e[r]),l="wrapper"==u?Oo(a):o;s=l&&Zo(l[0])&&l[1]==(E|_|w|T)&&!l[4].length&&1==l[9]?s[Uo(l[0])].apply(s,l[3]):1==a.length&&Zo(a)?s[u]():s.thru(a)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&vs(r))return s.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}})}function po(t,e,n,i,a,s,c,u,l,h){var f=e&E,d=e&v,p=e&y,m=e&(_|b),g=e&S,x=p?o:lo(t);return function v(){for(var y=arguments.length,_=r(y),b=y;b--;)_[b]=arguments[b];if(m)var w=No(v),M=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,w);if(i&&(_=to(_,i,a,m)),s&&(_=eo(_,s,c,m)),y-=M,m&&y<h){var E=Rn(_,w);return bo(t,e,po,v.placeholder,n,_,E,u,l,h-y)}var T=d?n:this,S=p?T[t]:t;return y=_.length,u?_=function(t,e){for(var n=t.length,r=Xn(e.length,n),i=no(t);r--;){var a=e[r];t[r]=Xo(a,n)?i[a]:o}return t}(_,u):g&&y>1&&_.reverse(),f&&l<y&&(_.length=l),this&&this!==Oe&&this instanceof v&&(S=x||lo(S)),S.apply(T,_)}}function mo(t,e){return function(n,r){return function(t,e,n,r){return qr(t,function(t,i,o){e(r,n(t),i,o)}),r}(n,t,e(r),{})}}function go(t,e){return function(n,r){var i;if(n===o&&r===o)return e;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=Di(n),r=Di(r)):(n=Ni(n),r=Ni(r)),i=t(n,r)}return i}}function vo(t){return Po(function(e){return e=$e(e,vn(Do())),Mi(function(n){var r=this;return t(e,function(t){return We(t,r,n)})})})}function yo(t,e){var n=(e=e===o?" ":Di(e)).length;if(n<2)return n?wi(e,t):e;var r=wi(e,Bn(t/Cn(e)));return Tn(e)?Yi(In(r),0,t).join(""):r.slice(0,t)}function xo(t){return function(e,n,i){return i&&"number"!=typeof i&&qo(e,n,i)&&(n=i=o),e=Gs(e),n===o?(n=e,e=0):n=Gs(n),function(t,e,n,i){for(var o=-1,a=Wn(Bn((e-t)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=t,t+=n;return s}(e,n,i=i===o?e<n?1:-1:Gs(i),t)}}function _o(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=js(e),n=js(n)),t(e,n)}}function bo(t,e,n,r,i,a,s,c,u,l){var h=e&_;e|=h?w:M,(e&=~(h?M:w))&x||(e&=~(v|y));var f=[t,e,i,h?a:o,h?s:o,h?o:a,h?o:s,c,u,l],d=n.apply(o,f);return Zo(t)&&ra(d,f),d.placeholder=r,aa(d,t,e)}function wo(t){var e=te[t];return function(t,n){if(t=js(t),n=null==n?0:Xn(Hs(n),292)){var r=(Ws(t)+"e").split("e");return+((r=(Ws(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Mo=tr&&1/Ln(new tr([,-0]))[1]==O?function(t){return new tr(t)}:Nc;function Eo(t){return function(e){var n=ko(e);return n==J?Sn(e):n==nt?Pn(e):function(t,e){return $e(e,function(e){return[e,t[e]]})}(e,t(e))}}function To(t,e,n,i,a,s,u,l){var f=e&y;if(!f&&"function"!=typeof t)throw new ie(c);var d=i?i.length:0;if(d||(e&=~(w|M),i=a=o),u=u===o?u:Wn(Hs(u),0),l=l===o?l:Hs(l),d-=a?a.length:0,e&M){var p=i,m=a;i=a=o}var g=f?o:Oo(t),S=[t,e,n,i,a,p,m,s,u,l];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<(v|y|E),a=r==E&&n==_||r==E&&n==T&&t[7].length<=e[8]||r==(E|T)&&e[7].length<=e[8]&&n==_;if(!o&&!a)return t;r&v&&(t[2]=e[2],i|=n&v?0:x);var s=e[3];if(s){var c=t[3];t[3]=c?to(c,s,e[4]):s,t[4]=c?Rn(t[3],h):e[4]}(s=e[5])&&(c=t[5],t[5]=c?eo(c,s,e[6]):s,t[6]=c?Rn(t[5],h):e[6]),(s=e[7])&&(t[7]=s),r&E&&(t[8]=null==t[8]?e[8]:Xn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(S,g),t=S[0],e=S[1],n=S[2],i=S[3],a=S[4],!(l=S[9]=S[9]===o?f?0:t.length:Wn(S[9]-d,0))&&e&(_|b)&&(e&=~(_|b)),e&&e!=v)A=e==_||e==b?function(t,e,n){var i=lo(t);return function a(){for(var s=arguments.length,c=r(s),u=s,l=No(a);u--;)c[u]=arguments[u];var h=s<3&&c[0]!==l&&c[s-1]!==l?[]:Rn(c,l);return(s-=h.length)<n?bo(t,e,po,a.placeholder,o,c,h,o,o,n-s):We(this&&this!==Oe&&this instanceof a?i:t,this,c)}}(t,e,l):e!=w&&e!=(v|w)||a.length?po.apply(o,S):function(t,e,n,i){var o=e&v,a=lo(t);return function e(){for(var s=-1,c=arguments.length,u=-1,l=i.length,h=r(l+c),f=this&&this!==Oe&&this instanceof e?a:t;++u<l;)h[u]=i[u];for(;c--;)h[u++]=arguments[++s];return We(f,o?n:this,h)}}(t,e,n,i);else var A=function(t,e,n){var r=e&v,i=lo(t);return function e(){return(this&&this!==Oe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return aa((g?Ai:ra)(A,S),t,e)}function So(t,e,n,r){return t===o||ds(t,se[n])&&!le.call(r,n)?e:t}function Ao(t,e,n,r,i,a){return As(t)&&As(e)&&(a.set(e,t),mi(t,e,o,Ao,a),a.delete(e)),t}function Ro(t){return Cs(t)?o:t}function Lo(t,e,n,r,i,a){var s=n&m,c=t.length,u=e.length;if(c!=u&&!(s&&u>c))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var h=-1,f=!0,d=n&g?new br:o;for(a.set(t,e),a.set(e,t);++h<c;){var p=t[h],v=e[h];if(r)var y=s?r(v,p,h,e,t,a):r(p,v,h,t,e,a);if(y!==o){if(y)continue;f=!1;break}if(d){if(!rn(e,function(t,e){if(!xn(d,e)&&(p===t||i(p,t,n,r,a)))return d.push(e)})){f=!1;break}}else if(p!==v&&!i(p,v,n,r,a)){f=!1;break}}return a.delete(t),a.delete(e),f}function Po(t){return oa(ta(t,o,ya),t+"")}function Co(t){return Kr(t,ic,Go)}function Io(t){return Kr(t,oc,Ho)}var Oo=rr?function(t){return rr.get(t)}:Nc;function Uo(t){for(var e=t.name+"",n=ir[e],r=le.call(ir,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function No(t){return(le.call(dr,"placeholder")?dr:t).placeholder}function Do(){var t=dr.iteratee||Cc;return t=t===Cc?ci:t,arguments.length?t(arguments[0],arguments[1]):t}function Fo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Bo(t){for(var e=ic(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Qo(i)]}return e}function zo(t,e){var n=function(t,e){return null==t?o:t[e]}(t,e);return si(n)?n:o}var Go=Gn?function(t){return null==t?[]:(t=ee(t),Je(Gn(t),function(e){return Ue.call(t,e)}))}:kc,Ho=Gn?function(t){for(var e=[];t;)tn(e,Go(t)),t=Ce(t);return e}:kc,ko=Qr;function jo(t,e,n){for(var r=-1,i=(e=Xi(e,t)).length,o=!1;++r<i;){var a=la(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ss(i)&&Xo(a,i)&&(vs(t)||gs(t))}function Vo(t){return"function"!=typeof t.constructor||Ko(t)?{}:pr(Ce(t))}function Wo(t){return vs(t)||gs(t)||!!(Fe&&t&&t[Fe])}function Xo(t,e){var n=typeof t;return!!(e=null==e?U:e)&&("number"==n||"symbol"!=n&&Yt.test(t))&&t>-1&&t%1==0&&t<e}function qo(t,e,n){if(!As(n))return!1;var r=typeof e;return!!("number"==r?xs(n)&&Xo(e,n.length):"string"==r&&e in n)&&ds(n[e],t)}function Yo(t,e){if(vs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ns(t))||Pt.test(t)||!Lt.test(t)||null!=e&&t in ee(e)}function Zo(t){var e=Uo(t),n=dr[e];if("function"!=typeof n||!(e in vr.prototype))return!1;if(t===n)return!0;var r=Oo(n);return!!r&&t===r[0]}(Kn&&ko(new Kn(new ArrayBuffer(1)))!=ut||Qn&&ko(new Qn)!=J||$n&&"[object Promise]"!=ko($n.resolve())||tr&&ko(new tr)!=nt||er&&ko(new er)!=at)&&(ko=function(t){var e=Qr(t),n=e==$?t.constructor:o,r=n?ha(n):"";if(r)switch(r){case or:return ut;case ar:return J;case sr:return"[object Promise]";case cr:return nt;case ur:return at}return e});var Jo=ce?Es:jc;function Ko(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||se)}function Qo(t){return t==t&&!As(t)}function $o(t,e){return function(n){return null!=n&&n[t]===e&&(e!==o||t in ee(n))}}function ta(t,e,n){return e=Wn(e===o?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=Wn(i.length-e,0),s=r(a);++o<a;)s[o]=i[e+o];o=-1;for(var c=r(e+1);++o<e;)c[o]=i[o];return c[e]=n(s),We(t,this,c)}}function ea(t,e){return e.length<2?t:Jr(t,Pi(e,0,-1))}function na(t,e){if("__proto__"!=e)return t[e]}var ra=sa(Ai),ia=Fn||function(t,e){return Oe.setTimeout(t,e)},oa=sa(Ri);function aa(t,e,n){var r=e+"";return oa(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Ft,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return qe(G,function(n){var r="_."+n[0];e&n[1]&&!Ke(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(Bt);return e?e[1].split(zt):[]}(r),n)))}function sa(t){var e=0,n=0;return function(){var r=qn(),i=P-(r-n);if(n=r,i>0){if(++e>=L)return arguments[0]}else e=0;return t.apply(o,arguments)}}function ca(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n<e;){var a=bi(n,i),s=t[a];t[a]=t[n],t[n]=s}return t.length=e,t}var ua=function(t){var e=ss(t,function(t){return n.size===l&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ct,function(t,n,r,i){e.push(r?i.replace(Ht,"$1"):n||t)}),e});function la(t){if("string"==typeof t||Ns(t))return t;var e=t+"";return"0"==e&&1/t==-O?"-0":e}function ha(t){if(null!=t){try{return ue.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function fa(t){if(t instanceof vr)return t.clone();var e=new gr(t.__wrapped__,t.__chain__);return e.__actions__=no(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var da=Mi(function(t,e){return _s(t)?Br(t,Vr(e,1,_s,!0)):[]}),pa=Mi(function(t,e){var n=Ma(e);return _s(n)&&(n=o),_s(t)?Br(t,Vr(e,1,_s,!0),Do(n,2)):[]}),ma=Mi(function(t,e){var n=Ma(e);return _s(n)&&(n=o),_s(t)?Br(t,Vr(e,1,_s,!0),o,n):[]});function ga(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Hs(n);return i<0&&(i=Wn(r+i,0)),sn(t,Do(e,3),i)}function va(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==o&&(i=Hs(n),i=n<0?Wn(r+i,0):Xn(i,r-1)),sn(t,Do(e,3),i,!0)}function ya(t){return null!=t&&t.length?Vr(t,1):[]}function xa(t){return t&&t.length?t[0]:o}var _a=Mi(function(t){var e=$e(t,Vi);return e.length&&e[0]===t[0]?ni(e):[]}),ba=Mi(function(t){var e=Ma(t),n=$e(t,Vi);return e===Ma(n)?e=o:n.pop(),n.length&&n[0]===t[0]?ni(n,Do(e,2)):[]}),wa=Mi(function(t){var e=Ma(t),n=$e(t,Vi);return(e="function"==typeof e?e:o)&&n.pop(),n.length&&n[0]===t[0]?ni(n,o,e):[]});function Ma(t){var e=null==t?0:t.length;return e?t[e-1]:o}var Ea=Mi(Ta);function Ta(t,e){return t&&t.length&&e&&e.length?xi(t,e):t}var Sa=Po(function(t,e){var n=null==t?0:t.length,r=Or(t,e);return _i(t,$e(e,function(t){return Xo(t,n)?+t:t}).sort($i)),r});function Aa(t){return null==t?t:Jn.call(t)}var Ra=Mi(function(t){return Fi(Vr(t,1,_s,!0))}),La=Mi(function(t){var e=Ma(t);return _s(e)&&(e=o),Fi(Vr(t,1,_s,!0),Do(e,2))}),Pa=Mi(function(t){var e=Ma(t);return e="function"==typeof e?e:o,Fi(Vr(t,1,_s,!0),o,e)});function Ca(t){if(!t||!t.length)return[];var e=0;return t=Je(t,function(t){if(_s(t))return e=Wn(t.length,e),!0}),gn(e,function(e){return $e(t,fn(e))})}function Ia(t,e){if(!t||!t.length)return[];var n=Ca(t);return null==e?n:$e(n,function(t){return We(e,o,t)})}var Oa=Mi(function(t,e){return _s(t)?Br(t,e):[]}),Ua=Mi(function(t){return ki(Je(t,_s))}),Na=Mi(function(t){var e=Ma(t);return _s(e)&&(e=o),ki(Je(t,_s),Do(e,2))}),Da=Mi(function(t){var e=Ma(t);return e="function"==typeof e?e:o,ki(Je(t,_s),o,e)}),Fa=Mi(Ca);var Ba=Mi(function(t){var e=t.length,n=e>1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,Ia(t,n)});function za(t){var e=dr(t);return e.__chain__=!0,e}function Ga(t,e){return e(t)}var Ha=Po(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof vr&&Xo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Ga,args:[i],thisArg:o}),new gr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(o),t})):this.thru(i)});var ka=io(function(t,e,n){le.call(t,n)?++t[n]:Ir(t,n,1)});var ja=ho(ga),Va=ho(va);function Wa(t,e){return(vs(t)?qe:zr)(t,Do(e,3))}function Xa(t,e){return(vs(t)?Ye:Gr)(t,Do(e,3))}var qa=io(function(t,e,n){le.call(t,n)?t[n].push(e):Ir(t,n,[e])});var Ya=Mi(function(t,e,n){var i=-1,o="function"==typeof e,a=xs(t)?r(t.length):[];return zr(t,function(t){a[++i]=o?We(e,t,n):ri(t,e,n)}),a}),Za=io(function(t,e,n){Ir(t,n,e)});function Ja(t,e){return(vs(t)?$e:fi)(t,Do(e,3))}var Ka=io(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Qa=Mi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&qo(t,e[0],e[1])?e=[]:n>2&&qo(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,Vr(e,1),[])}),$a=Dn||function(){return Oe.Date.now()};function ts(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,To(t,E,o,o,o,o,e)}function es(t,e){var n;if("function"!=typeof e)throw new ie(c);return t=Hs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var ns=Mi(function(t,e,n){var r=v;if(n.length){var i=Rn(n,No(ns));r|=w}return To(t,r,e,n,i)}),rs=Mi(function(t,e,n){var r=v|y;if(n.length){var i=Rn(n,No(rs));r|=w}return To(e,r,t,n,i)});function is(t,e,n){var r,i,a,s,u,l,h=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new ie(c);function m(e){var n=r,a=i;return r=i=o,h=e,s=t.apply(a,n)}function g(t){var n=t-l;return l===o||n>=e||n<0||d&&t-h>=a}function v(){var t=$a();if(g(t))return y(t);u=ia(v,function(t){var n=e-(t-l);return d?Xn(n,a-(t-h)):n}(t))}function y(t){return u=o,p&&r?m(t):(r=i=o,s)}function x(){var t=$a(),n=g(t);if(r=arguments,i=this,l=t,n){if(u===o)return function(t){return h=t,u=ia(v,e),f?m(t):s}(l);if(d)return u=ia(v,e),m(l)}return u===o&&(u=ia(v,e)),s}return e=js(e)||0,As(n)&&(f=!!n.leading,a=(d="maxWait"in n)?Wn(js(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),x.cancel=function(){u!==o&&Zi(u),h=0,r=l=i=u=o},x.flush=function(){return u===o?s:y($a())},x}var os=Mi(function(t,e){return Fr(t,1,e)}),as=Mi(function(t,e,n){return Fr(t,js(e)||0,n)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(c);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ss.Cache||_r),n}function cs(t){if("function"!=typeof t)throw new ie(c);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=_r;var us=qi(function(t,e){var n=(e=1==e.length&&vs(e[0])?$e(e[0],vn(Do())):$e(Vr(e,1),vn(Do()))).length;return Mi(function(r){for(var i=-1,o=Xn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return We(t,this,r)})}),ls=Mi(function(t,e){var n=Rn(e,No(ls));return To(t,w,o,e,n)}),hs=Mi(function(t,e){var n=Rn(e,No(hs));return To(t,M,o,e,n)}),fs=Po(function(t,e){return To(t,T,o,o,o,e)});function ds(t,e){return t===e||t!=t&&e!=e}var ps=_o($r),ms=_o(function(t,e){return t>=e}),gs=ii(function(){return arguments}())?ii:function(t){return Rs(t)&&le.call(t,"callee")&&!Ue.call(t,"callee")},vs=r.isArray,ys=ze?vn(ze):function(t){return Rs(t)&&Qr(t)==ct};function xs(t){return null!=t&&Ss(t.length)&&!Es(t)}function _s(t){return Rs(t)&&xs(t)}var bs=Hn||jc,ws=Ge?vn(Ge):function(t){return Rs(t)&&Qr(t)==W};function Ms(t){if(!Rs(t))return!1;var e=Qr(t);return e==q||e==X||"string"==typeof t.message&&"string"==typeof t.name&&!Cs(t)}function Es(t){if(!As(t))return!1;var e=Qr(t);return e==Y||e==Z||e==j||e==tt}function Ts(t){return"number"==typeof t&&t==Hs(t)}function Ss(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=U}function As(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Rs(t){return null!=t&&"object"==typeof t}var Ls=He?vn(He):function(t){return Rs(t)&&ko(t)==J};function Ps(t){return"number"==typeof t||Rs(t)&&Qr(t)==K}function Cs(t){if(!Rs(t)||Qr(t)!=$)return!1;var e=Ce(t);if(null===e)return!0;var n=le.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ue.call(n)==pe}var Is=ke?vn(ke):function(t){return Rs(t)&&Qr(t)==et};var Os=je?vn(je):function(t){return Rs(t)&&ko(t)==nt};function Us(t){return"string"==typeof t||!vs(t)&&Rs(t)&&Qr(t)==rt}function Ns(t){return"symbol"==typeof t||Rs(t)&&Qr(t)==it}var Ds=Ve?vn(Ve):function(t){return Rs(t)&&Ss(t.length)&&!!Se[Qr(t)]};var Fs=_o(hi),Bs=_o(function(t,e){return t<=e});function zs(t){if(!t)return[];if(xs(t))return Us(t)?In(t):no(t);if(Be&&t[Be])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Be]());var e=ko(t);return(e==J?Sn:e==nt?Ln:dc)(t)}function Gs(t){return t?(t=js(t))===O||t===-O?(t<0?-1:1)*N:t==t?t:0:0===t?t:0}function Hs(t){var e=Gs(t),n=e%1;return e==e?n?e-n:e:0}function ks(t){return t?Ur(Hs(t),0,F):0}function js(t){if("number"==typeof t)return t;if(Ns(t))return D;if(As(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=As(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Ut,"");var n=Wt.test(t);return n||qt.test(t)?Pe(t.slice(2),n?2:8):Vt.test(t)?D:+t}function Vs(t){return ro(t,oc(t))}function Ws(t){return null==t?"":Di(t)}var Xs=oo(function(t,e){if(Ko(e)||xs(e))ro(e,ic(e),t);else for(var n in e)le.call(e,n)&&Rr(t,n,e[n])}),qs=oo(function(t,e){ro(e,oc(e),t)}),Ys=oo(function(t,e,n,r){ro(e,oc(e),t,r)}),Zs=oo(function(t,e,n,r){ro(e,ic(e),t,r)}),Js=Po(Or);var Ks=Mi(function(t,e){t=ee(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&qo(e[0],e[1],i)&&(r=1);++n<r;)for(var a=e[n],s=oc(a),c=-1,u=s.length;++c<u;){var l=s[c],h=t[l];(h===o||ds(h,se[l])&&!le.call(t,l))&&(t[l]=a[l])}return t}),Qs=Mi(function(t){return t.push(o,Ao),We(sc,o,t)});function $s(t,e,n){var r=null==t?o:Jr(t,e);return r===o?n:r}function tc(t,e){return null!=t&&jo(t,e,ei)}var ec=mo(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),t[e]=n},Ac(Pc)),nc=mo(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=de.call(e)),le.call(t,e)?t[e].push(n):t[e]=[n]},Do),rc=Mi(ri);function ic(t){return xs(t)?Mr(t):ui(t)}function oc(t){return xs(t)?Mr(t,!0):li(t)}var ac=oo(function(t,e,n){mi(t,e,n)}),sc=oo(function(t,e,n,r){mi(t,e,n,r)}),cc=Po(function(t,e){var n={};if(null==t)return n;var r=!1;e=$e(e,function(e){return e=Xi(e,t),r||(r=e.length>1),e}),ro(t,Io(t),n),r&&(n=Nr(n,f|d|p,Ro));for(var i=e.length;i--;)Bi(n,e[i]);return n});var uc=Po(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,n){return tc(t,n)})}(t,e)});function lc(t,e){if(null==t)return{};var n=$e(Io(t),function(t){return[t]});return e=Do(e),yi(t,n,function(t,n){return e(t,n[0])})}var hc=Eo(ic),fc=Eo(oc);function dc(t){return null==t?[]:yn(t,ic(t))}var pc=uo(function(t,e,n){return e=e.toLowerCase(),t+(n?mc(e):e)});function mc(t){return Mc(Ws(t).toLowerCase())}function gc(t){return(t=Ws(t))&&t.replace(Zt,wn).replace(xe,"")}var vc=uo(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),yc=uo(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),xc=co("toLowerCase");var _c=uo(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var bc=uo(function(t,e,n){return t+(n?" ":"")+Mc(e)});var wc=uo(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Mc=co("toUpperCase");function Ec(t,e,n){return t=Ws(t),(e=n?o:e)===o?function(t){return Me.test(t)}(t)?function(t){return t.match(be)||[]}(t):function(t){return t.match(Gt)||[]}(t):t.match(e)||[]}var Tc=Mi(function(t,e){try{return We(t,o,e)}catch(t){return Ms(t)?t:new Qt(t)}}),Sc=Po(function(t,e){return qe(e,function(e){e=la(e),Ir(t,e,ns(t[e],t))}),t});function Ac(t){return function(){return t}}var Rc=fo(),Lc=fo(!0);function Pc(t){return t}function Cc(t){return ci("function"==typeof t?t:Nr(t,f))}var Ic=Mi(function(t,e){return function(n){return ri(n,t,e)}}),Oc=Mi(function(t,e){return function(n){return ri(t,n,e)}});function Uc(t,e,n){var r=ic(e),i=Zr(e,r);null!=n||As(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Zr(e,ic(e)));var o=!(As(n)&&"chain"in n&&!n.chain),a=Es(t);return qe(i,function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=no(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function Nc(){}var Dc=vo($e),Fc=vo(Ze),Bc=vo(rn);function zc(t){return Yo(t)?fn(la(t)):function(t){return function(e){return Jr(e,t)}}(t)}var Gc=xo(),Hc=xo(!0);function kc(){return[]}function jc(){return!1}var Vc=go(function(t,e){return t+e},0),Wc=wo("ceil"),Xc=go(function(t,e){return t/e},1),qc=wo("floor");var Yc,Zc=go(function(t,e){return t*e},1),Jc=wo("round"),Kc=go(function(t,e){return t-e},0);return dr.after=function(t,e){if("function"!=typeof e)throw new ie(c);return t=Hs(t),function(){if(--t<1)return e.apply(this,arguments)}},dr.ary=ts,dr.assign=Xs,dr.assignIn=qs,dr.assignInWith=Ys,dr.assignWith=Zs,dr.at=Js,dr.before=es,dr.bind=ns,dr.bindAll=Sc,dr.bindKey=rs,dr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return vs(t)?t:[t]},dr.chain=za,dr.chunk=function(t,e,n){e=(n?qo(t,e,n):e===o)?1:Wn(Hs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,s=0,c=r(Bn(i/e));a<i;)c[s++]=Pi(t,a,a+=e);return c},dr.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},dr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return tn(vs(n)?no(n):[n],Vr(e,1))},dr.cond=function(t){var e=null==t?0:t.length,n=Do();return t=e?$e(t,function(t){if("function"!=typeof t[1])throw new ie(c);return[n(t[0]),t[1]]}):[],Mi(function(n){for(var r=-1;++r<e;){var i=t[r];if(We(i[0],this,n))return We(i[1],this,n)}})},dr.conforms=function(t){return function(t){var e=ic(t);return function(n){return Dr(n,t,e)}}(Nr(t,f))},dr.constant=Ac,dr.countBy=ka,dr.create=function(t,e){var n=pr(t);return null==e?n:Cr(n,e)},dr.curry=function t(e,n,r){var i=To(e,_,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},dr.curryRight=function t(e,n,r){var i=To(e,b,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},dr.debounce=is,dr.defaults=Ks,dr.defaultsDeep=Qs,dr.defer=os,dr.delay=as,dr.difference=da,dr.differenceBy=pa,dr.differenceWith=ma,dr.drop=function(t,e,n){var r=null==t?0:t.length;return r?Pi(t,(e=n||e===o?1:Hs(e))<0?0:e,r):[]},dr.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Pi(t,0,(e=r-(e=n||e===o?1:Hs(e)))<0?0:e):[]},dr.dropRightWhile=function(t,e){return t&&t.length?Gi(t,Do(e,3),!0,!0):[]},dr.dropWhile=function(t,e){return t&&t.length?Gi(t,Do(e,3),!0):[]},dr.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&qo(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=Hs(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:Hs(r))<0&&(r+=i),r=n>r?0:ks(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},dr.filter=function(t,e){return(vs(t)?Je:jr)(t,Do(e,3))},dr.flatMap=function(t,e){return Vr(Ja(t,e),1)},dr.flatMapDeep=function(t,e){return Vr(Ja(t,e),O)},dr.flatMapDepth=function(t,e,n){return n=n===o?1:Hs(n),Vr(Ja(t,e),n)},dr.flatten=ya,dr.flattenDeep=function(t){return null!=t&&t.length?Vr(t,O):[]},dr.flattenDepth=function(t,e){return null!=t&&t.length?Vr(t,e=e===o?1:Hs(e)):[]},dr.flip=function(t){return To(t,S)},dr.flow=Rc,dr.flowRight=Lc,dr.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},dr.functions=function(t){return null==t?[]:Zr(t,ic(t))},dr.functionsIn=function(t){return null==t?[]:Zr(t,oc(t))},dr.groupBy=qa,dr.initial=function(t){return null!=t&&t.length?Pi(t,0,-1):[]},dr.intersection=_a,dr.intersectionBy=ba,dr.intersectionWith=wa,dr.invert=ec,dr.invertBy=nc,dr.invokeMap=Ya,dr.iteratee=Cc,dr.keyBy=Za,dr.keys=ic,dr.keysIn=oc,dr.map=Ja,dr.mapKeys=function(t,e){var n={};return e=Do(e,3),qr(t,function(t,r,i){Ir(n,e(t,r,i),t)}),n},dr.mapValues=function(t,e){var n={};return e=Do(e,3),qr(t,function(t,r,i){Ir(n,r,e(t,r,i))}),n},dr.matches=function(t){return di(Nr(t,f))},dr.matchesProperty=function(t,e){return pi(t,Nr(e,f))},dr.memoize=ss,dr.merge=ac,dr.mergeWith=sc,dr.method=Ic,dr.methodOf=Oc,dr.mixin=Uc,dr.negate=cs,dr.nthArg=function(t){return t=Hs(t),Mi(function(e){return gi(e,t)})},dr.omit=cc,dr.omitBy=function(t,e){return lc(t,cs(Do(e)))},dr.once=function(t){return es(2,t)},dr.orderBy=function(t,e,n,r){return null==t?[]:(vs(e)||(e=null==e?[]:[e]),vs(n=r?o:n)||(n=null==n?[]:[n]),vi(t,e,n))},dr.over=Dc,dr.overArgs=us,dr.overEvery=Fc,dr.overSome=Bc,dr.partial=ls,dr.partialRight=hs,dr.partition=Ka,dr.pick=uc,dr.pickBy=lc,dr.property=zc,dr.propertyOf=function(t){return function(e){return null==t?o:Jr(t,e)}},dr.pull=Ea,dr.pullAll=Ta,dr.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?xi(t,e,Do(n,2)):t},dr.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?xi(t,e,o,n):t},dr.pullAt=Sa,dr.range=Gc,dr.rangeRight=Hc,dr.rearg=fs,dr.reject=function(t,e){return(vs(t)?Je:jr)(t,cs(Do(e,3)))},dr.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=Do(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return _i(t,i),n},dr.rest=function(t,e){if("function"!=typeof t)throw new ie(c);return Mi(t,e=e===o?e:Hs(e))},dr.reverse=Aa,dr.sampleSize=function(t,e,n){return e=(n?qo(t,e,n):e===o)?1:Hs(e),(vs(t)?Tr:Ti)(t,e)},dr.set=function(t,e,n){return null==t?t:Si(t,e,n)},dr.setWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Si(t,e,n,r)},dr.shuffle=function(t){return(vs(t)?Sr:Li)(t)},dr.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&qo(t,e,n)?(e=0,n=r):(e=null==e?0:Hs(e),n=n===o?r:Hs(n)),Pi(t,e,n)):[]},dr.sortBy=Qa,dr.sortedUniq=function(t){return t&&t.length?Ui(t):[]},dr.sortedUniqBy=function(t,e){return t&&t.length?Ui(t,Do(e,2)):[]},dr.split=function(t,e,n){return n&&"number"!=typeof n&&qo(t,e,n)&&(e=n=o),(n=n===o?F:n>>>0)?(t=Ws(t))&&("string"==typeof e||null!=e&&!Is(e))&&!(e=Di(e))&&Tn(t)?Yi(In(t),0,n):t.split(e,n):[]},dr.spread=function(t,e){if("function"!=typeof t)throw new ie(c);return e=null==e?0:Wn(Hs(e),0),Mi(function(n){var r=n[e],i=Yi(n,0,e);return r&&tn(i,r),We(t,this,i)})},dr.tail=function(t){var e=null==t?0:t.length;return e?Pi(t,1,e):[]},dr.take=function(t,e,n){return t&&t.length?Pi(t,0,(e=n||e===o?1:Hs(e))<0?0:e):[]},dr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Pi(t,(e=r-(e=n||e===o?1:Hs(e)))<0?0:e,r):[]},dr.takeRightWhile=function(t,e){return t&&t.length?Gi(t,Do(e,3),!1,!0):[]},dr.takeWhile=function(t,e){return t&&t.length?Gi(t,Do(e,3)):[]},dr.tap=function(t,e){return e(t),t},dr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new ie(c);return As(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),is(t,e,{leading:r,maxWait:e,trailing:i})},dr.thru=Ga,dr.toArray=zs,dr.toPairs=hc,dr.toPairsIn=fc,dr.toPath=function(t){return vs(t)?$e(t,la):Ns(t)?[t]:no(ua(Ws(t)))},dr.toPlainObject=Vs,dr.transform=function(t,e,n){var r=vs(t),i=r||bs(t)||Ds(t);if(e=Do(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:As(t)&&Es(o)?pr(Ce(t)):{}}return(i?qe:qr)(t,function(t,r,i){return e(n,t,r,i)}),n},dr.unary=function(t){return ts(t,1)},dr.union=Ra,dr.unionBy=La,dr.unionWith=Pa,dr.uniq=function(t){return t&&t.length?Fi(t):[]},dr.uniqBy=function(t,e){return t&&t.length?Fi(t,Do(e,2)):[]},dr.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?Fi(t,o,e):[]},dr.unset=function(t,e){return null==t||Bi(t,e)},dr.unzip=Ca,dr.unzipWith=Ia,dr.update=function(t,e,n){return null==t?t:zi(t,e,Wi(n))},dr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:zi(t,e,Wi(n),r)},dr.values=dc,dr.valuesIn=function(t){return null==t?[]:yn(t,oc(t))},dr.without=Oa,dr.words=Ec,dr.wrap=function(t,e){return ls(Wi(e),t)},dr.xor=Ua,dr.xorBy=Na,dr.xorWith=Da,dr.zip=Fa,dr.zipObject=function(t,e){return ji(t||[],e||[],Rr)},dr.zipObjectDeep=function(t,e){return ji(t||[],e||[],Si)},dr.zipWith=Ba,dr.entries=hc,dr.entriesIn=fc,dr.extend=qs,dr.extendWith=Ys,Uc(dr,dr),dr.add=Vc,dr.attempt=Tc,dr.camelCase=pc,dr.capitalize=mc,dr.ceil=Wc,dr.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=js(n))==n?n:0),e!==o&&(e=(e=js(e))==e?e:0),Ur(js(t),e,n)},dr.clone=function(t){return Nr(t,p)},dr.cloneDeep=function(t){return Nr(t,f|p)},dr.cloneDeepWith=function(t,e){return Nr(t,f|p,e="function"==typeof e?e:o)},dr.cloneWith=function(t,e){return Nr(t,p,e="function"==typeof e?e:o)},dr.conformsTo=function(t,e){return null==e||Dr(t,e,ic(e))},dr.deburr=gc,dr.defaultTo=function(t,e){return null==t||t!=t?e:t},dr.divide=Xc,dr.endsWith=function(t,e,n){t=Ws(t),e=Di(e);var r=t.length,i=n=n===o?r:Ur(Hs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},dr.eq=ds,dr.escape=function(t){return(t=Ws(t))&&Tt.test(t)?t.replace(Mt,Mn):t},dr.escapeRegExp=function(t){return(t=Ws(t))&&Ot.test(t)?t.replace(It,"\\$&"):t},dr.every=function(t,e,n){var r=vs(t)?Ze:Hr;return n&&qo(t,e,n)&&(e=o),r(t,Do(e,3))},dr.find=ja,dr.findIndex=ga,dr.findKey=function(t,e){return an(t,Do(e,3),qr)},dr.findLast=Va,dr.findLastIndex=va,dr.findLastKey=function(t,e){return an(t,Do(e,3),Yr)},dr.floor=qc,dr.forEach=Wa,dr.forEachRight=Xa,dr.forIn=function(t,e){return null==t?t:Wr(t,Do(e,3),oc)},dr.forInRight=function(t,e){return null==t?t:Xr(t,Do(e,3),oc)},dr.forOwn=function(t,e){return t&&qr(t,Do(e,3))},dr.forOwnRight=function(t,e){return t&&Yr(t,Do(e,3))},dr.get=$s,dr.gt=ps,dr.gte=ms,dr.has=function(t,e){return null!=t&&jo(t,e,ti)},dr.hasIn=tc,dr.head=xa,dr.identity=Pc,dr.includes=function(t,e,n,r){t=xs(t)?t:dc(t),n=n&&!r?Hs(n):0;var i=t.length;return n<0&&(n=Wn(i+n,0)),Us(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&cn(t,e,n)>-1},dr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Hs(n);return i<0&&(i=Wn(r+i,0)),cn(t,e,i)},dr.inRange=function(t,e,n){return e=Gs(e),n===o?(n=e,e=0):n=Gs(n),function(t,e,n){return t>=Xn(e,n)&&t<Wn(e,n)}(t=js(t),e,n)},dr.invoke=rc,dr.isArguments=gs,dr.isArray=vs,dr.isArrayBuffer=ys,dr.isArrayLike=xs,dr.isArrayLikeObject=_s,dr.isBoolean=function(t){return!0===t||!1===t||Rs(t)&&Qr(t)==V},dr.isBuffer=bs,dr.isDate=ws,dr.isElement=function(t){return Rs(t)&&1===t.nodeType&&!Cs(t)},dr.isEmpty=function(t){if(null==t)return!0;if(xs(t)&&(vs(t)||"string"==typeof t||"function"==typeof t.splice||bs(t)||Ds(t)||gs(t)))return!t.length;var e=ko(t);if(e==J||e==nt)return!t.size;if(Ko(t))return!ui(t).length;for(var n in t)if(le.call(t,n))return!1;return!0},dr.isEqual=function(t,e){return oi(t,e)},dr.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:o)?n(t,e):o;return r===o?oi(t,e,o,n):!!r},dr.isError=Ms,dr.isFinite=function(t){return"number"==typeof t&&kn(t)},dr.isFunction=Es,dr.isInteger=Ts,dr.isLength=Ss,dr.isMap=Ls,dr.isMatch=function(t,e){return t===e||ai(t,e,Bo(e))},dr.isMatchWith=function(t,e,n){return n="function"==typeof n?n:o,ai(t,e,Bo(e),n)},dr.isNaN=function(t){return Ps(t)&&t!=+t},dr.isNative=function(t){if(Jo(t))throw new Qt(s);return si(t)},dr.isNil=function(t){return null==t},dr.isNull=function(t){return null===t},dr.isNumber=Ps,dr.isObject=As,dr.isObjectLike=Rs,dr.isPlainObject=Cs,dr.isRegExp=Is,dr.isSafeInteger=function(t){return Ts(t)&&t>=-U&&t<=U},dr.isSet=Os,dr.isString=Us,dr.isSymbol=Ns,dr.isTypedArray=Ds,dr.isUndefined=function(t){return t===o},dr.isWeakMap=function(t){return Rs(t)&&ko(t)==at},dr.isWeakSet=function(t){return Rs(t)&&Qr(t)==st},dr.join=function(t,e){return null==t?"":jn.call(t,e)},dr.kebabCase=vc,dr.last=Ma,dr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Hs(n))<0?Wn(r+i,0):Xn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):sn(t,ln,i,!0)},dr.lowerCase=yc,dr.lowerFirst=xc,dr.lt=Fs,dr.lte=Bs,dr.max=function(t){return t&&t.length?kr(t,Pc,$r):o},dr.maxBy=function(t,e){return t&&t.length?kr(t,Do(e,2),$r):o},dr.mean=function(t){return hn(t,Pc)},dr.meanBy=function(t,e){return hn(t,Do(e,2))},dr.min=function(t){return t&&t.length?kr(t,Pc,hi):o},dr.minBy=function(t,e){return t&&t.length?kr(t,Do(e,2),hi):o},dr.stubArray=kc,dr.stubFalse=jc,dr.stubObject=function(){return{}},dr.stubString=function(){return""},dr.stubTrue=function(){return!0},dr.multiply=Zc,dr.nth=function(t,e){return t&&t.length?gi(t,Hs(e)):o},dr.noConflict=function(){return Oe._===this&&(Oe._=me),this},dr.noop=Nc,dr.now=$a,dr.pad=function(t,e,n){t=Ws(t);var r=(e=Hs(e))?Cn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return yo(zn(i),n)+t+yo(Bn(i),n)},dr.padEnd=function(t,e,n){t=Ws(t);var r=(e=Hs(e))?Cn(t):0;return e&&r<e?t+yo(e-r,n):t},dr.padStart=function(t,e,n){t=Ws(t);var r=(e=Hs(e))?Cn(t):0;return e&&r<e?yo(e-r,n)+t:t},dr.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),Yn(Ws(t).replace(Nt,""),e||0)},dr.random=function(t,e,n){if(n&&"boolean"!=typeof n&&qo(t,e,n)&&(e=n=o),n===o&&("boolean"==typeof e?(n=e,e=o):"boolean"==typeof t&&(n=t,t=o)),t===o&&e===o?(t=0,e=1):(t=Gs(t),e===o?(e=t,t=0):e=Gs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Zn();return Xn(t+i*(e-t+Le("1e-"+((i+"").length-1))),e)}return bi(t,e)},dr.reduce=function(t,e,n){var r=vs(t)?en:pn,i=arguments.length<3;return r(t,Do(e,4),n,i,zr)},dr.reduceRight=function(t,e,n){var r=vs(t)?nn:pn,i=arguments.length<3;return r(t,Do(e,4),n,i,Gr)},dr.repeat=function(t,e,n){return e=(n?qo(t,e,n):e===o)?1:Hs(e),wi(Ws(t),e)},dr.replace=function(){var t=arguments,e=Ws(t[0]);return t.length<3?e:e.replace(t[1],t[2])},dr.result=function(t,e,n){var r=-1,i=(e=Xi(e,t)).length;for(i||(i=1,t=o);++r<i;){var a=null==t?o:t[la(e[r])];a===o&&(r=i,a=n),t=Es(a)?a.call(t):a}return t},dr.round=Jc,dr.runInContext=t,dr.sample=function(t){return(vs(t)?Er:Ei)(t)},dr.size=function(t){if(null==t)return 0;if(xs(t))return Us(t)?Cn(t):t.length;var e=ko(t);return e==J||e==nt?t.size:ui(t).length},dr.snakeCase=_c,dr.some=function(t,e,n){var r=vs(t)?rn:Ci;return n&&qo(t,e,n)&&(e=o),r(t,Do(e,3))},dr.sortedIndex=function(t,e){return Ii(t,e)},dr.sortedIndexBy=function(t,e,n){return Oi(t,e,Do(n,2))},dr.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Ii(t,e);if(r<n&&ds(t[r],e))return r}return-1},dr.sortedLastIndex=function(t,e){return Ii(t,e,!0)},dr.sortedLastIndexBy=function(t,e,n){return Oi(t,e,Do(n,2),!0)},dr.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=Ii(t,e,!0)-1;if(ds(t[n],e))return n}return-1},dr.startCase=bc,dr.startsWith=function(t,e,n){return t=Ws(t),n=null==n?0:Ur(Hs(n),0,t.length),e=Di(e),t.slice(n,n+e.length)==e},dr.subtract=Kc,dr.sum=function(t){return t&&t.length?mn(t,Pc):0},dr.sumBy=function(t,e){return t&&t.length?mn(t,Do(e,2)):0},dr.template=function(t,e,n){var r=dr.templateSettings;n&&qo(t,e,n)&&(e=o),t=Ws(t),e=Ys({},e,r,So);var i,a,s=Ys({},e.imports,r.imports,So),c=ic(s),u=yn(s,c),l=0,h=e.interpolate||Jt,f="__p += '",d=ne((e.escape||Jt).source+"|"+h.source+"|"+(h===Rt?kt:Jt).source+"|"+(e.evaluate||Jt).source+"|$","g"),p="//# sourceURL="+("sourceURL"in e?e.sourceURL:"lodash.templateSources["+ ++Te+"]")+"\n";t.replace(d,function(e,n,r,o,s,c){return r||(r=o),f+=t.slice(l,c).replace(Kt,En),n&&(i=!0,f+="' +\n__e("+n+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=c+e.length,e}),f+="';\n";var m=e.variable;m||(f="with (obj) {\n"+f+"\n}\n"),f=(a?f.replace(xt,""):f).replace(_t,"$1").replace(bt,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=Tc(function(){return $t(c,p+"return "+f).apply(o,u)});if(g.source=f,Ms(g))throw g;return g},dr.times=function(t,e){if((t=Hs(t))<1||t>U)return[];var n=F,r=Xn(t,F);e=Do(e),t-=F;for(var i=gn(r,e);++n<t;)e(n);return i},dr.toFinite=Gs,dr.toInteger=Hs,dr.toLength=ks,dr.toLower=function(t){return Ws(t).toLowerCase()},dr.toNumber=js,dr.toSafeInteger=function(t){return t?Ur(Hs(t),-U,U):0===t?t:0},dr.toString=Ws,dr.toUpper=function(t){return Ws(t).toUpperCase()},dr.trim=function(t,e,n){if((t=Ws(t))&&(n||e===o))return t.replace(Ut,"");if(!t||!(e=Di(e)))return t;var r=In(t),i=In(e);return Yi(r,_n(r,i),bn(r,i)+1).join("")},dr.trimEnd=function(t,e,n){if((t=Ws(t))&&(n||e===o))return t.replace(Dt,"");if(!t||!(e=Di(e)))return t;var r=In(t);return Yi(r,0,bn(r,In(e))+1).join("")},dr.trimStart=function(t,e,n){if((t=Ws(t))&&(n||e===o))return t.replace(Nt,"");if(!t||!(e=Di(e)))return t;var r=In(t);return Yi(r,_n(r,In(e))).join("")},dr.truncate=function(t,e){var n=A,r=R;if(As(e)){var i="separator"in e?e.separator:i;n="length"in e?Hs(e.length):n,r="omission"in e?Di(e.omission):r}var a=(t=Ws(t)).length;if(Tn(t)){var s=In(t);a=s.length}if(n>=a)return t;var c=n-Cn(r);if(c<1)return r;var u=s?Yi(s,0,c).join(""):t.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),Is(i)){if(t.slice(c).search(i)){var l,h=u;for(i.global||(i=ne(i.source,Ws(jt.exec(i))+"g")),i.lastIndex=0;l=i.exec(h);)var f=l.index;u=u.slice(0,f===o?c:f)}}else if(t.indexOf(Di(i),c)!=c){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},dr.unescape=function(t){return(t=Ws(t))&&Et.test(t)?t.replace(wt,On):t},dr.uniqueId=function(t){var e=++he;return Ws(t)+e},dr.upperCase=wc,dr.upperFirst=Mc,dr.each=Wa,dr.eachRight=Xa,dr.first=xa,Uc(dr,(Yc={},qr(dr,function(t,e){le.call(dr.prototype,e)||(Yc[e]=t)}),Yc),{chain:!1}),dr.VERSION="4.17.11",qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){dr[t].placeholder=dr}),qe(["drop","take"],function(t,e){vr.prototype[t]=function(n){n=n===o?1:Wn(Hs(n),0);var r=this.__filtered__&&!e?new vr(this):this.clone();return r.__filtered__?r.__takeCount__=Xn(n,r.__takeCount__):r.__views__.push({size:Xn(n,F),type:t+(r.__dir__<0?"Right":"")}),r},vr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),qe(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==C||3==n;vr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Do(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),qe(["head","last"],function(t,e){var n="take"+(e?"Right":"");vr.prototype[t]=function(){return this[n](1).value()[0]}}),qe(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");vr.prototype[t]=function(){return this.__filtered__?new vr(this):this[n](1)}}),vr.prototype.compact=function(){return this.filter(Pc)},vr.prototype.find=function(t){return this.filter(t).head()},vr.prototype.findLast=function(t){return this.reverse().find(t)},vr.prototype.invokeMap=Mi(function(t,e){return"function"==typeof t?new vr(this):this.map(function(n){return ri(n,t,e)})}),vr.prototype.reject=function(t){return this.filter(cs(Do(t)))},vr.prototype.slice=function(t,e){t=Hs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new vr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=Hs(e))<0?n.dropRight(-e):n.take(e-t)),n)},vr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vr.prototype.toArray=function(){return this.take(F)},qr(vr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=dr[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);i&&(dr.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,c=e instanceof vr,u=s[0],l=c||vs(e),h=function(t){var e=i.apply(dr,tn([t],s));return r&&f?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,m=c&&!d;if(!a&&l){e=m?e:new vr(this);var g=t.apply(e,s);return g.__actions__.push({func:Ga,args:[h],thisArg:o}),new gr(g,f)}return p&&m?t.apply(this,s):(g=this.thru(h),p?r?g.value()[0]:g.value():g)})}),qe(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);dr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(vs(i)?i:[],t)}return this[n](function(n){return e.apply(vs(n)?n:[],t)})}}),qr(vr.prototype,function(t,e){var n=dr[e];if(n){var r=n.name+"";(ir[r]||(ir[r]=[])).push({name:e,func:n})}}),ir[po(o,y).name]=[{name:"wrapper",func:o}],vr.prototype.clone=function(){var t=new vr(this.__wrapped__);return t.__actions__=no(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=no(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=no(this.__views__),t},vr.prototype.reverse=function(){if(this.__filtered__){var t=new vr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=vs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Xn(e,t+a);break;case"takeRight":t=Wn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,u=r?s:a-1,l=this.__iteratees__,h=l.length,f=0,d=Xn(c,this.__takeCount__);if(!n||!r&&i==c&&d==c)return Hi(t,this.__actions__);var p=[];t:for(;c--&&f<d;){for(var m=-1,g=t[u+=e];++m<h;){var v=l[m],y=v.iteratee,x=v.type,_=y(g);if(x==I)g=_;else if(!_){if(x==C)continue t;break t}}p[f++]=g}return p},dr.prototype.at=Ha,dr.prototype.chain=function(){return za(this)},dr.prototype.commit=function(){return new gr(this.value(),this.__chain__)},dr.prototype.next=function(){this.__values__===o&&(this.__values__=zs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},dr.prototype.plant=function(t){for(var e,n=this;n instanceof mr;){var r=fa(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},dr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vr){var e=t;return this.__actions__.length&&(e=new vr(this)),(e=e.reverse()).__actions__.push({func:Ga,args:[Aa],thisArg:o}),new gr(e,this.__chain__)}return this.thru(Aa)},dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=function(){return Hi(this.__wrapped__,this.__actions__)},dr.prototype.first=dr.prototype.head,Be&&(dr.prototype[Be]=function(){return this}),dr}();Oe._=Un,(i=function(){return Un}.call(e,n,e,r))===o||(r.exports=i)}).call(this)}).call(this,n(4),n(5)(t))},function(t,e,n){"use strict";const r=n(0);t.exports={Coins:new class{constructor(){this.setRadius(3),this.coinMaterial=new r.MeshStandardMaterial({color:13938487,roughness:.5,metalness:1})}setRadius(t){this.coinRadius=t,this.coinGeometry=this.generateCoinGeometry()}generateCoinGeometry(){let t=.18*this.coinRadius,e=.16*this.coinRadius,n=t/4,i=n+.25,o={amount:n,steps:1,curveSegments:24,bevelEnabled:!0,bevelSize:.25,bevelThickness:.25,bevelSegments:2},a=new r.TorusGeometry(this.coinRadius,.1*this.coinRadius,8,64),s=new r.CylinderGeometry(this.coinRadius,this.coinRadius,t,16);s.rotateX(Math.PI/2);let c=new r.Shape;c.moveTo(-3,1),c.lineTo(-3,2),c.bezierCurveTo(-2.75,1.75,-.75,3.5,-1,4),c.lineTo(1,4),c.lineTo(1,-3),c.lineTo(3,-3),c.lineTo(3,-4),c.lineTo(-3,-4),c.lineTo(-3,-3),c.lineTo(-1,-3),c.lineTo(-1,2),c.bezierCurveTo(-.8,1.8,-2.8,.8,-3,1);let u=new r.ExtrudeGeometry(c,o),l=new r.Mesh(u,this.coinMaterial);l.position.z-=n/2*e,l.position.z+=t/2,l.position.z-=i/2*e,l.scale.set(e,e,e);let h=new r.Shape;h.moveTo(0,4),h.bezierCurveTo(4,4,4,-4,0,-4),h.bezierCurveTo(-4,-4,-4,4,0,4);let f=new r.Path;f.moveTo(0,2.5),f.bezierCurveTo(-2.5,2.5,-2.5,-2.5,0,-2.5),f.bezierCurveTo(2.5,-2.5,2.5,2.5,0,2.5),h.holes.push(f);let d=new r.Shape;d.moveTo(-3.5,-2.5),d.lineTo(2.5,3.5),d.lineTo(3.5,2.5),d.lineTo(-2.5,-3.5),d.lineTo(-3.5,-2.5);let p=new r.ExtrudeGeometry(h,o),m=new r.ExtrudeGeometry(d,o),g=new r.Mesh(p,this.coinMaterial),v=new r.Mesh(m,this.coinMaterial);g.scale.set(e,e,e),v.scale.set(e,e,e),g.position.z-=n/2*e,v.position.z-=n/2*e,g.position.z-=t/2,v.position.z-=t/2,g.position.z+=i/2*e,v.position.z+=i/2*e;let y=new r.Geometry;return y.merge(a),y.merge(s),y.mergeMesh(l),y.mergeMesh(g),y.mergeMesh(v),y}createCoin(){return new r.Mesh(this.coinGeometry,this.coinMaterial)}createCoins(t=1){let e=[];for(let n=0;n<t;n++)e.push(this.createCoin());return e}}}},function(t,e,n){"use strict";n(1);var r=n(0);const{Display:i}=n(6),{Coins:o}=n(2),{CoinTunnel:a}=n(7),s=new i({domId:"canvas",cameraDistance:400,fov:35,fadeIn:!0});var c=new a({totalCoins:Math.min(.5*window.innerWidth,1337),radius:Math.max(.07*window.innerWidth,50),length:400,rotateTunnel:!0,tunnelRotationSpeed:25e-5,coinRotationSpeed:.06,pathSpeedMin:.0015,pathSpeedMax:.0015,debug:!1});s.camera.position.y=c.opts.length/2*-1,s.camera.lookAt(new r.Vector3(0,0,0)),s.scene.add(c.tunnel);var u=new r.DirectionalLight(16777215,1.5);u.position.y=0,u.position.z=0,u.position.x=-1;var l=new r.DirectionalLight(16777215,1.5);l.position.y=0,l.position.z=0,l.position.x=1,s.scene.add(u),s.scene.add(l),s.addAnimation(c.animateStep.bind(c)).animate()},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},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";const r=n(1),i=n(0);t.exports={Display:class{constructor(t={}){this.opts=r.assign({fov:50,cameraDistance:1e3,antialias:!0,domId:null,fadeIn:!1},t),this.animationCallbacks=[],this.initialize()}initialize(){this.scene=new i.Scene,this.camera=new i.PerspectiveCamera(this.opts.fov,window.innerWidth/window.innerHeight,.1,this.opts.cameraDistance),this.renderer=new i.WebGLRenderer({antialias:this.opts.antialias}),this.renderer.setSize(window.innerWidth,window.innerHeight),(this.opts.domId?document.getElementById(this.opts.domId):document.body).appendChild(this.renderer.domElement),this.opts.fadeIn&&this.addFade(),window.onresize=function(){this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight)}.bind(this)}addFade(){var t=0;this.renderer.domElement.style.opacity=t,this.addAnimation(function(){t+=.03,this.renderer.domElement.style.opacity=t,this.renderer.domElement.style.opacity>=1&&this.animationCallbacks.shift()}.bind(this))}addAnimation(t){return this.animationCallbacks.push(t),this}animate(){requestAnimationFrame(this.getAnimateFunction());for(let t of this.animationCallbacks)t();this.renderer.render(this.scene,this.camera)}getAnimateFunction(){return this.animateFunction||(this.animateFunction=this.animate.bind(this)),this.animateFunction}showAxes(t={}){let e=r.assign({x:0,y:0,z:0,distance:1e5},t),n=new i.LineBasicMaterial({color:16711680,linewidth:1}),o=new i.LineBasicMaterial({color:65280,linewidth:1}),a=new i.LineBasicMaterial({color:255,linewidth:1}),s=new i.Geometry,c=new i.Geometry,u=new i.Geometry;s.vertices.push(new i.Vector3(e.distance,e.y,e.z),new i.Vector3(-1*e.distance,e.y,e.z)),c.vertices.push(new i.Vector3(e.x,e.distance,e.z),new i.Vector3(e.x,-1*e.distance,e.z)),u.vertices.push(new i.Vector3(e.x,e.y,e.distance),new i.Vector3(e.x,e.y,-1*e.distance));var l=new i.Line(s,n),h=new i.Line(c,o),f=new i.Line(u,a);this.scene.add(l,h,f)}}}},function(t,e,n){"use strict";const r=n(1),i=n(0),{Coins:o}=n(2);t.exports={CoinTunnel:class{constructor(t={}){this.opts=r.assign({radius:100,length:400,totalCoins:500,coinRotationSpeed:.05,pathSpeedMin:.001,pathSpeedMax:.001,rotateTunnel:!1,tunnelRotationSpeed:5e-4,excludeCenter:!0,scalePoint:.05,debug:!1},t),this.createTunnel(),this.initCoins()}createTunnel(){if(this.calculateCoinPaths(),this.tunnel=this.createTunnelMesh(),this.opts.debug){let t=new i.LineBasicMaterial({color:16711680,transparent:!0,opacity:.5});for(let e of this.coinPaths){let n=new i.Geometry;n.vertices.push(e.v1,e.v2);let r=new i.Line(n,t);this.tunnel.add(r)}}}createTunnelMesh(){let t=new i.CylinderGeometry(this.opts.radius,this.opts.radius,this.opts.length,16),e=new i.MeshBasicMaterial({color:65280,wireframe:!0,transparent:!0,opacity:this.opts.debug?.5:0});return new i.Mesh(t,e)}getCoinSpeed(){let t=this.opts.pathSpeedMax-this.opts.pathSpeedMin;return Math.random()*t+this.opts.pathSpeedMin}setCoinRotation(t){t.rotation.y=Math.PI*(.5*Math.random()),t.rotation.x=Math.PI*(.5*Math.random()),t.rotation.z=Math.PI*(.5*Math.random()),t.rotationPerStep={x:2*(.5-Math.random())*this.opts.coinRotationSpeed,z:2*(.5-Math.random())*this.opts.coinRotationSpeed}}randomizeCoinPath(t){t.path=r.sample(this.coinPaths);let e=t.path.getPoint(t.pathProgress);t.position.x=e.x,t.position.y=e.y,t.position.z=e.z}initCoins(){this.coins=[];for(let t=0;t<this.opts.totalCoins;t++){let t=this.spawnCoin();this.coins.push(t),this.tunnel.add(t)}}spawnCoin(){this.baseCoin||(this.baseCoin=o.createCoin());let t=this.baseCoin.clone();return t.pathProgressPerStep=this.getCoinSpeed(),t.pathProgress=Math.random(),this.randomizeCoinPath(t),this.setCoinRotation(t),t}calculateCoinPaths(){this.coinPaths=[];let t=5*this.opts.totalCoins;for(var e=0;e<t;e++){let t=Math.random(),e=Math.sqrt(t),n=2*Math.random()*Math.PI,r=e*this.opts.radius,a=r*Math.cos(n),s=r*Math.sin(n);this.opts.excludeCenter&&(Math.abs(a)<o.coinRadius&&(a=o.coinRadius*(a<0?-1:1)),Math.abs(s)<o.coinRadius&&(s=o.coinRadius*(s<0?-1:1)));let c=new i.Vector3(a,this.opts.length/2,s),u=new i.Vector3(a,this.opts.length/2*-1,s),l=new i.LineCurve3(c,u);this.coinPaths.push(l)}}animateStep(){for(let t of this.coins){r.each(t.rotationPerStep,(e,n)=>{t.rotation[n]+=e}),t.pathProgress+=t.pathProgressPerStep;let e=t.path.getPoint(t.pathProgress);t.position.y=e.y,t.pathProgress>1&&(t.pathProgress=0,this.setCoinRotation(t),this.randomizeCoinPath(t));let n=t.pathProgress<=this.opts.scalePoint?Math.max(t.pathProgress/this.opts.scalePoint,1e-4):1;t.scale.set(n,n,n)}this.opts.rotateTunnel&&(this.tunnel.rotation.y+=this.opts.tunnelRotationSpeed)}}}},function(t,e,n){const r=n(0);r.OrbitControls=function(t,e){var n,i,o,a,s;this.object=t,this.domElement=void 0!==e?e:document,this.enabled=!0,this.target=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:r.MOUSE.LEFT,ZOOM:r.MOUSE.MIDDLE,PAN:r.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){c.target0.copy(c.target),c.position0.copy(c.object.position),c.zoom0=c.object.zoom},this.reset=function(){c.target.copy(c.target0),c.object.position.copy(c.position0),c.object.zoom=c.zoom0,c.object.updateProjectionMatrix(),c.dispatchEvent(u),c.update(),d=f.NONE},this.update=(n=new r.Vector3,i=(new r.Quaternion).setFromUnitVectors(t.up,new r.Vector3(0,1,0)),o=i.clone().inverse(),a=new r.Vector3,s=new r.Quaternion,function(){var t=c.object.position;return n.copy(t).sub(c.target),n.applyQuaternion(i),m.setFromVector3(n),c.autoRotate&&d===f.NONE&&P(2*Math.PI/60/60*c.autoRotateSpeed),m.theta+=g.theta,m.phi+=g.phi,m.theta=Math.max(c.minAzimuthAngle,Math.min(c.maxAzimuthAngle,m.theta)),m.phi=Math.max(c.minPolarAngle,Math.min(c.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=v,m.radius=Math.max(c.minDistance,Math.min(c.maxDistance,m.radius)),c.target.add(y),n.setFromSpherical(m),n.applyQuaternion(o),t.copy(c.target).add(n),c.object.lookAt(c.target),!0===c.enableDamping?(g.theta*=1-c.dampingFactor,g.phi*=1-c.dampingFactor):g.set(0,0,0),v=1,y.set(0,0,0),!!(x||a.distanceToSquared(c.object.position)>p||8*(1-s.dot(c.object.quaternion))>p)&&(c.dispatchEvent(u),a.copy(c.object.position),s.copy(c.object.quaternion),x=!1,!0)}),this.dispose=function(){c.domElement.removeEventListener("contextmenu",X,!1),c.domElement.removeEventListener("mousedown",B,!1),c.domElement.removeEventListener("wheel",H,!1),c.domElement.removeEventListener("touchstart",j,!1),c.domElement.removeEventListener("touchend",W,!1),c.domElement.removeEventListener("touchmove",V,!1),document.removeEventListener("mousemove",z,!1),document.removeEventListener("mouseup",G,!1),window.removeEventListener("keydown",k,!1)};var c=this,u={type:"change"},l={type:"start"},h={type:"end"},f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=f.NONE,p=1e-6,m=new r.Spherical,g=new r.Spherical,v=1,y=new r.Vector3,x=!1,_=new r.Vector2,b=new r.Vector2,w=new r.Vector2,M=new r.Vector2,E=new r.Vector2,T=new r.Vector2,S=new r.Vector2,A=new r.Vector2,R=new r.Vector2;function L(){return Math.pow(.95,c.zoomSpeed)}function P(t){g.theta-=t}function C(t){g.phi-=t}var I,O=(I=new r.Vector3,function(t,e){I.setFromMatrixColumn(e,0),I.multiplyScalar(-t),y.add(I)}),U=function(){var t=new r.Vector3;return function(e,n){t.setFromMatrixColumn(n,1),t.multiplyScalar(e),y.add(t)}}(),N=function(){var t=new r.Vector3;return function(e,n){var i=c.domElement===document?c.domElement.body:c.domElement;if(c.object instanceof r.PerspectiveCamera){var o=c.object.position;t.copy(o).sub(c.target);var a=t.length();a*=Math.tan(c.object.fov/2*Math.PI/180),O(2*e*a/i.clientHeight,c.object.matrix),U(2*n*a/i.clientHeight,c.object.matrix)}else c.object instanceof r.OrthographicCamera?(O(e*(c.object.right-c.object.left)/c.object.zoom/i.clientWidth,c.object.matrix),U(n*(c.object.top-c.object.bottom)/c.object.zoom/i.clientHeight,c.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),c.enablePan=!1)}}();function D(t){c.object instanceof r.PerspectiveCamera?v/=t:c.object instanceof r.OrthographicCamera?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom*t)),c.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)}function F(t){c.object instanceof r.PerspectiveCamera?v*=t:c.object instanceof r.OrthographicCamera?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom/t)),c.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)}function B(t){if(!1!==c.enabled){switch(t.preventDefault(),t.button){case c.mouseButtons.ORBIT:if(!1===c.enableRotate)return;!function(t){_.set(t.clientX,t.clientY)}(t),d=f.ROTATE;break;case c.mouseButtons.ZOOM:if(!1===c.enableZoom)return;!function(t){S.set(t.clientX,t.clientY)}(t),d=f.DOLLY;break;case c.mouseButtons.PAN:if(!1===c.enablePan)return;!function(t){M.set(t.clientX,t.clientY)}(t),d=f.PAN}d!==f.NONE&&(document.addEventListener("mousemove",z,!1),document.addEventListener("mouseup",G,!1),c.dispatchEvent(l))}}function z(t){if(!1!==c.enabled)switch(t.preventDefault(),d){case f.ROTATE:if(!1===c.enableRotate)return;!function(t){b.set(t.clientX,t.clientY),w.subVectors(b,_);var e=c.domElement===document?c.domElement.body:c.domElement;P(2*Math.PI*w.x/e.clientWidth*c.rotateSpeed),C(2*Math.PI*w.y/e.clientHeight*c.rotateSpeed),_.copy(b),c.update()}(t);break;case f.DOLLY:if(!1===c.enableZoom)return;!function(t){A.set(t.clientX,t.clientY),R.subVectors(A,S),R.y>0?D(L()):R.y<0&&F(L()),S.copy(A),c.update()}(t);break;case f.PAN:if(!1===c.enablePan)return;!function(t){E.set(t.clientX,t.clientY),T.subVectors(E,M),N(T.x,T.y),M.copy(E),c.update()}(t)}}function G(t){!1!==c.enabled&&(document.removeEventListener("mousemove",z,!1),document.removeEventListener("mouseup",G,!1),c.dispatchEvent(h),d=f.NONE)}function H(t){!1===c.enabled||!1===c.enableZoom||d!==f.NONE&&d!==f.ROTATE||(t.preventDefault(),t.stopPropagation(),function(t){t.deltaY<0?F(L()):t.deltaY>0&&D(L()),c.update()}(t),c.dispatchEvent(l),c.dispatchEvent(h))}function k(t){!1!==c.enabled&&!1!==c.enableKeys&&!1!==c.enablePan&&function(t){switch(t.keyCode){case c.keys.UP:N(0,c.keyPanSpeed),c.update();break;case c.keys.BOTTOM:N(0,-c.keyPanSpeed),c.update();break;case c.keys.LEFT:N(c.keyPanSpeed,0),c.update();break;case c.keys.RIGHT:N(-c.keyPanSpeed,0),c.update()}}(t)}function j(t){if(!1!==c.enabled){switch(t.touches.length){case 1:if(!1===c.enableRotate)return;!function(t){_.set(t.touches[0].pageX,t.touches[0].pageY)}(t),d=f.TOUCH_ROTATE;break;case 2:if(!1===c.enableZoom)return;!function(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);S.set(0,r)}(t),d=f.TOUCH_DOLLY;break;case 3:if(!1===c.enablePan)return;!function(t){M.set(t.touches[0].pageX,t.touches[0].pageY)}(t),d=f.TOUCH_PAN;break;default:d=f.NONE}d!==f.NONE&&c.dispatchEvent(l)}}function V(t){if(!1!==c.enabled)switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:if(!1===c.enableRotate)return;if(d!==f.TOUCH_ROTATE)return;!function(t){b.set(t.touches[0].pageX,t.touches[0].pageY),w.subVectors(b,_);var e=c.domElement===document?c.domElement.body:c.domElement;P(2*Math.PI*w.x/e.clientWidth*c.rotateSpeed),C(2*Math.PI*w.y/e.clientHeight*c.rotateSpeed),_.copy(b),c.update()}(t);break;case 2:if(!1===c.enableZoom)return;if(d!==f.TOUCH_DOLLY)return;!function(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);A.set(0,r),R.subVectors(A,S),R.y>0?F(L()):R.y<0&&D(L()),S.copy(A),c.update()}(t);break;case 3:if(!1===c.enablePan)return;if(d!==f.TOUCH_PAN)return;!function(t){E.set(t.touches[0].pageX,t.touches[0].pageY),T.subVectors(E,M),N(T.x,T.y),M.copy(E),c.update()}(t);break;default:d=f.NONE}}function W(t){!1!==c.enabled&&(c.dispatchEvent(h),d=f.NONE)}function X(t){!1!==c.enabled&&t.preventDefault()}c.domElement.addEventListener("contextmenu",X,!1),c.domElement.addEventListener("mousedown",B,!1),c.domElement.addEventListener("wheel",H,!1),c.domElement.addEventListener("touchstart",j,!1),c.domElement.addEventListener("touchend",W,!1),c.domElement.addEventListener("touchmove",V,!1),window.addEventListener("keydown",k,!1),this.update()},r.OrbitControls.prototype=Object.create(r.EventDispatcher.prototype),r.OrbitControls.prototype.constructor=r.OrbitControls,Object.defineProperties(r.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(t){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!t}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(t){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!t}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(t){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!t}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(t){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!t}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(t){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=t}}})}]);